A little puzzle - need help solving compactlogix

rigicon

Member
Join Date
Aug 2009
Location
kent
Posts
415
I am using a compactLogix PLC. We built a conveyor system now we have added an end of line sorter. Yes an add on and no one has thought of how it is to work just fabricated it and left it to me to sort out the control.
It has a long conveyor with 12 Stations.
There are 12 chutes along the length on the left hand side, and on the right hand side is 12 pushers and each of the twelve pushing stations has a sensor so I know product is in one of the 12 pusher area's at any one time.
At the beginning of the conveyor is a barcode reader that I read the barcode of the product and then query SQL and get the station number the product must go to.
At first I thought easy get the station number and once on the sorting conveyor (faster than the feed conveyor)send it to its station number and push whilst stopping the feed conveyor - once complete send the next product ie one at a time.
But ideally the customer doesn't want the feed conveyor stopping as it causes a traffic jam. I have been thinking 2D matrix etc etc but it keeps getting complicated ie counting etc problem is product can go to any sorting station in any order.
Dribbling at the moment....
Any suggestions please..:confused:

12stage.jpg
 
Is there how big space between products, is that space quaranteed? Is it more than one pushing station?


Edit.

If yes, First idea to come to my mind is: Do a FIFO for scanner, push station number to FIFO, extract at first photocell (have memory for every station), check if to be pushed out in that station, if not then move data to next station memory, then on that station trigger check it and so on...

I think it can be modified to work even if one or more answer to above questions is no.
 
Last edited:
You definitely need enough space between products to extend and retract your "kickers" though. This can be accomplished by starting and stopping the feed coveyor.

I don't like FIFOs for this type of application...they can get out of sequence too easily, and then you have the wrong product everywhere.

I prefer to track each product in transit based on its position in inches or millimeters. Each program scan, calculate how far each object has moved based on conveyor speed command. You can do this in an STI routine so that the time interval between updates is known and regular.

Then for each kicker, if there is an object whose position value is within that window and it's destination (recorded based on barcode) is a match, then operate the kicker. You can use a photocell at each kicker to make the timing of its operation more precise, so it will still work well even if your position values have some slight errors (as in being calculated from a command speed).
 
Conveyor speed adjustable?
Feed rate adjustable? (spacing)

how about 12 Retentive Timer (or more precise, counter triggered by interupt), each triggered to start by bar-code. When Down bit hits, trigger the pusher?
 
Here is a start. I don't know CompactLogix. I had to do this with RSLogix500 about 9 years ago, so, my memory may not be the best. First for the sortation conveyor belt. You need to put a 1:2 ratio spreader belt mechanical section for the conveyor prior to the entrance to the sortation to ensure product separation. Add a sensor at the entrance and a pulse generator, either an encoder or prox and toothed sprocket, depending on speed. Next, set up a shift register, BSL in RSLogix for each station. Let a barcode reader and the SQL query supply a station number from 1 to 12 in this case. Let each station number equal a certain number of pulses from the pulse generator. When the product triggers the entrance sensor and the barcode has selected a particular BSL let a "1" move into the shift register for that station. When the BSL has moved the proper number of pulses and the product sensor for the particular station zone is triggered, push the product off with its diverter.
I have this code somewhere in my archives. Again, it is in RSLogix500. I can try to find it for more accurate info if need be.
 
Last edited:
How fast is this moving? Since you have to query a database, how much time do you have to get an answer? Is there a buffer to get a few reads before their needed? What happens if you don't get a response from the DB?
 
from my view..i would say the barcode reader should place after
the feeding conv..once the barcode read the product ..it can send to SQL
and determine which station it goes ..and on each station it have sensor
to activate pusher.it also allow feeder
not too stop and the are some space between each product.
by speed up the 2nd conveyor so the product will have time space
 
Firstly Thanks for all the pointers.
Answers:-
yes there is a space between stations and space between product at least 1.5 stations but not guaranteed could be 1 or 0.5 station length.
Conveyor speed is on an invereter speed is adjustable.Feed is not contactor on/off
There is no encoder but if needed we can fit one.
there is a sensor at each station - 12 sensors
fast not that fast measure it tomorrow if needed.
database query is less than 0.5s max 1s. I have about 3-5s to get an answer. I could move the barcode reader to get more time.
There is NO buffer at the moment but there could be the feed conveyor is 3-4 meters long. Could have max 5-6 product in a buffer if needed - getting complicated!
I liked all the suggestions thanks. I don't think I need the code as much as the engineering principle - If I can understand what to do then I can code something and try it out.
 
