How do you Track boxes on a conveyor?

darrentpi

Member
Join Date
Jul 2004
Posts
44
I am using a color eye to detect the color of the boxes, but I have to track them some how. They will be pushed off the conveyor at certain locations, there is an eye at each drop off location, but how does that eye no what color box is correct for that drop off. There is no encoder, just roller coveyor, so I don't know if the bit shifting will work!
I am working with rs logix
EG.
three yellow boxes, then maybe 1 red box, then two blue boxes etc.
Help!
DM.
 
Last edited:
I don't know if this is a student question so bear with me if I'm not too specific as to code. Pretend you were doing this with people. The first person can see color, the others (at the push off points) can't but they each have a piece of paper and a pencil. Ok, here's the sequence.

Person #1 sees a yellow box. He yells to person #2 (at the first stop) "A yellow box is coming". Person #2 writes down "yellow box". Then person #1 sees a red box. He yells to person #2 "A red box is coming". Person #2 writes "red box" down under "yellow box". (Now that you have the idea for person #1 I won't repeat his part)

When person #2 sees a box come in front of him he looks at the top color he wrote down, ("yellow box"). If he's supposed to push yellow boxes he pushes it then erases it from his list. If he's NOT supposed to push yellow boxes he yells to person #3 "A yellow box is coming" and then ereses it from his list. Person #3 writes "yellow box" on the top of his list. This sequence follows on down the line. The very last person probably doesn't need to know colors and just pushes every box that comes to him.

Do you have the basic idea? If this isn't a 'student' project then give us a heads up (couldn't tell from the profile).

This type of system totally breaks down if someone takes a case off or puts one on so that has to be prevented. If something, like a power down, ereases the information then everything has to be re-run starting at person #1.
 
Look into

FIFO stacks

Fifo load Fifo unload.

Basically you load a stack of words into an integer file and then unload them. ie 1=red 2=yellow 3=blue

Fifo stack will show

1
1
1
3
3
2
1
1
These will be the boxes in order of passing your initial color sensor.

red, red, red, blue, blue, yellow, red, red.

As they go down the conveyor, the stack will be unloaded as they pass the next sensor. Similar to bit shift but with word data. Decide which unload gate to open or ram to energize based upon the word currently in the unload position.

Hope this helps

Marc
 
Use a group of shift registers(one for each color) and and the output at the colors knockoff position. You need a pulser on the conveyor to clock(update the conveyors movement) the shift register and your color detectors to input the registers.
 
Another thought, if the conveyor speed is constant and can be determined then you dont need an encoder. Speed and time have a proportional relationship.

There are several ways to do this and many were mentioned. I did one similar where labels were scanned, this determined the lane for that box...no encoder but speed was basically constant so time was used. After a certain time period the lane eye looked for a box to pass, once it passed then another time period was allowed to get in front of pusher then box was pushed into lane. This system had a box passing in front of eyes every 2 seconds and it was rare to get a jam unless a box was damaged.

Dont over think the problem, a good solution may be more simple than you can imagine.

Bit shift should be an option also. Create a register for each color, place a 1 in the register every time a color is detected, each time that passes a sensor shift that bit until it gets to position....ie the bit that corresponds to that lanes sensor. Hopefully I am making sense. Assume there are 8 lanes. Register 1 is for the yellow boxes which need to goto lane 7. The color sensor places a 1 in Register 1 bit 0 when a yellow box is detected...each time this box passes a sensor it shifts the bit one place until it reaches bit 6 (which corresponds to the sensor for lane 7), that will activate the pusher to move that box into the lane. Of course wil be other code required to accomplish this but hopefully it gives you an idea.
 
Thanks for the help!

I spent all night last night thinking of how this works, and I was on the right track, fifl load and unload, although I am a rookie it is really hard to aply this instruction usage to a program. I work well with simple logic, but this one is a tuffy, and I look to you guys for the advice. It is so tuff to get experience when you really dont know were to start!
It would be nice to see some examples, as the saying goes tell me I forget show me I remember, involve me and I understand!
Where I am lost is:
do you load up one fifl addresed from the different color inputs in parallel, or individual fifls from each color input?
Thanks for the advice everyone!
DM.
I am an Electrician in a new plant and they are challanging me with this new project! I guess they are testing my abilities!
 
Last edited:
Or...

You could try this:

Using bernie_carlton's analogy of guy's relaying information:

The color-enabled guy - no, let's make that a gal, since colorblindness is more prevalent in males - senses a yellow box. She notes this, releases the box onto the conveyor and hands a slip of paper with 'yellow' on it to a messenger, who walks down and shows it to the first non-color guy. The messenger waits. Eventually the box shows up. The pusher guy senses that the photoeye (or other sensing device) has been blocked. He checks the card the messenger is holding and if it matches his own preprogrammed color, the pusher is energized.

Now, the messenger neither knows nor cares whether the box was diverted, his only concern is relaying information. So, when the eye clears, either by the box continuing down the conveyor or being diverted, he proceeds to the next chute photoeye and waits there. If the box diverted upstream, his work is done. If the box didn't match or the destination chute was full, the box will show up at the second chute and the process will be repeated.

One other task that the messenger is charged with is telling the release logic gal that the box just inducted has reached the first divert point and it is now safe to release another. The reason for this is spacing - no more boxes can be released onto the conveyor until the previous one reaches the first chute. If a messenger is waiting at chute 'n' and another messenger appears, the new messenger's card will be honored and the previous card is destroyed.

The astute reader will understand that the messenger is actually an asynchronous shift register (which will need to be built 'by hand' from pieces, ie. instructions, lying about) and the check done at the lanes is an equality instruction.

I personally don't care for FIFO's for this sort of application because they've been nothing but trouble; they're too susceptible to stray photoeye triggering.
 
