Calculte the length of parts on conveyor chaning speed

hani2018

Member
Join Date
Apr 2018
Location
New York
Posts
20
I need help on develping PLC logic to use a PE(photoeye) to detect and calculate the lenght of parts and gap between parts on a conveyor. Conveyor speed is controlled by VFD and vary according to line speed. Thanks.

Part length and gap between parts also change during production
 
Depending on your accuracy needs, you need add an encoder or prox sensor and sprocket to a conveyor drive shaft. That will give you pulses representing conveyor travel while the PE senses the parts.
 
I need help on develping PLC logic to use a PE(photoeye) to detect and calculate the lenght of parts and gap between parts on a conveyor. Conveyor speed is controlled by VFD and vary according to line speed. Thanks.

Part length and gap between parts also change during production
To measure speed you need of an object on a conveyer you will either need to know the lenght of the object and measure time or 2 Photoeyes at a set distance and measure time between. Alternatively you could put put and encoder on the Converyer or from the G/Box Ratio & the Motor Details calculate the speed -> hz ratio and then use the Hz feedback from vfd.
 
Thanks for answer. There is only one PE in this application and we use SLC500. Could anyone provide the plc logic example or source code example?
 
I need help on develping PLC logic to use a PE(photoeye) to detect and calculate the lenght of parts and gap between parts on a conveyor. Conveyor speed is controlled by VFD and vary according to line speed. Thanks.

Part length and gap between parts also change during production

Agree with @jayden regarding speed feedback directly on the conveyor.

And if your accuracy needs are moderate, like you need to detect the difference between a box that is 6 inches long or a box that is 12 inches long, using the VFD output frequency and calculating through the gearbox to get belt speed, like @mad4x4 suggested, should work.

Just a general comment - the more info you give us, the more we can help. Vague requirements can only get you guesses, and vague solutions.

For example, if you posted the following, it would be AWESOME:
- I'd like to measure gaps between objects, and the length of objects, on a conveyor plus or minus 1/8 inch.
- the belt is running 3 - 6 feet per second and is running on a VFD with an encoder on the motor
- the gearbox is enclosed and we can't put feedback on the final drive gear
- the belt is not enclosed, so we can add a rubber wheel that is driven directly off the bottom of the belt for speed feedback

I realize that you would have to have a solution in mind to include a lot of these details ... but with this information many of us could provide specific recommendations on photo eyes, perhaps some programming suggestions, encoder/rubber wheel mounting ideas, etc
 
things to also consider.
If the photo is picking up the box as it leaves one conveyor and travels onto the conveyor with the photo, you will have product slippage.
if the conveyor belt starts / stops frequently, you may also have product slippage.
if the conveyor is on an incline / decline, the box may also slip.

tell us what your plc consists of, I/o modules.
post what you have done, zip the file first and attach it to your post.
we will offer suggestions.

james
 
Thanks for thingstodo and James for your suggestions.

The application is simple. After line start, conveyor with new length measure PE will run at constant speed most of time, maybe speed change based on upstream/downstream machine status. I need to add logic(slc500) to check final product length and gap between them. If either product length or gap is out of spec, system need sound the horn to alert operator to remove product manually.

The control accuracy is low and we only need PE to check both length and gap and don't need encoder.

--- Length spec: Between 20'' to 25'', if product <20'' or > 25'', need alarm
---- Gas spec: should be above 7'', if gas below 7'', need to alarm
---- Belt is drived by pf700 VFD and line speed is around 80 FPM.
----- If the logic can handle speed change, it will great, if not, conveyor run at 80 FPM most of time
---- Logic will not need to check during start/stop,incline / decline condition etc.

I need PLC logic sample code to perform test to approve the concept.
 
A product 20" long travelling at 80 FPM will be in front of the photoeye for 1.25 seconds.
A product 25" long travelling at 80 FPM will be in front of the photoeye for 1.5625 seconds.
During a gap of 7" at 80 FPM there will be nothing in front of the photoeye for 0.4375seconds.

The formula for calculating the time is [Product length (Inches) / 12 (Inches per foot)] divided by [Line Speed (FPM) / 60 (seconds per minute)]

or more simply, Product (or gap) Length in inches times 5 divided by speed in FPM.

Create one timer to measure the time while the eye is blocked by the product and a second timer to measure the time while there is nothing blocking the eye.

If your PLC scan time is 10 milliseconds the product travels 0.16 inches during each program scan. You can't detect any shorter increment than the distance traveled in one program scan.
 
Thanks Steve and all for the answers. If I need to use BSL to track the product on conveyor for above application which only has one PE, what condition shall I use to trigger the BSL instruction?
 
You could use a OSF from the PE input to trigger the BSL as the part leaves. BSL is binary, so you can't retain the length value, just a Go or NoGo condition.
To track the length value, you could use a FIFO.
 
