AutomateDirectUSAMotion LibraryIndustrial monitors & PCs

Troubleshooting

Stepper not following an encoder exactly: check the command path

Servo and stepper motion Published 6 min read By AutomateDirectUSA engineering team

Short answer

When a stepper drive in quadrature following mode misses a commanded 90-degree move by up to ten degrees in both directions, the cause is missing, extra or reversed encoder transitions, not lost motor steps. Count channels A and B at the drive terminals and prove the encoder before changing acceleration, deceleration or motor size; the reported fault was a new encoder defective out of the box.

On this page
  1. What the symptom tells you
  2. First checks, cheapest first
  3. Counting the expected quarter-turn for a 2000 pulses per revolution encoder
  4. Proving the open-collector interface at the drive terminals
  5. Isolate the encoder before replacing it
  6. Tune the motor only after the command is clean
  7. The decision for each case
  8. Questions asked

A stepper drive in quadrature following mode that lands on both sides of the commanded position — undershooting and overshooting a 90-degree move by up to ten degrees — is not losing motor steps. The command itself is changing: encoder transitions are arriving missing, extra or momentarily reversed. Prove the command path at the drive terminals before changing acceleration, deceleration or motor size. In the reported installation the cause was a brand-new open-collector encoder that was defective out of the box, and a replacement ended the error.

What the symptom tells you #

An open-loop stepper can only undershoot its command. Lost steps from excess acceleration, inadequate torque or resonance always leave the motor behind the target. Overshoot needs something else: extra command transitions or counts that briefly run backwards.

Quadrature direction comes from whether channel A leads channel B. A damaged channel, an unstable output level or a noisy cable can make one physical edge appear as no edge, as several edges, or as a step in the wrong direction. That is why an error in both directions points upstream of the motor, at the encoder and its wiring. Count the command before you retune the drive.

First checks, cheapest first #

  1. Mark the encoder shaft and the motor shaft, run one commanded 90-degree move slowly, and read the drive's input pulse counter before and after the move. If the count differs between two identical moves, stop tuning: the command path has already failed the first test.
  2. Power down and apply your lockout procedure before opening terminals; measure live encoder signals only under the procedures your machine's risk assessment requires. Check conductor continuity, terminal tightness and the signal common from the encoder to the drive.
  3. Confirm the electrical interface. An open-collector output is a sinking output, so the receiving input must supply the pull-up and the correct voltage level.
  4. Count each quarter-turn at the drive terminals and compare the totals with the expected count for a quarter-turn.
  5. Gently flex the cable and work the connector while watching the count. A change with no shaft motion identifies an intermittent connection or an internal encoder fault.
  6. Only when the command is clean, look at acceleration, torque and resonance on the motor side.

Counting the expected quarter-turn for a 2000 pulses per revolution encoder #

Inputs, and where each comes from:

  • Encoder resolution: 2000 pulses per revolution, as stated for the encoder in the reported installation. For your machine, take this from the datasheet of the exact encoder.
  • Drive scaling: set so the motor shaft turns 360 degrees for every 360 degrees of encoder rotation, as configured in the reported case.
  • Commanded move: 90 degrees, with a stop of about 0.35 seconds between moves.
  • Worst reported error: about 10 degrees, in either direction.

The rule in words: the expected count for a move equals the counts per revolution multiplied by the move angle divided by a full revolution.

The arithmetic: 2000 × 90 / 360 = 500 counts for the quarter-turn. A 10-degree error at that resolution is 2000 × 10 / 360 = about 56 counts.

One convention to check before you compare totals: encoder documentation may use "pulse" for channel cycles, while the drive may decode one, two or four edges on each cycle. Use the decoded count per revolution your drive actually registers. If your drive multiplies edges, work out the decoded total first with the article on the stepper pulse count needed for a given encoder target.

The decision this example leads to: repeated trials at the same 90 degrees should each land within a count or two of 500 and hold that count through the 0.35-second stop. Differences of tens of counts, on the order of that 56-count error, mean the command source is faulty. This is a calculated example for these inputs, not a measured result.

Proving the open-collector interface at the drive terminals #

An open-collector output conducts to ground in the on state and never creates a high level by itself; the receiving circuit must supply the pull-up and the matching input type. An application note comparing open-collector, push-pull and line-driver encoder outputs makes the same point: the receiver needs the sourcing arrangement the output type demands. A missing pull-up, an incompatible supply level, a weak signal common, a damaged channel or a long noisy cable can make one physical edge arrive as no edge or as several edges. The same mechanism is behind the case of an open-collector status output that reads nothing on the receiving side.

To prove the interface, identify the encoder supply, common, A and B on the drive side. Restore power and measure both channels at the drive terminals, not only at the encoder connector: turn the shaft slowly and confirm that each channel reaches stable high and low states. Then watch both channels during normal-speed motion with an oscilloscope or a high-speed counter. Look for narrow spikes, rounded transitions, missing states, and switching that continues after the source shaft stops. Pass this stage only when both channels switch cleanly at the drive terminals through several complete revolutions.

