AutomateDirectUSAMotion LibraryIndustrial monitors & PCs

Explainer

Why a PTO Axis Cannot Close the Loop With an External Encoder

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

Short answer

A pulse-train (PTO) motion axis cannot use an external encoder as closed-loop feedback: its internal counter counts commanded pulses only and cannot be read by your program. Close the motor-side loop with a closed-loop stepper drive, and read a separate encoder through a user-accessible high-speed counter purely to compare against the axis position.

On this page
  1. What the PTO axis actually reports
  2. The two position-loop options the PLC does have
  3. Supervisory feedback: the external encoder on a user HSC
  4. Worked example: scaling the comparison
  5. When a full encoder is more than the machine needs
  6. The decision
  7. Questions asked

No: an external encoder cannot close the position loop of a pulse-train (PTO) motion axis. The axis position you read in the program is the count of pulses the PLC commanded, not a measurement of the shaft or the load, and the high-speed counter (HSC) that the PTO uses internally cannot be evaluated by the user program. The encoder can still earn its place on the machine — as independent supervisory feedback through a separate HSC, compared against the axis position to catch slip, stall or lost motion. Here is why the loop cannot close, what to use instead, and how to build the supervisory comparison with real scaling numbers.

What the PTO axis actually reports #

A pulse-train axis is command-fed by construction. The PLC generates a step-and-direction pulse train, and the motion control firmware tracks those same pulses it just sent. The counter behind this is dedicated: the documented PTO implementation states that the PTO requires the functionality of a high-speed counter, that an internal HSC is used, and that its count cannot be evaluated. Engaging the first pulse output engages the first counter; engaging the second output engages the second counter. In later motion control versions the same internal tracking moved from hardware counters to dedicated internal memory, so the hardware counters stay free — but the axis position remains a pulse count either way.

That position value has real uses: it drives move sequencing, homing offsets and in-position signalling. What it cannot tell you is whether the mechanism followed. If a coupling slips, a belt loses teeth or the drive stalls against a jam, the commanded-pulse position keeps increasing as though nothing happened. No encoder wired anywhere changes that, because the axis firmware never accepts one as loop feedback.

The two position-loop options the PLC does have #

Closed-loop position control in which the encoder actually corrects the command exists on this controller family through two drive interfaces: an analog setpoint output with an optional enable signal, or a network drive connection. On an analog interface the drive closes its own position loop around the setpoint; on a network connection the drive exchanges cyclic setpoint and encoder data with the PLC.

For a stepper machine, though, the practical answer is different: keep the pulse command and put the loop inside the drive. A closed-loop stepper drive measures the motor encoder, follows the PLC's pulses, and raises an alarm when the motor does not track the command. You get the inner loop the analog route was supposed to buy you, without the analog interface, which is generally rougher out of the box. If you are converting an existing open-loop axis, see the walkthrough on converting an open loop stepper to closed loop control. Note the boundary: the drive's loop covers motor versus pulse command only. Anything between the motor shaft and the load — coupling, belt, gearbox, lead screw — is still unverified by any loop.

Supervisory feedback: the external encoder on a user HSC #

This is where an external encoder belongs. Wire it to a high-speed counter that remains available to the user program (not one of the counters the PTO occupies), and compare its scaled position with the axis position every cycle. The comparison catches what no loop can: mechanical slip, a broken coupling, a load that jammed and stalled the motor into the drive's alarm region. For the counter configuration itself, the checks that keep counts from being missed are the same ones described in counting encoder pulses on a PLC without losing position.

The comparison is only as good as its scaling. Four things must match between the encoder side and the axis side:

  1. Encoder counts per revolution — line count times quadrature factor, from the encoder datasheet.
  2. Mechanical ratio — pulley ratio, gearbox ratio or screw lead between the encoder shaft and the load, and whether the encoder rides the motor or the load.
  3. Direction — a positive command must produce a positive encoder count, or the deviation grows on every move.
  4. Units — scale both sides to millimeters, degrees or load revolutions before subtracting.

If channel-level counting behavior on a different controller is your reference point, the setup steps in configuring a high-speed counter for an encoder input transfer directly.

Worked example: scaling the comparison #

Hypothetical example, chosen so the arithmetic is easy to check. Suppose the axis drives a load through a timing-belt stage:

  • Encoder: 2000 pulses per revolution, quadrature, so 4 counts per line → 8000 counts/rev at the counter.
  • Encoder mounted on the load shaft, which carries a 20-tooth pulley; the motor carries a 40-tooth pulley. Load moves one pulley circumference per motor rev... more directly: the load shaft turns once per two motor revolutions.
  • Load travel per load-shaft revolution: a belt on a 20-tooth pulley at 5 mm belt pitch → 100 mm per load-shaft revolution.

Encoder scaling: 8000 counts per load-shaft revolution ÷ 100 mm per revolution = 80 counts per millimeter of load travel.

