AutomateDirectUSAMotion LibraryIndustrial monitors & PCs

Explainer

Does a pulse counter module track commanded stepper position

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

Short answer

Yes, but only commanded position: a pulse counter module totals every step pulse it generates and returns that output count through a system function, so no ladder-side position integer is needed. The count cannot see a stalled motor, so corrections go to absolute targets through a Dynamic Positioning profile, and a quadrature encoder on the counter inputs becomes the reference whenever missed steps or measured lengths matter.

On this page
  1. Does a pulse counter module update position after each move?
  2. Is the output count proof the stepper actually moved?
  3. How do you command 5-10 step corrections to an absolute target?
  4. How do you turn gap inputs into a corrected target?
  5. When do you need a quadrature encoder on the counter inputs?
  6. How do you wire a push-pull quadrature encoder to the inputs?
  7. How do you fire an output at a measured position?
  8. How do you verify tracking at commissioning?
  9. Questions asked

A pulse counter module driving a stepper in pulse/direction does keep a position for you: it totals every step pulse it generates and exposes that output count through a system function, so a move commanded from 1,000 to 1,100 pulses leaves the count reading 1,100 with no integer maintained in ladder logic. What that number cannot tell you is whether the motor followed. This article covers the two position references a counter module gives you, how small corrections are commanded as absolute targets through a Dynamic Positioning pulse profile, and when the module's quadrature inputs need an encoder to show what actually moved.

Does a pulse counter module update position after each move? #

Yes: with its output configured for pulse/direction, the module counts every step pulse it generates, and a system function returns that output count, so after a move from 1,000 to 1,100 pulses the count reads 1,100.

That is the same bookkeeping a servo controller performs when you ask for its current position after a relative move. On the CTRIO family the output count is read through one of the module's system functions, so the fallback plan of incrementing or decrementing a PLC integer after every move is unnecessary: that integer would only duplicate a number the module already holds, and it would diverge the first time a move was interrupted while the integer assumed it completed. Read the count for displays and diagnostics, and let the module own the arithmetic.

Is the output count proof the stepper actually moved? #

No: the count records pulses generated, not shaft position, so a stepper that stalls or loses steps leaves the number untouched while the load stands still.

This is commanded position, and the distance between it and measured position is exactly what commanded position versus measured position on stepper encoder feedback works through. A servo controller's current position deserves trust because a feedback device corrects it; a stepper on pulse/direction runs open loop, and no tally of generated pulses can report a stall, an overrun, or a coupling that slipped. The output count is reliable as a record of what you asked for and worthless as proof of what happened. Where a lost step is not self-correcting, it is not a position reference at all; that job belongs to the counter's quadrature inputs, covered below.

How do you command 5-10 step corrections to an absolute target? #

Load a Dynamic Positioning pulse profile once, then issue each 5-10 step correction as a signed absolute target and a fresh Goto Position trigger, never as a stack of relative moves.

The sequence, for the CTRIO family:

  1. Configure the module output for pulse/direction. The documented profile types are trapezoid, S-curve, dynamic positioning, dynamic velocity and home search; dynamic positioning is the one that takes absolute targets.
  2. In the CTRIO Workbench, open Pulse Profiles, choose Add… and set the profile up in the Edit Pulse Profile panel.
  3. In ladder, run CTDYNPOS, the instruction that selects and loads one of the preconfigured Dynamic Position or Dynamic Position Plus profiles.
  4. For every move, write the signed absolute target into the V-memory location the profile uses and set the Goto Position bit. Do not reload the profile for each correction.

The target is absolute: it names a pulse count measured from the defined zero, so a move of +100 from a current position of 1,000 is written as 1,100, and commanding 1,100 again produces no motion.

Worked example, calculated for its inputs and not a measurement: a 1.8 degree stepper with 200 full steps per revolution, a drive configured for full steps so one pulse turns the shaft 1.8 degrees, and a directly driven screw with 5 mm of travel per revolution. Travel per pulse is 5 mm ÷ 200 = 0.025 mm. A 5-10 step correction is therefore 0.125 mm to 0.25 mm of load travel. With the active target at 2,000 steps (2,000 × 0.025 mm = 50.0 mm) and the gap needing to open by 8 steps, the next target is 2,000 + 8 = 2,008 steps, a commanded move of 8 × 0.025 mm = 0.20 mm that puts the commanded position at 50.2 mm.

How do you turn gap inputs into a corrected target? #

Treat the pair as a request, not a direction: both off holds the target, one input shifts it by the validated correction, and both on is an unresolved state that must not command motion.

Gap inputs Target action
Both off Hold the current absolute target; issue no new move
Too far only Shift the target by the validated correction in the direction that closes the gap
Too close only Shift the target by the validated correction in the direction that opens the gap
Both on Hold and raise an alarm; no valid move exists for this state

Which sign closes the gap and which opens it is a commissioning fact, not a documentation fact, so prove it once as described in the last section and then encode it. Because the sensor pair itself closes the gap loop, the PLC's whole job is this target arithmetic; the output count never enters the control decision, only the bookkeeping behind it.

When do you need a quadrature encoder on the counter inputs? #

Whenever the machine must know what moved rather than what was commanded: measured position, direction, and a count a preset table can act on all come from quadrature feedback, and nothing else on the module provides them.

