AutomateDirectUSAMotion LibraryIndustrial monitors & PCs

How-to

Stop-and-pick conveyor: wait on the input with a timeout

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

Short answer

The sensor LED proves the wiring; the missing piece is program logic. Build a Loop that starts the belt, polls digital_in[1] with a short Wait, sets the conveyor output LOW the moment the input reads TRUE, and raises the No Part Detection popup only after a timeout longer than the worst-case belt transit time plus the feeder gap. Conveyor tracking is not needed unless the belt keeps moving during the pick.

On this page
  1. Why the LED proves only half the cell
  2. What not to build first
  3. The quantities that set the behavior
  4. Sizing the No Part timeout for a 0.2 m/s belt with a 12 s feeder gap
  5. Build the loop in eight steps
  6. Electrical checks when the logic is right
  7. Run these checks before calling it done
  8. Pitfalls that look like program faults
  9. Questions asked

If the sensor LED lights and the live input indicator toggles with a part, the sensor and its wiring are proven; what is missing is program logic. A digital input is a level, not an event, and nothing in the controller reacts to it unless a program node reads it at the right moment. The fix is a Loop that starts the belt, polls digital_in[1] with a short Wait, sets the conveyor output LOW the moment the input reads TRUE, and raises the No Part Detection popup only after a timeout longer than the worst-case belt transit time plus the feeder gap. Conveyor tracking plays no part in a cell where the belt stops at the sensor.

Why the LED proves only half the cell #

The program executes top to bottom, once per pass. When execution reaches a node that tests the input, the input has exactly one state, and the node acts on it and moves on. Nothing re-checks later unless a loop brings execution back. So the observed behavior, robot continuing on TRUE with no defined behavior on FALSE, is exactly what a program without a wait structure does. The sensor is not the problem; the missing piece is the structure that waits, stops and alarms.

The program needs three behaviors, in this order: wait for TRUE, stop the belt when TRUE arrives, and raise the alarm only after a defined timeout with the input still FALSE.

What not to build first #

  • The Conveyor Tracking template. It is built for a belt that keeps moving while the robot follows parts, using a conveyor reference such as an encoder. A stop-and-pick cell with one end-of-belt sensor has no moving-frame problem, so the template adds configuration nothing in the cell supplies. For a cell where the belt genuinely keeps moving, encoder-based tracking is the right tool, as covered in When integrated vision plus conveyor tracking is enough for one robot.
  • A single If node on the input. An If evaluates once, when execution reaches it. If the part has not arrived, the False branch runs or is skipped, and the program moves on. Nothing re-checks.
  • The I/O tab as evidence. The LED and the live indicator show the electrical state only. They say nothing about whether the program reads that state at the right point in the cycle.

The quantities that set the behavior #

Quantity What it decides Where it comes from
Input level, TRUE with a part present The condition the loop tests Installation tab, I/O, live indicator for the input pin, checked with a part present and absent
Sensor polarity, PNP sourcing or NPN sinking Must match the controller input wiring convention Sensor datasheet and the controller I/O wiring section of the manual
Belt transit time, feeder to sensor The minimum No Part timeout Measured with a stopwatch or logged timestamps in a test run
Worst feeder gap between parts Added to transit time before the timeout is set Observed over a production run
Belt stopping distance after the output drops Whether the part stops inside pick tolerance Measured at production belt speed
Conveyor run output The output the Set node drives Installation tab, I/O, output assignment, tested manually

The case is decided by one comparison: how long a part takes to reach the sensor against how long the program waits before declaring No Part Detected. Every timeout shorter than that sum produces false alarms that look like sensor faults.

Sizing the No Part timeout for a 0.2 m/s belt with a 12 s feeder gap #

These inputs are example values for one typical cell, not measurements; the arithmetic is what you reuse with your own numbers.

Inputs:

  • Belt speed: 0.2 m/s, taken from the drive's speed setting
  • Feeder-to-sensor distance: 1.5 m, measured along the belt
  • Worst feeder gap: 12 s, the longest interval between parts observed in a production run
  • Margin: 25 percent, a rule of thumb for feeder variability
  • Polling Wait: 0.1 s
  • Belt stopping distance after the output drops: 30 mm, measured at production speed
  • Pick tolerance: 50 mm total window (plus or minus 25 mm from the taught pose)

