1.66k likes | 3.21k Views
An Introduction To The Kalman Filter. By, Santhosh Kumar. The Problem. Black Box. System Error Sources. System state cannot be measured directly Need to estimate “optimally” from measurements. System. External Controls. System State (desired but not known).
E N D
An Introduction To The Kalman Filter By, Santhosh Kumar
The Problem Black Box System Error Sources • System state cannot be measured directly • Need to estimate “optimally” from measurements System External Controls System State (desired but not known) Optimal Estimate of System State Observed Measurements Measuring Devices Estimator Measurement Error Sources
What is a Kalman Filter? The Kalman Filter is essentially a set of mathematical equations that implement a predictor – corrector type estimator that is OPTIMAL – when some presumed conditions are met. Optimal? • For linear system and white Gaussian errors, Kalman filter is “best” estimate based on all previous measurements • For non-linear system optimality is ‘qualified’
What’s so great about Kalman Filter? • noise smoothing (improve noisy measurements) • state estimation (for state feedback) • recursive (computes next estimate using only most recent measurement)
Discrete Kalman Filter Estimates the state x of a discrete-time controlled process that is governed by the linear stochastic difference equation with a measurement
Components of a Kalman Filter Matrix (nxn) that relates the state at the previous time step k-1 to k without controls or noise. Matrix (nxl) that describes how the control uchanges the state from k-1to k. Matrix (mxn) that describes how to map the state xkto a measurement zk. Random variables representing the process and measurement noise that are assumed to be independent and normally distributed with covariance Rand Qrespectively.
Estimates and Errors is the priori state estimate at step k. is the posteriori state estimate at step k given measurement • Errors: • Error covariance matrices: • KalmanFilter’s task is to find
Residual and Kalman Gain • Expected value • innovation is • The optimal Kalman gain Kk is
Correction (Measurement Update) Prediction (Time Update) (1) Compute the Kalman Gain (1) Project the state ahead (2) Update estimate with measurement zk (2) Project the error covariance ahead (3) Update Error Covariance Discrete Kalman Filter Algorithm
ExtendedKalman Filter • Suppose the state-estimation and measurement equations are non-linear: • process noise w is drawn from N(0,Q), with covariance matrix Q. • measurement noise v is drawn from N(0,R), with covariance matrix R.
Jacobian Matrix Recap • For a scalar function y=f(x), • For a vector function y=f(x),
Linearize the Non-Linear The equations that linearize a kalman estimate are Where, • and are actual state and measurement vectors. • and are approx. state and measurement vectors. • and are process and measurement noise. (Cont.)
Linearize the Non-Linear(Cont.) • Let A be the Jacobian of f with respect to x. • Let Wbe the Jacobian of h with respect to w. • Let H be the Jacobian of h with respect to x. • Let Vbe the Jacobian of h with respect to v.
Correction (Measurement Update) Prediction (Time Update) (1) Compute the Kalman Gain (1) Project the state ahead (2) Update estimate with measurement zk (2) Project the error covariance ahead (3) Update Error Covariance ExtendedKalman Filter Algorithm
Quick Example – Constant Model Black Box System Error Sources System External Controls System State Optimal Estimate of System State Observed Measurements Measuring Devices Estimator Measurement Error Sources
Quick Example – Constant Model Time Update Equation Measurement Update Equation