The A and B channels sit one-quarter of a cycle apart, and the module evaluates the transitions on A and B to add in one direction of travel and subtract in the other. That is a measured position, whether the encoder watches the motor shaft or the load. For the gap machine the encoder is optional, because the sensors already close the loop and absorb an occasional lost step; for anything that must stop at a measured position or detect a missed step, it is the only verified reference the module can hold. Its count is incremental, so the zero is defined when the process begins, and what an absolute encoder would change about surviving power off is the subject of absolute versus quadrature encoders and what survives a power cycle.

How do you wire a push-pull quadrature encoder to the inputs? #

A push-pull (totem-pole) encoder is acceptable, and for that output circuit you tie the channel's COM terminal to ground, the preferred arrangement for push-pull, line-driver and PNP signals.

Each counter input channel brings out terminals A-B-C-D-COM and can be wired sinking, with COM at ground, or sourcing, with COM at the positive rail; the inputs contain a full-wave bridge, so current flowing in either direction creates the ON state. The pairings: an open-collector (NPN) encoder wants COM at the positive rail, while a line driver, an open-source device or a PNP device pushing current into the input wants COM at ground, the same arrangement as the push-pull encoder. Confirm the encoder's actual output circuit from its datasheet before choosing the rail. And keep the quadrature on these counter inputs: standard PLC inputs and the scan drop fast edges, which is the failure behind why the PLC input filter drops encoder pulses.

How do you fire an output at a measured position? #

Configure a preset table on the encoder's count: each entry fires a module output at a defined count, and the count values are editable from ladder logic, so the trigger point can change per piece.

A calculated example, not a measurement: a measuring wheel of 300 mm circumference turns a 600-pulse-per-revolution encoder, giving 600 ÷ 300 = 2 pulses per millimeter, or 0.5 mm of material per count. A 1.50 m cut is 1,500 mm × 2 = 3,000 counts, and a slowdown 150 mm earlier is 1,350 mm × 2 = 2,700 counts. At 30 m/min the line moves 500 mm per second, which is 1,000 counts per second at the input. Put one preset entry at the slowdown count and one at the cut count, and reset between pieces either with a reset entry in the preset table or by wiring a module output back into Input C as the counter reset.

How do you verify tracking at commissioning? #

Prove three things in order — the sign of a positive target, the count's agreement with the command, and the encoder's direction — each with a small commanded move before the machine runs product.

  1. Define the process zero and command a small positive target. Watch which way the mechanism moves; if it is the wrong way, fix the sign once, in the drive's direction setting or in your target arithmetic, and re-test.
  2. Command the same target again and confirm nothing moves. That proves the absolute semantics.
  3. Command a target on the negative side and confirm the move reverses; with an encoder fitted, confirm its count follows in the expected direction and lands on the expected value.
  4. Exercise each gap input alone and confirm the target changes by exactly the intended signed correction, and that both inputs off issues no new move.

Run every one of these checks with the mechanism in a safe test condition at reduced speed, because a sign error turns each automatic correction into a runaway.

Questions asked

Is one pulse always one full step of the motor?

No. A pulse is whatever the drive's step input is configured to consume. With microstepping, for example ten microsteps per full step, one pulse turns a 1.8 degree motor 0.18 degrees, and a correction sized in full steps must be multiplied by ten to move the same distance. Size corrections in the pulses the drive actually counts, and confirm the microstep setting before commissioning.

Can I scale the output count to millimeters for the operator display?

Yes. Multiply the count by the travel per pulse. In the worked example each pulse moves the axis 0.025 mm, so a count of 800 steps displays as 800 times 0.025, or 20.0 mm. Do the scaling where the number is displayed rather than in the target arithmetic, so targets stay in the pulse units the profile expects.

If the stepper loses a step, does the gap control recover?

Usually yes. The gap sensors close the loop, so the PLC keeps trimming the absolute target until both inputs are off again, even though the target and the shaft's physical origin now disagree by the lost steps. The gap is corrected, but the position bookkeeping is offset, so re-establish the zero at the next process start and treat repeated step losses as a load or acceleration problem to find.

Is an encoder on the motor shaft enough, or should it watch the load?

A shaft-mounted encoder proves pulses became steps but sees nothing downstream; only a load-side encoder reveals a slipping coupling, belt or clutch. For gap keeping with a directly driven screw, the shaft encoder is enough. For measuring material or verifying a geared or belted axis, put the encoder where the measurement actually matters: on the load or on the material.

Keep reading

  • How-to

    Stepper encoder feedback: commanded position vs measured

    A pulse-output stepper system is open loop: the controller's commanded position is its own count of emitted step pulses, and the quadrature encoder gives a separate measured position. Program the two as independent values, compare them in ladder logic after each move, and never reset the position counter or reload the motion profile between absolute moves — every target is an absolute position, so a reset turns each move into a fresh move from zero.

    Servo and stepper motion

  • How-to

    Stepper Pulse Count Needed for a Given Encoder Target

    Divide the drive's pulses per workpiece by the encoder's pulses per workpiece to get the conversion ratio, and pick the drive setting that makes the ratio a whole number. With 20,000 drive pulses against 5,000 encoder pulses, a 3,184-encoder-pulse move is exactly 12,736 stepper pulses.

    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

Stepper rail binary position selection: one writer, all bits