The rule in words: the No Part timeout must exceed the worst feeder gap plus the belt transit time, with a margin for variability. The polling latency, converted to belt travel, plus the stopping distance must fit inside the pick tolerance.

Arithmetic:

  • Transit time = 1.5 m ÷ 0.2 m/s = 7.5 s
  • Worst-case arrival = 12 s + 7.5 s = 19.5 s after cycle start
  • Timeout = 19.5 s × 1.25 = 24.4 s, rounded up to 25 s
  • Polling latency as belt travel = 0.1 s × 0.2 m/s = 0.02 m = 20 mm
  • Stop window at 0.1 s polling = 20 mm + 30 mm = 50 mm, exactly the whole tolerance with nothing left over
  • At a 0.05 s Wait: 10 mm + 30 mm = 40 mm, leaving 10 mm of margin

Result and decision: set the timeout to 25 s. Any value at or below 19.5 s raises false No Part alarms on normal feeder gaps. Shorten the polling Wait to 0.05 s, because a latency contribution of 20 mm fills 40 percent of the 50 mm tolerance window; the working rule is to keep polling latency under a quarter of the tolerance, and 10 mm meets it. This is a calculated example for the stated inputs, not a measured result; remeasure stopping distance after any belt speed change.

Build the loop in eight steps #

  1. Confirm the input: cover and uncover the sensor and watch the live indicator for digital_in[1] toggle both ways. If it reads TRUE with no part, the sensor is normally closed; swap it or invert the comparison before writing any logic.
  2. Assign a controller digital output to the belt run command and toggle it from the I/O tab to prove the belt starts and stops.
  3. Measure belt transit time and the worst feeder gap, then set the timeout as in the worked example above.
  4. Declare a counter variable, for example poll_count, integer type, initial value 0.
  5. Build the structure: an outer Loop starts the belt with a Set node, an inner Loop polls the input, and the timeout branch holds the Set node that drops the belt and the Popup.
  6. Teach the pick pose with the belt stopped at its normal stop position, never with a part hand-placed.
  7. Set the Popup to block program execution until the operator acknowledges it.
  8. Run the confirmation checks in the next sections before handing the cell to production.

The structure in pseudocode, with the example values from the sizing section:

# poll_count: integer, declared in the program, initial value 0
# timeout trip point: 25 s / 0.1 s per poll = 250 polls
Loop                         # outer cycle
  Set conveyor_output HIGH
  poll_count = 0
  Loop                       # polling loop
    If digital_in[1] == True
      Break
    Wait 0.1 s
    poll_count = poll_count + 1
    If poll_count >= 250     # timeout expired, still no part
      Set conveyor_output LOW   # belt stops BEFORE the alarm
      Popup "No Part Detection"  # blocks until acknowledged
      Break
  Set conveyor_output LOW     # part present: stop the belt
  pick sequence

Two things this ordering guarantees: the belt output is LOW before the popup appears, so parts do not keep feeding into the sensor zone while the operator is away, and after the popup is acknowledged the outer Loop restarts the cycle cleanly instead of resuming mid-sequence. The short Wait keeps the program from spinning at full cycle rate; a Wait node on the input alone blocks indefinitely when no part arrives, which is why the counter exists.

One boundary to keep straight: this input-driven stop is a control function, not a safety function. Guarding and interlocked access are set by the machine's risk assessment and the applicable machinery safety standard, and must act through their own devices.

Electrical checks when the logic is right #

Erratic behavior with correct logic usually comes from the sensor side:

  • Polarity mismatch. A PNP sensor sources the positive side and an NPN sensor sinks the negative side; the type must match the input wiring convention, or the input never reads TRUE at all. The same mismatch appears when a sourcing sensor faces an active-low input, as covered in Why a PNP proximity switch does not fit an active-low input.
  • Chatter at the sensing edge. A reflective or dark part can sit at the edge of the sensing range, so the input toggles rapidly and the belt stops short or overshoots. Cover and uncover the sensor repeatedly while watching the I/O tab; rapid toggling at the edge is the confirming check.
  • Trigger before center. A sensor whose field catches the leading edge stops the belt before the part is centered under the pick pose. That is a placement fault, not a logic fault: shift the sensor, add a short stop delay, or teach the pose to the actual stopped position.
  • Wiring. If the input reads nothing at all, revisit the sensor's power and signal wiring; the full hookup pattern is in Wiring a Proximity Switch to Trigger a Robot Gripper and Conveyor.

