design, implementation, and real- time...

19
http://www.iaeme.com/IJEET/index.asp 126 [email protected] 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 REAL- TIME SIMULATION OF A CONTROLLER- BASED 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

Upload: trinhbao

Post on 29-Jul-2018

218 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: DESIGN, IMPLEMENTATION, AND REAL- TIME …iaeme.com/MasterAdmin/uploadfolder/IJEET_07_03_011/IJEET_07_03_… · of the nonlinear MIMO CSTR in the Matlab/Simulink platform is presented

http://www.iaeme.com/IJEET/index.asp 126 [email protected]

International Journal of Electrical Engineering & Technology (IJEET) Volume 7, Issue 3, May–June, 2016, pp.126–144, 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 REAL-

TIME SIMULATION OF A CONTROLLER-

BASED 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. 126–144.

http://www.iaeme.com/ijeet/issues.asp?JType=IJEET&VType=7&IType=3

Page 2: DESIGN, IMPLEMENTATION, AND REAL- TIME …iaeme.com/MasterAdmin/uploadfolder/IJEET_07_03_011/IJEET_07_03_… · of the nonlinear MIMO CSTR in the Matlab/Simulink platform is presented

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

MIMO Closed Loop System

http://www.iaeme.com/IJEET/index.asp 127 [email protected]

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 Multi-

Output (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

Page 3: DESIGN, IMPLEMENTATION, AND REAL- TIME …iaeme.com/MasterAdmin/uploadfolder/IJEET_07_03_011/IJEET_07_03_… · of the nonlinear MIMO CSTR in the Matlab/Simulink platform is presented

Julius Ngonga Muga, Raynitchka Tzoneva and Senthil Krishnamurthy

http://www.iaeme.com/IJEET/index.asp 128 [email protected]

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 an 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.

Fresh Feed of A

AC

OT

inq

T

AC

T

cq

Inlet coolant temperature

cq

COT Effluent

COT

AOC

q

Stirrer

Coolant jacket

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 temperature 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:

Page 4: DESIGN, IMPLEMENTATION, AND REAL- TIME …iaeme.com/MasterAdmin/uploadfolder/IJEET_07_03_011/IJEET_07_03_… · of the nonlinear MIMO CSTR in the Matlab/Simulink platform is presented

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

MIMO Closed Loop System

http://www.iaeme.com/IJEET/index.asp 129 [email protected]

1( , ( )) ( ) ( )( ) ( ) ( ) ( )A

A AO A

dC qf C T t C C r t

dt Vt t t t

(1)

2

( )( , ) 0 ( ) 1 expc PC c

A o CO

P P P c

C qdT q H r hAf C T T T T T

dt V C C V C q

(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:

exp( )o A

Er k C

RT

(3)

where AC is the measured product concentration, 0AC is the feed concentration, 0k

is the reaction rate constant or the pre-exponential factor, 0T is the feed temperature,

COT is the Inlet coolant temperature, T is the measured reactor temperature, cq is the

coolant flow rate, q is the process feed flow rate, and c are the liquid densities,

and P PCC C 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 )( AC lmol /0989.0 CSTR volume )(V l100

Temperature )(T K7763.438 Heat transfer term )(hA )./(min10*7 5 kcal

Coolant flow rate )( cq min/103l Reaction rate constant )( ok 110 min10*2.7

Process flow rate )(q min/0.100 l Activation energy )/( RE K410*1

Feed concentration )( AOC lmol /1 Heat of reaction )( H molcal /10*2 5

Feed temperature )( OT K0.350 Liquid densities ),( c lgal /10*1 3

Coolant temperature )( COT K0.350 Specific heats ),( PCP CC )./(1 kgcal

Table 2 Steady state operating points

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

Operating points )(lpmq )(lpmqC )/( lmolCA )(KT

Operating points 1 102 97 0.0762 444.7

Operating points 2 100 103 0.0989 438.77

Operating points 3 98 109 0.01275 433

Page 5: DESIGN, IMPLEMENTATION, AND REAL- TIME …iaeme.com/MasterAdmin/uploadfolder/IJEET_07_03_011/IJEET_07_03_… · of the nonlinear MIMO CSTR in the Matlab/Simulink platform is presented

Julius Ngonga Muga, Raynitchka Tzoneva and Senthil Krishnamurthy

http://www.iaeme.com/IJEET/index.asp 130 [email protected]

function of the temperature. This type of nonlinearity is generally considered significant [17].

a)

b)

