Professional Documents
Culture Documents
Typical scenario:
d Assume
B(z) A(z)
−Hff H(z) = ⇒ H −1 (z) =
A(z) B(z)
Potential problems:
uc u y • Inverse not causal if pole excess d = deg A − deg B ≥ 1
Σ Hfb Σ H p1 Σ H p2
• Inverse not stable if B(z) has zeros outside unit circle
Hff (z) = Hp−1 (z) • B ∗− (z) - the mirror in the unit circle of the zeros outside the unit
1
2 circle 3
Let
6(1 − s)
G(s) =
(s + 2)(s + 3) Regulation problems: compromise between rejection of load
ZOH sampling with h = 0.1 gives disturbances and injection of measurement noise
6 7
uc ũc
Hf (z) y
Hfb Σ Hp
Z
A 2-DOF controller can be represented in many different ways, e.g.: 1 d
u = K βysp − y + (ysp − y)dτ + TD (γysp − y)
TI dt
Z
1 de
=K e+ e dτ + TD
TI dt
dysp
+ K(β − 1) ysp + TD K(γ − 1)
| {z } | {z } dt
K1 K2
10 11
Reference Generation – Input–Output Approach Reference Generation – Input–Output Approach
−1 Then
Hp ( H
Hp + Hc Hm )
m
H= = Hm
1 + Hp Hc
• Hm – model that describes the desired setpoint response
• Hff – feedforward generator that makes y follow ym Perfect model following!
• Goal: perfect following if there are no disturbances or model errors
12 13
Hm
In order for Hff = to be implementable (causal and stable),
Hp
Process:
• Hm must have at least the same pole excess as Hp 3
Gp (s) =
• any zeros of Hp outside unit circle must also be included in Hm (1 + 60s)2
ZOH-sampled process (h = 3):
In practice, also poorly damped zeros of Hp (e.g., outside the
heart-shaped region below) should be included in Hm 0.003627(z + 0.9672)
Hp (z) =
(z − 0.9512)2
1
ζ=0
0.2 PID controller tuned for good regulation performance:
0.4
0.5
0.6
0.8 1 sTd
Gc (s) = K 1 + +
0 1 sTi 1 + sTd /N
−1
Example: PID Control of the Double Tank Example: PID Control of the Double Tank
Gm (s) =
0.5 (1 + 10s)2
0
0 20 40 60 80 100 120 140 160 180 200
Sampled reference model:
40 0.036936(z + 0.8187)
Hm (z) =
20 (z − 0.7408)2
Input
0
Feedforward filter:
−20
0 20 40 60 80 100 120 140 160 180 200 Hm (z) 10.1828(z + 0.8187)(z − 0.9512)2
Time Hff (z) = =
Hp (z) (z − 0.7408)2(z + 0.9672)
• Load disturbance at time 100 regulated as desired
• Too large control signal at time 0 and overshoot in the step response
16 17
Example: PID Control of the Double Tank Example: PID Control of the Double Tank
1
Output
0 0.034147(z + 0.9672)
0 20 40 60 80 100 120 140 160 180 200 Hm (z) =
(z − 0.7408)2
10
uff
0.5
uc Model and
0 feedforward ym
0 20 40 60 80 100 120 140 160 180 200
generator
10
5 Matlab:
Input
0
>> Hp = ... % define process
−5
0 20 40 60 80 100 120 140 160 180 200 >> Hm = ... % define reference model
Time
>> refgen = [Hm/Hp; Hm] % concatenate systems
>> minreal(ss(refgen)) % make minimal state-space realization
• Very similar step response
• Ringing in control signal eliminated
20 21
Simplistic Setpoint Handling in State Space Reference Generation – State Space Approach
In order to have unit static gain (Hyuc (1) = 1), Lc should be chosen as The model should generate a reference trajectory xm for the process
1 state x (one reference signal per state variable)
Lc =
C(I − Φ + ΓL)−1 Γ The feedforward signal uff should make x follow xm
22 23
Reference Generation – State Space Approach Design of the Reference Model
Linear reference model: Start by choosing the reference model identical to the process model, i.e.,
Control law: Then modify the dynamics of the reference model as desired using state
feedback (“within the model”)
u(k) = L xm (k) − x̂(k) + uff (k)
uff (k) = Lc uc (k) − Lm xm (k)
24 25
xm Remark: The reference model will have the same zeros as the process,
−Lm so there is no risk of cancelling poorly damped or unstable zeros
Additional zeros and poles can be added by extending the model
26 27
x̂(k + 1) = Φx̂(k) + Γu(k) + K(y(k) − C x̂(k)) (Observer) The computational delay can be further minimized
xm (k + 1) = Φxm (k) + Γuff (k) (Reference model) 1 y = ReadInput();
2 u_c = getCommandSignal();
u(k) = L(xm (k) − x̂(k)) + uff (k) (Control signal) 3 u_ff = u_ff_temp + Lc*u_c;
4 u = u_temp + u_ff;
uff (k) = −Lm xm (k) + Lc uc (k) (Feedforward)
5 WriteOutput(u);
6 x_m = Phi*x_m + Gamma*u_ff;
7 x_hat = Phi*x_hat + Gamma*u + K*(y - c*x_hat);
8 u_ff_temp = -Lm*x_m;
9 u_temp = L*(x_m - x_hat);
28 29
Design Example: Depth Control of Torpedo Torpedo: Continuous-Time Model
Simple model:
y dq
= aq + bδ
dt
dθ
θ =q
dt
δ dy
= −V θ (+ cδ)
State vector: dt
q pitch angular velocity where a = −2, b = −1.3, and V = 5 (speed of torpedo)
x=
θ
=
pitch angle
a 0 0 b
y depth
ẋ =
1 0 0
x +
0
u
Input signal: 0 −V 0 0
u = δ = rudder angle y = 0 0 1x
30 31
• x̂(k + 1) = Φx̂(k) + Γu(k) + K y(k) − C x̂(k)
• state estimation + measurent noise rejection
Matlab:
Observer Dynamics:
>> wc = 1; % speed of state feedback • the same pole layout as in the state feedback design
>> pc = wc*roots([1 2 2 1]); % control poles in cont time
• parametrized by ωo instead of ωc
>> pcd = exp(pc*h); % control poles in disc time
>> L = place(Phi, Gam, pcd) • typically faster dynamics than the state feedback, e.g., ωo = 2ωc
L = Desired continuous-time characteristic polynomial:
-0.145 -1.605 0.153
(s2 + ωo s + ωo2 )(s + ωo ) = s3 + 2ωo s2 + 2ωo2 s + ωo3
34 35
Torpedo: Observer Design in Matlab Torpedo: Simplistic Setpoint Handling
Output
>> po = wo*roots([1 2 2 1]); % observer poles in cont time 0.5
>> pod = exp(po*h); % observer poles in disc time
0
>> K = place(Phi',C',pod)' 0 2 4 6 8 10 12 14 16 18 20
K = 1
0 0.5
Input
-0.130
0
0.460
−0.5
0 2 4 6 8 10 12 14 16 18 20
Time
36 37
Torpedo: Reference Model and Feedforward Design Torpedo: Reference Model and Feedforward in Matlab
Reference model:
38 39
1 1
Output
0.5 0.5
Input
uff
0 0
−0.5 −0.5
0 2 4 6 8 10 12 14 16 18 20 0 2 4 6 8 10 12 14 16 18 20
Time Time
• Faster step response without overshoot • The model states and the feedforward signal are not affected by the
load disturbance
• Open loop
40 41
Torpedo: Final Controller without Feedforward Torpedo: Final Controller without Feedback
Simulation without the feedforward signal, u(k) = L(xm (k) − x̂(k)): Simulation without the feedback signal, u(k) = uff (k):
1.5 1.5
1 1
Output
Output
0.5 0.5
0 0
0 2 4 6 8 10 12 14 16 18 20 0 2 4 6 8 10 12 14 16 18 20
1 1
0.5 0.5
Input
Input
0 0
−0.5 −0.5
0 2 4 6 8 10 12 14 16 18 20 0 2 4 6 8 10 12 14 16 18 20
Time Time
• Does not work very well – the feedforward term is needed to get the • Does not work – the feedback term is needed to stabilize the process
desired setpoint response and handle the load disturbance
42 43
Example: Time-Optimal Control of Ball on Beam Example: Time-Optimal Control of Ball on Beam
Optimization problem: Assume steady state. Move the ball from start
position z(0) = z0 to final position z(tf ) = zf in minimum time while
respecting the control signal constraints
−umax ≤ u(t) ≤ umax
Solving
dφm
dt = kφ uff
Assume umax = 1, z0 = 0, and zf = 5 ⇒ tf = 1.538
gives the optimal beam angle trajectory
Optimal control signal:
−kφ u0 t, 0≤t<T
2
φm (t) = −kφ u0 (t−2T ), T ≤ t < 3T
1
−k u (t−4T ),
φ 0 3T ≤ t ≤ 4T
uff
0
2
−1
1
−2
0 0.5 1 1.5
φm
t 0
(“bang-bang” control) −1
−2
0 0.5 1 1.5
48 t 49
Example: Time-Optimal Control of Ball on Beam Example: Time-Optimal Control of Ball on Beam
7 5
6
4
5
4 3
vm
zm
3 2
2
1
1
0 0
Using the Time-Optimal Feedforward Generator in a Cascade Lectures 9 and 10: Summary
Control Structure
52 53