Last edited:
A simple way is to create two arrays 12 elements long. One has the number of encoder counts until it is diverted and the other has the bin or chute number number. Each scan you check to see how many encoder counts have gone by. That count is then subtracted from EACH of the 12 elements int encoder count array. If the counts left is 0 or less for any part then use that index to index into the bin or chute number and activate it. Now shift all the elements in both the bin/chute destination array and counts left by 1 so there is a place for the next part. Note, after a part has been diverted you need some way to keep it from diverting again each scan. You can only divert when the count reach 0 or below or set the counts to a very high number so that it will not possibly reach 0 again or make yet another shift register that indicates which bins are empty or full. It should be possible for two or more diverters to fire in the same scan. I would use brute force for only 12 bin/chutes and not use indexing. If the maximum number of products on the conveyor is only 6 items then you can reduce the length of the arrays to 6. This shouldn't be hard. Get one part working and then copy and paste.
 
Encoder Pulse

You need Encoder and Induct Eye. The Encoder Pulse will compensate for any conveyor speed. Timers are no good for sortation. Except to create or gaurantee seperation of packages with metering belt. Attached a sample of logic. Scanner logic is not exactly like you app. but you can fill in the Scanner info.
 
I have done this many times in a SLC and a controlLogix.

You do not need any encoders or pulse tracking for this at all.

The easiest way is to create an array or use an integer file (to make this easier, I will designate N7:0 through N7:37 as the file). There is a sensor at each station so load up the file in a bubble sort to the 1st station and leave it there until it is blocked.

Barcode reader is at N7:0
ST1 is at N7:4
ST2 is at N7:7
ST3 is at N7:10
.
.
.
ST12 is at N7:37

As the BCR is read, put the station number in N7:0. If the conveyor is moving (aux contact) and N7:1 is empty, then move N7:0 to N7:1 and clear out N7:0.

If the conveyor is moving (aux contact) and N7:2 is empty, then move N7:1 to N7:2 and clear out N7:1.

If the conveyor is moving (aux contact) and N7:3 is empty, then move N7:2 to N7:3 and clear out N7:2.

When sensor at N7:4 is blocked and N7:3 is not empty, then move N7:3 to N7:4 and clear out N7:3. (If sensor is block and N7:3 is empty, then alarm as a rouge product). Compare the value of N7:4 to 1 (this is the station number). If equal, then divert and clear N7:4 ELSE if N7:5 is empty then move N7:4 to N7:5 and clear N7:4.

Continue for all 12 stations.

Now for the problems that you WILL see. No matter what anyone tells you, there will be times that the SQL database does NOT send you a response. What will you do with that product. Also, there will be times that someone may pull off a product as it moves down the conveyor. You will have to handle that (rouge product). For these times, you need to have a station that you can dump the product to to recirculate it back into the system. This usually is after the last station.

One other thing, what will you do if the station is full and the BCR wants it to go there? Finally, put a photoeye at the divert exit line to verify that the product went into that station. This will have to be in case the diverter is bad, the cylinder leaks and it slows way down, or if some pulls the air line.

I would also put in a clear out routine so if any product is on the line, you stop the feed and run all the product to a recirc line and zero out all the registers.

I hope this was clear, I would like to post some of the code, but since I was laid off, I don't have access to the RSLogix software.
 
I have done this many times in a SLC and a controlLogix.

You do not need any encoders or pulse tracking for this at all.

The easiest way is to create an array or use an integer file (to make this easier, I will designate N7:0 through N7:37 as the file). There is a sensor at each station so load up the file in a bubble sort to the 1st station and leave it there until it is blocked.

Barcode reader is at N7:0
ST1 is at N7:4
ST2 is at N7:7
ST3 is at N7:10
.
.
.
ST12 is at N7:37

As the BCR is read, put the station number in N7:0. If the conveyor is moving (aux contact) and N7:1 is empty, then move N7:0 to N7:1 and clear out N7:0.

If the conveyor is moving (aux contact) and N7:2 is empty, then move N7:1 to N7:2 and clear out N7:1.

If the conveyor is moving (aux contact) and N7:3 is empty, then move N7:2 to N7:3 and clear out N7:2.

When sensor at N7:4 is blocked and N7:3 is not empty, then move N7:3 to N7:4 and clear out N7:3. (If sensor is block and N7:3 is empty, then alarm as a rouge product). Compare the value of N7:4 to 1 (this is the station number). If equal, then divert and clear N7:4 ELSE if N7:5 is empty then move N7:4 to N7:5 and clear N7:4.

Continue for all 12 stations.

