AutomateDirectUSAMotion LibraryIndustrial monitors & PCs

Troubleshooting

Why conveyor tracking drifts further from each box

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

Short answer

A growing box-to-box offset is a stale reference, not a bad tracking scale: either the belt moved while tracking was off and the new window kept the old reference, or a measured pose already carrying the belt compensation was fed back as the next origin. Read the belt position at each restart and register the new window from it, or keep one tracking session and advance the nominal box reference by one measured pitch.

On this page
  1. Why does the first box land on target while every following box drifts further away?
  2. How far does the belt travel while tracking is switched off?
  3. Why does feeding the measured TCP pose back put the offset in twice?
  4. Is the tracking scale setting (TPM) the cause?
  5. How do I tell reference drift apart from mechanical drift or tuning lag?
  6. How do I fix tracking that restarts for each box?
  7. How do I fix tracking that stays on across boxes?
  8. Questions asked

The first box is your proof that the geometry, the tool path and the tracking scale are all right; the error that grows from box two onward lives in reference handling. Every new target is being built from a conveyor coordinate that no longer matches the belt: either the belt moved while tracking was switched off and the new window kept the old reference, or a measured pose that already carries the belt compensation is being fed back as the next box's origin. The fix is to re-anchor every box to the belt as the belt is now: read the belt position at each tracking restart and register from it, or keep one tracking session and advance the nominal box reference by exactly one measured pitch. The sections below measure which failure you have, in belt encoder ticks, and correct each one.

Why does the first box land on target while every following box drifts further away? #

A constant increment of drift from one box to the next is the signature of a stale reference: bad geometry or a bad scale gives a fixed offset or one proportional to speed, while a reference that is never re-anchored adds the same missed belt travel on every cycle.

The deciding quantity is the displacement between the conveyor coordinate used to build a target and the conveyor coordinate in force when that target executes. Neither program arrangement decides the outcome by itself. Restarting tracking for every box is correct if each new window is registered against the belt as found; keeping tracking on across boxes is correct if the nominal box reference advances by one measured pitch. The failures hide in the gap between those arrangements: a window that inherits the previous box's reference, or a nominal path that never advances. Both produce the same symptom — box one good, box two off, box three farther off, in equal steps.

How far does the belt travel while tracking is switched off? #

Belt travel during the gap is belt speed times gap time: at 0.15 m/s with a 1.2 s gap the belt advances 0.18 m, so a window that keeps the old reference lands 180 mm farther out and each following box adds another 180 mm.

Worked example, calculated for these inputs and not a measured result:

  • belt speed: 0.15 m/s
  • stop-to-restart gap: 1.2 s
  • tracking scale: 10,000 ticks/m — an example value; read the real one from the encoder setup of your own tracking configuration
  • gap travel: 0.15 m/s × 1.2 s = 0.18 m = 180 mm
  • gap travel in ticks: 0.18 m × 10,000 ticks/m = 1,800 ticks
  • cumulative drift with nothing re-anchored: box two +180 mm, box three +360 mm, box four +540 mm

The confirming check needs no stopwatch. Log the belt feedback value at the tracking stop and again at the restart, and subtract: the difference is the gap travel measured directly in belt ticks — 1,800 ticks at the example scale. When that difference converts through your scale to the same offset you measure between the expected and actual landing point, box after box, the stale reference is proven.

If belt speed is not constant, the gap travel changes with it — the same dependency that makes a routine behave as if the belt never sped up, covered in why robot conveyor tracking ignores encoder speed changes.

Why does feeding the measured TCP pose back put the offset in twice? #

While tracking is active, the pose the controller reports already includes the current belt compensation, so anchoring the next nominal target on that pose and tracking again applies the same belt travel twice, and the target walks one tracking offset farther along the belt every cycle.

A read such as get_actual_tcp_pose() returns the physical tool position in the base frame, while the target the tracking system executes is a nominal path point shifted by the live belt offset — two different quantities. The construction d_c = R_b_c*[dx, dy, dz] followed by pose_add(act_pose, p[d_c[0], d_c[1], d_c[2], 0,0,0]) only rotates a conveyor-frame translation into the base frame: a rotation changes a vector's direction, it does not identify a box, set an origin, or account for belt travel since registration. Anchoring a move on the measured pose is legitimate only when the measured pose and the target share one reference convention, or when the controller's documented conversion says they do.

The mirror-image failure is reuse. A target computed once outside the loop, or a pose variable renamed for the next box without recomputing it, feeds box one's coordinates into box two's cycle, and the robot works relative to where box one was — which reads on the floor as processing the second box against the first.

Test the stale-pose suspicion directly: log successive values returned by the pose read beside the targets the code generates. If the logged poses change while the generated targets repeat, the pose read is alive and the target generation is what is stale; find where that target is computed and advance or rebuild it every cycle.

Is the tracking scale setting (TPM) the cause? #

Scale is the wrong suspect when the single-object check passes: track one box along the belt with no relative motion and the tool stays glued to it and returns to its start, while a wrong scale makes even that single pass fall behind or run ahead.

That pass is the standard scale check, and a scale error does not survive it. Confirm the number independently anyway: mark a measured distance on the belt frame, run the belt, and compare the tick count the feedback reports against the tape-measured travel. Scale is feedback ticks per meter of real belt travel, it belongs to your encoder, pulley or roller dimensions, and you take it from that hardware's own configuration. Check the direction sign the same way: the configured conveyor direction must match the actual travel direction, because a flipped sign compensates backward and doubles the error instead of removing it. If tracking sits at null speed while its indicators show active, the belt feedback path itself is dead — a different fault from this drift, covered in why conveyor tracking stays at null speed with green LEDs.

How do I tell reference drift apart from mechanical drift or tuning lag? #

