Scroll to navigation

FILTER_KALMAN(9) HAL Component FILTER_KALMAN(9)

NAME

filter_kalman - Unidimensional Kalman filter, also known as linear quadratic estimation (LQE)

SYNOPSIS

loadrt filter_kalman [count=N|names=name1[,name2...]]

DESCRIPTION

Useful for reducing input signal noise (e.g. from the voltage or temperature sensor).

More information can be found at https://en.wikipedia.org/wiki/Kalman_filter.

Adjusting Qr and Qk covariances:

Default values of Rk and Qk are given for informational purpose only. The nature of the filter requires the parameters to be individually computed.

One of the possible and quite practical method (probably far from being the best) of estimating the Rk covariance is to collect the raw data from the sensor by either asserting the debug pin or using halscope and then compute the covariance using cov() function from Octave package. Ready to use script can be found at https://github.com/dwrobel/TrivialKalmanFilter/blob/master/examples/DS18B20Test/covariance.m.

Adjusting Qk covariance mostly depends on the required response time of the filter. There is a relationship between Qk and response time of the filter that the lower the Qk covariance is the slower the response of the filter is.

Common practice is also to conservatively set Rk and Qk slightly larger then computed ones to get robustness.

FUNCTIONS

Update xk-out based on zk input.

PINS

When asserted, prints out measured and estimated values.
When asserted, copies measured value into estimated value.
When asserted, resets filter to its initial state and returns 0 as an estimated value (reset pin has higher priority than passthrough pin).
Measured value.
Estimated value.

PARAMETERS

Estimation of the noise covariances (process).
Estimation of the noise covariances (observation).

AUTHOR

Dmian Wrobel <dwrobel@ertelnet.rybnik.pl>

LICENSE

GPL-2.0-or-later

2024-03-13 LinuxCNC Documentation