Вы находитесь на странице: 1из 23

METR4202 – Advanced Control & Robotics

Lecture 4

Review of Controller Design


METR4202/7202 – AAdvanced Control & Robotics, Semester 2, 2005: Page: 1

Frequency Domain PD Controller Design


State-Space Feedback Control Design

Introduction to State-Space Observer Design

G. Hovland 2004-2006

Solutions: Tutorial week 4, Q5


METR4202/7202 – AAdvanced Control & Robotics, Semester 2, 2005: Page: 2
Step 1a: Find Phase Margin and Frequency
%
− ln
100 − ln(0.1)
ζ = = = 0.5912
% π 2 + ln 2 (0.1)
π + ln
2 2

100
π π
wn = = = 3.90
Tp 1 − ζ 2
1.0 1 − 0.3495

2ζ 1.1823
Φ M = a tan = a tan = 58.6o
METR4202/7202 – AAdvanced Control & Robotics, Semester 2, 2005: Page: 3

− 2ζ 2 + 1 + 4ζ 4 0.7219

Desired Closed-Loop Frequency Response:


Y ( s) ωn 2
= 2
U ( s ) s + 2ζωn s + ωn 2

Desired Open-Loop Frequency Response:


Y ( s) ω 2
= 2 n
U ( s ) s + 2ζωn s

Step 1b: Desired Frequency Response

r(t) ωn 2 y(t) r(t) ωn 2 y(t)


-
s 2 + 2ζωn s = s 2 + 2ζωn s + ωn
2

Bode Plots: (wc = 2.8 rad/sec) and Phase Margin = 58.6o


METR4202/7202 – AAdvanced Control & Robotics, Semester 2, 2005: Page: 4
Tutorial Q5: Step 2a, Actual Response

Kd
Gc ( s ) = K p + K d s = K p s +1
Kp
Start with Kp=1 and Kd=0
METR4202/7202 – AAdvanced Control & Robotics, Semester 2, 2005: Page: 5

Must increase gain


by 32dB to get wc at
2.8 rad/sec

Convert dB to gain:

32 dB = 10(32/20)
≈ 40 = Kp

Tutorial Q5: Step 2b, Actual Response


Phase Curve
Phase margin only
15o. Needs to be lifted
approx. 45o.

Kd
Gc ( s ) = K p s +1
Kp
METR4202/7202 – AAdvanced Control & Robotics, Semester 2, 2005: Page: 6

Kp / Kd is the location
of the zero. The zero
will lift the phase curve.
Approximately 45o lift
where zero is.

Choose Kd = Kp/2.8 = 14.3,


which gives a zero at
2.8 rad/sec
Tutorial Q5, Step 2c: Actual Response
Bode plots with Kp = 40 and Kd = 14.3
METR4202/7202 – AAdvanced Control & Robotics, Semester 2, 2005: Page: 7

The zero has also increased the Phase margin now ok


crossover frequency wc.

Some fine-tuning required, but simply reduce gain while keeping zero.
Kp = 30 and Kd = Kp / 2.8 = 10.7 gives desired result.

Tutorial Q5, Step 3: Verification

Peak time exactly


METR4202/7202 – AAdvanced Control & Robotics, Semester 2, 2005: Page: 8

1.0 seconds.

Overshoot slightly higher


than 10%.

Design is not accurate, since


the PD controller and G(s)
do not match exactly
ωn 2
s 2 + 2ζωn s
Bode plots of (s+a) = a (s/a + 1)
Review from Lecture 1b. Asymptotic Bode plots

Figure 10.6
METR4202/7202 – AAdvanced Control & Robotics, Semester 2, 2005: Page: 9

a. magnitude
plot;
b. phase plot.

Gain and Phase Margin via Nyquist (10.6)


Review from Lecture 1b. The Nyquist plot explains why
we look at 0dB and -180o for the open-loop transfer
function.

Figure 10.35
METR4202/7202 – AAdvanced Control & Robotics, Semester 2, 2005: Page: 10

Nyquist diagram
showing gain
and phase
margins
METR4202/7202 – AAdvanced Control & Robotics, Semester 2, 2005: Page: 11 Tutorial w4, Q6

1
roots([1 6 11 6]) G( s) =
( s + 1)( s + 2)( s + 3)

1 1 1
u s 1 s 1 s 1
y

-1 -2 -3

Tutorial w4, Q6b

u dz3/dt
1 z3 dz2/dt 1 z2 dz1/dt 1 z1
s 1 s 1 s 1
y

-1 -2 -3
z1 = −3z1 + z2
z 2 = −2 z 2 + z 3
METR4202/7202 – AAdvanced Control & Robotics, Semester 2, 2005: Page: 12

