ECH3121 - Assignment 3 (PID CONTROLLER CASE STUDY)
ECH3121 - Assignment 3 (PID CONTROLLER CASE STUDY)
1.0 Introduction 3
2.0 Study of Dynamic Behavior 6
3.0 Auto-Tuning Method with Saturation Limits 11
4.0 Chien-Hrones-Reswick PID Tuning (Literature) 18
5.0 Conclusion and Recommendation 26
6.0 Appendices 28
2
1.0 Introduction
In this paper, the design of two PID controllers in a continuous stirred tank
reactor (CSTR) is studied using the Van der Vusse reaction mathematical model. The
Van de Vusse reaction is a famous example of a complicated reaction network for
which general recommendations or steady-state reactor selection are inapplicable.
Due to the non-linear properties of the system, any altering of the system parameters
may result in non-optimal control responses because the controller's settings are
fixed at the start of the control, as shown in Figure 1.
The Van de Vusse scheme comprises of two reactions of the monomer A to the
product B and to the undesired byproducts C and D.
A→B→C
2A → D
The mathematical model of the Van der Vusse reaction is described by set of
differential equations as
3
The nonlinear Van de Vusse CSTR model, as shown in Figure 2, is utilised in
this work to provide two different feedback control design approaches.
Two controllers are built for the Van der Vusse response in the CSTR, one using
the autotuning technique in Simulink and the other using a method discovered in the
literature, the Chien-Hrones-Reswick (C-H-R) method, to account for set point
change and disturbance rejection. In the designing process of the controller, the
process objective and control objective are identified before two sets of manipulated
variables (MV) and controlled variables (CV) are paired for the process control
objectives as tabulated in Table 1. The selection of the pairing is done according to
guidelines referred in textbook. The degree of freedom is also calculated validate the
number of control loops that will be design in this paper.
4
The degree of freedom is also calculated validate the number of control loops
that will be design in this paper.
Nv = 9
Ne = 4
Nf = Nv – Ne = 5
After determining the pairing, a set of transfer functions is then derived, which
can be referred in Appendix 6.1, and the study on the dynamic behaviour of the
CSTR is conducted by simulating the process with several process inputs. Using the
two techniques outlined, the PI and PID parameters for the controller are acquired by
tuning and constructing the controller for set point changes and load disturbance
rejection. The frequency response technique is then used to investigate the stability
of the process and the control loop system, as well as to derive the gain and phase
margins from the Bode Diagram. To overcome the saturation limit, the concept of
saturation based on realistic saturation is also applied, and anti-windup is used.
Finally, the optimal feedback controller mode, together with its appropriate
parameters, is proposed.
5
2.0 Study of Dynamic Behavior
Ramp test
Step test
Ramp 1 Ramp 2
6
Table 3: Parameters for rectangular pulse test and sinusoidal wave test
7
output for Tr’ and Tc’ has a bigger fluctuation compared to Ca’ and Cb’ indicating
the variables are more affected by sine wave input.
8
2.4 Dynamic behavior of controller output to deviation at Cao’
9
seconds compared to other tests. Similarly, for controller output of Tr’ and Tc’, the
steady state is also the fastest achieved at around 30 seconds compared to other tests.
The trend shape is logarithmic. In comparison to the ramp test, the steady state of the
controller output is double the value in step test which is 40 seconds (Ca’ & Cb’) and
60 seconds (Tr’ & Tc’). The trend shape is exponential. The step change and ramp
test both have stable gradual trend to the steady state value. In comparison to the
rectangular pulse test, the controller outputs in pulse test had a gradual increase
exceeding the steady state value before actually decreasing to its steady state. The
pulse input is simulated with non-ideal condition. Pulse test for this input simulate
the feed entering the reactor all at once at the duration of time corresponding to the
width. Hence, the response decreasing to a higher value before stabilizing into the
steady state at a lower value. It is also noted that the steady state for pulse input is
achieved slower than step test with 40 seconds for Tr’ & Tc’ and 30 seconds for Ca’
& Cb’. For the sinusoidal wave test, the steady state response of the system that
varies with the frequency of the sine wave input is analyzed. Similar to previous
tests, the controller output for Tr’ and Tc’ has a bigger fluctuation compared to Ca’
and Cb’ indicating the variables are more affected by sine wave input. It is noted that
all the response for the test have bigger fluctuations for controller output Tr’ and Tc’,
reaching steady state at 35 K for step test, ramp test and rectangular pulse test. This
indicates the deviation in process input Tr0’ greatly affect the controller output Tr’ &
Tc’ compared to Ca’ & Cb’.
10
3.0 Auto-Tuning Method with Saturation Limits
In this part, tuning through the auto tuning method is done for the setpoint
change and the disturbance rejections with the realistic saturation limits. The tuning
is done for the PID controller with both temperature and composition of A for the set
point change and Tro for the disturbance rejections. The stability of the system is then
measured using the concept of Gain Margin (GM) and Phase Margin (PM) and Anti-
Windup is then being introduced to the system to avoid windup saturation issue and
compared between the difference of existence of it by presenting it in a graph.
The saturation limits for the manipulated variable which are the flowrate of
feed and cooling water is set in prior before tuning the system. Saturation and output
limit of the flowrate of feed is set to 100% for the upper limit and 0% for the lower
as the valve can only go to an upper limit of 100% open, and it can only go to a
lower limit of 0% open. This shows that the controller has been introduced for the
valve to not go up more than 100% or less than 0%. This indicates that the flowrate
is set maximum to be 1 m3/min and the lowest will be no flow at all at 0 m3/min.
In relation to that, the upper saturation limit and lower saturation limit of of
flowrate of the cooling water is also set to be 100% and 0% respectively making
18.56 m3/min and -400 m3/min to be the range of cooling water flowed. 18.56
m3/min indicates that there is no cooling water flowed into the system. This also
explains and -418.56 m3/min to be the lower saturation limit as this flowrate of
cooling water will lead on sudden large changes of the temperature, thus leading to
windup.
The saturation limits for the manipulated variable which are the flowrate of
feed and cooling water is set in prior before tuning the system. Saturation and output
limit of the flowrate of feed is set to 0.9976 for the upper limit and -0.0024 for the
lower. This indicates that the flowrate is set maximum to be 1 m 3/min and the lowest
will be no flow at all at 0 m3/min. In relation to that, the upper saturation limit of
flowrate of the cooling water is set to be 18.56 m3/min and -400 m3/min indicating no
flow of cooling water at the upper saturation limit and -418.56 m 3/min to be the
lower saturation limit as this flow rate of cooling water will lead on sudden large
changes of the temperature, thus leading to windup.
11
After saturation limits have been set, tuning is done by auto tuning method to
achieve and determine the type of controllers based on the PID parameters obtained.
The system with anti-windup method is then being compared with the tuning without
the anti-windup method in one graph. The coefficient of the back calculation method,
Kb, is calculated through the PID values obtained after it is tuned.
Windup is a concept where the feedback control exceeds the maximum and
minimum saturation limits of the system and is unable to respond directly to the
changes in the control error. In results, the system runs with an open loop instead of a
constant feedback loop as the actuator constantly runs at its saturation limit despite
any output of the system it might have.
12
3.2 Composition - Disturbance Rejections
Both set point change and disturbance rejections have the same Kb, which is
7.21E-04.
13
A set point change of 10% of temperature is set to be -36.7 K. It is shown
here that the Tr achieved deviation of -36.7 K as it is being set. Based on Figure 5,
the graph with and without anti-windup method portrays the same result in the
system. This is due to the saturation limit not yet being achieved; therefore, it does
not cause integrator windup as it does not exceed the maximum saturation limit.
Based on Figure 6, the 10% disturbance rejections are set at Tro, an increase
of 38.05 K. While a disturbance is being input to the system, the set point of Tr is
still not changing and maintained at 0. It indicates that the system is still at stable
even though disturbance has been put in. Furthermore, there is also no windup error
as the graph of with and without the anti-windup method still produces the same
graph, as it does not exceed the saturation limit.
Both set point change and disturbance rejections have the same Kb which is
4.83E+00.
14
which can be increased or decreased without making the system unstable and
expressed as degrees. The greater the gain margin and the phase margin, the greater
the stability of the system.
Composition -
0.55866 -52
Disturbance
Temperature -
4.4444 76
Disturbance
15
Figure 8: Gain and Phase Margin of composition – Disturbance
It is shown here that both set point and disturbance rejections gain margin of
0.55866 portray stability and it indicates that the graph is marginally stable. The
amount of 0.5 of gain is still can be used without the graph to be oscillated to cater
with the process variations. The phase margin of -51 and -52 indicates that it is very
unstable. It also indicates that the gain used and derived in the GOL is quite high to
cater with the changes of the process, thus it needs to be extremely reduced.
Furthermore, the function of Gp obtained is not taking all affecting
parameters into it. The saturation limits set also can be a significant reason for the
instability of the system for phase margin.
16
Figure 10: Gain and Phase Margin of composition – Disturbance
Based on Figure 9 and Figure 10, both the gain margin and phase margin show a
result of positive number indicating that the system is stable. The gain margin in the
set point change is 4.42 and 4.44 for the disturbance rejections. This shows that the
system can tolerate a gain of up to 4 amounts of increase in gain without the system
to be unstable and the graph to be oscillated.
The phase margin also indicates a good number which is 76° for both set
point change and disturbance rejections. This shows that 76° of phase lag is available
before reaching -180°. The phase margin also is an acceptable range as it is higher
than 45° and not in the range of 20° to 25°.
17
4.0.0 Chien-Hrones-Reswick PID Tuning (Literature)
4.1 Temperature
i) PI Controller
18
ii) PID Controller
Figure 12: Chien-hrones-Reswick for PID Controller of Gp=Tr/Qc (Step Point Change)
iii) PI Controller
19
iv) PID Controller
4.2 Composition
i) PI Controller
20
ii) PID Controller
Figure 16: Chien-Hrones-Reswick for PID Controller of Gp=CA/qr (Set Point Change)
iii) PI Controller
21
iv) PID Controller
22
i) Temperature (Set Point Change)
23
iii) Composition (Set Point Change)
24
4.4 Discussion
The objective of this study is to design PI and PID controller to control the
composition and temperature in a Continuous Stirred Tank Reactor (CSTR). For the
literature method, the Chien-Hrones-Reswick (CHR) method was proposed for both
set point change and disturbance rejection because this method have the intention of
obtaining the quickest response without overshoot and quickest response with 20%
overshoot. Before the simulation, our group decided to use 20% overshoot for
temperature response and 0% overshoot for composition.
For set point change of temperature Gp2=Tr/Qc, both PI and PID controller
have achieved steady state at the end of the process. As expected, Figure 11 and
Figure 12 show that the PI controller provide higher oscillation at the beginning
compared to the PID controller which led to overshoot to occur. Meanwhile, as Kc
increases or τ I decreases, the response to the disturbance rejection of temperature
become aggressive. Figure 13 and Figure 14 show the comparison of stability
between PI controller and PID controller where the PID controller have quickly
minimized the effect of disturbances, thus providing smooth response for
disturbances rejection. Although our group used response of 20% overshoot, the
output graph has achieved same stability as 0% overshoot after plugged-in the value
of 10% of nominal state given.
For set point of composition Gp1= CA/qr, the observations in Figure 15 and
Figure 16 show that both PI and PID controller have unstable response because the
process did not achieve steady state at the end of the process. There is not much
difference in the graphs for disturbance rejection for PI and PID controller because of
the larger overshoot occurred. It may cause by the effect of disturbance variable
cannot be minimize, resulting in bad disturbance rejection response. Since all the
responses for composition Ca were having unstable graph, this tuning method is less
compatible for this case.
25
5.0 Conclusion and Recommendation
The CHR method is said to be the best for the corresponding CSTR reactor
control system to control Ca because as mentioned, the parameters of its PID
26
controller imposes high phase margin and gain margin. Thus, an additional gain of
over 3 or an additional phase lag of over 88° can be tolerated without causing
instability. The greater the gain and phase margin, the greater the capacity of a
control system to withstand changes in the plant transfer function's parameters while
preserving stability and performance goals. When compared to the auto-tuned control
system, the CHR system can endure more buffers and is less sensitive to tiny
variations in the system, promoting better stability. Although such perturbations can
cause deterioration in time response of the system, the performance of the PID
controller is most satisfying because the system reached the set point change quickly
compared to the control system tuned by auto-tuning method. In addition, the auto-
tuned control system imposes a negative value for the phase margin showing
instability of the system. Thus, the PID controller using CHR method has better
performance to control Ca compared to auto tuned PID controller. Similarly, for Tr,
the parameters of the auto-tuned PID controller imposes high phase margin and gain
margin. The higher gain and phase margin allow toleration of an additional gain of
over 4 or an additional phase lag of over 76° without causing instability. Hence, the
PID controller using auto-tuning method has better performance to control Tr
compared to CHR PID controller.
27
6.0 Appendices
28
6.1 Derivation of transfer function
29
30
31
32
33
34
35
36
37
38
Figure 23: Manual calculation to derive transfer function
39
6.2 Simulink block diagram
Process Response
input
Step
0.6
Ca'
0.5 Cb'
Tr'
0.4 Tc'
0.3
y
0.2
0.1
-0.1
0 5 10 15 20 25 30
Time (seconds)
Ramp
0.6
Ca'
0.5 Cb'
Tr'
0.4 Tc'
0.3
y
0.2
0.1
-0.1
0 5 10 15 20 25 30
Time (seconds)
Rectangula
r pulse 1.2
Ca'
1 Cb'
Tr'
0.8 Tc'
0.6
y
0.4
0.2
-0.2
0 5 10 15 20 25 30 35 40
Time (seconds)
Sinusoidal
wave 0.5
Ca'
0.4
Cb'
0.3 Tr'
Tc'
0.2
0.1
y
-0.1
-0.2
-0.3
-0.4
0 5 10 15 20 25 30
Time (seconds)
42
Table 9: Response to different setpoint changes at input Qc’
Process Response
input
Step
0.05
Ca'
0 Cb'
Tr'
-0.05
Tc'
-0.1
-0.15
y
-0.2
-0.25
-0.3
-0.35
0 5 10 15 20 25 30
Time (seconds)
Ramp
0.05
Ca'
0 Cb'
Tr'
-0.05
Tc'
-0.1
-0.15
y
-0.2
-0.25
-0.3
-0.35
0 5 10 15 20 25 30
Time (seconds)
43
Rectangula
r pulse 0.1
Ca'
0 Cb'
Tr'
-0.1
Tc'
-0.2
-0.3
y
-0.4
-0.5
-0.6
-0.7
0 5 10 15 20 25 30 35 40
Time (seconds)
Sinusoidal
wave 0.2
Ca'
0.15
Cb'
0.1 Tr'
Tc'
0.05
0
y
-0.05
-0.1
-0.15
-0.2
-0.25
0 5 10 15 20 25 30
Time (seconds)
44
Table 10: Response to different setpoint changes at input Cao’
Process Response
input
Step
0.5
Ca'
Cb'
Tr'
0
Tc'
-0.5
y
-1
-1.5
0 5 10 15 20 25 30
Time (seconds)
Ramp
0.5
Ca'
Cb'
Tr'
0
Tc'
-0.5
y
-1
-1.5
0 5 10 15 20 25 30
Time (seconds)
45
Rectangula
r pulse 1
Ca'
0.5 Cb'
Tr'
0 Tc'
-0.5
y
-1
-1.5
-2
-2.5
0 5 10 15 20 25 30 35 40
Time (seconds)
Sinusoidal
wave 0.6
Ca'
0.4 Cb'
Tr'
0.2 Tc'
0
y
-0.2
-0.4
-0.6
-0.8
0 5 10 15 20 25 30
Time (seconds)
46
Table 11: Response to different setpoint changes at input Tro’
Process Response
input
Step
35
Ca'
30 Cb'
Tr'
25
Tc'
20
15
y
10
-5
0 5 10 15 20 25 30
Time (seconds)
Ramp
35
Ca'
30 Cb'
Tr'
25
Tc'
20
15
y
10
-5
0 10 20 30 40 50 60
Time (seconds)
47
Rectangula
r pulse 60
Ca'
50 Cb'
Tr'
40 Tc'
30
y 20
10
-10
0 5 10 15 20 25 30 35 40
Time (seconds)
Sinusoidal
wave 20
Ca'
15 Cb'
Tr'
10
Tc'
0
y
-5
-10
-15
-20
0 5 10 15 20 25 30
Time (seconds)
48
6.4 Derivation of Gp1 and Gp2 for GOL
49
50
51
Figure 25: Manual calculation to Gp1 and Gp2 for GOL
52
6.5 Auto-tuning method with saturation limit
53
Figure 26: Command Window Script for Stability of GOL
54
6.6 Chien-Hrones-Reswick (CHR) Method
55
Figure 30: Chien -Hrones-Reswick for PID Controller (Set Point Change)
56
Figure 32: Chien -Hrones-Reswick for PID Controller (Disturbance Rejection)
57
Figure 33: Command Window Script for Stability of GOL
58