AutomateDirectUSAMotion LibraryIndustrial monitors & PCs

Explainer

When a Step and Direction Servo Drive Is Closed Loop

Servo and stepper motion Published 8 min read

Short answer

A step and direction servo drive is closed loop because the drive itself reads the motor encoder and corrects position with its internal PID loop, thousands of times a second; the step pulses are only a position command. Feed encoder pulses to the controller as well only when its logic must know actual position, and only after the encoder, drive and controller documentation agree on signal format, levels and loading.

On this page
  1. What a step pulse actually tells the drive
  2. The loop the controller sees, and the one it does not
  3. Three ways to build the loop
  4. Sharing one encoder output between drive and controller
  5. Worked example: step pulse budget for a 5 mm pitch axis at 3000 mm/min
  6. Proving which loop is actually running
  7. The decision, case by case
  8. Questions asked

Yes — a step and direction servo drive is closed loop as soon as the motor encoder is wired to the drive: it compares the pulse command against the encoder and corrects the motor through its internal PID loop, updated thousands of times a second. The step and direction pulses are a position command, not feedback, so the controller never needs to see the encoder for the loop to exist. Feeding encoder pulses to the controller as well adds a second, separate thing — the controller logic then knows actual position, not just what it commanded — but that split loads one encoder output with two receivers, so make it only after the encoder, drive and controller documentation agree on signal format, voltage levels and receiver count. The worked example below shows what pulse and count rates each side must carry, and the final checks prove which loop is actually running.

What a step pulse actually tells the drive #

A step and direction pair carries exactly one thing: commanded motion. Each step pulse is one configured increment of position, and the direction line chooses the rotation sense. Nothing in that pair says where the motor is. A pulse train is a position command, not feedback — that distinction is the whole question.

The drive turns the command into closed-loop motion on its own. It counts incoming steps into an internal command position, reads the motor encoder for actual position, and drives the difference to zero through its PID. Inside the drive this correction runs through the classic three-loop servo structure: a current (torque) loop inside a speed loop inside the position loop, refreshed thousands of times a second in a typical step/direction servo drive.

By definition, then, the loop is closed at the drive, and the controller's knowledge is irrelevant to it. Sensing alone is never the loop — something must act on the error — which is also the answer to whether an encoder makes a stepper motor closed loop. And feedback without tuned gains helps nothing: a drive wired exactly like this still stalls or oscillates with bad gains, the same why a phantom closed-loop stepper still needs PID gains.

The loop the controller sees, and the one it does not #

A controller that only outputs step and direction knows one number: how many pulses it has sent. If the drive corrects through a heavy cut, decelerates a load it barely holds, or trips, the controller's count still reads "commanded". The two counts can drift apart with nothing telling you.

You can live with that for most point-to-point and retrofit work, on one condition: wire the drive's position deviation (following error) alarm output to a controller input your logic watches, and stop the program when it asserts. With that wire in place, an axis the drive cannot hold becomes a stopped machine instead of a quietly wrong position.

Controller-level feedback is for the applications where your logic itself must know actual position: probing to a surface, synchronizing with an externally measured axis, logging real travel. That is a separate design decision, not a prerequisite for closed-loop operation.

Three ways to build the loop #

  • Drive loop only. Encoder to the drive; step, direction and fault wiring to the controller. Closed loop at the drive, controller blind to position. This is the standard retrofit architecture, and for most machines it is complete.
  • Drive loop plus controller feedback. Encoder pulses routed to the drive and to controller counting inputs, so your logic tracks actual position. The second receiver changes the electrical loading on one encoder output, so it must pass the checks in the next section.
  • Simulated encoder output. Most servo drives can regenerate a feedback signal from the main encoder they already read and put it out on dedicated terminals as a simulated encoder output, driven by the drive's own electronics. Where your drive offers it, prefer it: the controller gets position while the encoder drives only its own receiver.

