1

ME 233 Advanced Control II

Lecture 7
Discrete Time Kalman Filter(ME233 Class Notes pp.KF1-KF6)

2

Course Outline• Unit 0: Probability• Unit 1: State-space control, estimation• Unit 2: Input/output control• Unit 3: Adaptive control

Finished

3

Wiener Filtering
Norbert Wiener:• Well-known as the founder of cybernetics, a field hedeveloped in the 1970s that emphasized the modeling ofhumans as communication and control systems.
• In 1942 he did significant work in the use of time series
for military applications; an example of which would be
the prediction of the location of enemy planes at the nexttime step.
• His work in filtering, prediction and smoothing cameabout in 1949. Wiener filtering is solved for Gaussian
time series and under certain assumptions, stationary
time series.

Rudy Kalman:• First major contribution was the introduction of the selftuning regulator in adaptive control.
• Between 1959 and 1964 he wrote a series of seminal
papers:– First, the new approach to the filtering problem,
known today as Kalman Filtering– In the meantime, the all pervasive concept ofcontrollability and its dual, the concept ofobservability, were formulated.

• By combining the filtering and the control ideas, the firstsystematic theory for control synthesis, known today as
the Linear-Quadratic-Gaussian or LQG theory, resulted.

45Deterministic - state feedback
State variable feedback:With fictitious reference input r(k)6Deterministic - state feedback• ME 232 Approach: State Variable Feedback

RU-B-1(zI-A)XCK• What happens if the state is not directly
measurable – only the output y(k) ?

Y7Deterministic– state estimation• ME 232 Approach: State observer

X-1B(zI-A )UB--1(zI-A )

C

 +L+

Y-XCY

8

Deterministic– state observer feedbackB
RX-1(zI-A )U

B

K+--1(zI-A )C +L-Y-X

CY

9Stochastic State Estimation
System is now contaminated by noise

W
Bw
UV+B

(zI-A ) -1

Two random disturbances

X+CY

10

Stochastic State Estimation
System is now contaminated by noise

W
Bw
UV+B

(zI-A ) -1

X+C

• Input noise w(k) - contaminates the state x(k) is now a random sequenceY11

Stochastic State Estimation
System is now contaminated by noiseWBw
UV+
B(zI-A ) -1

X+CY

• Measurement noise v(k) - contaminates theoutput y(k)12Stochastic state model

Where:•known control input•

input noise•

measurement noise

13

Initial Conditions•

is Gaussian with known
marginal mean and covariance:

14Noises
and
•

are:

Gaussian zero mean uncorrelated noises
Not necessarily stationary• independent from each other and fromWBw
UV+
B(zI-A )-1

X+CY

15Noises

16

Output Measurements
is the measured output, which isconsidered as an outcome at instant k of therandom sequence• set of available measurements at the instant j17

Notation so far …
• Initial state marginal mean:• Initial state marginal covariance:• Input noise covariance :• Measurement noise covariance:• Set of j+1 output measurements:

18

Kalman Filter Objective
Obtain the best state estimate given availablemeasurements

WBwUV+
B(zI-A )-1

X+C

Conditional state estimation problemY

19

Conditional state estimation
New notation:

Conditional state estimate
given the set of available measurements:

20

Conditional state estimation

When:
•

this is a filtering problem•

this is a prediction problem•

this a smoothing problem

our focus

A-priori state estimate(one step prediction)
New notation:

Conditional state estimate
given the set of available measurements:

before y(k)A-priori state estimation error:

21

22

A-posteriori state estimate (filtering)
New notation:

Conditional state estimate
given the set of available measurements:
after y(k)A-posteriori state estimation error:

23State Estimate Covariances
A-priori estimation error covariance:

A-posteriori estimation error covariance:

24

Summary of estimate notation•• A-priori state estimate :• A-posteriori state estimate :• A-priori output estimate :25

Summary of estimate error notation• A-priori state estimation error and covariance :• A-posteriori state estimation error and covariance:• A-priori output estimation error :26State Estimate Covariances
Notice that:

A-posteriori

A-priori

27

Initial Conditions for a-priori estimate
Notice that:a-priori state estimate—before measuring y(0)initial state marginal estimation

28

Initial Conditions for a-priori estimate
Notice that:

initial statemarginal covariance29

Kalman Filter Solution
Given:• I.C.:• Noise covariance intensities:

WBw
UV+B

(zI-A )

-1

X+CY

30

Kalman Filter Solution
Want to recursively find:• State estimates:• Error covariances:a-prioriWa-posteriori

Bw
U

V+B

(zI-A )

-1

X+CY

31

Kalman Filter Solution
Remember:• Conditional state estimates:

a-priori (before y(k) )a-posteriori (after y(k) )32

Kalman Filter Solution
Remember:• noises are uncorrelated Gaussian, zero-mean
RVSs that are uncorrelated with each otherand the initial state:

33

We will use property 3 of least squares estimation• Conditional estimator of X given Y and Z

Previous lecture
notation:

Notation for
Kalman filter:34

We will use property 3 of least squares estimation• Conditional estimator of x(k) given Yk-1 andy(k)Previous lecture
notation:

Notation for
Kalman filter:35

