You are on page 1of 8

Lecture 10: Reference Generation

[IFAC PB Ch 7, Ch 9 p. 6872, these slides]


Inputoutput approach
State-space approach
Nonlinear reference generation
1
The Servo Problem
How to make the output respond to command signal changes
in the desired way
Typical design criteria:
Rise time, T
r
Overshoot, M
Settling time, T
s
Steady-state error, e
0
. . .
1.0
2p
y
M
T
r
t
e
0
T
s
2
Simplistic Setpoint Handling Error Feedback
PSfrag
u
c
C(z) P(z)
1
y e
Problems:
Step changes in the setpoint can introduce very large
control signals
The same controller C(z) must be tuned to handle both
disturbances and setpoint changes
No separation between the regulator problem and the
servo problem
3
Common Quick Fixes
Filter the setpoint signal
F(z)
u
c u
c
Rate-limit the setpoint signal
u
c u
c
Introduce setpoint weighting in the controller
E.g. PID controller with setpoint weightings and
4
A More General Solution
Use a two-degree-of-freedom (2-DOF) controller, e.g.:
u
c
P
1

H
fb
H
ff
y
Design procedure:
1. Design feedback controller H
fb
to get good regulation proper-
ties (attenuation of load disturbances and measurement noise)
2. Design feedforward compensator H
ff
to obtain the desired
servo performance
Separation of concerns
5
2-DOF Control Structures
A 2-DOF controller can be represented in many ways, e.g.:
(For linear systems, all these structures are equivalent)
6
Example: PID with Setpoint Weighting
u = K
_
y
sp
y +
1
T
I
_
(y
sp
y)d + T
D
d
dt
( y
sp
y)
_
= K
_
e +
1
T
I
_
e d + T
D
de
dt
_
+ K( 1)
. .
K1
y
sp
+ T
D
K( 1)
. .
K2
dy
sp
dt
GP
PID + +
y ysp
K1 + K2 d /dt ysp ysp

Interpretation: Error feedback + feedforward from y


sp
7
Reference Generation InputOutput Approach
2-DOF control structure with reference model and feedforward:
replacements
u
c
P
H
ff
H
m C
y
1
y
m
u
ff

H
m
model that describes the desired servo performance
H
ff
feedforward generator that makes y follow y
m
Goal: perfect following if there are no disturbances or
model errors
8
The transfer function from u
c
to y is
H
yuc
=
P(H
ff
+ CH
m
)
1 + PC
Choose
H
ff
=
H
m
P
Then
H
yuc
=
P(
Hm
P
+ CH
m
)
1 + PC
= H
m
Perfect model following!
9
Restrictions on the Model
In order for H
ff
=
H
m
P
to be implementable (causal and stable),
H
m
must have at least the same pole excess as P
any unstable zeros of P must also be included in H
m
In practice, also poorly damped zeros of P (e.g. outside the heart-
shaped region below) should be included in H
m
1.5 1 0.5 0 0.5 1 1.5
1
0.5
0
0.5
1
1
0.8
0.6
0.4
0.2
0 =
10
Example: PID Control of the Double Tank
Process:
G(s) =
3
(1 +60s)
2
Sampled process (h = 3):
H(z) =
0.003627(z +0.9672)
(z 0.9512)
2
PID controller tuned for good regulation performance:
C(s) = K
_
1 +
1
sT
i
+
sT
d
1 + sT
d
/N
_
with K = 7, T
i
= 45, T
d
= 15, N = 10, discretized using
rst-order hold.
11
Simulation with error feedback:
0 20 40 60 80 100 120 140 160 180 200
0
0.5
1
1.5
O
u
t
p
u
t
0 20 40 60 80 100 120 140 160 180 200
20
0
20
40
I
n
p
u
t
Time
Load disturbance at time 100 regulated as desired
Very large control signal at time 0 and overshoot in the
step response
12
Reference model (critically damped should not generate any
overshoot):
G
m
(s) =
1
(1 +10s)
2
Sampled reference model:
H
m
(z) =
0.036936(z +0.8187)
(z 0.7408)
2
Feedforward lter:
H
ff
(z) =
H
m
(z)
H(z)
=
10.1828(z +0.8187)(z 0.9512)
2
(z 0.7408)
2
(z +0.9672)
13
Simulation with reference model and feedforward:
0 20 40 60 80 100 120 140 160 180 200
0
0.5
1
1.5
O
u
t
p
u
t
0 20 40 60 80 100 120 140 160 180 200
5
0
5
10
I
n
p
u
t
Time
Perfect step response according to the model
Unpleasant ringing in the control signal
due to cancellation of poorly damped process zero;
note that u
ff
(k) =
Hm(q)
H(q)
u
c
(k)
14
Modied reference model that includes the process zero:
H
m
(z) =
0.034147(z +0.9672)
(z 0.7408)
2
New feedforward ler:
H
ff
(z) =
H
m
(z)
H(z)
=
9.414(z 0.9512)
2
(z 0.7408)
2
15
Simulation with modied reference model:
0 20 40 60 80 100 120 140 160 180 200
0
0.5
1
1.5
O
u
t
p
u
t
0 20 40 60 80 100 120 140 160 180 200
5
0
5
10
I
n
p
u
t
Time
Ringing eliminated
16
Remark
In the implementation, both u
ff
and y
m
can be generated by a
single dynamical system:
u
c
u
ff
y
m
Model and
feedforward
generator
Matlab:
>> H = ... % define process
>> Hm = ... % define reference model
>> refgen = [Hm/H; Hm] % concatenate systems
>> minreal(ss(refgen)) % make minimal state-space realization
17
Simplistic Setpoint Handling in State Space
Replace u(k) = Lx(k) with
u(k) = L
c
u
c
(k) Lx(k)
The pulse transfer function from u
c
(k) to y(k) is
H(z) = C(zI + L)
1
L
c
= L
c
B(z)
A
m
(z)
In order to have unit static gain (H(1) = 1), L
c
should be
chosen as
L
c
=
1
C(I + L)
1

