dumdum

OEE line speed

6 posts in this topic

Hi

What would be the best way to track units per last 5 minutes?

Share this post


Link to post
Share on other sites

That's a very broad question with far too little information given.

Can you supply the following:

1. Anticipated Units Per Minute Maximum and Average

2. What AB PLC are you using {PLC5, SLC500, ControlLogix5000, CompactLogix5000, Micro800Series, MicroLogix}

Share this post


Link to post
Share on other sites

While @BobLfoot is right, here's an over-generalized stab at it. I downloaded and tested on a 1756-5573, using V32. It works to count and record the parts over five-minute intervals.

 

 

Five Minute Part Counter.pdf

Share this post


Link to post
Share on other sites

Sorry i didn't provide the necessary information. 

Maximum units pr minute would be 8000 also average IF the machine is running.

Controller type: Compact logic and controllogix

Ideally i want real time update rate. But i'm aware that the amount of data would be too much. 

My thought was to load a counter value to an array of dint. (Dimension:5). Each dint of the array would represent count for each minute. Then use system clock to shift array every 1 minute. The average sum of the array would be units pr 5min updated every 1minute.

Is there a better way? 

 

Share this post


Link to post
Share on other sites

like this

 

unitsper5.PNG

Edited by dumdum

Share this post


Link to post
Share on other sites

That may not quite work, but it's really close. The first COP instruction will copy the avg_array to avg_array_Temp, but offset by one position. If your arrays are 5 elements long, you're going to have a problem with it since you're starting the copy into the destination at register [1] for length 5. The last element that will get written to is element [5], but the last element of a 5-element array will be [4] (they start at [0]). That also leaves the value in avg_array_Temp[0] unchanged, which then gets copied back to avg_array[0]. During the times between pulses of System_One_Shot_Min, your avg_array will not have valid data. Element [0] will always be invalid except during the scan of that rung of code.

What I would do is use a COP instruction to shift the avg_array one position UP (closer to [0]) like this:
Source: avg_array[1]
Dest: avg_array[0]
Length: 4
That will move [1] into [0], then [2] into [1], then [3] into [2], and finally [4] into [3]. [4] will remain unchanged while the data in the other registers moves one position towards [0]. Then MOV your counter .ACC into avg_array[4]. The most recent minute's data will always be in element [4] of the array with the preceding 4 minutes' of data always there and available for display or other purposes. Then you can use the AVE instruction on the array to get the average of the last 5 minutes. You won't need the _Temp array or the MUL instruction.

You can also investigate the FIFO instructions (FFL/FFU), but they may be overkill for this.


The RES instruction of the counter may also cause you to be off by one count. If Unit_sensor is still on for the next scan after RES, your CTU will increment again, double-counting that part. To avoid that, you can either use an ONS instruction between Unit_sensor and CTU or MOV 0 into counter_avg.ACC instead of RES.

1 person likes this

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now