You are on page 1of 6

Design and Implementation of a Water Tank Control

System Employing a MIMO PID Controller


Arturo Rojas–Moreno and Arturo Parra–Quispe
Faculty of Electrical and Electronic Engineering, National University of Engineering
Lima, Lima 25, Peru

ABSTRACT for robust control design, in which the nonlinearity is


considered as model uncertainty. An IMC–based ro-
This paper develops a design procedure of a MIMO bust tunable controller design technique is applied to a
PID (Multi-Input-Multi-Output Proportional–Integral– water tank control system. As the design provides an
Derivative) control system for controlling level and on-line tuning method, the controller can be adjusted
temperature in a water tank plant. Such a plant can when the operating point changes. Experimental re-
be described by interconnected nonlinear differential sults show the advantages of this design.
equations, which could complicate the analytical aspects
The study developed in this paper considers a water
of modeling and controller design. However, a linearized
tank system described by interconnected nonlinear dif-
technic was applied to obtain a MIMO linear description,
ferential equations. The objective control consist in
which permit to configure a control system by combining
stabilize level and temperature of the water tank si-
a linear MIMO PID controller acting on the water tank
multaneously employing a MIMO PID controller.
plant. Experimental results demonstrate that the designed
controller is able to stabilize tank level and temperature
simultaneously. The control software was written in
LabVIEW code. 2 MODELING THE PLANT

Keywords: Water tank plant, nonlinear modeling,


Fig. 1 depicts the water tank plant studied here. In
MIMO PID controller, control software, LabVIEW code.
such a plant, cold water is sent to the tank, heated elec-
trically, and sent out. The plant is a MIMO type be-
cause possesses two control inputs: the inflow rate and
1 INTRODUCTION the heater supply, and two controlled outputs: water
level and the temperature in the tank. Table 2 de-
scribes all variables and valued parameters of the plant
Water tank system are being used to illustrate both
into consideration.
traditional and advanced multivariable control strate-
gies. Quantitative Feedback Theory is employed in [1]
to design a robust controller to regulate the liquid level
in two coupled glass tanks. A multivariable laboratory 1
0
0
1 Θi
0
1
process of four interconnected water tanks is considered S: CROSS 0
1
in [2] for modeling and robust control of the tank level. SECTIONAL AREA Qi
Θa
In [2], flow and temperature of a water tank system are
11
00
controlled employing a backstepping method, whereas TEMPERATURE
111111
000000
SENSOR
00
11 00
11
a four tank system laboratory experiment is designed 0
1
Θ111111
000000
011
100
in [4] to illustrate the effects that time-varying dynam-
o 011
100
ics can have on controllability. Also, predictive fuzzy HEATER
H Φi
modeling technique is employed in [5] for analysis of a SUPPLIED
closed water tank, and an Internal Mode Contro–based
PPRESSURE Ao Av
robust tunable controller design technique is applied to SENSOR
a water tank control system in [6]. Qo
V ENA
Regulation of the level of liquid in a tank is a com- CONTRACTA
mon industrial process control problem. The modeling
of the dynamics of the liquid level and flow rate relies Fig. 1: Water tank plant.
on the approximate linearity at the equilibrium point.
A linear fractional transformation framework is set up
1.0, while Cv can take values between 0.8 and 0.99.
Table 1: Variables and valued parameters of the water
Therefore
tank plant.
0.48 ≤ Cd ≤ 0.99 (3)
Symbol Description and value
We assume a value Cd =0.5. From (1), we obtain the
dS tank diameter = 0.25 m first state equation
S tank cross sectional area = 0.041 m2
a√ 1
H water level in steady state = 0.19 m Ḣ = − H + Qi (4)
S S
H water level
h residual h = H − H On the other hand, assuming that the water tempera-
Qi tank inflow rate ture in the tank is uniform, the heat balance is formu-
Qi inflow rate in steady state = 0.16 m3 /h lated as [3]
qi residual qi = Qi − Qi
Qo tank outflow rate ΦT = −Φo − Φs + Φc + Φi (5)
qo residual qo = Qo − Qo where ΦT is the water heat in the tank, Φo is the out-
Rh hydraulic resistance Rh = H = 2700 ms2 flow heat, Φs is the heat released to the air, Φc is the
Q
inflow heat, and Φi is the heater supplied. Also
g gravitational constant = 9.81 m/s2
ρ water density =1000 kg/m3 Q2o dΘo dΘo
ΦT = SρCp 2
= SρCp H (6)
do output orifice diameter = 0.0127 m a dt √ dt
Ao orifice cross sectional area = 0.000126 m2 Φo = Cp ρΘo Qo = Cp ρaΘo H (7)
Av vena cross sectional area = m2 Θo − Θa
Cc area correction between Ao and Av Φs = (8)
Rt
Cv frictional losses correction = 0.8 to 0.99 Φc = Cp ρΘi Qi (9)
Cd discharge coefficient Cd = Cv Cc = 0.5
a discharge factor a = 0.00028 ms
2.5 The second state equation is obtained by solving for
dΘo
Cp water specific heat = 4186.8 kgJK dt = Θ̇o the equation (5)

