AutomateDirectUSAMotion LibraryShop the parts catalog

Selection guide

Choosing Encoder Resolution to Match a Stepper Step Response

Sensors, encoders and machine vision on the machine Published 8 min read

Short answer

A 50 ppr encoder read in x4 gives 200 counts/rev — one count per 1.8° full step, so the loop sees only before and after each step and ±1 count is ±1.8°. Size the encoder by counts per full step: 10 counts per step, which is 500 ppr in x4 at 2000 counts/rev and 0.18° per count, is the working minimum to reproduce a stepper's damped step response.

On this page
  1. Is a 50 ppr encoder enough to emulate a full-step stepper?
  2. How many counts per revolution does quadrature x4 decoding give?
  3. How many counts per full step does the servo need?
  4. How do I convert counts per step into an encoder line count?
  5. Can PID tuning compensate for a coarse encoder?
  6. What count rate must the controller input handle?
  7. How do I verify the servo matches the stepper's step response?
  8. What if I need to emulate half-steps or microsteps?
  9. Which encoder do I order for which job?
  10. Questions asked

Use a 500 ppr encoder, not the 50 ppr one that looks sufficient. A 50 ppr disc read in x4 quadrature decoding gives 200 counts/rev — exactly one count per 1.8° full step of a 200 step/rev stepper — so the loop sees only where the shaft was before and after each step, and ±1 count of position error is ±1.8°. A 500 ppr disc in x4 gives 2000 counts/rev, ten counts per full step, 0.18° per count: the resolution the loop needs to see overshoot and ringing inside a single step and reproduce the stepper's damped response. The servo runs from its own PID controller, because a stepper controller cannot drive a servo motor — the encoder sizing below is what makes the two responses match.

Is a 50 ppr encoder enough to emulate a full-step stepper? #

No. At x4 decoding a 50 ppr encoder produces 200 counts/rev, exactly one count per 1.8° full step, so ±1 count of quantization is ±1.8° of shaft angle and the PID loop cannot recover position it never measured.

The figure looks right because the decoded count equals the step count, so every full-step command lands on a whole count. But that equality only guarantees the servo can be told where each step ends. A step response lives inside the step: rise, overshoot, a few cycles of ringing, then settling. With one count per step the feedback offers two states per command — before and after — and none of that structure.

The decision: 50 ppr is acceptable only where ±1 full step of position error is tolerable and only the endpoint matters. For reproducing a stepper's step response it is disqualified by the arithmetic, before any tuning is attempted.

How many counts per revolution does quadrature x4 decoding give? #

Multiply the pulse-per-revolution rating by 4: a quadrature encoder's A and B channels produce four edges per line, so counts/rev = PPR × 4 under x4 decoding, the mode a position loop should use.

PPR is the number of lines on the disc. Decoding can count one edge per line (x1), both edges of one channel (x2), or all four edges of both channels (x4). x4 is the standard decoding for a position loop because it extracts the finest resolution the disc physically offers. The angular size of one count follows directly:

degrees per count = 360° ÷ (PPR × 4)

The table below runs this arithmetic for the common line counts.

How many counts per full step does the servo need? #

Ten counts per full step is the practical minimum — the same scale as the 8 to 10 microsteps per step that smooth stepper motion needs — which at 200 steps/rev means 2000 counts/rev and 0.18° per count.

The 8-to-10 figure is a rule of thumb from stepper practice, not a datasheet limit: smooth motion needs roughly that many increments per step, and feedback that must shape a response inside a step needs the same granularity. The two selection formulas:

  • counts per full step = (PPR × 4) ÷ 200
  • degrees per count = 360° ÷ (PPR × 4)
Encoder PPR Counts/rev at x4 Counts per 1.8° step Degrees per count Verdict for full-step emulation
50 200 1 1.8° Fails — the loop sees before and after only
100 400 2 0.9° Fails — no usable profile inside the step
250 1000 5 0.36° Marginal — below the counts-per-step rule of thumb
500 2000 10 0.18° Working minimum for response matching
1000 4000 20 0.09° Margin for tuning and later microstep work

Resolution also fixes the velocity estimate. With loop sample period T, the smallest speed the controller can distinguish is one count per sample, or (degrees per count) ÷ T. Calculated example at T = 1 ms: a 50 ppr loop resolves 1.8° ÷ 0.001 s = 1800°/s, which is 5 rev/s, so anything slower is invisible; a 500 ppr loop resolves 0.18° ÷ 0.001 s = 180°/s, or 0.5 rev/s. The shaft speeds during a single-step move sit far below 5 rev/s, which is a second, independent reason the coarse disc cannot damp the response.

