Experiment 6: Level Control of A Coupled Water Tank
Experiment 6: Level Control of A Coupled Water Tank
L
i
(t) =
1
A
i
F
in
i
(t) F
out
i
(t)
cm
sec
, i = 1, 2, (2.1)
where L
i
, A
i
, F
in
i
, and F
out
i
are the liquid level, cross-sectional area, inow rate, and outow rate,
respectively, for the i
th
tank. Next, note that the inow rate to Tank 1 is given by
F
in
1
(t) = K
p
V
p
cm
3
sec
, (2.2)
where K
p
is the pump constant (
cm
3
Volts-sec
) and V
p
is the voltage applied to the pump. In addition,
using Bernoullis law for ow through small orices, the outow velocity from the orice at the
bottom of each tank is
v
out
i
(t) =
2gL
i
cm
sec
, i = 1, 2. (2.3)
Then, the outow rate for each tank is given by
F
out
i
(t) = a
i
2gL
i
cm
3
sec
, i = 1, 2, (2.4)
where g is the gravitational acceleration and a
i
denotes the cross-sectional area of the outow orice
at the bottom of the i
th
tank. Finally, note that for the two-tank level control system shown in
Figure 1
F
in
2
(t) = F
out
1
(t). (2.5)
6-2
Thus, using (2.1)(2.5), we obtain the dynamic equations for the liquid level in the two tanks as
L
1
(t) =
a
1
A
1
2gL
1
(t) +
K
p
A
1
V
p
(t), (2.6)
L
2
(t) =
a
1
A
2
2gL
1
(t)
a
2
A
2
2gL
2
(t). (2.7)
Remark 2.1. Note that using (2.6), we can compute the steady-state pump voltage V
p
ss
that
produces the desired steady-state constant level L
1ss
in Tank 1. Specically, setting
L
1
(t) = 0 in
(2.6) yields
V
p
ss
= a
1
2gL
1ss
K
p
. (2.8)
In a similar manner, we can compute the steady-state level L
1ss
in Tank 1 that produces the desired
steady-state constant level L
2ss
in Tank 2. Specically, setting
L
2
(t) = 0 in (2.7) yields
L
1ss
=
a
2
a
1
2
L
2ss
. (2.9)
Now, theoretically one can use (2.8) and (2.9) to regulate the water level in Tank 2. However, ex-
ternal disturbances, system parameter uncertainty/variation, etc., necessitate a feedback controller
to improve the level control system performance.
Next, dening a set of shifted variables
1
(t)
=
L
1
(t) L
1ss
, (2.10)
2
(t)
=
L
2
(t) L
2ss
, (2.11)
u(t) = V
p
(t) V
p
ss
, (2.12)
we can rewrite the dynamic equations (2.6) and (2.7) as
1
(t) =
a
1
A
1
2g(
1
(t) + L
1ss
) +
K
p
A
1
u(t) + V
p
ss
, (2.13)
2
(t) =
a
1
A
2
2g(
1
(t) + L
1ss
)
a
2
A
2
2g(
2
(t) + L
2ss
). (2.14)
Finally, linearizing (2.13), (2.14), about (
1
= 0,
2
= 0, u = 0), we obtain
1
(t) =
1
1
(t) +
1
u(t), (2.15)
2
(t) =
2
2
(t) +
2
1
(t), (2.16)
6-3
where
1
=
a
1
A
1
g
2L
1ss
,
1
=
K
p
A
1
,
2
=
a
2
A
2
g
2L
2ss
,
2
=
a
1
A
2
g
2L
1ss
. (2.17)
Next, we address the level control problem for Tank 2 (i.e., set-point tracking of L
2
(t)) via a
subsystem decomposition of (2.15) and (2.16). In particular, we consider the level control for L
2
via the subsystem dynamics (2.16) with
2
and
1
as the subsystem output and input, respectively.
The level control problem for the Tank 2 subsystem necessitates the control of level L
1
in Tank 1.
The problem of controlling L
1
is addressed via the subsystem dynamics (2.15) with
1
and u as the
subsystem output and input, respectively.
Now, we develop the transfer function models for the subsystem dynamics (2.15) and (2.16).
Thus, taking the Laplace transform of (2.15) and arranging terms, we obtain
G
1
(s)
=
1
(s)
u(s)
=
1
s
1
, (2.18)
where
1
(s)
=
L[
1
(t)] and u(s)
=
L[u(t)] and L is the Laplace operator. Similarly, taking the
Laplace transform of (2.16) and arranging terms, we obtain
G
2
(s)
=
2
(s)
1
(s)
=
2
s
2
, (2.19)
where
2
(s)
=
L[
2
(t)].
The numerical values of the parameters for the laboratory two-tank water level control system
are provided in Table 1 below. Note that the variables
i
and
i
, for i = 1, 2, in (2.17) are computed
with L
1ss
= L
2ss
= 12cm.
Physical quantity Symbol Numerical value Units
Tank 1, 2 diameters D
1
, D
2
4.425 cm
Tank 1, 2 orice diameters d
1
, d
2
0.47625 cm
Pump constant K
p
4.6
cm
3
Volts-sec
Gravitational constant g 980
cm
sec
2
Table 1: Numerical Values for Physical Parameters of Two-Tank Level Control System
6-4
3. Objective
Proportional-plus-integral (PI) control of the state-coupled, two-tank system to track a desired
level of water in Tank 2.
4. Equipment List
i) PC with Q4 data acquisition card and terminal board
ii) Software environment: Windows, MATLAB, Simulink, RTW, and QuaRC
iii) Water Tank apparatus with a water basin
iv) Universal power module: UPM-2405
v) Set of leads
5. Experimental Procedure
i) Using the set of leads, universal power module, water tank apparatus, and the terminal
board of the Q4 data acquisition card, complete the wiring diagram shown in Figure 2.
ii) Start MATLAB. In the MATLAB window, choose C:\ControlLab\Experiment6 from the
Current Directory window. This directory path choice will change the directory from the
default MATLAB directory to the directory where all les needed to perform Experiment
6 are stored.
iii) You can now perform various steps for the level control of coupled water tanks. However,
before proceeding, you must request your laboratory teaching assistant to check your
electrical connections.
iv) From the File menu of the MATLAB window, select the option Open to load the Simulink
block-diagram Experiment6 A.mdl shown in Figure 3 to your desktop. This will load
the les for calibrating the pressure sensor voltage when there is no water in Tanks 1 and
2. The voltage measured on S1 and S2 should be 0 Volts.
a) In the MATLAB window, click the black Start arrow button to acquire the voltages
measured on S1 (the level of water in Tank 1) and S2 (the level of water in Tank 2).
6-5
Encoder Inputs
Analog Outputs
Analog Inputs
2
3 4 1
Water Tank Back Panel
Level Sensors
1 and 2
Q4 Terminal Board
UPM-2405
S1&S2 S3 S4 To A/D
From D/A To Load
Pump
Figure 2: Wiring Diagram for Two-Tank Level Control
b) Adjust the oset potentiometers 1 and 2 on the water tank apparatus back panel
to obtain 0 Volts.
c) In the MATLAB window, click the black Stop square button when you nish cali-
brating the sensor o-set.
v) Fill water into Tank 1 upto the 25cm level. The voltage measured on S1 should now be
about 4.1 Volts.
a) In the MATLAB window, click the black Start arrow button to acquire the
voltage measured on S1 (pressure sensor).
b) Adjust the gain potentiometer 1 on the water tank apparatus back panel to
obtain any where between 4.0 to 4.2 Volts on S1 (pressure sensor).
c) In the MATLAB window, click the black Stop square button when you nish
calibrating the sensor gain.
vi) Repeat (v) for Tank 2.
6-6
Figure 3: Simulink Block-Diagram for Water Pressure Sensor Oset and Gain Calibration
vii) Close the currently opened Simulink diagram. From the File menu of the MATLAB
window, select the option Open to load the Simulink block-diagramExperiment6 B.mdl
shown in Figure 4 to your desktop. A plot window will also appear on your desktop. The
various Simulink subblocks used in Figure 4 are given in detail in Figures 5 and 6.
a) At the MATLAB command prompt, execute the script Experiment6.m. This
will assign the numerical values of the physical parameters of the two-tank level
control system.
b) In Figure 4, under the subblock labeled Tank 1 Controller (Figure 5), the gains
k
p1
and k
i1
must be designed and supplied by you. In particular, design a PI
controller so that the closed-loop Tank 1 subsystem response exhibits a peak
overshoot less than 1.5% and settling time less than 10 seconds. Note that G
1
(s)
given by (2.18) denotes the open-loop transfer function for the Tank 1 subsystem.
Furthermore, note that in Figure 4, a feedforward controller based on (2.12) is
also implemented for the Tank 1 subsystem to account for the V
p
ss
term in (2.12).
c) In Figure 4, under the subblock labeled Tank 2 Controller (Figure 6), the gains
6-7
Figure 4: Simulink Block-Diagram for Two-Tank System PI Control
k
p2
and k
i2
must also be designed and supplied by you. In particular, design a
PI controller so that the closed-loop Tank 2 subsystem response exhibits a peak
overshoot less than 3.5% and settling time less than 20 seconds. Note that G
2
(s)
given by (2.19) denotes the open-loop transfer function for the Tank 2 subsystem.
Furthermore, note that in Figure 4, a feedforward controller based on (2.10) is
implemented for the Tank 2 subsystem to account for the L
1ss
term in (2.10).
d) Before proceeding, you must request your laboratory teaching assistant to ap-
prove your gain values. In the MATLAB window, click the black Start arrow
button to acquire the transient and steady-state step response of the level of
water in Tank 2.
6. Analysis
i) Analyze the script Experiment6.m and the simulink control diagramExperiment6 B.mdl.
ii) Build a nonlinear simulation model (using Simulink) for the two-tank level control system.
6-8
Figure 5: Tank 1 Controller Subblock
Figure 6: Tank 2 Controller Subblock
6-9
Note that as in the laboratory setup, for the simulation model the input voltage to the
pump must be limited to 22 Volts. Obtain the open-loop response of the system. In
addition, obtain the closed-loop response of the simulation model. How does the simulated
system response compare with the experimental response?
iii) Obtain the closed-loop response for the simulation model of the two-tank level control
system with a) only the PI controller and b) only the feedforward controller.
iv) Analyze and comment on your experimental results. Specically, analyze the experimental
time response of water levels in Tanks 1 and 2. Does the system response meet the
performance specications? Explain.
v) Obtain the experimental response of the two-tank system to disturbances. Note that
addition of water into Tank 1 and/or Tank 2 from any source other than the pump
constitutes an exogenous disturbance.
References
1. R. N. Bateson, Introduction to Control System Technology, Prentice-Hall, Upper Saddle River,
NJ, 1999, 6
th
Ed., pp. 304307.
6-10