AutomateDirectUSAMotion LibraryIndustrial monitors & PCs

Explainer

How robot outputs fire at fixed conveyor pulse counts

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

Short answer

Divide each target pulse count by your documented encoder scale (here 48,780 pulses per radian) to get a position threshold in radians, then fire the digital output on a below-to-at-or-above crossing of that threshold with a one-shot latch. A sustained greater-than comparison stays true every scan and repeats the command.

On this page
  1. What the encoder scale gives you
  2. Converting the 159-pulse target on a 48,780 pulses-per-radian conveyor
  3. Why a greater-than test alone fails
  4. Rollover on a circular conveyor
  5. Polling task or position-signal interrupt
  6. Commissioning sequence
  7. Where this fits in a tracking retrofit
  8. Questions asked

To fire a robot digital output at a fixed conveyor position, convert the target pulse count to position units with your documented encoder scale, then trigger on a detected crossing of that threshold, latched once per pass. With 48,780 pulses per radian, the three targets in question become 0.0000615 rad, 0.00326 rad and 0.7759 rad. The mechanism is the same on any controller that exposes conveyor position: threshold in position units, crossing detection, one-shot latch, defined reset.

What the encoder scale gives you #

A conveyor-tracking encoder interface reports counts on two channels 90 degrees out of phase, a fixed number of counts per revolution. After calibration the controller holds a live conveyor position value — on many systems it is exposed as an analog-type signal or a readable variable; on ABB IRC5 conveyor tracking the position signal is configured by name in the tracking system, and the c1Position value discussed here is in radians for the configured system. The scale of 48,780 pulses per radian comes from the encoder and mechanical ratio of this installation, not from a datasheet default: verify it the way the calibration procedure does, by moving the conveyor a known distance and comparing recorded counts.

A pulse target N converts to a position threshold with N divided by the pulses-per-radian scale. The result is a threshold in the position variable's units, not a pulse count you can compare against directly.

Converting the 159-pulse target on a 48,780 pulses-per-radian conveyor #

Inputs: target count 159 pulses (the requested second output); scale 48,780 pulses per radian (measured on this installation); position variable in radians with a zero that matches the encoder count origin (assumption to verify on your system).

Rule: threshold in radians = target pulses / pulses per radian.

Arithmetic: 159 / 48780 = 0.0032595... rad, rounded to 0.00326 rad.

Decision: enter 0.00326 rad as the threshold for the second output. The same division gives the other two targets:

Output event Target pulses Threshold (rad) = N / 48780
First 3 3 / 48780 = 0.0000615
Second 159 159 / 48780 = 0.00326
Third 37,850 37850 / 48780 = 0.7759

A note on a common mix-up: 780 / 48780 = 0.016 rad is not the second threshold. If your notes show 780 for that event, either the count or the division is wrong; recompute from the requested pulse count before commissioning.

Why a greater-than test alone fails #

A condition such as c1Position > 0.00326 becomes true on every scan once the conveyor passes that location. Depending on how you write the output command, you get an output that stays on, or a command issued repeatedly. An exact equality test does not fix it: the position advances between task executions, so the scan can miss the exact value entirely.

The fix is edge detection. Keep the previous scan's comparison result, compare it with the current one, and act only on the transition from below to at or above the threshold. Then latch an already-fired state for that event and rearm it at the defined reset point. The same pattern applies in any language: a comparison that keeps a variable true scan after scan is a level, not an event — the same pitfall described in the article about an ST IF/ELSIF condition that keeps a variable true in CODESYS V3.

Rollover on a circular conveyor #

This conveyor is circular, so the position likely wraps each revolution. Two consequences:

  • A latched event that is never rearmed fires only once. Rearm at the wrap, or track a revolution count and compare a target-relative position.
  • An edge detector comparing raw position can see a large backward jump at the wrap and, depending on your logic, fire or skip unexpectedly. Reset all event states at the wrap.