Choose the first unless your program needs position. Take the third over the second whenever the drive provides it, and take the second only after the datasheets agree.

Sharing one encoder output between drive and controller #

Work through three documents in this order:

  1. The drive manual: what encoder input format, signal levels and supply it expects, and what output type it assumes the encoder has. This must match the encoder you actually fitted.
  2. The encoder datasheet: output type (differential line driver or single-ended open collector), supply voltage, and the fanout figure — how many receivers one output is built to feed.
  3. The controller input specification: accepted format, threshold levels and maximum counting rate.

The electrical question the split turns on is fanout. Differential line-driver encoder outputs follow RS-422 practice, and RS-422 specifies a driver built to feed multiple receivers — up to ten unit loads — so a true line-driver output usually carries a second receiver without complaint. The encoder datasheet's own fanout figure still governs, because not every output sold as a line driver meets that allowance. A single-ended open-collector output gets no such allowance: a second load steals pull-up current and slows the edges, so that type needs a buffer between encoder and the two destinations, or the drive's simulated output instead.

If any of the three documents disagrees with the split, do not split the wiring raw; buffer it or use the simulated output.

Worked example: step pulse budget for a 5 mm pitch axis at 3000 mm/min #

Inputs, each an example value you replace with your own machine's numbers:

  • Leadscrew pitch: 5 mm per revolution, from the machine drawing.
  • Rapid traverse target: 3000 mm/min, from the process.
  • Drive configured at 10,000 steps per motor revolution, an electronic gearing value set at commissioning.
  • Motor encoder: 1000 lines, which quadrature decoding counts as 4000 counts per revolution, from the encoder datasheet.

Rule, in words: motor revolutions per second equal axis speed divided by pitch; the command pulse rate equals revolutions per second times steps per revolution; the controller count rate equals revolutions per second times counts per revolution.

Arithmetic:

  • 3000 mm/min / 60 s/min = 50 mm/s axis speed.
  • 50 mm/s / 5 mm/rev = 10 rev/s, or 600 rpm, at the motor.
  • Command side: 10 rev/s × 10,000 steps/rev = 100,000 pulses/s = 100 kHz.
  • Feedback side: 10 rev/s × 4000 counts/rev = 40,000 counts/s = 40 kHz.

Result: while this axis rapids, the drive must accept a 100 kHz step pulse train and the controller input must count at 40 kHz. That is a calculated result for these example inputs, not a rating.

Decision: compare those two rates against the drive manual's documented maximum step input frequency and the controller input's documented maximum counting rate. If the drive's limit is lower — say 50 kHz — halve the steps-per-revolution setting to 5,000, which halves the pulse rate to 50 kHz, or cap the rapid at 1500 mm/min; either meets the same 50 kHz. The feedback rate follows the encoder, not the steps setting, so a counter that tops out below 40 kHz needs different input hardware, not a setting change. Both rates scale linearly with pitch, rapid and steps per revolution, so re-run the two lines whenever one changes. This is the same arithmetic as a servo pulse scaling calculation, read against a speed limit instead of travel per commanded increment.

Proving which loop is actually running #

Check in this order, cheapest first:

  1. Enable the drive, jog a short distance, and read the drive's position deviation or following-error value on its display or diagnostic interface: it should rise during the move and settle near zero afterwards. A live loop shows a finite, correcting deviation; a dead one shows a large permanent deviation or an immediate fault.
  2. Command a known travel and measure the physical result against a rule, dial indicator or machine scale. This confirms the encoder scaling, not just loop activity.
  3. Jog both directions and confirm the drive's displayed position follows the command sign. With controller feedback added, confirm its counted position moves the same sign and tracks commanded travel; a count running backwards means the feedback channel direction is inverted, fixed by exchanging the two signal channels at the controller input or inverting the count in the controller configuration.
  4. Put the drive's deviation and fault outputs into the controller inputs and force a stop through them at low speed before running production.

