Académique Documents
Professionnel Documents
Culture Documents
1
2
Textbook Algorithm:
t
• The oldest controller type u(t) = K ( e(t) + 1
e(τ )dτ + TD dedt(t) )
TI
• The most widely used
– Pulp & Paper 86%
– Steel 93% U (s) = K ( E(s) + 1
E(s) + TD sE(s))
sTI
– Oil refineries 93%
• Much to learn!!
= P + I + D
3 4
Proportional
u
Term Properties of P-Control
Set point and measured variable
1.5
umax Kc=5
1
u0 Kc=2
0.5
Kc=1
umin 0
e 0 5 10 15 20
– e0 e0
6 Control variable
Proportionalband 4 Kc=5
2
Kc=2
⎧ 0 Kc=1
⎪
⎪umax e > e0 −2
⎨
0 5 10 15 20
u = K e + u0 − e0 < e < e0
⎪
⎪
⎩
umin e < − e0
• stationary error
• increased K means faster speed, increased noise sensitiv-
ity, worse stability
5 6
Errors with P-control Integral Term
Control signal:
u = K e + u0
u = K e + u0
Error:
u − u0 1
u = K e+ e(t)dt (PI)
e= Ti
K e
1 1.5
Ti=1
Ti=2
ub 1+sT i 1
Ti=5
0.5
Kc e u Ti=∞
Σ 0
0 5 10 15 20
Control variable
2 Ti=1
1
U = KE+ U Ti=2
1 + sTi 1
Ti=5
1 1 + sTi − 1 sTi
(1 − )U = U=
Ti=∞
U 0
1 + sTi 1 + sTi 1 + sti 0 5 10 15 20
1
U = K (1 + )E
sTi
• removes stationary error
• smaller TI implies worse stability, faster steady-state error
9 10
removal
Reglerfel
de(t)
e(t) + Td
dt
P:
I I u(t) = K e(t)
P P PD:
de(t)
t tid t tid u(t) = K e(t) + Td K e(t + Td )
dt
Td = Prediction horizon
11 12
Properties of PD-Control Outline
Set point and measured variable
Td=0.1
1
Td=0.5
0.5
Td=2
• The basic algorithm
0
0 5 10 15 20
• Algorithm modifications
6 Control variable
Td=0.1 • Discretization
4 Td=0.5
• Mode handling
Td=2
2
−2
• Code
0 5 10 15 20
13 14
• Limitations of derivative gain We do not want to apply derivation to high frequency measure-
• Derivative weighting ment noise, therefore the following modification is used:
• Setpoint weighting
sTD
sTD
1 + sTD / N
N = maximum derivative gain, often 10 − 20
15 16
17 18
Setpoint weighting How to introduce the reference: PID
Z
1 d
u = K (β ysp − y + ( ysp − y)dτ + TD (γ ysp − y)) =
TI dt
1.5 Set point and measured variable Z
1 de
beta=1 K (e + edτ + TD )+
TI dt
1
dy
K (β − 1) ysp + TD K (γ − 1) sp
0.5
beta=0.5
beta=0
dt
K1 K2
0
0 20 40 60 K1 ysp + K2 d ysp /dt
3 Control variable ysp y
+ PID + GP
−
2
beta=1
beta=0.5
1
beta=0 Feedforward + Feedback
0
0 20 40 60
19 20
21 22
When the control signal saturates the integral part will integrate up
• conditional integration (integration is switched off when the
control is far from the steady-state)
to a very large value. This may cause large overshoots.
2 Output y and yref
1.5
• tracking (back-calculation)
1
0.5
0
0 10 20
Control variable u
0.2
−0.2
0 10 20
23 24
Tracking Tracking
–y
KTds
saturation limit
K – +
Σ 1 Σ
• to avoid resetting the integral due to, e.g., measurement Ti s
es
noise, the re-computation is done dynamically, i.e., through 1
Tt
a LP-filter with a time constant Tr .
–y
KT d s
Actuator
model Actuator
e = r− y
K Σ
K 1 – +
Ti
Σ Σ
s
1 es
Tt
25 26
Tracking Outline
−0.4
−0.8
0 10 20 30
27 28
Discretization Discretization
I-part:
t
K dI K
I ( t) = e(τ )dτ , = e
TI dt TI
0
31 32
Discretization Outline
33 34
• changing parameters +
−
1
Σ
1
Tm s
• changing between different controllers
y sp
PD
Changing operating mode y
M
e K 1 u
Key Issue: Make sure that the controller states have the correct Ti
Σ s Σ
A
values, i.e., the same values before and after the change – +
Σ
1
Tt
35 36
Bumpless parameter changes Bumpless parameter changes
or
v := P + (K/Ti)*I + D;
I := I + h*e;
Process
Controller2 Switch
• The basic algorithm
• Algorithm modifications
• Discretization
Similar to changing between manual and auto • Mode handling
Let the controllers run in parallel • Code
Let the controller that is not active track the one that is active.
Alternatively, execute only the active controller and initialize the
new controller to its correct value when switching (saves CPU-
time)
39 40
43 44
public Regul() {
pid = new SimplePID(1,10,0,1,10,5,0.1);
}
while (true) {
y = getY();
yref = getYref():
u = pid.calculateOutput(yref,y);
u = limit(u);
setU(u);
pid.updateState(u);
// Timing Code
}
}
}
45