Isolate the encoder before replacing it #

Check coupling slip first. Place alignment marks across the driving shaft, the coupling and the encoder shaft: a slipping coupling changes physical angle without any electrical fault. Then rotate the encoder through controlled quarter-turns while counting at the same terminals the drive uses, and flex the cable gently during the test. Counts that change with no shaft motion identify an intermittent connection or an internal fault.

When the interface is correct but the states or counts stay inconsistent, substitute a known-good, electrically compatible encoder without changing the drive scaling, and repeat the four quarter-turn count test. The reported fault was exactly this: the encoder was defective right out of the box, and the error ended when it was replaced. A replacement is proven only when its counts repeat at the drive input, including during the stop.

Tune the motor only after the command is clean #

Quadrature following commands motion but gives the drive no motor-shaft feedback, so a clean input count proves the command, not the completed move. The motor can still lose steps when acceleration demands exceed available torque or when the move crosses a resonant region; the article on lost steps after a stall covers what that does to the motor. Mark the motor shaft and the driven mechanism, run the same move at reduced acceleration and speed using only documented adjustments, and watch the marks. If the error disappears while the drive receives the same clean count, investigate acceleration torque, load inertia, binding and resonance. If the shaft position must be known rather than inferred, choose a drive or controller that closes the position loop on the motor.

The decision for each case #

  • Counts differ from trial to trial, or the count moves during the stop: the command path is faulty — wiring, the pull-up interface or the encoder itself. Isolate and replace the encoder. Do not change acceleration or motor size.
  • Counts are clean and repeat at the expected 500, and the shaft falls short the same way on every move at the same acceleration: this is an open-loop motor error. Reduce acceleration, verify torque against the load, and check for resonance.
  • Counts are clean, the motor follows correctly at slow speed, and the error appears only at full speed: check acceleration torque, load inertia and deceleration before suspecting hardware.

Questions asked

Why can a bad encoder make the motor overshoot instead of only undershooting?

Quadrature direction comes from the order of the A and B transitions. A damaged channel or an unstable open-collector level can turn one physical edge into several edges or a momentary reverse count, so the drive is briefly commanded past the target or back toward it. Errors in both directions therefore point at the command path, because lost motor steps can only leave the motor behind.

My drive decodes four edges per encoder cycle. Does the expected quarter-turn count change?

Yes. The expected count uses the decoded counts per revolution the drive actually registers, not the encoder's channel cycles. If the encoder delivers 2000 channel cycles per revolution and the drive counts four edges on each cycle, the decoded total is 8000 counts per revolution and a 90-degree move is 2000 counts. Take both numbers from the encoder datasheet and the drive's decoding-mode setting before comparing totals.

Should I increase motor current or move to a servo first?

Not when the error runs in both directions. More torque can only reduce lost steps, which always undershoot; it cannot remove extra or reversed command transitions. Prove the encoder count first. A closed-loop stepping drive or servo axis is justified once the command source is proven clean and the motor still cannot hold the move under real acceleration and load.

What does the stop between moves tell me?

In the reported sequence the shaft stops for about 0.35 seconds between 90-degree moves. During a clean stop the drive's input count must not change at all. Counts that creep or jump while the encoder shaft is stationary show noise, an intermittent connection or an internal encoder fault, and they explain overshoot that grows or varies from move to move.

Keep reading

  • Explainer

    Convert an open loop stepper to closed loop control

    Converting an open loop stepper to closed loop control means a rotary encoder on the motor shaft, a drive mode that uses it for commutation and position, a position-tracking-error threshold that turns lost motion into a fault, and a non-zero recovery setting that returns the axis to the commanded setpoint after the fault clears. The motor's back EMF still sets the top speed.

    Servo and stepper motion

  • Explainer

    Does an Encoder Make a Stepper Motor Closed Loop

    No. An encoder on a stepper only reports position until a drive or controller compares encoder counts with commanded steps and changes the command to correct the error. Where that comparison happens — in the drive, in a motion controller, or only on a screen as an alarm — decides whether the axis is open loop, monitored, or closed loop.

    Servo and stepper motion

  • Explainer

    Mapping 5 stepper axes and 3 encoder inputs on a motion controller

    Four step and direction outputs go on JP7 pins 15-22, the fifth on JP5 pins 1-8, the three encoder inputs on JP7, and the 11 input bits on JP4 and JP6's 20 general-purpose 3.3 V I/O points. The generators and encoder inputs are fixed hardware functions that cannot be moved to other pins, and every limit-switch run belongs behind 24 V opto-isolation instead of on the non-isolated pins.

    Servo and stepper motion