Gapping Cartons Before a Scanner: Speed Ratio, Gap Length and the Eye That Measures It

A 300 mm tote leaving zone 12 at 0.280 m/s onto a metering belt running 0.513 m/s arrives at the scanner 250 mm behind the tote that left in front of it, and a 600 mm carton on the same two belts arrives 499 mm behind its neighbour. Neither number has a timer in it: gapping cartons is arithmetic. The gap is the product length multiplied by the speed ratio minus one, and the whole job is choosing that ratio from the shortest product the line runs and the smallest gap the scanner will read, then measuring what the belts actually did with one photo-eye two metres past the step.

Length times ratio minus one. The tote sets the ratio, not the carton.

Everything below is worked on the twelve-zone line from the zone logic article: a 5069-L320ER CompactLogix, polarised retroreflective 42EF eyes into a 5069-IB16, a PowerFlex 525 on every motor, zone logic in a 50 ms periodic task, accumulation zones at 0.280 m/s. The scanner tunnel on this line was specified by its integrator at a 200 mm minimum gap between products at 0.5 m/s, and the products are 300 mm totes, 600 mm cartons and 1219 mm cartons.

Why the hold timer stopped working at the scanner

The singulation handshake already makes a gap, and on paper it makes 150 mm.

It does it with time: zone 12 holds for 850 ms after each handover, and at 0.280 m/s that is 235 mm of belt, of which the coast of the held zone takes 70 mm and the detection chain 15 mm, leaving 150 mm between the box that left and the box behind it. That is a real gap and it is real at the release point. It is not real at the scanner, because between the release point and the scanner there were two transfers onto sections whose speed nobody had measured, and a section running 5% slower than the one feeding it closes a nose-to-nose pitch by 5% – which on a 300 mm tote with a 150 mm gap is 22 mm gone per transfer – and the drive on the last of them had its P042 lengthened in the spring, so the coast on every stop was 140 mm rather than 70. The gap measured at the scanner eye over a thousand totes came out with a mean of 92 mm and a spread of 38 mm, 998 of the thousand under the 200 mm the tunnel needs, and the no-read rate was 41 per thousand. A time hold buys distance at the speed of the belt it is on, and everything after that belt spends it.

A time hold makes a gap where the timer is. The scanner is somewhere else.

Gapping cartons on a speed step, and why the gap is proportional to length

Two belts at different speeds make a gap without a timer, and they make it the same size every time.

Advertisement

A tote leaves zone 12 nose first onto the metering belt. The nose is now travelling at 0.513 m/s while the tail is still being fed at 0.280 m/s, so the tote is being stretched off the slow belt, and the tote behind it – nose to tail with it, because accumulated product arrives nose to tail – does not reach the step until the first tote’s tail has crossed it. In the time the first tote takes to clear the step, its own length divided by the feed speed, 300 mm at 0.280 m/s is 1.07 s, its nose has travelled 1.07 s at 0.513 m/s, 550 mm. The gap behind it is 550 minus 300, 250 mm, and written generally that is the product length multiplied by the ratio of the two speeds minus one: 300 × (0.513 / 0.280 − 1). The same step gives the 600 mm carton 499 mm and the 1219 mm carton 1014 mm. Nothing about it depends on the scan, the drive ramp, or how long anybody held a zone, and the gap it makes is the gap that leaves the step, which is why the thousand-tote distribution after the change has a spread of 13 mm instead of 38.

Gapping cartons on a speed step, in side view: zone 12 at 0.280 m/s, the metering belt at 0.513 m/s and the scanner belt, two 300 mm totes nose to tail before the step and 250 mm apart after it, the gap eye PE_G 2 m past the step, and the gap arithmetic for three product lengths

The step converts the time each product takes to clear it into distance on the faster belt. The tote gets 250 mm, the long carton 1014 mm, from the same two speeds.

Proportional to length is the whole design rule. The shortest product is the one that gets the least gap, so the ratio is chosen for it: 200 mm on a 300 mm tote needs a ratio of 1.667, which is 0.467 m/s against a 0.280 m/s feed. This line runs 1.832 for 250 mm on the tote, because the scanner belt after the metering belt is a separate drive and separate drives drift, and a 50 mm margin is what a 10% slower scanner belt costs – the table below has the arithmetic. Every longer product then gets more than it needs and there is nothing to be done about that short of a second step, which nobody fits for a scanner.

