lecture 7: pid tuning 1. objectives describe and use the two methods of ziegler-nichols to tune pid...
Post on 23-Dec-2015
242 Views
Preview:
TRANSCRIPT
Lecture 7:
PID Tuning
1
Objectives
• Describe and use the two methods of Ziegler-Nichols to tune PID controllers.
• Use the process reaction curve (step response) to fit a FOPDT model to the system.
• List some guidelines to design and implement a good step experiment.
2
PID TUNING
• How do we apply the same equation to many processes?• How to achieve the dynamic performance that we desire?
TUNING!!!
t
dI
c dt
CVddtteteKtu
0
')'(
1)()(
The adjustable parameters are called tuning constants. We can match the values to the process to affect the dynamic performance 3
PID TUNING
Trial 1: unstable, lost $25,000
0 20 40 60 80 100 120-40
-20
0
20
40S-LOOP plots deviation variables (IAE = 608.1005)
Time
Con
tro
lled
Var
iabl
e
0 20 40 60 80 100 120-100
-50
0
50
100
Time
Man
ipul
ated
Va
riabl
e
Trial 2: too slow, lost $3,000
0 20 40 60 80 100 1200
0.2
0.4
0.6
0.8
1S-LOOP plots deviation variables (IAE = 23.0904)
Time
Con
tro
lled
Var
iabl
e
0 20 40 60 80 100 1200
0.2
0.4
0.6
0.8
1
Time
Man
ipul
ated
Va
riabl
e
0 20 40 60 80 100 1200
0.5
1
1.5S-LOOP plots deviation variables (IAE = 9.7189)
Time
Con
tro
lled
Var
iabl
e
0 20 40 60 80 100 1200
0.5
1
1.5
Time
Man
ipul
ated
Va
riabl
e
Trial n: OK, finally, but took way too long!!
Is there an easier way than
trial & error?
4
Ziegler Nichols’ First method
When to use the first method?
The first method is applicable for processes whose “process reaction curve” (open-loop step response) is “S-shaped”.
DYNAMIC SIMULATION
Time
0 5 10 15 20 25 30 35 40 45 50-0.5
0
0.5
1
1.5
Time
Con
trol
led
Var
iabl
e
0 5 10 15 20 25 30 35 40 45 500
0.2
0.4
0.6
0.8
1
Man
ipul
ated
Var
iabl
e
S-shaped
5
EMPIRICAL MODEL BUILDING PROCEDURE
Process reaction curve - The simplest and most often used method. Gives nice visual interpretation as well.
1. Start at steady state
2. Single step to input
3. Collect data until steady state
4. Perform calculations
T
6
Ziegler Nichols’ First method
How to use the first method?• Apply a step input to the process (open-loop).• Record the process reaction curve.• Fit a FOPDT model to the “process reaction curve”.
7
1
s
Ke
U
YG
Ls
PRC
Ziegler Nichols tuning rules
• With the aid of the following table find the controller parameter corresponding to the FOPDT model obtained.
8
1
s
Ke
U
YG
Ls
PRC
sT
sTKsG d
ipc
11)(
How to fit a FOPDT model to the process reaction curve?
9
EMPIRICAL MODEL BUILDING PROCEDURE
-5
5
15
25
35
45 in
pu
t v
ari
ab
le i
n d
ev
iati
on
(%
op
en
)
-5
-1
3
7
11
15
ou
tpu
t v
ari
ab
le i
n d
ev
iati
on
(K
)
0 10 20 30 40 time (min)
Process reaction curve - Method I
S = maximum slope
L
igureshown in fL
S
K
/
/
Data is plotted in deviation variables
10
EMPIRICAL MODEL BUILDING PROCEDURE
-5
5
15
25
35
45 in
pu
t v
ari
ab
le i
n d
ev
iati
on
(%
op
en
)
-5
-1
3
7
11
15
ou
tpu
t v
ari
ab
le i
n d
ev
iati
on
(K
)
0 10 20 30 40 time (min)
Process reaction curve - Method II
%63
%28%63 )( 5.1
/
tL
tt
K
0.63
0.28
t63%t28%
Data is plotted in deviation variables
11
Recommended
EMPIRICAL MODEL BUILDING PROCEDURE
Process reaction curve - Methods I and II
The same experiment in either method!
Method I
• Prone to errors because of evaluation of maximum slope
Method II
• Simple calculations
12
Notes on experiment design
13
EMPIRICAL MODEL BUILDING PROCEDURE
Process reaction curve
-5
5
15
25
35
45
inp
ut
va
ria
ble
in
de
via
tio
n (
% o
pe
n)
-5
-1
3
7
11
15
ou
tpu
t v
ari
ab
le i
n d
ev
iati
on
(K
)
0 10 20 30 40 time (min)
Is this a well designed experiment?
Input should be close to a perfect step; this was basis of equations. If not, cannot use data for process reaction curve.
14
EMPIRICAL MODEL BUILDING PROCEDURE
-5
5
15
25
35
45
inp
ut
va
ria
ble
, %
op
en
-5
-1
3
7
11
15
ou
tpu
t v
ari
ab
le,
de
gre
es
C
0 10 20 30 40 time
Process reaction curve
Should we use this data?
The output must be “moved” enough. Rule of thumb:
Signal/noise > 5
15
EMPIRICAL MODEL BUILDING PROCEDURE
Process reaction curve
-5
5
15
25
35
45
inp
ut
va
ria
ble
, %
op
en
-5
-1
3
7
11
15
ou
tpu
t v
ari
ab
le,
de
gre
es
C
0 10 20 30 40 time
Plot measured vs predicted
measured
predicted
16
Example
Let us apply ZN first method to the following process
1) Approximate the process with a FOPDT model using the two-points method.
2) Find the PID controller parameters recommended by ZN’s first method.
17
)2)(1(
1)(
sssG
Answer • The step response of the given process is given by
• Using partial fractions
• Hence the time domain step response is given by
• Which has a steady state value of 0.5. • Therefore, we need to find the time at which the response becomes
approximately 0.14 and 0.31 (28% and 63%, respectively) 18
ssssY
1.
)2)(1(
1)(
2
5.0
1
15.0)(
ssssY
tt eety 25.05.0)(
Answer, continued • We can write the following equations:
• Which can be rewritten as (where we defined A = e-t1 and B = e-t2 )
• These are simple quadratic equations which can be solved to give
19
22
11
22
21
5.05.0315.0)(
5.05.014.0)(tt
tt
eety
eety
037.02037.02
072.02072.0222
22
22
11
BBee
AAeett
tt
56.121.0
75.047.0
%632
%281
ttB
ttA
Answer, continued
Applying a step input and recording the process reaction curve gives:
t28% = 0.75 sec,
t63% = 1.58 sec.
20
Answer, continued
• The FOPDT parameters are then:
• Then, the controller parameters are obtained as
34.0
24.1)( 5.1
5.0/
%63
%28%63
tL
tt
K
17.0
68.0
75.8
d
i
p
T
T
K
21
Ziegler Nichols’ 2nd method (Ultimate-Cycle Method)
While the first Ziegler-Nichols method is used in open-loop configuration, the second method is used in closed-loop.
When to use the 2nd method?
• If the process is open loop unstable, or,• If it is stable but does not give S-shaped step response.
22
Procedure of ZN 2nd method
1. Put the process under closed-loop control (Use only a proportional controller).
2. Create a small disturbance in the loop by changing the set point.
3. Adjust the proportional gain, increasing and/or decreasing, until the oscillations have constant amplitude.
4. Record the gain value (Kcu) and period of oscillation (Tu).
5. Use the table to find the controller parameters.
23
The sustained oscillation
24
Example
Let us apply ZN’s 2nd method to the following process
1) Find the ultimate gain and period.
2) Find the PID controller parameters recommended by ZN’s second method.
Then use MATLAB to plot the step set-point and disturbance responses of the closed loop system using the designed PID controller.
25
2)12(
1)(
sssG
• Using proportional controller Kc, the characteristic equation of the closed-loop system is
Writing the Routh array:
The system is stable if Kc < 1. So, the ultimate gain Kcu =1.
c
c
c
Ks
Ks
Ks
s
0
1
2
3
1
4
14
Answer
26
044
0)12(
0)12(
11
23
2
2
c
c
c
Ksss
Kss
ssK
Answer, continued
• When Kc = 1, Routh array becomes
The third row is zero. So, the auxiliary equation obtained from the second row is
27.sec56.12
2rad/sec5.0
5.0
equationauxiliary thesolvingby
014 2
uu
TT
js
s
1
0
14
14
0
1
2
3
s
s
s
s
The sustained oscillation 28
• Using the ZN 2nd method, the PID controller parameters are calculated as:
57.1
28.6
6.0
D
I
cK
29
Another method to find the ultimate gain, Kcu
Using the root locus method
30
syms ss=tf('s');G=1/(s*(2*s+1)^2);rlocus(G)
The open loop response:
31
The closed-loop set-point step response
32
The closed-loop disturbance step response
33
close all
% Simulate
t=0:0.01:70;
s=tf('s');
G = 1/(s*(2*s+1)^2);
figure(1)
step(G,t)
% The FOPDT parameters
Ku = 1; Pu = 12.54;
% The PID parameters using ZN first method
Kc = 0.6*Ku; tauI = 0.5*Pu; tauD = 0.125*Pu;
KI=Kc/tauI; KD=Kc*tauD;
Gc = pid(Kc,KI,KD,0.01);
% Set point step response
cloop = Gc*G/(1+Gc*G);
figure(2)
step(cloop,t)
% Disturbance step response
cloop_dist = G/(1+Gc*G);
figure(3)
step(cloop_dist,t)34
MALAB code for this example
Comments on ZN tuning rules
• It is realized that the responses are oscillatory.
• Generally, Ziegler-Nichols tuning is not the best tuning method.
• However, these two guys were real pioneers in the field! It has taken 50 years to surpass their guidelines.
35
top related