Engineering question
How many usable counts does a quadrature encoder produce, and should the PLC be configured for X1, X2 or X4 decoding?
An incremental quadrature encoder normally provides two square-wave channels, A and B, displaced by 90 electrical degrees. The nameplate PPR usually describes pulses per revolution on one channel, while a PLC high-speed counter may count one, two or all four edges. Confusing pulses with decoded counts produces a scale error of two or four even when the mechanics are perfect.
The decoding choice is not a free accuracy upgrade. Higher edge counts improve theoretical position resolution, but they also increase the input frequency, expose more electrical noise edges and require a counter mode that preserves direction correctly. The encoder data sheet and the PLC high-speed-counter manual must therefore be read together.
Calculation basis
Formulas and units
Decoded counts per encoder revolution
Counts/rev = PPR × decode factor
Use 1, 2 or 4 only when the counter mode actually implements X1, X2 or X4 edge decoding.
Input edge frequency
fcount = PPR × decode factor × RPM / 60
Compare the worst-case value, including overspeed, with the PLC input and counter-channel limits.
Linear resolution
mm/count = πD / (PPR × decode factor × gear factor)
D is effective measuring-wheel diameter and gear factor is encoder revolutions per wheel revolution.
Worked example
Apply the formula
A 1024 PPR encoder runs at 1500 RPM and the counter uses X4 decoding.
- 1Decoded counts/rev = 1024 × 4 = 4096.
- 2Input edge frequency = 4096 × 1500 / 60 = 102,400 Hz.
- 3The selected input must therefore accept more than 102.4 kHz with suitable margin.
Result: X4 provides 4096 counts per encoder revolution, but it is unsuitable if the complete input path cannot reliably capture the resulting frequency.
Open Encoder Length & Pulse CalculatorChoosing a decode mode
X1 is often adequate for speed or long-travel measurement and has the lowest pulse-rate demand. X2 counts two edges of one channel. X4 counts rising and falling edges of both channels and gives the finest theoretical resolution. Direction-capable applications should use a supported A/B counter mode rather than improvised logic in the normal PLC scan.
- Check how the encoder manufacturer defines PPR, CPR and line count.
- Confirm whether the PLC specification quotes pulses or edges per second.
- Include maximum machine speed, overspeed and mechanical ratio.
- Use shielded cabling, correct grounding and the voltage/interface required by the input.
Commissioning checks
Mark the shaft or measuring roll, rotate it exactly one revolution at low speed, and compare the observed counter change with the predicted count. Then verify direction, rollover behaviour, reset logic and high-speed operation. A correct low-speed count does not prove that the channel is free from missed edges at production speed.
- Trend raw A/B status only at low speed; use the hardware counter value for production tests.
- Measure supply voltage at the encoder under load.
- Check differential line-driver termination where applicable.
- Document the signed-count and reset convention in the PLC functional description.
Common mistakes
- Entering 4096 as PPR for a 1024 PPR encoder and then applying X4 again
- Ignoring the counter input-frequency limit
- Counting A/B in the normal PLC scan
- Reversing one channel and masking direction errors with a software sign change
Troubleshooting checks
- Exactly 2× or 4× scale error: compare nameplate PPR with the configured decoding factor.
- Correct at low speed but short at high speed: check input frequency, signal levels and cable waveform.
- Count jitters while stopped: inspect shielding, grounding, input threshold and loose coupling.
- Direction reverses intermittently: inspect A/B phase integrity and counter mode.
Assumptions
- Incremental quadrature encoder with clean A/B signals
- PPR refers to one-channel pulses per revolution
- Mechanical ratio remains constant
Limitations
- Decoded count resolution is not the same as mechanical accuracy
- Backlash, wheel slip, runout, cable noise and counter latency are excluded
- Absolute and serial encoders require a different treatment
Topic cluster