Choose the ratio for the tote. The carton will take care of itself.

Throughput does not change. Totes nose to tail at 0.280 m/s arrive at 56 a minute, and 56 a minute is what leaves the step, each one now 250 mm from the next; the metering belt cannot pass more product than zone 12 gives it, it can only space what it gets. That is worth saying to whoever asks for the metering belt to be run faster to “get more through the scanner”, because a faster metering belt widens gaps and passes exactly the same number of totes.

Setting the ratio on the drives

The ratio is a ratio of belt speeds, and the keypad shows hertz.

Zone 12 runs at 30.00 Hz and moves the belt at 0.280 m/s. The metering belt has a different gearbox and a different drive roller, and at 42.50 Hz it was measured at 0.500 m/s with a chalk mark and a stopwatch over 3.00 m; the ratio of the two frequencies, 1.417, has nothing to do with the ratio of the two speeds, 1.786, and a metering belt “set to 1.8 times the zone speed” by someone reading the drives would have been running at 0.36 m/s and making 86 mm gaps. Measure both belts, in metres per second, loaded, and write the numbers on the drive. Then 0.513 m/s on the metering belt is 42.50 × 0.513 / 0.500, 43.60 Hz, and on a PowerFlex 525 commanded over EtherNet/IP that is a reference of 4360, because 520COM-UM001 defines the Reference as a 16-bit value in 0.01 Hz – the same units as the 3000 the zone drives get for 30.00 Hz. P047 [Speed Reference1] has to be option 15 “EtherNet/IP” and P046 [Start Source 1] option 5 for the reference to be taken from the controller at all, both PowerFlex 525-only settings in 520-UM001, and the same manual notes that a negative reference is not a reverse command but an overflow that sends the drive to maximum speed, which is one more reason the trim logic below has a floor.

P044 [Maximum Freq] stays at 60 Hz on the metering drive, and P041 [Accel Time 1] is defined in 520-UM001 as the time from 0 Hz to that maximum, so the ramp only matters on a line start; once the belt is at speed the ratio is fixed by the two references and the two gearboxes. What is not fixed is the scanner belt, which has to run at least as fast as the metering belt and is its own drive with its own reference. Set it to the same 0.513 m/s, in its own hertz, from its own chalk-mark measurement.

Advertisement

Two chalk marks, two stopwatches, two numbers on two drives. Then the hertz.

Three ladder rungs: a TONR GapTmr enabled while PE_G is clear and the metering belt is running, a MUL on the rising edge of PE_G converting the timer to millimetres with a MIN into Gap_Min, and a trim rung that adds 25 to FreqRef_M once per twenty cartons while Gap_Min is under 220 and the reference is under 4600

Rung 40 times the clear beam. Rung 41 converts on the leading edge and keeps the worst gap of the batch. Rung 42 is the trim, with the ceiling written into the rung rather than left to a comment.

The eye that measures it, and what its number is worth

One eye, two metres past the step, timing the gap between the tail of one product and the nose of the next.

PE_G is a 42EF polarised retroreflective eye across the metering belt at 2.0 m from the step, far enough that the longest carton is fully on the fast belt and the gap behind it is finished forming. A TONR runs while the eye is clear and the belt is running; on the next rising edge of the eye the accumulated milliseconds are multiplied by the belt speed in millimetres per millisecond, 0.513, and that is the gap in millimetres. The timer’s time is real time – Logix timers add elapsed clock time to the accumulator, not scans – but the edges that start and stop it are seen at the task period, so in a 50 ms task the measurement is quantised to 50 ms either way, which at 0.513 m/s is ±26 mm on a 250 mm gap. That is coarse enough to matter, and the fix is to put the gap-eye routine in its own 10 ms periodic task, where the quantisation drops to ±5 mm and the rest of the chain, a 1 ms sensor and the 5069-IB16’s 1 ms default filter, is under a millimetre. If the gap has to be measured to the millimetre, the 5069-IB16F records a CIP Sync time stamp on each edge of each point and the arithmetic is done on the stamps; for a scanner gap it is not worth the module.

(* GapTask, 10 ms periodic - measure and trim *)
GapTmr.PRE := 60000;
GapTmr.TimerEnable := NOT PE_G AND Belt_M_Running;
TONR(GapTmr);

