0% found this document useful (0 votes)
6 views24 pages

CME321 Project Group 2 With Equations

The document outlines a project for a Process Dynamics and Control course, detailing various problems related to transfer functions and control systems. It includes MATLAB and Simulink simulations to analyze the behavior of closed-loop proportional and proportional-integral control systems. Key findings indicate that increasing the proportional sensitivity (Kc) reduces the offset in temperature deviations in the system.

Uploaded by

alsheek.ab
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views24 pages

CME321 Project Group 2 With Equations

The document outlines a project for a Process Dynamics and Control course, detailing various problems related to transfer functions and control systems. It includes MATLAB and Simulink simulations to analyze the behavior of closed-loop proportional and proportional-integral control systems. Key findings indicate that increasing the proportional sensitivity (Kc) reduces the offset in temperature deviations in the system.

Uploaded by

alsheek.ab
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 24

CME321 Project Group 2

1|Page

<image: DeviceRGB, width: 795, height: 1057, bpc: 8>

<image: DeviceRGB, width: 438, height: 358, bpc: 8>

College of Engineering

Department of Chemical Engineering

Project

CME321 Process Dynamics and Control

Spring 2022

June 19, 2022

Supervised by Prof. Hadil Abu Khalifeh

<image: DeviceRGB, width: 815, height: 184, bpc: 8>

2|Page

Table of Contents

Problem 1: ......................................................................................................................4

Part a: Determine the Transfer Function that relates the height in the vessel to changes

in the inlet flow rate .....................................................................................................5

Part b: Plot the actual solution versus the linearized solutiong using MATLAB ..........7

Problem 2: .. ………………………………………………………………………………8

Part a: Determine and plot the response of a closed-loop proportional (P) control

system and the offset for Kc and plot the relation using MATLAB……………….….11

Part b: Determine and plot the respone using Excel and MATLAB of a closed-loop

proportional intergral (PI) control system …………………………..…………………15

Part c: Repeat Part b using constant value of 20 for K and values of 1,2,5, and 10 min
for τI
…………………………………………………………………………………………………………………………………………
………… 18

Problem 3:……………………………………………………………………………….20

Part a: Draw a block diagram of the feedback control system…………….…………22

Part b: Derive a transfer function for each block……………………….…………….23

Part c: Use Simulink to determine the PI controller settings/ parameters using the step

response method and Ziegler-Nichols settings…………….…………………………..28

Part d: Simulate the closed loop respone for the determined PI controller setting…...31

Part e: Attempt to obtain improved control by adding derivative action to your PI

controller of Part c…………………….……………………………………………….32

3|Page

*IMPORTANT NOTE

To access the Simulink files, please follow these instructions as Simulink versions differ
(A new version file might not be accessible using the old Simulink Version)

1) Access the preferences tab on MATLAB

2) Simulink  Open Simulink Preferences

3) Model File  Untick do not load models created with a newer version of Simulink

<image: DeviceRGB, width: 1564, height: 384, bpc: 8>

<image: DeviceRGB, width: 1078, height: 231, bpc: 8>

<image: DeviceRGB, width: 924, height: 427, bpc: 8>

4|Page

<image: DeviceRGB, width: 608, height: 383, bpc: 8>

5|Page

Part a

General mass balance equation

General mass balance equation:


Considering the figure given in the statement above,

𝜌𝑞 − 𝜌𝑞0 = 𝜌 𝑑𝑉

𝑑𝑡

Taking 𝜌 common from the above equation, the following relation is


obtained

(𝑞 − 𝑑0) = 𝑉𝑑 𝑉
𝑞

𝑑𝑡

The difference between the two angles 𝜃and 𝜃0 is the derivative of volume
with respect to time. Therefore, the relation can be written it as follows:

𝑑𝑡 … … … … … … … . (2)

Considering the above figure, the volume can be represented as follows:

𝑉𝑜𝑙𝑢𝑚𝑒 (𝑉) = 𝜋𝑟2ℎ

6|Page

To add, the volume of a cone is stated as following

𝑉𝑜𝑙𝑢𝑚𝑒 (𝑉) = 1

3 𝑟2 ℎ

To proceed,

𝑉𝑜𝑙𝑢𝑚𝑒 (𝑉) = 1

3ℎ
(𝑡𝑎𝑛 15)2ℎ

𝑞 − 𝑞0 = 𝜋 tan2 15

3
3ℎ2 𝑑ℎ