Rt termal resistance Rt = C 1ρQ = 0.0054 W K a Θo Θ − Θa Θi Qi 1 Φi


p Θ̇o = − √ − o + + (10)
Θa atmosphere temperature = 27.0 C o S H SρCp Rt H A H SρCp H
Θo steady state tank temperature = 31 o C Linearizing equations (4) and (4) for the operation
Θo outflow rate temperature point (H, Θo ) using Jacobian matrices leads to
θo residual θo = Θo − Θo ẋ = Ax + Bu
Φi heater supplied  
1 0
Φi steady state heater supplied = 1540 W y = Cx = x (11)
0 1
ΦT water heat in the tank    
∂f1 ∂f1 ∂f1 ∂f1
Φo outflow rate heat ∂H ∂Θ0 ∂Qi ∂Φi
A= B=
Φs released heat Φs = ΘoR−Θ
t
a ∂f2
∂H
∂f2
∂Θ0
∂f2
∂Qi
∂f2
∂Φi
Φc inflow rate heat
where f1 = Ḣ and f2 = Φ̇o are equations (4) and (10)
respectively, and the residual state and control vectors
x = [h θo ]T and u = [qi Φo ]T are defined by
The rate of water outflow is expressed by        
h H −H qi Qi − Qi
= =
dH θo Θ0 − Θ0 Φo Φ0 − Φ0
S = S Ḣ = Qi − Qo (1) (12)
dt
Performing partial derivatives on (11) produces
where the flow rate through the orifice is [7]
∂f1 a ∂f1
 √ √ = − √ =0
Qo = Cv Cc Ao 2gh = Cd Ao h = a h (2) ∂H 2S H ∂Θo
√ ∂f2 a Θo Θo − θa θi Qi Φi
where a = Cd Ao 2g is the discharge factor, Cc is the =  + 2 − 2 − 2
∂H 2S H 3 SρCp Rt H SH SρCp H
area correction between Ao and Av (see figure 1)
∂f2 a 1
= − √ −
Av = Cc Ao ∂Θo S H SρCp Rt H
∂f1 1 ∂f1
and Cv is a coefficient that considers frictional losses = =0
∂Qi S ∂Φi
through the orifice. The product Cd = Cv Cc , the dis-
∂f2 θi ∂f2 1
charge coefficient, can be determined experimentally = = (13)
for a given orifice. Values of Cc vary between 0.6 and ∂Qi SH ∂Φi SρCp H
3 MIMO PID CONTROLLER DESIGN Static Accuracy
To achieve static accuracy, the vector error
Figure 2 shows the block diagram of a MIMO PID con-
trol system where Gs (s) is the MIMO PID controller, E = R − Y = [I − Gc (s)]R
R is the vector of desired outputs, Y = Gp (s)U (s is
the Laplace variable), and U = Gs (s)[R − Y]. There- for constant step–type R should approach to zero
fore
lim E = 0
t→∞
Gc (s) = (I + Gp (s)Gs (s))−1 Gp (s)Gs (s)
 
Gc11 (s) Gc12 (s) Applying the final–value theorem, a necessary condi-
= (14) tion for zero static accuracy is
Gc21 (s) Gc22 (s)

lim Gc (s) = I (18)


Gs (s) = Gp (s)−1 Gc (s)(I − Gc (s))−1 s→0
 
Gs11 (s) Gs12 (s)
= (15)
Gs21 (s) Gs22 (s) On using condition (18) into (14) produces

lim [I + G(s)] = lim G(s) (19)


