Data manipulation- moving average

frt

Member
Join Date
Jul 2011
Location
nh
Posts
2
Hi all,
I am pretty new to the PLCs and I had a question about data handling.
I get readings from a pressure sensor and display it to the screen (I use EZSeries) the thing is, the pressure sensor readings fluctuate so much and I need to stabilize it somehow. I want to apply a moving average on the data and then display it to the screen. Is such thing possible ?

Thank you
 
Hi all,
I am pretty new to the PLCs and I had a question about data handling.
I get readings from a pressure sensor and display it to the screen (I use EZSeries) the thing is, the pressure sensor readings fluctuate so much and I need to stabilize it somehow. I want to apply a moving average on the data and then display it to the screen. Is such thing possible ?

Thank you

You want to put moving average routine in the PLC? Yes, it is possible.
PLC make/type?

Kalle
 
Hi Frt,

Yes, that is certainly possible. Two questions: How often do you need to take readings, and how often do you want the average updated?
 
Not to sidetrack a PLC solution but some pressure transmitters have a setup parameter typically called damping that smooths the output of the pressure transmitter.
 
the pressure sensor readings fluctuate

First why does it fluctuate so much?

If your EZseries supports math instructions then a simple filter might work for you.

FV=FV+C(NV-FV)
Where:
FV= Filtered value
C= constant (range 0-1) The smaller the number the more dampening.
NV= New Value
 
I'm not familiar with EZ series, but here is a way to do it on an SLC processor that is fairly simple.
 
Mickey thank you very much. The fluctuations decreased significantly. never thought that it would be this simple.

Also thank you all for your ideas and suggestions

Frt
 
The fluctuations decreased significantly. never thought that it would be this simple.
NO! The pressure fluctuations ARE STILL EXACTLY the same as they were. The only thing that decreased significantly is the fluctuations in YOUR DISPLAY OF THE PRESSURE.

This is something to keep in the back of your head. Most likely, for all normal every-day uses, your new average pressure will be what you want to use. At the same time you need to be aware of what the REAL pressure is doing - jumping around all over the place. At some time for some other use, this could be important.

For example, for controlling the draft pressure in certain gas and wood-fired boilers, it is important to keep the pressure from ever going positive. Positive pressure in the burn chamber can result in dangerous gases being expelled into an occupied area.

You can average this pressure over some time period to get a nice display number that is easy to read and follow, but at the same time, for the draft pressure controller, you must not use too long of an averaging time period to control the draft, otherwise it will go positive too often.
 
Last edited:
I dont know about EZSeries PLC's, but many provide a first or second order filtering as standard, my control theory memory suggests this would be better than a moving average .
Or as DANV said the transmitter itself may provide filtering (damping)
 
BMACATTACK - What you have programmed is useful, however it isn't strictly a moving average, it is a 10 second average with 10 samples, updated every 10 seconds. A moving averge continuously updates every sample, by deleting the last sample, summing the values and dividing the sum by the number of samples. The major difference is that moving average updates every sample.
 
FV=FV+C(NV-FV)
Where:
FV= Filtered value
C= constant (range 0-1) The smaller the number the more dampening.
NV= New Value

Mickey,

I am so glad you posted this formula again. I was looking for this for a job I am working on right now and going thru all of your posts would have been a difficult task.


Thanks,
Clay
 

Similar Topics

Hello Everyone, I am uploading a CSV from a Click PLC, doing so the rows are in groups of 10 cells (columns B-K), below that in the next row is...
Replies
12
Views
2,883
Knowledge of all, it indicates which hardware. To classify the adequate models of PLC and with evident capacity to: 1-Set of instrutions...
Replies
7
Views
4,150
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
153
We are using RED LION HMI Since las 15 years. To day we have found that My log file has data up to 22 Mar 2024 1:16. Then After new Log File is...
Replies
22
Views
825
Back
Top Bottom