You are on page 1of 9

See discussions, stats, and author profiles for this publication at: https://www.researchgate.

net/publication/323993806

An Implementation on Matlab Software for Non-linear Controller Design


Based on Linear Algebra for Quadruple Tank Process

Chapter · March 2018


DOI: 10.1007/978-3-319-77712-2_32

CITATIONS READS

0 72

7 authors, including:

Edison Sasig Edwin Pruna


Universidad de las Fuerzas Armadas-ESPE Universidad de las Fuerzas Armadas-ESPE
4 PUBLICATIONS   4 CITATIONS    43 PUBLICATIONS   65 CITATIONS   

SEE PROFILE SEE PROFILE

Víctor H. Andaluz
Universidad de las Fuerzas Armadas ESPE
116 PUBLICATIONS   325 CITATIONS   

SEE PROFILE

Some of the authors of this publication are also working on these related projects:

Virtual reality View project

tic impacto en la economía de las empresas View project

All content following this page was uploaded by Edison Sasig on 03 March 2019.

The user has requested enhancement of the downloaded file.


An Implementation on Matlab Software
for Non-linear Controller Design Based
on Linear Algebra for Quadruple
Tank Process

Edison R. Sásig, César Naranjo, Edwin Pruna(&),


William D. Chicaiza, Fernando A. Chicaiza, Christian P. Carvajal,
and Victor H. Andaluz

Universidad de las Fuerzas Armadas ESPE, Sangolquí, Ecuador


{erssigs,canaranjo,eppruna,wdchicaiza1,
vhandaluz1}@espe.edu.ec,
fachicaiza@ingenius-scitech.com,
chriss2592@hotmail.com

Abstract. This paper is focused on the design of a control algorithm based on


linear algebra for multivariable systems and its application to control of a
quadruple tank system. In order to design the controller, the system model is
approximated by numerical methods and then a system of linear equations are
solved by least square to obtain the optimal control actions. The strategy presented
in this paper has the advantage of using discrete equations and therefore a direct
implementation in most computer-driven systems is feasible. The simulation
results developed on Matlab software shows the effective of the proposed method.

Keywords: Quadruple tank system  Control system design


Non-linear process  Multivariable control  Linear algebra

1 Introduction

Multivariable and non-linear systems are very common in industrial environment and
control liquid level is one of the most important problem in the process industries as
well as flow between tanks in coupled tank systems (CTS) [1]. Major problem in
control of multivariable system is interaction or coupling effect present between the
inputs and outputs of the system. In such cases conventional multi loop PID control
works when the coupling is less or weak [2]. The quadruple tank system have been
used in visualizing the dynamic interactions and non-linearities exhibited in the
operation of power plants, chemical industries and biotechnological fields [3]. This
process consists in two modules of two cascaded tanks, which can exhibit either
minimum or non-minimum phase behavior with adequate physical tuning [4].
Traditional control methods such as PID, Fuzzy-PID and Multivariable Model Based
Control strategies have been applied to improve the system’s transient performance in [5,
6]. As mentioned in [6], PID control is a powerful method in industrial application owing
to following advantages: great operating flexibility, simple design and tuning. However,

© Springer International Publishing AG, part of Springer Nature 2018


Á. Rocha et al. (Eds.): WorldCIST'18 2018, AISC 746, pp. 333–340, 2018.
https://doi.org/10.1007/978-3-319-77712-2_32
334 E. R. Sásig et al.