18
Reference Generation State Space Approach
The model should generate a reference trajectory x
m
for the
process state x (one reference signal per state variable)
The feedforward signal u
ff
should make x follow x
m
Goal: perfect following if there are no disturbances or
model errors
19
Linear reference model:
x
m
(k +1) =
m
x
m
(k) +
m
u
c
(k)
y
m
(k) = C
m
x
m
(k)
Control law:
u(k) = L
_
x
m
(k) x(k)
_
+u
ff
(k)
How to generate model states x
m
that are compatible with
the real states x?
How to generate the feedforward control u
ff
?
20
Design of the Reference Model
Start by choosing the reference model identical to the process
model, i.e.,
x
m
(k +1) = x
m
(k) + u
ff
(k)
y
m
(k) = Cx
m
(k)
Then modify the dynamics of the reference model as desired
using state feedback (within the model)
u
ff
(k) = L
cm
u
c
(k) L
m
x
m
(k)
Gives the reference model dynamics
x
m
(k +1) = ( L
m
)x
m
(k) + L
cm
u
c
(k)
y
m
(k) = Cx
m
(k)
21
u
c
u
ff
x
m
L
cm
Model
L
m

Model and Feedforward Generator


22
Design of the Reference Model
Design choices:
L
m
is chosen to give the model the desired eigenvalues
L
cm
is chosen to give the model the desired static gain
(typically 1)
(The above model will have the same zeros as the plant.
Additional zeros and poles can be added by extending the
model.)
23
Complete State-Space Controller
The complete controller, including state feedback, observer,
and reference generator is given by
x(k +1) = x(k) + u(k) + K(y(k) C x(k)) (Observer)
x
m
(k +1) = x
m
(k) + u
ff
(k) (Reference model)
u(k) = L(x
m
(k) x(k)) +u
ff
(k) (Control signal)
u
ff
(k) = L
m
x
m
(k) + L
cm
u
c
(k) (Feedforward)
24
Design Example: Depth Control of Torpedo

y
State vector:
x =
_

_
q

y
_

_
=
_

_
pitch angular velocity
pitch angle
depth
_

_
Input signal:
u = = rudder angle
25
Torpedo: Continuous-Time Model
Simple model:
dq
dt
= aq + b
d
dt
= q
dy
dt
= V (+ c )
where a = 2, b = 1.3, and V = 5 (speed of torpedo)
x =
_

_
a 0 0
1 0 0
0 V 0
_