z3 = − z3 + u

−3 1 0 0
Az = 0 − 2 1 Bz = 0 C z = [1 0 0] Dz = 0
0 0 −1 1
z1 z1 z1
z2 = A z2 + Bu y = C z2 + Du
z3 z3 z3
METR4202/7202 – AAdvanced Control & Robotics, Semester 2, 2005: Page: 13 Tutorial w4, Q7

Tutorial w4, Q7: Step 1. Desired Polynomial


We already have the desired polynomial from Q1
%
− ln 1
100 − ln(0.1)
ζ = = = 0.5912
π 2 + ln 2 (0.1) s 2 + 2ζωn s + ωn
% 2
π + ln
2 2

100
π π 1
wn = = = 3.90 =
Tp 1 − ζ 2
1.0 1 − 0.3495 s + 4.6 s + 15.2
2
METR4202/7202 – AAdvanced Control & Robotics, Semester 2, 2005: Page: 14

The system is 3rd order. We have no zeros to cancel. Hence, we


add another pole at 40 (a decade above wn) where it has little
effect on overshoot and peak time.

1 1
=
( s + 40)( s 2 + 4.6s + 15.2) s 3 + 44.6s 2 + 199.2 s + 608
Tutorial w4, Q7: Step 2. Phase Variable-Form

x1 0 1 0 x1 0
x2 = 0 0 1 x2 + 0 u
x3 − a0 − a1 − a2 x3 1

1 1
METR4202/7202 – AAdvanced Control & Robotics, Semester 2, 2005: Page: 15

G( s) = =
s 3 + 6s 2 + 11s + 6 s 3 + a2 s 2 + a1s + a0

x1 0 1 0 x1 0
x2 = 0 0 1 x2 + 0 u
x3 − 6 − 11 − 6 x3 1

Ax Bx

Tutorial w4, Step 3: Controller Gains by Inspection

0 1 0
Ax − Bx K x = 0 0 1
− (6 + k1 ) − (11 + k2 ) − (6 + k3 )

Desired Polynomial:
METR4202/7202 – AAdvanced Control & Robotics, Semester 2, 2005: Page: 16

1
s 3 + 44.6s 2 + 199.2 s + 608

k1 = 602
Controller gains in
k2 = 188.2 phase-variable form
k3 = 38.6
Tutorial w4, Q7: Step 4. Transformation Matrix

The transformation matrix P to convert from cascade to


phase-variable form
0 0 1
CMZ = [ Bz Az Bz Az Bz ] = 0 −3
2
1
1 −1 1
METR4202/7202 – AAdvanced Control & Robotics, Semester 2, 2005: Page: 17

0 0 1
CMX = [ Bx Ax Bx Ax Bx ] = 0 −6
2
1
1 −6 25

1 0 0
−1
P = CMZ * CMX = 3 1 0
6 5 1

Tutorial w4, Q7: Step 5. Final Controller Gains

K z = K x P −1
1 0 0
= [602 188.2 38.6] − 3 1 0
−5 1
METR4202/7202 – AAdvanced Control & Robotics, Semester 2, 2005: Page: 18

9
= [384.8 − 4.8 38.6]
METR4202/7202 – AAdvanced Control & Robotics, Semester 2, 2005: Page: 19 Tutorial w4, Q7: Verification

Peak time exactly 1.0 seconds

Overshoot exactly 10%.

Limitations of state-feedback control

In practice, all the states x are not measured and


available for feedback.
For mechanical systems, such as robots, the joint
angles are typically measured but the velocities not.
Reducing the number of sensors reduces the cost of the
METR4202/7202 – AAdvanced Control & Robotics, Semester 2, 2005: Page: 20

overall control system.

Hence, we need to develop methods for state-space


controller design when the only measurement is the
scalar y.
State-feedback design using observers
A) Unforced observer B) Forced observer
METR4202/7202 – AAdvanced Control & Robotics, Semester 2, 2005: Page: 21

Details of
forced observer

Unforced Observer
x = Ax + Bu
The plant dynamics
y = Cx

xˆ = Axˆ + Bu
The observer dynamics
yˆ = Cxˆ
METR4202/7202 – AAdvanced Control & Robotics, Semester 2, 2005: Page: 22

x − xˆ = A (x − xˆ ) The error dynamics.


Note that the error e = x − xˆ
y − yˆ = C(x − xˆ ) approaches zero given by the
transient dynamics of A

This is not a particularly good observer; we want the error dynamics


to be much faster than the system dynamics.
Forced Observer
x = Ax + Bu The plant dynamics