PID control cannot be applied to MIMO systems directly. Problem of constrained output
feedback H∞ is considered in [7], where a design procedure of output feedback H∞
controllers is derived via the LMI scheme. A robust controller using sliding mode and
feedback linearization with NDO observer proposed for minimum phase is carried out in
[8] to decrease the effects of the estimated uncertainties.
In the same context, [9] proposes a type 2 fuzzy control, in which it extends the
typical membership functions to the membership functions type interval 2, thereby
efficiently reducing the error against a disturbance.
In [10] is presented the stability in fuzzy control systems for MIMO processes using
the LaSalle’s theorem in which each diffuse rule is separated from the fuzzy MIMO
systems [10], thus reducing complexity in stability analysis and easily implemented
new fuzzy rules. The applicability and efficiency are shown in a MIMO process with
the level control in a system of three spherical tanks.
An adaptive fuzzy control system (AFC) for level position control of two coupled
water tanks is shown in [11], where gains are obtained using the fuzzy identifier model
that are defined by the outputs of the control and the real system. The parameters of the
fuzzy identifier model are linearly adjusted by using least squares; the robustness of the
AFC is achieved with respect to the variation of the water level and the ability to
eliminate external disturbances.
Control based on linear algebra is an innovative technique with main characteristics
such as non-necessity of complex calculations to reach the control signal and the sim-
plicity to make mathematical operations [12]. Therefore, the algorithm can be imple-
mented directly on the ship’s microcontroller without the need to implement it on an
external computer. The aim of this paper is to use the linear algebra theory and numerical
methods to compute optimal control actions on Matlab software without none toolbox.
The important advantage of this approach is that it use simple algorithms that may be
executed in modules with less computing power, thus conserving energy [13, 14].
This paper is organized as follows: in Sect. 2, the mathematical modelling is pre-
sented; Sect. 3 presents the study case and the controller design; later, Sect. 4 shows the
dynamic analysis of the obtained results. Finally, the conclusions are presented in Sect. 5.

2 Mathematical Modelling

The mathematical model of the quadruple-tank process is given by mass balance


equation and Bernoulli’s law as follows [15].

a1 pffiffiffiffiffiffiffiffiffiffi a3 pffiffiffiffiffiffiffiffiffiffi c1 k1
h_ 1 ¼  2gh1 þ 2gh3 þ v1
A1 A1 A1
a2 pffiffiffiffiffiffiffiffiffiffi a4 pffiffiffiffiffiffiffiffiffiffi c2 k2
h_ 2 ¼  2gh2 þ 2gh4 þ v2
A2 A2 A2
ð1Þ
a3 pffiffiffiffiffiffiffiffiffiffi ð1  c2 Þk2
h_ 3 ¼  2gh3 þ v2
A3 A3
a4 pffiffiffiffiffiffiffiffiffiffi ð1  c1 Þk1
h_ 4 ¼  2gh4 þ v1
A4 A4
An Implementation on Matlab Software for Non-linear Controller Design 335

where
Ai cross-section of Tank i;
ai cross-section of Tank i;
hi cross-section of Tank i

A schematic diagram of the process is shown in Fig. 1. The process inputs are v1
and v2 (input voltages to the pumps) and the outputs are y1 ¼ kc h1 and y2 ¼ kc h2
(measured level signals). The voltage applied to pump i is vi and the corresponding
flow is ki vi .

Tank 3 Tank 4

Tank 1 Tank 2
Pump 1
Pump 2
v2
v1

Fig. 1. Schematic diagram of the quadruple tank process.

The parameters ci 2 ð0; 1Þ are determined by the valves position prior to an


experiment. The acceleration of gravity is denoted by g. The parameter values of the
process for two operating points (minimum and non-minimum phase) are given in the
following Table 1.

Table 1. Operating points of QTS.


Parameters Minimum phase Non-minimum phase
h01 ; h02 ½cm 12.4, 12.7 12.6, 13.0
h03 ; h04 ½cm 1.8, 1.4 4.8, 4.9
A1 ; A2 ; A3 ; A4 ½cm2  28, 32, 28, 32 28, 32, 28, 32
a1 ; a2 ½cm2  0.071, 0.057 0.071, 0.057
a3 ; a4 ½cm2  0.071, 0.057 0.071, 0.057
k1 ; k2 ½cm3 =Vs 3.33, 3.35 3.14, 3.29
c1 ; c2 0.70, 0.60 0.43, 0.34
336 E. R. Sásig et al.

3 Controller Design

In this section, the control law based on linear algebra theory and numerical methods is
presented.

3.1 Euler Method and Markov Property


Through the Euler’s approximation the model of the quadruple-tank process (1), the
following model discrete is obtained

