You are on page 1of 19

International Journal of Electrical Engineering & Technology (IJEET)

Volume 7, Issue 3, MayJune, 2016, pp.126144, Article ID: IJEET_07_03_011


Available online at
http://www.iaeme.com/ijeet/issues.asp?JType=IJEET&VType=7&IType=3
ISSN Print: 0976-6545 and ISSN Online: 0976-6553
Journal Impact Factor (2016): 8.1891 (Calculated by GISI) www.jifactor.com
IAEME Publication

DESIGN, IMPLEMENTATION, AND REALTIME SIMULATION OF A CONTROLLERBASED DECOUPLED CSTR MIMO CLOSED
LOOP SYSTEM
Julius Ngonga Muga, Raynitchka Tzoneva and Senthil Krishnamurthy
Cape Peninsula University of Technology
Department of Electrical, Electronic and Computer Engineering
Bellville Campus, P.O. Box 1906, Bellville, South Africa - 7535
ABSTRACT
In this paper, dynamic decoupling control design strategies for the MIMO
Continuous Stirred Tank Reactor (CSTR) process characterised by
nonlinearities, loop interaction and the potentially unstable dynamics, are
presented. Simulations of the behavior of the closed loop decoupled system are
performed in Matlab/Simulink. Software transformation technique is proposed
to build a real-time module of the developed in Matlab/Simulink environment
software modules and to transfer it to the real-time environment of TwinCAT
3.1 software of the Beckhoff PLC. The simulation results from the
investigations done in Simulink and TwinCAT 3.1 software platforms have
shown the suitability and the potentials of the method for design of the
decoupling controller and of merging the Matlab/Simulink control function
blocks into the TwinCAT 3.1 function blocks in real-time. The merits derived
from such integration imply that the existing software and its components can
be re-used. The paper contributes to implementation of the industrial
requirements for portability and interoperability of the PLC software.
Key words : Continuous Stirred Tank Reactor, Decoupling control, Closed
loop system, Programmable Logic Controller, Real-time simulation
Cite this Article: Julius Ngonga Muga, Raynitchka Tzoneva and Senthil
Krishnamurthy, Design, Implementation, and Real- Time Simulation of A
Controller-Based Decoupled CSTR MIMO Closed Loop System.
International Journal of Electrical Engineering & Technology, 7(3), 2016, pp.
126144.
http://www.iaeme.com/ijeet/issues.asp?JType=IJEET&VType=7&IType=3

http://www.iaeme.com/IJEET/index.asp

126

editor@iaeme.com

Design, Implementation, and Real-Time Simulation of A Controller-Based Decoupled CSTR


MIMO Closed Loop System

1. INTRODUCTION
The control of the MIMO Continuous Stirred Tank Reactor (CSTR) process requires a
careful design because of its existing nonlinearities, loop interactions and the
potentially unstable dynamics. Various methods for design of controllers for this
process are based on utilisation of the linear and nonlinear control theories. Thus
developing and implementing controllers which are suitable when process
nonlinearities must be accounted for, is of great interest for both academy and
industry. Plenty of research papers on the analysis and control of nonlinear systems
are available and many different methods have been proposed. Such approaches are
feedback linearization, back stepping control, sliding mode control, trajectory
linearization based on Lyapunov theory, those based on Differential Geometry
concepts, as well as those based on artificial computing approaches, etc. A few
examples are from [18], [19], [20], [21], and [22].
Another challenging aspect is if the system to be controlled is Multi-Input MultiOutput (MIMO). In MIMO systems the coupling between different inputs and outputs
makes the controller design to be difficult. Generally, each input will affect every
output of the system. Because of this coupling, signals can interact in unexpected
ways. One solution is to design additional controllers to compensate for the process
and control loop interactions [23], [24], and [25].
The method, investigated in the paper for design of a controller for the CSTR is
based on linearisation and decoupling of the linearised process model into independed
SISO submodels. Decoupling control pre-compensates for the interactions so that
each output is controlled independently. This control strategy has been used by
several other authors over the years with success, among them [6], [8] and [10].
Another problem in industry is that the existing PLCs have only linear PID
controllers to be used and it is difficult to program more complex linear or nonlinear
controllers in their software environment. New approach to solve this problem is to
transform the models of controllers and control systems build in Matlab/Simulink to
models capable to be used for real-time implementation in a PLC. The paper presents
a methodology for transforming the developed continuous time controller blocks as
well as the complete closed loop systems from Matlab/Simulink environment to the
Beckhoff PLC automation software using the capabilities of TwinCAT 3.1 simulation
environment for real- time control. The Beckhoff CX5020 Programmable Logic
Controller [5] is used for the closed loop real-time control system simulation to show
the effectiveness of the control laws developed for dynamic decoupling control.
The rest of the paper is structured as follows: In section 2, Mathematical modeling
of the nonlinear MIMO CSTR in the Matlab/Simulink platform is presented. In
section 3, the design of the dynamic decoupling controller for the MIMO CSTR
process is described. Section 4 presents the design of the decentralized control for the
MIMO CSTR process. Section 5 describes the transformation procedure of the
developed software from the Matlab/Simulink environment to Beckhoff TwinCAT 3
real-time environment and the results of the real-time simulation. Section 6 gives the
conclusion of the paper.

