How-to
Scaling a 262144-count absolute encoder to 0-360 degrees
Short answer
Scale a 262144-count single-turn absolute encoder with angle_deg = raw × 360 / 262144, or enable module scaling at 360 for whole degrees or 3600 for tenths. A 360-unit scale changes only once per degree, so an apparent lag beside a drive position is usually quantization, not a sampling delay.

On this page
The number that matters is 262144 counts for one shaft revolution, which is 2^18. Convert it to an angle with angle_deg = raw × 360 / 262144, or enable scaling in the encoder module's configuration and enter 360 for whole-degree units or 3600 for 0.1-degree units. The reading is cyclic: it runs from 0 up to, but never including, 360, then rolls back to 0, because 0° and 360° are the same physical shaft position.
The conversion and the resolution it gives #
An absolute single-turn encoder represents one revolution as a finite set of angular states, and every position of the shaft has a unique code, as the overview of absolute versus incremental rotary encoders explains. With 262144 states, the raw range is 0 through 262143 and the native angular increment is:
360° / 262144 = 0.00137329° per count
At the last raw state the calculated angle is about 359.9986°, and the next count rolls to 0°. Expecting both 0 and 360 as separate endpoints adds a position the revolution does not contain.
Module scaling trades display increments for convenient units; it does not change the update rate. With a scaling value of 360 the expected states are 0 through 359, subject to the module's documented rounding convention. With 3600 the states are 0 through 3599, in tenths of a degree.
Why a 360 scale looks laggy beside a drive #
A value scaled to 360 changes only once per degree. A drive's actual position usually changes in much finer increments, so side by side the encoder reading appears to freeze and jump. At n rpm the shaft moves 6n degrees per second, so a one-degree reading changes about every 1/(6n) seconds. At 10 rpm that is one change every 0.0167 s, which looks like latency but is quantization.
Worked example, a calculated result for these inputs only: the shaft turns at 60 rpm and you trend the encoder against the drive's actual position in the same controller task. The angular speed is 6 × 60 = 360 degrees per second. You measure a separation of 3 degrees between the two readings at constant speed. The relative sampling delay is:
Δt = Δθ / (6n) = 3 / (6 × 60) = 3 / 360 = 0.0083 s
That is about 8.3 ms of genuine time difference, because 3 degrees is three full display steps of a 360 scale. If the separation had been under one degree, it would be hidden by the scale and you could not measure it at all.
Set the scaling in the controller project #
- Open the controller project and locate the encoder module in the project tree.
- Open its properties and go to the configuration tab.
- Enable scaling.
- Enter the output units for one revolution: 360 for whole degrees or 3600 for tenths of a degree. Choose from the smallest angle the application must detect, not from the text format you want to display.
- Accept the configuration and put the controller and module into the state needed to apply the change.
- Monitor the scaled input through one slow, complete revolution. Record the first value, the last value before rollover and the first value after.
If you keep the native counts in the program and calculate the angle yourself, use floating-point arithmetic so the fractional result survives:
angle_deg := raw_count * 360.0 / 262144.0;
Apply any zero offset after the conversion and then normalize once per revolution. A single subtraction or addition of 360 is enough when the offset is under one revolution; for larger offsets repeat it or use a modulo calculation. Handling the 0-to-360 wrap in logic is covered in this encoder 0-360 degree wraparound fix.
Compare the encoder with the drive's actual position #
The two readings are comparable only when both describe the same physical shaft, the same units, the same direction, the same zero and the same rollover interval. A drive's actual position often describes its motor shaft or its own feedback device while the external encoder measures a different shaft; a gearbox, belt ratio, coupling compliance, backlash or slip then produces a real difference that no scaling setting will remove.
- Stop the shaft and compare both readings at several positions. A fixed difference is a zero offset; a difference that grows proportionally with position is a scale or ratio mismatch.
- Turn the shaft slowly through one complete revolution and confirm the encoder produces exactly one rollover and returns to its starting value.
- Check direction. If one value rises while the other falls, correct the convention before judging any latency.
- Trend both values in the same controller task at constant speed and measure the angular separation instead of judging two changing displays by eye.
- Convert the separation to time with Δt = Δθ / (6n), where Δθ is in degrees and n is the measured speed in rpm.
- Repeat with native counts or 3600 scaling. If the apparent lag shrinks when resolution increases, quantization caused most of it. If the time estimate stays similar at different speeds, look at controller task timing, the module's connection update rate, and when in the scan each value is copied or calculated.
Keep the unscaled value during commissioning: it separates communication timing from display quantization and gives the full resolution for calculations. If you also need speed from the same encoder, the position-difference method in Calculate RPM from an absolute encoder position difference applies directly to the raw counts.
Reading the comparison table #
| Observed behavior | Likely mechanism | Corrective check |
|---|---|---|
| Encoder stays still while drive position changes slightly | 360-unit scaling hides motion below one degree | Use 3600 scaling or native counts |
| Error grows through the revolution | One source is cyclic, the other accumulated | Normalize both to the same one-revolution interval |
| Constant error while stopped | Different mechanical zeros | Measure and apply one zero offset |
| Error proportional to position | Wrong scale, ratio or shaft relationship | Compare total change over exactly one physical revolution |
| Error appears only while moving | Different sample times or mechanical compliance | Trend at constant speed and calculate Δt |
The decisions: for a display only, scale to 360 or 3600 and accept the step size. For comparing with a drive position or calculating speed, keep the raw 262144-count value and convert to degrees in floating point, with modulo-360 handling after any offset.
Questions asked
Why does my encoder value look delayed compared with the drive position?
A value scaled to 360 units changes only once per degree, while the drive position usually changes in finer increments, so the encoder reading appears to stand still and catch up. Scale to 3600 or keep the raw counts and the effect shrinks; if the time estimate stays the same at different speeds, the cause is sampling or task timing, not resolution.
Does enabling module scaling improve the encoder's update rate?
No. Scaling only changes the number you read, not how often the module updates or how fast the network delivers it. Choose the scale from the smallest angle the application must detect, and do latency checks with native counts so display quantization cannot mask the measurement.
How do I compare the encoder with the drive's actual position?
Both readings must describe the same shaft, units, direction, zero and rollover interval. Stop the shaft and compare at several positions: a fixed difference is a zero offset, a difference that grows with position is a scale or ratio mismatch, and opposite directions mean one convention must be reversed before any timing test means anything.

