Anda di halaman 1dari 32

Intuitive Introduction to the

Kalman Filter
Historical Development of
Optimal Filtering Theory
! Norbert Wiener filter: developed during 1940's, prompted by needs of US military.
Secret report considered to be very difficult theoretically and had a yellow cover.
Led to name among military as Yellow Peril.

! After war years: filter applied successfully in analog signal processing applications
but the mathematics surrounded the technique in mystery for many potential users.

! In later years as computers became available: original work of Wiener was thought
to be difficult to program; therefore relatively neglected.

! In 1960’s Rudi Kalman developed state-space approach to optimal filtering with his
co-worker Bucy. Digital form of filter involved a recursive algorithm; particularly
suitable for digital estimation work inspired by space industry.

! Kalman filter was widely adopted in the aerospace industry but found few
applications in general industries until more recently.

! Notable successors for industrial applications of Kalman filters include ship


positioning systems, fault monitoring and steel mill applications.
Expected Value
! The expected value is a weighted average, weighted by the
probability of each sample.

! Assume function f(x) is continuous,

E{ f (x )} = ∫ f (x )P(x) dx
! If f(x) is discrete,

E{ f (x )} = ∑ f (x )P(x )
x

! If P(x) is constant for all x, E{f(x)} is the average of f(x).


Gaussian probability density
The Gaussian probability density function of the random vector of
dimension n is given by the expression:
1  1 
0.08

exp  − ( x − x ) P −1 ( x − x ) 
T
ϕ (ξ ) = 0.07

(2π ) n det( P)  2  0.06

0.05

0.04

0.03

0.02

0.01

0
0 1 2 3 4 5 6 7 8 9 10

For scalar system:


1  1 
exp  − ( x − x ) σ −1 
2
ϕ (ξ ) =
(2π )σ  2 
where σ is the variance
Motivation
Preliminaries - State Equations

! Consider a system with TF:


y ( s) 2(s + 3)
= G(s) =
u ( s) (s + 1)(s + 2)

! This has one possible state vector representation

 x&1  − 1 0   x1  1
 x&  =    x  +  u
 2   0 − 2  2  1
 x1 
y = [4 − 2]  
 x2 
Advantages of State Equations

! Can be used for time-varying systems


x&(t ) = A(t)x(t ) + B(t)u(t )
y(t ) = C(t)x(t )

! Can be used for nonlinear systems


x& (t ) = f ( x(t ), u (t ), t )
y (t ) = g ( x(t ))

! Can be used for discrete systems


x k +1 = A x k + Bu k + Gω k
y k = C xk
State Equations

! Can be written in vector form,


x& = A x + Bu
 x1 
y = Cx where x =  
 x2 

u(t) + x& (t ) x(t)


BB CC y(t)
+

AA
Need for a Kalman Filter
in Control
! Conventional design uses plant output for control purposes.

ζ(s) plant
GG

+ u(s) + + x(s) y(s)


Controller
Controller BB CC
- + + Measured
AA output
State feedback control
! Has many advantages including, excellent robustness,
optimal solutions or easy pole placement.

ζ(t)
GG

+ + + x(t) y(t)
BB CC
- + +

AA
KK

! Problem:- Cannot measure all the states.


Need Black Box
State Estimator
Why is Kalman filtering
so popular?

!Kalman filter is the best linear estimator.


!Good results in practise due to optimality
and structure
!Convenient form for online real-time
processing
!Easy to formulate and implement given a
basic understanding
!Recursive form
What is a Kalman filter
and what can it Do?

! Optimal estimator
" provides an estimate of some desired quantity such that
a specified cost metric is minimised, e.g.,

x̂ opt = x̂ s .t . x − x̂ is minimised

! Recursive
" on-line data processing,
" low computational burden.
Preliminaries:
Typical Stochastic System
! Plant Equations
x& (t ) = A x(t ) + Bu (t ) + Gζ (t )
y (t ) = C x(t ) + υ (t ) Disturbance
Measurement Known
noise control
V(t)

ζ(t) GG
+ x&( t ) x(t) +
u(t) BB CC y(t)
+ + +