Run these checks before calling it done #

  • Run with no parts for longer than the timeout. The belt output must go LOW and the popup must appear.
  • Feed a single part. The belt must stop with the part inside pick tolerance and the robot must pick it without a touch-up.
  • Run at least 50 consecutive cycles at production belt speed and log the stopped-position variation.
  • Cover and uncover the sensor repeatedly while watching the I/O tab to expose edge chatter.
  • Trigger the popup, acknowledge it, and confirm the program resumes at the polling loop without restarting the cycle out of sequence.

Pitfalls that look like program faults #

  • A conveyor output left HIGH while the popup is displayed keeps feeding parts into the sensor zone. The Set node that drops the output goes before the Popup, always.
  • A timeout shorter than the feeder gap time causes false alarms that look exactly like sensor faults. Size it from the arithmetic above, not from a guess.
  • Tracking-template parameters such as encoder setup are unnecessary here and add commissioning time with no benefit on a stopping belt.
  • Without a stopping-distance allowance, a faster belt shifts the stop position; recheck the pick pose and the timeout after any speed change.
  • A poll counter that is not reset at cycle start makes the timeout drift shorter every cycle; zero it where the pseudocode shows it.

Questions asked

Can the Wait node's own time limit replace the inner polling loop?

Yes. A Wait node can be configured with a time limit as well as an input condition; when the limit expires, follow it with an If on the input and run the alarm branch when it still reads False. The result is identical to the polling loop. Keep the conveyor output Set and the Popup in that branch either way, and reset your poll counter before the next cycle so the timeout starts fresh.

How do I tell a normally closed sensor from a wiring fault?

Cover and uncover the sensor while watching the live input indicator. A normally closed sensor shows TRUE with no part and FALSE with one, which inverts the whole program. A wiring fault usually shows one stuck state in both conditions. Swap in a normally open sensor or invert the comparison, but do not mix the two conventions across the cell, or the next technician will misread the logic.

Do I lose anything by not using the conveyor tracking template?

Nothing on a belt that stops at the sensor. The template exists for a belt that keeps moving while the robot follows parts, and it needs a conveyor reference such as an encoder plus extra commissioning. Skipping it removes encoder setup, reference tuning and tracking parameters. If the cell later changes to moving picks, that is the moment to add the encoder and the tracking configuration.

Is stopping the belt on a sensor a safety function?

No. It is ordinary control logic: it can fail from a stuck input, a broken wire or a program edit, and the popup is not an interlock. Guarding, fixed barriers and any interlocked access come from the machine's risk assessment and the applicable machinery safety standard, and they must stop hazardous motion through their own devices, independent of this loop.

When should I escalate to the robot vendor's support?

Escalate when the live input indicator shows the wrong state with verified wiring, or when the indicator reads correctly while the running program ignores the input. Bring the controller's software version and the program file; both are needed to reproduce the behavior. Before calling, run the loop with the Popup replaced by a simple output toggle to rule out the Popup node's program-blocking setting.

Keep reading

  • Explainer

    Why a loading robot cannot place a part on a moving conveyor belt

    WaitWobj waits forever at a loading station because an empty flat belt never registers a tracked object. Register a virtual placement object instead: each time the conveyor position advances one part pitch and the belt-clear sensors qualify the space, issue one latched new object strobe, and retire the object once the part is placed. The strobe follows conveyor position, never belt speed or elapsed time.

    Servo and stepper motion

  • Troubleshooting

    Why a Robot Faults When the Conveyor Stops

    A tracked robot that errors when the conveyor halts is usually missing coordinated stop tracking, not a missing input. Conveyor position and stop/run state travel on separate paths; confirm valid position feedback, confirm the stop-state input, then enable the controller's stop-on-point tracking setting.

    Servo and stepper motion

  • Explainer

    Why joint torque can detect an empty pick without a load cell

    Yes, with limits: read stationary at a repeatable pose, the controller's estimated external joint torque separates a 35 kg carton from an empty pick, because the carton adds a gravity moment of about 412 N·m on the carrying joint at a 1.2 m reach. The empty and loaded ranges must come from your own known picks, and overlapping ranges mean a load cell is still required.

    Sensors, encoders and machine vision on the machine