2. THE IDEAL CSTR PROCESS


The Continuous Stirred Tank Reactor (CSTR) process model is used as a case study
in the design and implementation of various control laws, due to the simplicity o f the
mathematical representation and because of the inherent nonlinearity property of the

http://www.iaeme.com/IJEET/index.asp

127

editor@iaeme.com

Julius Ngonga Muga, Raynitchka Tzoneva and Senthil Krishnamurthy

model. An exothermic CSTR is a common phenomenon in chemical and


petrochemical reaction plants in which an impeller continuously stirs the content of a
tank or reactor, thereby ensuring proper mixing of the reagents in order to achieve a
specific output (product). The process is normally run at steady state with continuous
flow of reactants and products. Exothermic reactors are the most interesting systems
to study because of the potential safety problems (rapid increase in temperature
behavior) and possibility of the exotic behavior such as multiple steady states. This
means that for the same value of the input variable there may be several possible
values of the output variable [1], [2], [4], [9], [14], [15] and [17]. These features
therefore make the CSTR an important model for research. Although industrial
reactors typically have more complicated kinetics than an ideal CSTR, the
characteristic behavior is similar; hence the interesting features can still be realized
using the ideal one. In addition, the CSTR is an example of a MIMO system in which
the formation of the product is dependent upon the reactor temperature and the feed
flow rate. The process has to be controlled by two loops, a concentration control loop
and a temperature control loop. Changes to the feed flow rate are used to control the
product concentration and the changes to the reactor temperature are made by
increasing or decreasing the temperature of the jacket (varying the coolant flow rate).
However, changes made to the feed would change the reaction mass, and hence
temperature, and changes made to temperature would change the reaction rate, and
hence influence the concentration. This is therefore a n example of loop interaction
process. For control design, loop interactions should be avoided because changes in
one loop might cause destabilizing effects on the other loop. The basic scheme of the
CSTR process is shown in Figure 1.
qin

Stirrer

Fresh Feed of A
C AO
TO

qc
TCO

T
CA

Coolant jacket

qc
Effluent

TCO

Inlet coolant temperature

T
CA

Figure 1 A basic scheme of the CSTR Process

Dynamic behavior of the considered CSTR process is developed using mass,


component and energy balance equations [7], [13]. For this study, the system is
assumed to have two state variables; the reactor te mperature and the reactor
concentration and these are also the output variables to be controlled. The
manipulated variables are the feed flow rate and the coolant flow rate. The system is
modelled and analyzed using the parameters specified in Tables 1 and Table 2. These
parameters represent both the steady state and the dynamic operating conditions [16],
[17]. The process has three steady state operating points, given in Table 2. The model
is given by:

http://www.iaeme.com/IJEET/index.asp

128

editor@iaeme.com

Design, Implementation, and Real-Time Simulation of A Controller-Based Decoupled CSTR


MIMO Closed Loop System
f1 (CA (t ), T (t ))

f 2 (CA , T )

dCA
dt

(t )

q
V

(CAO (t ) CA (t )) r (t )

(1)

dT
q
(H )r cCPC qc
hA
0 (To T )

1 exp
T T
dt
V
CP
CPV
CP qc CO

(2)
The nonlinearity of the model is hidden mainly in the computation of the reaction
rate, r which is a nonlinear function of the temperature T and it is computed from the
Arrhenius law, as follows:

r ko exp(

E
RT

)C A

(3)

where CA is the measured product concentration, CA0 is the feed concentration, k0


is the reaction rate constant or the pre-exponential factor, T0 is the feed temperature,
TCO is the Inlet coolant temperature, T is the measured reactor temperature, qc is the
coolant flow rate, q is the process feed flow rate, and c are the liquid densities,
CP and CPC are the specific heat capacities of the liquids, R is the universal gas
constant, E is the activation energy, hA is the heat transfer term H is the heat of
the reaction and V is the CSTR volume.
Table 1 Steady state operating data
Process variable

Nominal
operation
condition

Process variable

Nominal operation
condition

Reactor Concentration (C A )

0.0989 mol / l

CSTR volume (V )

100l

Temperature (T )

438 .7763 K

Heat transfer term (hA)

7 *105 cal /(min.k )

Coolant flow rate (q c )

103l / min

Reaction rate constant (k o )

7.2 *10 10 min 1

Process flow rate (q )

100 .0l / min

Activation energy ( E / R)

1*10 4 K

Feed concentration (CAO )

1mol / l

Heat of reaction (H )

2 *10 5 cal / mol

Feed temperature (TO )

350 .0K

Liquid densities ( , c )

1*103 gal / l

Coolant temperature (TCO )

350 .0K

Specific heats (C P , C PC )

1cal /(g.k )

Table 2 Steady state operating points


Operating points

q(lpm)

qC (lpm)

CA (mol / l )

T (K )

Operating points 1
Operating points 2
Operating points 3

102
100
98

97
103
109

0.0762
0.0989
0.01275

444.7
438.77
433

