Troubleshooting
Why an incremental encoder counts wrong turns per revolution
Short answer
One measured revolution settles an incremental encoder turn-count fault: with 2,000-cycle channels decoded in x4 mode the raw counter must advance exactly 8,000 counts per shaft revolution, and at 300 rpm that stream arrives as 40,000 counts per second — fast enough to overflow a signed 16-bit register between resets. Measure the raw counter first; retuning the divisor to 6,810 only rescales the error.

On this page
- How many counts should one encoder revolution produce?
- What do I measure before changing the counts-per-turn setting?
- Which count pattern points to which fault?
- Is my encoder frequency too fast for the high-speed input?
- Why does the turn total go wrong near the register limit?
- Where does the Z channel go if the controller has no index input?
- Where should the encoder shield (FG) terminate?
- Do you need this much encoder resolution just to count turns?
- Which fix applies to each measurement result?
- Questions asked
An incremental encoder that reports the wrong number of turns almost never needs a new counts-per-turn setting — it needs one measurement. Turn the shaft exactly one revolution and read the raw high-speed counter difference before you touch any threshold or reset. With a 2,000-cycle encoder decoded in x4 mode, a clean revolution must advance the counter exactly 8,000 counts. If it does, the encoder and input are healthy and the fault lives in the turn logic, most often a signed 16-bit register that overflows past 32,767 between resets. If the counts come up short only as speed rises, the fault is at the input: pulse frequency, edge quality or filtering. Trimming the divisor — the classic symptom-driven retune — rescales the error without finding it. Every check below separates those cases.
How many counts should one encoder revolution produce? #
A 2,000-cycle encoder in x4 mode must produce exactly 8,000 counts per shaft revolution, because the decoder counts the rising and falling edge of channel A and the rising and falling edge of channel B — four counts per input cycle. Anything else means the capture or the rating interpretation is wrong.
x4 is a defined decoding rule: one count for each transition on each channel, with the transition order on A and B setting the direction. The Z channel contributes nothing to this figure — it is a single index pulse per revolution and never part of the decoded total.
Worked example, calculated for a shaft at 300 rpm and a rating read as 2,000 cycles per channel per revolution. These are computed values for these inputs, not a measured result:
- Shaft speed: 300 rpm ÷ 60 = 5 revolutions/s
- Raw channel frequency: 2,000 cycles/revolution × 5 revolutions/s = 10,000 cycles/s on each of A and B
- Decoded count rate: 10,000 cycles/s × 4 = 40,000 counts/s
- Counts per revolution: 40,000 counts/s × 0.2 s per revolution (1 ÷ 5) = 8,000 counts
Manufacturers do not share one convention for the number on the label: for some families it means complete cycles on one channel, for others it is already the decoded count. The one-revolution test in the next section settles which convention your encoder uses.
If you also need shaft speed from the same counter, calculating roller RPM from encoder HSC counts works through that conversion.
What do I measure before changing the counts-per-turn setting? #
Rotate the shaft exactly one full revolution, slowly and by hand, and read the raw high-speed counter difference. Exactly the expected counts per revolution clears the encoder and the input and puts the fault in the turn logic; a shortfall that grows with speed puts it in the capture path.
Disable or bypass the turn-counting logic for this test so nothing resets the register mid-turn. Note the raw count, rotate one measured turn — one full turn of the encoder shaft, not of the machine — and read again. Repeat at low speed and at the operating speed.
If the raw test passes at every speed, the divisor retune is concealment: setting it to 6,810 reduced the observed error only because the measurement was rescaled by about 14.9 percent, not because any fault was found or fixed. Leave the divisor at its calculated value and fix the logic or the input.
Which count pattern points to which fault? #
The pattern of the error — constant, speed-dependent, or present while standing still — separates a software fault from a capture fault more reliably than any single reading. Match what you observe against the four patterns below, cheapest to check first, and run that row's confirming check before replacing hardware.
- Exactly the expected raw counts at every speed, wrong turn total — the capture path is clean; the fault is in the software: threshold comparison, reset placement, direction handling or register overflow. Confirming check: watch the raw register through one full operating sequence and mark where the turn step fires.
- The same scale error at any speed — decoder mode set to x1 when the divisor assumes x4, or the reverse, or the label convention from the previous section. Confirming check: one slow measured revolution against the calculated counts per revolution.
- Correct at low speed, short at operating speed — the raw input frequency limit, distorted trapezoidal edges, or an input filter whose acceptance window swallows short pulses. Confirming check: probe channels A and B at the controller terminals while ramping speed up and watch where the count falls behind.
- Counts jump or drift while the shaft is stationary, or run backwards — noise pickup, an unterminated shield, or channels A and B swapped so direction inverts. Confirming check: bar the shaft by hand in a known direction and watch the count sign; if the wiring itself is under suspicion, wiring a TTL quadrature encoder to drive encoder terminals covers the channel assignments that make a quadrature pair count cleanly.
Is my encoder frequency too fast for the high-speed input? #
10,000 cycles per second is modest for a high-speed counter input: one manufacturer's counter module manual documents a 250 kHz maximum for x1 and x4 modes, and the deciding number is the raw input frequency in your exact controller's hardware manual — not a limit quoted for a different model.
The Rockwell ControlLogix high-speed counter module manual, publication 1756-UM007, documents that 250 kHz ceiling at 50 percent duty cycle with a 2 µs minimum pulse width — a figure for that module family, useful here mainly to show the order of magnitude a dedicated counter input handles.
Read your own manual for three things: whether the stated maximum is defined on raw cycles or on decoded counts (many manuals define it on raw cycles, which makes the decoded count rate a separate question), the minimum pulse width the input accepts, and any restriction the quadrature mode adds. Then size against the fastest speed the machine can actually reach — jog speed, overshoot after a commanded stop — not the setpoint. Running at the ceiling leaves no headroom, and rounded or trapezoidal edges can lose counts below the nominal limit, because the input needs a clean level crossing to register each transition.
Why does the turn total go wrong near the register limit? #
A signed 16-bit register holds a maximum of 32,767 counts, and at 40,000 counts per second an unreset register passes that ceiling in about 0.82 seconds — roughly four revolutions at 300 rpm — so a turn total read after the wrap goes wrong with no hardware fault anywhere.
That timing is what makes this fault hard to see: the register wraps several times per second at operating speed, and any logic that reads it late, or resets it in a scan separate from the turn increment, loses or double-counts a turn. Three fixes work, in order of preference:
- Reset the raw counter to zero inside the same step that increments the turn counter, so the register never approaches its ceiling.
- Accumulate turns in a register too wide to overflow within the job length — a 32-bit register holds over two billion counts.
- Count revolutions on the Z index instead, if the controller has a true index or capture input.
The reset-and-accumulate pattern is exactly what configuring a PLC revolution counter for bin turns walks through for a turn-counting application.
Where does the Z channel go if the controller has no index input? #
On controllers that expose only the two quadrature inputs, the Z conductor stays cut back and insulated: turns derived from A and B alone are already direction-aware, and Z adds only a once-per-revolution mark that a scanned input can miss between scans.
Z is a single pulse per revolution — an index, not a channel in the decoded count. It earns its connection only when the application needs an absolute mark within each revolution: a homing reference, a once-per-turn latch, or a drift check on the accumulated turn total. Using it requires an input that captures or interrupts on the pulse at operating speed; an ordinary scanned input samples every few milliseconds and can miss a short pulse entirely, so index-based homing through a standard input is no substitute for a dedicated index function. Check whether your controller's encoder mode provides one, and what pulse width it accepts at speed. Until then, cut the Z conductor back, insulate its end so it cannot short against a terminal, and count turns from A and B.
Where should the encoder shield (FG) terminate? #
Terminate the shield (FG) on the designated chassis or shield-ground terminal at the controller end, kept distinct from the encoder GND conductor, which is the supply and signal return and lands on the input-common terminal the wiring diagram shows.
Six conductors, four decisions: Vcc to a supply within the encoder's rated range, GND to the signal return the controller's wiring diagram names, A and B to the paired high-speed inputs the encoder mode requires, and shield (FG) to the shield or chassis ground terminal. The shield is a drain for coupled noise, not a current-carrying conductor: terminate it at the end your equipment guidance directs, insulate the far end, and never let shield current share the GND return. A missing or wrongly landed shield shows up as the stationary-jump pattern in the fault list — the same mechanism by which switching noise manufactures false counts on a pulsed input, covered in proximity switch noise causes false counter counts.
Before moving any of these conductors, isolate the encoder circuit and follow the machine's lockout practice; a shaft you can turn by hand can move drivetrain parts someone else assumes are stopped.
Do you need this much encoder resolution just to count turns? #
No: ten input cycles per revolution would count turns fine, roughly 200 times less counter traffic than the present setup, so keeping the high-resolution encoder is justified only when something also measures angle or position inside the turn.
Check the arithmetic: ten cycles per revolution with x4 decoding gives 40 counts per revolution, one two-hundredth of the current traffic — and register pressure, reset discipline and noise exposure all scale with that traffic. If turn counting is genuinely the only job and a low-resolution encoder is available, swapping is the honest fix. When the supplier situation pins you to the high-resolution unit, the design above — reset every turn, wide turn register, clean shield — runs it reliably, and the surplus resolution becomes spare headroom for a future measurement function.
Which fix applies to each measurement result? #
If one revolution reads exactly the expected count, fix the logic: reset the raw register inside the turn step and accumulate turns in a register that cannot overflow. If counts fall short only as speed rises, fix the input against your controller's documented raw frequency limit — never the threshold.
- Raw count correct at every speed — encoder, wiring and input are proven. Reset the raw register within the turn-increment step, hold turns in a wide register, and delete any scan-dependent read of the raw value.
- Raw count short, and the shortfall grows with speed — verify the exact controller's raw input frequency limit, minimum pulse width and filter settings from its own hardware manual, inspect edge quality at the terminals, and confirm the machine's true maximum speed. If the input cannot carry the raw rate with headroom, the encoder resolution is wrong for that input — not the threshold.
- Raw count off by the same factor at any speed — the decoder mode and the label convention disagree. Set the mode to match the rating you verified, and the divisor follows from arithmetic, not from the error you observed.
- Only turns are needed and the encoder is oversized — a low-resolution encoder is the correct replacement; if the present unit stays, the reset-every-turn logic above is the design, and the threshold stays at its calculated value.
Questions asked
Does x4 decoding make the electrical input work four times harder?
No. x4 decoding multiplies the register count rate, while each channel still delivers its raw cycle rate of 10,000 cycles per second at 300 rpm with this encoder. Compare that raw rate against the input frequency limit in your controller's manual. A few products also publish a separate decoded count-rate limit, and the 40,000 counts per second arriving in the register is the number to check against that one.
What does the pulse number printed on the encoder label actually count?
Conventions differ between manufacturers: for some encoder families the label number is complete cycles on one channel, which x4 decoding turns into four counts, and for others it is already the decoded total. The label alone cannot settle it. Rotate the shaft one measured revolution with the turn logic disabled: if the raw counter advances four times the label number, the rating meant cycles per channel; if it advances the label number, the rating was already decoded.
Can ordinary PLC inputs read these pulses instead of high-speed inputs?
Not at this speed. At 10,000 cycles per second each channel period is 100 microseconds, so a high or low level lasts about 50 microseconds and decoded transitions arrive every 25 microseconds. A controller scanned in milliseconds samples far too slowly to see that structure, so turn counting at 300 rpm needs the dedicated high-speed counter input no matter what the ladder logic does afterward.
What changes if the counter register is 32-bit instead of 16-bit?
The overflow ceiling moves from 32,767 counts to 2,147,483,647. At the decoded rate worked out earlier that is roughly 14.9 hours of continuous running at operating speed, so the fault can disappear for a whole shift and reappear days later. Plan the reset or rollover handling anyway: a turn total that depends on when the machine was last power-cycled is still a latent fault.