Material output per time for speed test question

Hi All,
I need to calculate total material output per X time for a production machine.
To put it another way, I need to know how much material weight the machine put out in the previous 5 minutes, continiously.

This machine outputs material in bags at varying weights.
Its fastest output is 1 bag every 7 seconds, but varies because it is operator controlled.

My original thought plan was something like the following:
1: load the bag weights and their output time into a datatable or where they are tied together.
2: keep a running total of them and continiously delete the entrys older than 5 minutes.

it always sounds simple until you get to the details.

I am presently reading the bag weights in floating point.

My problem is I do not know how to tie the weight values to the time, and where to save them.

Is this possible to do within a SLC 5/05, and how should I do it?

I can purchase any devices or equipment that are required to get this accomplished, but I would prefer to use what I have if at all possible.

Thanks in advance for any suggestions.

OK I think we have agreed that using weight is the best for the paper shreds. Now that we have eliminated deriving weight at the input or front end our other choice is the output back end.

You are already weighing bagged product.
I think the approach algorythm could be
1. Start timer say 5 minute
2. Start detector for bag at each bag number dumps to a temp file INCREMENT --- also record bag weight in similar manner
3. The total file adds the value in temp file INCREMENT to give a running total and puts that number in another "file" call it SUM

Divide SUM by time accumulate from timer and by number of bags
That should give you total weight of paper and fire retard
IF you subtract teh weight of fire retardent from that weight then you derive paper weight
Now you can divide paper weight by retard weight to get percent.
Dan Bentler
 
Thanks guys, that is actually the process I am using now, except that I did not use a FiFo, I bumped each weight to a flt address, so I could see each weight, and have the previous bag weights displayed on an interface.

My dislike, or problem with this setup is that the total only updates when the timer runs out. I am forced to use a larger time value than desired in order to maintain a stable output number. 15 minutes is barely stable enough to be of any use.

On top of that, this setup is for multiple machines that all send their output data back to 1 SLC to be summed up. this makes the long timer value problem even worse.
It works most of the time like this, but when there is a problem somewhere in the process, like material supply, this setup displays unrealistic data for the next 15 minutes.
On a bad day, the process might stop several times without reaching 15 minutes of continous runtime.
Chris
 
Last edited:
I really need the amonut of weight output in xx minutes to update every second.
I thank everyone for the help!
I should have asked this question.

How do I create an If/then statment that evaluates time.
If I save multiple time values somewhere, lets call them "T" values.
I need to compare these "T" values to the current time, and perform an action if XX seconds have passed.
This needs to evaluate at least 25 "T" data at the same time, so I don't think a timer will suffice.

Seems like a simple subtraction, with a GEQ.
But what happens when the minutes roll over from 60 to 0?
I know the SLC will fault if I try to subtract from 0.
Any ideas?
 
Last edited:
My dislike, or problem with this setup is that the total only updates when the timer runs out

I am not sure of your process, but can you not update when each bag is filled, or discharged?

Every time a hopper or whatever etc is full, or empty, can you not update your FIFO's that way?

Just a thought...
 
I am not sure of your process, but can you not update when each bag is filled, or discharged?

Every time a hopper or whatever etc is full, or empty, can you not update your FIFO's that way?

Just a thought...

Going to have to think on that one for a while...
If I can make it work it should be more accurate.

Give me a few days to try that.
Thanks,
Chris
 
If the total of each five minute period will fit within a floating point register, then you can FIFO all of them, and keep a running sum.

Provide a method to restart the logic so that you can clear the running sum, and FLL with zeros the FIFO stack. Make the stack hold 300 items (300 seconds = five minutes). This means that you will need two floating point files since each file can only hold 256 elements.

Each time a bag is produced, add its weight to a temporary holding register. Be sure to use a 1shot to only add it once (OSR). Then, each time S:42 changes, add that temp value to the running sum and FIFO it into the stack and clear it. Then subtract the oldest one from the running total. I would not actually use a FIFO for this. Rather, I would have a moving pointer that wraps around.

The only problems are going to be if the total weight exceeds what can be stored in a float, and floating point precision on the running total. The running total may get "off" over time, so it might be a good idea to clear the data and start fresh periodically. The frequency would depend on your raw data and actual needs.

I can write up an example for you and attach it in a few minutes...

Paul

EDIT: Try the attached example. Note that you will have to supply the logic to write to the most recent second value (F8:100).
 
