Abstract:
A system for counting a series of progressively moving articles using one or more sidewardly positioned and angularly oriented ultrasonic transducers which bathe the articles with ultrasonic waves and receive echoes reflected backwardly therefrom. Distances to the articles are determined by measuring round-trip sonic travel times. Count adjustment signals are generated when articles pass through the fields of view of the transducers and are replaced by other articles at measurably different distances.

Description:
BACKGROUND OF THE INVENTION 
     This invention relates to the field of article counting and more particularly to the counting of bottles, jars, cans, containers and similar objects being transported along a conveyor. Counting of such articles is complicated by the fact that they tend to back up and reverse direction on the conveyor, so that individual articles become indistinguishable to commonly used sensors. The prior art does include arrangements for counting overlapped sheets, newspaper sections, signatures and the like with the aid of specially positioned ultrasonic transmitters and receivers. However, the positioning of the transmitters and receivers is peculiar to the geometry of overlapped sheet-like articles. Such counting systems are not entirely suitable for counting irregularly shaped and variously spaced articles traveling in an upright orientation along a conveyor. An example of such a counting system appears in Duss U.S. Pat. No. 5,005,192. 
     The prior art also includes counting systems having inductive proximity sensors which may be placed in pairs on the same side of a pass line or on opposite sides thereof. The two sensors are offset for performing a quadrature count. These sensors are suitable only for counting metallic articles. Also, whenever the article size is changed the sensors must be realigned. 
     Yet other prior art uses pairs of optical sensors which are laterally separated by a distance equal to half the diameter of articles being sensed, so that a given article is sensed by both sensors sequentially and at different times before another article is sensed by either sensor. Again, the sensors must be realigned upon changes of article size. 
     It is therefore seen that there is a need for an improved apparatus and method for counting progressions of variously positioned articles of arbitrary construction which may start, stop and reverse their direction of movement. 
     SUMMARY OF THE INVENTION 
     The present invention provides an improved apparatus and method for counting a series of progressively moving articles. It involves the use of an offset, directional and angularly oriented, sonic transducer which bathes the articles with pulsed sonic energy and receives echoes reflected backwardly therefrom. A system clock provides a measurement of the round-trip sonic travel time, which is proportional to the distance between the transducer and a target positioned within the transducer&#39;s field of view. As a target article passes through the field of view, there is a progressive change in the measured travel time. This is followed by an abrupt change in the travel time when a new target enters the field of view. This invention contemplates the use of that change to trigger an incrementation of a count maintained in a count register. 
     Preferably, the invention utilizes a pair of such transducers, facing an article pass line in an inwardly toed arrangement, so that one transducer observes the articles during their approach, while the other views them as they depart. Accordingly the transducers have radiation axes which are directed somewhat toward each other at fixed angles ranging between 10 deg. and 80 deg. from perpendiculars to the article pass line. It has found that best results are obtained when these angles are about 40 deg. 
     When a progression of moving articles are bathed acoustically by different beams operating at the same carrier frequency, care must be taken to avoid interference at the points of reception. This is done by operating the transducers in an alternately pulsed fashion. Whenever one receiver is active, the other receiver is turned off. Preferably each of the transmitters generates ultrasonic pulses having a pulse width of about 4 to 16 microseconds with a pulse repetition rate of about 1,000 Hz. The transducers should be operated at an ultrasonic frequency which is heavily attenuated in air. The required amount of the attenuation depends upon the power of the transmitters and the sensitivity of the receivers. In particular a sonic burst from one transducer should be attenuated sufficiently that it is below the detectable level before the next burst from the other transducer (about one millisecond). 
     It is a feature of the invention that the distance to an article is known at a series of closely spaced times. This makes it possible to calculate the radial velocity of the article. Also the article moves along a path having a fixed and known offset from the sensor. From that information it is possible to calculate the component of the article velocity in a direction along the path, except for the instant of time while the article lies along a perpendicular from the sensor to the path. 
     Article velocity information has many uses and is a collateral benefit of the invention. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     FIG. 1 is a perspective drawing of an ultrasonic sensor positioned in accordance with the present invention for counting a series of moving articles; 
     FIG. 2 is a top plan view illustrating positioning geometry for an ultrasonic sensor; 
     FIG. 3 is a plot of the distance between a moving article and a stationary ultrasonic sensor; 
     FIG. 4 is a schematic block diagram of apparatus for article counting; 
     FIG. 5 is a top plan view of an article counting system utilizing two ultrasonic sensors; and 
     FIG. 6 is a schematic plot of target distance signatures for a series of articles being counted by the embodiment of FIG. 5. 
    
    
     DESCRIPTION OF THE PREFERRED EMBODIMENTS 
     FIG. 1 illustrates the invention in its simplest form, employing a single ultrasonic transducer. Thus the invention contemplates a conveyor 10 carrying a series of articles 12. Conveyor 10 has a pair of sidewalls 14, 114 and a moving belt 16 traveling in a direction as indicated by an arrow 18. An ultrasonic transducer 22 is positioned above conveyor 10 as indicated by a coordinate system having a vertical axis 30 and horizontal axes 32, 34. Transducer 22 directs a beam of ultrasonic energy along a line 50. The line 50 is in a horizontal plane above front sidewall 114. The coordinate axis 34 is perpendicular to the direction of travel of containers 12, and the direction line 50 makes an angle A with this axis. Preferably the angle A may be about 40 degrees, but it may have a value anywhere between 10 degrees and 80 degrees or between -10 degrees and -80 degrees. It is significant to note that the beam of transducer 22 may have an angular component in the direction of the arrow 18 or in a direction reversely thereof. 
     As the articles 12 travel along conveyor 10 they pass through the beam of transducer 22 and reflect echoes backwardly toward their point of origination. These echoes are detected by transducer 22, and the round-trip travel time is measured. This travel time progressively increases or progressively decreases depending upon the sign of the angle A. 
     Referring now to FIG. 2, there is shown an article 12 traveling in the direction 18. An ultrasonic transducer (not illustrated) is positioned at a point 54 and generates a beam of ultrasonic energy along a direction line 55 making an angle A with the axis 34. Again, axis 34 is perpendicular to the direction of movement of article 12 The ultrasonic energy traveling in the direction 55 forms a beam as generally indicated by the lines 57, 59. The article 12 is observable by the transducer only while it is between lines 57, 59. Detection occurs when the article crosses line 57, at which time its distance from transducer 12 is D1. Sensing of article 12 ceases at a distance D2 when the article crosses line 59. During the sensing period the distance between article 12 and point 54 decreases progressively as illustrated by FIG. 3. So long as echoes are being detected, the system keeps track of the distance change by a calculation of the form: 
     
         D.sub.dif =D.sub.new -D.sub.old 
    
     Normally D dif  has a negative value. 
     If no other article appears before article 12 passes out of visibility, there will be a loss of echo detection. Such a loss of echo, persisting for a predetermined period of time following an echo presence, triggers an incrementation of an article count in a microprocessor (not illustrated in FIG. 2). However, if a new article enters beam 55 before echo loss occurs, D dif  goes momentarily positive. This also triggers an incrementation of the article count. It will be appreciated that other abrupt changes in the target distance may be used for initiation of an article count adjustment. 
     The invention described above with reference to FIG. 2 may be extended to a two-transducer arrangement as illustrated in FIG. 5. For that arrangement article distance differences are cumulated and separately queued for the two transducers. This enables verification of the count. Count adjustment signals are generated when corresponding difference accumulations appear in the queues for different transducers. 
     Referring now to FIG. 5 the two-transducer arrangement will be discussed. As illustrated therein, two counting transducers 1 and 3 are built into a cartridge 60 and generate a pair of inwardly toed ultrasonic beams 81, 83. A third transducer, indicated by the reference number 2, is provided for jam and proximity detection and will not be discussed further herein. Transducers 1, 3 view a progression of articles 12 arranged against a backboard 86 and traveling in direction 88 along a pass line 84. Transducer 3 views the articles 12 during their approach, and transducer 1 views them during their departure. This is so, because beam 81 is angled at an angle A1 of approximately -40 degrees relative to a perpendicular line 61 while beam 83 is directed at an angle A3 of approximately +40 degrees relative to a perpendicular line 63. 
     Beams 81, 83 are pulsed on for 4-16 microseconds in alternating 1 millisecond intervals so as not to interfere with each other. The sound carrier frequency is above 200 KHz and preferably about 500 Khz. Sound waves at this frequency are highly attenuated in air. Therefore second trip echoes are avoided even at relatively short distances. 
     FIG. 6 illustrates a sequence of 4 distance signatures 201-204 for four containers as observed by transducer #3 and a series of 4 distance signatures 211-214 as observed by transducer #1 for the same four articles. It will be observed that the distance signatures 211-214 are displaced in time with respect to the distance signatures 201-204. Each distance signature is characterized by a series of spaced bursts 220 as beams 81, 83 are switched on and off. 
     A block diagram illustrating the major electronic components for a two-transducer version of the invention is shown in FIG. 4. Included therein is a microprocessor 302 housing a system clock 399 which provides timing signals for measuring the round trip travel of ultrasonic pulses generated on an alternating basis by transmitters 341 and 343 of transducers 1 and 3 respectively, under control of microprocessor 302 via control lines 321 and 323. Echoes which are returned by target objects are received by receivers 351 and 353 of transducers 1 and 3 respectively. The returning echoes are processed by receivers 351, 353, digitized and relayed to microprocessor 302 by connection lines 361, 363. Microprocessor 302 processes the signals on line 361, 363 as appropriate for generation of count incrementing and decrementing signals which are relayed to a count register 315 by a line 398. It will be appreciated that count register 315 may be any type of count indicating device and that the incrementation thereof may be performed inside microprocessor 302. A control panel 310 accepts manually generated setup parameters and transmits them to microprocessor 302 via a cable indicated by a line 398. 
     TABLE I presents a structured English description of the program which is executed by microprocessor 302, beginning with a description of the terminology employed. As described in the table, there is an Executive routine which reads echo data from transducers 1 and 3 on an alternating basis under control of system interrupts. Processing of data from one transducer proceeds simultaneously with reading of data from the other. Table I speaks of distances rather than round trip echo travel times, but this is merely a matter of convenience. It will be understood that travel times and distances are proportional, and may be used interchangeably. 
     The Executive routine begins by calling a subroutine CNTPRC --  INIT, which initializes all variables. Thereafter the Executive routine reads echo data from the two transducers. It will be seen that echo distances are temporarily stored in a 3×1 array ScanEchoPostn[n] which may have index values 0 or 2. ScanEchoPostn[0] stores the most recent echo data from transducer 1, and ScanEchoPostn[2] stores the most recent echo data from transducer 3. After the Executive routine stores an echo distance, it changes the index value for ScanEchoPostn[n], calls a subroutine CNTPRC() and reads a new echo distance. The process repeats endlessly. 
     CNTPRC() is a subroutine for processing the echo data. Each pass through the subroutine, the microprocessor copies the most recent echo data to a variable, ThisPostn, compares it with the previous value for the same transducer (stored in LastPrcPostn[ ]) and finds the difference, DiffDist. The values of DiffDist are cumulated in two array variables, Accum[O].MoveDist (for transducer 1) and Accum[1].MoveDist (for transducer 3). Two other array variables, NoEchoCnt[0] and NoEchoCnt[1] are used for counting strings of non-echoes which follow an echo detection. 
     In an ideal case, as a container approaches transducer 3, DiffDist and Accum[1] are both negative. This condition obtains until the container begins to leave the sonic beam and is replaced by a new container. At that instant DiffDist goes temporarily positive, and the program deduces that it may be appropriate to increment a count variable known as CntainerCount. However, before doing so, the microprocessor calls a subroutine CNTCHK for approval of the count incrementation action. In like manner the microprocessor calls CNTCHK when DiffDist goes temporarily negative for a positive Accum[0].MoveDist. In the event that either of NoEchoCnt[0] or NoEchoCnt[1] reaches a value of 100 the program makes a preliminary assessment that a lone container has passed through the beam and should be counted. This also leads to an approval call to CNTCHK. 
     In a real world case the containers may back up, stop and even reverse direction. The CNTCHK subroutine deals with these anomolies by queueing and comparing values of Accum[1].Mov.Dist and Accum[0].MoveDist. After CNTCHK has approved a count modification, it calls another subroutine, MAKECNT(Rcvrlndx, Move,Dist) to adjust the value of ContainerCount. As described in table I the program can count both forward and backward, so that if there is a temporary reversal of the container movement, the value of ContainerCount decreases. 
     
                                           TABLE I__________________________________________________________________________Terminology|  Signifies a bitwise OR operation&amp;      Signifies a bitwise AND operationxxx[n] In variable definition, this defines an array xxx of n elements.  Index as 0to n-1  In processing, this refers to index n of array xxxxxx.zzz  In variable definition, this says element zzz belongs to structure  xxx.  In processing, this refers to element zzz of structure xxx.xxx[n].zzz  In variable definition, this says element zzz belongs to a  structure xxx  which is an array.  In processing, this refers to element zzz at index n of structure  array xxx.Rcvr is used in place of transducer, in order to reduce the length ofvariable namesRcvrIndx is 0 for transducer 1, and 1 for transducer 3.Postn refers to the distance from the transducer face to the containerDist refers to the distance that the echo positions have been tracked************************Count - VariablesScanRcvrNum    Receiver being scannedPrcRcvNum    Receiver being processed by CNTPRCScanEchoPostn[3]    Last echo distance for indicated transducer. Program uses array    index 0 for echo data from transducer 1 and array index 2 for    echo data from transducer 3.    Array index 1 is not used.ThisRcvrIndx    Index for transducer for which an echo distance is currently           available.OtherRcvrIndx    Index for other transducer* During processing, the move differences are accumulated inAccum[n].MoveDist, and the nearest* echo* position is savedin Accum[n].NearPostn. When a break in echo occurs,theMoveDist andNearPostn are* shifted through the queues and acted upon when they reach Qued4Accum[2].MoveDist     Accumlated move distanceAccum[2].NearPostn     Nearest echo distance. Invalid move if not close to pass lineQued1[2].MoveDist     First queue of move distancesQued1[2].NearPostn     First queue of newest echo distancesQued2[2].MoveDist     Second queue of move distancesQued2[2].NearPostn     Second queue of nearest echo distancesQued3[2].MoveDist     Third queue of move distancesQued3[2].NearPostn     Third queue of nearest echo distancesQued4[2].MoveDist     Fourth queue of move distancesQued4[2].NearPostn     Fourth queue of nearest echo distancesLastprcPostn[2]     Last processed echo position for each tansducer. Updated at     exitof processingAccumDist[2]     Accumulated move distance for each transducer.NoEchoCnt[2]     No echo counter for each transducerClearQueueFig[2]     Flag to clear queues. Set non-zero after 100 non echoes     (After 25 non-echoes, Accum arrays get processed)DiffDist  Movement since the last scan for this rcvrContainerCounter     Count of containers** The following variables are set at initialization and not changed  againe*PassLinePostn[2]    The distance from transducer to pass lineNextCanDist    The distance that qualifies as a jump to next containerGoodMoveDist    The distance that qualifies as a good move stringPoorMoveDist    The distance that qualifies as poor move stringDirectionFlg    Specifies left-to-right or right-to-left************************EXECUTIVE ROUTINECall CNTPRC.sub.-- INIT     * Initialize count processing** Scan and process each Rcvr sequentially*ScanRcvrNum = 1Start scan cycle for ScanRcvrNumDO Wait for end of scan for ScanRcvrNum If Received an echoScanEchoPostn[ScanRcvrNum-1] = Current Echo Distance ElseScanEchoPostn[ScanRcvrNum-1] = 0    * no echo PrcRcvrNum = ScanRcvrNum IF (ScanRcvrNum = 3)ScanRcvrNum = 1 ELSEScanRcvrNum = 3 ENDIF** Processing required for getting an echo distance from RcvrNum is done  by interrupts.*Start scan cycle for ScanRvrNum** While collecting the echo distance for ScanRcvrNum with interrupts,the* the echo distance from the just completed Rcvr (PrcRcvrNum) isprocessed*Call CNTPRC()WHILE (Forever)*************************SUBROUTINE CNTPRC.sub.-- INIT** initialize count processing*Zero all variablesInitialize NextCanDist, GoodMoveDist, and PoorMoveDist for container sizeand shapeInitialize DirectionFlg based on selected directionPassLinePostn[0] = Nearest distance from rcvrl to container along passlinePassLinePostn[1] = Nearest distance from rcvr3 to container along passlineReturnENDSUB - CNTPRC.sub.-- INIT*************************SUBROUTINE CNTPRC()** Process ScanEchoPostn for PrcRcvrNum*IF (PrcRcvrNum = 1)ThisRcvrIndx = 0OtherRcvrIndx = 1ELSEIF (PrcRcvrNum = 3)ThisRcvrIndx = 1OtherRcvrIndx = 0ELSEReturn     * PrcRcvrNum 2ENDIFENDIF*ThisPostn = ScanEchoPostn[PrcRcvrNum-1]** If ThisPostn is zero, then just update LastPrcPostn, and do no echo  processingIF (ThisPostn = 0)NoEchoCnt[ThisRcvrIndx] = NoEchoCnt[ThisRcvrIndx + 1]GOTO CNTPRC.sub.-- NOUPD.sub.-- LASTENDIF** Current reading is a valid echo, clear NoEchoCnt, NoEchoActive, and  ClearQueueFlg*NoEchoCnt[ThisRcvrIndx] = 0ClearQueueFlg[ThisRcvrIndx] =0;** If do not have a valid LastPrcPostn, just update LastPrcPostn*IF (LastPrcPostn[ThisRcvrIndx] = 0)GOTO CNTPRC.sub.-- UPD.sub.-- LASTENDIFDiffDist = ThisPostn - LastPrcPostn[ThisRcvrIndx]IF (DiffDist = 0)GOTO ACCUM.sub.-- UPD.sub.-- CONTENDIF** Continue processing based on movement*IF (DiffDist &gt; 0)IF (Accum[ThisRcvrIndx].MoveDist &gt; 0)**   Plus movement and plus accumulation so continue accumulation*Accum[ThisRcvrIndx].MoveDist = Accum[ThisRcvrIndx].MovrDist + DiffDistIF (Accum[ThisRcvrIndx].NearPostn = 0 .OR. ThisPostn &lt; Accum[ThisRcvrIndx].       NearPostn)Accum[ThisRcvrIndx].NearPostn = ThisPostnENDIFELSE**   Plus movement with minus accumulation so check for next container*IF (DiffDist &gt;NextCanDist)CALL CNTCHKELSE**   Remove minus direction movement from plus accumulation*Accum[ThisRcvrIndx].MoveDist = Accum[ThisRcvrIndx].MoveDist - DiffDistIF (Accum[ThisRcvrIndx].NearPostn = 0.OR. ThisPostn &lt; Accum[ThisRcvrIndx].       NearPostn)Accum[ThisRcvrIndx].NearPostn = ThisPostnENDIFENDIFELSE    * if (DiffDist &gt; 0**  Have a minus movement. Check accumulation direction*IF (Accum[ThisRcvrIndx].MoveDist &lt; 0)**  Minus movement and minus accumulation so continue accumulation*Accum[ThisRcvrIndx).MoveDist = Accum[ThisRcvrIndx].MoveDist + DiffDistIF (Accum[ThisRcvrIndx].NearPostn = 0.OR. ThisPostn &lt; Accum[ThisRcvrIndx].       NearPostn)Accum[ThisRcvrIndx].NearPostn = ThisPostnENDIFELSE**   Minus movement with plus accumulation so check for next container*IF ( -DiffDist &gt; NextCanDist)CALL CNTCHKELSE**   Remove minus direction movement from minus accumulation*Accum[ThisRcvrIndx].MoveDist = Accum[ThisRcvrIndx].MoveDist - DiffDistIF (Accum[ThisRcvrIndx].NearPostn = 0.OR. ThisPostn &lt; Accum[ThisRcvrIndx].       NearPostn)Accum[ThisRcvrIndx].NearPostn = ThisPostnENDIFENDIFENDIF    *if (DiffDist &gt; 0CNTPRC.sub.-- UPD.sub.-- LAST:** Update last processed echo for this Rcvr*IF (ThisPostn &lt;&gt; 0) LastPrcPostn[ThisRcvrIndx] = ThisPostnENDIFCNTPRC.sub.-- NOUPD.sub.-- LAST:** If more than 25 no echoes from each Rcvr, then process current  accumulations.* After 100 non-echoes, then clear the queues*IF (NoEchoCnt[ThisRcvrIndx] &gt;= 25.AND.NoEchoCnt[OtherRcvrIndx] &gt;= 25)If (NoEchoCnt[ThisRcvrIndx] &gt; 100.AND.NoEchoCnt[OtherRcvrIndx&gt; 100)ClearQueueFlg[ThisRcvrIndx] = 1ENDIFCall CNTCHKENDIF * if(NoEchoCnt[ThisRcvrIndx] &gt;= 25.AND. NoEchoCnt[OtherRcvrIndx] &gt;25)RETURNENDSUB CNTPRC***************************************************************SUBROUTINE CNTCHK** This routine is called when a jump to next can is detected or when  clearing queues because of no* echoes.* This subroutine must clear Accum[ThisRcvrIndx] arrays before returning,  so another move string* can begin.* Normally this is done by matching up a Qued4[ThisRcvrIndx] with either  Qued4[OtherRcvrIndx]* or* Qued3[OtherRcvrIndx], making a change in count, and then clearing the  queued entries used* to make the count. However many exceptions to this processing occur.** If clearing queues is active, then the queues get shifted up until they  are all zero* (After 25 non-echoes, the data in the Accum arrays are processed)*IF (ClearQueueFlg[ThisRcvrIndx] = 0**  Not clearing queues. Throw away small accumulations*IF (Accum[ThisRcvrIndx].MoveDist &lt;&gt; 0)IF (ABS(Accum[ThisRcvrIndx].MoveDist) &lt; SMALL.sub.-- DIST)Clear Accum[ThisRcvrIndx] arraysGOTO CNTCHK.sub.-- RETENDIFELSE**   zero accumulation, so no processing*GOTO CNTCHK.sub.-- RETENDIFENDIF * if (ClearQueueFlg[ThisRcvrIndz]** If Qued4[ThisRcvrIndx] array empty, then just shift the queues*IF (Qued4.[ThisRcvrIndx].MoveDist = 0)Move Qued3[ThisRcvrIndx] arrays to Qued4[ThisRcvrIndx] arraysMove Qued2[ThisRcvrIndx] arrays to Qued3[ThisRcvrIndx] arraysMove Qued1[ThisRcvrIndx] arrays to Qued2[ThisRcvrIndx] arraysMove Accum[ThisRcvrIndx] arrays to Qued1[ThisRcvrIndx] arraysClear Accum[ThisRcvrIndx] ArraysGOTO CNTCHK.sub.-- RETENDIF** Qued4[ThisRcvrIndx] not empty. If Qued3[ThisRcvrIndx] array empty, then  just shift queues*IF (Qued3[ThisRcvrIndx].MoveDist = 0)Move Qued2[ThisRcvrIndx] arrays to Qued3[ThisRcvrIndx] arraysMove Qued1[ThisRcvrIndx] arrays to Qued3[ThisRcvrIndx] arraysMove Accum[ThisRcvrIndx] arrays to Qued1[ThisRcvrIndx] arraysClear Accum[ThisRcvrIndx] arraysGOTO CNTCHK.sub.-- RETENDIF** If Qued4[ThisRcvrIndx] entry not close to pass line, then delete  Qued4[ThisRcvrIndx] entry by* shifting queues*IF (Qued4[ThisRcvrIndx].Nearpostn not close to PassLinePostn[ThisRcvrIndx])Clear Qued4[ThisRcvrIndx] arraysMove Qued3[ThisRcvrIndx] arrays to Qued4[ThisRcvrIndx] arraysMove Qued2[ThisRcvrIndx] arrays to Qued3[ThisRcvrIndx] arraysMove Qued1[ThisRcvrIndx] arrays to Qued2[ThisRcvrIndx] arraysMove Accum[ThisRcvrIndx] arrays to Qued1[ThisRcvrIndx] arraysClear Accum[ThisRcvrIndx] arraysGOTO CNTCHK.sub.-- RETENDIF** Check if Qued3[ThisRcvrIndx] and Qued4[ThisRcvrIndx] entries have  opposite directions*IF (Direction for Qued3[ThisRcvrIndx] not same direction asQued4[ThisRcvrIndx])**  If either move distance, 3 times greater than the other, delete   smaller*IF (3 *ABS(Qued3[ThisRcvrIndx].MoveDist) &lt; ABS(Qued4[ThisRcvrIndx].MoveDist) )Clear Qued3[ThisRcvrIndx] arraysMove Qued2[ThisRcvrIndx] arrays to Qued3[ThisRcvrIndx] arraysMove Qued1[ThisRcvrIndx] arrays to Qued2[ThisRcvrIndx] arraysMove Accum[ThisRcvrIndx] arrays to Qued1[ThisRcvrIndx] arraysClear Accum[ThisRcvrIndx] arraysGOTO CNTCHK.sub.-- RETENDIFIF(3* ABS(Qued4[This RcvrIndx].MoveDist) &lt; ABS(Qued3[ThisRcvrIndex].MoveDist) )Clear Qued4[ThisRcvrIndx] arraysMove Qued3[ThisRcvrIndx] arrays to Qued4[ThisRcvrIndx] arraysMove Qued2[ThisRcvrIndx] arrays to Qued3[ThisRcvrIndx] arraysMove Qued1[ThisRcvrIndx] arrays to Qued2[ThisRcvrIndx] arraysMove Accum[ThisRcvrIndx] arrays to Qued1[ThisRcvrIndx] arraysClear Accum arraysGOTO CNTCHK.sub.-- RETENDIF**  Neither is 3 times greater than the other, so delete both Qued3 &amp;   Qued4*Clear Qued4[ThisRcvrIndx] arraysClear Qued3[ThisRcvrIndx] arraysMove Qued2[ThisRcvrIndx] arrays to Qued3[ThisRcvrIndx] arraysMove Qued1[ThisRcvrIndx] arrays to Qued2[ThisRcvrIndx] arraysMove Accum[ThisRcvrIndx] arrays to Qued1[ThisRcvrIndx] arraysClear Accum arraysGOTO CNTCHK.sub.-- RETENDIF** Have a Qued4 and Qued3 entry for this rcvr that are for same  direction.* Try to find a matching move for the other rcvr** Program can loop back here after deleting or adjusting the queues*CNTCHK.sub.-- TRYAGAIN:IF (Qued4[OtherRcvrIndx].MoveDist &lt;&gt; 0)GOTO HAVE.sub.-- QUED4.sub.-- BOTH   *Branch to process qued4 for bothrcvr&#39;sENDIF** Do not have a Qued4 for the other rcvr* If not doing Clear Queue processing for either rcvr, check  Qued3[OtherRcvrIndx]* (If clearing Queues, Qued3 will get shifted into Qued4 eventually.)*IF (ClearQueueFlg[ThisRcvrIndx] &lt;&gt; 0.OR.ClearQueueFlg[OtherRcvrIndx] &lt;&gt;0)GOTO CNTPRC.sub.-- RETENDIFIF (Qued3[OtherRcvrIndx].MoveDist &lt;&gt; 0)Move Qued3[OtherRcvrIndx] arrays to Qued4[OtherRcvrIndx] arraysClear Qued3[OtherRcvrIndx] arraysGOTO HAVE.sub.-- QUED4.sub.-- BOTHENDIF** Have neither Qued4[OtherRcvrIndx] or Qued3[OtherRcvrIndx],* Check if Qued2[ThisRcvrIndx] can cancel Qued3[ThisRcvrIndx]IF (Qued2[ThisRcvrIndx].MoveDist = 0)**  No Qued2[ThisRcvrIndx] so just shift queues which clears up Accum   arrays*Move Qued1[ThisRcvrIndx] arrays to Qued2[ThisRcvrIndx] arraysMove Accum[ThisRcvrIndx] arrays to Qued1[ThisRcvrIndx] arraysClear Accum[ThisRcvrIndx] arraysGOTO CNTCHK.sub.-- RETENDIF** Have Qued2[ThisRcvrIndx] and Qued3[ThisRcvrIndx].* If Qued2[ThisRcvrIndx] opposite direction of Qued3[ThisRcvrIndx] and  valid move, then canclear q2 &amp; q3.*IF (Direction of Qued2[ThisRcvrIndx] opposite direction ofQued3[ThisRcvrIndx])If (ABS(Qued2[ThisRcvrIndx].MoveDist) &gt; PoorMoveDist)Clear Qued3[ThisRcvrIndx] arraysClear Qued2[ThisRcvrIndx] arraysMove Qued1[ThisRcvrIndx] arrays to Qued2[ThisRcvrIndx] arraysMove Accum[ThisRcvrIndx] arrays to Qued1[ThisRcvrIndx] arraysClear Accum[ThisRcvrIndx] arraysGOTO CNTCHK.sub.-- RETENDIFENDIF** Have Q2, Q3, &amp; Q4 for ThisRcvrIndx that agree on direction, and no Q3  or Q4 forOtherRcvrIndx* Check Q2 for OtherRcvrIndx*IF (Qued2[OtherRcvrIndx].MoveDist &lt;&gt; 0)Move Qued2[OtherRcvrIndx] arrays to Qued4[OtherRcvrIndx] arraysClear Qued2[OtherRcvrIndx] arraysGOTO HAVE.sub.-- QUED4.sub.-- BOTHENDIF** Have Q2, Q3, Q4 for ThisRcvrIndx agree on direction, and no Q2, Q3, or  Q4 for OtherRcvrIndx* Check that Q4[ThisRcvrIndx], Q3[ThisRcvrIndx], and Q2[ThisRcvrIndx] are  all good moves*IF (ABS(Qued4[ThisRcvrIndx].MoveDist) &lt; PoorMoveDist)**  Delete Qued4[ThisRcvrIndx] which is a poor move*Clear Qued4[ThisRcvrIndx] arraysMove Qued3[ThisRcvrIndx] arrays to Qued4[ThisRcvrIndx] arraysMove Qued2[ThisRcvrIndx] arrays to Qued3[ThisRcvrIndx] arraysMove Qued1[ThisRcvrIndx] arrays to Qued2[ThisRcvrIndx] arraysMove Accum[ThisRcvrIndx] arrays to Qued1[ThisRcvrIndx] arraysClear Accum[ThisRcvrIndx] arraysGOTO CNTCHK.sub.-- RETENDIFIF (ABS(Qued3[ThisRcvrIndx].MoveDist) &lt; PoorMoveDist)**  Delete Qued3[ThisRcvrIndx] which is a poor move*Clear Qued3[ThisRcvrIndx] arraysMove Qued2[ThisRcvrIndx] arrays to Qued3[ThisRcvrIndx] arraysMove Qued1[ThisRcvrIndx] arrays to Qued2[ThisRcvrIndx] arraysMove Accum[ThisRcvrIndx] arrays to Qued1[ThisRcvrIndx] arraysClear Accum[ThisRcvrIndx] arraysGOTO CNTCHK.sub.-- RETENDIFIF (ABS(Qued2[ThisRcvrIndx].MoveDist) &lt;PoorMoveDist)**  Delete Qued2[ThisRcvrIndx] which is a poor move*Clear Qued2[ThisRcvrIndx] arraysMove Qued1[ThisRcvrIndx] arrays to Qued2[ThisRcvrIndx] arraysMove Accum[ThisRcvrIndx] arrays to Qued1[ThisRcvrIndx] arraysClear Accum[ThisRcvrIndx] arraysGOTO CNTCHK.sub.-- RETENDIF** Make count based on Qued4[ThisRcvrIndx] alone*CALL MAKECNT(ThisRcvrIndx, Qued4[ThisRcvrIndx].MoveDist)Clear Qued4[ThisRcvrIndx] arraysMove Qued3[ThisRcvrIndx] arrays to Qued4[ThisRcvrIndx] arraysMove Qued2[ThisRcvrIndx] arrays to Qued3[ThisRcvrIndx] arraysMove Qued1[ThisRcvrIndx] arrays to Qued2[ThisRcvrIndx] arraysMove Accum[ThisRcvrIndx] arrays to Qued1[ThisRcvrIndx] arraysClear Accum[ThisRcvrIndx] arraysGOTO CNTCHK.sub.-- RETHAVE.sub.-- QUED4.sub.-- BOTH:** Have Qued4[ThisRcvrIndx], Qued3[ThisRcvrIndx], and Qued4[OtherRcvrIndx]*IF (Qued4[OtherRcvrIndx].NearPostn not close to PassLinePostn[OtherRcvrIndx])Clear Qued4[OtherRcvrIndx] arraysGOTO CNTCHK.sub.-- TRYAGAINENDIFIF (direction of Qued4[ThisRcvrIndx] agrees with direction ofQued4[OtherRcvrIndx])**  Rcvrs agree on direction so make count*CALL MAKECNT(ThisRcvrIndx, Qued4[ThisRcvrIndx].MoveDist)Clear Qued4[ThisRcvrIndx] arraysMove Qued3[ThisRcvrIndx] arrays to Qued4[ThisRcvrIndx] arraysMove Qued2[ThisRcvrIndx] arrays to Qued3[ThisRcvrIndx] arraysMove Qued1[ThisRcvrIndx] arrays to Qued2[ThisRcvrIndx] arraysMove Accum[ThisRcvrIndx] arrays to Qued1[ThisRcvrIndx] arraysClear Accum[ThisRcvrIndx] arraysClear Qued4[OtherRcvrIndx] arraysGOTO CNTCHK.sub.-- RETELSE** ThisRcvrIndx and OtherRcvrIndx disagree on the direction.* Check if Qued2[ThisRcvrIndx] can cancel out Qued3[ThisRcvrIndx] which  will* clear Accum array*IF (direction of Qued2[ThisRcvrIndx] opposite direction ofQued3[ThisRcvrIndx])IF (ABS(Qued2[ThisRcvrIndx].MoveDist) &gt; PoorMoveDist)Clear Qued3[ThisRcvrIndx] arraysClear Qued2[ThisRcvrIndx] arraysMove Qued1[ThisRcvrIndx] arrays to Qued2[ThisRcvrIndx] arraysMove Accum[ThisRcvrIndx] arrays to Qued1[ThisRcvIndx] arraysClear Accum[ThisRcvrIndx] arraysENDIFENDIF** Check if Qued3[OthrRcvr] disagrees with Qued4[OthrRcvr],* If so delete Qued3[OtherRcvrIndx] and Qued4[OtherRcvrIndx], which will  next test* direction of Qued4[ThisRcvrIndx] with direction of Qued2[OtherRcvrIndx]*IF (direction of Qued3[OtherRcvrIndx] opposite direction ofQued4[OtherRcvrIndx])Clear Qued4[OtherRcvrIndx] arraysClear Qued3[OtherRcvrIndx] arraysMove Qued2[OtherRcvrIndx]arrays to Qued4[OtherRcvrIndx] arraysClear Qued2[OtherRcvrIndx] arraysGOTO CNTCHK.sub.-- TRYAGAINENDIF** Still have a Qued4[ThisRcvrIndx] disagreeing with direction of  Qued4[OtherRcvrIndx]* If one twice as good as other, make count based on larger; otherwise  delete both*IF (2*ABS(Qued4[OtherRcvrIndx].MoveDist) &lt; ABS)Qued4[ThisRcvrIndx].MoveDist) )CALL MAKECNT(ThisRcvrIndx, Qued4[ThisRcvrIndx].MoveDist)Clear Qued4[OtherRcvrIndx] arraysClear Qued4[ThisRcvrIndx] arraysMove Qued3[ThisRcvrIndx] arrays to Qued4[ThisRcvrIndx] arraysMove Qued2[ThisRcvrIndx] arrays to Qued3[ThisRcvrIndx] arraysMove Qued1[ThisRcvrIndx] arrays to Qued2[ThisRcvrIndx] arraysMove Accum[ThisRcvrIndx] arrays to Qued1[ThisRcvrIndx] arraysClear Accum[ThisRcvrIndx] arraysGOTO CNTCHK.sub.-- RETENDIFIF (2*ABS(Qued4[ThisRcvrIndx].MoveDist) &lt; ABS(Qued4[OtherRcvrIndx].MoveDist) )CALL MAKECNT(OtherRcvrIndx, Qued4[OtherRcvrIndx].MoveDist)Clear Qued4[OtherRcvrIndx] arraysClear Qued4[ThisRcvrIndx] arraysENDIFCNTCHK.sub.-- RET:RETURNENDSUB CNTCHK-***************************************SUBROUTINE MAKECNT(RcvrIndx, MoveDist)** Make plus or minus count based on DirectionFlg, RcvrIndx, and sign of  MoveDist*If (DirectionFlg is Left-to-Right)**  Direction is left-to-right. Plus count is moving away from rcvr 1*IF (RcvrIndx = 1)IF (MoveDist &gt; 0)ContainerCount = ContainerCount + 1ELSEContainerCount = ContainerCount - 1ENDIFELSEIF (MoveDist &lt; 0)ContainerCount = ContainerCount + 1ELSEContainerCount = ContainerCount - 1ENDIFENDIFELSE*** Direction is right-to-left. Plus count is moving away from rcvr 3*IF (RcvrIndx = 1)IF (MoveDist &gt; 0)ContainerCount = ContainerCount - 1ELSEContainerCount = ContainerCount + 1ENDIFELSEIF (MoveDist &lt; 0)ContainerCount = ContainerCount + 1ELSEContainerCount = ContainerCount - 1ENDIFENDIFENDIFENDSUB MAKECNT*****************************__________________________________________________________________________ 
    
     While the forms of apparatus and the methods of operation herein described constitute preferred embodiments of this invention, it is to be understood that the invention is not limited to these precise embodiments, and that changes may be made therein without departing from the scope of the invention which is defined in the appended claims.