smoothing analog signal

cdnrookie

Member
Join Date
Apr 2013
Location
Canada
Posts
112
Good morning guys,

So i know this is extremely basic, but im just starting our with analog signals and trying to wrap my head around it.

I hooked up a prosense DPT to a 1746-NIO4, it is measuring the fan output from a vent.

I sclaed it down to 0-100 and i get some good numbers, the problem is that it can jump from -1.9 to 2 when the fan is off. When on, it flucuates from 68-75

Please keep in mind im new to this, what are some of the "approved methods" I have attached the program im using to view, feel free to mock me :)

thanks
 
There have been numerous posts providing good answers to this question.

Look for the "Search this Forum" tab on the far right side of the Live PLC Questions and Answers page. Click on the down arrow & search for "smoothing analog". The forum search is a wonderful tool. I highly recommend it.
 
Some of the answers to your question are hiding on the site under "digital filtering" and "running average" Attached is the method I use. I usually use a timer to trip the routine every few tenths of a second and use three to ten samples. The frequency and number of samples will depend on the signal fluctuations you get.
 
I use this

FV=FV+C(NV-FV)
Where:
FV= Filtered value
C= constant (range 0-.99) The smaller the number the more dampening.
NV= New Value
 
Thanks guys, I dit try the search, but didnt come up with much until I tried some keyword changes.

Ill play around with this a bit and post something then

thanks
 
The most basic thing is a moving average, which is not the same as a running average and is generally superior for filtering since running averages never converge.

The next step is a moving variance filter (variance is just standard deviation squared), which is a fancy way of saying filter out spikes. You basically look at how far a new point is from the old point and from the moving average and then decide if that point is complete ******** and should be ignored or your value really did jump.

The moving average will get rid of little blips, but you need the variance filter if you have longer lasting data spikes, like sensor that reads 0 or 100% every now and then when it can't see it's target for a split second.

I know I've posted my Structured Text variance filter on here before.
 
ok, so this gets me ALMOST there, but my reading still fluctuates a few digits, can anyone clean this up a little and give an explanation of where im going wrong???

thanks again
 
The file you posted does not show any logic trying to filter (smooth) an analog value. ??
 
Last edited:
I don't use that method, I like using math to filter an analog value. (see post #4)

But maybe a few more samples would help you with that method.
 

Similar Topics

Hello, I'm pretty new to RSLogix 500. I'm trying to smooth out the raw analog input. Current 4-20ma. I'm in an environment that I can not control...
Replies
5
Views
2,980
Hello, I am using a P1000 CPU (P1-540) with a P1-04DAL-2 and a P1-04ADL-2 I tried doing a data transfer now I am trying to scale them both...
Replies
0
Views
1,109
Mickey has posted a formula for doing this that a lot of people seem to make use of. Could somebody please give a simple "Ladder" diagram as to...
Replies
22
Views
12,246
Good Morning, So i have attached some really crude programming to try and work around my inability to smooth an anlog signal (actually several)...
Replies
22
Views
8,584
I am trying to make an input less jumpy. The monitored input has large spikes, and changes too fast. I am trying to smooth it out. I am using...
Replies
2
Views
2,138
Back
Top Bottom