How do I convert counts per step into an encoder line count? #

Invert the resolution equation: PPR = (200 steps/rev × counts per step) ÷ 4, so ten counts per full step gives (200 × 10) ÷ 4 = 500 ppr, and any multiple of 50 ppr keeps counts per step an integer.

Worked example, calculated for exactly these inputs:

  • Stepper: 200 steps/rev, full-step mode, 1.8° per step
  • Feedback: incremental quadrature encoder, x4 decoding
  • Target: 10 counts per full step

The arithmetic, with units carried through:

  1. counts/rev = 200 steps/rev × 10 counts/step = 2000 counts/rev
  2. PPR = 2000 counts/rev ÷ 4 counts per line = 500 ppr
  3. Check: 360° ÷ 2000 counts/rev = 0.18°/count, and 2000 counts/rev ÷ 200 steps/rev = 10 counts per step

Order the 500 ppr encoder for this job. Prefer a multiple of 50 ppr in general: 200 steps/rev then divides the count evenly, step-unit setpoints convert to counts without rounding, and the controller's scaling stays in integer arithmetic.

Can PID tuning compensate for a coarse encoder? #

No. The position error is quantized in 1.8° units at 50 ppr, so more proportional gain only makes the drive react harder to a one-count error, and the loop limit-cycles around the target instead of holding it.

Derivative action fares worse. Velocity computed from successive position samples is either zero or one whole count per sample, so the D term emits a spike at every count edge and amplifies quantization instead of damping it. Both symptoms — limit cycling at hold, spikes during a move — are sensor faults wearing a tuning disguise.

Tuning also cannot change what the loop is tuned to. Record the stepper's single-step response with its real load attached, then tune the servo to that measured rise time, overshoot and ringing rather than to the lowest settling time you can reach. Command a shaped profile instead of a raw setpoint jump: a raw jump saturates the drive, and the current limit then sets the response, not the PID. Slowing into the target needs remaining distance expressed in counts, which is only meaningful with several counts per step.

One related trap: a servo that travels the wrong distance after its feedback device is changed is usually a counts-per-revolution scaling mismatch, the failure mode behind fixing servo travel error after swapping resolver and encoder — the same number sized in this article decides that fault.

What count rate must the controller input handle? #

The counter input must accept PPR × 4 × rev/s without dropping edges: at 500 ppr and 3000 rpm that is 2000 counts/rev × 50 rev/s = 100,000 counts per second, checked against the controller's stated maximum input frequency.

The arithmetic for those example inputs: 3000 rpm ÷ 60 s/min = 50 rev/s; 500 × 4 = 2000 counts/rev; 2000 × 50 = 100,000 counts/s, which is 100 kHz. The maximum input frequency is a documented controller limit — take it from the controller's datasheet and leave margin for overspeed. If your worst-case speed exceeds it, the honest options are a counter input rated for the rate or a lower top speed; dropping edges shows up as position drift that no resolution arithmetic predicts.

How do I verify the servo matches the stepper's step response? #

Measure both motors with the same independent high-resolution position sensor, command one full step to each, and overlay the position-versus-time traces: the loop encoder cannot validate itself, because it is the device under test.

Procedure:

  1. Record the stepper's response to a single full-step command, real load attached, sampling well above the ringing frequency.
  2. Move the same measurement sensor to the servo shaft and issue the equivalent command — 1.8°, which is 10 counts on a 500 ppr loop.
  3. Overlay the traces and compare rise time, peak overshoot in degrees, ringing period, and settling into a stated band, for example ±0.18°.
  4. Hold position and watch the count: jitter beyond ±1 count at that resolution points to excessive gain or drive noise, not to resolution.
  5. Repeat with the real load inertia on the servo, because the stepper's ringing depends strongly on load inertia and a match made unloaded often disappears loaded.

Run the tests with guards closed and nothing on the axis that an unexpected move can throw: a mistuned servo can swing well past its commanded angle.

Backlash or compliance between the motor shaft and the measured load adds apparent ringing of its own and must be separated from loop tuning. How the feedback device itself is attached matters for the same reason — the trade-off in timing belt versus direct mount for a rotary encoder applies to loop encoders as much as to measurement encoders.

