Theory
Kalman filter
A Kalman filter, also known as Linear Quadratic Estimator (LQE) uses a series of noisy measurements to produce estimates of unknown state variables. A Kalman filter provides an optimum solution to many tracking and data prediction tasks and finds excellent use in control, navigation and guidance.
The algorithm works in a two-step process. In the "predict" step, the Kalman filter looks one-step forward in time to predict the estimates of the current state vector and state covariance using an inner dynamic model. In the second step, known as "update", a "kalman gain matrix" is calculated using the state covariances and measurement covariance. This matrix is then used to update the state of the vehicle as shown below. One key advantage of Kalman filter is that it can run efficiently in real-time.
For a more comprehensive literature on the subject, the reader is recommended to consult [1]. Consult [2] for an excellent introductory article on KFs.
Predict
Let xkxk be the state vector and PkPk be the state covariance. The state equation is written as
where,
- \(A_k\) = State Transition Matrix
- \(B_k\) = Control-Input Model
- \(u_k\) = Input Vector
- \(w_k\) = Zero-mean Gaussian Process Noise
- \(Q_k\) = Covariance of the Process Noise
Update
Let \(\tilde{y_k}\) be the innovation factor vector, i.e. the difference between the predicted state output and the measured state output.
where,
- \(z_k\) = Measurement Vector
- \(C_k\) = Observation Matrix
- \(R_k\) = Measurement Covariance
- \(S_k\) = Innovation Covariance
- \(K_l\) = Kalman Gain Matrix
The variables \(z_k\), \(C_k\), \(R_k\) are derived from the incoming measurement.
Filter Model
Horizontal filter
where
- \(\delta_t\) = predict_period
Vertical Filter
where,
- \(\delta_t\) = predict period
- \(A\) = altitude
- \(B\) = buoyancy
Rotation Filter
where
- \(\delta_t\) = predict_period
Outlier Detection
where
- \(e_n\) = normalized error
- \(th_{outlier}\) = threshold outlier rejection parameter
References
- Rhudy, Matthew & Salguero, Roger & Holappa, Keaton. (2017). A Kalman Filtering Tutorial for Undergraduate Students. International Journal of Computer Science & Engineering Survey. 08. 01-18. 10.5121/ijcses.2017.8101.
- https://towardsdatascience.com/kalman-filter-an-algorithm-for-making-sense-from-the-insights-of-various-sensors-fused-together-ddf67597f35e