IF PE_G AND NOT PE_G_Last THEN               (* leading edge: the gap just closed *)
    Gap_mm := DINT_TO_REAL(GapTmr.ACC) * 0.513;
    Gap_Min := MIN(Gap_Min, Gap_mm);
    GapTmr.Reset := 1;
    Batch20.CountUp();                        (* CTU, preset 20 *)
END_IF;
PE_G_Last := PE_G;

IF Batch20.DN THEN
    IF Gap_Min < 220.0 AND FreqRef_M < 4600 THEN
        FreqRef_M := FreqRef_M + 25;          (* +0.25 Hz *)
    ELSIF Gap_Min > 300.0 AND FreqRef_M > 4360 THEN
        FreqRef_M := FreqRef_M - 25;
    END_IF;
    Gap_Min := 9999.0;
    Batch20.Reset();
END_IF;
Drv_M.O.FreqCommand := FreqRef_M;

Two numbers in that block are the design and everything else is plumbing. The floor of 4360 is the calculated ratio, and the trim is never allowed below it because a gap that is reading long is a gap that is fine. The ceiling of 4600 is the scanner belt: raise the metering belt above what the belt after it can carry away and the gap closes again at the next transfer, this time with the scanner in the middle of it, so the ceiling is set from the scanner belt’s measured speed and not from the metering drive’s capability. Between the two limits the trim is covering belt slip on a cold morning, a product code with a slick base that lags the fast belt for 20 mm before friction catches it, and the ratio drifting when someone changes a gearbox oil and a roller diameter with it. It is not there to find the ratio. The ratio was found with the chalk mark.

The floor is the arithmetic. The ceiling is the belt after this one.

A gap alarm belongs on the same eye. Twenty consecutive gaps under 200 mm means a belt has changed speed, and that is worth knowing before the scanner’s no-read counter says so.

Histogram of the gap measured at PE_G for a thousand 300 mm totes each way: the time-hold distribution centred on 92 mm with 998 under the 200 mm scanner minimum, and the speed-step distribution centred on 249 mm with none under it

Worked from the article’s numbers, not a stock plot. The hold’s gap was spent on two transfers and a longer coast before it reached the eye; the step’s gap is made 2 m before it.

What the belt after the step takes back

A gap made at one step is spent at the next, and the arithmetic is one line.

Product crossing from the metering belt at 0.513 m/s onto a belt at some slower speed keeps its nose-to-nose pitch in time and loses it in distance: the pitch of 550 mm becomes 550 × v3 / v2, and the gap is that minus the product length. Two percent slow, 0.503 m/s, and the tote’s 250 mm is 239 mm – fine. Ten percent slow, 0.462 m/s, and it is 195 mm, under the tunnel’s minimum, while the 600 mm carton on the same belt still has 389 mm and reads perfectly. That is the signature to look for when a scanner starts missing totes and only totes: the shortest product is the first one under the line, and it is under it because a downstream belt slowed, not because the metering belt did.

Totes go under the line first, and only the totes. That is the signature.

Table of the gap each product gets at a 1.832 ratio, what a 2% and a 10% slower following belt leave of it, the ratio needed for 200 mm on the tote, the ratio chosen, and the throughput

The tote decides the ratio and the tote is the one a slow scanner belt pushes under the minimum. Throughput is the feed rate whatever the ratio.

The thing everyone checks first

The scanner.

No-reads send people to the tunnel: the trigger eye gets moved, the read window gets widened, the integrator gets called, and the no-reads carry on because the scanner is reading exactly what it can see, which is two totes 90 mm apart in a window sized for 200. Put Gap_mm on a trend at the task period for an hour before touching the tunnel, and if the gaps are short the scanner is not the problem. Then check the drive references against the commissioning sheet in metres per second, not hertz, and check the belt after the metering belt before the metering belt itself, because a belt that is slow closes gaps and a belt that is fast opens them, and the one that changed is almost never the one somebody is looking at.

Advertisement

Next step

Chalk-mark every belt between zone 12 and the scanner and write the speed on the drive in metres per second at the reference it actually runs. Then compute the gap for your shortest product at your ratio and compare it with Gap_Min over a shift: a difference of more than 30 mm means a belt speed on the sheet is wrong. The lead distance a divert needs on the same belt is measured the same way, and the merge arbiter upstream of a step like this one needs its takeaway speed in the same units, because a merge that releases onto a belt whose speed changed with the gearbox oil is a merge whose token clears late. If the drive on the metering belt is new to you, the command word and reference wiring from the controller side is in driving a PowerFlex 525 from ControlLogix.