Kalman filter design, Kalman estimator
[kest,L,P] = kalman(sys,Qn,Rn,Nn)
[kest,L,P] = kalman(sys,Qn,Rn,Nn,sensors,known)
[kest,L,P,M,Z] = kalman(sys,Qn,Rn,...,type)
kalman designs a Kalman
filter or Kalman state estimator given a state-space model of the
plant and the process and measurement noise covariance data. The Kalman
estimator provides the optimal solution to the following continuous
or discrete estimation problems.
Given the continuous plant
with known inputs u, white process noise w, and white measurement noise v satisfying
construct a state estimate that
minimizes the steady-state error covariance
The optimal solution is the Kalman filter with equations
The filter gain L is determined by solving an algebraic Riccati equation to be
The estimator uses the known inputs u and the measurements y to generate the output and state estimates and . Note that estimates the true plant output
Given the discrete plant
and the noise covariance data
The estimator has the following state equation:
There are two variants of discrete-time Kalman estimators:
The current estimator generates output estimates and state estimates using all available measurements up to . This estimator has the output equation
When H = 0, and .
The delayed estimator generates output estimates and state estimates using measurements only up to yv[n–1]. This estimator is easier to implement inside control loops and has the output equation
[kest,L,P] = kalman(sys,Qn,Rn,Nn) creates
a state-space model
kest of the Kalman estimator
given the plant model
sys and the noise covariance
Nn (matrices Q, R, N described
be a state-space model with matrices .
The resulting estimator
kest has inputs and outputs (or their discrete-time
counterparts). You can omit the last input argument
Nn when N
both continuous and discrete problems and produces a continuous estimator
sys is continuous and a discrete estimator
otherwise. In continuous time,
kalman also returns
the Kalman gain
L and the steady-state error covariance
P solves the associated
[kest,L,P] = kalman(sys,Qn,Rn,Nn,sensors,known) handles
the more general situation when
Not all outputs of
sys are measured.
The disturbance inputs w are not
the last inputs of
The index vectors
which outputs y of
sys are measured
and which inputs u are known (deterministic). All
other inputs of
sys are assumed stochastic.
[kest,L,P,M,Z] = kalman(sys,Qn,Rn,...,type) specifies
the estimator type for discrete-time plants
type argument is either
'delayed'. For discrete-time plants,
the estimator and innovation gains L and M and
the steady-state error covariances
The plant and noise data must satisfy:
has no uncontrollable mode on the imaginary axis (or unit circle in discrete time) with the notation
 Franklin, G.F., J.D. Powell, and M.L. Workman, Digital Control of Dynamic Systems, Second Edition, Addison-Wesley, 1990.
 Lewis, F., Optimal Estimation, John Wiley & Sons, Inc, 1986.
 Deshpande, A.S., "Bridging a Gap in Applied Kalman Filtering: Estimating Outputs When Measurements Are Correlated with the Process Noise." IEEE Control Systems Magazine, Vol. 37, Number 3, 2017, pp. 87–93.