What if I need to emulate half-steps or microsteps? #

Recompute for the smallest increment you must resolve: 500 ppr in x4 gives 2000 counts/rev, which is 5 counts per half step, so microstep emulation needs a proportionally higher line count.

Half-stepping, 400 increments/rev, keeps 500 ppr workable but marginal at 5 counts per increment. Microstepping does not: emulating 10 microsteps per full step at 10 counts per increment requires 2000 increments/rev × 10 counts/increment = 20,000 counts/rev, hence 20,000 ÷ 4 = 5000 ppr. At 3000 rpm that count rate is 20,000 × 50 rev/s = 1,000,000 counts/s, a rate many quadrature counter inputs do not accept — so for microstep emulation, check the count-rate limit before the line count, or plan on a high-resolution feedback interface instead of a quadrature counter.

Which encoder do I order for which job? #

Decide by counts per step and the count rate together; the line count follows from the smallest motion you must reproduce, and the counter limit can veto it.

  • Full-step emulation with response matching: 500 ppr minimum in x4 — 2000 counts/rev, 10 counts per full step, 0.18° per count.
  • Endpoint-only positioning where ±1.8° is acceptable: 50 ppr suffices, but that is a positioning application, not step-response emulation.
  • Half-step emulation: 500 ppr gives 5 counts per half step — usable, with little margin.
  • Microstep emulation: PPR = (increments/rev × counts per increment) ÷ 4, and the count rate at maximum speed is checked before ordering.

Questions asked

Why does the servo still hunt at standstill after retuning the 50 ppr loop?

That hunting is quantization, not tuning: inside a 1.8° count window the loop reads zero error, then full error at the edge, so it limit-cycles no matter how the gains are set. The confirmation is that the oscillation amplitude sits near one count, 1.8°. Swap in an encoder with several counts per step and the hunting goes; if it persists with fine feedback, then chase gain, noise, or drive current instead.

What happens if the encoder I have is not a multiple of 50 ppr?

The loop still works, but the scaling picks up fractions. A 360 ppr disc at x4 gives 1440 counts/rev, which is 7.2 counts per full step, so setpoints expressed in steps need rounding or fixed-point arithmetic in the controller. Integer scaling is why 500 ppr is the convenient choice, not why it is the minimum.

Does a higher-resolution encoder change how I tune the loop?

Yes. With ten counts per step the velocity estimate has intermediate values to work with, so derivative gain becomes usable rather than a source of spikes. Tune in order: proportional first with derivative and integral off, add derivative until the overshoot matches the stepper's measured overshoot, then add a small integral term only if steady-state error remains, because integral windup during a step command lengthens settling.

What can I use to measure the step response if I have no test sensor?

Temporarily mount a much higher line-count encoder as a measurement device only — it records the motion but closes no loop. Aim for roughly an order of magnitude finer than the loop count: 0.18° ÷ 10 is about 0.02° per count, which means 360° ÷ 0.02° = 18,000 counts/rev, about 4500 ppr at x4. Sample it at several times the ringing frequency so the trace shows the ringing shape.

Keep reading

  • Troubleshooting

    Fix Servo Travel Error After Swapping Resolver and Encoder

    Travel that does not match the position display after a resolver-to-encoder swap is a scaling fault: the drive or the technology axis is still converting counts with the other feedback's increments per revolution. Measure one commanded move and divide actual by displayed travel; a constant ratio equal to the resolution ratio names the encoder data. Fix both layers, re-home, then re-tune.

    Servo and stepper motion

  • How-to

    How to Identify Geared Resolver and Encoder Feedback on Old Servos

    Treat the resolver plus its geared 1:4 and 1:80 channels as one integrated coarse-and-fine, multi-turn position package: the resolver reads absolute angle within one shaft revolution, and the geared channels count revolutions above it. Identify each channel by resistance checks, ratio counting and waveform capture before choosing a replacement drive, because the resolver model number alone establishes neither commutation nor multi-turn position recovery.

    Sensors, encoders and machine vision on the machine

  • Troubleshooting

    How to Tell if a Servo Motor Is Actually Faulty

    A servo motor is only confirmed faulty when it still fails with a known-good drive, verified feedback, and the load uncoupled. Read the commanded motion, the measured motion, and the motor current during the same event: high current with no movement points to the load or the feedback, and no command with no movement points upstream of the motor.

    Servo and stepper motion