Match the shape of the error to its cause: a constant increment per box is reference handling, a fixed offset from box one is registration geometry, scatter that appears with the belt stopped is mechanical, and a smooth lag while the tool rides the belt is loop tuning.

Work the checks from cheapest to dearest:

  • Read the targets, not the floor. Compare the generated target values for box one and box two: targets that repeat while the physical landing points walk away prove stale generation before any hardware is touched.
  • Change the belt speed and rerun. An error that scales with speed points at gap travel or computation timing, because both are products of speed and time.
  • Stop the belt and cycle the robot between two fixed points. An offset that grows with the belt parked is drivetrain or mounting, and that diagnosis is walked through in diagnosing servo axis position drift in the drivetrain. Run this inside the cell's safeguarded procedure and its risk assessment, with nobody inside the guarded space.
  • Watch the tool ride one box. A smooth lag that grows during the ride is a servo-loop matter, not a reference one: the gain that holds one axis tight can sit several times looser on the next, which is why the Kv factor varies with axis loop tuning.
  • Add the computation time. The belt also advances while the controller reads a pose, calculates and schedules the move — travel equals speed times that elapsed time, usually small, but it stacks onto gap travel and grows with belt speed.

How do I fix tracking that restarts for each box? #

Re-anchor every new window to the belt as you find it: read the belt feedback at the moment tracking stops and again when it restarts, and build that window's box reference from the second reading, so the gap travel is absorbed instead of inherited.

  1. Log the belt feedback value at the tracking stop and at the restart of the next window; the difference is the gap travel in ticks — 1,800 ticks in the worked example above.
  2. Register the new window from the restart reading. Never carry the previous window's reference forward; the belt does not rewind for your program.
  3. Rebuild every waypoint of the next box — entry, contact end, exit — from that registered reference each cycle. Renaming the entry pose in_pose to a next-box name does not recompute its coordinates.
  4. Place the tracking stop where the window is meant to end so that it actually executes; a stop_conveyor_tracking() written after an unconditional loop never runs during production.
  5. Verify on the following cycle: the landing error should collapse to the robot's normal repeatability, and the logged tick difference should match the converted gap travel.

Registering each part against the belt position at its own moment of selection is exactly the principle behind tracking conveyor parts with an encoder and a FIFO buffer, and it holds for any pitch, not only for equidistant boxes.

How do I fix tracking that stays on across boxes? #

Keep one tracking session, keep the first registration as the only origin, and advance the nominal box reference by one measured pitch along the belt axis before each cycle: a 300 mm pitch is 0.300 m, which is 3,000 ticks at the example scale of 10,000 ticks/m.

Separate three operations and give each its own step: register the conveyor reference once, select the current box, and generate the contact path inside that box. Measure the pitch on the physical boxes rather than the drawing — equidistant is an assumption until a tape says otherwise, and the increment you command should be the pitch you measured. Advance the reference in the belt coordinate so direction and scale are handled once, then derive each next-box waypoint, MoveL or relative, from the advanced reference every cycle. And never adopt the last compensated actual pose as the next box's origin unless the controller's documented conversion explicitly requires it — that is the double-counting from the earlier section returning through a different door.

Questions asked

Can I just program an offset that cancels the drift?

No. The offset equals the belt travel missed during the gap or the compensation counted twice, so it changes with belt speed, gap time and pitch. A constant correction holds at one speed and fails at every other; re-anchoring the box reference to the belt as found costs the same effort and holds at any speed.

Why did renaming the next entry pose change nothing?

The coordinates were computed once and stored, so a new variable name points at the same old numbers. Renaming copies a reference; it does not rerun the geometry. Recompute every waypoint of the next box from the advanced or re-registered reference, and the names can stay as they are.

Does the same fix apply to a rotary tracking table?

Yes, with angular quantities in place of lengths. Read the encoder angle at each restart or registration, advance the reference by one angular pitch, and confirm the scale as ticks for a known rotation. The double-counting trap is identical, because a measured pose on a rotary table already carries its rotation offset.

Can a camera remove the need for the pitch increment?

Yes. When vision registers each box individually against the current belt position, every box gets its own measured reference and the fixed pitch assumption disappears; the increment is only needed when spacing is assumed rather than measured. Vision adds its own calibration to verify, so log the registered reference for every box either way.

Keep reading

  • Troubleshooting

    Servo Speed Control That Misses the Cut Position

    Registration error on a rotary cutter is a phase problem, not a speed-accuracy problem: a PID that holds RPM steady cannot correct it because nothing in that loop sees X1 minus X2. Keep the speed loop as the inner loop, capture X2 at the actual cut event, compute X1 - X2 as a wrapped phase error, and close a slow outer loop that trims the speed reference, updated once per cut.

    Servo and stepper motion

  • Troubleshooting

    Fix Servo Travel Error After Swapping Resolver and Encoder

    Travel that does not match the position display after a resolver-to-encoder swap is a scaling fault: the drive or the technology axis is still converting counts with the other feedback's increments per revolution. Measure one commanded move and divide actual by displayed travel; a constant ratio equal to the resolution ratio names the encoder data. Fix both layers, re-home, then re-tune.

    Servo and stepper motion

  • Explainer

    Mounting a Motor Encoder Behind a Belt Reduction

    No, not for commutation: field-oriented control switches phase current against the rotor's electrical angle, which only a sensor on the motor shaft reports directly. Behind a 10:1 belt, a 4096-count encoder gives about 410 counts per motor revolution — enough counts per pole to turn a 6-pole motor, but belt lash and multiplied noise put a load-dependent error inside the current loop. Use the belt-side sensor for velocity only; commutate from the motor shaft and add an output encoder if you need load position.

    Servo and stepper motion