Figure 2 Time response of a) concentration and b) temperature for (±10%) step changes in q

and cq

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:

0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 50.05

0.06

0.07

0.08

0.09

0.1

0.11

0.12

X: 1.168

Y: 0.1166

Time [minutes]

Concentr

ation C

A o

f A

[m

ol/L]

open loop step response curves for concentration

+10% step change in q with qc constant

-10% step change in q with qc constant

+10% step change in qc with q constant

-10% step change in q with qc constant

X: 4.681

Y: 0.1083X: 1.355

Y: 0.09537

X: 1.537

Y: 0.07623

X: 0.1722

Y: 0.08288

X: 3.322

Y: 0.0563

X: 2.307

Y: 0.06389

nominal values of q and qc

0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5434

436

438

440

442

444

446

448

450

452

X: 4.434

Y: 450.4

X: 2.025

Y: 451.2

Time [minutes]

Tem

pera

ture

response o

f A

[K

]

open loop step response curves

+10% step change in qc with q constant

response for nominal values of q and qc

+10% step change in q with qc constant

-10% step change in q with qc constant

-10% step change in qc with q constant

X: 1.538

Y: 450.5

X: 1.229

Y: 438.1

X: 2.037

Y: 444.7

X: 4.625

Y: 438.8

X: 4.964

Y: 437.2

Page 6: DESIGN, IMPLEMENTATION, AND REAL- TIME …iaeme.com/MasterAdmin/uploadfolder/IJEET_07_03_011/IJEET_07_03_… · of the nonlinear MIMO CSTR in the Matlab/Simulink platform is presented

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

MIMO Closed Loop System

http://www.iaeme.com/IJEET/index.asp 131 [email protected]

A AS 1

S 2

C - C xx = = = State variables

T -T x

,

s 1

c cs 2

q - q uu = = = Control variables

q - q u

A AS 1

S 2

C - C xy = = = Output variables

T -T x

where s, , qAS SC T and csq 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,41*101a = E / R

,13

1.44*10 ,o

2

p

(- H)ka =

rC

0.01,

c pc

3

p

r Ca =

rC V and 7004

p

-hAa =

rc , the Equations (1) - (3) may

be written as:

1 2-a / x AO 1 11 1 2 o 1

(C - x )uf (x ,x )= -k x e +

V (4)

4 21 2 -a / u-a / x O 2 12 1 2 2 1 3 CO 2 2

(T - x )uf (x ,x )= a x e + +a (T - x )u *(1- e )

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:

1 2 1 2

1 2 4 2 1 2

1 1 1

( / ) ( / )2

2

2 1 1 2 13 2( / ) ( / ) ( / )2

2

( )

e ( e )

1 ( )( 1)

e e ( e )

o o

a x a x

a a a u a x

u k a k x

V xA

a u a a xa u

V x

4 2

1

2 3 4 23 2( / )

2 4 2

( )0

( ) 1 ( ( ))( 1)( )e ( exp( / ))

Ao

o COCOa u

C x

VB

T x a a T xa T x

V u a u

Substitution of the nominal steady state parameter values at the given operating

point 1 in the above matrices, it is obtained:

13.9 0.046

2518.6 7.9A

0.0092 0

0.947 0.9413B

1 0

0 1C

(6)

From Equation (6) the matrix transfer function of the linearized CSTR is found to be:

2 211 12

21 22

2 2

0.009238 0.02633 0.04672

( ) ( ) 5.99 17.58 5.99 17.58( )

( ) ( ) 0.947 10.66 0.9413 13.11

5.99 17.58 5.99 17.58

( )

( )P

s

G s G s s s s sG s

G s G s s s

s s s s

Y s

U s

Page 7: DESIGN, IMPLEMENTATION, AND REAL- TIME …iaeme.com/MasterAdmin/uploadfolder/IJEET_07_03_011/IJEET_07_03_… · of the nonlinear MIMO CSTR in the Matlab/Simulink platform is presented

Julius Ngonga Muga, Raynitchka Tzoneva and Senthil Krishnamurthy

http://www.iaeme.com/IJEET/index.asp 132 [email protected]

where,

1 1

2 2

( ) ( )( ) ; ( )

( ) ( )

U s Y sU s Y s

