Pallet counting method

The best way is to use a shift register, it looks like something I did some years ago the difference was we had 10 or so divert stations, basically, the bar codes were read at a position & a simple encoder (actually a star wheel & proximity) giving pulses to shift the reads down the line, in my case just had to compare particular parts of the shift register when the data reached the divert position if correct box then it diverted, if it failed to find a divert for a particular barcode it would just go round the loop.
what you have is something similar but it appears you have no way of checking when one is removed but this is quite simple I think.
lets assume your pulses from a star wheel (personally I would not use an encoder as that sort of accuracy probably not required). on every pulse (or perhaps every x number of pulses when the RFID is read poke that into the shift register, then count the number of shift registers that have data.
Let's assume that the pulses from the star wheel correspond to 2 ft, & the circular conveyor is 100ft long then there are 50 effective shift places, when a pallet is read it is put into the shift register & shifted along, every 2 ft ( pulse from star wheel) if no data read then zero the shift register location.
You would need to find the number of pulses per pallet length (only needs to be a rough amount) to give the shift pulse. & the number of shift pulses from read position round the loop until back of the read position
1736406845384.png
Sorry about the crude drawing but this is my idea.
A RFID is read & put into the shift register location 0, if no read then a zero is put in there. as the conveyor moves pulses off the star wheel shift the reads along the shift register, denoted by the lines, if the pallet is still on when it gets back to the read position then it is read again however, if no pallet then a zero is put in there, so lets assume there are 20 pallets in the system your code will add up the number of locations with data so that gives you the number of pallets, if one has been removed then the register at the read will be reset to zero. To complex to draw this quickly but it is just a matter of getting the resolution correct, the only thing I do not know is how these pallets be removed, if only in one location then a sensor at that location could be used to clear the shift register position so every scan of the plc will check if that location has a bar code if it does but sensor does not detect a pallet then zero the shift register. so when the system counts the number of reads in the shift register it gives the number of pallets on the system. there must be a position where the pallets are loaded onto it or where it may be taken off but not shown on your drawing, so it's a guess. I would make the shift register twice as long as the pallet width the syncronisation would require a sort of encoder/star wheel on the drive Done this a number of times but slightly different it is just a matter of working out the number of shifts per pulse spaced evenly around the conveyor, the only catch is if the pallets can be removed aor placed at any position there will be an error of pallet counts for a short time.
 
Please see this sketch this is how the assembly line looks.
I didnt expect that many readers... it is now more clear what the layout is.

I did not get the variable part if i add and subtract at the scan position of pallet that would make it 0 again ?
Adding and subtracting was based on assumption that there is only two readers and some zone in between that needs to be monitored, and in this zone can be multiple pallets at once. Like a buffer section.

Now to the core.

My attempt at this would be to have one global ring buffer representing pallets on the conveyor. Each scanner holds index of its position in the buffer.
Since You don't have exact information what pallet has been removed or added and where this operation appeared in the ring, You can achieve eventual consistency of the data.

When a scanner encounters new pallet, update current index - check ID at that position.
If there is a match, everything is fine, .
If it is different - pallet might be removed, added or moved.

Check if arriving pallet exists somewhere in the ring buffer.
If it does not exist,
insert arriving at current index, (inserting means shift items then add, not replace)
else (it exists in buffer somewhere - so pallet has been removed or moved)
either way - remove item at checked index and move to the next index, repeat until matched.

Indexes held by each other scanner have to be updated every time buffer contents change.

This algorithm is triggered any time any scanner encounter a pallet.

The count of the pallets is the count of elements in the buffer. It might not be valid for some time in case of large disruption bit algo should be self-correcting.
 
No need for a circular buffer as I assume that when the pallet comes round again it will scan it & place the value in the array.
I did the above so quick (about an hour or less) but the way it works is that the pallet is detected at array[0] & that array location is re-populated with the read data, It is shifted from the pulse in the above case using a reciprical timer to give a pulse every 100ms & counting it just as if the conveyor star wheel would work (no need to read every pulse from the star wheel as this would require a very large shift register) if the takeoff is in the same place then the array[xx] at that location could be zeroed when pallet removed so instantly the pallet count would be correct, however, if there is no way of sensing where pallets are removed then the count will only change when the removed pallet position drops off the end of the shift register.
The actual count is just a loop that indirectly points to the array positions 7 counts the positions with data.
 
Are the pallets on a circular conveyor, moving around past many RFID readers? If yes, does the conveyor move in only one direction?

Is the ID of each pallet unique?

What is the maximum number of pallets that can be on the line at any time?
 
Using a single RFID reader solely to count pallets seems #!)%. The primary function of an RFID reader is to read data from a pallet, including its unique ID, and potentially update or write data to it. If a pallet requires repair, the operator can either replace it with a different pallet or remove it from the carousel entirely.
 
Are the pallets on a circular conveyor, moving around past many RFID readers? If yes, does the conveyor move in only one direction?

Is the ID of each pallet unique?

What is the maximum number of pallets that can be on the line at any time?
yes to first question and moves in only one direction.

yes the pallet ID is unique for each pallet.

60 could be maximum but the management wants 56 to be a minimum number of pallets.
 
Another question, where are the loading/takeoff points or are they random are they manusl (forklift) or conveyors without this information we will be going round in circles trying to give you relevant ideas on control.
TBH it will not matter if the data is unique but depending on thye plc type (which you have not mentioned) a circular buffer is not requirede as far as I can see, as any pallet coming round again would be re-read anyway.
The last one I did the circular conveyor was probably 100 mtrs long, we decided to use a star wheel & prox as the encoder even then the array holding the information was over 1,200 registers (quite a lot of CPU time to shift) these boxes were only about 1 mtr in length & the data needed was stripped from the reader i.e. rather than store the whole string we only needed a unique 3 digit number 1-300 from the data (unique as far as the store location) the way it worked was boxes were inserted into the loop conveyor & read, the data was stripped to 3 digits & converted to a decimal number to take the whole string would mean a lot of registers & there was only a need for the store number. These were tracked along the circular conveyor & the takeoff conveyors (8 off) would divert the relevant takeoff & stored until the amount of boxes had been added, these were then sent enblock to the relevant stacker, stacked & put on a lorry to be sent to the relevant retail store, although a little more complex as these boxes were all mixed up as they transit down to the stackers, each stacker had another reader & diverted the store number down the relevant feed to the stacker, all this was controlled by the higher level Scada, boxes that had not been allocated at that time would be re-circulated on the circular conveyor or if a mis-read would be diverted onto a reject leg conveyor.
So the information we really need is as follows.
How & where are the pallets added to the loop.
How & where are the pallets removed from the loop (are there any sensors if these are fixed points).
Some idea of the RFID data i.e. format.
The way we commissioned the above system was we put a box on the infeed to the loop, ran it round & stopped it on each takeoff & noted the register holding the data, that was used to verify the box number & divert position, did the same for all the other takeoffs, & found what would be the last array segment when it reached the read point again (this allowed us to reduce the size of the array) also to ensure that the position of the register array at the point of diverts we calculated the number of actual pulses for a box & settled for 3 this then allowed a smaller array size so infact the boxes were at least 3 pulses between them to avoid crashes & give the correct spacing.
 
yes to first question and moves in only one direction.

yes the pallet ID is unique for each pallet.

60 could be maximum but the management wants 56 to be a minimum number of pallets.
I seems to me that the trick is to come up with a data model that makes it easy both to detect new pallets and to detect when a pallet is removed.

If we further assume the pallets cannot reorder themselves on the circular conveyor (carousel, e.g. airport baggage claim), then I think the simplest data model would be a number of FIFOs, with each FIFO containing the values, and order, of expected RFID tags at each RFID sensor.
  1. The FIFO for one sensor has an RFID value loaded (pushed) onto it when that value is first* read by the next sensor upstream.
  2. The oldest RFID value is removed from a sensor's FIFO when that value is read by that sensor
  3. If an RFID value read by a sensor is not the oldest value on that sensor's FIFO, then one of two things are true
    • EITHER the RFID value is in that sensor's FIFO but not the oldest,
      • so all RFID values in that FIFO, which are older than that newly-read RFID value, are from pallets that have been removed
    • OR the RFID value is not in that sensor's FIFO,
      • so that vlaue represents a new pallet introduced at or upstream of that sensor, and downstream of the previous sensor upstream
Step 1 is simple: when RFID value R is newly-read* at sensor N, push value R onto FIFON-1.

Step 2 and the first case for Step 3 require a single operation: shift the all RFID values newer than the newly-read value to the beginning of the FIFO of the sensor that read the value; if the newly-read value is the oldest in the FIFO, then the FIFO values shift by one position an overwrite only that oldest vale; if the newly-read value is not the oldest in the FIFO, then that value and all before it are overwritten.

The second case for Step 3, i.e. when that newly-read value is not on that sensor's FIFO, indicates that the newly-read RFID value is a new pallet downstream of the next expected value for that sensor, so no shifting is necessary.

* The code will need to deal with an RFID sensor reading the same value from the same pallet multiple times in a row, if that happens, but that only requires a "last read" value for each sensor, plus one-shot logic that checks for a new value on every scan cycle.

The total number of pallets can be derived by summing the lengths of all sensors' FIFOs; it can also be updated on the fly:
  • subtract K-1 from the total when shifting K positions on (first case for Step 3)
    • Note that, if the oldest RFID value is newly read, this will subtract 0 i.e. do nothing
  • add 1 when a new pallet is detected (second case for Step 3)
 
@Dr, Yes too little information, but in the event that a pallet taken off then that one will drop off the end of the shift register anyway, it will mean the actual number of pallets on the system will not be correct until the conveyor has rotated, That is why I would not use a circular buffer just make the last location of the buffer array on the last segment of the conveyor if the pallet is not there then a zero will be moved from Array[0] (Read point).
 
@Dr, Yes too little information, but in the event that a pallet taken off then that one will drop off the end of the shift register anyway, it will mean the actual number of pallets on the system will not be correct until the conveyor has rotated, That is why I would not use a circular buffer just make the last location of the buffer array on the last segment of the conveyor if the pallet is not there then a zero will be moved from Array[0] (Read point).
Yeah, my approach has many FIFOs, so it detects the missing pallet sooner, also it is less work to insert a new pallet.

But the trade-off for that a few dozen independent FIFO arrays in the data model.

An OOP-ish approach should work since each sensor is identical: the subroutine would not require much more than a dozen statements/rungs to handle the logic for an RFID sensor.
 
thankyou guyz for your help, I got it working with your help as i used one balluf RFID to start the counter until the same pallet number comes over to reset the count.
 

Similar Topics

Hello has anyone out there ever tried to count boxes using barcode (UPC) stacked on a pallets. I have spoken to a large Barcode scanner OEM and...
15
Replies
11,389
Views
For some very strange reason, one of the units at a facility i work at is giving me error 94 FW brake test not possible, We looked at the PLC...
0
Replies
480
Views
I have a project where I have an Epson t6 scara robot picking from a pallet with 35 positions, 5 row and 7 columns. Using a 1769-l24ER, V32.x of...
4
Replies
820
Views
Hi everyone, I am newbie at here. Also, ı have a little experience at plc programming. I use structure text at twincat 2. Now, I need to be...
20
Replies
6,045
Views
Hi guys, I am facing problem on layer palleatizer machine.my problem is I can not change the pattern. it is running by present pattern.There is...
1
Replies
1,873
Views
Top