You are on page 1of 11

ELE8306 (LECTURE 6)

OPTIMAL Estimator
Chapter 4
Lecture 6

Dr. N. Magaji
Introduction of Kalman Filter
4.4 Introduction
The Kalman Filter algorithm was developed by Rudolf E. Kalman around
ELE8306 (LECTURE 6)
1960 [8].There is a continuous-time version of the Kalman Filter and
several discrete-time versions. (The discrete-time versions are
immediately ready for implementation in a computer program.).
Kalman Filters have the same structure as the observers.
4.5 Classes of algorithm
 Discrete-time Kalman Filter (DKF)
 Continuous-Discrete Kalman Filter (CDKF)
ELE8306 (LECTURE 6)
 Extended Kalman Filter (EKF)
 Continuous-time Kalman Filter (CKF)
Here the Discrete-time Kalman Filter (DKF) , Extended Kalman Filter
(EKF) will be introduce but Continuous-time Kalman Filter (CKF) will be
treated.

In summary Kalman Filter is all about:


• Recursive data processing algorithm
• Generates optimal estimate of desired quantities given the set of
measurements
• 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’
• Recursive?
– Doesn’t need to store all previous measurements and
reprocess all data each time step
Discrete Kalman Filter
n
• Estimate the state x   of a linear
ELE8306 (LECTURE 6)
stochastic difference equation
x k  Axk 1  Buk  wk 1
– process noise w is drawn from N(0,Q), with
covariance matrix Q.
• with a measurement m
z
z k  Hx k  vk
– measurement noise v is drawn from N(0,R), with
covariance matrix R.
• A, Q are nxn. B is nxl. R is mxm. H is mxn.
Discrete Kalman Filter(cont.)
• Estimator:(Predictor-Corrector form)
ELE8306 (LECTURE 6)
Error covariance matrices
Pk  E[ek ek T ] and Pk  E[e k eTk ]

Predictor :x k  Axˆ k 1  Bu k
ˆ
Corrector : xˆ k  xˆ k  K k (z k  Hxˆ k )
•Update error covariance matrixP
Pk  APk 1AT  Q
•The optimal Kalman gain K k is
K k  Pk HT (HPk HT  R)1
Pk HT

HPk HT  R
4.6 Extended Kalman Filter
ELE8306 (LECTURE 6)

• Suppose the state-evolution and measurement equations


are non-linear:
x( k )  f ( x( k  1), u( k  1))  w ( k  1)
z( k )  h ( x( k ))  v ( k )
f h
A= , C=
x ( k ) x ( k )
– 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.
Justification: the nonlinearities are treated as process noise.
4.7 Continuous-time Kalman Filter Design for (LTI) Systems
Steady State Optimal State Estimation (LQE)
ELE8306 (LECTURE 6)
 optimal linear quadratic observers.
 The optimal LQ observer problem is dual to the LQ state feedback
problem. However, optimal LQ observers have a stochastic interpretation,
in that they are optimal in estimating the state in the presence of Gaussian
noises corrupting the output measurements and the state.

Suppose we introduce state and output noise processes w and v so that



System Dynamics : x  Ax  Bu  w w : Process noise vector
Measured Output: y  Cx  v v: Sensor noise vector

Assumptions:

The signals w and v are zero-mean stochastic Gaussian processes uncorrelated in


time and with each other. They have the following covariances:

(i ) E  ww  = W and E  vv   V
T T

(ii) W and V are statistically independent (uncorrelated in time and with each
other)
Example 4.4
Consider a given plant characterized by the following state space model
 0 1 0  1 0 
x    x  1  u   0 0  w
 0.89 1.8     
ELE8306 (LECTURE 6)
z  [1, 0]x  v
With
E (v(k ))  0; var(v(k )vT ( k ))  R  V  1
1 0 
E ( w(k ))  0; var( w(k ) w (k ))  Q  
T

0 1 
Simulate the optimal time-varying DT Kalman Filter for the system
 0 1 0 1 0 
x    x   u    w
 0.89 1.8 1  0 0 ,
z  [1, 0]x  v
K=L= PeCV -1
PeA T +APe +BBT -PeC T V -1CPe =0 .
Example 4.5
Design a kalman filter or Kalman-Busy Filter
 x1   0 1   x1   0  0 
 x    0 0   x   1  u  1  w
 2   2    
ELE8306 (LECTURE 6)
y   1,0  x  v
Now we design the gain L of our Kal man filter
 
x   A  LC  x  Bu  y
Solution
rank[A, B ]  2  ( A, B )is controllable
C 
rank    2  (A,C) is observable
CA
V -1 = 1

PeA T +APe +BBT -PeC T V -1CPe =0
 P11 P12   0 0  0 1   P11 P12  0 
P     0 1  PeCT 1/ CPe=0
 12 P22  1 
0  0 0   P12 
P22  1 
1  P11 P12  1   P P12 
PeCT 1/ CPe= 1 0    11
  P12 P22   0   P12 P22 
Example 2.1 (cont.)
ELE8306 (LECTURE 6)
Example 4.6
Consider the system below design a Kalman filter gain and
covariance matrix P
ELE8306 (LECTURE 6)
Using lqe or dlqe in matlab
 x1   0.0213 0 0   x1  8.9362   0.1 0 0   w1 
 x    0.0006 0.005 0   x2    0  u   0 0.1 0   w2 
 2 
 x 3   0 0.00038 0.0023  x3   0   0 0 0.00132  w3 
1 0 0   x1 
y  0 1 0   x2 
0 0 1   x3 

 0.01 0 0  0.1 0 0

Q 0 0.01 0  ; R   0
 0.1 0 
 0 0 7.46  0 0 0.1
From general linear Kalman filter equation
x  Ax  Bu  Gw            State equation
y  Cx  Du  v               Measurements
[L,P,E] = lqe(A,G,C,Q,R,N) returns the observer gain matrix L
such that the stationary Kalman filter

You might also like