You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

---------->>>>>Get FREE PLC Programming Tips

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

PLC training tools sale

Reply
Thread Tools Display Modes
Unread October 17th, 2019, 10:28 PM   #1
hani2018
Member
United States

hani2018 is offline
 
Join Date: Apr 2018
Location: New York
Posts: 20
Calculte the length of parts on conveyor chaning speed

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
  Reply With Quote
Unread October 17th, 2019, 11:53 PM   #2
jaden
Member
United States

jaden is offline
 
Join Date: Sep 2009
Location: Pleasant Dale, Nebraska
Posts: 179
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.
  Reply With Quote
Unread October 18th, 2019, 03:17 AM   #3
mad4x4
Member
United Kingdom

mad4x4 is offline
 
Join Date: Mar 2009
Location: ST CYrus
Posts: 42
Quote:
Originally Posted by hani2018 View Post
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.
  Reply With Quote
Unread October 18th, 2019, 11:59 AM   #4
hani2018
Member
United States

hani2018 is offline
 
Join Date: Apr 2018
Location: New York
Posts: 20
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?
  Reply With Quote
Unread October 18th, 2019, 12:09 PM   #5
thingstodo
Member
Canada

thingstodo is offline
 
Join Date: Feb 2012
Location: Saskatoon
Posts: 317
Quote:
Originally Posted by hani2018 View Post
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
  Reply With Quote
Unread October 18th, 2019, 12:57 PM   #6
James Mcquade
Member
United States

James Mcquade is offline
 
Join Date: Oct 2007
Location: Tennessee
Posts: 2,607
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
  Reply With Quote
Unread October 18th, 2019, 05:51 PM   #7
hani2018
Member
United States

hani2018 is offline
 
Join Date: Apr 2018
Location: New York
Posts: 20
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.
  Reply With Quote
Unread October 18th, 2019, 07:55 PM   #8
Steve Bailey
Lifetime Supporting Member + Moderator
United States

Steve Bailey is offline
 
Steve Bailey's Avatar
 
Join Date: Apr 2002
Location: The boondocks of Western Massachusetts USA
Posts: 6,896
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.
  Reply With Quote
Unread October 19th, 2019, 09:40 PM   #9
hani2018
Member
United States

hani2018 is offline
 
Join Date: Apr 2018
Location: New York
Posts: 20
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?
  Reply With Quote
Unread October 19th, 2019, 09:56 PM   #10
jaden
Member
United States

jaden is offline
 
Join Date: Sep 2009
Location: Pleasant Dale, Nebraska
Posts: 179
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.
  Reply With Quote
Unread October 20th, 2019, 03:16 PM   #11
thingstodo
Member
Canada

thingstodo is offline
 
Join Date: Feb 2012
Location: Saskatoon
Posts: 317
Quote:
Originally Posted by hani2018 View Post
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
  Reply With Quote
Unread October 21st, 2019, 11:40 AM   #12
hani2018
Member
United States

hani2018 is offline
 
Join Date: Apr 2018
Location: New York
Posts: 20
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.
  Reply With Quote
Unread October 21st, 2019, 03:36 PM   #13
James Mcquade
Member
United States

James Mcquade is offline
 
Join Date: Oct 2007
Location: Tennessee
Posts: 2,607
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
  Reply With Quote
Unread October 21st, 2019, 05:26 PM   #14
thingstodo
Member
Canada

thingstodo is offline
 
Join Date: Feb 2012
Location: Saskatoon
Posts: 317
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.
  Reply With Quote
Unread October 21st, 2019, 06:28 PM   #15
James Mcquade
Member
United States

James Mcquade is offline
 
Join Date: Oct 2007
Location: Tennessee
Posts: 2,607
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
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Topics
Thread Thread Starter Forum Replies Last Post
Powerflex 525 Encoder for Speed Feedback ASF LIVE PLC Questions And Answers 5 September 12th, 2017 06:45 PM
ControlLogix and Devicenet Christoph LIVE PLC Questions And Answers 16 October 5th, 2013 11:17 AM
Using a proximity switch to detect speed Beej LIVE PLC Questions And Answers 22 December 8th, 2011 05:21 AM
Cut to length problem alanm LIVE PLC Questions And Answers 8 April 8th, 2003 01:40 PM
VFD speed control Alan Case LIVE PLC Questions And Answers 8 July 18th, 2002 04:09 PM


All times are GMT -5. The time now is 07:02 PM.


.