Lecture 16: State Observer (Estimator) 1. Objectives Define the observability of dynamic systems....

18
Lecture 16: State Observer (Estimator) 1

Transcript of Lecture 16: State Observer (Estimator) 1. Objectives Define the observability of dynamic systems....

Page 1: Lecture 16: State Observer (Estimator) 1. Objectives Define the observability of dynamic systems. Design state estimators (observers). Select the eigenvalues.

Lecture 16:

State Observer (Estimator)

1

Page 2: Lecture 16: State Observer (Estimator) 1. Objectives Define the observability of dynamic systems. Design state estimators (observers). Select the eigenvalues.

Objectives

• Define the observability of dynamic systems.

• Design state estimators (observers).

• Select the eigenvalues of the observer.

2

Page 3: Lecture 16: State Observer (Estimator) 1. Objectives Define the observability of dynamic systems. Design state estimators (observers). Select the eigenvalues.

Observability

Definition: A system is observable if the knowledge of the input u(0), u(1), …, u(n-1) and the output y(0), y(1),…,y(n-1) is sufficient to determine the initial state x(0).

Condition for observability:To derive the condition under which the system is observable, let us consider, for simplicity, the unforced system (no input):

)()(

),()1(

kCxky

kxkx

3

Page 4: Lecture 16: State Observer (Estimator) 1. Objectives Define the observability of dynamic systems. Design state estimators (observers). Select the eigenvalues.

• Note that x(0) has n unknowns. This requires n equations to have a unique solution.

• For single output systems, the matrix Δo, called the observability matrix, is of size n x n. For the system to be observable, Δo must be invertible or, more generally, be of full rank n.

)0(

)1(

)2(

)1(

)0(

)0(

)0(

)0(

)0(

)1(

)2(

)1(

)0(

x(0))(

x(0))(

1

2

1

2 x

C

C

C

C

ny

y

y

y

xC

xC

xC

Cx

ny

y

y

y

Cky

kx

known

n

known

n

k

k

o

4

Page 5: Lecture 16: State Observer (Estimator) 1. Objectives Define the observability of dynamic systems. Design state estimators (observers). Select the eigenvalues.

Example 1

Given the following discrete-time system

Check if the system is observable.

This means that x(0) can not be uniquely estimated (calculated) from input-output data sequence. That is different initial states will result in the same output sequence.

)(5.01)(

)(01

3.01.1)1(

kxky

kxkx

observablenot is system1 rank 3.06.0

5.01

C

Co

5

Page 6: Lecture 16: State Observer (Estimator) 1. Objectives Define the observability of dynamic systems. Design state estimators (observers). Select the eigenvalues.

State estimation

• In designing state feedback controller, we assumed that all states are measured.

• In most applications, measuring the entire state vector is impossible or prohibitively expensive.

• To implement state feedback control, an estimate of the state vector can be used.

• The state can be estimated from the input and output measurements by using a state estimator or observer. A state estimator is a mathematical construct (implemented as a part of the controller program) that helps estimate the states of a system.

)(ˆ kx

6

Page 7: Lecture 16: State Observer (Estimator) 1. Objectives Define the observability of dynamic systems. Design state estimators (observers). Select the eigenvalues.

Observer: simple idea

Consider the following system:

To estimate all the states, one could in theory use a system with the same state equation:

Here, we assume perfect knowledge of the system dynamics (i.e. the matrices Φ, Γ).

),()(ˆ)1(ˆ kukxkx

)()(

),()()1(

kCxky

kukxkx

7

Page 8: Lecture 16: State Observer (Estimator) 1. Objectives Define the observability of dynamic systems. Design state estimators (observers). Select the eigenvalues.

Simple observer: drawback• Let us examine the error dynamics of the simple observer by

subtracting the observer dynamics from the system dynamics, i.e.

• The state error dynamics are determined by the state matrix Φ. This matrix cannot be chosen arbitrarily.

• For an unstable system, the observer will be unstable and cannot track the state of the system.

xxxkxkx

kxkxkxkx

kukxkx

kukxkx

eee ˆwhere),()1(

)()(ˆ)1(ˆ)1(

)()(ˆ)1(ˆ

)()()1(

8

Page 9: Lecture 16: State Observer (Estimator) 1. Objectives Define the observability of dynamic systems. Design state estimators (observers). Select the eigenvalues.

Observer: a better idea

A practical alternative is to provide the estimator with the measured output in addition to the input as shown. This corrects the state estimate.

9

Page 10: Lecture 16: State Observer (Estimator) 1. Objectives Define the observability of dynamic systems. Design state estimators (observers). Select the eigenvalues.

• The observer will calculate the difference between the measured and the estimated output of the system and use this difference as additional input in its state equation as:

• Subtracting the observer state equation from the system dynamics yields the estimation error dynamics

))(ˆ)(()()(ˆ)1(ˆ

))(ˆ)(()()(ˆ)1(ˆ

kxCkCxLkukxkx

kykyLkukxkx

)()()1( kxLCkx ee

o

10

Observer: a better idea

Page 11: Lecture 16: State Observer (Estimator) 1. Objectives Define the observability of dynamic systems. Design state estimators (observers). Select the eigenvalues.

• The error dynamics are now governed by the eigenvalues of the observer matrix Φo.

• Thus, the gain matrix L can be designed so that Φo has eigenvalues with fast modes to guarantee fast convergence of the estimated state to the true state (i.e. to make the error in estimated state goes to zero quickly).

11

Observer: a better idea

Page 12: Lecture 16: State Observer (Estimator) 1. Objectives Define the observability of dynamic systems. Design state estimators (observers). Select the eigenvalues.

Theorem: State Estimation

If the pair (Φ, C) is observable, then there exists a matrix L that arbitrarily assigns the observer poles (eigenvalues of the matrix Φo = Φ - LC) to any set {λi, i = 1, . . . , n}.

12

Page 13: Lecture 16: State Observer (Estimator) 1. Objectives Define the observability of dynamic systems. Design state estimators (observers). Select the eigenvalues.

Selecting estimator pole locations

Typically, estimator pole locations are selected so that the estimator responds two to six times faster than the controlled plant.

13

Page 14: Lecture 16: State Observer (Estimator) 1. Objectives Define the observability of dynamic systems. Design state estimators (observers). Select the eigenvalues.

Example 2

Given the following discrete-time system

Check if the system is observable and controllable. If so, design a state feedback controller as well as a state observer such that:

• The eigenvalues of the state feedback system is ½ and -½• The eigenvalues of the observer is ¼ and -¼.

)(01)(

)(1

0)(

10

10)1(

kxky

kukxkx

14

Page 15: Lecture 16: State Observer (Estimator) 1. Objectives Define the observability of dynamic systems. Design state estimators (observers). Select the eigenvalues.

Solution

• Check if the system is observable and controllable:

• The controllability matrix

• The observability marix

observable is system2 rank 10

01

C

Co

lecontrollab is system2rank 11

10

c

15

Page 16: Lecture 16: State Observer (Estimator) 1. Objectives Define the observability of dynamic systems. Design state estimators (observers). Select the eigenvalues.

14/11,4/1

4/1)1(

4/11

1

4/11

0

10

10

0

0

)2/1)(2/1()(

2121

212

2

2

21

221

kkKkk

kk

kk

kk

KI

16

Solution: computing the state feedback gain matrix K

Page 17: Lecture 16: State Observer (Estimator) 1. Objectives Define the observability of dynamic systems. Design state estimators (observers). Select the eigenvalues.

16/15

116/15,1

16/1)1(

16/11

1

)4/1)(4/1(0110

10

0

0

)4/1)(4/1()(

2

121

2211

2

2

2

1

2

1

l

lLll

lll

l

l

l

l

LCI

17

Solution: observer design (computing the matrix L)

Page 18: Lecture 16: State Observer (Estimator) 1. Objectives Define the observability of dynamic systems. Design state estimators (observers). Select the eigenvalues.

• Given the observer state matrix

• We transpose the matrix to obtain

• By this way we can use the same MATLAB command “place” as follows

Lt = place(phi’,C’,p); L = Lt’; % note that the output need to be transposed

TTTTo LC

Observer design using MATLB

LCo

18