y = Cx

xˆ = Axˆ + Bu + L( y − yˆ ) The forced observer


yˆ = Cxˆ dynamics
METR4202/7202 – AAdvanced Control & Robotics, Semester 2, 2005: Page: 23

x − xˆ = A ( x − xˆ ) − L( y − yˆ )
y − yˆ = C( x − xˆ )
Forced error dynamics. We
can now design the transient
response of the error by
placing the poles of A-LC
x − xˆ = ( A − LC)( x − xˆ )

Observer Design vs. Controller Design

In controller design we placed the poles of A-BK


The phase-variable or the controller canonical forms
made feedback gain selection easy: by inspection

In observer design we will place the poles of A-LC


METR4202/7202 – AAdvanced Control & Robotics, Semester 2, 2005: Page: 24

The observer canonical form will turn out to be ideal for


observer feedback gain selection: also by inspection
3rd Order Observer: Observer Canonical Form
b3 s 2 + b2 s + b1
G( s) = 3
s + a2 s 2 + a1s + a0

Signal-flow chart for


the unforced observer
METR4202/7202 – AAdvanced Control & Robotics, Semester 2, 2005: Page: 25

Signal-flow chart for


the forced observer

Observer Design Procedure


Observer
Canonical
Form
Here you see why
this form has the
advantage
METR4202/7202 – AAdvanced Control & Robotics, Semester 2, 2005: Page: 26

Desired Poles:
METR4202/7202 – AAdvanced Control & Robotics, Semester 2, 2005: Page: 27 Example 12.5: Observer Design

From Lecture Notes 3

Desired poles:

( s 2 + 2ζwn s + wn )( s + p )
2

= ( s 2 + 2 s + 5)( s + 4) = s 3 + 6s 2 + 13s + 20

Observer Canonical Form


METR4202/7202 – AAdvanced Control & Robotics, Semester 2, 2005: Page: 28

xˆ = Axˆ + Bu + L( y − yˆ )
yˆ = Cxˆ = xˆ 1
METR4202/7202 – AAdvanced Control & Robotics, Semester 2, 2005: Page: 29 Ex 12.5: Characteristic Polynomial

Ex 12.5: Desired Polynomial


Desired Poles from Example 12.4:

( s 2 + 2ζwn s + wn )( s + p )
2

= ( s 2 + 2 s + 5)( s + 4) = s 3 + 6s 2 + 13s + 20
10 Times Faster wn:

= ( s 2 + 20s + 500)( s + 100) = s 3 + 120s 2 + 2500s + 50000


METR4202/7202 – AAdvanced Control & Robotics, Semester 2, 2005: Page: 30

This is the pole selection in the book,


alternatively cancel the zero at 4.

By inspection: = 112, = 2483, = 49990


Observer Response

A) With observer feedback


gains L
METR4202/7202 – AAdvanced Control & Robotics, Semester 2, 2005: Page: 31

B) With observer feedback


gains disconnected

Observable and Non-Observable Systems


All the states influence
the output
METR4202/7202 – AAdvanced Control & Robotics, Semester 2, 2005: Page: 32

The state x1 does not


influence the output

Observability by inspection:
Convert to parallel form by eigenvectors
The Observability Matrix: Analytic Approach
An nth-order plant whose state and output
dynamics are:

x = Ax + Bu
y = Cx
METR4202/7202 – AAdvanced Control & Robotics, Semester 2, 2005: Page: 33

is completely observable if the matrix


Compare
C with
controllability
CA matrix
is of rank n. OM =

CA n −1

Example 12.6: Observability


METR4202/7202 – AAdvanced Control & Robotics, Semester 2, 2005: Page: 34

Determine if the system above is observable!


x1 = x2
x2 = x3
x3 = −4 x1 − 3x2 − 2 x3 + u
y = 5 x2 + x3
Example 12.6: A and C Matrices

0 1 0
A= 0 0 1 C = [0 5 1]
−4 −3 −2
METR4202/7202 – AAdvanced Control & Robotics, Semester 2, 2005: Page: 35

The observability matrix:

C 0 5 1
OM = CA = − 4 − 3 3
CA 2 − 12 − 13 − 9

det(OM) = -344 ≠ 0 Hence, the system is observable

Example 12.7: Unobservability


This system looks
as if it could be
observable.

x1 = x2
METR4202/7202 – AAdvanced Control & Robotics, Semester 2, 2005: Page: 36

21
x2 = −5 x1 − x2 + u
4
y = 5 x1 + 4 x2
1 0
A= 21 C = [5 4]
−5 −
4
C 5 4
OM = = Rank is 1, not observable
CA − 20 − 16
Summary so far: Observers