U s Y s

(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 1 2Y (s) and Y (s)

independently, in spite of changes in1 2

U and U(s) (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.

Pant modelController Decoupler

1( )U s

2 ( )U s

1( )Y s

2 ( )Y s

2 ( )V s

1( )V s1( )R s

2 ( )R s

1( )E s

2 ( )E s

Apparent plant model

( )C s ( )D s ( )PG s

Figure 3 The decoupled closed loop control system

Decoupling at the input of a 2 2x process transfer function PG (s) requires the design

of a transfer function matrix D(s) , such that PG (s)D(s) is a diagonal transfer function

matrix Q(s), where;

( ) ( ) ( )PQ s G s D s ,

11 12 11 12

21 22 21 22

11

22

1 1

2 2

( ) ( ) ( ) ( )( ) , ( )

( ) ( ) ( ) ( )

( ) 0( )

0 ( )

( ) ( )( )

( ) ( )

P

D s D s G s G sD s G s

D s D s G s G s

Q sQ s

Q s

Y s V sand Q s

Y s V s

(8)

For complete decoupling the decouplers should be designed according to the

equation:

1( ) ( ). ( )

PD s G s Q s

(9)

Then the diagonal elements of the decoupler are set to be 1 and the off-diagonal elements are as follows:

Page 8: DESIGN, IMPLEMENTATION, AND REAL- TIME …iaeme.com/MasterAdmin/uploadfolder/IJEET_07_03_011/IJEET_07_03_… · of the nonlinear MIMO CSTR in the Matlab/Simulink platform is presented

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

MIMO Closed Loop System

http://www.iaeme.com/IJEET/index.asp 133 [email protected]

1

2

1 ( )( )

( ) 1

D sD s

D s

(10)

12 21

1 2

11 22

( ) ( )( ) ( )

( ) ( );

G s G sD s D s

G s G s ,

12 21

11

22

21 12

22

11

( ) ( )( ) 0

( )( )

( ) ( )0 ( )

( )

G s G sG s

G sQ s

G s G sG s

G 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:

11

0.009238* ( )

( 13.93)G s

s

, 22

0.9413*( )

( 2.85)G s

s

(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.

1( )Y s

G22

G12

G11

1( )U s

2 ( )U s

2 ( )Y s

C1

C2

1( )E s

2 ( )E s

1( )R s

2 ( )R s

D2

D1

11( )U s

22 ( )U s

21( )U s

12 ( )U s

11( )Y s

21( )Y s

12 ( )Y s

22 ( )Y s

G21

Figure 4 The decoupled closed loop system.

Page 9: DESIGN, IMPLEMENTATION, AND REAL- TIME …iaeme.com/MasterAdmin/uploadfolder/IJEET_07_03_011/IJEET_07_03_… · of the nonlinear MIMO CSTR in the Matlab/Simulink platform is presented

Julius Ngonga Muga, Raynitchka Tzoneva and Senthil Krishnamurthy

http://www.iaeme.com/IJEET/index.asp 134 [email protected]

It is therefore prudent to use the PI controller which has the ideal transfer function

of the form: P IC(s)= K (1+K (1 / s)) , where P IK and K 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 11

22 2

1(1 ) 0

( ) 0( )

0 ( ) 10 (1 )

P I

P I

K KC s s

C sC s

K Ks

(13)

The outputs of the two separate non- interacting closed loops are:

1 1 11 12

1 1 1

0.009238( )( ) ( )

(13.93 0.00923 ) 0.009238P P I

P P I

K s K KY s R s

s s K K K

(14)

2 2 22 22

2 2 2

0.947( )( ) ( )

( 2.85 0.947 ) ( 0.947 )P P I

P P I

K s K KY s R s

s s K K K

(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.

Page 10: DESIGN, IMPLEMENTATION, AND REAL- TIME …iaeme.com/MasterAdmin/uploadfolder/IJEET_07_03_011/IJEET_07_03_… · of the nonlinear MIMO CSTR in the Matlab/Simulink platform is presented

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

MIMO Closed Loop System

http://www.iaeme.com/IJEET/index.asp 135 [email protected]

The time response characteristics of the closed loop TITO CSTR processes for the

concentration and temperature are illustrated in Figures 6a and 6b respectively:

a)

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.

0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5

0.08

0.09

0.1

0.11

0.12

0.13

0.14

X: 1.26

Y: 0.1355

Time [min]

Co

nc

en

tra

tio

n[m

ol/L

]

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

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

Setpoint

Tracking concentration response

0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5440

445

450

455

460

X: 0.62

Y: 459.1

Time [min]

Tem

peratu

re[K

]

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

decouling tracking temperature response

Setpoint

Page 11: DESIGN, IMPLEMENTATION, AND REAL- TIME …iaeme.com/MasterAdmin/uploadfolder/IJEET_07_03_011/IJEET_07_03_… · of the nonlinear MIMO CSTR in the Matlab/Simulink platform is presented

Julius Ngonga Muga, Raynitchka Tzoneva and Senthil Krishnamurthy

http://www.iaeme.com/IJEET/index.asp 136 [email protected]

a)

b)

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

control input

a)