Darren, this is a timely question you have since I just wrote a program that does the same type thing except we have seven different barcodes to read, with diverts to seven different lanes. I have to read each box (barcode) by a scanner, which sends me a character string. I then have to match that string to any one of eight different strings (seven match codes or one "no-read"). Then I have to send an integer value to a FIFO stack for loading and unloading. The FIFO is triggered by a recycling timer and works flawlessly when properly set up. That's the hardest part. My boxes are different sizes but run along the conveyor at 120FPM, and are diverted by high speed pushers of my own design. It's rather a proud moment when 3 or more boxes reach their assigned lane at the same time and all get properly diverted in unison.

If this gives you an idea on how to program, glad to be of help. If you're still needing help and use an AB platform, post some questions and maybe I can help more.

Good luck.
 
Rube said:
Darren, this is a timely question you have since I just wrote a program that does the same type thing except we have seven different barcodes to read, with diverts to seven different lanes. I have to read each box (barcode) by a scanner, which sends me a character string. I then have to match that string to any one of eight different strings (seven match codes or one "no-read"). Then I have to send an integer value to a FIFO stack for loading and unloading. The FIFO is triggered by a recycling timer and works flawlessly when properly set up. That's the hardest part. My boxes are different sizes but run along the conveyor at 120FPM, and are diverted by high speed pushers of my own design. It's rather a proud moment when 3 or more boxes reach their assigned lane at the same time and all get properly diverted in unison.

If this gives you an idea on how to program, glad to be of help. If you're still needing help and use an AB platform, post some questions and maybe I can help more.

Good luck.

Well the difficulty Im having is the lay out of loading info in the fifl. I am trying to develop this program with the use of three different eyes addresing three different fifls, that have the same address. my source will be different as I set my bits to either 1, 2, 3, which represent the different colors, with that in mind, this should load in to the fifo.But how do you unload them and addres them to an output, being a pusher. I hope this makes some sence!
 
I also would use 3 seperate bit shift registers, all driven from the same clock. Then you can use the appropriate bit from each to trigger the corresponding pusher...

bit 7 6 5 4 3 2 1 0 <new box in at bit 0
RED - 0 1 0 0 1 0 0 0
YEL - 1 0 0 1 0 0 0 0
GRN - 0 0 0 0 0 0 1 0

Then, if your pusher stations are at 4 (Red), 5 (Yel), and 6(Grn), just do...

if RED.bit4 then PUSH RED
if YEL.bit5 then PUSH YEL
if GRN.bit6 then PUSH GRN

I've always found individual shift registers to be much more flexible myself, rather than bit encoding in words, and clearer to follow for troubleshooting.
 
Conveyor

Darren, another way is to use an indexed file to load the coloured boxes, so your colour eye loads the conveyor with integers for each colour. and counts as it does so

1=Red
2=Blue
4 =yellow

etc, as peviously stated.

Each push off station will count from the top of the indexed file so when it sees a box it compares the integer using indexed addressing and if it corresponds to the right colour it pushes the box off .

i.e index file is N7:100, length 16
The indexed address is N7:[100+C5:1.ACC]
each push off point starts counting when it sees the first box and the counter .ACC value is used as the index for a compare instruction if the colours match it pushes that one off and continues counting. Reset the counter at 16 (or whatever length the indexed file is). the File has to be long enough to count all the boxes before the last push off point without repeating.

The yellow push off will look at N7:[100+C5:2.ACC]
etc.

It doesn't matter how many boxes are between each station as long as they stay in order.

This is just off the top of my head as I eat my lunch so it may not work.
 
Darren - from all these replies you may be getting an idea that there are multiple ways to solve a problem (probably one for each control programmer). We each tend to get familiar with a subset of the PLC's commands and rely on them when envisioning the solution to a problem. This is EXPERIMENT time with a lot of imagination. Every situation will have its own little quirks. I heard of a local conveyor/pusher line located out of doors which, during bad weather, would miss push items or even push when nothing was there. It turned out that the photoeyes were VERY sensitive and were triggering off snowflakes. It's a grand adventure and you won't learn anything if you just blindly copy something given by someone else. Read through your PLC's instruction set, look at these examples then go for it.
 
Here's my scenario and you can substitute where you need to. This is an AB 5/03 PLC by the way. I read one of eight LETTER codes at the scanner. I have eight strings (ST9s) set up to match the scanner's ASCII letter string. When I match to the first letter string (an ST9), say your red box, I move a "1" into an N7 word, for a "V" box. When I match another letter string (another ST9), say your green box, I move a "1" into the next N7 word, for a "D" box, and so on. This is done through ASC blocks. Then, later in my logic, when a "V" box gets loaded into the first N7 word, I move a "1" into an N7 word that is the "load integer" for the FIFO stack. If the next box is a "D", I move a "3" into the load integer, and so on. This way I have one stack move several different values. You could do the same with your colored boxes.
See of you can post what you have written and I'll be glad to help more if I can.
 

Similar Topics

Hi, I have some numeric input fields and I would like to track whenever a change is made to them. For example if an user changes temperature...
Replies
1
Views
843
Any help appreciated, Proposed question: I need to track parts to count the rejects in a rotating machine but having no luck tracking proper...
Replies
7
Views
2,317
Right now my system is using RFID tags on the load bars. Im trying to figure out how to implement error correction in this system. In the past...
Replies
2
Views
1,099
So at my plant our shift schedule is 12 hour shifts 7 days a week. There is 4 shifts A,B,C,D. A and C are the day shifts. 6am to 6pm B and D are...
Replies
10
Views
3,890
Hi all, i am having trouble finding out how i could track an event like start command or stop command. is there anyway to do it in FTView ME 6.1...
Replies
2
Views
1,542
Back
Top Bottom