𝑑𝑡

Similarly, considering the above figure and Equation 2 in terms of height


and angles followed while considering the height, the following relation is
obtained

𝑞 − 𝑞0 = 𝑡𝑎𝑛
( 215)ℎ2. 𝑑ℎ
𝑑𝑡 … … … … … … (3)

𝑤ℎ𝑒𝑟𝑒 𝑞0 = ℎ

Now, considering Equation 2 and 3, and applying Laplace transformation on


both Equations, the final transfer function can be written as follows:

𝑅𝑄(𝑠) = [((𝑡𝑎𝑛 215)𝑅ℎ2𝑠 + 1]𝐻(𝑠) 𝑤ℎ𝑒𝑟𝑒 𝑡𝑎𝑛215 = 0.072

𝑄(𝑠) =
𝑅

0.23𝑅 𝐻2𝑠 + 1 … … … … … . . (4)

Equation 4 is the required transfer function

7|Page

Part b

% Actual solution versus the linearized solution

clear all;
close all;
clc;
% Actual solution axis
X = 2 : 0.5 : 20;
% Linearized solution axis
Y = 2 : 0.5 : 20;
%Actual solution function
A = exp (-X / 3);
%Linearized solution function
B = exp (-X / 2);
%Plot command
plot (X, A, Y, B, 'k')
title('Actual solution versus the linearized solution')
legend('Actual solution', 'Linearized solution')

The actual vs linearized solution obtained through MATLAB as shown on the


plot as follows:

<image: DeviceRGB, width: 555, height: 418, bpc: 8>

8|Page
<image: DeviceRGB, width: 646, height: 303, bpc: 8>

<image: DeviceRGB, width: 339, height: 307, bpc: 8>

9|Page

Material balance (General)

Overall system process can be written as:

𝐼𝑛𝑝𝑢𝑡 − 𝑂𝑢𝑡𝑝𝑢𝑡 + 𝐺𝑒𝑛𝑒𝑟𝑎𝑡𝑖𝑜𝑛 = 𝐴𝑐𝑐𝑢𝑚𝑢𝑙𝑎𝑡𝑖𝑜𝑛

For a closed loop proportional system, the transfer function (closed loop) of
the system given to us is as follows:

𝑤𝐶(𝑇𝑖 − 𝑇0) − 𝑤𝐶(𝑇𝑖 − 𝑇0) + 𝑞 = 𝑉𝑐 𝑑𝑇

𝑑𝑡

Similarly, the response of the system in steady state can be written as follows:

𝑤𝐶(𝑇𝑖 − 𝑇𝑖𝑠𝑡𝑒𝑎𝑑𝑦) − 𝑤𝐶(𝑇𝑖 − 𝑇𝑖𝑠𝑡𝑒𝑎𝑑𝑦) + 𝑞𝑠𝑡𝑒𝑎𝑑𝑦 = 0

𝑤𝐶(𝑇𝑖 − 𝑇𝑖𝑠𝑡𝑒𝑎𝑑𝑦) − (𝑇 − 𝑇𝑠𝑡𝑒𝑎𝑑𝑦) + (𝑞 − 𝑞𝑠𝑡𝑒𝑎𝑑𝑦) = 𝑉𝑐 𝑑(𝑇 − 𝑇𝑠𝑡𝑒𝑎𝑑𝑦)

𝑑𝑡

Further, the variables for deviation are given as follows:

𝑇𝑖′ = 𝑇𝑖−𝑇𝑖𝑠𝑡𝑒𝑎𝑑𝑦 = 𝑇𝑖 - 60

𝑇′= 𝑇−𝑇𝑠𝑡𝑒𝑎𝑑𝑦= 𝑇- 80

𝑄 ′ = (𝑞 − 𝑞𝑠𝑡𝑒𝑎𝑑𝑦)

By involving these variables, the following expression is obtained:

𝑤𝐶 Ti′ − T′ + Q ′ = 𝑉𝐶 𝑑𝑇′

𝑑𝑡

By apply Laplace transform, the following expression is obtained:

Ti′(s) 𝑄′(𝑠)

𝑊𝑐 = T′(𝑠) (𝜌𝑉

𝑤 𝑠 + 1) 𝑊ℎ𝑒𝑟𝑒 𝜏 = 𝜌𝑉

The process transfer function can be written as follows:


𝑇′(𝑠) = 𝑇𝑖′(𝑠)

𝑠+ 1 +

1
𝑤𝐶 𝑄′(𝑠)

𝑠+ 1

10 | P a g e

The time constant and gain can be obtained as follows:

Time constant:-

=𝑉
𝑉

𝐿= 1000 𝐿

200 𝐿

𝑚𝑖𝑛

𝑇= 𝑖𝑚𝑒 𝐶𝑜𝑛𝑠𝑡𝑎𝑛𝑡 = 5 𝑚𝑖𝑛𝑢𝑡𝑒𝑠

Gain:-

𝐴=
1

𝑤𝐶

𝐴=
1

200 𝐿

𝑚𝑖𝑛 ∗ 1 𝑘𝑔

∗ 4.184
𝑘𝐽

𝐾𝑔 ∗ 𝐶0 ∗ 1 𝑚𝑖𝑛

60 𝑠𝑒𝑐

𝐴 = 𝐺𝑎𝑖𝑛 = 1
14

𝐶0

𝑘𝐽/𝑠𝑒𝑐

Assume the following

 Transfer Function of Measuring Element is 1 (TF=1)


 Transfer Function of Actuator is 1 (TF=1)

11 | P a g e

Part a

The closed loop system is modeled in Simulink and is given as follows:

<image: DeviceRGB, width: 702, height: 634, bpc: 8>

<image: DeviceRGB, width: 1054, height: 443, bpc: 8>

12 | P a g e

MATLAB Code

clear
clc
close all

for i = 1:4
PI = [5,10,20,100]; %Different Kc values for PI
ranging from 5 to 20
Kc = PI(1,i); %i starts from 1 until 4 representing
the four Kc values

%calling the simulink model


model = 'q2modelgroup2';
[t,x,y]= sim(model,60);
plot(t,y(:,1),'color',rand(1,3));
xlabel('Time')
ylabel('Deviation in Tank Temperature T''')
legend('Kc=5','Kc=10','Kc=20','Kc=100')
title('Temp vs Time for Kc = 5,10,20,100');
xlim([0 60]);
hold on

%Last row in y will contain the final values of the


model
[norow,nocol] = size(y);
%Offset used is from the simulink model file
'q2modelgroup2';
Offset(i,1) = y(norow,2)-y(norow,1);
KcPlot(i,1) = Kc;
end

display(Offset);
display(KcPlot);

13 | P a g e

Response in terms of Kc

As it can be obtained, by increasing the Kc value, the disturbance between the


steady state temperature and the temperature after disturbance becomes
minimized. Therefore, higher value of Kc is desired.

Response in terms of Kc and offset

There is an inverse relation between


offset and Kc which is shown in the
plot. In the proposed system, this
particular relationship is observed. By
increasing the proportional sensitivity
Kc, the offset that happens because of
disturbances will be reduced.

Response in command window

offset =

-3.6832

-2.9170

-0.6143

kcplot=

10

20

100
<image: DeviceRGB, width: 290, height: 237, bpc: 8>

<image: DeviceRGB, width: 371, height: 295, bpc: 8>

14 | P a g e

Manually, offset value can be calculated as follows:

𝑜𝑓𝑓𝑠𝑒𝑡 =
5

1 + 𝑘𝐶𝐴

The proposed system response is approved using excel and is given as


follows:

Kc
offset

5
3.680506685

10
2.912026726

20
2.054202671

100
0.611982214

Besides, the offset vs Kc plot is shown in figure below:

<image: DeviceRGB, width: 809, height: 442, bpc: 8>

15 | P a g e

Part b

Excel

The excel plot for different values given as follows:

Comment: By increasing value of Kc, a rise is obtained as shown in the above


Figure.

Simulink

The closed loop PI control-based feedback system using Simulink is modeled


and is shown as follows:
<image: DeviceRGB, width: 902, height: 353, bpc: 8>

<image: DeviceRGB, width: 1054, height: 443, bpc: 8>

16 | P a g e

MATLAB Code

clear
clc
close all

for i = 1:4
PI = [5,10,20,100]; %Different Kc values for PI
ranging from 5 to 20
Kc = PI(1,i); %i starts from 1 until 4 representing
the four Kc values

%calling the simulink model


model = 'q2modelgroup2';
[t,x,y]= sim(model,60);
plot(t,y(:,1),'color',rand(1,3));
xlabel('Time')
ylabel('Deviation in Tank Temperature T''')
legend('Kc=5','Kc=10','Kc=20','Kc=100')
title('Temp vs Time for Kc = 5,10,20,100');
xlim([0 60]);
hold on

%Last row in y will contain the final values of the


model
[norow,nocol] = size(y);
%Offset used is from the simulink model file
'q2modelgroup2';
Offset(i,1) = y(norow,2)-y(norow,1);
KcPlot(i,1) = Kc;
end

display(Offset);
display(KcPlot);

17 | P a g e

Response of KC
Regardless of the actual value of kc, the process reaches the same steady state
value. A variation in Kc values, however; results in a variant response and a
deviation in temperature. For example, Kc=5 results in the biggest
temperature deviation. In contrast, when Kc=100, the maximum deviation is
smallest. By setting Kc higher, the maximum deviation from the set point and
oscillations will be reduced. Thus, higher Kc is more desired.

Offset in PI

Command window result

Offset =

-0.0025

0.0001

0.0000

Kcplot =

10

20

100

<image: DeviceRGB, width: 328, height: 261, bpc: 8>

18 | P a g e

Part c

Excel

By following the instructions given in part c, a reverse response of the system


will be obtained which is given as follows:

Comment: For such values of Kc, a reverse response is obtained. Changing


the τI value affects the response. The process will become faster as τI drops,
but it will experience higher oscillations, which will lead to lower maximum
deviations from target.

<image: DeviceRGB, width: 410, height: 314, bpc: 8>

<image: DeviceRGB, width: 752, height: 430, bpc: 8>

19 | P a g e
MATLAB Code

By repeating part b, and using the Kc value constant, which is equal to 20

clear
clc
close all
for i = 1:4
PI = [1,2,5,10]; %Different Kc values for PI
ranging from 1 to 10
tao = PI(1,i); %defining tao for each Kc value in
the PI
%calling the simulink model 'q2modelgroup2'
model = 'q2modelgroup2';
[t,x,y]= sim(model,60);
plot(t,y(:,1),'color',rand(1,3));
xlabel('Time')
ylabel('Deviation in Tank Temperature T''')
legend('tao = 1','tao = 2','tao = 5','tao = 10')
title('Temp vs Time for tao = 1,2,5,10');
xlim([0 60]);
hold on
[rowL,colL] = size(y);
end

20 | P a g e

<image: DeviceRGB, width: 599, height: 414, bpc: 8>

<image: DeviceRGB, width: 293, height: 107, bpc: 8>

Values assigned to Group 2

W1
W2
X1
X2
h(m)
X

600
300
0.25
0.4
1.4
0.3
<image: DeviceRGB, width: 582, height: 362, bpc: 8>

21 | P a g e

<image: DeviceRGB, width: 382, height: 232, bpc: 8>

22 | P a g e

Part a

Figure 2: General block diagram

<image: DeviceRGB, width: 549, height: 180, bpc: 8>

<image: DeviceRGB, width: 509, height: 189, bpc: 8>

<image: DeviceRGB, width: 549, height: 180, bpc: 8>

Figure 3 Detailed Block Diagram

Figure 1 General Block Diagram

Figure 2 General Block Diagram

23 | P a g e

Part b

The balance for mixture is modeled as follows:

𝑑𝑚
𝑑𝑡 = 𝑤1 + 𝑤2(𝑡) − 𝑤(𝑡)

The balance can be reduced to the following as a mixture has constant


volume and density

0 = 𝑤1 + 𝑤2(𝑡) − 𝑤(𝑡)

𝑇ℎ𝑒𝑟𝑒𝑓𝑜𝑟𝑒, 𝑑𝑚

𝑑𝑡 = 0

Similarly, the mass balance for solute is given by:

𝑉 𝑑𝑥(𝑡)

𝑑𝑡
= 𝑤1𝑥1(𝑡) + 𝑤2(𝑡)𝑥2 − 𝑤(𝑡)𝑥(𝑡)

Further explore the above equation


𝑉 𝑑𝑥(𝑡)

𝑑𝑡
= 𝑤1𝑥1(𝑡) + 𝑤2(𝑡)𝑥2 − 𝑤1𝑥(𝑡) − 𝑤2(𝑡)𝑥(𝑡)

𝑇ℎ𝑒𝑟𝑒𝑓𝑜𝑟𝑒, 𝑤𝑡 = 𝑤1 + 𝑤2(𝑡)

In order to linearize the system about the steady state, first order Taylor
series expansion should be applied

𝑓(𝑥1(𝑡), 𝑤2(𝑡), 𝑥(𝑡)) = 𝑓(𝑋1, 𝑊1, 𝑋) +


𝜕𝑓

𝑑𝑥1(𝑡) │𝑋1,𝑊1,𝑋

<image: DeviceRGB, width: 343, height: 172, bpc: 8>

24 | P a g e

Deviation Variables at time t (Steady state)

𝑋′1(𝑡) = 𝑥1(𝑡) − 𝑋1

𝑊′2(𝑡) = 𝑤2(𝑡) − 𝑊2

𝑋′(𝑡) = 𝑥(𝑡) − 𝑋

𝑋′1(𝑡) +
𝑓

𝑑𝑤2(𝑡) │𝑋1,𝑊2,𝑋𝑊′2(𝑡) +
𝑓

𝑑𝑥(𝑡) │𝑋1,𝑊2,𝑋𝑋′(𝑡)

In order to solve the linear expansion, the following derivations should be


applied

𝑑𝑥1(𝑡) │𝑋1,𝑊2,𝑋 = 𝑊1

𝑑𝑤2(𝑡) │𝑋1,𝑊2,𝑋 = 𝑋2 − 𝑋

𝑑𝑋(𝑡) │𝑋1,𝑊2,𝑋 = −𝑊1 − 𝑊2

𝑓(𝑋1, 𝑊2, 𝑋) = 𝑊1𝑋1 + 𝑊2𝑋2 − (𝑊1 + 𝑊2)𝑋 = 0


𝑉 𝑑𝑥(𝑡)

𝑑𝑡
= 𝑉 𝑑(𝑋′(𝑡) + 𝑋)

𝑑𝑡
=𝑉( 𝑑𝑋′(𝑡)

𝑑𝑡
)

Combine

( 𝑑𝑋′(𝑡)
𝑉

𝑑𝑡
) = 𝑊1𝑋′

1(𝑡) + (𝑋2 − 𝑋)𝑊′2(𝑡) − (𝑊1 + 𝑊2)𝑋′(𝑡)

By applying Laplace transform (time domain to s domain)

( 𝑠𝑋′
𝑉

𝑠 + 𝑋′(0)) = 𝑊1𝑋′

1(𝑠) + (𝑋2 − 𝑋)𝑊′2(𝑠) − (𝑊1 + 𝑊2)𝑋′

(𝑠)

𝑋′(𝑠)(𝑉𝑠 + 𝑊1+𝑊2) = 𝑊1𝑋′

1(𝑠) + (𝑋2 − 𝑋)𝑊′2(𝑠)

25 | P a g e

Manipulated variable is constant. Thus, the transfer function of the response


of the controlled variable to changes in load and manipulated variable is given
by:

𝑋′(𝑠)(𝑉𝑠 + 𝑊1 + 𝑊2) = 𝑊1𝑋′

1(𝑠)

𝐺𝑑𝑣 = 𝑋′(𝑠)

𝑋′1(𝑠) =
𝑊1

𝑉𝑠 + 𝑊1 + 𝑊2
=

𝑊1

𝑊1 + 𝑊2
𝑉

𝑊1 + 𝑊2 𝑠 + 1

= 𝑘𝑑𝑣

𝑠+ 1

Where 𝜏 =

𝑊1+𝑊2 & 𝑘𝑑𝑣 =

𝑊1

𝑊1+𝑊2

Load variable is constant. Thus, the output transfer function (manipulated


variable) can be written as:

𝑋′(𝑠)(𝑉𝑠 + 𝑊1 + 𝑊2) = (𝑋2 − 𝑋)𝑊′2(𝑠)

𝐺𝑚𝑣 = 𝑋′(𝑠)

𝑊′2(𝑠) =
(𝑋2 − 𝑋)

𝑉𝑠 + 𝑊1 + 𝑊2

𝑋2 − 𝑋
𝑊1 + 𝑊2
𝑉

𝑊1 + 𝑊2 𝑠 + 1

= 𝑘𝑚𝑣

𝑠+ 1

Where 𝜏 =

𝑉
𝑊1+𝑊2 and 𝑘𝑚𝑣 =

(𝑋2−𝑋)

𝑊1+𝑊2

Based on the following data

the following values are found

kdv

𝑘𝑑𝑣 =
𝑊1

𝑊1 + 𝑊2

𝑘𝑑𝑣 =
600

600 + 300

𝐾𝑑𝑣 = 0.67

Values assigned to Group 2

W1
W2
X1
X2
h(m)
X

600
300
0.25
0.4
1.4
0.3

26 | P a g e

kmv

𝑘𝑚𝑣 = (𝑋2 − 𝑋)

𝑊1 + 𝑊2

𝑘𝑚𝑣 = 0.4 − 0.3


600 + 300

𝐾𝑚𝑣 = 1.11 × 10−4 𝑚𝑖𝑛

𝑘𝑔

𝜏=
𝑉

𝑊1 + 𝑊2

𝜏=

(1000 𝑘𝑔

𝑚3)(𝜋

4 (2)2(1.4)

600 + 300

= 4.9 𝑖𝑛
𝑚

Transfer Functions

𝐺𝑑𝑣 =
0.67

4.9𝑠 + 1 𝑤ℎ𝑒𝑟𝑒 𝑘𝑑𝑣 = 0.67, 𝜏 = 4.9

𝐺𝑚𝑣 = 1.11 ∗ 10−4

4.9𝑠 + 1
𝑤ℎ𝑒𝑟𝑒 𝑘𝑚𝑣 = 1.11 ∗ 10−4, 𝜏 = 4.9

As it was given in the problem statement

𝑻𝒓𝒂𝒏𝒔𝒇𝒆𝒓 𝑭𝒖𝒏𝒄𝒕𝒊𝒐𝒏 𝒇𝒐𝒓 𝒕𝒉𝒆 𝒄𝒐𝒎𝒑𝒐𝒔𝒊𝒕𝒊𝒐𝒏 𝒎𝒆𝒂𝒔𝒖𝒓𝒆𝒎𝒆𝒏𝒕 𝒅𝒆𝒗𝒊𝒄𝒆

𝐺𝑚 = ∆𝐸𝑙𝑒𝑐𝑡𝑟𝑖𝑐 𝑆𝑖𝑔𝑛𝑎𝑙

𝐶𝑜𝑚𝑝𝑜𝑠𝑖𝑡𝑖𝑜𝑛 𝑆𝑝𝑎𝑛 𝑒−𝑠

𝐺𝑚 = 20 − 4

0.5
𝑒−𝑠

𝐺𝑚 = 32 𝑒−𝑆
27 | P a g e

𝑻𝒓𝒂𝒏𝒔𝒇𝒆𝒓 𝑭𝒖𝒏𝒄𝒕𝒊𝒐𝒏 𝒇𝒐𝒓 𝒕𝒉𝒆 𝒗𝒂𝒍𝒗𝒆

𝐺𝑣 = ∆𝑃𝑟𝑒𝑠𝑠𝑢𝑟𝑒 𝑆𝑖𝑔𝑛𝑎𝑙

∆𝐸𝑙𝑒𝑐𝑡𝑟𝑖𝑐 𝑆𝑖𝑔𝑛𝑎𝑙

𝑘𝑣

𝑣𝑠 + 1

𝐺𝑣 = 15 − 3

20 − 4

300
1.2

0.08335𝑠 + 1

𝐺𝑣 =
187.5

0.08335𝑠 + 1

𝑻𝒓𝒂𝒏𝒔𝒇𝒆𝒓 𝑭𝒖𝒏𝒄𝒕𝒊𝒐𝒏 𝒇𝒐𝒓 𝒕𝒉𝒆 𝒄𝒐𝒏𝒕𝒓𝒐𝒍𝒍𝒆𝒓𝒔

Proportional Integral (PI)

𝐺𝑐 = 𝐾𝑐(1 + 1

𝐼𝑠)

Proportional Integral Derivative (PID)

𝐺𝑐 = 𝐾𝑐(1 + 1

𝐼𝑠 + 𝐷𝑠)

28 | P a g e

Part c

Simulink block diagrams as follows:

<image: DeviceRGB, width: 1201, height: 488, bpc: 8>

<image: DeviceRGB, width: 1110, height: 423, bpc: 8>

29 | P a g e
MATLAB Code

clear
clc
close all
for i = 1:5
PI = [10.7,11,11.5,11.8,12]; %Different Kc values for PI ranging
from 10.7 to 12
Kc = PI(1,i); %i starts from 1 until 5 representing the four Kc
values
%calling the simulink model
model = 'q3modelgroup2';
[t,x,y]= sim(model,40);
plot(t,y(:,1),'color',rand(1,4));
xlabel('Time')
ylabel(' X''(t)')
legend('Kc = 10.7','Kc = 11','Kc = 11.5','Kc = 11.8','Kc = 12')
title('Composition vs Time for Kc = 10.7,11,11.5,11.8,12');
xlim([0 40]);
hold on
end
Response of the system

In
order
to observe
the

transient response, a value of


Kc was selected. By studying
the system and the response, a
higher value of Kc was
selected as a decrease in the
response was noticed. By
gradually increasing the gain, a sustained oscillation was obtained first. In
terms of oscillation sustained by sustained gain, the ultimate gain Kcu and the
ultimate period Pu correspond to sustained oscillation. The value of Kcu was
set at 11.8 as it was noticed
that the response first exhibits
a sustained oscillation. The
ultimate period Pu represents
the time spent to complete one
cycle. It can be calculated by
taking the difference between
two peaks or valleys.

𝑃𝑢 = 18.6 − 14.6 = 4 𝑚𝑖𝑛

<image: DeviceRGB, width: 783, height: 405, bpc: 8>

<image: DeviceRGB, width: 770, height: 390, bpc: 8>

30 | P a g e

Using the Ziegler-Nichols tuning relations table stated above, the PI


controller settings were calculated as it follows:-

Kc

𝐾𝑐 = 0.45𝐾𝑐𝑢

𝐾𝑐 = 0.45 ∗ 11.8

𝐾𝑐 = 5.3

τI

τI = 𝑃𝑢

1.2

τI = 4

1.2

τI = 3 𝑚𝑖𝑛

<image: DeviceRGB, width: 851, height: 264, bpc: 8>

31 | P a g e

Part d

Disturbance and PI parameters

MATLAB Code

clear
clc
close all

%Given parameters
Kc = 5.31;
taoi = 3.2691 ;

%calling the simulink model


model = 'q3modelgroup2';
[t,x,y]= sim(model,40);
plot(t,y(:,1));
xlabel('Time')
ylabel(' X''(t)')
title('Composition vs Time for Kc = 5.31 and taoi =
3.2691');
xlim([0 40]);
hold on

<image: DeviceRGB, width: 509, height: 399, bpc: 8>

32 | P a g e

Part e

For a PID controller, the following parameters can be calculated using


Ziegler-Nichols tuning relations table:-

τD = 𝑃𝑢

τD = 4

τD = 0.5 𝑚𝑖𝑛

𝐾𝑐

Kc = 0.6𝐾𝑐𝑢

Kc = 0.6 ∗ 11.8

Kc = 7.08

𝜏I

τI = 𝑃𝑢

τI = 4
2

τI = 2 𝑚𝑖𝑛

<image: DeviceRGB, width: 871, height: 272, bpc: 8>

33 | P a g e

In the process of comparing the responses of various time constants, the


calculated 𝐷value was used to identify the range of different time constants.
In this part, the PID controller block parameters are adjusted. The following
MATLAB code was used to plot the responses for different 𝐷 values :

MATLAB Code

clear
clc
close all

%Given parameters
Kc = 5.31;
taoi = 3.2691 ;

for i = 1:7
PID = [0,0.4,1,2,3,3.5,4]; %Different taod values
for PID ranging from 0 to 4
taod = PID(1,i);

%calling the simulink model


model = 'q3modelgroup2';
[t,x,y]= sim(model,40);
plot(t,y(:,1),'color',rand(1,4));
xlabel('Time')
ylabel(' X''(t)')
legend('PI only','taod = 0.4','taod = 1','taod =
2','taod = 3','taod = 3.5','taod = 4')
title('Composition vs Time for different taod');
xlim([0 40]);
hold on
end

34 | P a g e

Response of the system


The offshoot was reduced once the derivative action was merged into the
process. The Higher 𝐷 value
the lower overshoot. When the
𝐷value was set at 3.5min, it
was noticed that some sluggish
behavior started occurring,
and the response to the process
became less dampened and
oscillations
became
more

noticeable. For this reason, the


𝐷value of 3 min will be
chosen in order to ensure that the derivative action will produce the desired
results.

By setting 𝐷
value to 3 min, the offshoot will decrease. Thus, the sluggish
response of the process will decrease.

PID controller parameters

Kc = 5.13

𝜏I = 3.2 min

𝜏D = 3 min

<image: DeviceRGB, width: 788, height: 426, bpc: 8>

<image: DeviceRGB, width: 747, height: 411, bpc: 8>

You might also like