Download as pdf or txt
Download as pdf or txt
You are on page 1of 22

L5:1

Lecture 5

Symmetric Root Locus LQR Design State Estimation

Selection of 'optimal' poles for SISO pole placement design: SRL

LQR design example

Prediction and current estimators

L5:2

Optimal pole placement for SISO systems

For a single-input system, we might select one particular output (y = Cx) to constrain in a cost function: = Ax + Bu y r=0 + u x J = (y 2 (t ) + u 2 (t ) )dt y = Cx 0 Plant transfer function: x K Y ( s) N (s) 1 = C(sI A ) B = , say D( s) U (s)

It can be shown that:

J will be minimised by the control law u = Kx the eigenvalues of the closed-loop system are the left half-plane roots of the 2n-degree polynomial equation Ref: Kailath, Linear Systems, 1980

c ( s ) c ( s ) = D ( s ) D( s ) + N ( s ) N ( s ) = 0

L5:3

Optimal pole placement for SISO systems

c ( s ) c ( s ) = D ( s ) D( s ) + N ( s ) N ( s ) = 0

Hence we can see the effects of the output-weighting factor on the closed-loop poles by plotting a root locus for N ( s ) N ( s) 1+ =0 D( s ) D( s)

This symmetric root locus (SRL) will be a 180 (0) locus if the open-loop pole-zero excess is even (odd)

The roots of c(s) = 0 are guaranteed stable

Hence if branches of the 180 SRL lie on the imaginary axis, plot the 0 locus instead

The SRL thus provides a basis for specifying CLPs in a SISO pole-placement design

SRL for discrete systems


N ( z ) N ( z 1 ) 1+ =0 1 D( z ) D( z )
k m b
d

L5:4

The SRL is plotted for the equation


See script flex_srl.m and function srl.m

Example:

Compliant structure: M = 1, m = 0.1 b = 0.0036, k = 0.091 States: x = [d d

y ]
Sample period: T = 0.4 s

Open-loop TF:

D( z ) 0.00134( z + 0.07)( z + 0.82)( z + 7.74) = U ( z) ( z 1) 2 ( z 0.91 j 0.39)

Discrete SRL for compliant structure


Symmetric root locus

L5:5

1.5

0.5

Imag Axis

-0.5

-1

-1.5

-2 -2 -1.5

-1

-0.5

0 Real Axis

0.5

1.5

Use rlocfind to select trial CLPs


[rho,clp]=rlocfind(Gol)

L5:6

1.5

0.5

s i x A g a m I

-0.5

rho = 1.3414 clp = 1.3120 + 0.2387i 1.3120 - 0.2387i 0.9934 + 0.5065i 0.9934 - 0.5065i 0.7989 + 0.4074i 0.7989 - 0.4074i 0.7378 + 0.1342i 0.7378 - 0.1342i

-1

-1.5

-2 -2 -0.5

-1.5

-1

0 Real Axis

0.5

1.5

dclp=clp(find(abs(clp)<1)) dclp = 0.7989 + 0.4074i 0.7989 - 0.4074i 0.7378 + 0.1342i 2 0.7378 - 0.1342i

SRL pole-placement design (see flex_srl.m)

L5:7

Gp = ss(A, B, C, D,'InputName','force u','OutputName','disp d'); set(Gp, 'StateName', {'d', 'ddot', 'y', 'ydot'}) T = 0.4; % sample period Gpd = c2d(Gp, T); % discrete ss model

% Plot symmetric root locus and get desired CL poles [rho, dclp] = srl(Gpd); % MCG-written function

% State-feedback control gains Phi = Gpd.a; Gam = Gpd.b; K = acker(Phi, Gam, dclp);

% Closed-loop regulator system Gdu = [Gpd; 1]; % get d and u as outputs Gdux = augstate(Gdu); % augment plant outputs with states Gcl = feedback(Gdux, K, [1], [3:6]); % feed-back 4 states to u Gcl = Gcl(1:2,1); % suppress state outputs Gcl.outputn={'disp d'; 'ctrl u'};

% Initial condition response x0 = [1 0 0 0]'; % d(0) = 1 initial(Gcl, x0)

SRL pole-placement design Initial condition response

L5:8

0.5

To: disp d

-0.5

Amplitude

0.5

To: ctrl u

-0.5 5 10 15 20 25

Time (sec.)

LQR design for compliant structure (see flex_lqr.m)


L5:9

% Discrete model T = 0.4; Gpd = c2d(Gp, T); Phi = Gpd.a; Gam = Gpd.b;

% Optimal control: trial and error Rc = 1; % Scalar input

% Weight displacements but not velocities % Get trial diagonal elements for Q Q11 = input('Enter controller Q11: '); Q22 = input('Enter controller Q22: '); Qc = diag([Q11 0 Q22 0]);

K = dlqr(Phi, Gam, Qc, Rc)

L5:10

LQR design, Q11 = 100, Q22 = 10, R = 1

0.5

To: disp d

-0.5

0.5

Amplitude

To: disp y

-0.5

To: force u

-2 2 4 6 8 10 12

Time (sec.)

L5:11

LQR with prediction estimator


u(k) m

q1

x(k)

y(k)

Plant:
Plant

x(k + 1) = x(k ) + u(k )

y ( k ) = Cx(k )

Control law: u ( k ) = Kx (k | k 1)

u(k)

q1
C
y (k )
Estimator

Estimator:

x (k | k 1)

Lp

x ( k + 1 | k ) = x (k | k 1) + u(k ) + L p [y (k ) Cx (k | k 1)]
Feedback compensator

Full-order prediction estimator

L5:12

Plant:

x(k + 1) = x(k ) + u(k ) y ( k ) = Cx(k )

