Help with Filtering

Tim Ganz

Member
Join Date
Dec 2010
Location
Dallas, Texas
Posts
700
I have a question on filtering. I am working with a center winder that is ran by a compact logix brick processor and the program is filtering a laser sensr like this

Expression Local:3:I.Ch0Data/40+(Diameter_Input_Filtered*39/40

Destination Diameter_Input_Filtered

Can someone help me understand how this works? I am really struggling and math is not my strongest subject.
 
Write it out and look. You basically have:

Output = Input/40 + (Output * 39/40)

That is just a slightly strange form of an averager, without having to devote a bunch of memory locations.
It integrates every scan, but might never actually converge.

Just being lazy and dropping that into Excel, even after 250 scans with a raw input of 20, it only hits 19.9661.
 
There is nothing strange about the filter. It is a low pass IIR fillter.
Y(n)=A*Y(n-1)+B*X(n)
Where A=0..1 and B=1-A
If you want smooth the data even more then make A bigger. Right now A is 39/40. Try 0.99 and B=0.01
There is a lot information about IIR low pass filters on the web. One can calculate A and B in terms of a response time constant or cut off frequency.
 
Here's another .

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 have a question on filtering. I am working with a center winder that is ran by a compact logix brick processor and the program is filtering a laser sensr like this

Expression Local:3:I.Ch0Data/40+(Diameter_Input_Filtered*39/40

Destination Diameter_Input_Filtered

Can someone help me understand how this works? I am really struggling and math is not my strongest subject.

What type of laser sensor? Is it a "noisy" signal, or a "noisy" medium which the laser is sensing? There are some great laser sensors out there which I have personally used in high noise environments(material being sensed and high freq.) for dynamic height control. They filter the "environment's noise" for you!
 
I've attached a spreadsheet which graphically shows these 2 filters that they are mentioning.
I put in process change and noise amplitude.
I set the sample as twice the time so a small step will be seen for unfiltered.

Playing with the constants on the filters always helped me.
 
Thank you all for trying but it looks like i am in over my head with this one. This is some of my first plc work and i thought i would try to fix the problem but it will have to wait till the plc guru is back from vacation.
 
In your expression provided:

Local:3:I.Ch0Data/40+(Diameter_Input_Filtered*39/40

To make MORE filtering (and slower response) then Increase 39 and 40 by 1 at a time. The number at the '39' position will always be 1 less than the number at the '40' positions.

So for twice the filtering you could change it to:

Local:3:I.Ch0Data/80+(Diameter_Input_Filtered*79/80

And, as was being pointed out, more filtering will decrease the effect of noise and very short terms stuff but will make it slower to react to longer term changes.
 

Similar Topics

Application: Read in pulses from a volumetric flowmeter via a high-speed counter card to display flowrate i.e. cc/sec. Present Configuration...
Replies
8
Views
6,968
HI everyone, i am new to Siemens plc programming and i am in need of some help. yesterday we had an S7-1200 CPU 1214C fail to turn on an output to...
Replies
3
Views
21
I have an old Sentry Palletizer (S/O Number 3007 / Serial Number 1172) that has lost its program as the backup battery died years ago. I can...
Replies
0
Views
103
Hello, I need to write the following program in Ladder language, but I could not integrate the Fibonacci sequence into the ladder. Can you help...
Replies
22
Views
463
this a program to send data to barcode printer I want to integrate a new printer in a new machine and i wanted to adapt the old prgram on it but I...
Replies
4
Views
174
Back
Top Bottom