We need observers for state-feedback control when not


all the states x are measured.
First, check observability. If the system is observable,
you can go on and design an observer.
Second, if the system is in observer canonical form, the
METR4202/7202 – AAdvanced Control & Robotics, Semester 2, 2005: Page: 37

observer design is a simple gain matching by inspection.

If the system is not in observer canonical form, we need


to first transform the model into this form.

Transformation Matrix P
Original System: Transformed System:

z = Az + Bu x = P −1APx + P −1Bu
y = Cz y = CPx
C CP
METR4202/7202 – AAdvanced Control & Robotics, Semester 2, 2005: Page: 38

CA CP( P −1AP)
OMZ = OMX = = OMZ P

CP( P −1AP) n −1
CA n −1

Hence, We now have two ways


of obtaining P: either via the
−1
P = OMZ OMX controllability matrices or
the observability matrices
Transformation to Observer Canonical Form
This is the observer canonical form (system X):

− an −1 1 0 0
− an − 2 0 1 0
AX = C X = [1 0 0]
− a1 0 0 1
METR4202/7202 – AAdvanced Control & Robotics, Semester 2, 2005: Page: 39

− a0 0 0 0

With this transformation matrix


−1
P = OMZ OMX we can transform any system Z
to the observer canonical form X

In Matlab: P = inv(obsv(Az,Cz)) * obsv(Ax,Cx)

Design gains in observer canonical form: Convert back to system Z


Lz = PLx

Ex. 12.8: Observer Design by Transformation

Design an observer for the plant

1
G( s) =
( s + 1)( s + 2)( s + 5)

represented in cascade form.


METR4202/7202 – AAdvanced Control & Robotics, Semester 2, 2005: Page: 40

Let the closed-loop performance of the observer be


governed by the characteristic polynomial:

s 3 + 120s 2 + 2500s + 50000


Ex 12.8: Cascade Form

1
METR4202/7202 – AAdvanced Control & Robotics, Semester 2, 2005: Page: 41

G( s) =
( s + 1)( s + 2)( s + 5)
z1 = −5 z1 + z2
z 2 = −2 z 2 + z 3
−5 1 0
z3 = − z 3 + u
A = 0 −2 1 C = [1 0 0]
0 0 −1

Ex 12.8: Observability Test


Determinant equals 1
C 1 0 0 Hence, observable
OMZ = CA = − 5 1 0
CA 2 25 −7 1

1 Poles expanded:
G( s) =
s 3 + 8s 2 + 17 s + 10
METR4202/7202 – AAdvanced Control & Robotics, Semester 2, 2005: Page: 42

( s + 1)( s + 2)( s + 5)
Observer Canonical Form X
−8 1 0
A X = − 17 0 1 C X = [1 0 0]
− 10 0 0
CX 1 0 0
OMX = CX A X = −8 1 0
−8 1
2
CX A X 47
Ex 12.8: Observer Gains by Inspection
− (8 + l1 ) 1 0
A X − L X C X = − (17 + l2 ) 0 1
− (10 + l3 ) 0 0

Characteristic Polynomial is:

s 3 + (8 + l1 ) s 2 + (17 + l2 ) s + (10 + l3 )
METR4202/7202 – AAdvanced Control & Robotics, Semester 2, 2005: Page: 43

Desired Polynomial is:

s 3 + 120s 2 + 2500s + 50000

Observer design by coefficient matching

L1 = 112 L2 = 2483 L3 = 49990

Example 12.8: Final Design


Convert observer gains back to original cascade form:
Lorig = PLX = OMZ-1 * OMX * LX = [ 112 2147 47619]T
METR4202/7202 – AAdvanced Control & Robotics, Semester 2, 2005: Page: 44
Ex 12.8: Forced and unforced responses

Forced response
METR4202/7202 – AAdvanced Control & Robotics, Semester 2, 2005: Page: 45

Response with observer


gains disconnected. This
response has the same
transient as the system
itself.

Summary: Observer Design


The observer canonical form is used to find the observer
gains by inspection
As for state-space controller gains, the observer gains
need to be transformed back to the original state-space
model using the transformation matrix P.
For observer design, the transformation matrix P is
METR4202/7202 – AAdvanced Control & Robotics, Semester 2, 2005: Page: 46

found from the observability matrices.


For controller design, the transformation matrix P is
found from the controllability matrices.
The observer poles should be typically designed 10
times faster than the controller poles.
With the information in this lecture, you can now
proceed with the observer for the inverted pendulum
practical experiment.

Вам также может понравиться