Aug 23, 2017

Lag filter for control systems, calculating the filtering constant k

This article clarifies each parameter that goes into filter design, and provides an analytical solution to calculate k value. Site of Jeff Steidl.

This is the same equation as that for an exponential smoothing filter which is a highly useful and low-computation smoothing technique similar to, but generally better than, an N-point average. A starting point for k is 0.5, which is roughly equal to a 4-point average.]

The formula for a first order lag filter is fairly simple:
new_filtered_value = k * raw_sensor_value + (1 - k) * old_filtered_value
The "magic" is determining an approprate value for k.

Calculate k

To calculate k, enter Tr, Ts and Frac from above into the following equation:
k = 1 - eln(1 - Frac) * Ts / Tr
For details, see http://my.execpc.com/~steidl/robotics/first_order_lag_filter.html


No comments: