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
Old October 9th, 2013, 08:34 AM   #1
MartB
Lifetime Supporting Member
United States

MartB is offline
 
MartB's Avatar
 
Join Date: Jun 2005
Location: Pinellas Park, FL
Posts: 684
RSLogix 5000 Product tracking

Product tracking based on time and position.
I'll be using a 1769-L16ER-BB1B processor. There will also be an HMI involved, but it will be for display purposes only (data will also be fed into our plant metrics system).

The scenario:
Products are loaded into a curing oven (thermal) which is essentially a continuous conveyor. An encoder tracks movement and speed of the oven. The oven conveyor can stop/start several times during the curing process.
The oven has 4 thermal zones which are individually controlled (by separate controllers external to the PLC).
The oven can accommodate approximately 1500 products. Potentially they could all be different product ID's (ID's are supplied by loading robot in the form of a string).

The requirements:
Track the position of each product in the oven.
Record the time each product spends in each zone.
Warn if the product is approaching max time in a zone.
Alarm if the product exceeds max time in zone.
During the unload process, pass the product ID and time spent in each zone to the next machine.

Initially I was thinking of just loading a FIFO for each Zone which would simply move the product through the oven.
However, I've also learned that the oven does not have a continuous supply of product and there may be gaps in the system.
So would it better to have a time based FIFO? probably not as the oven can stop or start many times during the curing process (due to downstream equipment).
So would it be better to do either or?
i.e. If product is loaded, and the encoder has moved on 'one product space' then index the FIFO
OR
If no product is loaded, and 'some' time has elapsed and the encoder has moved on 'one product space' then index the FIFO
?

Then there is the problem of tracking the time per product. I've never done anything using time comparison before. Can I just time stamp the product somehow as it enters the system and load that into a FIFO?
How can I compare current time in the system to see if I'm approaching max time?

I'm still spitballing ideas here, but I'm willing to bet someone has already done
something similar and can help guide me in the right direction.
I'm just having trouble deciding which is the best way to achieve a clean and dynamic solution. And by dynamic I mean will work regardless of oven loading (there could be several gaps in the oven, or several stops in the cycle).

Any ideas or suggestions would be most welcome.

Thanks.
__________________
Mart B
_________________________________________________

Never underestimate the predictability of stupidity!
  Reply With Quote
Old October 9th, 2013, 10:41 AM   #2
rigicon
Member
United Kingdom

rigicon is offline
 
rigicon's Avatar
 
Join Date: Aug 2009
Location: kent
Posts: 409
http://www.plctalk.net/qanda/showthread.php?t=64462
This worked for me. No timers though.
__________________
Artificial Intelligence - Genuine programmers headache

  Reply With Quote
Old October 9th, 2013, 11:13 AM   #3
MartB
Lifetime Supporting Member
United States

MartB is offline
 
MartB's Avatar
 
Join Date: Jun 2005
Location: Pinellas Park, FL
Posts: 684
Thanks, that one didn't come up in my initial search, I'll check it out and see if it fits my needs
__________________
Mart B
_________________________________________________

Never underestimate the predictability of stupidity!
  Reply With Quote
Old October 9th, 2013, 12:20 PM   #4
MartB
Lifetime Supporting Member
United States

MartB is offline
 
MartB's Avatar
 
Join Date: Jun 2005
Location: Pinellas Park, FL
Posts: 684
Unfortunately the example you redirected me too doesn't solve my timestamping/comparison issue, but thanks anyway.
__________________
Mart B
_________________________________________________

Never underestimate the predictability of stupidity!
  Reply With Quote
Old October 9th, 2013, 03:35 PM   #5
blperkins
Member
United States

blperkins is offline
 
Join Date: Jan 2006
Location: minnesota
Posts: 56
If the data could be within a few seconds of being accurate, I think I Would set up a user-defined type in the PLC (called Product_Array). It would contain all the information I needed for each product. Such as if the robot placed a product, the timestamp the product entered zone 1, 2, 3, and 4. Also, the total time in zone 1,2,3,4. Along with the system master encoder position, the product ID and any other information I would need. I would add an array of these data-types in the controller tags longer then the number of products can fit in the oven (1500+).
Then I would have the Robot load the product in the oven, but have the robot (or the PLC this program is in) index the Product_Array it loads the product information into (current time and Encoder position).
Then on each scan I would scan and index up 1 of the Product_Array and compare the position to zone start positions (Start,2,3,and 4) and the current time. From that you could tell where the product is in the oven, the time it has been in each zone, and you can reset the array once the product exits the oven.
you will have to scan all 1500+ arrays to get all the data and tell which array is next to exit and that could take a bit of time depending on what else you have happening in the code.
  Reply With Quote
Old October 9th, 2013, 03:53 PM   #6
Paul T
Member
United States

Paul T is offline
 
Paul T's Avatar
 
