Upload
tonuonu
View
225
Download
0
Embed Size (px)
Citation preview
8/8/2019 L13 KF Intuitive Intro
1/32
Intuitive Introduction to theIntuitive Introduction to theKalman FilterKalman Filter
8/8/2019 L13 KF Intuitive Intro
2/32
Historical Development ofHistorical Development of
Optimal Filtering TheoryOptimal 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 applicationsbut the mathematics surrounded the technique in mystery for many potential users.
! In later years as computers became available: original work of Wiener was thoughtto be difficult to program; therefore relatively neglected.
! In 1960s Rudi Kalman developed state-space approach to optimal filtering with hisco-worker Bucy. Digital form of filter involved a recursive algorithm; particularlysuitable for digital estimation work inspired by space industry.
! Kalman filter was widely adopted in the aerospace industry but found fewapplications in general industries until more recently.
! Notable successors for industrial applications of Kalman filters include shippositioning systems, fault monitoring and steel mill applications.
8/8/2019 L13 KF Intuitive Intro
3/32
Expected ValueExpected Value! The expected value is a weighted average, weighted by the
probability of each sample.
! Assume functionf(x) is continuous,
! Iff(x) is discrete,
! IfP(x) is constant for allx, E{f(x)} is the average off(x).
( ){ } ( ) ( ) dxxPxfxfE =
( ){ } ( ) ( )=
xxPxfxfE
8/8/2019 L13 KF Intuitive Intro
4/32
Gaussian probability densityGaussian probability densityThe Gaussian probability density function of the random vector of
dimension n is given by the expression:
( ) ( )11 1
( ) exp2(2 ) det( )
T
nx x P x x
P
=
0 1 2 3 4 5 6 7 8 9 100
0.01
0.02
0.03
0.04
0.05
0.06
0.07
0.08
For scalar system:
( )2 11 1( ) exp
2(2 )x x
=
where is the variance
8/8/2019 L13 KF Intuitive Intro
5/32
MotivationMotivation
8/8/2019 L13 KF Intuitive Intro
6/32
PreliminariesPreliminaries -- State EquationsState Equations
! Consider a system with TF:
! This has one possible state vector representation
)2)(1(
)3(2)(
)(
)(
++
+==
ss
ssG
su
sy
[ ]
=
+
=
2
1
2
1
2
1
24
1
1
20
01
x
xy
ux
x
x
x
&
&
8/8/2019 L13 KF Intuitive Intro
7/32
Advantages of State EquationsAdvantages of State Equations
! Can be used for time-varying systems
! Can be used for nonlinear systems
! Can be used for discrete systems
)(C(t))(
)(B(t))(A(t))(
txty
tutxtx
=
+=&
( )
))(()(
),(),()(
txgty
ttutxftx
=
=&
1 A B
C
k k k k
kk
x x u G
y x
+
= + +
=
8/8/2019 L13 KF Intuitive Intro
8/32
State EquationsState Equations
! Can be written in vector form,
==
+=
2
1whereC
BA
x
xxxy
uxx&
AA
CC+
+
u(t)y(t)
x(t)
BB
)(tx&
8/8/2019 L13 KF Intuitive Intro
9/32
Need for a Kalman FilterNeed for a Kalman Filter
in Controlin Control
! Conventional design uses plant output for control purposes.
+
+
u(s) y(s)x(s)
(s)
+
+
+
-Measured
output
plant
BB
AA
CC
GG
ControllerController
8/8/2019 L13 KF Intuitive Intro
10/32
State feedback controlState feedback control
! Has many advantages including, excellent robustness,optimal solutions or easy pole placement.
! Problem:- Cannot measure all the states.
BB
AA
CC++
y(t)x(t)
GG(t)
++
+-
KK
8/8/2019 L13 KF Intuitive Intro
11/32
Need Black BoxNeed Black Box
State EstimatorState Estimator
8/8/2019 L13 KF Intuitive Intro
12/32
!Kalman filter is the best linear estimator.
!Good results in practise due to optimalityand structure
!Convenient form foronline real-timeprocessing
!Easy to formulate and implement given abasic understanding
!Recursive form
Why is Kalman filteringWhy is Kalman filtering
so popular?so popular?
8/8/2019 L13 KF Intuitive Intro
13/32
What is a Kalman filterWhat is a Kalman filter
and what can it Do?and what can it Do?
! Optimal estimator
"provides an estimate of some desired quantity such that
a specified cost metric is minimised, e.g.,
!Recursive" on-line data processing,
" low computational burden.
imisedminisxx.t.sxxopt =
8/8/2019 L13 KF Intuitive Intro
14/32
Preliminaries:Preliminaries:
Typical Stochastic SystemTypical Stochastic System
! Plant Equations
( ) A ( ) B ( ) G ( )
( ) C ( ) ( )
x t x t u t t
y t x t t
= + +
= +
&
Measurement
noise Knowncontrol
Disturbance
x(t)
(t)
+
+u(t)
+
+
+y(t)BB
AA
CC
GG
)t(x&
V(t)
8/8/2019 L13 KF Intuitive Intro
15/32
Typical stochastic systemTypical stochastic system
ResponsesResponses
tt
O/P without noise or
disturbance
t
O/P without noise
but including
disturbance
O/P with noise & disturbance
x(t)
(t)
+
+u(t)
+
+
+y(t)BB
AA
CC
GG
)t(x&
( )v t
8/8/2019 L13 KF Intuitive Intro
16/32
Kalman FilterKalman Filter (First step)(First step)
BB
A
A
CC y(t)x(t)
0
+
+
u(t)+ +
+
0
t
t
AA
CC
+
+
)( tx)( tyu(t)
BB
8/8/2019 L13 KF Intuitive Intro
17/32
Model Estimator StructureModel Estimator Structure
disturbance presentdisturbance present
BB
AA
CC
x(t)+
+u(t)
GG(t)
+
AA
CC
+
+
)( tx )( ty
BB
y(t)
t
t
8/8/2019 L13 KF Intuitive Intro
18/32
Kalman Filter StructureKalman Filter Structure
( )xy
tytytutxtx
C
)()(K)(B)(A)(
=
++=&
BB
AA
CCx
GG
u +
AA
CC
)( tx )( ty
BB
y
KK
+
How do we calculate the gain K?
What is the new controller?
)t(x&
Plant
Filter
+
+
++ -
++
+
8/8/2019 L13 KF Intuitive Intro
19/32
ContinuousContinuous--Time Kalman FilterTime Kalman Filter
(Kalman(Kalman--Bucy Filter)Bucy Filter)
( ) ( ) ( ) ( ) ( )[ ]( ) xx
tytxtutxtx
=
++=
0
CK(t)BA&
K(t)K(t)
AA
u
B
B
yx
CC+ +
++-
8/8/2019 L13 KF Intuitive Intro
20/32
8/8/2019 L13 KF Intuitive Intro
21/32
Problem StatementProblem Statement
! Define the estimation error
!Define performance measure
! Problem- Determine the gainKto minimiseJ
)()()(~ txtxtx =
)(~)(~E))(~(JT
txtxtx =
8/8/2019 L13 KF Intuitive Intro
22/32
Noise and DisturbanceNoise and Disturbance
CharacteristicsCharacteristics! Assume Gaussian White noise zero mean
"Uncorrelated instant to instant
"Constant spectral density
! Define Covariance of Noise
{ }
{ } )(.)(R)()(E
)(.)(Q)()(E
T
T
=
=
ttt
ttt
Expectation Average
Dirac delta is 1 iff t=and
0 otherwise
8/8/2019 L13 KF Intuitive Intro
23/32
How to SolveHow to Solve
the Problemthe Problem
!ExpandJin terms of system equations
!Calculate gradient (Weiner-Hopf Equation)
!Set gradient = 0 at optimum
!CalculateKfrom resulting equations
J
K
Zero Gradient
8/8/2019 L13 KF Intuitive Intro
24/32
Solution for the Gain MatrixSolution for the Gain Matrix
! The Kalman Gain matrix is given by,
! Where P(t) is the filtering error covariance given by thesolution of,
! Gain can be pre-computed unless system nonlinear or
system/noise varying in an unknown way use discreteequations and update knowledge of the system at eachinstant.
1T
R)CP()K(
=
tt
T T -1 TP( ) AP PA PC R CP GQGd tdt
= + +
8/8/2019 L13 KF Intuitive Intro
25/32
Generic Nature of FilteringGeneric Nature of Filtering
ProblemsProblems
Steel
Ship
8/8/2019 L13 KF Intuitive Intro
26/32
Separation Principle ofSeparation Principle ofStochastic ControlStochastic Control
8/8/2019 L13 KF Intuitive Intro
27/32
KF in ControlKF in Control
Separation PrincipleSeparation Principle
!Plant
! Criterion
( ) A ( ) B ( ) G ( )( ) C ( ) ( )
x t x t u t t y t x t t
= + +
= +
&
}{J +=T
T
TTdtuRuxQxE
8/8/2019 L13 KF Intuitive Intro
28/32
Separation PrincipleSeparation Principle
BB CC
AA
KfKf
AA
CC
BB
KcKc
u x y
Filter
x
Controller
xKu c=
8/8/2019 L13 KF Intuitive Intro
29/32
Real ExamplesReal Examples
! Determination of planet orbit parameters from limitedearth observations
! Tracking targets eg aircraft, missiles using Radar & EOsystems
! Sensor data fusion
! The process of finding the best estimate from noisy data
amounts to filtering out the noise.! However a Kalman Filter doesnt just clean up the data
measurements, but also projects these measurements ontothe state estimate
Why use the word Filter?Why use the word Filter?
8/8/2019 L13 KF Intuitive Intro
30/32
!If all noise is Gaussian, KF minimises the
mean square error of the estimatedparameters.
!Kalman filter is the best linear estimator.
Optimal in What Sense?Optimal in What Sense?
What if the noise is NOT Gaussian?What if the noise is NOT Gaussian?
8/8/2019 L13 KF Intuitive Intro
31/32
ConclusionsConclusions
!Simple structure easy to motivate
!Kalman gives optimal solution
!For very wide range of systems and problems!Many applications-control only one.
8/8/2019 L13 KF Intuitive Intro
32/32
Any Questions?Any Questions?