s→0 s→0
R E U Y
G s(s) G p (s) which implies that [I + G(0)] = G(0), meaning that
CONTROLLER PLANT each diagonal element of G should approach to ∞ for
s = 0. Therefore, each diagonal element of G must
contain at least one integrator.
Fig. 2: Block diagram of a MIMO PID control system.
Stability
To preserve stability of the designed control system, all
eigenvalues of its characteristic equation det[I+G(s)] =
The MIMO PID control system studied here must sat- 0 must be located on the left side of the s plane [8].
isfy the following performance specifications [8] Since
 
1 + G11 (s) 0
1) No interaction between reference inputs R (the de- I + G(s) = (20)
0 1 + G22 (s)
sired outputs) and outputs Y.
2) Static accuracy. then

3) Stability det[I + G(s)] = (1 + G11 (s))(1 + G22 (s)) = 0


3) Insensitivity to disturbances
implying that (1 + G11 (s) = 0) and (1 + G22 (s)) = 0.

No Interaction Insensitivity to disturbances


To obtain complete decoupling between vectors R and By setting R = 0 and introducing a vector disturbance
Y, matrix Gc (equation (14)) must be diagonal, which Z in figure 2, this turns into the block diagram showed
means transfer functions Gc12 (s) and Gc21 (s) are null. in figure (3) which can be used to compute the effect
A necessary and sufficient condition for noninterac- of disturbances in output vector Y as follows
tion is that the open–loop transfer matrix G(s) =
Gp (s)Gs (s) also be diagonal. This fact is easy to prove. Y = (I + Gp Gs )−1 Gp Z = (I + G(s))−1 Gp Z (21)
Using (14)
G(s) = Gc (s)[I − Gc (s)]−1
Z
Since Gc (s) is diagonal, then matrix [I − Gc (s)] and its
inverse are also diagonal Y
R=0 G s (s) G p (s)
 
1
−1 1−Gc11 (s) 0
[I − Gc (s)] = 1 (16) CONTROLLER PLANT
0 1−Gc22 (s)

Therefore Fig. 3: Block diagram for computing the effect of the dis-
 Gc11 (s)
 turbances.
1−Gc11 (s) 0
G(s) = Gc22 (s) (17)
0 1−Gc22 (s)
4 MIMO CONTROLLER CALCULATION Observe that Gs (s) possess three PI controllers, one
of them negative. Figura 4 the block diagram of the
The transfer matrix Gp (s) of the linear plant model MIMO PID control system for controlling the water
given by (11) can be calculated from tank plant.
Gp (s) = C(sI − A)−1 B (22)
⎡ ⎤ Y1
K p11
0 R1 E1 U1
⎢ Tp11 s+1
⎥ G s11 G p11
Gp (s) = ⎣ ⎦
P s+Q Kp22
(Tp11 s+1)(Tp22 s+1) Tp22 s+1
where s is the Laplace variable, I is the identity matrix,
G s21 G p21
and Kp11 , Kp22 , P and Q are constants.

To determine the control matrix Gs (s) given by (15),


it is required to specify the diagonal form of the closed– R2 E2 U2 Y2
Gs22 G p22
loop transfer matrix Gc (s). We may attempt the fol-
lowing choice
 
1
Tniv s+1 0 Fig. 4: Block diagram of the MIMO PID control system.
Gc (s) = 1 (23)
0 Ttemp s+1

due to the following reasons

1) Gc (s) is diagonal, satisfying the non interaction


5 HARDWARE AND SOFTWARE
requirement.
2) Gc (0) = I, fulfilling the static accuracy require- Hardware
ment stipulated in (18). Fig.5 depicts the hardware configuration of the water
3) Knowing that Y = Gc R, then the two channels of tank control system, which includes level measurement
the system have the form using a Valcom pressure sensor (range: [0, 1.25] m) and
a Safir type P transmitter with digital indicator set to
1 1 [0, 10] V, temperature measurement using a Pt 100
Y1 = R1 Y2 = R2
Tniv s + 1 Ttemp s + 1 RTD sensor (range: [0 o C/4 mA, 100 o C/20 mA]) and
As R is assuming to be a step–type vector, the a Safir type T transmitter with digital indicator which
level channel Y 1 and the temperature channel Y2 converts [4, 20] mA to [0, 10] V, a Sauter AVM104S
will reach exponentially to their correspondence valve with electric drive (range: [0, 10 V]) to regulate
references R1 and R2 . Observe that Tniv and Ttemp the inflow rate of water, a SPC1-35 power controller
are the time constants of the channels. with input set to [1, 5] V connected to an electric re-
sistance for water heating, a NI PCI 6229 data acqui-
4) Using (17), G(s) = Gp (s)Gs (s) is found to be sition card allocated in a Pentium PC, and the water
 Tniv  tank plant.
