kamenges
Member
Originally posted by Peter Nachtwey:
Why not use Kalman filter?
As the problem is presented, we don't have enough information to construct the system model to provide state updates for the predicted portion of the filter. Nor do we have the system input value. We have no way of knowing what the system state is supposed to be so we have nothing to compare the feedback value to. Also, most plcs don't have the tools or horsepower to reasonably implement a Kalman filter. It can be done but only for relatively "slow" systems and you would be doing everything at the lowest level.
Originally posted by NetNathan:
How sensitive is K1?
Not very. Steve's filter is basically a first order IIR filter. It has a tweek that causes it to operate on the filtered value from two scans back but outside of that it is a pretty standard form. Interestingly, it is effectively the same filter as that posted by Mickey, just in a different form. It doesn't sound like you have a specific target to shoot for; you just want the signal "cleaner". Since this is the case you can just start playing with values of K1 until you are happy with the result. If you get to 0.1 and you still need more filtering, just enter 0.05 and keep going down from there. Add digits to the right as you need to in order to get the level of filtering you need. But you will not see a visual difference between 0.1 and 0.09 so don't get too worried about absolute precision.
This is a first order filter. It will produce an output to a step response that looks like a capacitor charging. You can calculate a value of K1 for this filter if you know what you want your time constant to be with the equation:
1-e(-t/T)
where t is the equation update rate and T is the time constant you are shooting for.
Keith