Thanks Steve and all for the answers. If I need to use BSL to track the product on conveyor for above application which only has one PE, what condition shall I use to trigger the BSL instruction?

Now it's getting more interesting!

You can trigger the BSL as @jaden describes.

If you want to keep track of the sizes of each, you will need an array of INT.

There is no BSL for INT arrays, but you can do it with two COP commands. If you have your array sized .. lets say 100 long. You need a second array of 100 long to copy to, then copy back ...

This one copies your data to N10 from N7
COP N7:0 N10:0 100

This one empties N7:0
MOV 0 N7:0

This puts everything one integer to the 'left'
COP N10:0 N7:1 99

All three of these can be on three branches of one rung, triggered with the same logic that triggers your BSL

But I'd suggest getting your BSL working the way that you want before adding the array of integers

You can add a second array of integers to keep track of the spaces between your objects.

Be careful about your scan time. These COP instructions take some time. If you have timing sensitive logic in your SLC ... like diverting the objects to a different conveyor when they pass a photoeye .. the increase in scan time could mess it up :(
 
Could anyone create PLC sample code for me to follow to achieve Steve Bailey's idea?

A product 20" long travelling at 80 FPM will be in front of the photoeye for 1.25 seconds.
A product 25" long travelling at 80 FPM will be in front of the photoeye for 1.5625 seconds.
During a gap of 7" at 80 FPM there will be nothing in front of the photoeye for 0.4375seconds.

The formula for calculating the time is [Product length (Inches) / 12 (Inches per foot)] divided by [Line Speed (FPM) / 60 (seconds per minute)]

or more simply, Product (or gap) Length in inches times 5 divided by speed in FPM.

Create one timer to measure the time while the eye is blocked by the product and a second timer to measure the time while there is nothing blocking the eye.

If your PLC scan time is 10 milliseconds the product travels 0.16 inches during each program scan. You can't detect any shorter increment than the distance traveled in one program scan.
 
if the conveyor speed changes (and it will due to speed signals, changes in load, voltage sags,....) you will need an encoder.

Not slamming you in any way with what I am about to say and I apologize in advance if I offend you.
We are more than happy to help you if you post your work. I have been helped on several projects. I detailed what I wanted, members offered suggestions. I then posted the program when I had an issue and received several answers with the program changes. they worked wonderfully. I have also helped where I can.

post your work, zip the program (forum rules), describe the issue(s) you are having, and we will look at it and offer suggestions / corrections. my break is over, so it's back to work.

james
 
The problem with me posting some code for you to try is that you didn't write it.

In my experience, writing the code gives you some sort of connection with the solution. It's difficult for a programmer to troubleshoot other people's code ... no matter how much sense it makes and how much it is documented. This gets easier with experience, but it it *REALLY* difficult for beginners!

If I write it up and you have any problem at all, and you don't know how it works, you won't be comfortable fixing it.

When I type in my own code, and test it, it seldom works the first time. None of us have your hardware, so we can't even test it before we send it. That does not even begin to address the silly things that happen in the real world, like photo-eyes getting dirty, the photo-eye vibrating a bit on the mount and turning off for short periods ... or other interesting stuff like that.

As @James Mcquade said - much better that you write your own code and others give you suggestions. The 'banging your head on the desk' part of trying it on your own first ... appears to make the lessons stick much better.
 
adding to what thingstodo said and not meaning to be rude.

doing your work for you will learn you nothing. when asked to modify the program or write something similar to the program on another plc, you try to figure out what we wrote and eventually you get into trouble, so you come back here for more help. The boss learns or figures out that you had help and your out of a job.

Everyone has started as a beginner and we truly understand, but we offer this help to everyone.

try this.
break your system down into parts.
1. start and stop the conveyor.
2. add a photo cell to detect when an object is in the way.
put the accumulated time in a register for when the object is gone.
do the math to get your distance.

this is a start, but you have to figure out the rest.
james
 

Similar Topics

Maybe this is just not possible, or maybe I am doing something wrong. Background; I have a data array of over 1500 products. For sorting I...
Replies
6
Views
727
Hello all, I see that the Block Transfer Read instruction can read a max length of 64 words I have a Hilscher gateway to map DeviceNet Slave to...
Replies
7
Views
803
Hello everyone, I'm working with an old ACM3710 device and I'm encountering an issue with the data frames I'm sending over an RS232 connection...
Replies
5
Views
655
Good day all. I have an RS-485 topology question. I am hoping for some guidance so that I can make a confident calculation/decision that this will...
Replies
4
Views
1,413
Just wanted to see if anyone can see anything wrong with this as my mind is being blown. Basically, I have created a TCP server string decoder to...
Replies
9
Views
1,279
Back
Top Bottom