s 0
G(s) = Ttemp (24)
0 s
PERSONAL
Θi
By application of the final value theorem in (21), 1
0 COMPUTER
0
1
0
1Qi 0 −− 1O V
assuming that Z is a step–type disturbance, it is Θa 0
1 1 −− 5 V ANALOG
easy to demonstrate that 1
0
S OUTPUTS
0
1 00
11
11111
00000
00
11
0
1
lim {[I + G(s)]−1 Gp Z} = 0 0
1
0
1 Θo
00000
11111
00
11
00
11
s→0 H
Φi
This result satisfies the requirement of insensitiv-
Qo
ity to disturbances.
0 −− 1O V ANALOG
INPUTS
The control matrix Gs (s) is obtained using (15):
  0 −− 1O V PCI 6229
DAQ
Gs11 (s) 0
Gs (s) = (25)
Gs21 (s) Gs22 (s)
⎡ ⎤
1
−Ks11 1 + TI11 ) 0
=⎣ ⎦
s Fig. 5: Hardware configuration of the water tank control
1 1
−Ks21 1 + TI211 s ) −K s22 1 + TI221 s ) system.
Control Software Subtracting I(k − 1) from I(k) we obtain the recursive
The MIMO PID control algorithm was written in Lab- form of I(k)
VIEW code (V 8.5) and executed in the CPU of the
Kp T
PC. Such an algorithm process level and temperature I(k) = I(k − 1) + [e(k) + e(k − 1)] (28)
signals and generate two control signals, one for the 2Ti
valve and another for the power controller. Actually, The derivative term given by (27) can be rewritten as
the MIMO PID controller given by (25) requires three
PI control algorithms. The basic form of a PID control D(t) + Tf Ḋ(t) = −Kp Td ẏ(t)
algorithm is
 Performing backward approximation of the derivative
Kp t de(t) terms
u(t) = Kp e(t) + e(t)dτ + Kp Td
Ti 0 dt
D(k) − D(k − 1) y(k) − y(k − 1)
= P (t) + I(t) + D(t) Ḋ(t)  ẏ(t)
T T
e(t) = r(t) − y(t) (26)
leads to
where u(t), y(t), e(t), and r(t) are the control, output, Td
error and set–point signals, respectively. Also, Kp , Ti , D(k) = {D(k − 1) − Kp N [y(k) − y(k − 1)]}
N T + Td
and Td represent the proporcional gain, the integral (29)
time, and the derivative time, respectively. That ba-
sic PID algorithm has been modified as to improve its The designed control signal u(k) is limited to be be-
performance. tween umin and and umax before entering to the ac-
tuator: the PWM amplifier. It may happen that u(k)
To prevent drastic changes in the derivative term D(t) reaches such limits. When this happens the feedback
due to abrupt changes in r(t), let us the derivative ac- loop is broken and the system runs as an open loop
tion operate only on y(t) and not on r(t), that is because the actuator will remain at its limit indepen-
dy(t) dently of the process output y(k). Meanwhile, the I(k)
D(t) = −Kp Td term of the controller may become very large or, in
dt
other words, it “winds up” because the error will be
It is advisable to filter the pure derivative term dy(t)
dt
continuously integrated. To avoid this integral windup
employing a first order filter to limit the high frequency phenomena, it is recommended to turn off the integral
measurement noise amplification in y(t), that is action as soon as the actuator saturates. One way to
turn off the integral term is to use a dead zone
Kp Td s Td
D(s) = − y(s) Tf = (27) v(k) = P (k) + D(k) + I(k)
1 + Tf s N

where Tf is a time constant and N is the bound of the ⎨ P (k) +
KP
Ti + D(k), v(k) ≤ umin
derivative gain (a value between 3 and 10). u(k) = v(k), umin ≤ v(k) ≤ umax

P (t) + KP
Ti + D(k), v(k) ≥ umax
The control software is written in the discrete–time do-
main. So we need a discrete form of the modified PID On the other hand, when the controller conmutes from
controller. Being k = Tt the discrete time, where T is manual to automatic operation, the control signal u(t)
the sampling time, P (t) takes the form may change (“bump”) from a value to another inde-
pendent of the value of the error signal e(t). To obtain
P (k) = KP e(k) bumpless operation of the controller, the control algo-
rithm must be also executed in manual operation. Fig.
We can employ trapezoidal approximation for the in- 6 pictures a portion of the control software written in
tegral term I(t) LabVIEW code [9], [10].

