Lecture 7: PID Tuning 1. Objectives Describe and use the two methods of Ziegler-Nichols to tune PID...
-
Upload
rachel-terry -
Category
Documents
-
view
237 -
download
2
Transcript of Lecture 7: PID Tuning 1. Objectives Describe and use the two methods of Ziegler-Nichols to tune PID...
![Page 1: 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.](https://reader036.fdocuments.in/reader036/viewer/2022081503/56649d9f5503460f94a89a29/html5/thumbnails/1.jpg)
Lecture 7:
PID Tuning
1
![Page 2: 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.](https://reader036.fdocuments.in/reader036/viewer/2022081503/56649d9f5503460f94a89a29/html5/thumbnails/2.jpg)
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
![Page 3: 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.](https://reader036.fdocuments.in/reader036/viewer/2022081503/56649d9f5503460f94a89a29/html5/thumbnails/3.jpg)
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
![Page 4: 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.](https://reader036.fdocuments.in/reader036/viewer/2022081503/56649d9f5503460f94a89a29/html5/thumbnails/4.jpg)
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
![Page 5: 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.](https://reader036.fdocuments.in/reader036/viewer/2022081503/56649d9f5503460f94a89a29/html5/thumbnails/5.jpg)
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
![Page 6: 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.](https://reader036.fdocuments.in/reader036/viewer/2022081503/56649d9f5503460f94a89a29/html5/thumbnails/6.jpg)
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
![Page 7: 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.](https://reader036.fdocuments.in/reader036/viewer/2022081503/56649d9f5503460f94a89a29/html5/thumbnails/7.jpg)
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
![Page 8: 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.](https://reader036.fdocuments.in/reader036/viewer/2022081503/56649d9f5503460f94a89a29/html5/thumbnails/8.jpg)
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)(
![Page 9: 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.](https://reader036.fdocuments.in/reader036/viewer/2022081503/56649d9f5503460f94a89a29/html5/thumbnails/9.jpg)
How to fit a FOPDT model to the process reaction curve?
9
![Page 10: 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.](https://reader036.fdocuments.in/reader036/viewer/2022081503/56649d9f5503460f94a89a29/html5/thumbnails/10.jpg)
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
![Page 11: 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.](https://reader036.fdocuments.in/reader036/viewer/2022081503/56649d9f5503460f94a89a29/html5/thumbnails/11.jpg)
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
![Page 12: 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.](https://reader036.fdocuments.in/reader036/viewer/2022081503/56649d9f5503460f94a89a29/html5/thumbnails/12.jpg)
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
![Page 13: 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.](https://reader036.fdocuments.in/reader036/viewer/2022081503/56649d9f5503460f94a89a29/html5/thumbnails/13.jpg)
Notes on experiment design
13
![Page 14: 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.](https://reader036.fdocuments.in/reader036/viewer/2022081503/56649d9f5503460f94a89a29/html5/thumbnails/14.jpg)
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
![Page 15: 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.](https://reader036.fdocuments.in/reader036/viewer/2022081503/56649d9f5503460f94a89a29/html5/thumbnails/15.jpg)
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
![Page 16: 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.](https://reader036.fdocuments.in/reader036/viewer/2022081503/56649d9f5503460f94a89a29/html5/thumbnails/16.jpg)
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
![Page 17: 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.](https://reader036.fdocuments.in/reader036/viewer/2022081503/56649d9f5503460f94a89a29/html5/thumbnails/17.jpg)
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
![Page 18: 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.](https://reader036.fdocuments.in/reader036/viewer/2022081503/56649d9f5503460f94a89a29/html5/thumbnails/18.jpg)
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)(
![Page 19: 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.](https://reader036.fdocuments.in/reader036/viewer/2022081503/56649d9f5503460f94a89a29/html5/thumbnails/19.jpg)
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
![Page 20: 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.](https://reader036.fdocuments.in/reader036/viewer/2022081503/56649d9f5503460f94a89a29/html5/thumbnails/20.jpg)
Answer, continued
Applying a step input and recording the process reaction curve gives:
t28% = 0.75 sec,
t63% = 1.58 sec.
20
![Page 21: 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.](https://reader036.fdocuments.in/reader036/viewer/2022081503/56649d9f5503460f94a89a29/html5/thumbnails/21.jpg)
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
![Page 22: 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.](https://reader036.fdocuments.in/reader036/viewer/2022081503/56649d9f5503460f94a89a29/html5/thumbnails/22.jpg)
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
![Page 23: 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.](https://reader036.fdocuments.in/reader036/viewer/2022081503/56649d9f5503460f94a89a29/html5/thumbnails/23.jpg)
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
![Page 24: 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.](https://reader036.fdocuments.in/reader036/viewer/2022081503/56649d9f5503460f94a89a29/html5/thumbnails/24.jpg)
The sustained oscillation
24
![Page 25: 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.](https://reader036.fdocuments.in/reader036/viewer/2022081503/56649d9f5503460f94a89a29/html5/thumbnails/25.jpg)
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
![Page 26: 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.](https://reader036.fdocuments.in/reader036/viewer/2022081503/56649d9f5503460f94a89a29/html5/thumbnails/26.jpg)
• 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
![Page 27: 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.](https://reader036.fdocuments.in/reader036/viewer/2022081503/56649d9f5503460f94a89a29/html5/thumbnails/27.jpg)
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
![Page 28: 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.](https://reader036.fdocuments.in/reader036/viewer/2022081503/56649d9f5503460f94a89a29/html5/thumbnails/28.jpg)
The sustained oscillation 28
![Page 29: 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.](https://reader036.fdocuments.in/reader036/viewer/2022081503/56649d9f5503460f94a89a29/html5/thumbnails/29.jpg)
• Using the ZN 2nd method, the PID controller parameters are calculated as:
57.1
28.6
6.0
D
I
cK
29
![Page 30: 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.](https://reader036.fdocuments.in/reader036/viewer/2022081503/56649d9f5503460f94a89a29/html5/thumbnails/30.jpg)
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)
![Page 31: 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.](https://reader036.fdocuments.in/reader036/viewer/2022081503/56649d9f5503460f94a89a29/html5/thumbnails/31.jpg)
The open loop response:
31
![Page 32: 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.](https://reader036.fdocuments.in/reader036/viewer/2022081503/56649d9f5503460f94a89a29/html5/thumbnails/32.jpg)
The closed-loop set-point step response
32
![Page 33: 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.](https://reader036.fdocuments.in/reader036/viewer/2022081503/56649d9f5503460f94a89a29/html5/thumbnails/33.jpg)
The closed-loop disturbance step response
33
![Page 34: 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.](https://reader036.fdocuments.in/reader036/viewer/2022081503/56649d9f5503460f94a89a29/html5/thumbnails/34.jpg)
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
![Page 35: 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.](https://reader036.fdocuments.in/reader036/viewer/2022081503/56649d9f5503460f94a89a29/html5/thumbnails/35.jpg)
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