smoothing a noisy ananlog signal

power_guy

Member
Join Date
Jan 2004
Posts
3
The GE90/70 choice of programming functions is limited they don't even have a simple scale block. Amazing.

With the limited functionality how can you configure a PID loop to smooth an analog signal. I am not sure what to use for a setpoint with the PV being the noisy signal and the output of the PID being the smoothed signal.
 
That's an interesting approach to filtering.

In the 90-70, you can scale the analog input signal in the configuration of the module. Open up the hardware configuration and set some values for the 'engineering units' parameters. Each channel can be independently scaled.

Without scaling, the raw data will be in the range of -32000 to + 32000. If it's a 12-bit analog input module, the increments will be in steps of 8 counts, so you could divide the raw data by 8 with no loss of resolution in your signal.

If you choose to use the PID function for filtering, the easiest approach would be to copy the SP value to the Bias term, use values of zero for the P, I, and D terms, and set some value for the 'slew rate' term.
 
The best you can do is to ensure you have proper wiring so you
don't need to fix the signal in software. What is the range
of the input signal and what is the level of noise?
Is the noise something periodical (particular frequency) or random?
All PLC inputs have some sort of filter built in and many have some
adjustment (usually to counter AC line noise).
Scaling can be done using two basic math functions (multiply and add).
Multiply is used to do scaling and then (optionally) add some offset.
 
smoothing a signal is rather simple.
i did make some function blocks for this, i even did it with scaling.
i am using iec language so possible to read it even by you.
as plc now is very fast i still use old techniques for it.
like not using division but simple shift and subtract.
as filtering is not exact so use two samples shift once
use four samples and shift twice
use eight sampoles and shift three times.
as sampling is very fast i am using 1024 samples and 10 shift.
 
There are two kinds of filtering or smoothing that are often confused. One is filtering out 60 Hz or similar EMI/RFI noise, and often a capacitor or capacitor/resistor across the signal is sufficient for that.

The second kind of filtering is dampening out fluctuations in signal due to process variations - for example filtering out the pulsations in pressure in a pipe fed by a reciprocationg compressor. For this I use "digital filtering" which is essentially averaging the signal change over several samples. The formula is: Yn = Yn-1 + (1/k x (Xn - Yn-1))

Here is a file for this in Koyo format - you can readily convert it to any ladder logic. Note that the filtering will slow response somewhat, and may cause a slight offset in the value. It includes a PDF with the logic.
 

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,984
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
Hey all. Here is a little piece of code that I use to get the RPM or Units Per Minute from some of our production lines. It seems good and...
Replies
8
Views
2,345
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,267
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,595
Back
Top Bottom