PLC Filter



Filters help to clear noise from signals.  They are often used to clean up Analog Inputs.  To accomplish this, they take the input signal value and average it with past values.

Let’s look at the filter equation on the right:

  • Input is the incoming signal value
  • Output is the result of the filter
  • Weight is how much influence you want past values to hold.  Higher numbers place more importance on past values.  Weight must be greater than 1.

 

In this example we see that as Weight increases 3 things happen:
  • The signal smooths out
  • The Maximum and Minimum values decrease.
  • Changes in input take longer to detect.
With Filters, its a balancing act, where these considerations must be balanced to arrive at an ideal Weight for your situation.

 

One option that isn’t in the equation but matters a great deal: The frequency samples are taken.  This will effect how fast the Filter responds to changes in amplitude.  In this example we took 36 samples for the single wave.



For those of you who would like to see some numbers, here they are for the example above:

InputWeight = 2Weight = 4Weight = 8
141141141141
159150143.25141.28
196173150.69142.46
187180158.02144.4
225202.5169.14147.49
221211.75179.79151.53
244227.88191.81156.57
260243.94204.84162.6
246244.97214.87169.13
248246.48222.78175.84
227236.74226.27182.14
254245.37231.04188.26
248246.69234.95194.09
231238.84235.93199.32
229233.92235.43203.84
211222.46232.18207.38
169195.73223.07209.34
183189.37214.64210
165177.18205.28209.41
133155.09192.73207.33
105130.05177.06203.54
83106.52159.43198.03
6485.26140.88190.89
5670.63123.32182.44
7170.82110.19173.41
5462.4198.25164.01
5458.288.24154.54
4451.178.95145.09
5452.5572.35136
5453.2867.58127.45
6257.6465.1119.65
8370.3266.4113
8376.6668.97107.49
7877.3371.06102.94
124100.6678.4699.88
150125.3390.1898.67