h1 ðk þ 1Þh1 ðk Þ
pffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi a pffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi c k1
ts ¼  Aa11 2gh1 ðkÞ þ A31 2gh3 ðk Þ þ A1 1 v1 ðk Þ
h2 ðk þ 1Þh2 ðk Þ
pffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi pffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi
ts ¼  Aa22 2gh2 ðkÞ þ Aa42 2gh4 ðk Þ þ cA2 k22 v2 ðk Þ
pffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi ð2Þ
h3 ðk þ 1Þh3 ðkÞ
ts ¼  Aa33 2gh3 ðk Þ þ ð1c A3
2 Þk2
v2 ð k Þ
h4 ðk þ 1Þh4 ðkÞ
p ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi

ts ¼  Aa44 2gh4 ðk Þ þ ð1c A4
1 Þk1
v1 ð k Þ

where, values of hi at the discrete time t ¼ kts will be denoted as hi ðkÞ, ts is the sample
time, and k 2 f0; 1; 2; 3; 4; 5. . .g. Next by the Markov property and to adjusting the
performance of the proposed control law [10], the state hi ðk þ 1Þ is replaced by

hi ðk þ 1Þ ¼ hdi ðk þ 1Þ  wi ðhdi ðkÞ  hi ðkÞÞ ð3Þ

where, 0 \ wi \ 1 are control parameters that allows to reduce the variations in state
variables and is the desired trajectory.
Remark 1. If a faster response is required, the values should be closer to 0 and if a
slower response is required, the values of should be closer to 1.

3.2 Linear Algebra Theory


Considering (2) and (3) the system of equations can be rearranged in the following
matrix form
2 c1 k1
3 2 hd1 ðk þ 1Þw1 ðhd1 ðkÞh1 ðkÞÞh1 ðkÞ pffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi pffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi 3
0 þ Aa1 2gh1 ðk Þ  Aa3 2gh3 ðk Þ
6 hd2 ðk þ 1Þw2 ðhd2sðkÞh2 ðkÞÞh2 ðkÞ a21 pffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi a41 pffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi 7
A1 t
6 c2 k2 7 
6 0 7 v1 6 þ A2 2gh2 ðk Þ  A2 2gh4 ðk Þ 7
6 7 6 pffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi 7 ð4Þ
7 v2 ¼
A2 ts
6 ð1c2 Þk2 6 hd3 ðk þ 1Þw3 ðhd3 ðk Þh3 ðk ÞÞh3 ðk Þ
þ Aa33 2gh3 ðk Þ 7
4 0 5 |fflffl{zfflffl} 4 5
ð1c1 Þk1
A3 ts
hd4 ðk þ 1Þw4 ðhd4 ðk Þh4 ðk ÞÞh4 ðk Þ
pffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi
A4 0 x þ a4
2gh 4 ð k Þ
|fflfflfflfflfflfflfflfflfflfflfflfflfflfflffl{zfflfflfflfflfflfflfflfflfflfflfflfflfflfflffl} ts A4
|fflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflffl{zfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflffl}
A b

or, in a compact form as.

Ax ¼ b ð5Þ
An Implementation on Matlab Software for Non-linear Controller Design 337

Now, it is necessary to set the conditions for that this system (5) have an exact
solution. One way to ensure this is that vectors and be parallel. This condition can be
expressed as the system (6). In (6), the subscripts denote the position in the matrix.
A1;1 b
A4;1 ¼ b1;1
A2;2
4;1
b ð6Þ
A3;2 ¼ b2;1
3;1

The control objective is to follow the liquid levels h1 ; h2 of the tank 1 and 2 to a
desired trajectory level, respectively. Therefore, it can be deduced that for the system to
have a solution, at least two of the state variables has to take any value so that the
others can follow the references. That variable is called “sacrificed” [12], it is denoted
as hezi with i ¼ 3; 4

c1 k1 hd1 ðk þ 1Þw1 ðhd1 ðkÞh1 ðkÞÞh1 ðkÞ a


pffiffiffiffiffiffiffiffiffiffiffi a3 pffiffiffiffiffiffiffiffiffiffiffi
þ A1 2gh1 ðk ÞA 2gh3 ðk Þ
A1
ð1c1 Þk1 ¼ ts 1
hez4 ðk þ 1Þw4 ðhez4 ðkÞh4 ðkÞÞh4 ðk Þ a4
pffiffiffiffiffiffiffiffiffiffiffi
1