( k + 1 | k ) = x (k | k 1) + u(k ) + L p [y (k ) Cx (k | k 1)] Estimator: x

x p (k ) = x (k | k 1) x(k ) Estimation error: ~

x p (k + 1) = [ L p C]~ x p (k ) Estimation error dynamics: ~

Characteristic polynomial:

L ( z ) = det[zI + L p C]

n coefficients containing pn unknowns


e ( z ) = ( z 1 )( z 2 ) ( z n )

Desired characteristic polynomial:

n chosen coefficients

For MIMO systems, Matlabs place function uses the extra DoF to give a robust solution

Example: Regulation of compliant structure with prediction estimator


L5:13

k m b
d

Compliant structure: M = 1, m = 0.1 b = 0.0036, k = 0.091 d

States: x = [d

y ]

Sample period: T = 0.4 s Sensed outputs: y = [d y]T

A previous controller design K = [0.46 0.25 0.57 0.97] to place poles at z = 0.9 j 0.05, 0.8 j 0.4 (corresponding to [, n] = [0.88, 0.29], [0.23, 1.19]) Try placing estimator poles 5-times faster: dcls = 1/T*log(dclz); % controller s-poles deps = 5*dcls; depz = exp(T*deps); % estimator z-poles

L5:14

Prediction estimator design

Discretised plant model: T = 0.4; Gpd = c2d(Gp,T); Phi = Gpd.a; C = Gpd.c; Estimator gains: Lp = place(Phi',C',depz)

Regulator: H = reg(Gpd, K, Lp) Feedback: Gcl = feedback(Gpd, H, +1) Check response to initial condition d(0) = 1 Experiment with estimator pole selection, etc. (Matlab script flex_predict.m)

2.59 4.35 Lp = 0.07 0.57

0.20 0.29 0.87 0.47

Response to initial condition d = 1


u
b y
d

k M m

L5:15

To: disp d

0.5

d(k)

0.4

0.2

y(k)

Amplitude

To: disp y

-0.2

u(k)

To: force u

-1 5 10 Time (sec.) 15 20

esponse of states and predictive estimates to prediction x 1(0) = 1 Actual states compared with
L5:16

3 x 2=ddot x 2hat

estimates

2 0

x 1=d x 1hat

0 -5 0

-1 10 1 x 3=y x 3hat

5 Time (s)

5 Time (s)

10

0.4

0.2

0.5

x 4=ydot x 4hat

0 0

-0.2

-0.4

5 Time (s)

10

-0.5

5 Time (s)

10

Current estimators

L5:17

Using the previous prediction estimator, the control at instant k is based on sensor data up to the previous sampling instant: u(k ) = Kx (k | k 1)

We know that delays (latency) in a feedback loop are de-stabilising Hence, if we were able to quickly update the state estimate at instant k, based on the current measurement, it would be worthwhile: x (k | k ) = x (k | k 1) + L c [y (k ) Cx (k | k 1)] This measurement update is performed on the model prediction (a time update):

x (k | k 1) = x (k 1 | k 1) + u(k 1) We need to organise the calculations so that the measurement update can be performed rapidly

L5:18

u(k)

LQR with current estimator


m
C +

q1 p

x(k)

y(k)

Plant:
Plant

x(k + 1) = x(k ) + u(k ) y ( k ) = Cx(k )

Control law: u ( k ) = Kx (k | k ) u(k)

x (k | k 1)

Estimator:

q1
x (k | k )

y (k ) + C

Time update: x ( k + 1 | k ) = x ( k | k ) + u ( k )

K Measurement update: x (k | k ) = x (k | k 1) + L c [y (k ) Cx (k | k 1)]

Lc

Comparison between prediction and current estimates

L5:19

For the current estimator we have x (k + 1 | k ) = x ( k | k ) + u ( k )

and x (k | k ) = x (k | k 1) + L c [y (k ) Cx (k | k 1)]

Hence x ( k + 1 | k ) = x (k | k 1) + u(k ) + L c [y (k ) Cx (k | k 1)]

The prediction estimation error is ~ x p (k + 1) = x (k + 1 | k ) x(k + 1)

= x (k | k 1) + u(k ) + L c [Cx(k ) Cx (k | k 1)]

x ( k ) u ( k ) = [ L c C]~ x p (k )

L5:20

Comparison between prediction and current estimates ...

For the current estimator we have the prediction error ~ x p (k + 1) = x (k + 1 | k ) x(k + 1) = [ L C]~ x (k )
c p

Similarly, we can show that the current estimate error is ~ xc (k + 1) = x (k + 1 | k + 1) x(k + 1) = [ L C ]~ x (k )


c c

The two error equations have the same eigenvalues (both are outputs from the same dynamic system) hence can use either as a basis for calculating Lc x p (k + 1) = [ L p C]~ x p (k ) For the prediction estimator: ~

Hence for current estimator we can use: Lc = place(Phi, (C*Phi), depz)

L5:21

Implementation of current estimator in Matlab

Given x ( k + 1 | k ) = x ( k | k ) + u ( k )

and x (k | k ) = x (k | k 1) + L c [y (k ) Cx (k | k 1)]

we can show that the state equations for the estimator, with input y(k) and output u(k), are

u(k ) = K [I L c C]x (k | k 1) KL c y (k )

x (k + 1 | k ) = [ K ][I L c C]x (k | k 1) + [ K ]L c y (k )

Script flex_current compares responses of current and prediction estimators

Initial Condition Results

L5:22

To: disp d

0.5

0.4

current estimator

0.2

Amplitude

To: disp y

-0.2

prediction estimator

To: force u

-1 5 10 Time (sec.) 15 20

You might also like