_
x +
_

_
b
0
0
_

_
u
y =
_
_
0 0 1
_
_
x
26
Torpedo: Sampled Model
Sample with h = 0.2
x(kh + h) =
_

_
0.67 0 0
0.165 1 0
0.088 1 1
_

_
x(kh) +
_

_
0.214
0.023
0.008
_

_
u(kh)
27
Torpedo: State Feedback
u(k) = Lx(k)
load disturbance rejection
Desired continuous-time dynamic behaviour:
two complex-conjugated poles with relative damping 0.5
and natural frequency
c
one pole in
c
a single parameter decides the dynamics
Desired characteristic polynomial
(s
2
+2 0.5
c
s +
2
c
)(s +
c
) = s
3
+2
c
s
2
+2
2
c
s +
3
c
28
Corresponds in discrete time to
(z
2
+ a
1
z + a
2
) (z e
ch
)
where a
1
= 2e
ch
cos
_
_
1
2

c
h
_
, a
2
= e
2 ch
with
= 0.5
29
Torpedo: State Feedback in Matlab
Matlab code
>> h = 0.2;
>> wc = 1; % speed of state feedback
>> pc = wc*roots([1 2 2 1]); % control poles in cont time
>> pcd = exp(pc*h); % control poles in disc time
>> L = place(Phi, Gam, pcd)
L =
-0.1452 -1.6047 0.1528
30
Torpedo: Observer Design
x(k +1) = x(k) + u(k) + K(y(k) C x(k))
measurement noise rejection + state estimation
Observer Dynamics:
the same pole layout as in the control design
parametrized by
o
instead of
c
typically faster dynamics than the controller, e.g.,
o
= 2
c
Desired continuous-time characteristic polynomial:
(s +
o
)(s
2
+
o
s +
2
o
) = s
3
+2
o
s
2
+2
2
o
s +
3
o
Discrete time characteristic polynomial given from previous
slide
31
Torpedo: Observer Design in Matlab
>> wo = 2; % speed of observer
>> po = wo*roots([1 2 2 1]); % observer poles in cont time
>> pod = exp(po*h); % observer poles in disc time
>> K = place(Phi,C,pod)
K =
0
-0.130
0.460
32
Torpedo: Simplistic Setpoint Handling
Simulation assuming simplistic approach, u(k) = L x(k) + L
c
u
c
(k)
0 2 4 6 8 10 12 14 16 18 20
0
0.5
1
1.5
O
u
t
p
u
t
0 2 4 6 8 10 12 14 16 18 20
0.5
0
0.5
1
I
n
p
u
t
Time
Slow step response with overshoot
33
Torpedo: Model and Feedforward Design
Reference model:
x
m
(k +1) = x
m
(k) + u
ff
(k)
y
m
(k) = Cx
m
(k)
Feedforward:
u
ff
= L
m
x
m
+ l
r
r
Desired characteristic polynomial:
(s +
m
)
3
= s
3
+3
m
s
2
+3
2
m
s +
3
m
(critically damped important!)
Parametrized using
m
Chosen as
m
= 2
c
34
Torpedo: Model and Feedforward Design in
Matlab
Corresponding discrete time characteristic polynomial from
Matlab
>> h = 0.2;
>> wm = 2; % speed of model
>> pm = wm*roots([1 3 3 1]); % model poles in cont time
>> pmd = exp(pm*h); % model poles in disc time
>> Lm = place(Phi,Gam,pmd)
Lm =
1.518 -5.539 1.001
>> Hm = ss(Phi-Gam*Lm,Gam,C,0,h);
>> lcm = 1/dcgain(Hm)
lcm =
1.001
35
Torpedo: Final Controller
0 2 4 6 8 10 12 14 16 18 20
0
0.5
1
1.5
O
u
t
p
u
t
0 2 4 6 8 10 12 14 16 18 20
0.5
0
0.5
1
I
n
p
u
t
Time
Faster step response without overshoot
36
Model states and feedforward signal:
0 2 4 6 8 10 12 14 16 18 20
0.5
0
0.5
1
1.5
0 2 4 6 8 10 12 14 16 18 20
0.5
0
0.5
1
Time
x
m1
x
m2
x
m3
u
ff
The model states and the feedforward signal are not affected
by the load disturbance
Open loop
37
Simulation without the feedforward signal, u(k) = L(x
m
(k) x(k)):
0 2 4 6 8 10 12 14 16 18 20
0
0.5
1
1.5
O
u
t
p
u
t
0 2 4 6 8 10 12 14 16 18 20
0.5
0
0.5
1
I
n
p
u
t
Time
Does not work very well the feedforward term is needed to
get the desired reference step response
38
Simulation without the feedback term, u(k) = u
ff
(k):
0 2 4 6 8 10 12 14 16 18 20
0
0.5
1
1.5
O
u
t
p
u
t
0 2 4 6 8 10 12 14 16 18 20
0.5
0
0.5
1
I
n
p
u
t
Time
Does not work at all the feedback is needed to handle the
load disturbance
39
Nonlinear Reference Generation
Recall the state-space approach to reference generation:
Often, u
ff
and x
m
do not come from linear lters but are the result
of solving an optimization problem, e.g.:
Move a satellite to a given altitude with minimum fuel
Position a mechanical servo in as short time as possible under
a torque constraint
Move the ball on the beam as fast as possible without losing it
40
General Solution
Derive the feedforward (open-loop) control signal u
ff
that
solves the optimization problem
Course in Nonlinear Control (FRTN05, Lp Vt 2)
The model state trajectories are generated by solving
dx
m
dt
= Ax
m
+ Bu
ff
41
Example: Time-Optimal Control of Ball on Beam
State vector:
_