Join Date: Oct 2006
Location: NH
Posts: 254
Hm. I think the FIFO idea is on the right track, but off the top of my head it seems it should be based on the encoder. Time doesn't enter the FIFO at all since you are not necessarily going to get any one product through the oven in the same time as any other. And, in fact "too long in oven" is a fault condition. So your FIFO will reliably run only off of position, which comes either from discrete inputs or the encoder count which is just another input after all.

I would approach this with, as you say, one FIFO per zone since you want to track time in zone. When a product goes into a zone, i.e. a FIFO, you write a flag to the FIFO - just a 1 or a zero. Now, you use the FIFO position as the index to a lot of other registers.

All the other registers, tied to that FIFO position, are your data. Some fixed - start time and start position. Others calculated, the time in zone (or oven) and the position in zone (or oven).

Some registers that come to mind based on what you need:

String ID of the Product
T0, time that it entered the zone
T1, time that it has been in the zone (calculated)
P0, encoder count when the product entered the zone
P1, product position (calculated)
Alarm0, flag set if product is approaching too long in zone (calculated)
Fault0, flag set if product exceeds time in zone

You can extend this to total time in oven, if needed.

So, I think what you want to do is us every encoder tick (or some number of them) to advance each FIFO. Sometimes when the FIFO advances you write a zero to it because no product entered the zone - ie, the FIFO. Sometimes product will leave. The stuff in the middle, is, in the middle.

Now, the time portion is pretty straightforward if lengthy. Every 10 seconds, or 1 second or every scan if you want! you run through subroutines on indexed arrays - 1 to whatever the FIFO count is. If the FIFO value at that position is "1" you calculate all your derived data from the initial time and initial position and update those registers. If it's zero, then nothing came in on that tick and you don't have to calculate anything. So, this accounts for your "holes" you see - there can be a gap but you don't care, the FIFO tells you it is a gap.

This will be fun of course if your FIFOs have to track 1500 parts. How many parts can you get into a FIFO in a CompactLogix, and how many words in a file etc. IDK. The typical 128/256 limits of Logix500 would make this approach a challenge for 1500 pieces of product. Is Logix5000 less limited?

Maybe this approach is one way to go.

Frankly, sounds like fun.

Paul T
  Reply With Quote
Old October 9th, 2013, 03:56 PM   #7
Paul T
Member
United States

Paul T is offline
 
Paul T's Avatar
 
Join Date: Oct 2006
Location: NH
Posts: 254
LOL. BL got his reply in while I was doing mine, but I don't think I would try this without a FIFO of some kind keeping track of the parts for me. My first thought is that I would definitely NOT try to write a time-based logic for part tracking through the oven. Time is data in this case not control.

Paul T
  Reply With Quote
Old October 9th, 2013, 03:59 PM   #8
MartB
Lifetime Supporting Member
United States

MartB is offline
 
MartB's Avatar
 
Join Date: Jun 2005
Location: Pinellas Park, FL
Posts: 684
Yep, that's pretty much what I'm working towards right now.
As far as accuracy, I'm told within 1 minute is enough, but using this system it would be accurate to within a second or two (which is better in my opinion).
The only thing I'd change is that I'm going to index the product array when the encoder has moved enough to allow one more product into the oven.
This way, if I'm not actually loading anything into the oven, I'll just put in an empty string for product ID, and let everything else move on down through the system.
I think having an individual array for each oven zone is also wise.

My dilemma is how to efficiently check each products time stamp to see if it's approaching (or exceeding) it's time in each zone though. This is the part I'm having a hard time getting my head around right now.
With up to 1500 products total in the oven I need an easy (and not time consuming) way to do it.
__________________
Mart B
_________________________________________________

Never underestimate the predictability of stupidity!
  Reply With Quote
Old October 9th, 2013, 04:01 PM   #9
MartB
Lifetime Supporting Member
United States

MartB is offline
 
MartB's Avatar
 
