Read RPM from Quadrature Encoder

Hi Everyone,
I wish to measure the RPM of a shaft using a quadrature encoder and a PCI-6259 card. I've seen a few examples on reading position, which i have managed to get working, but Im not sure on how to get RPM. Any tips or code examples would be greatly appreciated.
Thanks,
David

Hi All-
Thanks for the suggestion DJ, but your VI will not work as it is written using the Traditional (Legacy) NI-DAQ driver and David's M Series card is only compatible with the NI-DAQmx driver.
To answer David's question, it is not possible to directly measure position and count edges at the same time.  What you can do is count edges with external Up/Down control (basically the same as a X1 encoder) and then use the edge counting to calculate both frequency and displacement in ticks/degrees/RPM/etc.  I have attached an example I did recently that shows how to use an edge count with external Up/Down control (i.e. PFI10 or PFI11 for M Series ctr0 or ctr1, respectively) provided by the 'B' phase signal and the 'A' phase provided to the counter source.
Hopefully this helps-
Tom W
National Instruments
Attachments:
32bit_Cnt_Edges_to_Quad.vi ‏73 KB

Similar Messages

  • How can analog signals are measured every several counters from Quadrature Encoder using USB-6221

    how can I sample analog signals every counters from quadrature encoder using usb-6621?

    There is a well documented example of what you are trying to do at :
    http://zone.ni.com/devzone/explprog.nsf/webmain/DD85F07A7CA99F8F862568690062DE54?opendocument
    Don't be afraid because of the BNC-2120. It is just used in this example to simulate the pulses from a device. So it is not needed in your case. Obviously, you will need to change the number of increments/rev according to your encoder to get correct RPM values.

  • Reading Angles From a Line Driver Quadrature Encoder

    I currently have a Quadrature Encoder (Line Drive) and am trying to interface it with a PCI-6602 Counter/Timer Card. I have currently had no luck in correctly hooking it up and reading the angle. Past experience with Quadrature Encoder have all been open collector; I have been able to to successfully hook up an open collector encoder with the 6602.
    Any help in hooking up the Line Driver encoder with the PCI6602 would be appreciated.
    Thanks.

    Justin,
    Normally, the mfgr. would include a recommended "Line Receiver" interface circuit for the encoder. I've found that some line-driver encoders actually can be successfully connected directly to the 6602 for quick-and-dirty testing, though you wouldn't want to wire that up arbirtrarily or rely on it for the long term. In any event, it sounds like you'll need to add a line receiver interface.
    -Kevin P.

  • RPM Measurement using Quadrature Encoder and PXI 6602 counter

    Hi,
    I am on a project at work where I need to verify the speed (in RPM) of an unloaded motor which can operate up to 1400 rpm.  After doing some research, i determined that a quadrature encoder could be used to make the measurement.  I am looking at this encoder  http://sine.ni.com/nips/cds/view/p/lang/en/nid/205321.
    I have a PXI 6602 counter/timer module in which I would like to interface to the quadrature encoder.  I would like to create a VI that allows me to calculate the speed using the encoder.  Can someone provide me with details of what needs to be in the VI or an example which can do this?  At the most basic level, i want to calculate the speed on demand.  After doing this, i would like to figure out how to quickly calculate the speed so that i can determine response time of the speed changing within sub-millisecond resolution (1 ms resolution max).
    Further, i created a VI that allows me to change the pulse width of a 100 Hz pulse train at run-time which tells the motor controller the desired speed.  I would like to be able to use this VI to change the speed of the motor and the first VI (that I am seeking help about) to calculate the response time (time between the initial speed and settling at the new setpoint).
    I am familiar with the NI example finder, but have not been able to find an example that I can use.
    Thanks,
    Gary

    Hey Gary,
    I think for you setup, you should try using the Meas Dig Frequency - Low Freq 1 ctr. You can find it by searching example finder with 'low freq'. This vi tells you the frequency of a digital signal by sampling between two pulses and inverting the time between pulses. If you hook up your encoder to a counter and have that counter specified in the vi, it will be able to give you on demand readings of frequency (you can do some multiplication to get the rpm value, freq*60/pulses per revolution of encoder). A simple way to take continuous readings is to put a while loop around the daqmx read and the data output of the read. You can also replace the numeric indicator to a waveform chart to graphically display the change of frequency or rpm readings over time.
    You should be able to integrate this as two separate tasks with the pulse train vi you created earlier.
    Hope this helps
    Luke W

  • Generate a pulse train using a count from a quadrature encoder as the clock

    I am trying to generate a pulse train with the same frequency as my quadrature encoder.  Every time the encoder counts, I want the pulse to go high until the next count and then go low and so on.  I am using a 6602 PCI card and a BNC 2121 accessory.

    Maybe I'm not understanding your app, but I *think* you and I are approaching it from two very different directions.
    As I understand it, you'd like to emit a pulse with each quad state change.  Then that pulse would act as a counter Source signal.  The counter will then increment on each pulse, to keep track of accumulated position.  Further, you'd use your device-under-test (DUT) as a counter Gate signal, which would buffer the position count each time there's a rising edge on your DUT.  The end result is a buffer of position values, captured at each rising edge of your DUT.
    I'm talking about a different approach to produce the same data.  You'd use 2 tasks on a M-series board.  One of them is a hardware-timed digital input task based on "change detection."  Each time one of the specified bits has a transition, your whole set of digital input bits can be captured and an internal "change detect pulse" is generated on the board.  This task should be sensitive to the DUT edges.
    The other task would be a buffered position measurement.  It would receive the reference encoder inputs and internally do quad decode and keep a running count.  The sampling clock for this task would be specified as the other task's "change detect pulse."
    Net result: on each specified edge of your DUT, you'll buffer a reference encoder position value and a digital state of your DUT.  You can choose to be sensitive to rising edges, falling edges, or (!!!!) both at once. You can also choose to be sensitive to many bits simultaneously.  These are better capabilities than you get with the 6602 alone.
    I *think* the 6220 should be ok, based on a quick overview of specs.  I assume your 3.6 MHz is the rate of ref encoder quad state changes, right?  In the approach I'm suggesting, you only need concern yourself with the rate of DUT edges which appear to be in the 10's of kHz or less.
    Gotta go for now.  Post back if any further questions.
    -Kevin P.

  • How reading Rpm speed from fp quad 510

    I have an encoder of 2500 ppm quadrature differential signal, and i link
    this with a FP_quad_510
    The value reading count/microsec how is possible to transform in RPM?
    Why if i use the FP configurator in the edit device/channel if i setting a
    range of -1,25_1,25 coerce the value range at the default range setting?
    Courtesly i would like information of field point quadrature encoder end
    reading position,speed,reset on the revolution exc.
    Thank for answer Nicola

    Thank's for answer,
    Now i have try to coerce the 1,25 range and i select customer value.This
    mode bring the 1,25 range.
    Nic
    "Pravin B" ha scritto nel messaggio
    news:[email protected]..
    > Nicola,
    > As for converting the count/us into a RPM reading,you will have to do
    > it inside your software program. It's gonna depend on the
    > counts/revolution on your quad encoder. You can then mathematically
    > calculate the RPM and display that on your panel.
    > Ex: 'count/us value' / (1,000,000*60) = counts/min
    > > 'counts/min' / (counts/rev of your encoder) = RPM
    >
    > I am unable to follow the second question but if you mean that your
    > count values coerce when set to +_ 1.25 velocity range setting, it
    > could probably be
    becuase the velocity resolution at that range is
    > 38.15 counts/s and so you may not be able to see smaller counts.
    >
    > You can find more information about the position counters, velocity
    > measurement(speed), index status etc in the FP QUAD-510 Operating
    > Instructions Manual at : http://www.ni.com/pdf/manuals/322633b.pdf
    >
    > To program the QUAD-510 'Reset', right click on the FP-QUAD-510 @x and
    > choose Edit This Device. Then click on Channel Configuration. In the
    > Channel Commands box, press the button that says Create Item. This
    > will create a channel named "Control @Ch0". You can then write to the
    > "Control @Ch0" item as if it was a normal output. Anytime in your code
    > that you write a value of 1 to the "Control @Ch0" item, it will reset
    > Axis 0 (channels 0 and 4). To change which channel you are resetting,
    > simply change the checkboxes before pressing the Create Item button.
    >
    > Hope this helps,
    > Pravin

  • Speeding up quadrature encoder read out

    Hi,
    I`m using a quadrature encoder together with a 6259 DAQ Card and BNC2110 Terminal Block.
    I managed to have it working with the DAQ-Assistent at 80Mhz using the Counters and reading one value at a time. Before the DAQ-Assistent I used a DAQmx command to connect PFI10 and PFI9 as the BNC2110 Terminal only outputs PFI0-9. This works but it is really slow, the distance between each measurement point is around 6 us. The VI is in the attachement (AquadB_one_value.vi)
    So I thought I might use the n-values version with the DAQ-Assistent but this does not work and I dont see any reason why, it is complaining about that connection between PFI10 and PFI9 which it didnt do before in the one-value-version. The VI is also in the attachement (AquadB_n_values.vi)
    I also tried another method using a VI I was given some time ago and modified it but here the distance between each measurement point is also around 6us. This VI is also in the attachement (Counter - Read Encoder.vi)
    Or am I missunderstanding something? The minimum achievable time distance between measurement points should be 1/80.000.000 s where of course the value can only differ 1/0/-1 because it has only calculated one new change in the A and B Signals right? I thought with using the n-values it is storing all the calculated values in the memory and I am transferring them afterwards for doing all the "post-processing"?
    If I am wrong, how can I spped up the read-out of the calculated values any other way?
    Best regards
    Attachments:
    AquadB_n_values.vi ‏56 KB
    AquadB_one_value.vi ‏49 KB
    Counter - Read Encoder.vi ‏98 KB

    Hi Dani_munich,
    I just realized that you asked the same question in our Service request. In the service request, I was missing out more information which I found them here by chance . I will further assist you in the SRQ you have created. I also sent you an email.
    Regard
    Anoj
    Anoj Mubarak
    National Instruments

  • Quadrature encoder read

    Hi.
    I'm a new user to labview, so try to be as soft as possible.
    I want to control an electric motor(24v, 3I) via labview.
    I use labview 6i(budget,budget) and a pci6024e board.
    I have a quadrature encoder connected to the motor and I've build
    the pid vi to control it.
    1.what is the best way to connect the encoder?
    i have tried to use software counters, with no luck so far.
    2. I need to find a way to build a vi that can give me the response of a known transfer function to a pulse.is there a vi example or do I need to build it by solving the DE?
    Thank you
    ran

    Hi Ran,
    There are a few examples of either counting digital pulses on your quadrature encoder, or measuring the revolution frequency (frequency measurement). Depending on your application you will need to connect your device to your E series card to either the gate (frequency, period and time measurements) or the source (simple event counting) of the counters. These are decribed clearly in the E Series Help File. http://digital.ni.com/manuals.nsf/websearch/0E0DFDBB7706687A86256F6300560584?OpenDocument&node=10968_US
    In addition, we have a few examples and tutorials on this website. You can simply make quick searches with the few key words i have just mentionned.
    You also have to make sure that the signal coming out of your encoder is in the appropriate format (5V digital). In some cases, you would need a voltage divider.
    As for the second question, I would need some clarification. You can definately process the information you have acquired in any way you want. You can search for our VIs by selecting the search button in the function pallette. Most data processing VIs are for analog signals.
    Best regards,
    Nathan Yang
    Applications Engineer
    National Instruments

  • How do I use a quadrature encoder as an external clock (PCI 6229)

    Hello, ( a similar post has been placed on DAQ forum apologies as I did not know best place)
    I have a PCI 6229 M Series data acquisition card. I want to use a quadrature encoder to be the external clock driving the acquisition of a number of signals. I have set up reading 24 signals each time a clock pulse is received using the DAQ assistant and set my external clock to pin pfi8 (I think) this is then connected to an encoder output. This works well enough until the encoder is run too fast when it appears I am either missing pulses or getting bounce.
    How can I set up to clock using a quadrature encoder? I have seen a number of questions on this forum regarding quadrature encoders and reverse counting but not on using them as an external clock.
    Basically I want to have the stability and "bounceless" nature of using two outputs from a quadrature encoder whilst still using an external clock. Is this just a case of configuring controls to certain pfi's? If so how is it done?
    Any help or pointers would be helpful. So far I have managed very nicely by simply using the DAQ assistant and the interface it has would suggest that if configured for a certain pfi pin I could actually still use it.
    Thanks in advance.
    Kevin

    Hi,
    Well I've had alook into this for you and I'm not quite sure I understand what you are looking for.
    Is it possible for you to phone back in to support?
    The reason you are seeing bounce at high speeds, or indeed loss of points, is due to the sampling rate that you have set up.
    What you will find is that the trigger will start an aquisition of a number of points at a certain rate.  If your sampling rate is too low then you will not finish that sample batch before the next set of samples is recorded.
    It is possible to use an external clock into a trigger or digital line, however this will limit the number of samples you can take to the speed of your encoder.
    If you increase your sampling rates, and then configure a start trigger from a single input from the encoder you will be able to record a number of samples after a rising/falling edge.  (Set the clock as an internal clock)
    Hope this helps
    AdamB
    Applications Engineering Team Leader | National Instruments | UK & Ireland

  • Can I use the 'Export Signal Property Node' on a quadrature encoder?

    Hi,
    So I don't know which counter board I'd be using yet for this (it's used in conjunction with a PCI-6280--the PCI-6280's counter inputs are all taken and so I need another board), but assuming this is possible at all in DAQmx I wouldn't mind knowing whether, say, the PCI-6601 (or any other timer board for that matter) could do this. I'm programming this in LabVIEW 2010 by the way. 
    I want to have a counter which counts the number of pulses on one channel (I'll call this the 'clock' channel) between when another channel goes from low to high (which I'll call the trigger). It's basically a pulse width measurement, but I only care if there are more than n clock pulses between triggers. I need to have a hardware-timed digital signal which goes from low to high if there are ever more than n pulses between trigger changing state from low to high. 
    What I am planning to do is this: 
    Wire 'trigger' to the z-input of the quadrature encoder, and set the z-input value to some arbitrary large value such that, at the quadrature encoder counter task's settings, the counter reaches terminal count in n pulses.
    Configure the quadrature encoder counter using DAQmx Export Signal Property Node (tutorial I was looking at is here: http://zone.ni.com/devzone/cda/tut/p/id/5387 ) to toggle a digital channel ('counter event output') from low to high if the counter reaches terminal count (ie, if the encoder reads n pulses).
    If the encoder ever reads n pulses on 'clock' between two rising pulses on 'trigger', it sets counter event output high.
    Is this possible? Reading through the manual of M series PCI-62xx devices, the index pulse loads the counter with a particular value so it seems like you could conceivably set the counter to the terminal count if you wanted. My only real problem is whether DAQmx Export Signal Property Node works on all counter tasks or just on edge counting tasks. 
    Thanks in advance for your help. If this isn't possible, I can reply with more details on the problem this is supposed to solve so that you can help me figure out an alternate method.
    Solved!
    Go to Solution.

    There is probably a way to do it, but it it may be easier to use an X-series board for the job.   They support a new counter capability for count reset on a digital edge without needing to be configured in encoder position mode.  I am not sure exactly how that feature's been implemented however, so maybe it won't make things easier after all.
    The plan based on the hoped-for behavior: 
    1. Configure an X-series counter for pulse generation based on "ticks" of your clock channel.
    2. Set both initial delay and low time to the critical # of ticks.
    3. Configure for count reset on a digital edge (if possible in pulse generation mode)
    4. Configure the count reset value to be the critical # (or possibly 1 less, if possible in pulse generation mode)
    5. If you want the output to remain high indefinitely, configure the counter task to use its own output as a
    pause trigger, and pause while high.
    The way pulse generation works is to preload a # of "low time" ticks into the count register.  Then every source edge will decrement the count.  When the count reaches terminal count (0), the counter's output is toggled (or can be configured to pulse).  The register is then loaded with the # of "high time" ticks and the process continues.
    You would be perpetually interrupting the count-down process as long as you got your triggers in time.  The count would keep getting reset to the # of low counts, keep decrementing toward 0 without reaching it, and so on.  If ever you did reach 0, the output state would toggle high, then the high state would prevent subsequent clock signals from decrementing the count.
    You can conceivably do a similar thing with a 6601, but I'm pretty sure you'd need 2 counters working together to get it working.
    -Kevin P

  • Simulate quadrature encoder output without hardware

    I am brand new to Labview and have not had any training other than youtube and this fine forum. I am a mechanic trying to solve a problem using labview. I am posting this new question because I don’t have any hardware so I can’t use the examples I’ve seen others pointing to.
    I’m trying to simulate the output of a quadrature rotary encoder. Once I have done that I want to use Labview to program an instrument that reads that signal and makes mathematical calculations to it but I need the signal first. The encoder will attach to a shaft that will rotate clockwise and then counterclockwise at a rate of about 122 times a minute.  The total shaft rotation will be between 0 - 18 degrees. It is important to me to know the direction of the shaft. The quadrature encoder will send out 2 square waves with one wave behind the other. The way I’ve tried to do this is by using 2 Simulate Signal modules each sending out a square wave at 2 Hz. I’ve connected a single knob controller to the both frequency inputs of the signal modules to simulate the speed the shaft rotates back and forth. I’ve done the exact same thing to the amplitude input to simulate the degrees the shaft turns before changing directions. My problem is the changing directions. I can delay the phase, which is what I want to do, but I can’t do it in real time and I can’t do it in a single 180 degree step. What I would like is a switch to change the B channel from +90 to -90 when it is toggled. If I could then toggle the switch when the amplitude reaches 18 degrees or less I will have an encoder signal. Thanks for any help you can provide.
    steve
    Attachments:
    Rotory Encoder.vi ‏59 KB

    Steve,
    From what I understand, you want to make a 180 degree phase shift every N intervals?  I modified your code to do this.  Let me know if that gets at what you are doing.
    Cheers,
    Chris LS
    National Instruments
    Applications Engineer
    Visit ni.com/gettingstarted for step-by-step help in setting up your system.
    Attachments:
    Rotory EncoderEdit.vi ‏61 KB

  • Troulbe in measuremen​t quadrature encoder with 6601

    Hi,
    Thanks for Ross's help.But I cannot differ 6601's x4 mode from other counter/timer counting mode. In measurement position, what difference between them. And I just want to know whether my application viable.
    We are trying to measure position with 6601. The frequency of quadrature encoder is from 100Hz to 8MHz. Now, we connet the A,B and Z channel directly to counter . Using the example in CVI, we change the filter to 100ns and use x4 mode. It works perfect at low frequency.
    The problem is when the frequency of encoder is higher than 2MHz, the accuracy decreases greatly. I'd like to know about following:
    1.Can 6601 do the previous task enough? Or I must change to use 6602.
    2.If
    6601 is available, is there any way to increase measurement accuracy ?(in software or wire connection )

    >jimmyjimmy2000
    "Hi,
    Thanks for Ross's help.But I cannot differ 6601's x4 mode from other counter/timer counting mode. In measurement position, what difference between them. And I just want to know whether my application viable.
    >>mross>The application is viable. However, the use may be difficult.
    >jimmyjimmy2000
    We are trying to measure position with 6601. The frequency of quadrature encoder is from 100Hz to 8MHz. Now, we connet the A,B and Z channel directly to counter . Using the example in CVI, we change the filter to 100ns and use x4 mode. It works perfect at low frequency.
    The problem is when the frequency of encoder is higher than 2MHz, the accuracy decreases greatly. I'd like to know about following:
    1.Can 6601 do the previous task enough? Or I must change to use 6602.
    >>mross>The 6601 is just as good as the 6602 at 2MHz. Therefore, a 6602 will have the same problem of inaccuracy.
    >jimmyjimmy2000
    2.If 6601 is available, is there any way to increase measurement accuracy ?(in software or wire connection )"
    >>mross>Yes, in the wire connection you can make improvements.
    6601 can count as fast as 20MHz (60MHz with prescaling). The signal is noisy (containing addtional, incorrect information).
    You must use an oscillosope to look at the signal. Look at it when 6601 is counting correctly, and look at it when 6601 is "malfunctioning".
    The counter will increment whenever the signal is high for more than 5 nanoseconds. The conditions for "High" and "Low" signals must be strictly met. If the signal is greater than 0.8V, the counter may increment. The signal must then drop below 2 Volts for a "Low" to be seen.
    This sounds wrong, but is true. The counter is expecting TTL signal conditions (Transistor -Transistor Logic). This specification is very broad.
    A "High" will absolutely be recognised if the signal is greater than 2.0V.
    A "Low" will absolutely be recognised if the signal is less than 0.8 V.
    However, the range from 0.8V to 2.0V is "undefined." This means the counter could increment at 0.8V. It has been my experience that National Instruments TTL will always see 0.8V as a "High." If your noise exceeds 0.8V you will never be able to count accurately.
    The problem will be solved when your encoder signal is read cleanly by the 6601. This is why I gave you the URL for US Digital in the previous answer. The circuits they sell can help to clean up the counter signals. You will have to see what works best, since I don't exactly understnad you application. If the noise is very bad, you may wish to use the Encoder to Binary Number circuit. There will be no noise in the reading of a binary number. Since your encoder may run as fast as 8MHz, you must be sure the circuit you choose is also this fast.
    The other solution is to eliminate the noise which is causing the counter to trigger falsely. THis can be a very interesting problem to solve. Please look a this NI link:
    Field Wiring and Noise Considerations for Analog Signalsv
    http://zone.ni.com/devzone/conceptd.nsf/webmain/01​F147E156A1BE15862568650057DF15?opendocument
    Follow these instructions very carefully.
    Also, this book is helpful to explain noise and how one may reduce it.
    From Amazon.com you can get Grounding and Shielding Techniques, by Ralph Morrison.
    http://www.amazon.com/exec/obidos/ASIN/ 0471245186/104-3492923-2811911
    Be very careful how you wire the circuits. Try to use only one ground point.
    The worst source of noise can be the motor and drive that spins the encoder. Be particularly careful in wiring this apparatus. A simple solution can be to use an air powered motor insted of an electric motor.
    Good luck,
    Mike Ross

  • 6602 quadrature encoder with c code

    I need to implement a quadrature encoder on the 6602 board usinng c language.
    I found some good function, for example  DAQmxBaseCreateCIAngEncoderChan, but i think this function is only for DaqmxBase,
    is there some similar function for Daqmx, or have i to do it myself?
    From where can i start?
    Thank you in andvance
    There are 10 kinds of people. Those who understand binary notation, and those who do not.

    Solved my problem.
    I installed the daqmx version on CD and it was old.
    Now i installed the new version daqmx 9.0 , that i toke from the site.
    This version has the function i need  DAQmxCreateCIAngEncoderChan,
    it compiles , now i have only to attach my encoder.
    Thank you lo stesso
    Message Edited by blacksocket on 02-08-2010 05:32 AM
    There are 10 kinds of people. Those who understand binary notation, and those who do not.

  • Quadrature encoder, velocity

    Hi,
    I am using DAQ 6062E, with BNC 2120. I have a quadrature encoder, and I need to get the position, and velocity. I have modified BNC2120_Quadrature_Encoder vi from NI. I can compute the velocity (delta position/time loop) easily, however this is not very accurate. I need to have a high accuracy velocity, and I think I have to use the second counter to measure the frequency of channel. However, I am not able to calculate the velocity with this method. I have attached my vi. I appreciate if somebody can help.
    My encoder is connected to CTR Source 0 (PFI8), and UP_DOWN (P0.6)
    I have connected CTR Source 0 (PFI8) to CTR 1 Gate (PFI4)
    Thanks!
    Attachments:
    try encoder_with frequency.vi ‏58 KB

    I get reasonably accurate velocity from quad encoders by connecting the source of my counter to the internal 20MHz clock then gating said
    counter with my index pulse(Z) or either A or B, depending on the speed at which I am running. This will give you a count of time between
    revolutions if gating with Z, or it will yield time between X degrees if gating with A or B.

  • DAQmx Quadrature Encoder Initial Position

    Hello, 
    I am building an application that requires trackig the raw counts from a quadrature encoder connected to a NI USB-6212.  In order to count each rising and falling edge of both channel A and channel B, I have configured a DAQmx Linear Encoder Channel for 4X decoding with the units set to ticks.  In order to prevent the counter from rolling over when the ticks become negative, I convert the U32 value from DAQmx Read to I32.  So far this all works as expected.  I would additionaly leik to retain to position of the encoder if the VI is stopped but remains in memory.  For this reason I wire the value of the raw counts to a shift register which is read into the initial position input of the DAQmx Create Channel VI.  For some reason, the DAQmx Create Channel VI quadruples whatever value is wired to the inital position input.  I solve this by deviding the previous counts by 4 before writing to initial position.  However, the problem occours that if the value of the previous count was not an even multiple of 4, the inital position must be rounded to the nearest integer, causing the count to jump when restarting the VI.  How can I reset the inital postition to the exact value of the encoder at the end of the previous iteration?

    Yes, It does. In 1X decoding mode, the starting count equal to the supplied initial position, but then I only count 1/4 of the pulses I expect to see.  Perhaps I am misunderstanding the meaning of 'inital position'?

Maybe you are looking for