For the process dynamic analysis, the steady state values from Table 2 for the
operating point 1 are taken as the initial conditions. The process was simulated for
(10%) step changes in each input variable in the Matlab environment. One of the
input variables was kept at the nominal value and the other was changed. The results
are shown in Figures 2 a and 2b. The simulation results demonstrate that the CSTR
process exhibits highly nonlinear dynamic behaviour because of the coupling and the
inter-relationships of the states, and in particular, the exponential dependence of each
state on the reactor temperature as well as the reaction rate being an exponential

http://www.iaeme.com/IJEET/index.asp

129

editor@iaeme.com

Julius Ngonga Muga, Raynitchka Tzoneva and Senthil Krishnamurthy

function of the temperature. This type of nonlinearity is generally considered


significant [17].
open loop step response curves for concentration
0.12

Concentration CA of A [mol/L]

-10% step change in q with qc constant

X: 1.168
Y: 0.1166

0.11

X: 4.681
Y: 0.1083

X: 1.355
Y: 0.09537

0.1

-10% step change in q with qc constant


X: 0.1722
Y: 0.08288

0.09

X: 1.537
Y: 0.07623

0.08

nominal values of q and qc


X: 2.307
Y: 0.06389

0.07

+10% step change in q with qc constant


X: 3.322
Y: 0.0563

0.06
0.05

+10% step change in qc with q constant


0

0.5

1.5

2.5
3
Time [minutes]

3.5

4.5

a)

open loop step response curves


452

+10% step change in qc with q constant


X: 2.025
X: 1.538 Y: 451.2
Y: 450.5

Temperature response of A [K]

450
448

+10% step change inX:q4.434


with qc constant
Y: 450.4

X: 2.037
Y: 444.7 response for nominal values of q and qc

446
444
442
440

X: 4.625
Y: 438.8
-10% step change in q with qc constant
X: 4.964
Y: 437.2

X: 1.229
Y: 438.1

438
436
434

-10% step change in qc with q constant


0

0.5

1.5

2.5
3
Time [minutes]

3.5

Figure 2 Time response of a) concentration and b) temperature for


and qc

4.5

b)
(10%) step changes

in q

Hence, there rises a need to develop control schemes that are able to achieve
tighter control of the process dynamics. Decoupling control strategy is investigated in
the paper to evaluate its capabilities to control the CSTR process. It requires that the
nonlinear system be linearized at the given operating point and the resulting state
space equations can then be directly used in the design of standard linear controllers.

3. DECOUPLING CONTROL STRATEGY


3.1. Linearization and stability analysis
The linearization method is applied to the nonlinear CSTR model of equations (1)- (3)
to give a state space representation where, the state, input, and output vectors are in
the deviation variable form and defined by the following:

http://www.iaeme.com/IJEET/index.asp

130

editor@iaeme.com

Design, Implementation, and Real-Time Simulation of A Controller-Based Decoupled CSTR


MIMO Closed Loop System

CA - CAS x1
q - qs u1
x=
= = State variables u =

= = Control variables
T -TS x2
qc - qcs u2
,

CA - CAS x1
y=
= = Output variables
T - TS x2

where CAS , TS , qs and qcs are the steady state values of the effluent concentration,
reactor temperature, the feed flow rate, and the coolant flow rate respectively .Using
the values of the parameters provided in Tables 1 and 2, and letting, a1 = E / R 1*104
, a2 =

(-H)ko
rCp

1.44 *1013 , a3 =

rcC pc
rC pV

0.01, and a4 =

-hA
700 , the Equations (1) - (3) may
rcp

be written as:
f1(x1 ,x2 )= -ko x1e-a1 / x2 +

f2 (x1 ,x2 )= a2 x1e-a1 / x2 +

(CAO - x1 )u1
V

(4)

(TO - x2 )u1
+a3(TCO - x2 )u2 * (1- e-a4 / u2 )
V

(5)

Then state space equation matrices for the CSTR model (4) and (5) are derived
from the corresponding Jacobian matrices in terms of x and u from which the matrices
of the linear model of the process are:
ko
u1
V e( a1 / x2 )
A

a2

( a1 / a2 )
e

(a1ko x1 )

( x22 e( a1 / x2 ) )

1
u1
(a1a2 x1 )
a3u2 ( ( a4 / u2 ) 1) 2 ( a1 / x2 )
e
V ( x2 e
)

(CAo x1 )

0
V

B
(To x2 ) a ( 1 1)(T x ) (a3a4 (TCO x2 ))
3 ( a4 / u2 )
CO
2
V
e
(u2 exp(a4 / u2 ))

Substitution of the nominal steady state parameter values at the given operating
point 1 in the above matrices, it is obtained:
0
1 0
0.0092
13.9 0.046 B 0.947 0.9413 C 0 1
A
(6)
2518.6 7.9
From Equation (6) the matrix transfer function of the linearized CSTR is found to
be:

0.009238s 0.02633
Y ( s)
G (s) G12 (s) s 2 5.99s 17.58
GP (s) 11

U ( s)
G21 (s) G22 (s) 0.947s 10.66
s 2 5.99s 17.58

http://www.iaeme.com/IJEET/index.asp

131

0.04672

s 5.99s 17.58