Kp  [e(i) + e(i − 1)]


k
I(k) = T =
Ti i=1 2 6 EXPERIMENTAL RESULTS

Kp  [e(i) + e(i − 1)] Kp [e(k) + e(k − 1)]


k−1
Figure 7 depicts the controlled level and its correspond-
T + T
Ti i=1 2 Ti 2 ing control action (the inflow rate), while figure 8 shows
the controlled temperature and its corresponding con-
For the discrete time (k − 1) holds trol action (the heat supplied). Constants and time
constants of the MIMO controller (see relation (25)
Kp  [e(i) + e(i − 1)]
k−1
I(k − 1) = T were set to Ks11 = 4, Ks21 = 4, Ks22 = 6, Ti11 = 100,
Ti i=1 2 Ti21 = 100 and Ti22 = 100. Reference points level and
35

TEMPERATURE [C]
30

25

20

15
0 100 200 300 400 500 600 700 800 900

CONTROL [V]
3

1
0 100 200 300 400 500 600 700 800 900
TIME [s]

Fig. 8: Controlled tank temperature and its corresponding


control force.
Fig. 6: Portion of the control software.

8 REFERENCES
o
temperature were set to 19 cm and 31 C, respectively.
[1] Pratibha Shingare, and M. A. Joshi, “Modeling and Ro-
The sampling period used to execute the algorithm was bust Control of Level in Hybrid Tanks”, Proceedings of
1 s. We observe that the designed MIMO control al- the World Academy of Science, Engineering and
gorithm is able to stabilize the controlled outputs with Technology, Vol 20, April 2007.
sufficient speed.
[2] Rajanikanth Vadigepalli, Edward P. Gatzke and Francis
J. Doyle III, “Robust Control of a Multivariable Experi-
21 mental Four-Tank System”, Industrial and Engineer-
20
ing Chemistry Research, 2001; 40 (8).
[cm]

19

18 [3] Jin-Hua She, Hiroshi Odajima, Hiroshi Hashimoto and


LEVEL

17 Minoru Higashiguchi, “Flow and temperature control of


16 a tank system by backstepping method, The Fourth In-
15
0 100 200 300 400 500 600 700 800 900 ternational Conference on Motion and Vibration
Control, ETH Zurich, Switzerland, August 25-28, 1998,
10 pp 449-454.
8
[4] Effendi Rusli, Siong Ang, and Richard D. Braatz, “A
CONTROL [V]

6
Quadruple Tank Process Control Experiment”, Journal
4 of Chemical Engineering Education, Vol 38, Number
2 3, 2004.
0
0 100 200 300 400
TIME
500
[s]
600 700 800 900 [5] Raimundas Liutkeviius and Saulius Dainys, “ Hybrid
Fuzzy Model of a Nonlinear Plant”, Information Tech-
nology and Control, Vol.34, No.1, 2005.
Fig. 7: Controlled tank level and its corresponding control [6] Y. Duan, B. Boulet, and H. Michalska, “Application
force. of IMC-based Robust Tunable Controller Design to Wa-
ter Tank Level Regulation”, Proceeding (550) Mod-
elling, Identification, and Control, Insbruck, Aus-
tria, Feb. 2007.
[7] W. F. Hughes and J. A. Brighton, Theory and Prob-
lems of Fluid Dynamics, Shaum’s outline series,
7 CONCLUSIONS McGraw-Hill, 2nd edition, Inc., 1991.
[8] Olle I Elgerd, Control Systems Theory, McGraw-Hill
In light of the experimental result, we may assure that Kogakusha. LTD., Tokyo at. al., 1967.
it is possible to find an interconnected MIMO linear [9] LabVIEW Fundamentals, National Instruments, Au-
dynamic model of the water tank plant capable of cap- gust 2007, 324029C–01.
turing significant features of the actual MIMO inter-
[10] Getting Started with LabVIEW, National Instru-
connected nonlinear plant. Such a model permit to
ments, August 2007, 323427D–01.
design and implement a MIMO PID linear controller,
capable of stabilizing the outputs of the plant (level
and temperature) in real–time operation.

You might also like