Axis scaling: the load shaft turns once per 2 motor revolutions, and the motor moves 100 mm per load-shaft rev, so the motor must produce 100 mm per 2 revs = 50 mm per motor rev. If the drive is set to 4000 steps per motor revolution, the axis counts 4000 × 2 = 8000 steps per load-shaft rev, or 8000 ÷ 100 mm = 80 units per millimeter on the axis side — set the axis scaling to 80 units per millimeter and the comparison becomes a straight subtraction.

Command a 250 mm move: the axis reports 250 × 80 = 20,000 units; the encoder counter should read 250 × 80 = 20,000 counts. Deviation = encoder position − axis position = 0 at rest. Pick a deviation alarm limit from your mechanics — for example 0.5 mm, or 40 counts, as an illustrative value — and latch the alarm when |deviation| exceeds it for a few scans, so counter noise during motion does not trip it. With a 5 mm pitch belt and a 20-tooth pulley, one skipped tooth is 5 mm of load error against your 0.5 mm limit: detected. With the limit set wider than one tooth pitch, a single skipped tooth passes silently.

Verify the monitor before trusting it: jog in both directions and confirm the deviation stays near zero and the sign is right; then induce a fault — hold the load back by hand with the drive alarm disabled, or loosen the coupling on a locked-out machine — and confirm the deviation alarm fires. If it does not, the scaling or direction is wrong, and every later alarm would be false either way.

When a full encoder is more than the machine needs #

If continuous position comparison is unnecessary, a reference sensor that the mechanism triggers regularly gives you a cheaper check: passive homing on a home switch, or a high-speed capture input that latches the counter on a sensor edge. A pickup triggered once per cycle proves the mechanism actually swept past that point; if the axis says it completed but the sensor never fired, motion was lost. That periodic check catches gross failures and accumulating error at the reference point without a second encoder, though it does nothing between references.

The decision #

  • Need the load position verified? Wire the external encoder to a user-accessible HSC, scale both sides to the same units, and alarm on deviation. It supervises; it never closes the PTO loop.
  • Need the motor to actually follow the pulses? Use a closed-loop stepper drive and let it alarm on tracking error; that is the loop the PLC cannot give you over pulses.
  • Need true PLC-in-the-loop position control? Move to an analog setpoint interface or a network drive connection — not more encoders on the pulse axis.
  • Only need gross fault detection? A regularly triggered reference sensor with homing or high-speed capture is enough.

One safety note: before inducing a stall or loosening a coupling to prove the monitor works, isolate the machine per your site's lockout practice — the verification deliberately creates the fault you are protecting against.

Questions asked

Can an external encoder close the position loop of a PTO motion axis?

No. A pulse-train axis is fed the pulse command it generated itself, so the encoder cannot correct the command. The documented position loop options for the PLC are an analog setpoint interface or a network drive connection. An external encoder on a separate high-speed counter gives you supervisory comparison only, not loop correction.

Why can't the user program read the high-speed counter the PTO uses?

The pulse-train output requires a high-speed counter to operate, and the counter it engages is dedicated to that function. In the documented implementation, engaging the first pulse output engages the first counter and the second output engages the second counter, and the engaged counter's count cannot be evaluated by the user program. Later motion control versions track position in dedicated internal memory instead, which frees the hardware counters but still leaves the axis command-fed.

How do I detect a stalled or slipping mechanism on a PTO axis?

Mount a separate encoder on the load side and read it through a high-speed counter that remains available to the user program. Scale its counts into the same units as the axis position, match the direction, and alarm when the deviation exceeds your application's limit. Verify the monitor by blocking or slipping the mechanism deliberately and confirming the alarm fires.

Is a closed-loop stepper with a pulse command a good choice instead of an analog setpoint?

For most pulse-train stepper applications, yes. The motor-side loop lives in the drive, the drive alarms when the motor does not follow the pulses, and pulse-and-direction motion control is generally more refined out of the box than an analog setpoint interface on this class of PLC. What the drive loop cannot see is what happens after the motor shaft, which is exactly what the supervisory encoder covers.

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

  • How-to

    Tuning a Closed-Loop Stepper With Linear Scale Feedback

    Commission the axis open loop first, verify both linear scale channels and the counts-per-unit constant with gains at zero, then close the loop at an integral gain near 0.01 with about 100 Hz filtering. Backlash, stiction and compliance end up inside the loop, so it limit-cycles at rest — fix the mechanics and the gains together.

    Servo and stepper motion

  • Explainer

    Why a servo feeder stops on motor position, not strip position

    The servo stops on its motor encoder's position, so the strip encoder can never be the stop condition itself. Read the strip encoder in the controller and correct the running relative move through its documented continuous-update distance input — a position reset needs the axis stopped and cannot recover lost travel. Begin deceleration early: braking travel v²/(2a) plus v·t of command delay; at 300 mm/s and 2,000 mm/s² with 10 ms delay that lead is 25.5 mm.

    Servo and stepper motion