0.9413s 13.11
s 2 5.99s 17.58
2

editor@iaeme.com

Julius Ngonga Muga, Raynitchka Tzoneva and Senthil Krishnamurthy


U (s)
Y ( s)
U ( s) 1 ; Y ( s) 1
U 2 (s)
Y2 (s)
where ,

(7)
As can be seen from the transfer function formed, the inputs and outputs are
interacting. Thus, a disturbance at any of the inputs causes a response in all the two
outputs. Such interactions make control and stability analysis very complicated.
Consequently, it is not immediately clear which input to use to control the individual
outputs. It is therefore necessary to reduce or eliminate the interactions by designing
control system that compensates for such interactions so that each output can be
controlled independently of the other output.

3.2. Decoupling controller design


A systematic design procedure is presented for the case of a dynamic decoupling
strategy for the system under study. The control objective is to control Y1(s) and Y2(s)
independently, in spite of changes in U1(s) and U2 (s) . Therefore, to meet these objectives,
the first step is to design the decouplers and secondly, to design the controllers for the
decoupled systems. Most decoupling approaches use the scheme depicted in Figure 3
where the apparent plant model is diagonal.
Apparent plant model
R1 ( s)

E1 ( s)

U1 ( s )

V1 ( s)
Decoupler

Controller

R2 ( s)

E2 ( s )

C (s)

V2 ( s)

D( s)

U 2 (s)

Y1 ( s)
Pant model

GP ( s)

Y2 ( s)

Figure 3 The decoupled closed loop control system

Decoupling at the input of a

2x2 process

transfer function G P (s) requires the design

of a transfer function matrix D(s) , such that GP (s)D(s) is a diagonal transfer function
matrix Q(s), where;
D11 (s) D12 (s)
G11 (s) G12 (s)
, GP (s)

D21 (s) D22 (s)


G21 (s) G22 (s)
0
Y ( s)
V (s)
Q11 (s)
Q(s)
and 1 Q(s) 1

Q22 ( s)
0
Y2 (s)
V2 (s)
D(s)

Q(s) GP (s) D(s) ,

(8)
For complete decoupling the decouplers should be designed according to the
equation:
D(s) GP 1 (s).Q(s)

(9)

Then the diagonal elements of the decoupler are set to be 1 and the off-diagonal
elements are as follows:
http://www.iaeme.com/IJEET/index.asp

132

editor@iaeme.com

Design, Implementation, and Real-Time Simulation of A Controller-Based Decoupled CSTR


MIMO Closed Loop System

1
D ( s)

D( s)

D1 ( s)

D1 ( s)

G12 ( s)
G11 ( s)

(10)

; D2 ( s)

G21 ( s)
G22 ( s)

G12 ( s)G21 (s)

0
G11 ( s) G (s)

22

Q( s )
G21 ( s)G12 (s)

0
G22 ( s)

G11 ( s)

(11)

This choice makes the realization of the decoupler easy. It ensures two
independent SISO control loops. However the diagonal transfer matrix Q( s ) becomes
complicated. This may require an approximation of each term in equation (11) by a
simpler transfer function in order to facilitate easier controller C ( s ) tuning. In this
work, simpler approximations are made possible by representing Q( s ) in the
zero/pole/gain form of first order and then designing additional controllers based on
these approximations. Thus, in the presence of the decouplers, the TITO process is
presented as two independent SISO first order transfer functions, as follows:
G *11 ( s)

0.009238
0.9413
G22 *( s)
( s 13.93) ,
( s 2.85)

(12)

3.3. PI-controller design


Two independent PI controllers are designed for each apparent loop using a pole
placement technique. The relationship between the location of the closed loop poles
and the various time-domain specifications of the process transition behavior are
considered. The design objective is to maintain the system outputs close to the desired
values by driving the output errors to zero at steady state with minimum settling
times. To have no steady state error a controller must have integral action.
The decoupled closed loop system is given in Figure 4.

R1 ( s )

E (s)

U11 ( s )

C1

U1 ( s )

Y11 ( s )

G11

Y1 ( s )

Y12 ( s )

G12

D2
U12 ( s )

Y21 ( s )

U 21 ( s )

G21

D1

R2 ( s )

E2 ( s )

U 22 ( s )
C2

Y22 ( s )

G22

Y2 ( s )

U 2 (s)

Figure 4 The decoupled closed loop system.

http://www.iaeme.com/IJEET/index.asp

133

editor@iaeme.com

Julius Ngonga Muga, Raynitchka Tzoneva and Senthil Krishnamurthy

It is therefore prudent to use the PI controller which has the ideal transfer function
of the form: C(s)= KP(1+ KI (1 / s)) , where KP and KI are the controller tuning parameters
representing its gain constant and the integral gain constant. The pole placement
design method attempts to find a controller setting that gives desired closed loop
poles. Thus the controller transfer function matrix C ( s) of the system under
consideration is given by:
1

K (1 KI 1 )
0

0 P1
C1 (s)
s
C ( s)

C2 (s)
1
0
0
KP 2 (1 KI 2 )

(13)

The outputs of the two separate non- interacting closed loops are:
Y1 (s)
Y2 (s)

0.009238( KP1s KP1KI 1 )


