Experiment E. Liquid Level Control Using Coupled Tanks
Experiment E. Liquid Level Control Using Coupled Tanks
이름: 윤초록
학번: 20180422
1. Introduction
Process control is the ability to change the process actively based on the consequences of
process monitoring in order to take a desired output. When device detecting an out-of-control
situation, the manager makes a alternation in order to put the process back into control. As the
condition for each unit in plant. Off-control can result in the production of off-spec products,
and the decreased profitability due to insufficient consummation of raw materials and energy.
Most importantly, several deviations from the steady-state operation can eventually lead to an
explosion in chemical plant. Automatic process control can supply robustness of process in
the present of disturbance and enhanced process safety. We will use the simple liquid-level
control experiment to learn how we can design the controller and choose each parameter.
manipulating some process variables. A typical example of a control system is home hot
The control system in Figure 1. efforts to keep the temperature in the tank of heating process
at the aimed value by manipulating the fuel flow to the burner (or the electrical input to the
heater). For instance, if we desire the temperature by 50℃, we apply the system to response
smoothly and efficiently. The thermostat which is a controller compares the measured
temperature recorded in thermocouple to the aimed variable. Then we call such difference
between the two values as error. (Equation: error = set value – measured signal value) The
controller takes proper action by sending a signal to the final control element (Fuel valve)
based on the magnitude/sign of error, which manipulates input of process to lead to the set
point. The concept that we get information about the deviation of the system from its desired
state and use this for controlling the system is called feedback control. These information
about state of system is sent to controller for formation of feedback and process utilizes this
2. Theoretical Background
Consider a system that controls the water level in the tank by connecting two pumps.
Figure 2. Configuration of the coupled tanks system
We will use type of configuration, Quanser Inc. QUARC User Manual, (2012) in the liquid-
level control experiment. We want to maintain the water level of the tank through control
system at the desired value. According to the tank 1 of Figure, the amount of water drawn
from a pump/ the outlet volumetric flow/ the height of the tank1 (L1) can be considered as an
input/disturbance/output, respectively. For tank2, the out-flow from the tank1 is input of
tank2, and the height of the tank2 (L2) can be considered as output.
In tank 1, we set water level as L1 (t), cross sectional area as A1, outlet cross sectional area
input voltage. In tank 2, similarly with tank 1, we set water level as L2 (t ), cross sectional area
Assume that V0, L10, and L20 are the input voltage, water level of tank 1 and water level of
tank 2 at steady-state, respectively. Also, differences between the variables and their steady-
※ deviation variables
L11 =L1 −L10
L21=L2−L20
V 1=V −V 0
dL10 d L20
Since the system is in a steady-state (no change over time), = =0.
dt dt
Volumetric flow rate by pump is set to k v V . Also, flow rate balance equation can be
obtained through Bernoulli's principle (the velocity of fluid at the tank outlet can be
L11 ( s ) K
We can obtain = c from above equation. In addition, L10 , L20 ,V 0 can be obtained
V 1 ( s ) τs +1
A transfer function relates two variables (generally input and output) of a physical (real)
process.
Figure 3. Transfer Function
Here, X(s) indicates the input variable and Y(s) indicates the output variable affected by
physical process. We can set the input and output balance with intermediate transfer function,
G(s),
Y ( s )=G(s) X (s)
Y ( s)
Finally, we can get the form of transfer function G(s), G ( s )= . We state that the transfer
X (s )
dy
τ + y=K c x (t )
dt
y is output, x(t) is the input function. The initial condition is y ( 0 )= y s=K p x ( 0 )=K p x s. ( y s
and x s are y and x values in steady-state, respectively). In this form, we can get deviation
dy
variable expressed as X =x−x s ,Y = y− y s. Therefore, τ + y=K c x (t ) can be replaced with
dt
dY ( t )
τ +Y =K c X (t ). (At steady-state, change over time is 0) Through Laplace transform of
dt
Y ( s) K
this differential equation, we get transfer function G(s) = = c . Here, a Laplace
X ( s ) τs+1
dY ( t )
transform sY(s) of was used.
dt
Assume that a step change of X(t) with magnitude A is applied into the first-order system,
A A Kc
the Laplace transform of X(t) is . Also, we can obtain Y ( s )= and
s s τs+1
L−1 {Y ( s ) }= y ( t )=K c A {1−exp ( −tτ ) } can be obtained using an inverse Laplace transform.
of second-order system.
d2 y (t ) dy ( t )
A 2
+B +Cy ( t )=x (t)
dt dt
A second-order transfer function can arise physically whenever two first-order processes are
connected in series. Above figure shows the signal flow relation for such a process in block
diagram.
U ( s ) Y ( s) Y ( s) K1 K2 Kc
G ( s )= = =G 1 ( s ) G 2 (s ). G ( s )= = because
X ( s) U ( s) X ( s ) τ 1 s+ 1 τ 2 s+1 (τ ¿¿ 1 s+1)(τ 2 s+1)¿
K1 K2
G 1 ( s )= ,G 2 ( s )= (according to transfer function of first-order system). We can
τ 1 s+1 τ 2 s +1
w2
G ( s )= . Depending on the value of ζ , the type of second-order system can be
s 2+ 2 wζs+ w2
classed in Table.
Damping Coefficient Characterization of Roots of Characteristic
Response Equation
ζ >1 Overdamped Real and unequal
ζ =1 Critically damped Real and equal
0< ζ <1 Underdamped Complex conjugates (of the
For underdamped case, if step-input of the second-order process is applied, the response will
Firstly, tr is the rise time, which is the time it takes that output reaches the new steady-state
π
value first, and tp is time to first peak ( ¿, which means the time it takes that the
w √ 1−ζ 2
output reaches its first maximum value. ts is settling time, which means the time it takes that
the output starts to remain within specific range for steady-state value. The range here is ±5%
a
of value b (sometimes ±1% of b is used in some cases). Overshoot (OS) is defined as (=
b
−2 πζ
)) value. Decay ratio (DR) means c (= exp(
−πζ
exp( 2
) 2
2 = OS ) value (c is height of
√ 1−ζ a √ 1−ζ
second peak) Period of oscillation (P) means the time between two successive peaks or
−2 π
valleys of response (exp (√ )
1−ζ 2
¿.
In summary, we can find a, b, c in above Figure, and express these terms with a, b, c.
π a −πζ
t p=
w √ 1−ζ 2
OS= =exp
b (
√1−ζ 2 )
c −2 πζ −2 π
2
DR=( OS ) = =exp
b √1−ζ 2 ( ) P=exp
( √1−ζ 2 )
U(t) is the input function. Assume that Ú is in the reference state. U ' ( t )=U ( t )−Ú .
t
' ' 1 ¿ ¿ de ( t )
In PID control, we can express U ( t ) as U ( t )=U ( t )−Ú =K p {e (t ) + ∫ e ( t ) d t +τ D }.
τ1 0 dt
Kp
Kp, K i= , K d =K p τ D
τI
U' (s ) 1
When the transfer function C(s) can be expressed as C ( s ) =
E (s )
=K p 1+ +τ s .
τIs D ( )
In proportional control, the output of the controller is adjusted in proportion to the error
value. In addition, by changing the value of the controller gain, it is possible to control how
sensitive the output changes with the error, and by adjusting the sign of Kp, the output can be
Integral control allows the controller’s output to integrate the error signal over the entire
¿
time. It is controlled by the value. Integral control continuously controls the system until e (t )
¿
congerges to 0 because the e (t ) value is not 0 when the output value is not in the steady
state. Therefore, integral control is widely used because it has the advantage of reducing the
the error signal. Because of its role, it is also called anticipatory control. However, if the error
value is kept constant at a value other than 0, the output of the controller cannot be adjusted
because the rate of change of the error is 0. Therefore, it is used together with other control
methods.
When the feedforward control is used together with the feedback control, the error generated
in the modeling process and the error caused by the output of the process can be reduced, so
The closed loop system of the tank controlled by the feedback controller can be expressed as
C(s) and P(s) are the transfer functions of the controller and the tank, respectively. In this
system, Y ( s )=U ' ( s ) P ( s )=C ( s ) P ( s ) E ( s )=C ( s ) P ( s ) { R ( s )−Y ( s ) } Thus, total transfer function
Y (s ) C ( s ) P ( s)
G(s) can be expressed as G ( s )= = .
R ( s ) 1+C ( s ) P ( s )
In order to obtain G(s), C(s) and P(s) should be calculated.
U' (s ) K
For PI controller, Kd = 0. Then, C ( s ) = =K p + i is calculated. Because tank have first-
E (s ) s
L11 ( s ) K
order system formation in this system, P ( s )= = c can be obtained.
V 1 ( s ) τs+1
Since C(s) and P(s) obtained, we can obtain G(s) which has a standard form of
w2
, (It is form of transfer function of the second order system)
s 2+ 2 wζs+ w2
3. Scheme of experiment
- Offset 1 potentiometer calibration: With an empty tank, adjust the Tank 1 Offset:
- Gain 1 potentiometer calibration: Fill tank 1 up to 25cm, and adjust the "Tank 1 Gain"
▷ PI-controller
- Open the Tank1_FFPI and set the set-point and feedforward gain to 9cm and 2.39,
respectively.
- Set Ki and Kp as 0.
conditions
▷ Data plotting
Open the simulink file, then the assigned data will be saved as format of "mat".
X=importdata('stepinput.mat');
plot(X(1,:), X(2,:));
5. Discussion
We will use type of configuration, Quanser Inc. QUARC User Manual, (2012) in the liquid-
level control experiment. (We will only use tank 1.) We want to maintain the water level of
the tank through control system at the desired value. According to the tank 1 of Figure, the
amount of water drawn from a pump/ the outlet volumetric flow/ the height of the tank1 (L1)
the tank1 is input of tank2, and the height of the tank2 (L2) can be considered as output.
Figure 10. Configuration of the coupled tanks system (Quanser Inc. QUARC User Manual,
(2012))
dL1 (t) 1
= (−a1 √ 2 g L1 ( t ) + k v V ( t ))
dt A1
dL2 (t) 1
= (−a2 √ 2 g L2 ( t )+ a1 √2 g L1 ( t ))
dt A2
We can set this equation by constructing the mass balance assuming constant fluid density.
In tank 1, we set water level as L1 (t), cross sectional area as A1, outlet cross sectional area
input voltage. In tank 2, similarly with tank 1, we set water level as L2 (t ), cross sectional area
Firstly, we can express volumetric flow rate from pump as k v V (t ). Then we can utilize
1 2 1
Bernoulli equation, which is ρ v 1 + P1 + ρg h1=P2 + ρ v 22 + ρg h2.
2 2
Figure 11. Bernoulli equation
With Bernoulli equation, we can express v1(t) (outlet flowing velocity) with variable that is
mentioned previously. Based on means of Bernoulli's principle (the velocity of fluid at the
d L1 ( t )
A1 =( inflow¿ pump )−( out flow through outlet )=k v V ( t )−a1 v 1 ( t )=k v V ( t )−a1 √ 2 g L1 (t )
dt
dL1 ( t ) 1
= {−a 1 √ 2 g L1 ( t ) +k v V ( t ) } ⋯ Tank L1 equation
dt A1
d L2 ( t )
A2 =( inflow¿ pump )−( out flow through outlet ) ¿ a 1 v 1(t)−a 2 v2 ( t )=a1 √ 2 g L1 (t)−a2 √ 2 g L2 (t )
dt
Assume that V0, L10, and L20 are the input voltage, water level of tank 1 and water level of
tank 2 at steady-state, respectively. Also, differences between the variables and their steady-
※ deviation variables
L21=L2−L20
V 1=V −V 0
dL10 d L20
Since the system is in a steady-state (no change over time), = =0.
dt dt
With Tank L1 equation and Tank L2 equation, we can get expression of L10 and L20 with terms
of V0.
k 2v V 20
Tank L1 equation → 0=k v V 0−a1 √ 2 g L10 → L10= 2
2 a1 g
a21 k 2v V 20
Tank L2 equation → 0=a1 √2 g L10−a2 √ 2 g L20 → L20= L 10 =
a22 2a 22 g
Suppose that there is a change of input voltage from V0 to V and this change leads to
change of L1(t) and L2(t) over time. Deviation function can be defined as
1 '' 1
y=f ( x )=f ( x 0 ) + f ' ( x 0 )( x− x0 ) + f ( x 0 ) ( x−x 0 )2+ ⋯ f n ( x0 ) ( x−x 0 ) n+ ⋯ ≈ f ( x 0 ) + f ' ( x0 ) ( x−x 0 )
2! n!
expansion at x 0=0 )
1
so√ 2 g L1= √2 g ( L11 + L10) =√ 2 g ×
( √ L10+1 ! ( ) L +⋯
2 √ L10 11 )
≅ √2 g L10 + √g L
11
√2 L10
g
√ 2 g L2 ≅ √ 2 g L20+ √2 L L21.
√ 20
Tank L1 equation
dL1 ( t ) d L11 1 a √g 1 −a √ g
→
dt
=
dt
=
A1 {
−a1 √2 g L10 +k v V 0 − 1
√ 2 L10
L11 + k v V 1 = ( 1
A1 √ 2 L10 11 v 1}
L +k V ). (
dL11 −a1 √ g k
= L11 + v V 1 ⋯ Equation L11
dt A 1 √ 2 L10 A1
Tank L2 equation
dL2 ( t ) d L21 1 a √ g a2 √ g 1 a 1 √ g a2 √ g
→
dt
=
dt
=
A2 {
a1 √2 g L10−a2 √ 2 g L20+ 1 −
√ 2 L10 √2 L20
L21 = − L
} (
A2 √2 L10 √ 2 L20 21 )
(0 = a 1 √ 2 g L10−a 2 √ 2 g L20 ¿
dL21 a1 √ g a2 √ g
dt
=
( −
A 2 √2 L10 A2 √2 L20 )
L21 ⋯ Equation L21
L11(t) and V1(t) in Equation L11 can be changed to L11(s) and V1(s) by Laplace transform.
−a 1 √ g k
s L11 ( s )−L11 ( 0 )= L11 ( s)+ v V 1 (s) ( L11 ( 0 )=0 ¿
A1 √2 L10 A1
A 1 √ 2 L10 k √ 2 L10
{ a1 √ g }
s+1 L11 ( s ) = v
a1 √ g
V 1 ( s)
k v √ 2 L10
L11 ( s ) a1 √ g k A √2 L10 k √ 2 L10
→
V 1 (s )
=
A 1 √ 2 L10
= c τ= 1
τs+ 1 (
a1 √ g
, kc= v
a1 √ g )
⋯ Equation Laplace L21
{ a1 √ g }
s+1
A kc 1 1
A
V 1 ( s ) becomes L { A }= and
s
L11 ( s )=
s τs+ 1
=k c A −
s
s+
1
τ
{ }
{
L−1 { L11 ( s ) }=L11 ( t )=k c A 1−exp ( −tτ )}(τ = Aa√√2gL
1
1
10
, k c=
k v √ 2 L10
a1 √ g
)
2) Find the definition of the Laplace transform and how to apply the transform to
solve an ODE.
Definition of the Laplace transform: Laplace transform of function f(t) is defined in F(s)
∞
F ( s ) =L { f ( t ) } =∫ e−st f ( t ) dt (if it converges) (Laplace transform of f(t) for (t ≥ 0))
0
L−1 { F ( s ) }=f (t )
The purpose of Laplace transform is to solve the ordinary differential equation (ODE) with
ease.
As long as ODE can be modified by Laplace transform, the solution of ODE in the Laplace
domain can be obtained by simple algebraic manipulation. The inverse Laplace transform
Laplace transform can be used to solve ODEs because the differential terms can be
expressed as polynomials when we know the initial condition for the differential term.
3) Derive the first peak time (tp), Overshoot (OS) and Decay ratio (DR) in second order
system.
1 { } 1 w2
Step input X(t) = constant (value: 1) → X ( s )=
s( )
L 1 = , Y ( s )= 2
s s (s +2 wζs+ w2 )
w2 1 s +2 wζ
Y ( s )= = − 2 2
s ( s + 2 wζs+ w ) s s +2 wζs +w
2 2
2 2
w √ 1−ζ −wζi w √ 1−ζ + wζi
1
¿ − { 2 w √1−ζ 2
+
∗1
2 w √ 1−ζ 2
s s +wζ −w √ 1−ζ 2 i s+wζ + w √1−ζ 2 i
∗1
}
β−αi β+ αi
1
¿ −
s {
2β
∗1
+
2β
∗1
s+ α− βi s +α + βi } 2
, ( α =ζw , β=w √ 1−ζ )
¿)
α 2
¿ 1−e−αt 1+
√ ()β
sin ( βt+ φ )
α 2
∴ y ( t )=1−e−αt 1+
√ ()
β
sin ( βt + φ ) ¿
√ () β
0
√
sin ( β t 0 +φ )−β e−α t 1+
β ()
cos ( β t 0 + φ )=0
sin ( β t 0+ φ ) β nπ
→ =tan ( β t 0 +φ ) = → tan ( β t 0+ φ ) =tanφ → β t 0=nπ , t 0 =
cos ( β t 0+ φ ) α β
(φ=tan
−1
( αβ ) , tan function has π period ¿
π π
t p=t 0 ( n=1 )= =
β w √ 1−ξ 2
Ⅱ) Overshoot (OS)
−πα
α 2 α 2
a+ b= y ( t p )=1−e −α t p
√ 1+()
β
sin ( π + φ )=1+e−α t
1+
p
β √ ()
sin ( φ ) =1+ e β 2
=1+e−πξ / √ 1−ξ (
β
sin φ= 2 )
√α + β2
a 2
OS= =α =e−πξ / √1−ξ
b
Ⅲ) Decay rate (DR)
−3 απ
3π α 2
b+ c= y ( t 0 ( n=3 ) ) = y ( )
β
=1−3 β
√ 1+ ()
β
sin ( 3 π + φ )=1+ e−3 απ / β
β
( sin φ= 2 )
√α + β2
t→∞
c 2 πξ
DR= =exp {− }
a √ 1−ξ2
Ⅳ) Period (P)
2π 2π
¿ =
β w √ 1−ξ 2
4) Derive the transfer function of the closed loop system (P-controller, I-controller, PI-
controller).
→ { C ( s ) P ( s ) +1 } Y ( s )=C ( s ) P ( s ) R ( s )
Y ( s ) : output value C ( s) P ( s)
→ total transfer function of system ,G ( s )= =
R ( s ) :set value C ( s ) P ( s ) +1
Transfer function of the tank has formation of first order system. (By open loop system
Y ( s ) L11 ( s ) kc
P ( s ) :tank → P ( s )= = =
U ' ( s ) V 1 ( s ) τs+1
t
1 de (t )
U ( t )−Ú=k p {e ( t ) + ∫ e ( t ¿ ) d t ¿ + τ D }
τI 0 dt
' kp 1
Laplace → U ( s )=k p E ( s )+ E ( s )+ k p τ D sE ( s ) ( e ( 0 )=0 )
τI s
U ' ( s) 1 1 ki kp
→ C ( s )=
E ( s) [ ]
=k p 1+ × +τ D s =k p + + k d s k i= , k d =k p τ D
τI s s τI ( )
Ⅰ) P-controller (k i=k d =0 ¿
kc
C ( s ) =k p , P ( s ) =
τs+1
k p kc k p kc
C ( s) P (s) τs+1 k p kc k p k c +1 k 'c
G ( s )= = = = = '
C ( s ) P ( s ) +1 k pk c k p k c + τs+1 τ τ s +1
{ }
τs+ 1
+1 k p k c +1 { s+1
}
Y ( s) k 'c τ k k
∴ G ( s) = = ' , τ'= , k 'c = p c
R ( s ) τ s+1 k p k c +1 k p k c+ 1
ki kc
C ( s) = , P ( s) =
s τs+1
2
C ( s) P ( s ) k i k c /(τ s 2+ s) ki kc k i k c/ τ (w ')
= = = =
C ( s ) P ( s ) +1 ki kc k i k c +s +τ s2 1 k i k c k i k c s 2+ 2 s w ' ξ + ( w ' )
2
τ s 2+ s
+1 2
s +2
(
2 √ ki kc τ )√ τ
s+
τ
2
Y ( s) ( w' ) 1 ki k c
∴ G ( s) = = 2
R ( s ) s + 2ζ w' s+ ( w' )2
, where ζ =
2 √ ki kc τ
, w '
=
τ √
Ⅲ) PI-controller (k ¿ ¿ d=0) ¿
ki kc
C ( s ) =k p + , P ( s )=
s τs+1
(k ¿ ¿ p s+k i) k c kp kp
C ( s ) P (s )
=
2
τ s +s
=
( k p s+ k i ) k c
=
ki kc ( ki
s+ 1 ) =
ki kc ( ki
s+1 )
{ C ( s ) P ( s ) +1 } ( k p s +k i ) k c ( k p s+ k i ) k c + s+τ s2 k i k c + ( k c k p +1 ) s+ τ s2 2 k k +1 √ k k k k
+1 s +2× c p × i c + i c
2
τ s +s √ ki kc τ √ τ τ
2
Y (s ) ( w' ) ( τ ' s +1 ) k c k p +1 ' √ k i k c ' k p
G ( s )= = , where ζ= ,w = ,τ =
R ( s ) s2 +2 ζ w' s + ( w ' ) 2 √k i k c τ √τ ki
6) The derivative control parameter is not widely used in practical process control,
variable (PV) has a lot of noise on it. Derivative control is based on the rate of change of the
error. Then, noise is small, random, rapid changes in the PV. Thus, noise will not place the
variable actually far from the set value. However, the derivative control can be sensitive
because the rate of change of the instantaneous error cannot be that small. (Below Figure can
In short words, since with derivative control, this mode extrapolates slope of the error, it is
In addition, when the unexpected change of error occurs, the overshoot which is caused by
other control signals can be on the decline (the derivative control can overwhelm it).
However, this can meddle the action of other control signals overly. Since magnitude of error
is big but rate of change of error can be small, derivative control could not function alone.
6. Meaningful Questions
1) Is there reason why we use Laplace transform? Solving the first/second ODE is not that
difficult and there is a general solution as mathematical expression.
4) There are modes of proportional control, integral control, and derivative control. How are
they different (not just mathematical expression)? What does the mathematical expression
mean?
5) If we obtain not appropriate result due to noise, what kind of noise can occur?
7. References
2) [CBE 301] EXP. E Liquid Level Control Using Coupled Tanks, Minkee Choi, Dept. of
3) https://blog.opticontrols.com/archives/153