One safety note: run any deviation test at low speed with guards closed and an E-stop within reach, and never unplug an encoder connector under power as a test — it proves nothing and can damage the drive's feedback input.

The decision, case by case #

  • Your controller outputs step and direction only: the axis is closed loop once the motor encoder is wired to the drive per its manual and the drive's gains are commissioned. Leave controller feedback out unless your program needs position. Wire the fault and deviation outputs to watched controller inputs either way.
  • Your program must know actual position: take the drive's simulated encoder output if it offers one. If it does not, share or buffer the encoder output only after the drive manual, encoder datasheet and controller input specification agree on format, levels and fanout.
  • Either way, the wire that turns a silent stall into a stopped program is the drive's deviation alarm into a controller input — not encoder feedback to the controller.

Questions asked

What alarm tells me the closed loop actually caught a problem?

The position deviation or following-error alarm. The drive raises it when the gap between commanded and actual position passes the limit you set, and that alarm output is the wire that should stop your program. Set the limit from the drive's tuning tools: start at the value the drive documentation suggests, then tighten it only as far as the machine's real accelerations allow, because a limit set too tight trips on every hard deceleration.

Why does my axis still lose position if the drive is closed loop?

The drive's loop corrects only what the motor encoder can see. It cannot recover a mechanical slip between motor and screw, a loose coupling, or a stall so severe the drive hit its torque limit and tripped; after any of those, actual position has changed while the command count has not. The loop prevents drift, not lost motion, so re-home the axis after such an event.

My encoder is single-ended and the drive has no simulated output. How do I feed both devices?

Use a buffer or repeater that accepts the single-ended signal and re-drives two clean copies, one to the drive and one to the controller input. Put it close to the encoder, keep each branch within the cable length the encoder datasheet allows, and power the buffer from a clean supply so the two branches cannot pull each other's levels around.

The controller counts backwards after I add feedback. What do I change?

Fix the sign where the controller reads the feedback: invert the count direction in the controller's feedback configuration, or exchange the encoder's two signal channels at the controller input, so counted position rises for the same jog direction the drive moves. Do not swap encoder power leads to reverse direction, because a reversed supply damages some encoders outright.

Does adding controller feedback change how I tune the drive?

No. The drive's PID still runs on its own encoder exactly as commissioned, and the controller feedback is a parallel read, not an input to the drive, so leave the drive gains alone. If the axis still follows badly after feedback is added, the cause is in the drive tuning or the mechanics, and the fix belongs in the drive's gains, not in the controller wiring.

Keep reading

  • Troubleshooting

    Servo Position Counts Up While the Motor Is Stationary

    Counts that rise while the motor shaft is held still are false feedback counts, not motion. Compare the controller's tell-position reading against the drive's rotor-position display: a drive value steady within 1 count while the controller climbs condemns the simulated-encoder path. Isolate the encoder output, cable, breakout and counting input by substitution, one part at a time, cheapest check first.

    Servo and stepper motion

  • Explainer

    Mounting a Motor Encoder Behind a Belt Reduction

    No, not for commutation: field-oriented control switches phase current against the rotor's electrical angle, which only a sensor on the motor shaft reports directly. Behind a 10:1 belt, a 4096-count encoder gives about 410 counts per motor revolution — enough counts per pole to turn a 6-pole motor, but belt lash and multiplied noise put a load-dependent error inside the current loop. Use the belt-side sensor for velocity only; commutate from the motor shaft and add an output encoder if you need load position.

    Servo and stepper motion

  • Troubleshooting

    Servo Drive Over-Speed Alarm: Causes and Checks

    An over-speed alarm means the drive measured motor speed above the limit configured in its speed-limit parameter, not that the motor is broken. Confirm whether the limit, the command, the ramps, false encoder feedback, unstable tuning or a load that back-drives the motor put it there, cheapest first, and never raise the limit to silence a trip whose cause you have not confirmed.

    Servo and stepper motion