R1 (s)
s s(13.93 0.00923KP1 ) 0.009238KP1KI 1

(14)

0.947( KP 2 s KP 2 KI 2 )
R2 (s)
s s(2.85 0.947KP 2 ) (0.947KP 2 KI 2 )

(15)

The denominators of the above transfer functions are used in a developed pole
placement procedure to determine the values of the parameters of the two PI
controllers.

4. MATLAB/SIMULINK SIMULATION
Simulation results are used to verify the performance of the closed loop system. The
Simulink block diagram is given in Figure 5. Two types of investigations are done for
every control loop: 1) Changing the values of the set points and 2) Changing the
values of the set points under noise conditions in the input and output of the
corresponding closed loop and in the control input and output of the other control
loop.

Figure 5 Dynamic decoupling control implemented in Simulink.

http://www.iaeme.com/IJEET/index.asp

134

editor@iaeme.com

Design, Implementation, and Real-Time Simulation of A Controller-Based Decoupled CSTR


MIMO Closed Loop System

The time response characteristics of the closed loop TITO CSTR processes for the
concentration and temperature are illustrated in Figures 6a and 6b respectively:
Closed loop response of the nonlinear CSTR process under the dynamic decoupling control
0.14
X: 1.26
Y: 0.1355

Concentration[mol/L]

0.13

ysp1=0.0762
ysp2=0.13
ysp3=0.1
Mp=10.2%
ts=0.311min
tr=0.127min

0.12
0.11
0.1
0.09

Setpoint
Tracking concentration response

0.08
0

0.5

1.5

2.5
3
Time [min]

3.5

4.5

a)

Closed loop response of the nonlinear CSTR process under the dynamic decoupling control
460
X: 0.62
Y: 459.1

Temperature[K]

455

450
decouling tracking temperature response
Setpoint
445

440

0.5

1.5

2.5

Time [min]

3.5

4.5

b)

Figure 6 Set-point tracking a) concentration response and b) temperature response

Several other variations in the set-point are investigated to evaluate the time
response performance indices for the rising time, settling time, peak overshoot, and
steady state errors. The investigation showed that the indices remain constant
throughout the set-point variations, hence the dynamic decoupling control is not
sensitive to the set-point variations.
Figure 7 and Figure 8 present the closed loop responses under the conditions of
noises in the input and output of the same control loop. Figure 9 presents the
temperature response when the noises are in the concentration loop input and ouput.
Figure 10 presents the concentration response when the noises are in the temperature
loop input and output.

http://www.iaeme.com/IJEET/index.asp

135

editor@iaeme.com

Julius Ngonga Muga, Raynitchka Tzoneva and Senthil Krishnamurthy


Closed loop response of the nonlinear CSTR process under the dynamic decoupling control
Concentration[mol/L]

0.18
0.16

Setpoint
Tracking concentration response with noise on y1

X: 0.76
Y: 0.1637

0.14
0.12
0.1

ysp1=0.0762
ysp2=0.13
ysp3=0.10
noise of +/-0.04 mol/L

0.08
0.06
0.04

0.5

1.5

2.5

3.5

4.5

Time [min]

a)

Closed loop response of the nonlinear CSTR process under the dynamic decoupling control
Concentration[mol/L]

0.14
X: 0.68
Y: 0.1369

0.13
0.12

ysp1=0.0762
ysp2=0.13
ysp3=0.10
noise on u1 of +/-40L/min

0.11
0.1
0.09

Setpoint
Tracking concentration response with noise on u1

0.08
0

0.5

1.5

2.5

3.5

4.5

Time [min]

b)

Figure 7 Concentration response under noise a) 0.04 mol/lin the ouput and b) 40 l/min in the
control input

Closed loop response of the nonlinear CSTR process under the dynamic decoupling control
465

460

Temperature[K]

Setpoint
Tracking temperature response with noise

X: 0.61
Y: 462.8

455

450

445

ysp1=444.7
ysp2=455
noise +/- 8K

440

435

0.5

1.5

2.5

Time [min]

http://www.iaeme.com/IJEET/index.asp

136

3.5

4.5

a)

editor@iaeme.com

Design, Implementation, and Real-Time Simulation of A Controller-Based Decoupled CSTR


MIMO Closed Loop System

b)
Figure 8 Temperature responses under noise a) 8 K in the ouput and b) 40 l/min in the
control input
Closed loop response of the nonlinear CSTR process under the dynamic decoupling control
460
Setpoint
Tracking temperature response with noise on y1

Temperature[K]

X: 0.63
Y: 459

455

450
ysp1=445
ysp2=455
ysp3=445
noise of +/-0.04 mol/L on y1

445

440

0.5

1.5

2.5

3.5

4.5

Time [min]

a)

Closed loop response of the nonlinear CSTR process under the dynamic decoupling control
460
Setpoint
Tracking temperature response with noise on u1

Temperature[K]

X: 0.63
Y: 458.8

455

450
ysp1=445
ysp2=455
noise on u1 of +/-40l/min

445

440

0.5

1.5

2.5

Time [min]

3.5

4.5

b)

