Guide
Encoder X1/X2/X4 Decoding: Exactly 1, 2, or 4
Effective counts equal PPR times mode; anything else raises the mode flag.
For an incremental quadrature encoder, X1, X2, and X4 decoding produce one, two, or four counts per A-channel cycle. If the encoder specification defines 1024 PPR as 1024 complete cycles per channel per shaft revolution, X4 decoding produces 4096 counts per revolution. That corresponds to a nominal angular increment of 0.087890625°, or approximately 316.4 arcseconds per count—not a guarantee of angular accuracy. The decoding multiplier applies in the receiving counter or controller, not as an increase in the encoder’s physical output cycles.
What X1, X2, and X4 Actually Count
A quadrature encoder provides A and B signals with a nominal 90-electrical-degree phase separation. Their sequence lets a quadrature decoder determine direction; the selected decoding mode determines how many count updates occur per complete signal cycle.
| Decoding mode | Counted events | Counts per complete A-channel cycle |
|---|---|---|
| X1 | One selected A-channel edge per cycle, according to the decoder’s direction logic | 1 |
| X2 | Rising and falling edges of channel A | 2 |
| X4 | Rising and falling edges of both channels A and B | 4 |
These modes are described in the NI-9361 Incremental Encoder Measurements documentation. In that implementation, X1 increments on A’s rising edge when A leads B and decrements on A’s falling edge when B leads A. Check the actual receiver manual for supported modes and direction conventions rather than assuming that a particular shaft direction is always positive.
PPR must mean complete cycles per channel per encoder-shaft revolution before you apply the multiplier. Do not rely on abbreviations such as PPR or CPR alone: determine whether the stated resolution is an encoder output-cycle count or an already-decoded count. Dynapar explicitly distinguishes quadrature output from the controller’s X4 multiplication.
If a configuration field expects already-decoded counts per revolution, enter the multiplied value once. If it expects base encoder cycles and has a separate decoding-mode setting, supply those separately.
Calculate Counts per Revolution and Angular Resolution
For direct measurement of the encoder shaft:
[
C=P\times M
]
[
\Delta\theta=\frac{360^\circ}{C}
]
[
\Delta\theta_{\text{arcsec}}=\frac{1{,}296{,}000}{C}
]
Where:
- (P) = complete A-channel cycles per encoder-shaft revolution, in cycles/rev.
- (M) = decoding multiplier: 1, 2, or 4, dimensionless.
- (C) = decoded counts per encoder-shaft revolution, in counts/rev.
- (\Delta\theta) = nominal angular increment, in degrees/count.
- (\Delta\theta_{\text{arcsec}}) = nominal angular increment, in arcseconds/count.
The count multiplier follows the documented decoding modes; the angular increment divides one complete revolution by the resulting count total. Dynapar describes the same relationship between the number of positions per revolution and the angular increment.
Worked Example: 1024 Cycles per Revolution
Assume the encoder produces 1024 complete A-channel cycles per shaft revolution, with no gearing, electronic scaling, missed counts, or counter resets.
| Mode | Calculation | Decoded counts/rev | Degrees/count | Arcseconds/count |
|---|---|---|---|---|
| X1 | (1024\times1) | 1024 | 0.3515625 | 1265.625 |
| X2 | (1024\times2) | 2048 | 0.17578125 | 632.8125 |
| X4 | (1024\times4) | 4096 | 0.087890625 | 316.40625 |
The table shows exact arithmetic values for these inputs. For practical reporting, the X4 increment may be rounded to 0.08789°/count or 316.4 arcseconds/count. Retain the unrounded value in subsequent calculations.
X4 gives a smaller nominal count increment than X1, but that increment is not an accuracy specification. The division alone does not establish actual transition locations, encoder accuracy, mounting error, or measurement uncertainty.
Check Angle Scaling and Avoid a Fourfold Error
For an unwrapped angular displacement:
[
\theta=\frac{\Delta N}{C}\times360^\circ
]
Where (\Delta N) is the signed count change in counts, (C) is decoded counts/rev, and (\theta) is displacement in degrees. This assumes the count difference has been corrected for any counter rollover and has not been interrupted by a reset or index reload.
Using the 1024-cycle encoder in X4 mode, (C=4096):
| Signed count change | Calculated displacement |
|---|---|
| 0 | 0° |
| +1024 | +90° |
| +2048 | +180° |
| +4096 | +360° |
| −4096 | −360° |
The reverse calculation also gives (180^\circ\times4096/360^\circ=2048) counts. These are unwrapped displacements: a single-turn display may show 0° again after a complete revolution.
What Happens When the Multiplier Is Wrong
Suppose the hardware counts in X4, but downstream software uses 1024 counts/rev instead of 4096. One actual encoder revolution produces 4096 counts, so the software reports:
[
\theta_{\text{reported}}
=\frac{4096}{1024}\times360^\circ
=1440^\circ
]
The displayed travel is four times the actual encoder-shaft travel. The opposite mismatch—hardware X1 with software expecting 4096 counts/rev—reports only 90° for one actual revolution.
A factor-of-two or factor-of-four discrepancy is therefore a reason to inspect decoding and scaling together, not proof that the encoder itself is faulty.
Account for Gearing Separately
If the encoder is not mounted directly on the measured shaft, define:
[
G=\frac{\text{encoder revolutions}}{\text{measured-shaft revolution}}
]
Then the effective counts per measured-shaft revolution are:
[
C_{\text{shaft}}=P M G
]
State the ratio in this direction explicitly; an unexplained “gear ratio” can lead to an inverted calculation. This relationship assumes a fixed ratio without slip and does not account for backlash.
Distinguish Channel Frequency from Decoded Count Rate
Changing decoding mode changes the decoded count rate, not the encoder’s A-channel cycle frequency at a given shaft speed. Dynapar’s encoder resolution guidance identifies encoder operating frequency and shaft speed as linked selection constraints. Receiver limits must also be interpreted according to the particular input specification.
For encoder-shaft speed (n):
[
f_A=\frac{P n}{60}
]
[
r_C=\frac{P M n}{60}
]
Where:
- (n) = encoder-shaft speed, in revolutions per minute.
- (f_A) = A-channel cycle frequency, in Hz.
- (r_C) = decoded count rate during steady one-direction rotation, in counts/s.
For (P=1024), (M=4), and (n=1500) rpm:
[
f_A=\frac{1024\times1500}{60}=25{,}600\text{ Hz}
]
[
r_C=\frac{1024\times4\times1500}{60}=102{,}400\text{ counts/s}
]
The receiver therefore sees a 25.6 kHz A-channel signal while producing 102.4 thousand decoded counts per second.
If a hypothetical receiver specification explicitly limits decoded count rate to 100,000 counts/s, its corresponding arithmetic speed ceiling would be:
[
n_{\max}=\frac{60r_{C,\max}}{PM}
=\frac{60\times100{,}000}{1024\times4}
\approx1464.84\text{ rpm}
]
That value is an illustrative calculation, not a specification for a particular device or a recommended operating speed.
Do not substitute an input-frequency rating into this count-rate formula unless the manual defines it on that basis. A per-channel cycle-frequency limit instead uses (n_{\max}=60f_{A,\max}/P). Check the encoder’s output-frequency and mechanical-speed limits, the receiver’s applicable quadrature-mode limits, and any pulse-width or input-filter requirements. The counter is not necessarily the limiting component.
Verify the Configuration with a Known Rotation
Use a controlled rotation check only when the equipment can be moved safely under the applicable site procedure.
- Record the encoder model and its cycles-per-revolution definition.
- Read the active receiver mode, not just the available modes listed in its datasheet.
- Use the raw decoded counter before downstream engineering-unit scaling.
- Identify any index reload, automatic reset, counter rollover, or electronic scaling that could alter the count difference.
- Rotate the encoder shaft through a known number of complete revolutions and record the signed count change.
- Repeat in reverse to check the configured direction convention.
Index behavior matters: on the NI-9361, for example, channel Z can reload the counter with a configured value at a selected quadrature phase. A count difference spanning that reload cannot be interpreted as uninterrupted travel without accounting for it.
For (R) known encoder revolutions, calculate an observed multiplier:
[
M_{\text{observed}}=\frac{|\Delta N|}{P R}
]
Here, (R) is the positive number of complete encoder-shaft revolutions, and (|\Delta N|) is the magnitude of the net raw count change. With a correct cycle definition and uninterrupted counting, values near 1, 2, or 4 are consistent with X1, X2, or X4 respectively.
“Near” is not a universal pass threshold. For an ideal, exactly indexed one-revolution comparison, the expected count is (PM); a manual shaft-mark check also has endpoint-positioning uncertainty. Establish the allowable discrepancy from the rotation reference, count capture method, and applicable procedure rather than inventing a percentage tolerance.
A different ratio calls for investigation of the pulse definition, actual rotation, gearing, scaling, resets, or signal capture. It does not by itself identify the cause. Likewise, a ratio of exactly 4 does not prove that no errors occurred during the movement. A calculator or software flag can check arithmetic consistency only within its documented inputs and logic; it cannot establish the physical decoder configuration from multiplication alone.
Configuration Checklist
- Confirm that the encoder provides A/B quadrature signals and that the receiver is configured for quadrature decoding.
- Establish whether the stated resolution means cycles/rev or already-decoded counts/rev.
- Match the downstream count scale to the active X1, X2, or X4 mode without multiplying twice.
- Keep encoder-shaft quantities separate from measured-shaft quantities when gearing is present.
- Distinguish channel cycle frequency from decoded counts per second when checking limits.
- Account for index reloads, resets, and rollover before interpreting count differences.
- Treat a known-rotation comparison as a configuration check, not a certificate of angular accuracy, calibration acceptance, or safety-function performance.
Formulas
Counts and speed
CPR=PPR*mode; RPM=f*60/CPRMode is exactly 1, 2, or 4.
Worked example
Encoder Pulses to Angle worked example (typ)
Inputs: ppr=1024.0, mode_x=4.0, pulses=4096.0
Calculation: angle=360.0, revs=1.0, rad=6.2832, eff=4096.0, res_arcsec=316.41, mode_ok=1
Lesson:
Frequently asked questions
What is the most common mistake on Encoder Pulses to Angle?
Skipping the verify items: set nameplate values first, then read every flag.
What is the most common mistake on Encoder Pulses to Angle?
Skipping the verify items: set nameplate values first, then read every flag.
Sources and further verification
- Encoder Pulses to Angle calculator SenseCalc
- Encoder Frequency to RPM calculator SenseCalc
Next step
Run the Encoder Pulses to Angle calculator
Related resources