_
x
v

_
=
_

_
ball position
ball velocity
beam angle
_

_
Continuous-time state-space model:
dx
dt
= v
dv
dt
= k
v
(k
v
10)
d
dt
= k

u (k

4.5)
42
Optimization problem: Assume steady state. Move the ball
from start position x(0) = x
0
to nal position x(t
f
) = x
f
in
minimum time while respecting the control signal constraints
u
max
u(t) u
max
Optimal control theory gives the optimal open-loop control law
u
ff
(t) =
_

_
u
0
, 0 t < T
u
0
, T t < 3T
u
0
, 3T t < 4T
where
u
0
= sgn(x
f
x
0
)u
max
T =
3

x
f
x
0

2k

k
v
u
max
t
f
= 4T 43
Example: u
max
= 1, x
0
= 0, and x
f
= 5 t
f
= 1.538
Optimal control signal:
0 0.5 1 1.5
2
1
0
1
2
u
f
f
t
(bang-bang control)
44
Solving
dm
dt
= k

u
ff
gives the optimal beam angle trajectory

m
(t) =
_

_
k

u
0
t, 0 t < T
k

u
0
(t2T), T t < 3T
k

u
0
(t4T), 3T t 4T
0 0.5 1 1.5
2
1
0
1
2

m
t
45
Solving
dvm
dt
= k
v

m
gives the optimal ball velocity trajectory
v
m
(t) =
_

_
k

k
v
u
0
t
2
/2, 0 t < T
k

k
v
u
0
(t
2
/22Tt+T
2
), T t < 3T
k

k
v
u
0
(t
2
/24Tt+8T
2
), 3T t 4T
0 0.5 1 1.5
0
1
2
3
4
5
6
7
v
m
t
46
Finally, solving
dxm
dt
= v
m
gives the optimal ball position trajectory
x
m
(t) =
_

_
x
0
+ k

k
v
u
0
t
3
/6, 0 t < T
x
0
k

k
v
u
0
(t
3
/6Tt
2
+T
2
tT
3
/3), T t < 3T
x
0
+ k

k
v
u
0
(t
3
/62Tt
2
+8T
2
t26T
3
/3), 3T t 4T
0 0.5 1 1.5
0
1
2
3
4
5
x
m
t
47
Lectures 9 and 10: Summary
Regulator problem reduce impact of load disturbances
and measurement noise
Inputoutput approach: design of feedback controller
H
fb
(z), e.g. PID controller
State space approach: design of state feedback and
observer, including disturbance estimator
Servo problem - make the output follow the setpoint in the
desired way
Inputoutput approach: design of model reference
H
m
(z) and feedforward lter H
ff
(z)
State space approach: design of combined reference
and feedforward generator
Linear or nonlinear reference generation
48

You might also like