an introduction to the kalman filter by, santhosh kumar

20
An Introduction To The Kalman Filter By, Santhosh Kumar

Upload: oswin-flynn

Post on 21-Jan-2016

246 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: An Introduction To The Kalman Filter By, Santhosh Kumar

An Introduction To The Kalman Filter

By,Santhosh

Kumar

Page 2: An Introduction To The Kalman Filter By, Santhosh Kumar

The Problem

System state cannot be measured directlyNeed to estimate “optimally” from measurements

Measuring Devices Estimato

r

MeasurementError Sources

System State (desired but not known)

External Controls

Observed Measurement

s

Optimal Estimate of

System State

SystemError Sources

System

Black Box

Page 3: An Introduction To The Kalman Filter By, Santhosh Kumar

What is a Kalman Filter?

The Kalman Filter is essentially a set of mathematical equations that implement a predictor – corrector type estimator that is OPTIMAL – when some presumed conditions are met.

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’

Page 4: An Introduction To The Kalman Filter By, Santhosh Kumar

What’s so great about Kalman Filter?

noise smoothing (improve noisy measurements)

state estimation (for state feedback)recursive (computes next estimate using

only most recent measurement)

Page 5: An Introduction To The Kalman Filter By, Santhosh Kumar

Discrete Kalman Filter

11 kkkk wBuAxx

kkk vHxz

Estimates the state x of a discrete-time controlled process that is governed by the linear stochastic difference equation

with a measurement

Page 6: An Introduction To The Kalman Filter By, Santhosh Kumar

Components of a Kalman Filter

1kw

Matrix (nxn) that relates the state at the previous time step k-1 to k without controls or noise.

A

Matrix (nxl) that describes how the control u changes the state from k-1 to k.B

Matrix (mxn) that describes how to map the state xk to a measurement zk.

H

1kv

Random variables representing the process and measurement noise that are assumed to be independent and normally distributed with covariance R and Q respectively.

Page 7: An Introduction To The Kalman Filter By, Santhosh Kumar

Estimates and Errors

is the priori state estimate at step k.

is the posteriori state estimate at step k given measurement

Errors:

Error covariance matrices:

Kalman Filter’s task is to find

ˆ x k n

ˆ x k n

ek x k ˆ x k

ek x k ˆ x k

Pk E[ek

ek T

]

Pk E[ek ekT ]

kx̂

kz

Page 8: An Introduction To The Kalman Filter By, Santhosh Kumar

Residual and Kalman Gain

Expected value

◦ innovation is

The optimal Kalman gain Kk is

kx̂

ˆ x k ˆ x k Kk(zk Hˆ x k

)

zk Hˆ x k

K k Pk HT (HPk

HT R) 1

Pk

HT

HPk HT R

Page 9: An Introduction To The Kalman Filter By, Santhosh Kumar

Discrete Kalman Filter Algorithm

Prediction (Time Update)

(1) Project the state ahead

(2) Project the error covariance ahead

Correction (Measurement Update)

(1) Compute the Kalman Gain

(2) Update estimate with measurement zk

(3) Update Error Covariance

kkk BuA

1ˆˆ xx

QAAPP Tkk

1

1)( RHHPHPK Tk

Tkk

)ˆ(ˆˆ kkkkk HzK xxx

kkk PHKP )1(

Page 10: An Introduction To The Kalman Filter By, Santhosh Kumar

Extended Kalman FilterSuppose the state-estimation and

measurement equations are non-linear:

◦ 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.

),,( 11 kkkk f wuxx

),( kkk h vxz

Page 11: An Introduction To The Kalman Filter By, Santhosh Kumar

Jacobian Matrix Recap

For a scalar function y=f(x),

For a vector function y=f(x),

y f (x)x

y Jx y1

yn

f1

x1

(x) f1

xn

(x)

fn

x1

(x) fn

xn

(x)

x1

xn

Page 12: An Introduction To The Kalman Filter By, Santhosh Kumar

Linearize the Non-LinearThe equations that linearize a kalman estimate are

Where, and are actual state and measurement

vectors. and are approx. state and measurement

vectors. and are process and measurement noise.

(Cont.)

11

~

1

~

)( kkkkk WwxxAxx

kkkkk VvxxHzz )(~~

kx kz

kx~

kz~

kw kv

Page 13: An Introduction To The Kalman Filter By, Santhosh Kumar

Linearize the Non-Linear(Cont.)

Let A be the Jacobian of f with respect to x.

Let W be the Jacobian of h with respect to w.

Let H be the Jacobian of h with respect to x.

Let V be the Jacobian of h with respect to v.

)0,,( 1

~

kk

j

iij x

fuxA

)0,(~

k

j

iij x

hxH

)0,(~

k

j

iij x

hV x

)0,,( 1

~

kk

j

iij w

fW ux

Page 14: An Introduction To The Kalman Filter By, Santhosh Kumar

Extended Kalman Filter Algorithm

Prediction (Time Update)

(1) Project the state ahead

(2) Project the error covariance ahead

Correction (Measurement Update)

(1) Compute the Kalman Gain

(2) Update estimate with measurement zk

(3) Update Error Covariance

Tkkk

Tkkkk WQWAPAP 11

1)( Tkkk

Tkkk

Tkkk VRVHPHHPK

))0,ˆ((ˆˆ kkkkk hzK xxx

kkk PHKP )1(

)0,,( 1

^^

kkk fx ux

Page 15: An Introduction To The Kalman Filter By, Santhosh Kumar

Quick Example – Constant Model

Measuring Devices Estimato

r

MeasurementError Sources

System State

External Controls

Observed Measurement

s

Optimal Estimate of

System State

SystemError Sources

System

Black Box

Page 16: An Introduction To The Kalman Filter By, Santhosh Kumar

Quick Example – Constant Model

Time Update Equation

Measurement Update Equation

^

1

^

kk xx

QPP kk

1

1)( RPPK kkk

)(~^~^^

kkkkk xzKxx

kkk PKP )1(

Page 17: An Introduction To The Kalman Filter By, Santhosh Kumar

Quick Example – Constant Model

Page 18: An Introduction To The Kalman Filter By, Santhosh Kumar

Quick Example – Constant Model

Page 19: An Introduction To The Kalman Filter By, Santhosh Kumar

Quick Example – Constant Model

Page 20: An Introduction To The Kalman Filter By, Santhosh Kumar

QUERIES?????