Encoder Scaling Calculator

Counts to millimetres or degrees, and the resolution per count: from pulses per revolution, evaluation, feed constant and gear ratio, or from two measured positions.

Scaling

Measured points

Counts
Position
Point 1
inc
Point 2
inc
three or more give the best-fit line

From the encoder

Encoder
PPR
Mechanics
i
Top speed

Check a point
Counts
Position
Check
inc
—
Measured
same counts

—

Target
—
Use the measured point as
Results

Encoder scaling: counts to position

An incremental encoder delivers pulses; the PLC or NC axis needs millimetres or degrees. The scaling factor between them is the feed per revolution divided by the counts per revolution: feed constant ÷ (PPR × evaluation × gear ratio). The page fills it in from the encoder's data, or fits it from two positions you measured against the count, and shows both when you give both: the dashed line is the encoder's own, and the factor between the two says how far the mechanics disagree with the datasheet.

The derived numbers are the ones a commissioning checklist asks for: counts per millimetre or per degree, the resolution (one count), how far the axis travels before a 32-bit counter wraps, and the count rate at top speed to hold against the input terminal's limit. A rotary axis gives the same in degrees and revolutions.

The usual mistakes: an evaluation of ×1 configured where the terminal counts ×4 (a position four times too large), the gear ratio applied the wrong way round, and a feed constant taken from the drawing while the belt pitch or the roller diameter is slightly different. The check point catches all three: enter a measured position and the deviation from the line is shown as a value and a percentage.

How it works

Every scaling here is one straight line: value = gain × raw + offset. Two measured points fix it: gain = (value₂ − value₁) / (raw₂ − raw₁) and offset = value₁ − gain × raw₁. The gain is the scaling factor a PLC or NC axis asks for, and 1 / gain is the same thing the other way round: counts per millimetre, hertz per metre a minute.

Measured more than twice? Add up to eight points and the line becomes the least-squares fit: the one with the smallest sum of squared distances to every point. Each point then shows its residual, how far it was measured off the line; one that stands out from the rest is usually a misread or a point taken while the axis was still moving.

Worked example. An encoder reads 0 at the home position and 100 000 counts 2500 mm further on. gain = 2500 / 100000 = 0.025 mm per count, 40 counts per millimetre, offset 0. The encoder itself says the same: 1000 pulses per turn, read ×4, on a 100 mm feed, is 100 / 4000 = 0.025 mm.

Measured points define the line whenever they are filled in. The mechanics give the theoretical line: on its own it is the line, next to measured points it is the dashed comparison, and the measured one is divided by it. A factor of 0.97 means the belt runs 3 % slower than the motor and roller say it should. Each scaling has its own theory.

Encoder counts

feed ÷ (PPR × evaluation × ratio)

Position per count from the pulses per turn, the ×1/×2/×4 evaluation, the feed per turn and the gear ratio. Also the pulse rate at top speed, to check the input terminal.

Show this example

Drive frequency

n ÷ f ÷ i × π × D

Speed per hertz from the motor's rated speed at its rated frequency, the gearbox ratio and the roller diameter. Measured below it: slip.

Show this example

Speed setpoint

π × D ÷ i

Speed per setpoint turn from the gearbox and the roller: the effective feed constant of the axis.

Show this example

Analog input

raw range → value range

A 4–20 mA or 0–10 V signal arrives as a raw integer, 0–27648 or 0–32767. Map its ends to the sensor's range and read any value in between.

Show this example

Check a point looks up any raw value on the line, or slides along it. Type what you measured there and the difference is shown, as a value and a percentage; if that point is the better one, make it point 1 or 2 and the line moves through it, or add it as a new point. A target value gives the raw value that reaches it: the frequency for a conveyor speed, the count for a position.

The offset is where the line crosses zero. For an encoder it is the reference position; for a drive it should be 0, and a line that does not pass through zero points to a minimum frequency, a dead band or a measuring error.

Questions

How do I calculate an encoder scaling factor?

Divide the feed per revolution by the counts per revolution: scaling factor = feed constant / (PPR × evaluation × gear ratio). A 1000 PPR encoder read ×4 on a 100 mm feed gives 100 / 4000 = 0.025 mm per count, or 40 counts per mm. Two measured positions give the same factor as (position₂ − position₁) / (counts₂ − counts₁).

What is the difference between PPR and CPR (counts per revolution)?

PPR is the pulses one channel delivers per turn; counts per revolution is PPR times the evaluation. Reading both edges of the A and B channels (×4, quadrature) gives 4 × PPR counts per turn, ×2 gives 2 × PPR and ×1 gives PPR. Most PLC encoder inputs count ×4 by default, so a 1024 PPR encoder yields 4096 counts per revolution.

How do I convert encoder counts to degrees?

Degrees per count = 360 / (PPR × evaluation × gear ratio). A 2500 PPR encoder read ×4 on the shaft itself gives 360 / 10000 = 0.036° per count; measured through a 10:1 gearbox on the load side it is 0.0036° per count. Choose the rotary axis on this page and the position is in degrees.

What is encoder resolution, and is it the same as accuracy?

Resolution is the smallest position step the encoder can report, one count: at 0.025 mm per count nothing finer than 0.025 mm is resolved. Accuracy is how close the reported position is to the true one, and depends on the encoder's own error, backlash, belt stretch and whether the feed constant is right. A finer resolution does not make the measurement more accurate; a wrong scaling factor makes every position wrong by the same percentage. On a rotary axis, resolution = 360° / counts per revolution; a 17-bit absolute encoder has 2^17 = 131 072 counts per turn, 0.0027° per count.

Where does the scaling factor go in TwinCAT or a Siemens axis?

TwinCAT NC asks for the scaling factor as a numerator and denominator in the encoder parameters, position units per increment: 0.025 mm per count is 100 mm over 4000 increments. A Siemens S7-1500 technology object asks for the increments per encoder revolution, the load gear ratio and the leadscrew pitch or distance per revolution instead, and derives the factor itself. Either way the number this page shows is the one to check against. A servo drive's electronic gear ratio is the same relation the other way round, encoder counts per command unit, again as a numerator and denominator.

How fast will the encoder pulse at top speed?

Count rate = speed / position per count: at 2 m/s and 0.025 mm per count the input counts 80 000 edges per second, 80 kHz, while the A and B channels themselves pulse at a quarter of that with ×4 evaluation. Datasheets state an input's limit either as the signal frequency on A and B or as the count rate after evaluation, so read which before comparing. Fill in the max speed and the page shows the count rate.

Need saved scalings and PDF export?

View Plans