Moving avg values from cyclical pumps

Traxxtar

Member
Join Date
May 2022
Location
Rochester, NY
Posts
5
Our lift station pumps cycle on/off about 8x/hr sending waste flow offsite. We measure the flow during pump cycles. I will add a totalizer but wanted to capture the peak flow of each cycle/pump occurrence when it happens and get that avg for the previous 1 hour.

Using ladder logic, what's the best method to use?

TIA
 
A simple method would be to have an array of the peak flows. (8 since you want to average 8 per hour)
At the end of every cycle move out the oldest value in the array and move in the newest. Run the average of the array.
If you are using RSLogix trying looking up CPS and AVE instructions for specifics.
 
If it is important that the average be time-based (last hour) but the exact number per hour may vary, I would suggest using a FIFO and storing timestamps, then using [oldest timestamp + 1 hour] to unload.
 
Welcome to the forum!

Do you want the average of the peak flows for the previous hour, or would the average of the peak flows for the previous eight ON-cycles be "good enough?"

[plvlce beat me to it!]
_
 
Last edited:
clunky approach in RSLogix500; Logix may be coded similarly; a FIFO and and an AVE block would be a lot cleaner.
 
Last edited:
First post and you guys are all over it. I'm impressed beyond words.

THANK YOU guys so much for the warm welcome. I'm new to this SFC/Ladder stuff so some of it will require some reading.

Since we're avg about 7-8 pump cycles for an hour I can simply grab the peak values of the last 7-8 cycles, then avg those.

I'll look at the solutions you guys offered and learn from there.
 
There is also a moving average instruction, MAVE (cf. this link), but it is not available in Ladder.

The peak flow collection would be the same i.e. initialize max flow to 0 on rising edge of pump running, then overwrite with any max flow as long as pump continues to run, then on the falling edge of pump running pass that peak value in a call to MAVE.
 
A very simple way to grab the peak of a cycle is to just use a "Pump Running Bit" Then check if the current value is > a "saved value" If it is move the current value to the saved value. Every time you turn off the pump the "saved value" will be the highest peak during the operation.
 
A very simple way to grab the peak of a cycle is to just use a "Pump Running Bit" Then check if the current value is > a "saved value" If it is move the current value to the saved value. Every time you turn off the pump the "saved value" will be the highest peak during the operation.

Sweet and simple, I love it!!

Thank you!
 
Another question: What's the simplest totalizer I can build with ladder logic?

I now have an avg, but if the pump ramps up, flows out for 3 mins, then shuts down, after 8x of doing this per hour, what's the simplest way to totalize that?

Allen-Bradley, RSLogix 5000
 
Another question: What's the simplest totalizer I can build with ladder logic?

I now have an avg, but if the pump ramps up, flows out for 3 mins, then shuts down, after 8x of doing this per hour, what's the simplest way to totalize that?

Allen-Bradley, RSLogix 5000

I think its important to know if you want to check the "last 8" or the "last hour"
 
So every cycle you will need to save the data in an array. If you include the current time in your data table. You can then go back and totalize everything on the previous hour.

I generally don't use a FIFO. I like to use an array of a udt that contains everything I want to save. Then I shift it with a copy instruction. But due to the way the copy instruction works its necessary to copy to a buffer, then back.
 

Similar Topics

Ok, I'm no expert so bear with me. I'm using a dual head Keyence laser setup to measure board thickness. The board dimensions are 4'x8'...
Replies
5
Views
2,599
I'm a Siemens person, and this is one of my first AB programs. The customer wants everything programmed in Ladder. I have a lot of data (3...
Replies
14
Views
220
Hello, I have a compact Logix plc and I have been task with configuring alarms into our SCADA when an Analog signal stops moving. The analog...
Replies
6
Views
244
Hello, i am a beginner with a Siemens Logo 8 PLC. I would determine the direction of an object if it passes a whole cycle of 2 input sensors. See...
Replies
2
Views
188
Can an AOP be removed from Logix? I seem to have some version weirdness from an E&H AOP and I need to see if reinstalling the AOP will correct it.
Replies
5
Views
974
Back
Top Bottom