Join Date: Jun 2005
Location: Pinellas Park, FL
Posts: 684
Paul, I initially thought of using a FIFO, but the requirement to check the time to see if a product is approaching max time makes me think it might be better not to use a FIFO (as I'd have to unload it and reload it to check the timestamp for each product)?
__________________
Mart B
_________________________________________________

Never underestimate the predictability of stupidity!
  Reply With Quote
Old October 9th, 2013, 04:14 PM   #10
Paul T
Member
United States

Paul T is offline
 
Paul T's Avatar
 
Join Date: Oct 2006
Location: NH
Posts: 254
Quote:
Originally Posted by MartB View Post
Paul, I initially thought of using a FIFO, but the requirement to check the time to see if a product is approaching max time makes me think it might be better not to use a FIFO (as I'd have to unload it and reload it to check the timestamp for each product)?

Well, no, because the FIFO is only holding a "1" or a "0" at each position. The time stamp (and everything else) is in another register that is associated with that FIFO position.

OK, so what follows is based on Logix500. There are probably better ways to do it in 5000 but here goes. Biggest difference in Logix5000 is the UDT maybe so that you can set up one set of indexed registers, rather than multiple files of them? Not that it matters much, the data has to be manipulated the same either way.

For the time, I'd set up a subr that simply calculated the current second of the day, 1-86400. When a product enters, look at that register and that's your time T0.

Now, each time you update your product info, you look at the current second, subtract the T0 value that was stored when the FIFO position was loaded, and you have your time in seconds that product has been in the oven.

You have to account for rollover at midnight, but that is not too hard. Same for the encoder; you log the starting count and then subtract every time you update the registers. With provision for the encoder rollover too.

Paul T

Last edited by Paul T; October 9th, 2013 at 04:20 PM.
  Reply With Quote
Old October 9th, 2013, 04:16 PM   #11
Paul T
Member
United States

Paul T is offline
 
Paul T's Avatar
 
Join Date: Oct 2006
Location: NH
Posts: 254
See, the key thing is that the FIFO is ONLY holding a flag, no other data. ALL the other data is off to the side in registers that you find using the FIFO position value as a pointer.

As far as accuracy, hah. It's not a guess - it's as accurate as the timers in the PLC so nearly damm perfect. That's the beauty of using the FIFO and the encoder - time doesn't enter into it, you just read it and use it. Nearly perfectly accurate. BTW, how long does it take to traverse the oven and how many encoder counts over the distance?

Also, how do you know when product enters and leaves zones? Only on encoder count or is there something else like an optical sensor?

Last edited by Paul T; October 9th, 2013 at 04:24 PM.
  Reply With Quote
Old October 9th, 2013, 05:02 PM   #12
cwal61
Member
United States

cwal61 is offline
 
Join Date: Jan 2011
Location: NC
Posts: 980
Take a look at the FAL instruction And Using it in the incremental mode. You can make your Arrays as long as you need and use the FAL to increment the data thru the total length of the Array. No Limit on Lengths. Make your Array Lengths According To encoder pulses for the full length of the oven and the interval you need checked. You can use Multiple FAL to Track your Information or Make A UDT to hold all your data.

If you want to Track individual zone times you could make an AOI to enter data because all zone tracking should be the same. There are a lot of neat Instructions in RS5000.
Not all are Bubba Friendly and there are some here that only want to take that approach. But for me I Like the New Stuff.

good luck with your project.
  Reply With Quote
Old October 9th, 2013, 05:26 PM   #13
cwal61
Member
United States

cwal61 is offline
 
Join Date: Jan 2011
Location: NC
Posts: 980
Quote:
Originally Posted by MartB View Post
My dilemma is how to efficiently check each products time stamp to see if it's approaching (or exceeding) it's time in each zone though. This is the part I'm having a hard time getting my head around right now.
With up to 1500 products total in the oven I need an easy (and not time consuming) way to do it.
This could be done by converting all time to Minutes. Use the GSV instruction an choose the WallClock.
MUL the current HOUR x 60 and ADD current MIN to get Total Minutes for the Time of Day. 1:15 pm would be converted to
(13x60)+15 = 795th Minute of the day. Then it's a simple compare of the time spent in a zone.
  Reply With Quote
Old October 9th, 2013, 05:59 PM   #14
widelto
Member
Colombia

widelto is offline
 
widelto's Avatar
 
Join Date: Jul 2005
Location: barranquilla
Posts: 2,595
MartB:

There is and AOI calle Elapsed Time, I have used it to change setpoint in my process every ten minutes after process has started.
Your FIFO can be an array so that you have bar code data and time stamp data at the same time, this way you can compare actual time to time when an item entered the oven and you know how long any item has been inside the oven at any time.
The AOI can be download it from here:
http://search.rockwellautomation.com...te=sample_code
__________________
My two cents.
  Reply With Quote
Old October 10th, 2013, 07:33 AM   #15
MartB
Lifetime Supporting Member
United States

MartB is offline
 
MartB's Avatar
 
Join Date: Jun 2005
Location: Pinellas Park, FL
Posts: 684
Thanks everyone, lots of food for thought here.
I'll try and digest it and come up with a plan.....
__________________
Mart B
_________________________________________________

Never underestimate the predictability of stupidity!
  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
RSLogix Emulate 5000 - Controller Setup DC2010 LIVE PLC Questions And Answers 30 October 25th, 2016 10:43 AM
RSLogix Emulate 5000 v. 19.01 Saulo35 LIVE PLC Questions And Answers 17 January 20th, 2014 01:39 PM
RSLogix 5000 Need Help how to use tags. eshmx1977 LIVE PLC Questions And Answers 3 July 12th, 2010 06:54 PM
RSlogix 5000 professional huynt LIVE PLC Questions And Answers 4 August 2nd, 2005 02:45 AM
RSLogix 5000 eastkodakguy LIVE PLC Questions And Answers 2 July 3rd, 2002 12:28 PM


All times are GMT -5. The time now is 06:09 PM.


.