Figure 9 Temperature responses under noise a) 40 l/min in the concentration ouput and b)
0.04 mol/l in the concentration control input

http://www.iaeme.com/IJEET/index.asp

137

editor@iaeme.com

Julius Ngonga Muga, Raynitchka Tzoneva and Senthil Krishnamurthy


Closed loop response of the nonlinear CSTR process under the dynamic decoupling control
0.14
X: 0.7
Y: 0.1362

Concentration[mol/L]

0.13
0.12

ysp1=0.0762
ysp2=0.13
ysp3=0.10
noise on y2 of +/-8K

0.11
0.1
0.09

Setpoint
Tracking concentration response with noise on y2

0.08

0.5

1.5

2.5

3.5

4.5

Time [min]

a)

Closed loop response of the nonlinear CSTR process under the dynamic decoupling control
0.14
X: 0.7
Y: 0.1365

Concentration[mol/L]

0.13
0.12

ysp1=0.0762
ysp2=0.13
ysp3=0.10
noise on u2 of +/-40L/min

0.11
0.1
0.09

Setpoint
Tracking concentration response with noise on u2

0.08

0.5

1.5

2.5

Time [min]

3.5

4.5

b)

Figure 10 Concentration responses under noise a) 8 K in the temperature ouput and b) 40


l/min in the temperature control input

When the separate controll loops for concentration and temperature are subjected
on disturbances in their own inputs and outputs, Figure 7 and 8, good tracking control
is still achieved and the designed decoupling system is good at rejecting the random
variations. The magnitude of the disturbance is important for smooth set point
tracking.
Performances of the temperature control loop when the disturbances are in the
concentration control loop, and vice versa show that the output of the other output
does not influence the considered output, but the input of the other control loop
influences the output of the considered one.This implies that there are still some
elements of interactions in the system.

5. CLOSED LOOP SYSTEM SIMULATION IN REAL-TIME


ENVIRONMENT
MATLAB/Simulink simulation of the developed closed loop system for control of the
CSTR process has shown good behaviour of the concentration and the temperature
under the designed decoupling control. Next question is will this system behave in the
same way under real-time conditions. Beckhoff CX5020 Programmable Logic
Caontroller (PLC) and its software The Windows Control and Automation
Technology (TwinCAT 3.1) through their integration with Matlab/Simulink software
allow answer to this question to be given without separately programming in the

http://www.iaeme.com/IJEET/index.asp

138

editor@iaeme.com

Design, Implementation, and Real-Time Simulation of A Controller-Based Decoupled CSTR


MIMO Closed Loop System

environment of TwinCAT 3.1. Special transformation methodology is developed by


Beckhoff and Matlab for this purpose.
TwinCAT 3.1 is new PC-based PLC automation software that enables control
engineers to model and simulate complex, distributed control applications in realtime. In support to interoperability between different platforms, this new software
supports the development of control applications in Matlab/Simulink environment and
generates executable PLC code based on the models applied to it. To use control
programs and controllers designed in Matlab/Simulink with a real PLC after
successful tests in simulation, the developed algorithms have to be programmed in
real-time capable languages like C++ or PLC code. Matlab/Simulink software is
capable of generating codes from the Simulink models to the various targets by using
the Embedded Simulink Coder (formerly Real-Time Workshop). With the Simulink
Embedded Coder and specially developed supplementary software TE1400 from
Beckhoff automation, called the TwinCAT 3.1 Target for Matlab/Simulink, it makes
it possible for the generation of C++ code which is then encapsulated in a standard
TwinCAT 3.1 module format. This code may be instantiated or loaded into the
TwinCAT 3.1 development platform. The TE1400 software acts as an interface for
the automatic generation of real-time capable modules, which can be executed on the
TwinCAT 3.1 runtime environment. It allows for the generation of the TwinCAT 3.1
runtime modules and provides for the real-time parameter acquisition and
visualisation. The real-time capable module is termed the TwinCAT Component
Object Model (TcCOM). This module can be imported in the TwinCAT 3.1
environment and contains the input and output of the Simulink model.
In this case, the CX5020 PLC acts as a real-time platform for execution of the
applications downloaded from the TwinCAT 3.1 development environment through
the Ethernet communication platform. Through this connection, real-time
communication between the Matlab/Simulink, the TwinCAT 3.1 developed
algorithms, and the PLC is provided. Figure 11 shows the transformed Simulink
closed loop MIMO CSTR process under dynamic control to the corresponding
TwinCAT 3 function blocks (modules). The transformation technique shows that the
data and parameter connection are the same in these two platforms and therefore there
is a one to one correspondence of function blocks between Simulink and TwinCAT
3.1.

Figure 11 Transformed Simulink closed loop model to TwinCAT 3 function blocks

5.1. Experimental results


Figures 12 -14 present the behavior of the closed loop system in real-time.

http://www.iaeme.com/IJEET/index.asp

139

editor@iaeme.com

Julius Ngonga Muga, Raynitchka Tzoneva and Senthil Krishnamurthy

a)

b)
Figure 12 Concentration response under noise a) 0.04 mol/l in the output and
b) 40 l/min in the control input

a)

http://www.iaeme.com/IJEET/index.asp

140

editor@iaeme.com