Now for the problems that you WILL see. No matter what anyone tells you, there will be times that the SQL database does NOT send you a response. What will you do with that product. Also, there will be times that someone may pull off a product as it moves down the conveyor. You will have to handle that (rouge product). For these times, you need to have a station that you can dump the product to to recirculate it back into the system. This usually is after the last station.

One other thing, what will you do if the station is full and the BCR wants it to go there? Finally, put a photoeye at the divert exit line to verify that the product went into that station. This will have to be in case the diverter is bad, the cylinder leaks and it slows way down, or if some pulls the air line.

I would also put in a clear out routine so if any product is on the line, you stop the feed and run all the product to a recirc line and zero out all the registers.

I hope this was clear, I would like to post some of the code, but since I was laid off, I don't have access to the RSLogix software.

I like this as its same as my idea, just lot explained in more detail.

He needs atleast three deep fifo for every station as he can have one in between and one in both stations next to each other.

Why do you okie think fifo gets out of seq easily, with fifo structure one could modify trough hmi which part is where, with count/time based sorting it could not be done, atleast not as easily.
 
Last edited:
I hope this was clear, I would like to post some of the code, but since I was laid off, I don't have access to the RSLogix software.
With help like this I am sure you'll get another job mate.🍻

I had a play with FIFO. I got very confused as I made 12 arrays 12 deep - i see you would go 3 deep OK my mistake.
Just not sure about FIFO there is a control which is where to place the data.
I understand 1 deep but as I am moving that one to the next array if not that station then how does it ever get deeper than 1 ?
My biggest headache is the kit is 128miles away so I can't really simulate or test unless I go to site.
We have decided to put a VFD on the conveyor so there will always be a gap between product and I can stop the feed if station 1 hasn't been reached so only one product on the conveyor up until station1 then another product.
We spoke about encoders etc but the PLC is doing lots more ie talking to HMI's and Robots and we don't want to load it too much just got over the 100%cpu issue got it down to 60%. The simpler the better - no interupts etc.
If we have a rogue part it can carry on and fall of the end of the conveyor into a box.
Other question if rogue should I put a value of 13 (end of conveyor)into register?
 
Last edited:
With help like this I am sure you'll get another job mate.🍻

I had a play with FIFO. I got very confused as I made 12 arrays 12 deep - i see you would go 3 deep OK my mistake.
Just not sure about FIFO there is a control which is where to place the data.
I understand 1 deep but as I am moving that one to the next array if not that station then how does it ever get deeper than 1 ?
My biggest headache is the kit is 128miles away so I can't really simulate or test unless I go to site.
We have decided to put a VFD on the conveyor so there will always be a gap between product and I can stop the feed if station 1 hasn't been reached so only one product on the conveyor up until station1 then another product.
We spoke about encoders etc but the PLC is doing lots more ie talking to HMI's and Robots and we don't want to load it too much just got over the 100%cpu issue got it down to 60%. The simpler the better - no interupts etc.
If we have a rogue part it can carry on and fall of the end of the conveyor into a box.
Other question if rogue should I put a value of 13 (end of conveyor)into register?


For rouge, I use a value of 99. I also put a counter in to see how many 99 there are at the end of the conveyor.

For the array, it is just 1 deep, and there are 2 empty place holders between each station. You might only need 1, but I would put another in just in case.

This really isn't a FIFO and that instruction won't work the way I have it laid out. Since you will be zero out data in the middle and possibly adding in the middle, I just use a "roll your own" bubble type of sort.

One product between the BCR and station 1 is nice, but it should still work if you have the array set up. I used to track 40-50 tires traveling at 160 ft/min with 20 sort stations. The distance between stations even varied at some places (there I just put in a couple of extra place holders between stations.
 

Similar Topics

Hello, I am trying to replicate a piece of logic on the PLC5 onto an SEL RTAC. I am using ladder on SEL and FBD. I am having issue on the ladder...
Replies
13
Views
241
Hi, Need a little bit guiding using SISTEMA software. As I understand a subsystem consist of components and are the same category. I'm confused...
Replies
11
Views
2,649
Good morning everyone, I've got 2 servo driven axes that each use a Heidenhain glass slide to the motion controller for position and velocity...
Replies
4
Views
1,412
RSLogix 500, what is the little image next to the ladder in the project tree? it looks like a little blue bug with a red dot on its back. just...
Replies
5
Views
2,055
Hi everyone, trying to get data out of a digital encoder that is little endian into my Siemens S7-1200 controller that is big endian...it's an...
Replies
7
Views
3,400
Back
Top Bottom