0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 50.04

0.06

0.08

0.1

0.12

0.14

0.16

0.18

ysp1=0.0762

ysp2=0.13

ysp3=0.10

noise of +/-0.04 mol/L

X: 0.76

Y: 0.1637

Time [min]

Co

nce

ntr

atio

n[m

ol/L

]

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

Setpoint

Tracking concentration response with noise on y1

0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5

0.08

0.09

0.1

0.11

0.12

0.13

0.14

X: 0.68

Y: 0.1369

Time [min]

Co

nce

ntr

atio

n[m

ol/L

]

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

ysp1=0.0762

ysp2=0.13

ysp3=0.10

noise on u1 of +/-40L/min

Setpoint

Tracking concentration response with noise on u1

0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5435

440

445

450

455

460

465

ysp1=444.7

ysp2=455

noise +/- 8K

X: 0.61

Y: 462.8

Time [min]

Te

mp

era

ture

[K]

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

Setpoint

Tracking temperature response with noise

Page 12: DESIGN, IMPLEMENTATION, AND REAL- TIME …iaeme.com/MasterAdmin/uploadfolder/IJEET_07_03_011/IJEET_07_03_… · of the nonlinear MIMO CSTR in the Matlab/Simulink platform is presented

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

MIMO Closed Loop System

http://www.iaeme.com/IJEET/index.asp 137 [email protected]

b)

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

a)

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

0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5440

445

450

455

460

ysp1=445

ysp2=455

ysp3=445

noise of +/-0.04 mol/L on y1

X: 0.63

Y: 459

Time [min]

Te

mp

era

ture

[K]

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

Setpoint

Tracking temperature response with noise on y1

0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5440

445

450

455

460

ysp1=445

ysp2=455

noise on u1 of +/-40l/min

X: 0.63

Y: 458.8

Time [min]

Te

mp

era

ture

[K]

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

Setpoint

Tracking temperature response with noise on u1

Page 13: DESIGN, IMPLEMENTATION, AND REAL- TIME …iaeme.com/MasterAdmin/uploadfolder/IJEET_07_03_011/IJEET_07_03_… · of the nonlinear MIMO CSTR in the Matlab/Simulink platform is presented

Julius Ngonga Muga, Raynitchka Tzoneva and Senthil Krishnamurthy

http://www.iaeme.com/IJEET/index.asp 138 [email protected]

a)

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

0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5

0.08

0.09

0.1

0.11

0.12

0.13

0.14

X: 0.7

Y: 0.1362

Time [min]

Co

nce

ntr

atio

n[m

ol/L

]

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

ysp1=0.0762

ysp2=0.13

ysp3=0.10

noise on y2 of +/-8K

Setpoint

Tracking concentration response with noise on y2

0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5

0.08

0.09

0.1

0.11

0.12

0.13

0.14

X: 0.7

Y: 0.1365

Time [min]

Co

nce

ntr

atio

n[m

ol/L

]

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

ysp1=0.0762

ysp2=0.13

ysp3=0.10

noise on u2 of +/-40L/min

Setpoint

Tracking concentration response with noise on u2

Page 14: DESIGN, IMPLEMENTATION, AND REAL- TIME …iaeme.com/MasterAdmin/uploadfolder/IJEET_07_03_011/IJEET_07_03_… · of the nonlinear MIMO CSTR in the Matlab/Simulink platform is presented

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

MIMO Closed Loop System

http://www.iaeme.com/IJEET/index.asp 139 [email protected]

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 real-

time. 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.

