How-to
Match a Stepper Feed Rate to Conveyor Speed With an Encoder
Short answer
Continuously scale the conveyor encoder's measured count rate into the pulse-output velocity register: divide the count rate by the counts per inch of belt travel, then multiply by the label-feed ratio and the drive's pulses per inch of label travel. A fixed feed rate matches one belt speed only; the per-scan register update is what makes the labeler follow the belt.
On this page
Match the feed to the belt by writing the conveyor's measured speed into the stepper's velocity command every scan: read the encoder's count rate, divide by the counts per inch of belt travel to get belt speed, then multiply by the label-feed ratio and by the drive's pulses per inch of label travel. The whole follower is one gain — pulses per encoder count — computed from four measured values and applied continuously. A fixed feed rate tuned by eye matches exactly one belt speed, which is why labels bunch when the feed runs fast and misplace when it runs slow. The example hardware here is a DL06 with a CTRIO high-speed module, encoder into the counter input and stepper drive on the pulse output, but the scaling is identical on any controller with a counter input and a pulse output.
Why one fixed speed loses the label #
Two shortcuts fail first. Raising the velocity setting until a label looks right calibrates the feed to the belt speed of that moment; when the conveyor ramps or the operator changes rate, the error comes back on every label after it. And copying the conveyor drive's speed command into the stepper treats an instruction as a measurement — the command says what the conveyor drive was asked to do, not what the belt did, with slip, ramp time and load all sitting between the two. Only a count taken off the belt follows the belt.
| What you see | Likely cause, cheapest first | Confirming check |
|---|---|---|
| Labels bunch on the bottle | Feed faster than the belt — gain too high | Compare inches of web fed against inches of belt travel over one cycle |
| Labels misplace or drift late | Feed slower than the belt, or a stale count | Watch the input-map register while the belt runs; it must move every scan |
| Tracking holds at one speed, lost at another | Fixed velocity in use, or the update rung is conditional | Change belt speed and trend the velocity register alongside the count |
| Velocity register never moves | Wrong map address, or the update contact never closes | Open the module's map display and read both addresses off it |
Map the encoder input and the pulse output #
The encoder and the stepper share one high-speed module in this arrangement, which leaves the machine's second module spare. Configure the module with its input register map and its output register map; the map display names the address of everything the module exposes. One example puts the input block at V2000 and the output block at V2030, so the encoder's count lands in V2000 and the velocity command lives in the register the map labels Velocity Parameter 1. Those are that project's addresses, not defaults — the map display of the configured module is the authority, so read yours and write the two addresses down.
Wire the encoder to the module's counter input and the stepper drive's pulse and direction inputs to the module's pulse output. The pulse output is a command signal only; the stepper drive supplies motor power. Set the drive's direction input once for the feed direction, and make the counter count up when the belt runs forward — a reversed sign reads as negative speed and the follower runs backwards.
Turn counts into a pulse rate #
A raw count is not a pulse rate; counts per second become pulses per second only through the unit conversion below. Pulse frequency is proportional to rotational velocity, so one constant gain holds across the whole speed range — that linearity makes this a scaling job rather than a tuning job. It is the same master-and-follower idea as following a master axis with a stepper traverse, with the belt encoder as the master.
- C, counts per inch of belt = encoder pulses per revolution ÷ belt travel per encoder revolution. The encoder's datasheet and a tape measure on the wheel give you both.
- P, pulses per inch of label = drive command pulses per motor revolution ÷ label travel per motor revolution. The drive's configured microstepping and the feed roller's circumference give you both.
- k, feed ratio = label travel per inch of belt travel; 1.000 when the web must move exactly with the bottles. The label spec gives it.
- G, follower gain = k × P ÷ C, in pulses per encoder count. The commanded pulse rate is R × G, with R the measured count rate in counts per second.
In integer registers, multiply before you divide, and cross-multiply the raw fractions so the gain stays exact.
Worked example: a 60 ft/min labeler with a 1024-count encoder and a 2000-pulse drive #
Inputs, each with its source. All are example values for this case — take the real figures from your own datasheet, machine and label spec:
- Encoder resolution: 1024 pulses per revolution (encoder datasheet).
- Measuring wheel riding the belt: 6.00 in of belt per encoder revolution (measured on the machine).
- Belt speed at the check point: 60.0 ft/min = 12.0 in/s (the production rate to verify at).
- Stepper drive: 2000 command pulses per motor revolution, from its configured microstepping (drive configuration).
- Feed roller: 3.00 in of label per motor revolution (measured on the machine).
- Feed ratio k = 1.000 in of label per 1.000 in of belt (label spec).
Rule in words: counts per inch come from the encoder and the wheel; pulses per inch come from the drive and the roller; the gain is k × P ÷ C; the command is count rate × gain.
Arithmetic:
- C = 1024 ÷ 6.00 = 170.7 counts/in.
- P = 2000 ÷ 3.00 = 666.7 pulses/in.
- G = 1.000 × 666.7 ÷ 170.7 = 3.906 pulses per count.
- At 60.0 ft/min the belt runs 12.0 in/s, so R = 12.0 × (1024 ÷ 6.00) = 2048 counts/s.
- Commanded rate f = 2048 × 3.906 = 8000 pulses/s, or 8.00 kHz.
- Exact integer form: cross-multiply first — 2000 × 6.00 = 12000 and 3.00 × 1024 = 3072, and 12000 ÷ 3072 = 125 ÷ 32 — so velocity = (R × 125) ÷ 32 = (2048 × 125) ÷ 32 = 256000 ÷ 32 = 8000. Integer division drops less than one pulse per second.
Repeat at the machine's maximum belt speed — taken as 120 ft/min, 24.0 in/s, in this example — and the same gain commands R × G = 4096 × 3.906 = 16000 pulses/s, or 16.0 kHz.
Decision: write the update so Velocity Parameter 1 carries 8000 pulses/s at 60.0 ft/min, and confirm 8.00 kHz at the drive with its display or a frequency meter. Before release, put the 16.0 kHz top-speed figure against the smaller of the module's documented maximum output frequency and the drive's documented maximum input pulse frequency: above that limit, go to coarser microstepping or a larger feed roller. Never clamp the number in software — a clamped command is a fixed speed again, and labels bunch above the clamp point.
Commission the follower #
- Lock out and tag out the machine — in the US, OSHA 1910.147 covers control of hazardous energy — before touching wiring, and keep the guards on the belt and rollers for every test that follows.
- Read the module's input and output register maps and record the encoder's address and the address of Velocity Parameter 1; your map display is the authority, not example addresses.
- With the belt stopped, verify the count register holds still and the commanded velocity is zero.
- Jog the belt forward slowly and confirm the count rises; jog backward and confirm the sign reverses.
- Verify C on the machine: mark a measured distance on the belt, jog across it, and divide the accumulated counts by the distance — it must equal your computed counts per inch.
- Compute the gain and program the scaling rung on an always-on contact — SP1 in the example program — so the velocity register is rewritten every scan. Put the output in velocity mode; the example loads K20 into the command code.
- Run the label feed at low belt speed with no bottles; the web must advance smoothly, with no ratcheting from lost steps.
- Step the belt up through its range; at each step the commanded rate must equal belt speed × k × P — spot-check 8.00 kHz at 60.0 ft/min.
- Run with product and inspect label placement across a full batch before the machine goes back to production.
What the scaling cannot fix #
The follower obeys two hard ceilings and one blind spot. The ceilings are frequency: the commanded rate must stay below the module's maximum output frequency and the drive's maximum input pulse frequency, both printed in their documents, and you fix a violation in the mechanics or the microstepping, never by clamping the command. The blind spot is between encoder and belt: a measuring wheel riding the belt sees belt slip, while an encoder on the conveyor's drive shaft does not — mount on the belt side, and re-run the tape-mark check whenever placement drifts with load.
Questions asked
Will a proximity switch on a conveyor roller work instead of an encoder?
Yes, as a speed source it drives the same scaling. Count the pulses the switch actually gives per shaft revolution, divide by that shaft's belt travel per revolution, and C follows directly. The tradeoff is far fewer counts per inch than an encoder gives, so the follower resolution is coarser and low belt speeds update in visible steps; average the rate over several scans when the belt runs slowly.
Does matching the feed rate also place the start of each label?
No. The follower sets how fast the label web advances; where each label begins is a separate event, from a bottle sensor, a registration mark, or a counted belt position. Tune the gain first, then the start trigger. A constant offset at every speed is a start-timing error; an error that grows with speed is a gain error.
How often must the velocity register be updated?
Every scan, on an always-on contact — SP1 in the example program. The follower must see belt speed changes while they happen; a register updated once a second commands stale speed during every ramp, and the feed lags the belt exactly where labels misplace. Per-scan updates cost nothing extra in a program this small.
What if labels still wander after gain, slip and timing all check out?
Suspect lost steps. An open-loop stepper that accelerates faster than it can follow drops pulses with no fault raised, and the conveyor encoder cannot see that. An encoder on the step motor itself closes the loop: step-motor encoder feedback is what enables stall detection and stall prevention, and it reports whether the motor actually reached its commanded position. Until then, ease the acceleration ramp.
Is a 1:1 feed ratio always the right choice?
No. The ratio k is label travel per inch of belt travel: 1.000 only when the web must move exactly with the bottles. Some applicator geometries feed a different web length per inch of bottle travel, and the label spec gives that number. A wrong k and a wrong gain produce the same symptom, drift that grows with belt speed, so verify both against measurements.