Comparative study of Time Optimal Controller
with PID Controller
for a Continuous Stirred Tank Reactor
Ayush Sharma, Miroslav Fikar, Monika Bakošová
Faculty of Chemical and Food Technology
Slovak University of Technology in Bratislava
81237 Bratislava, Slovakia
[email protected] Abstract: Continuous Stirred Tank Reactor (CSTR) is the productive part in different chemical and process
industries, and hence there is a need to control this process at desired optimum conditions of temperature
and concentration. This paper deals with modelling and constrained control of a CSTR that minimises
the processing time. Modelling consisted in performing the mass and heat balances of the CSTR system.
Different controllers (time optimal, PID) were then applied to this non-linear system and compared within
the boundaries of the control input and states. A theoretical case study was solved numerically using the
orthogonal collocations method and simulations, resulting in a comparison of different controllers.
Keywords: CSTR, mathematical modelling, constrained optimisation, PID control, time optimal control
Introduction Kadlec, 1970) with the maximum principle and
phase plane analysis. Both experimental studies
CSTR is a very important part of chemical and proc- and analogue computer simulation studies were
ess industries. The CSTR configuration is widely conducted, but the results were not very satisfying.
used in industrial applications and in wastewater In another paper (Kim. H. J et al., 1998), a success-
treatment units (i.e. activated sludge reactors). As ful implementation of time optimal control for
mentioned in (Pathak, Markana and Parikh, 2010), copolymerisation of methyl metacrylate and methyl
it is very difficult to control this non-linear process. acrylate was studied. Minimum principle of the
One of the main reasons of this difficulty in control is optimal control theory was applied to achieve the
the uncertainty in chemical kinetics, multiple steady copolymerisation in minimum time, but no com-
states and non-linear behaviour. In this paper, the parison with other possible controllers was studied.
simplest form of reaction, i.e. irreversible conversion The mentioned papers present the reason to keep
of a single reactant to a single product is studied and searching for alternative controllers for such non-
discussed. A comparison of different controllers was linear complex processes. Optimal control is a vast
presented in (Allwin, Biksha, Abirami, Kala and Ud- area of control theory, while time minimisation is
haya, 2014) as a comparative study of a conventional a part of this theory, and it is the mode of control
PID controller and Model Predictive Control (MPC). which is compared with PID control in this paper.
This study proved MPC to be more suitable for the This paper investigated the control of a jacketed
control of a CSTR. In another comparative study CSTR as seen in Fig. 1. The flow rate of the cool-
(Shakib, 2013) of PI, PID, and a reset controller, a ant was the control variable and was constrained
linearized model was used to study and control the between two boundaries. The reactor temperature
process. Disturbance rejection and the integral error was the controlled output, and it was constrained
criterion were used to compare different controllers between the upper and the lower boundary, too. The
and the reset controller was found to be the best one aim was to study the control and states behaviour in
according to these criteria. order to minimise the control time when different,
In another research work (Pathak, Markana and Pa- i.e. time optimal and PID based controllers were
rikh, 2010), non-linear MPC was implied to assist the applied to control an irreversible single reactant,
optimal control of a CSTR. The simulation studies single product reaction.
in this paper proved non-linear MPC to be a better
alternative for conventional controllers. The time Theoretical
optimal control problem for a jacket cooled CSTR
with an exothermic, irreversible, second-order, In this section, the process and reaction to be con-
homogeneous, liquid-phase reaction (saponifica- trolled are briefly described, and the theoretical
tion of ethyl acetate) was solved in (Javensky and aspects of time optimal control are discussed.
Acta Chimica Slovaca, Vol. 8, No. 1, 2015, pp. 27—33, DOI: 10.1515/acs-2015-0006 27
Process model -E
dc B F
In this study, an irreversible, single reactant, single = - c B + c A k0 e RTR (3b)
dt VR
product reaction was assumed according to the
equation:
dTR
A → B (1) =
dt
The process operation, mass flows and heat flows -E
(3c)
are presented in Fig. 1. Feed consisting of reactant F D Hc k e RTR
Ua J (TR -TJ )
= (T0 -TR ) - r A 0 -
A was fed continuously at the flow rate F with VR rcP VR rcP
reactant A concentration cA,in at temperature T0.
The coolant was fed into the jacket at the flow rate
FJ, and the temperature Tc,in. The first-order exo- dTJ FJ Ua J (TR -TJ )
= (Tc,in -TJ ) - (3d)
thermic reaction inside the CSTR ran according to dt VJ V J r JcP , J
Eq. (1), and the outlet stream contained reactant A
having concentration cA, and the product B having where ∆rH is the heat of the reaction, r is the density
concentration cB. of the reactant and product (density of the reaction
mixture is assumed to be constant), rJ is the density
of the coolant, and cP is the specific heat of the re-
actant and product, while cP,J is the specific heat of
the coolant.
Process optimisation
In this section, a brief description of the optimisa-
tion/minimisation problem is presented. The aim
was to minimise the reaction time of the reaction
given in Eq. (1), while controlling the process to a
steady state. The minimisation problem or objec-
tive function to minimise time can be formulated
as
tf
Fig. 1. Process scheme of the CSTR. J * = min ò 1.dt (4a)
F J (t ) 0
The CSTR was operated at a constant volume, i.e.
s.t. (3a) – (3d) (4b)
VR was constant, and hence the flow rate of the
outlet stream equalled F, and similarly the flow rate
cA(0) = cA,0, cB(0) = cB,0, TR(0) = TR,0, TJ(0) = TJ,0 (4c)
of coolant leaving the jacket was equal to flow rate
coming into the jacket, i.e. FJ.
cA(tf) = cA,f, cB(tf) = cB,f, TR(tf) = TR,f, TJ(tf) = TJ,f (4d)
The state variables cA, cB, TR and TJ are the concen-
· · · ·
tration of A and B inside the CSTR, temperature c A (t f ) = 0, c B (t f ) = 0, TR (t f ) = 0, TJ (t f ) = 0 (4e)
inside the CSTR, and temperature inside the jacket,
respectively. The flow inside the jacket FJ was the
FJ ∈ [FJ,min, FJ,max], TR ∈ [TR,min, TR,max] (4f)
control variable. The first order reaction rate is
given as where tf is the optimisation terminal/final time,
• • • •
-E cA, cB, TR, and TJ represent the derivatives of state
u = kc A = c A k0 e RTR
variables w.r.t. time, i.e. the left hand sides of the
(2)
dynamic equations (3a), (3b), (3c) and (3d), respec-
where, n is the rate of consumption of reactant A, k tively. To control the process at steady state, these
• • • •
is the specific reaction rate, k0 is the preexponential derivatives, i.e. cA, cB, TR, and TJ should be equal to
factor, E represents the activation energy, and R is 0 at final time of optimisation, i.e. at tf. Numerical
the gas constant. The reactor dynamics was mod- optimisation of such a problem is discussed in the
elled by exploiting the mass and heat balances of the next section, i.e. Experimental.
reactor, and the heat balance of the jacket providing Minimisation of time in the optimal control theory
the dynamic non-linear model as follows: (OCP) as studied by (Hull 2003) is historically the
-E first optimal control problem to be treated, and
dc A F
= (c A, 0 - c A ) - c A k0 e RTR (3a) it aims at finding such a control trajectory that
dt VR drives the process from the given initial state to a
28 Sharma A et al., Comparative study of Time Optimal Controller with PID Controller…
fixed final state in minimum time within the con- Tab. 1. CSTR parameters for irreversible exother-
straints. OCP can be distinguished e.g. by fixed/ mic reaction (from (Luyben, 2007)).
free initial/terminal time/state as mentioned in
Parameter value unit
(Hull, 2003). Initial time is usually fixed since it is
the time when we start to control the process, and Preexponential factor 20750000 s–1
we have considered it to be equal to 0. For such Activation energy 69710000 J.kmol–1
constrained problems, the control trajectory is ei- Process density 801 kg.m–3
ther the bang-bang control, i.e. only the boundary Coolant density 1000 kg.m–3
values of control, or a singular arc and thus some Heat capacity 3137 J.kg–1.K–1
other value/values of control along with bound- Coolant heat capacity 4183 J.kg–1.K–1
ary values.
Heat of reaction –69710000 J.kmol–1
Feed temperature 294 K
Experimental
Feed flowrate 0.004377 m3.s–1
Here, a literature case study taken from (Luyben Feed concentration 8.01 kmol.m–3
2007) is solved using different controllers. The Coolant inlet temperature 294 K
values of different CSTR parameters are given in Overall heat transfer coefficient 851 W.K–1.m–2
Table 1. First, the steady state analysis of the proc- Gas constant 8314 J.K–1.kmol–1
ess is presented. To find the steady states, heat in/ Reactor volume 5 m3
out (Q), and heat generated (Qgen) were analysed
Coolant flowrate Control m3.s–1
by checking the effect of 100 different values of
Aspect ratio (Length/Diameter) 2 –
the steady state reactor temperature TRs within
the constrained range of TR ∈ [280, 480] K, with
FJs = 0.004377 m3.s–1, and the following equations Tab. 2. Three steady states observed for the given
generated by the heat balance parameters.
Q = F rcP (TRs -T0 ) +Ua J (TRs -TJs )] (5) Steady state cAs [kmol.m–3] TRs [K] TJs [K]
1 7.92 295.5 294.6
and
2 5.12 342.8 312.9
-E
RTRs 3 0.11 427.2 345.6
Q gen = -VR Dr Hc As k0 e (6)
The steady values of states cAs and TJs were calculated
by equating the left hand sides of Eqs. (3a) and (3d) evident from the figure that there are three steady
to 0. Fig. 2 shows the trend of Q and Qgen, as the states, as there are three points where Q = Qgen (Ta-
temperature of the reactor TRs was increased. It is ble 2).
Fig. 2. Change in Q and Qgen with the increasing reactor temperature.
Sharma A et al., Comparative study of Time Optimal Controller with PID Controller… 29
Time optimal control temperature to the third steady state value, i.e. TRs =
The case study described above is solved here for 427.2 K with a ±0.3 K error margin, in minimum
the purpose of time minimisation with the aid of time and within the constrained boundaries of
the numerical method of orthogonal collocations control FJ and state TR.
implemented in (Čižniar, Fikar, and Latifi, 2005) as The optimisation was done for different numbers
a toolbox called Dynopt. The aim was to find the of affine periods, but the optimal control trajectory
control trajectory, to go from the prescribed initial was found to be of the bang-bang type. The control
state of the reactor, i.e. [cA,0, cB,0, TR,0, TJ,0] = [3 trajectory was divided into two piecewise constant
kmol.m–3, 1 kmol.m–3, 380 K, 310 K], to the conver- values with the upper boundary, i.e. 0.04377 m3.s–1
sion of A to the third steady state concentration of for the first time period of 209 s, and the lower
0.11 kmol.m–3 while staying within the constrained boundary value of 0.0004377 m3.s–1 for the second
control FJ ∈ [0.0004377, 0.04377] m3.s–1 and con- time period of 678 s. The allowed error margin for
strained reactor temperature TR ∈ [280, 480] K. stability or steady state value of TR was considered
Briefly, the objective was to aid the conversion of A to be ±0.3 K, and hence the time optimal control
from 3 kmol.m–3 to 0.11 kmol.m–3, and the reactor required 887 s to achieve these results.
Fig. 3. Trajectory of control (FJ) and reactor temperature (TR) with time optimal (TO)
and different PID based controllers.
30 Sharma A et al., Comparative study of Time Optimal Controller with PID Controller…
Comparison of controllers either of them when compared to PID and PPP, but
In this section, the described case study was con- settling time in both was longer.
trolled using classical PID controllers. Reactor
temperature was the controlled variable, and the
Tab. 3. Controller parameters.
PID was designed using the MATLAB toolbox.
The transfer function to design the controller Controller KP KI KD
was evaluated from multiple step responses of the PID –0.00049 5998.2 0.105
CSTR s-function in MATLAB, and then the system PI –0.00006 2118.8 –
identification toolbox PIDDESIGN (Oravec and
PPP –0.51588 – –
Bakošová, 2012), implementable in MATLAB, was
Pm –0.00015 – –
used. The controller parameters are given in Table
3. In Fig. 3, a comparison of different controllers,
i.e. PI gave quite smooth results in context of the reactor
1. PID designed using MATLAB tool, temperature, but it required the longest time to reach
2. PI designed using MATLAB tool, the steady state (Fig. 3). The P controller designed
3. P(PPP) designed using Pole placement method, using the pole placement method (PPP) provided
4. P (Pm) designed using MATLAB tool, and oscillating results (Fig. 3), but required shorter time
5. TO time optimal control than other PID controllers to reach the third steady
is depicted. It is evident from Fig. 3 that of all the state. Fig. 4 again proves that the time optimal con-
controllers, time optimal control (TO) required trol (TO) required the shortest time for the jacket
the minimum time to reach the steady state within temperature to reach a steady value, without any
the allowed error margin range of the steady state over-shooting, followed by PPP, Pm, PID, and PI.
reactor temperature TRs = 427.2 K, and the time
optimal is the only controller without any under-
Tab. 4. Time required by different controllers to
shoot (temperature not decreasing below the steady
reach the steady state within the error range
state once reached). PID based controllers showed a
of ±0.3 K at TRs = 427.2 K.
similar trajectory although the time to settle down
was longer than the time optimal controller. PID Controller tT [s]
and PPP controller’s settling time was the shortest TO 887
of the classical controllers, but the trajectory of PID 2386
control FJ and the state TR for PPP was oscillating.
PI 18232
PI and Pm gave smoother results with respect to the
PPP 2450
reactor temperature and the control trajectory (FJ)
as no substantial under-shooting was observed in Pm 3400
Fig. 4. Trajectory of jacket temperature (TJ) with time optimal (TO)
and different PID based controllers.
Sharma A et al., Comparative study of Time Optimal Controller with PID Controller… 31
a
Fig. 5. Trajectory of reactant A concentration (cA) with time optimal (TO)
and different PID based controllers.
The time required to reach the third steady state better comparison. It is clear that the time optimal
reactor temperature by classical controllers de- (TO) control required the minimum time to reach
signed in this paper, when compared to the time the objective.
required by time optimal control from Table 4, acts
as the distinguishing point between all controllers Conclusions
as the objective of the case study was to reach the
third steady state in minimum time. The control In this paper, the time optimal control to achieve
trajectory for the time optimal control comprises a specified conversion of a single reactant, single
of two piecewise constant values, and both being product, irreversible non-linear CSTR has been
on the boundary of allowed control. In Fig. 5, the studied. The time optimal controller has been
trajectory of reactant A concentration is presented compared to classical PID based controllers. Math-
and compared for different controllers. As it can be ematical modelling of the system was done using
seen in Fig. 5a, all controllers are able to bring the mass and heat balances. A literature case study was
concentration of reactant A to the desired steady then solved numerically to find the time optimal
state value. Fig. 5b provides a zoom of Fig. 5a for control of this process and the bang-bang type
32 Sharma A et al., Comparative study of Time Optimal Controller with PID Controller…
control with only upper and lower boundary values Čižniar M, Fikar M, and Latifi AM (2005) MATLAB
was identified as the most suitable. The same case dynamic optimization code dynopt. User’s guide, KIRP
study was then controlled with PID, PI and P con- FCHPT STU Bratislava, Slovak Republic, Technical
Report.
trollers. The process was controlled to the steady
Hull D (2003) Optimal Control Theory for Applications,
state reactor temperature but these controllers re- ser. Mechanical Engineering Series. Springer.
quired more time than the time optimal control to Javinsky A, Kadlec H (1970) Optimal Control of a
reach this steady state. Time required to reach the Continuous Flow Stirred Tank Chemical Reactor.
desired concentration of the reactant was compared AlChE Journal. 916—924.
with that of the time optimal control, and the time Kim HJ, Lee MH, Han C, Chang KS (1998) Time-
optimal control proved to be the best of the studied Optimal control of MMA-MA copolymerization in a
CSTR for grade change. Korean Journal of Chemical
controllers to achieve the objective of this study.
Engineering. 15(1): 45—50.
Lyuben L (2007) Chemical Reactor Design and Control.
Acknowledgement John Wiley & Sons. Inc., Hoboken, New Jersey, USA.
This publication is the result of the Research & Develop- Oravec J, Bakošová M (2012) PIDDESIGN — Software
ment Operational Programme for the project University for PID Control Education. In IFAC Conference on
Scientific Park STU in Bratislava, ITMS 26240220084, Advances in PID Control. 2(1): 691—696.
supported by the Research & Development Operational Pathak K, Markana A, Parekh N (2010) Optimal control
of CSTR. Electroanalytical Chemistry. 3: 199—296.
Programme funded by the ERDF
Shakib Joo AD (2013) A Comparison of Different
Control Design Methods for the Linearized CSTR
References Temperature Model. Journal of Electrical and
Computer Engineering Innovations. 1(2): 107—114.
Allwin S, Biksha NS, Abirami S, Kala H, Udhaya PA (2014)
Comparison of Conventional Controller with Model
Predictive Controller for CSTR Process. International
Journal of Advanced Research in Electrical, Electronics
and Instrumentation Engineering. 3(9): 11934—11941.
Sharma A et al., Comparative study of Time Optimal Controller with PID Controller… 33