Page 15: DESIGN, IMPLEMENTATION, AND REAL- TIME …iaeme.com/MasterAdmin/uploadfolder/IJEET_07_03_011/IJEET_07_03_… · of the nonlinear MIMO CSTR in the Matlab/Simulink platform is presented

Julius Ngonga Muga, Raynitchka Tzoneva and Senthil Krishnamurthy

http://www.iaeme.com/IJEET/index.asp 140 [email protected]

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)

Page 16: DESIGN, IMPLEMENTATION, AND REAL- TIME …iaeme.com/MasterAdmin/uploadfolder/IJEET_07_03_011/IJEET_07_03_… · of the nonlinear MIMO CSTR in the Matlab/Simulink platform is presented

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

MIMO Closed Loop System

http://www.iaeme.com/IJEET/index.asp 141 [email protected]

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

Page 17: DESIGN, IMPLEMENTATION, AND REAL- TIME …iaeme.com/MasterAdmin/uploadfolder/IJEET_07_03_011/IJEET_07_03_… · of the nonlinear MIMO CSTR in the Matlab/Simulink platform is presented

Julius Ngonga Muga, Raynitchka Tzoneva and Senthil Krishnamurthy

http://www.iaeme.com/IJEET/index.asp 142 [email protected]

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 applications 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] Aris, R. and Amundson N. An analysis of chemical reactor stability and control—I. Chemical Engineering Science, 7(8), 2000, pp. 121–131.

[2] 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. 570–576.

[3] 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, 816–820.

[4] Bequette, B. Nonlinear control of chemical processes: a review. Industrial & Engineering Chemistry Research Ind. Eng. Chem. Res., 30, 1990, pp. 1391–1413.

[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. 1735–1740.

[7] Henson, M. and Seborg D. Input-output linearization of general nonlinear processes. AIChE Journal AIChE J., 36, 1990, pp. 1753–1757.

Page 18: DESIGN, IMPLEMENTATION, AND REAL- TIME …iaeme.com/MasterAdmin/uploadfolder/IJEET_07_03_011/IJEET_07_03_… · of the nonlinear MIMO CSTR in the Matlab/Simulink platform is presented

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

MIMO Closed Loop System

http://www.iaeme.com/IJEET/index.asp 143 [email protected]

[8] Jevtović, B. and Mataušek M. PID controller design of TITO system based on ideal decoupler. Journal of Process Control, 20, 2010, pp. 869–876.

[9] 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.

[10] 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. 654–660.

[11] Maghade, D. and Patre B. Decentralized PI/PID controllers based on gain and phase margin specifications for TITO processes. ISA Transactions, 51, 2012, pp. 550–558.

[12] http://www.mathworks.com

[13] Pottman, M. and Seborg D. Identification of non-linear processes using reciprocal multi-quadric functions. Journal of Process Control, 2, 1992, pp. 189–203.

[14] 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.

[15] Uppal, A., Ray, W. and Poore A. On the dynamic behavior of continuous stirred tank reactors. Chemical Engineering Science, 29, 1974, pp. 967–985.

[16] 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.

[17] 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.

[18] 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. 104–123.

[19] 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. 639–644

[20] 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

[21] Marinescu, B. Output feedback pole placement for linear time-varying systems with application to the control of nonlinear systems. Automatica, 46: 2010, pp. 1524–1530.

[22] Hammer, J. State feedback control of nonlinear systems: a simple approach. International Journal of Control, 87(1): 2014, pp. 143–160.

[23] 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. 76–80.

[24] Dr. V.Balaji, E.Maheswari, Model Predictive Control Techniques For CSTR Using Matlab. International Journal of Electrical Engineering & Technology , 3(3), 2012, pp. 121–129.

[25] 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. 103–114.

Page 19: DESIGN, IMPLEMENTATION, AND REAL- TIME …iaeme.com/MasterAdmin/uploadfolder/IJEET_07_03_011/IJEET_07_03_… · of the nonlinear MIMO CSTR in the Matlab/Simulink platform is presented

Julius Ngonga Muga, Raynitchka Tzoneva and Senthil Krishnamurthy

http://www.iaeme.com/IJEET/index.asp 144 [email protected]

[26] Sujatha, V. and Panda, R. Control configuration selection for multi input multi output processes. Journal of Process Control, 23(10): 2013, pp.1567–1574

[27] 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. 1735–1740

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).