Professional Documents
Culture Documents
Part 6 Design and Tuning Methods v3
Part 6 Design and Tuning Methods v3
Gm
From Block Diagram Manipulation, we learn that this system can be simplified as:
𝑌𝑜𝑢𝑡𝑝𝑢𝑡 𝐺𝑐 ∙ 𝐺𝑣 ∙ 𝐺𝑝
=
𝑌𝑠𝑒𝑡𝑝𝑜𝑖𝑛𝑡 1 + 𝐺𝑐 ∙ 𝐺𝑣 ∙ 𝐺𝑝 ∙ 𝐺𝑚
1
Then, we obtain:
𝐾𝑐 clear all GM = wcg =
𝐺𝑂𝐿 = clc
𝑠 2𝑠 + 3 𝑠 + 2 2 close all 19.4372 1.0444
Kc=1;
Set the value of Kc=1 to yield: G1=tf(Kc,[1 0]); PM = wcp =
G2=tf(1,[2 3]);
1 G3=tf(1,[1 2]); 82.0781 0.0830
𝐺𝑂𝐿 = 2 G4=tf(1,[1 2]);
𝑠 2𝑠 + 3 𝑠 + 2 GOL=G1*G2*G3*G4;
[GM,PM,wcg,wcp]=margin(GOL)
1 𝑁
PID form in SIMULINK: 𝑃 + 𝐼 + 𝐷 1
𝑠 1+𝑁𝑠
1
Our standard PID: 𝐾𝐶 1 + + 𝑇𝐷 𝑠
𝑇𝐼 𝑠
Kc
Kc/TI
Ziegler-Nichols Ultimate Cycle
Simulation result:
• The simulation result shows that ZN parameters gave rather strong oscillation both during set
point change (servo mechanism) and disturbance rejection. In some cases, this oscillation is not
permissible.
• Many improvements have been made since 1942. There are hundreds of tuning correlations
available in literature. Some of them will be discussed here.
Tuning Method 2: Process Reaction
Curve
Process Reaction Curve
Example: Let us analyze a high order transfer function system as follows:
𝐾𝑝 ∙ 𝑒 −𝑡𝑑𝑠
𝐺𝑃 =
𝜏𝑠 + 1
Process Reaction Curve
Approximation of First Order Plus Time Delay Model (FOPTF) Method 1
Let’s modify our transfer function as follows:
5
𝐺(𝑠) =
2𝑠 + 3 𝑠 + 2 2
5
𝐺(𝑠) = 2
2 1
3 𝑠+1 ∙ 2 𝑠+1
3 2
5
𝐺(𝑠) = 12
2 1 1
3𝑠 + 1 2𝑠 + 1 2𝑠 + 1
5
𝐺(𝑠) = 2
2 1
3 𝑠+1 ∙ 2 𝑠+1
3 2
5
𝐺(𝑠) = 12
2 1 1
3𝑠 + 1 2𝑠 + 1 2𝑠 + 1
𝑡𝑑 ≈ 𝜏𝑖
𝑖≠1
Hence, the FOPTD model is:
5 − 0.5+0.5 𝑠 5
∙ 𝑒 ∙ 𝑒 −𝑠
𝐺 𝑠 = 12 = 12
2 2
3 𝑠 + 1 3𝑠 + 1
There is also other approximation using SOPTD (Second Order Plus Time Delay)
𝐾𝑝 ∙ 𝑒 −𝑡𝑑 𝑠
𝐺𝑃 =
𝜏1 𝑠 + 1 𝜏2 𝑠 + 1
Process Reaction Curve
Comparison with the initial model:
𝐾𝑝 ∙ 𝑒 −𝑡𝑑 𝑠
𝐺𝑃 =
𝜏𝑠 + 1 Gain
t28%=td+τ/3
t63%=td+τ
Gain=Δoutput/Δinput=0.4167/1=0.4167
τ=3/2*(1.8-1.02)=1.17
td=1.8-1.17=0.63 t63%≈1.80
Thus: t28%≈1.02
0.4167 ∙ 𝑒 −0.63𝑠
𝐺𝑃 =
1.17𝑠 + 1
Process Reaction Curve
Comparison of FOPTD method 2 with original model and FOPTD Method 1:
FOPTD approximation can also be conducted by using Skogestad’s half rule as presented in
Seborg 3rd ed. Chapter 6 Page 100. Similar to previous exercise, the original model is:
5
𝐺(𝑠) = 12
2 1 1
𝑠+1 𝑠+1 𝑠+1
3 2 2
To apply Skogestad’s method, the largest neglected time constant has a value of 0.5.
According to his half rule, half of this value is added to the next largest time constant:
τ=0.67+0.25=0.92.
The other half provides a new time delay. The new total time delay=0.25+0.5=0.75.
The new FOPTD model is:
0.4167 ∙ 𝑒 −0.75𝑠
𝐺(𝑠) =
0.92𝑠 + 1
Process Reaction Curve
Comparison with original model and FOPTD Method 1,2,3:
5
𝐺𝑂𝐿 = 𝐺𝐶 ∙ 2
2𝑠 + 3 𝑠 + 2
𝐾𝑝 ∙ 𝑒 −𝑡𝑑 𝑠
Approximation of GOL with 𝐺𝑃 =
FOPTD Model: 𝜏𝑠 + 1
5
∙ 𝑒 −𝑠 0.4167 ∙ 𝑒 −0.63𝑠 0.4167 ∙ 𝑒 −0.75𝑠
𝐺 𝑠 = 12 𝐺(𝑠) =
2 𝐺𝑃 = 0.92𝑠 + 1
1.17𝑠 + 1
3𝑠 + 1
Method 1 Method 2 Method 3
We can now calculate PID parameters using the table as in previous slide
Process Reaction Curve
Let’s suppose to choose PI Controller with Cohen-Coon Method:
clear all
clc
𝜏 1 close all
𝐾𝐶 𝐾 = 0.9 +
𝑡𝑑 12
td=[1 0.64 0.75];
𝑡 tau=[2/3 1.17 0.92];
30 + 3( 𝜏𝑑 ) K=0.4167;
𝜏𝐼 = 𝑡𝑑 𝑡 KcK=0.9.*tau./td+1/12;
9 + 20( 𝜏𝑑 ) taui=td.*(30+3.*td/tau)/(9+20*(td/tau));
Kc=KcK./K;
P=Kc;
I=Kc./taui;
The ISE magnifies large errors. The resulting controller setting tends to have a high
proportional gain and the system is very underdamped
∞
2. Integral of the absolute error (IAE): 𝐼𝐴𝐸 = න 𝑒 𝑡 𝑑𝑡
0
The IAE simply integrates the absolute value and puts equal weight to large and small
errors.
∞
3. Integral of the time-weighted absolute error (ITAE): 𝐼𝑇𝐴𝐸 = න 𝑡 ∙ 𝑒 𝑡 𝑑𝑡
0
The time-weighting function puts a heavy penalty on errors that persist for long period
of time. The weighting function also helps to derive controller settings that allow for low
settling times.
Minimal Integration of Error
In MATLAB, the value of ISE, IAE and ITAE can be easily computed using:
e=error=Y-Ysp
IAE=trapz(t,abs(e));
ISE=trapz(t,e.^2);
ITAE=trapz(t,t’.*abs(e));
To demonstrate the use of IAE method, we can revisit the previous system and perform
disturbance rejection case. Using Cohen-Coon method, one of the PI suggested were 2.85 and
2.91. We can then perform scanning of PI values and calculate their IAE value. The best parameters
gave the smallest values of IAE.
Minimal Integration of Error
Let us revisit our previous system:
IAE=trapz(tout,abs(simout.Data))
Here is just a simple illustration when we scan the P from 2.5 to 3.5 and I from 2.5
to 3.5. You can use for loop to obtain more rigorous step
P=2.5 3 3.5
I=2.5 … … …
3 … … …
3.5 … … …
Minimal Integration of Error
Here is the illustration for P=2.5 and I=2.5 which gives:
IAE=trapz(tout,abs(simout.Data))
IAE=0.3177
P=2.5 and I=2.5
P=2.5 3 3.5
It is indicative that
I=2.5 0.3177 0.2849 0.2653 P=3.5 and I=2.5 gave
3 0.3479 0.3052 0.2770 the smallest value of
IAE.
3.5 0.3922 0.3380 0.3017
Minimal Integration of Error
clear all
clc
close all
P = linspace(2,8,12);
I = linspace(1,6,10);
IAE=zeros(length(P),length(I));
for i = 1:1:length(P)
for j = 1:1:length(I)
P_exp = P(i);
I_exp = I(j);
%optimasi parameter PI
simout=sim('IAEcomputation');
load('Ydata.mat');
t=ans.Time;
IAEdata=ans.Data;
IAE(i,j)=trapz(t,abs(IAEdata));
end
end
imagesc(I,P,IAE)
grid on
xlabel('I values')
ylabel('P values')
colormap('jet')
colorbar
5
∙ 𝑒 −𝑠
0.4167 ∙ 𝑒−0.63𝑠 0.4167 ∙ 𝑒 −0.75𝑠
𝐺 𝑠 = 12 𝐺𝑃 = 𝐺(𝑠) =
0.92𝑠 + 1
2 1.17𝑠 + 1
3𝑠 + 1
Method 1 Method 2 Method 3
Let us choose all FOPTD method 1,2,3, then we can now calculate P and I parameters
using the ITAE table as in previous slide for load change:
Minimal Integration of Error
P and I tuning using ITAE Method for load change
clear all
clc
close all
a1=0.859;
a2=0.674;
b1=0.977;
b2=0.680;
Kc=a1./K.*(tau./td).^b1;
taui=tau./a2.*(td./tau).^b2;
P=Kc;
I=Kc./taui;
Ysetpoint Km + Gc Gv Gp +
+
Youtput
-
Gm
• In the DS method, the controller design is based on a process model and a desired
closed-loop transfer function.
• The DS approach provides valuable insight into the relationship between the process
model and the resulting controller.
• The DS method does produce PI or PID controller for common process models, as
demonstrated here.
Direct Synthesis (DS) Method
Disturbance Gd
Ysetpoint Km + Gc Gv Gp +
+
Youtput
-
Gm
𝑌𝑜𝑢𝑡𝑝𝑢𝑡 𝐺 ∙ 𝐺𝐶
=
𝑌𝑠𝑒𝑡𝑝𝑜𝑖𝑛𝑡 1 + 𝐺 ∙ 𝐺𝐶
Direct Synthesis (DS) Method
We can rearrange the equation to yield:
𝑌ൗ
1 𝑌𝑠𝑝
𝐺𝐶 =
𝐺 1 − 𝑌ൗ
𝑌 𝑠𝑝
Now, let us introduce the model transfer function of 𝐺෨ (read G tilde) to approximate the
actual process of G. It is common that we don’t know the transfer function of actual
process and we then we can make approximation. In addition, Let us set a
𝑌 𝑌
𝑜𝑟 .Then the controller equation becomes:
𝑌𝑠𝑝 𝑌𝑠𝑝
𝑑𝑒𝑠𝑖𝑟𝑒𝑑 𝑑
𝑌ൗ
1 𝑌𝑠𝑝
𝑑
𝐺𝐶 =
𝐺෨ 1 − 𝑌
ൗ𝑌
𝑠𝑝 𝑑
𝑌
The specification of is the key design decision in DS tuning method. In addition,
𝑌𝑠𝑝
𝑑
1
the inverse of the process model, 𝐺෨ , is also distinguishing characteristic of model based
control.
Direct Synthesis (DS) Method
𝑌
Specification of 𝑌𝑠𝑝
𝑑
For a process without time delays, the first order model is a reasonable choice:
𝑌 1
=
𝑌𝑠𝑝 𝜏𝑐 𝑠 + 1
𝑑
Where 𝜏𝑐 is the desired closed-loop time constant and it is also our tuning
parameter. There is a guideline later on how to choose 𝜏𝑐 . By substitution, we can
obtain:
𝑌ൗ
1 𝑌𝑠𝑝 1 1
𝑑
𝐺𝐶 = = ∙
𝐺෨ 1 − 𝑌 𝐺෨ 𝜏𝑐 𝑠
ൗ𝑌
𝑠𝑝 𝑑
The term 1/𝜏𝑐 𝑠 provides integral control action and thus eliminate offset. Low 𝜏𝑐
makes the controller more aggressive and high 𝜏𝑐 makes the controller less
aggressive.
Direct Synthesis (DS) Method
𝑌
Specification of 𝑌𝑠𝑝
𝑑
For a process with time delays, the FOPTD model is a reasonable choice:
𝑌 𝑒 −𝜃𝑠
=
𝑌𝑠𝑝 𝜏𝑐 𝑠 + 1
𝑑
𝑌
Combining the with controller function as in previous procedure yields:
𝑌𝑠𝑝
𝑑
1 𝑒 −𝜃𝑠
𝐺𝐶 = ∙
𝐺෨ 𝜏𝑐 𝑠 + 1 − 𝑒 −𝜃𝑠
𝑒 −𝜃𝑠 ≈ 1 − θ𝑠
Direct Synthesis (DS) Method
𝑌
Specification of 𝑌𝑠𝑝
𝑑
1 𝑒 −𝜃𝑠 1 𝑒 −𝜃𝑠
Hence, we can obtain: 𝐺𝐶 = ∙ = ∙
෨
𝐺 𝑐𝜏 𝑠 + 1 − 𝑒 −𝜃𝑠 𝐺෨ (𝜏𝑐 + θ)𝑠
Notes:
𝑌
• The Gc above is set for FOPTD model. It is generally true and we will use for
𝑌𝑠𝑝
𝑑
later part when we derive the Gc.
• this controller also contains integral control action.
• it is not necessary to approximate time-delay term in the numerator, because it is
cancelled by the identical term in 𝐺,෨ when the time-delay is known exactly.
So far so good, Ok now let’s move to approximate the process model (𝐺)
෨
Direct Synthesis (DS) Method
Estimation of 𝐺෨ or process model
Let us first assume that the G
෩ = G (perfect model). Next, we consider the common
FOPTD model as our G ෩ as shown below:
𝐾 ∙ 𝑒 −𝜃𝑠
෨
𝐺(𝑠) =
𝜏𝑠 + 1
Here, again θ=td =time delay
𝑌
Rearrangement and substitution to controller transfer function with 𝑌𝑠𝑝
as FOPTD, we
𝑑
obtain:
1 𝑒 −𝜃𝑠 𝜏𝑠+1 𝑒 −𝜃𝑠 1 𝜏𝑠+1 1 𝜏 1 1 𝜏 1
𝐺𝐶 = ∙ = ∙ =𝐾∙ =𝐾 + = 𝐾𝜏 1 + 𝜏𝑠
𝐺෨ 𝜏𝑐 +𝜃 𝑠 𝐾∙𝑒 −𝜃𝑠 𝜏𝑐 +𝜃 𝑠 𝜏𝑐 +𝜃 𝑠 𝜏𝑐 +𝜃 𝜏𝑐 +𝜃 𝑠 𝑐 +𝜃
1
Now, let us compare with standard PI controller transfer function as: 𝐺𝐶 = 𝐾𝑐 (1 + )
𝜏𝐼 𝑠
Then, it is easy to see that:
1 𝜏
𝐾𝐶 = and 𝜏𝐼 = τ
𝐾 𝜏𝑐 + 𝜃
Direct Synthesis (DS) Method
Estimation of 𝐺෨ or process model
Now let’s suppose that we approximate our model with second order plus time delay
model (SOPTD) model:
𝐾 ∙ 𝑒 −𝜃𝑠
෨
𝐺(𝑠) =
𝜏1 𝑠 + 1 𝜏2 𝑠 + 1
Here, again θ=td =time delay
Rearrangement and substitution to controller transfer function as previous
procedure can obtain a standard PID transfer function as:
1
𝐺𝐶 = 𝐾𝑐 (1 + + 𝜏𝐷 𝑠)
𝜏𝐼 𝑠
To speed up the explanation and skip the math procedure, we can finally arrive at the
final form:
1 𝜏1 + 𝜏2 𝜏1 𝜏2
𝐾𝐶 = and 𝜏𝐼 = 𝜏1 + 𝜏2 and 𝜏𝐷 =
𝜏1 + 𝜏2
𝐾 𝜏𝑐 + 𝜃
Direct Synthesis (DS) Method
Estimation of 𝐺෨ or process model
Now let’s suppose that we approximate our model with second order plus time delay
model (SOPTD) model:
𝐾 ∙ 𝑒 −𝜃𝑠
෨
𝐺(𝑠) =
𝜏1 𝑠 + 1 𝜏2 𝑠 + 1
Here, again θ=td =time delay
Rearrangement and substitution to controller transfer function as previous
procedure, we can then obtain a standard PID transfer function as:
1
𝐺𝐶 = 𝐾𝑐 (1 + + 𝜏𝐷 𝑠)
𝜏𝐼 𝑠
To speed up the explanation and skip the math procedure, we can finally arrive at the
final form:
1 𝜏1 + 𝜏2 𝜏1 𝜏2
𝐾𝐶 = and 𝜏𝐼 = 𝜏1 + 𝜏2 and 𝜏𝐷 =
𝜏1 + 𝜏2
𝐾 𝜏𝑐 + 𝜃
Direct Synthesis (DS) Method
Demonstration example:
Let’s suppose that we have a SOPTD process model:
2 ∙ 𝑒 −𝑠
𝐺(𝑠) =
10𝑠 + 1 5𝑠 + 1
Consider three values of τc =1,3 and 10, evaluate the controllers for unit step
change in both set point and the disturbance, assuming that Gd=G. Assume that
the process model is perfect (𝐺෨ = 𝐺) and plot the response with SIMULINK.
First we have to calculate the PID parameters using the formula of:
1 𝜏1 + 𝜏2 𝜏1 𝜏2
𝐾𝐶 = and 𝜏𝐼 = 𝜏1 + 𝜏2 and 𝜏𝐷 =
𝜏1 + 𝜏2
𝐾 𝜏𝑐 + 𝜃
Direct Synthesis (DS) Method
We compute the PID parameters using the formula of:
1 𝜏1 + 𝜏2 𝜏1 𝜏2
𝐾𝐶 = and 𝜏𝐼 = 𝜏1 + 𝜏2 and 𝜏𝐷 =
𝜏1 + 𝜏2
𝐾 𝜏𝑐 + 𝜃
close all
clear all
clc
taui1=10;
taui2=5;
theta=1;
K=2;
tauc=[1 3 10];
Kc=1./K.*(taui1+taui2)./(tauc+theta);
tauI=taui1+taui2;
tauD=taui1*taui2./(taui1+taui2);
tauc= [1 3 10];
Kc= [3.75 1.875 0.6818]
tauI=15;
tauD=3.33;
Direct Synthesis (DS) Method
There are some notes for DS method:
𝑌
• It is common to assume as FOPTD model. In a certain situation it is not
𝑌𝑠𝑝
𝑑
possible to assume FOPTD. For instance, a process contains a RHP zero term
𝑌
denoted by (1-τas) where τa > 0. The use of standard as FOPTD model will
𝑌𝑠𝑝
𝑑
cause unstable process. Hence, this problem can be avoided by replacing
𝑌
as:
𝑌𝑠𝑝
𝑑 𝑌 (1 − 𝜏𝑎 𝑠)𝑒 −𝜃𝑠
=
𝑌𝑠𝑝 𝜏𝑐 𝑠 + 1
𝑑
• The DS approach should not be used directly for process models with unstable
poles. However, it can be applied if the model is first stabilized by an additional
feedback control loop.
Tuning Method 5: Internal Model
Control (IMC) Method
As seen in the figure of IMC model, we used IMC controller as Gc* which gives output P.
The output P will be used for process model 𝐺෨ and output ෩𝑌. In general, ෩𝑌≠𝑌 due to
modeling errors ( ෩𝐺≠G) and unknown disturbance that are not accounted in the model
(D≠0).
It can be shown that the two block diagrams are equivalent if the controllers Gc and Gc*
satisfy the relation:
𝐺𝐶∗
𝐺𝐶 =
1 − 𝐺𝐶∗ 𝐺෨
Thus, any IMC controller Gc* is equivalent to a standard feedback controller Gc, and vice
versa.
IMC Method
By using block diagram manipulation, the IMC model can be described as:
𝐺𝐶∗ 𝐺 1 − 𝐺𝐶∗ 𝐺෨
𝑌= 𝑌𝑠𝑝 + 𝐷
1+ 𝐺𝐶∗ (𝐺 − 𝐺෨ ൯ 1 + 𝐺𝐶∗ (𝐺 − 𝐺෨ ൯
For a special case of a perfect model where 𝐺෨ = 𝐺, then the above equation reduces to:
෨
𝑌 = 𝐺𝐶∗ 𝐺 𝑌𝑠𝑝 + (1 − 𝐺𝐶∗ 𝐺)𝐷
Where 𝐺෨+ contains any time delays and RHP zeros. In addition, 𝐺෨+ is required to have a
steady-state gain equal to one in order to ensure that the two factors are unique.
IMC Method
Step 2. The IMC controller is specified as
1
𝐺𝐶∗ = 𝑓
𝐺෨−
Where f is the low-pass filter with a steady-state gain of one. It typically has the form:
1
𝑓=
(𝜏𝑐 𝑠 + 1)𝑟
The same as in DS method, 𝜏𝑐 is the desired closed-loop time constant. The usual choice
is r=1. The resulting IMC controller 𝐺𝐶∗ is guaranteed to be physically realizable and stable.
Example: Use the IMC design method to design controller for the FOPTD model
𝐾 ∙ 𝑒 −𝜃𝑠
෨
𝐺(𝑠) =
𝜏𝑠 + 1
By using Pade approximation we know that:
𝜃
1− 𝑠
𝑒 −𝜃𝑠 = 2
𝜃
1+2𝑠
Thus:
𝜃
𝐾 ∙ (1 − 2 𝑠)
෨
𝐺(𝑠) =
𝜃
(1 + 2 𝑠) 𝜏𝑠 + 1
𝐺෨ = 𝐺෨+ ∙ 𝐺෨−
IMC Method
Where:
𝜃
𝐺෨+ = 1 − 𝑠
2
𝐾
𝐺෨− =
𝜃
(1 + 2 𝑠) 𝜏𝑠 + 1
We know that:
𝜃
1 (1 + 2 𝑠) 𝜏𝑠 + 1 1
𝐺𝐶∗ = 𝑓= ∙
𝐺෨− 𝐾 𝜏𝑐 𝑠 + 1
Selection of 𝜏𝑐
The choice of 𝜏𝑐 is a key decision in both the DS and IMC design methods. In general,
increasing 𝜏𝑐 produces a more conservative controller because Kc decreases while 𝜏𝐼
increases. Several IMC guidelines for 𝜏𝑐 have been published for the FOPTD model
𝜏𝑐
•
𝜃
> 0.8 𝑎𝑛𝑑 𝜏𝑐 > 0.1 ∙ 𝜏 Rivera et al., 1986
There is possibility to use different form of PID Controller setting such as parallel
form and series form. Table 12.2 provides conversion table for both PID controller
setting:
IMC Method
Demonstration example:
A process model for a liquid storage system is given by Chien and Fruehauf
(1990) as:
𝐾 ∙ 𝑒 −7.4𝑠
෨
𝐺(𝑠) =
𝑠
Use table 12.1 to calculate PI and PID controller settings for K=0.2 and 𝜏𝑐 =8 and 15 !
By using part M and N in table 12.1 we can obtain:
IMC Method
Demonstration example:
PID parameter calculation in Matlab
clear all
clc
close all
theta=7.4;
tauc=[8 15];
K=0.2;
%PI Setting in M
Kc1=1./K.*(2.*tauc+theta)./(tauc+theta).^2;
tauI1=2.*tauc+theta;
%PID setting in N
Kc2=1./K.*(2.*tauc+theta)./(tauc+theta./2).^2;
tauI2=2.*tauc+theta;
tauD2=(tauc.*theta+theta.^2./4)./(2.*tauc+theta);
IMC Method
Demonstration example:
PID parameter calculation in Matlab
Kc τI τD
PI (τc=8) 0.493 23.4 -
PI (τc=15) 0.373 37.4 -
PID (τc=8) 0.855 23.4 3.12
PID (τc=15) 0.535 37.4 3.33
IMC Method
Demonstration example:
IMC Method
Demonstration example:
Seborg Bequette
Notes: This is also a modern Process Control book with emphasize in
Notes: I would say this is a modern book for Process Control course. It is
simulation using MATLAB and Simulink. Many god examples are
new and fresh by putting emphasize on simulation. A number of
presented in this book. A number of SIMULINK and Matlab Modules
examples were solved with MATLAB and Simulink. The problems here
were given in this book.
are also comprehensive. I have used all materials from this book for
describing the IMC and DS tuning methods. In addition, they also
presented a number of modern problems such as dynamic modeling in
biological system. I would say, we are also heading to the same direction
to tackle dynamic system of biology.
Closing remark