Documentation |
Design discrete Kalman estimator for continuous plant
kalmd
[kest,L,P,M,Z] = kalmd(sys,Qn,Rn,Ts)
kalmd designs a discrete-time Kalman estimator that has response characteristics similar to a continuous-time estimator designed with kalman. This command is useful to derive a discrete estimator for digital implementation after a satisfactory continuous estimator has been designed.
[kest,L,P,M,Z] = kalmd(sys,Qn,Rn,Ts) produces a discrete Kalman estimator kest with sample time Ts for the continuous-time plant
$$\begin{array}{cc}\dot{x}=Ax+Bu+gw& (\text{stateequation)}\\ {y}_{v}=Cx+Du+v& \text{(measurementequation)}\end{array}$$
with process noise w and measurement noise v satisfying
$$\begin{array}{cccc}E(w)=E(v)=0,& E(w{w}^{T})={Q}_{n},& E(v{v}^{T})={R}_{n},& E(w{v}^{T})=0\end{array}$$
The estimator kest is derived as follows. The continuous plant sys is first discretized using zero-order hold with sample time Ts (see c2d entry), and the continuous noise covariance matrices Q_{n} and R_{n} are replaced by their discrete equivalents
$$\begin{array}{l}{Q}_{d}={\displaystyle {\int}_{0}^{{T}_{s}}{e}^{A\tau}GQ{G}^{T}{e}^{{A}^{T}\tau}d\tau}\\ {R}_{d}=R/{T}_{s}\end{array}$$
The integral is computed using the matrix exponential formulas in [2]. A discrete-time estimator is then designed for the discretized plant and noise. See kalman for details on discrete-time Kalman estimation.
kalmd also returns the estimator gains L and M, and the discrete error covariance matrices P and Z (see kalman for details).