AA
Typical stochastic system
Responses
O/P with noise & disturbance
O/P without noise or O/P without noise
disturbance but including
disturbance

t
t t

v(t )
ζ(t) GG
+ x&( t ) x(t) +
u(t) BB CC y(t)
+ + +

AA
Kalman Filter (First step)
0 0

+ + x(t) + t
u(t) BB CC y(t)
+ +

AA

xˆ(t ) t
u(t) + yˆ (t )
BB CC
+

AA
Model Estimator Structure
disturbance present

ζ(t) GG t
+ + x(t) y(t) + xˆ (t ) yˆ (t )
u(t) BB CC CC
+ +

AA BB AA
t
Kalman Filter Structure
Plant
υ Filter
ζ GG
x x̂&( t ) xˆ (t ) yˆ (t )
+ + + +
u BB CC KK + CC
+ + + -
y +

AA AA

BB

(
x&ˆ (t ) = A xˆ (t ) + Bu (t ) + K y (t ) − yˆ (t ) ) How do we calculate the gain K?
yˆ = C xˆ What is the new controller?
Continuous-Time Kalman Filter
(Kalman-Bucy Filter)
u
BB

y
+ + x̂
K(t)
K(t) CC
- + +

AA

[
x̂& (t ) = A x̂(t ) + Bu (t ) + K(t) C x̂(t ) − y (t )]
x̂(0) = x
Ideas For Solution
Problem Statement

! Define the estimation error


~
x (t ) = x(t ) − xˆ(t )

! Define performance measure


~ {
J ( x (t )) = E x (t ) ~
~ T
x (t ) }
! Problem- Determine the gain K to minimise J
Noise and Disturbance
Characteristics
! Assume Gaussian White noise – zero mean
" Uncorrelated instant to instant
" Constant spectral density

! Define Covariance of Noise

{ }
E ζ (t )ζ (τ ) = Q(t ) . δ(t −τ )
T

E{υ (t )υ (τ )}= R(t ) . δ(t −τ )


T

Dirac delta is 1 iff t=τ and


Expectation ≈ Average 0 otherwise
How to Solve
the Problem
!Expand J in terms of system equations
!Calculate gradient (Weiner-Hopf Equation)
!Set gradient = 0 at optimum
!Calculate K from resulting equations
J

Zero Gradient
K
Solution for the Gain Matrix
! The Kalman Gain matrix is given by,
−1
K(t ) = P(t )C RT

! Where P(t) is the filtering error covariance given by the


solution of,
d
P(t ) = AP + PA − PC R CP + GQG
T T -1 T

dt
! Gain can be pre-computed unless system nonlinear or
system/noise varying in an unknown way ⇒ use discrete
equations and update knowledge of the system at each
instant.
Generic Nature of Filtering
Problems

Steel

Ship
Separation Principle of
Stochastic Control
KF in Control –
Separation Principle

! Plant x& (t ) = A x(t ) + Bu (t ) + Gζ (t )


y (t ) = C x(t ) + υ (t )

T
J = E{∫
T T
! Criterion x Q x + u Ru dt}
−T
Separation Principle
u x y
BB CC

AA
BB
Filter


KKc KKf
c f

Controller AA

u = Kc x̂ CC
Real Examples
! Determination of planet orbit parameters from limited
earth observations
! Tracking targets – eg aircraft, missiles using Radar & EO
systems
! Sensor data fusion

Why use the word “Filter”?


! The process of finding the “best estimate” from noisy data
amounts to “filtering out” the noise.
! However a Kalman Filter doesn’t just clean up the data
measurements, but also projects these measurements onto
the state estimate
Optimal in What Sense?

!If all noise is Gaussian, KF minimises the


mean square error of the estimated
parameters.

What if the noise is NOT Gaussian?

! Kalman filter is the best linear estimator.


Conclusions

! Simple structure easy to motivate


! Kalman gives optimal solution
! For very wide range of systems and problems
! Many applications-control only one.
Any Questions?

Anda mungkin juga menyukai