We will use property 3 of least squares estimation• Conditional estimation error of X
given Y and ZPrevious lecture
notation:

Notation for
Kalman filter:36

We will use property 3 of least squares estimation• Conditional estimation error of X
given Y and Z

Previous lecture
notation:

Notation for
Kalman filter:37

Kalman Filter Solution:

k=0• Before measurement y(0):(given)(given)38

Kalman Filter Solution:

k=0• A-priori output estimate:A-priori output estimation error (KF residual)

39

Kalman Filter Solution:

k=0

Review of the results so far:a-prioria-posteriori

40

Kalman Filter Solution:

k=0• After measurement y(0):Calculate a-posteriori state estimate using theconditional estimation formula for Gaussians:(We exploited that)

41

Calculate:42

Calculate:43

Kalman Filter Solution:• a-posteriori state estimate:

k=0

44

Kalman Filter Solution:

k=0

Review of the results so far:a-priori

45

Kalman Filter Solution:

k=0• A-posteriori state estimation error:• A-posteriori state estimation error covariance:

46

Kalman Filter Solution:

k=0• a-posteriori state estimation covariance:• Use least squares result:

47

Kalman Filter Solution:

k=0• a-posteriori state estimation covariance:• Use least squares result:

48

Kalman Filter Solution:
Review of the results so far:

k=0

49

Kalman Filter Solution:

k=1

Before measurement y(1):• Determine a-priori state estimate• Determine a-priori state estimation errorcovariance50

Kalman Filter Solution:

k=1

A-priori state estimate:• Use state equation and take conditional
expectations:

Independent
from y(0)51Kalman Filter Solution:
A-priori state estimation error:• Use state equation:

k=1

52

Kalman Filter Solution:

k=1

A-priori state estimation error covariance:• Use:

53Kalman Filter Solution:

k=1

A-priori state estimation error covariance:

54

Kalman Filter Solution:• Before measurement y(1):

k=1

55

Kalman Filter Solution:
Before measurement y(1):A-priori output estimation error

k=1

56

Kalman Filter Solution:

k=1

Review of the results so far:a-prioria-posteriori

57

Kalman Filter Solution:

k=1• After measurement y(1):Calculate a-posteriori state estimate using theconditional estimation formula for Gaussians:(We exploited that)

58

Kalman Filter Solution:
Before measurement y(1):A-priori output estimation errork=1

59

Kalman Filter Solution:

k=1

IMPORTANT: Property 1 of least squaresestimation:• The a-priori output estimation error
is uncorrelated with60• Calculate

61

Kalman Filter Solution• Calculate

62

Kalman Filter Solution:• a-posteriori state estimate:

k=1

63

Kalman Filter Solution:
Review of the results so far:

k=1

64

Kalman Filter Solution:• A-posteriori state estimation error:• A-posteriori state estimation error
covariance:

k=1

65

Kalman Filter Solution:

k=1• a-posteriori state estimation covariance:• Use least squares result:

66

Kalman Filter Solution:
Review:

Equations are entirely recursive!

k=1

67

Kalman Filter Solution
1) Compute a-priori output estimation error residual:

2) Compute a-posteriori state estimate:3) Update a-priori state estimate:68

Kalman Filter Solution4) Compute a-posteriori state estimation error
covariance:5) Update a-priori state estimation error
covariance:

69

Kalman filter implementation

70

Kalman Filter Solution V-2•Kalman filter algorithm can be written in adifferent manner, which only involves thea-priori state estimate and the a-prioriestimation error covariance.

71

Kalman Filter Solution V-2
PlugInto

Results in

72

Kalman Filter Solution V-2

where

73

Kalman Filter Solution V-2
Plugging

Into•

Results in the following
discrete Riccati difference equation:

74

Kalman Filter Solution V-2
A-priori state observer structure:

75

Kalman Filter Solution V-2• Same structure as deterministic a-prioriobserver

X-1

B(zI-A )

U

B--1(zI-A )C

 +L+Y-X

CY

76

Kalman Filter Solution V-1 (Review)
A-posteriori state observer structure:

77

Kalman Filter Solution V-1• A-posteriori estimator as output-1

BX

YC(zI-A )UCB++-oz-1

AX+oY~YoF(k)+-+ X

78

Kalman Filter, State Space Form

79

Kalman Filter, State Space Form

80

Kalman Filter (KF) Properties• The KF is a linear time varying estimator,even when the system is LTI and the noises
are WSS• The KF is the optimal state estimator whenthe input and measurement noises areGaussian.
• The KF is still the optimal linear stateestimator even when the input andmeasurement noises are not Gaussian.

81

Kalman Filter (KF) Properties
The KF a-priori output error (a-priori output residual)

is often called the innovation
it contains only the “new information” in y(k)Moreover,i.e.

is an uncorrelated RVS

82

Kalman Filter (KF) Properties
Proof:

It suffices to show that

By causality,
By least squares property 1,

83

KF as an innovations filter
We will assume, without loss of generality that the control
input is zero, i.e.
• Plant:• Kalman filter V-2:

84

KF as an innovations filterplantW(z)+C  (z) Bw

Uncorrelated
noise input

Kalman filter
Y(z) +-o^
Y (z)Correlated
noise output~oY (z)C  (z) L

Uncorrelated
noise output