Design, Implementation, and Real-Time Simulation of A Controller-Based Decoupled CSTR


MIMO Closed Loop System

b)
Figure 13 Concentration responses under noise a) 8 K in the temperature ouput and b) 40
l/min in the temperature control input

a)

b)
Figure 14 Temperature responses under noise a) 0.04 mol/l in the concentration ouput and b)
40 l/min in the concentration control input

Analyses of the obtained figures, further confirm that the designed dynamic
decoupling controller settings achieve tracking contro l of the concentration and
temperature set points in real- time situation and validate the performance of the

http://www.iaeme.com/IJEET/index.asp

141

editor@iaeme.com

Julius Ngonga Muga, Raynitchka Tzoneva and Senthil Krishnamurthy

designed controllers. A comparative analysis with the results presented in section 4


for the closed loop system simulation in Matlab/Simulink shows that the overshoot
has increased but the other performance indices remain the same This showes that
strict requirements for the value of the allowed overshoot have to be followed during
the process of design of the process controllers. The influence of the noises over the
behavior of both the concentration and the temperature is reduced in the conditions of
real-time control. Simulation results verify the suitability of the control for effective
set-point tracking control and disturbance effect minimisation in real-time.

6. CONCLUSION
In this paper, design and real-time implementation of of MIMO closed loop dynamic
decopling control of the CSTR process have been investigated. The simulation results
from the investigation done in Simulink and TwinCAT 3 software platforms using the
model transformation have shown the suitability and the potentials of merging the
Matlab/Simulink control function blocks into the TwinCAT 3.1 function blocks in
real-time. The merits derived from such integration implies that the existing software
and software components can be re- used. This is in line with the requirements of the
industry for portability and interoperability of the PLC programming software
environments. Similarly, the simplification of programming applicatio ns is greatly
achieved. The investigation has also shown that the integration of the
Matlab/Simulink models running in the TwinCAT 3.1 PLC do not need any
modification, hence confirming that the TwinCAT 3.1 development platform can be
used for the design and implementation of controllers from different platforms.

ACKNOWLEDGEMENT
The authors gratefully acknowledge the authorities of Cape Peninsula University of
Technology, South Africa for the facilities offered to carry out this work. The
research work is funded by the National Research Foundation (NRF) THRIP grant
TP2011061100004 and ESKOM TESP grant for the Center for Substation
Automation and Energy Management Systems (CSAEMS) development and growth.

REFERENCES
[1]
[2]

[3]

[4]

Aris, R. and Amundson N. An analysis of chemical reactor stability and control


I. Chemical Engineering Science, 7(8), 2000, pp. 121131.
Bakosova, M. and A. Vasickaninova A. Simulation of Robust Stabilization of a
Chemical Reactor. ECMS 2009 Proceedings edited by J. Otamendi, A. Bargiela,
J. L. Montes, L. M. Doncel Pedrera, 2009, pp. 570576.
Bansode, P. and Jadhav S. Decoupling based predictive control analysis of a
continuous stirred tank reactor. Proc. of the 2015 International Conference on
Industrial Instrumentation and Control (ICIC), 2015, 816820.
Bequette, B. Nonlinear control of chemical processes: a review. Industrial &
Engineering Chemistry Research Ind. Eng. Chem. Res., 30, 1990, pp. 13911413.

[5]

https://www.beckhoff.com/

[6]

Ghosh, A. and Das S. Decoupled periodic compensation for multi-channel output


gain margin improvement of continuous-time MIMO plants. IET Control Theory
& Applications IET Control Theory Appl., 6(11), 2012, pp. 17351740.
Henson, M. and Seborg D. Input-output linearization of general nonlinear
processes. AIChE Journal AIChE J., 36, 1990, pp. 17531757.

[7]

http://www.iaeme.com/IJEET/index.asp

142

editor@iaeme.com

Design, Implementation, and Real-Time Simulation of A Controller-Based Decoupled CSTR


MIMO Closed Loop System
[8]
[9]

[10]

[11]

[12]
[13]
[14]

[15]
[16]

[17]

[18]

[19]

[20]

[21]

[22]
[23]

[24]

[25]

Jevtovi, B. and Matauek M. PID controller design of TITO system based on


ideal decoupler. Journal of Process Control, 20, 2010, pp. 869876.
Kumar, N. and Khanduja N. Mathematical modeling and simulation of CSTR
using MIT rule. Proc of the IEEE 5 th India Intern. Conf. on Power Electronics,
2012.
Luyben, W. Simple method for tuning SISO controllers in multivariable systems.
Industrial & Engineering Chemistry Process Design and Development Ind. Eng.
Chem. Proc. Des. Dev., 25, 1986, pp. 654660.
Maghade, D. and Patre B. Decentralized PI/PID controllers based on gain and
phase margin specifications for TITO processes. ISA Transactions, 51, 2012, pp.
550558.