Last edited:
ElectricFreak,

I am not qualified to offer any advice but I have never let my shortcomings stop me before so why start now?

I was doing some reading and came across these two instructions. I don't know but it seems like they might be of help.

RHC - Read High Speed Clock: Provides a high performance time-stamp for performance diagnostics and performing calculations such as velocity.

TDF - Compute Time Difference: Calculates the number of 10 μs “ticks” between any two time-stamps captured using the RHC instruction.
 
I have read a bit about the RHC and TDF, I already use the RHC in these machines, and I believe only one is allowed per CPU in the SLC 500 series.
I dont think "I" can apply the TDF to my situation.

Right now I am trying to figure out how to apply the weight tracking example from OkiePC.
It looks very promising, but I have never had to use a FIFO before, so I'm still comprehending how it works.
It may take me a few days to integrate, as production runs almost round the clock in winter.

Thanks,
Chris
 
Right now I am trying to figure out how to apply the weight tracking example from OkiePC.
It looks very promising, but I have never had to use a FIFO before, so I'm still comprehending how it works.

Technically, it isn't a FIFO. It doesn't use the FFL/FFU instructions, or the COP instructions to move a ton of data around. It just moves one pointer [n7:101] around in a circle from 0 to 299 and then back to zero. That address is used as an indirect addressing which is a reference to the next (newest) spot in the floating point files to be used. Once a second, the amount produced during that second is moved there and also added to an accumulated total. Then the pointer is moved to the next spot, (the oldest value) and then the number stored in that spot is subtracted that from the total.

If you aren't familiar with this indirect addressing technique, then feel free to ask any questions you might have.

That program was written without any knowledge of how much you produce and how fast. It will require you to add the code which will ADD the quantity produced to the address F8:100. This can be done at any time and frequency, and could be completely separate from the logic I provided. Just know that my logic will CLR that value once per second, so don't use that address for anything else.

Just add a rung somewhere in your existing program that will add the weight produced to F8:100 at whatever point in the cycle is most logical for the process. And monitor F26:50 for the running total of the last five minutes worth of product.

Notice that F26:50 is cleared on power up (or when the data is reset) since it is part the group that gets cleared after the raw number storage area.

As for putting it to work in your machine, if you don't have the unused data file space available then you would have to put the machine in program mode for about a minute in order to download a file with the data tables expanded.

I chose those file numbers and addresses somewhat randomly, so it is likely that you'll need to change them to fit in with your existing logic without interference.

Offline, you can use the search and replace features in RSLogix to do the grunt work for you (CTRL+H). It will even move the comments to the new addresses. Just make sure you examine the indirect addressing closely after using search and replace. Sometimes that feature does not do what is expected when it runs across those square brackets.

Good Luck!
Paul
 
Thanks OkiePC!
after converting some addresses, I have it in my program.
It appears to work. however I won't know till tomorrow, because production shutdown to do maintenance.

They like to use short weeks for that, due to production bonuses.

I think I understand your logic, but it is completly new to me.
the indirect addressing is new to me also.

My process puts out a weight value roughly every 10 seconds. it varies from 8 to whatever depending on a hundred variables.

When I get to view it in action, I will have a better understanding, I hope.

will report back tomorrow...

Chris
 
I am happy to report, it works, and I think very well!

at this time, I have it only on 1 machine.
By tomorrow, I will have in on all the machines for 1 production line.
Then I can total them and display on Operator interface.

Right now I am running this in parallel with the old way I was calculating rate, so I need to get rid of the old code, and clean up.

I'm having problems getting FactoryTalk View Studio to run on my Windows 7 64bit laptop. Going to have to install it on a desktop somewhere so I can redo the Panelviews.

Thank You OkiePC!

Chris
 

Similar Topics

Any list of additional components needed to complete a plc installation
Replies
11
Views
786
The objective: Reach about 10’ horizontally into a 1300F furnace, and pick up a 140lb rectangular container, then pull the container back out of...
Replies
15
Views
1,913
Sometimes I build small circuit boards, and I want to pot them into a case. What do you use for this ? Some type of epoxy or what ?
Replies
3
Views
671
I am looking for a way to determine level in a silo. The material is called Perilite which has a very light density. Bulk density could be...
Replies
10
Views
2,771
Hello everyone, as part of the automatic process, we need to non-contact measure the distance between a black glossy plastic with a pattern...
Replies
3
Views
2,304
Back
Top Bottom