Verify the wrap behavior by jogging the conveyor through one full revolution and trending the position value before wiring any output to real loads.

Polling task or position-signal interrupt #

Two implementation routes:

  • Polling task. A cyclic task reads the position and runs the crossing logic. Simple, but trigger timing depends on task period and output update latency; the position overshoot at fire time equals conveyor speed times that latency. Measure the worst-case delay on the running controller at operating speed and check it against what your process tolerates.
  • Analog-signal interrupt. Where the controller exposes the position as an analog signal, an interrupt instruction of the ISignalAI type supervises it and raises an event at a predefined limit, without application-level polling. The Analog Signal Interrupt option on IRC5 exists for exactly this: generating a program interrupt when a supervised analog signal reaches a limit. Confirm in the conveyor-tracking configuration that the position signal is named and scaled as the interrupt expects.

For three fixed positions, prefer the interrupt route when your installed system supports it; otherwise poll with crossing detection.

Commissioning sequence #

  1. Confirm the live position value's units, zero reference, direction and wrap behavior on the actual controller.
  2. Convert each target with target / 48780 only after step 1 confirms radians and a matching zero.
  3. Implement crossing detection with a per-event latch and defined rearm.
  4. Define how long each digital output stays on and what resets it.
  5. Test at low conveyor speed with outputs disconnected, trending position, threshold state and output transition together; then verify direction reversal and the revolution rollover.

If an output fires late, first check the scale and zero, then measure the task or signal latency; do not adjust the scale to compensate for timing.

A firing output can drive a camera flash, a printer or a reject solenoid. Commission with the driven equipment safely isolated from the product stream until each event is proven once, in sequence, with correct rearm.

Where this fits in a tracking retrofit #

The threshold logic here is one piece of a larger job. Before you get to output events, the retrofit needs the mechanical encoder mounting, the calibration travel, and the tracking configuration — see what a conveyor-tracking retrofit needs beyond an encoder. The pulse scale itself is bounded by what the encoder interface and tracking system can resolve as the belt moves, which is the subject of what limits counts per meter in robot conveyor tracking.

Questions asked

How do I convert a conveyor pulse target to radians?

Divide the target count by the documented scale. With 48,780 pulses per radian, 159 pulses is 159/48780 = 0.00326 rad. The conversion is only valid if the live position variable is in radians and shares the encoder zero; if your interface reports counts or applies an offset, convert with the controller's actual representation instead.

Why does my output stay on or fire repeatedly?

Because a greater-than comparison remains true on every scan after the conveyor passes the threshold. Detect the crossing edge instead: store the previous scan's comparison result, fire only when it changes from false to true, latch an already-fired flag, and rearm at the position wrap or defined reset.

Should I poll the position or use an analog-signal interrupt?

If your controller option exposes the conveyor position as an analog signal that the interrupt instruction can supervise, that avoids application-level scan timing. Confirm the signal name, scaling and threshold direction in the controller configuration first. Otherwise a polling task with explicit crossing detection works; measure the worst-case scan latency and the position overshoot at operating speed.

Keep reading

  • Selection guide

    Counting Real Axes Before Selecting a Gantry Motion Controller

    Count independent servos, not marketing axes: this machine is 13 controlled axes (1 X, 4 Y, 4 Z, 4 C), so the controller must coordinate 13. Size the payload forces first — 300 N horizontal and about 1,772 N accelerating up on Z — then use a PLC with integrated motion driving servos on one deterministic fieldbus unless robot-style kinematics or conveyor tracking saves real development time.

    Servo and stepper motion

  • 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

    What a Conveyor Tracking Retrofit Needs Beyond an Encoder

    Conveyor tracking works only when the robot controller has the licensed tracking software option and a matching encoder interface unit reading a real encoder driven by the conveyor. An encoder alone, a faster robot program, or a timer estimate changes nothing, because position error equals conveyor speed multiplied by timing error.

    Servo and stepper motion