http://www.mathworks.com
Pottman, M. and Seborg D. Identification of non-linear processes using reciprocal
multi-quadric functions. Journal of Process Control, 2, 1992, pp. 189203.
Russo, L. and Bequette B. Impact of process design on the multiplicity behavior
of a jacketed exothermic CSTR. AIChE Journal AIChE J., 41(1), 1995, pp. 135
147.
Uppal, A., Ray, W. and Poore A. On the dynamic behavior of continuous stirred
tank reactors. Chemical Engineering Science, 29, 1974, pp. 967985.
Vinodha, R., Abraham, S., and Lincoln, S. Prakash. Multiple Model and Neural
based Adaptive Multi-loop Controller for a CSTR Process. International journal
of Electrical and Computing engineering. 5(4), 2010, pp. 251-256.
Vojtesek, J., Novak, J., and Dostal P. Effect of External Linear Model's Order on
Adaptive Control of CSTR. Applied Simulation and Modelling: 2005, pp. 591
598.
Desoer, C. and Wang, Y. Foundations of feedback theory for nonlinear
dynamical systems. IEEE Trans. Circuits Syst. IEEE Transactions on Circuits
and Systems, 27(2): 1980, pp. 104123.
Enqvist, M. and Ljung L. Estimating nonlinear systems in a neighborhood of
LTI-approximants. Proceedings of the 41st IEEE Conference on Decision and
Control, 2002, pp. 639644
Schweickhardt, T. and Allgower, F. Linear modelling error and steady-state
behaviour of nonlinear dynamical systems. In Proc. 44th IEEE Conf. Decision
Control: 2005, pp. 8150-8155
Marinescu, B. Output feedback pole placement for linear time-varying systems
with application to the control of nonlinear systems. Automatica, 46: 2010, pp.
15241530.
Hammer, J. State feedback control of nonlinear systems: a simple approach.
International Journal of Control, 87(1): 2014, pp. 143160.
Liu, R., Liu, G., and Wu, M. A novel decoupling control method for
multivariable systems with disturbances. Proceedings of 2012 UKACC
International Conference on Control: 2012, pp. 7680.
Dr. V.Balaji, E.Maheswari, Model Predictive Control Techniques For CSTR
Using Matlab. International Journal of Electrical Engineering & Technology,
3(3), 2012, pp. 121129.
Olatunji, O. M. And Ayotamuno, M. J, Simulation of A CSTR Model For
Thevetia Peruviana Oil Transesterification In The Production of Biodiesel.
International Journal of Electrical Engineering & Technology, 5(7), 2014, pp.
103114.

http://www.iaeme.com/IJEET/index.asp

143

editor@iaeme.com

Julius Ngonga Muga, Raynitchka Tzoneva and Senthil Krishnamurthy


[26]
[27]

Sujatha, V. and Panda, R. Control configuration selection for multi input multi
output processes. Journal of Process Control, 23(10): 2013, pp.15671574
Ghosh, A. & Das, S. Decoupled periodic compensation for multi-channel output
gain margin improvement of continuous-time MIMO plants. IET Control Theory
& Applications, 6(11): 2012, pp. 17351740

BIOGRAPHIES
Julius Ngonga Muga has MTech in Electrical Engineering from the Cape Peninsula
University of Technology (CPUT), Cape Town and MSc in Electronic Engineering
from the ESIEE, France. He has been a Lecturer at the Technical University of
Mombasa, Kenya between 2009 and 2013. Since 2013 he has been doing research as a
DTech postgraduate at the Department of Electrical, Electronic, and Computer
Engineering, CPUT. His research interest is process instrumentation, classic and
modern control strategies, industrial automation, and application of soft computing
techniques as alternative methods for the control of real-time systems.
Raynitchka Tzoneva has MSc. and Ph.D. in Electrical Engineering (control
specialization) from the Technical University of Sofia (TUS), Bulgaria. She has been
a lecturer at the TUS and an Associate Professor at the Bulgarian Academy of
Sciences, Institute of Information Technologies between 1982 and 1997. Since 1998,
she has been working as a Professor at the Department of Electrical, Electronic, and
Computer Engineering, Cape Peninsula University of Technology, Cape Town. Her
research interest is in the fields of optimal and robust control design and optimization
of linear and nonlinear systems, energy management systems, real-time digital
simulations, and parallel computation. Prof. Tzoneva is a Member of the Institute of
Electrical and Electronics Engineers (IEEE).
Senthil Krishnamurthy received BE and ME in Power System Engineering from
Annamalai University, India and Doctorate Technology in Electrical Engineering
from Cape Peninsula University of Technology, South Africa. He has been a lecturer
at the SJECT, Tanzania and Lord Venkateswara and E.S. College of Engineering,
India. Since 2011 he has been working as a Lecturer at the Department of Electrical,
Electronic and Computer Engineering, Cape Peninsula University of Technology,
South Africa. He is a member of the Niche area Real Time Distributed Systems
(RTDS) and of the Centre for Substation Automation and Energy management
Systems supported by the South African Research Foundation (NRF). His research
interest is in the fields of optimization of linear and nonlinear systems, power
systems, energy management systems, parallel computing, computational intelligence
and substation automation. He is a member of the Institute of Electrical and Electronic
Engineers (IEEE), Institution of Engineers India (IEI), and South African Institution
of Electrical Engineers (SAIEE).

http://www.iaeme.com/IJEET/index.asp

144

editor@iaeme.com

You might also like