A4 ts þA 2gh4 ðkÞ
c2 k2 hd2 ðk þ 1Þw2 ðhd2 ðkÞh2 ðkÞÞh2 ðkÞ a
4
pffiffiffiffiffiffiffiffiffiffiffi a4 pffiffiffiffiffiffiffiffiffiffiffi ð7Þ
þ A2 2gh2 ðk ÞA 2gh4 ðk Þ
A2
ð1c2 Þk2 ¼ ts 2
hez3 ðk þ 1Þw3 ðhez3 ðkÞh3 ðkÞÞh3 ðk Þ a3
pffiffiffiffiffiffiffiffiffiffiffi
2

A3 ts þA 2gh3 ðkÞ
3

where hezi ðkÞ is obtained at the current sampling time, while hezi ðk þ 1Þ is obtained
through of (7). In addition, at the first sampling time hezi ðk þ 1Þ ¼ hezi ðkÞ is
approximated through of Taylor zero-order approximation. Finally, the optimal control
actions is obtained by least squares, which makes the tracking errors tend to zero in
every sampling time.
To obtain the solution of the matrix system (5) where A 2 Rmn with m [ n
(because the number of equations is greater than the number of unknowns in matrix A),
we are facing a system overdetermined; in which the concept of pseudoinverse is
applied to the left resulting in the following expression.
 
v1  1
¼ AT A AT b ð8Þ
v2

4 Simulation Results

In this section, the performance of the proposed control law is tested thought the two
simulations developed on Matlab software. Both experiments corresponds to the
minimum phase point.
The desired trajectory for quadruple tank process is described by a first order
system response.

hdi ¼ Kp 1  eðkts Þ=T þ h0d ð9Þ
338 E. R. Sásig et al.

18 18

h1d h2d
16 16
h1 h2

[cm]
[cm]

14 14

12 12

10 10
0 200 400 600 0 200 400 600

Time [s] Time [s]

3 2.5

h3ez h4ez

2 h3 2 h4

[cm]
[cm]

1 1.5

0 1
0 200 400 600 0 200 400 600

Time [s] Time [s]

Fig. 2. Tracking trajectory of the all state variables for first experiment.

where Kp ¼ 2 is the gain level, h0d ¼ 11 is the initial desired level and T ¼ 12 is the
closed loop time constant. For all simulations the values of the constants of the con-
troller are ½ w1 w2 w3 w4  ¼ ½ 0:995 0:995 0:995 0:995 .
Figure 2, shows the desired trajectory and the current trajectory of the all state
variables, where the evolution of the tracking errors, which remain close to zero, while
Fig. 3, shows the optimal control actions. In this test is considered a fast response in
closed loop given by T, it can be seen that the proposed controller presents a good
performance.

5.5 6

v1 v2
5
5
4.5

4 4

3.5
[Volt]

[Volt]

3
3

2.5 2

2
1
1.5

1 0
0 200 400 600 0 200 400 600

Time [s] Time [s]

Fig. 3. Time evolution of optimal control actions for first experiment.

For the second experiment, it’s consider the desired trajectory (9) with Kp ¼ 2,
h0d ¼ 15 and T ¼ 20. The desired trajectory and the current trajectory of the all state
variables are plotted in Fig. 4, where the evolution of the tracking errors, which remain
close to zero, while Fig. 5, shows the optimal control actions. In this case a slow
response in closed loop is considered.
An Implementation on Matlab Software for Non-linear Controller Design 339

25 25

h1d h2d

20 h1 20 h2

[cm]
[cm]
15 15

10 10
0 200 400 600 0 200 400 600

Time [s] Time [s]

5 4

h3ez h4ez
4
h3 3 h4

[cm]
[cm]

2
2

1 1
0 200 400 600 0 200 400 600

Time [s] Time [s]

Fig. 4. Tracking trajectory of the all state variables for second experiment.

6 6.5
v1 v2

6
5.5

5.5
5
5

4.5
4.5
[Volt]

[Volt]

4 4

3.5
3.5

3
3
2.5

2.5
2

2 1.5
0 100 200 300 400 500 600 0 100 200 300 400 500 600
Time [s] Time [s]

Fig. 5. Time evolution of optimal control actions for second experiment.

5 Conclusion

In this work it has been presented a control algorithm based on linear algebra and
numerical methods for a quadruple tank process. The presented controller differs from
the existing ones in its easy implementation in a digital system, besides being able to
modify the speed of the closed-loop response given the proposed trajectory. The
presented control algorithm can be implemented in any programming language, in this
case the Matlab platform has been used due to the easiness in the manipulation of
matrices. To demonstrate the efficiency of the proposed algorithm, two types of
experiments were carried out, the first for a fast response in closed loop and the other
for a slow response. Additionally, the control parameters were chosen in such a way
that the control actions are minimal. Finally, the results of the simulation show the
optimal performance of this control algorithm.
340 E. R. Sásig et al.

References
1. Prusty, S.B., Seshagiri, S., Pati, U.C., Mahapatra, K.: Sliding mode control of coupled tanks
using conditional integrators. In: Control Conference (ICC), pp. 146–151. IEEE, Indian
(2016)
2. Vhora, H., Patel, J.: Design of static and dynamic decoupler for coupled quadruple tank level
system. Nirma Univ. J. Eng. Technol. 5, 8–12 (2017)
3. Turki, A., Said, S.H., M’Sahli, F.: Backstepping control for a quadruple tank process based
on adaptive observer. In: 12th International Multi-Conference on Systems, Signals &
Devices (SSD), pp. 1–5. IEEE (2015)
4. Maxim, A., Ionescu, C., De Keyser, R.: Modelling and identification of a coupled sextuple
water tank system. In: IEEE International Conference on Automation, Quality and Testing,
Robotics (AQTR), pp. 1–6. IEEE (2016)
5. Maxim, A., Ionescu, C.M., Copot, C., De Keyser, R., Lazar, C.: Multivariable model-based
control strategies for level control in a quadruple tank process. In: 17th International
Conference on System Theory, Control and Computing (ICSTCC), pp. 343–348. IEEE
(2013)
6. Raj, R., Deepa, S.: Modeling and implementation of various controllers used for
Quadruple-Tank. In: International Conference on Circuit, Power and Computing Technolo-
gies (ICCPCT), pp. 1–5. IEEE (2016)
7. Yu, S., Wang, Y., Wang, J., Chen, H.: Constrained output feedback H∞ control of a
four-tank system. In: IEEE International Conference on Mechatronics and Automation
(ICMA), pp. 2048–2053. IEEE (2016)
8. Azizi, A., Babazadeh, R., Ghiasi, A.: A new combined robust controller using sliding mode
and feedback linearization with NDO observer proposed for minimum phase quadruple tank
process. In: 4th International Conference Control, Instrumentation, and Automation
(ICCIA), pp. 35–41. IEEE (2016)
9. Zhao, T., Li, P., Cao, J.: Study of interval type-2 fuzzy controller for the twin-tank water
level system. Chin. J. Chem. Eng. 20(6), 1102–1106 (2012)
10. Precup, R., Tomescu, M., Preitl, S., Petriu, E., Fodor, J., Pozna, C.: Stability analysis and
design of a class of MIMO fuzzy control systems. J. Intell. Fuzzy Syst. 25(1), 145–155
(2013)
11. Başçi, A., Derdiyok, A.: Implementation of an adaptive fuzzy compensator for coupled tank
liquid level control system. Measurement 91, 12–18 (2016)
12. Rómoli, S., Serrano, M., Ortiz, O., Vega, J., Scaglia, G.: Tracking control of concentration
profiles in a fed-batch bioreactor using a linear algebra methodology. ISA Trans. 57, 162–
171 (2015)
13. Andaluz, V., Sásig, E., Chicaiza, W., Velasco, P.: Linear algebra applied to kinematic
control of mobile manipulators. In: International Conference on Information Theoretic
Security, pp. 297–306. Springer, Singapore (2017)
14. Andaluz, V., Sásig, E., Chicaiza, W., Velasco, P.: Control based on linear algebra for mobile
manipulators. In: Computational Kinematics, pp. 79–86. Springer, Cham (2016)
15. Johansson, K.: The quadruple-tank process: a multivariable laboratory process with an
adjustable zero. IEEE Trans. Control Syst. Technol. 8, 456–465 (2000)

View publication stats

You might also like