How-to
Stepper Pulse Count Needed for a Given Encoder Target
Short answer
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.

On this page
- Which counter module mode actually places a piece exactly?
- How do I convert an encoder displacement into stepper pulses?
- What is the worked example from encoder 16 to 3,200?
- Do I write the displacement or the absolute target into the profile?
- How do I configure and run the move?
- How do I know the piece actually arrived?
- What if the belt stops at an awkward encoder count?
- Questions asked
To move a belt from encoder count 16 to encoder count 3,200 on an open-loop stepper, do not ask the counter module for 3,184 of anything. Convert the encoder displacement into output pulses with the drive's pulses-per-piece setting divided by the encoder's pulses per piece, and choose the drive setting that makes that ratio a whole number. This article uses the H2-CTRIO and its Dynamic Positioning pulse profile as the worked case, and the same arithmetic applies to any pulse-output axis whose position is measured by an independent encoder.
Which counter module mode actually places a piece exactly? #
Use a Dynamic Positioning pulse profile: it is the only mode here that accelerates, runs at a configured maximum frequency and decelerates to an absolute output position. The other modes cannot place a piece precisely. The H2-CTRIO manual describes Dynamic Positioning Plus for sending output pulses to an amplifier without encoder feedback, and the module's Run Position mode instruction loads and runs one of the pulse profiles you configured in its Workbench tool.
The alternatives fail for different reasons:
- Velocity Mode simply emits pulses at the selected frequency forever. It moves the belt but has no target, so it cannot stop on a position.
- Run to Position counts the pulses it has sent and stops when the commanded count is reached. It uses no encoder feedback and applies no acceleration or deceleration, which is why an uncoupled or stalling stepper walks out of the move and why the profile stalls at the start.
- Dynamic Positioning accelerates to the configured maximum frequency, then decelerates toward an absolute output position. Still open loop, but with a controlled profile it is the mode to use.
Understand what "done" means in every case: the module finishes when its own record of commanded output pulses is complete. The encoder tells you whether the machine actually got there; the module never consults it.
How do I convert an encoder displacement into stepper pulses? #
Compute the ratio as drive pulses per workpiece divided by encoder pulses per workpiece, then multiply. In this machine the encoder sees 5,000 pulses from start to start of each piece, and the stepper drive can be set to 800, 2,000, 4,000 or 20,000 output pulses for that same pitch (two shaft revolutions). The formulas are:
- conversion ratio = drive pulses per piece divided by encoder pulses per piece
- relative output move = encoder displacement times the ratio
- absolute output target = absolute encoder target times the ratio
The drive setting decides whether the move can be exact:
| Drive setting | Ratio (drive over encoder) | Output move for 3,184 encoder pulses | Result |
|---|---|---|---|
| 800 | 0.16 | 509.44 pulses | fractional, must be rounded |
| 2,000 | 0.4 | 1,273.6 pulses | fractional, must be rounded |
| 4,000 | 0.8 | 2,547.2 pulses | fractional, must be rounded |
| 20,000 | 4 | 12,736 pulses | exact integer |
The decision: set the drive to 20,000 pulses per piece. Every other setting forces a rounding that repeats on every piece, in the same direction, and accumulates into real belt drift over a shift. If a lower setting were unavoidable, you would need an explicit rounding rule and tolerance on the placement — but on this machine you do not have to accept that.
What is the worked example from encoder 16 to 3,200? #
The move needs exactly 12,736 stepper pulses. The arithmetic, all in pulses:
- Encoder displacement: 3,200 − 16 = 3,184 encoder pulses.
- Ratio at the 20,000-pulse drive setting: 20,000 / 5,000 = 4 output pulses per encoder pulse.
- Relative move: 3,184 × 4 = 12,736 output pulses.
- Current output coordinate, if both coordinates were zeroed together at home: 16 × 4 = 64 pulses.
- Absolute output target: 3,200 × 4 = 12,800 pulses, and 12,800 − 64 = 12,736, which confirms the relative figure.
This is a calculated example for these inputs, not a measured result from a machine. The encoder displacement and both drive settings are the documented numbers of the application; the multiplication is exact because the ratio is the whole number 4.
Do I write the displacement or the absolute target into the profile? #
Write the absolute output coordinate when the profile accepts one, and 12,800 is the value here. Dynamic Positioning takes an absolute position in Parameter 3, so the destination depends entirely on where the output coordinate's zero sits:
- If the encoder and the pulse-output coordinate were both zeroed at the same prox home, enter the converted absolute target: 3,200 × 4 = 12,800.
- If you reset only the output coordinate to zero at the current position (encoder count 16), enter the relative move instead: 12,736.
- Entering 12,736 into Parameter 3 with an unreset coordinate would command a different spot on the belt — the coordinate system's home decides which number is correct.
Home both coordinate systems from the same prox reference before you rely on absolute targets. The article on stepper label registration with an edge home and a dynamic move shows the same home-plus-move pattern applied to registration work.
How do I configure and run the move? #
Follow the module's documented sequence, from its manual and instruction help, with your numbers in place of the placeholders:
- Configure a pulse profile as Dynamic Positioning in the Workbench tool, with the acceleration, deceleration and maximum output frequency you want.
- Load that pulse-profile file to the module's pulse output.
- Set the Enable Output bit.
- Convert the requested absolute encoder coordinate to output pulses and write it to Parameter 3 — 12,800 for this target with the shared home.
- Toggle the Goto Position bit. The output accelerates, holds the maximum frequency when the distance allows, and decelerates into the commanded position.
- For the next piece, write the new absolute target and toggle Goto Position again.
If your pulses come from a PLC output rather than this counter module, the scaling is identical; the article on configuring a PLC pulse-output servo axis before position moves covers the setup on that side.
How do I know the piece actually arrived? #
Compare the measured encoder count against the requested target after motion stops, every piece or on a sampled schedule. The module considers the move complete from commanded pulses alone, so it cannot detect mechanical slip, a missed stepper step, a loose cog belt tooth or coordinate misalignment. A mismatch between measured and requested encoder counts is the signal that the pulse coordinate and the mechanical coordinate have separated — re-home both from the prox and investigate before trusting further absolute moves.
For the same reason, do not source encoder feedback into an input that cannot keep up; the article on counting encoder pulses on a PLC without losing position explains which inputs count reliably.
What if the belt stops at an awkward encoder count? #
It does not matter what the count is — with a whole-number ratio every encoder count maps to an exact output coordinate. The stop at 16 works precisely because 16 × 4 = 64 and 3,200 × 4 = 12,800 are both whole pulses. With the 4,000-pulse setting, that same stop would need 2,547.2 output pulses from count 16, and there is no such output coordinate; the controller rounds and the piece sits a fixed fraction off, piece after piece. That is the whole argument for the 20,000-pulse setting: it makes the answer independent of where the belt happened to stop.
One safety note: an open-loop axis that stalls delivers no fault and no position error — the belt simply sits still while the controller believes the move finished. Keep the encoder verification in step with production, and interlock downstream pushers on encoder-verified position, not on the module's move-done signal.
If your pulses are generated by a timer rather than a dedicated motion output, the count itself can come out wrong before any scaling is applied; the article on why a timer-driven stepper pulse train delivers the wrong step count covers that failure.
Questions asked
Does Run to Position on a counter module use the encoder to finish a move?
No. It tracks the number of pulses it has sent out of its own output and declares the move done when that count is reached. It never reads the encoder to correct the move, and the plain Run to Position mode applies no acceleration or deceleration. Verify final position with the encoder after motion stops.
What happens if my drive setting gives a fractional pulse count for the move?
The output coordinate advances in whole pulses only, so the controller rounds and the real stop lands a fraction of a pulse away from the target, every piece, always in the same direction. Over many one-direction placements that rounding becomes visible drift. Pick a drive setting that makes the ratio a whole number.
Can one index pulse zero the encoder and the pulse output at the same time?
Yes, and it is the safest way to keep the two coordinates aligned. Home both coordinate systems from the same prox or index reference so encoder count zero and output coordinate zero mark the same mechanical point. Then an absolute encoder target multiplied by the ratio is directly the absolute output target.
How do I size the acceleration and deceleration on a Dynamic Positioning profile?
Set the maximum frequency at or below the speed at which the stepper reliably holds torque with your load, which you read from the motor and drive documentation, not from the counter module. Set accel and decel long enough that the load does not stall or lose steps; a closed-loop stepper that follows your pulses makes the profile gentler to tune.


