Sei sulla pagina 1di 6

# Latest Trends on Circuits, Systems and Signals

## Modeling and Predictive Control of Tow Tank

System by MLD Approach
Y.HAMMI, N. ZANZOURI, M. KSOURI

## Recently, it was shown in [1] that expressing

Abstract In this paper deals with MLD approach. It propositional logic is transformed into linear
allows to model the hybrid systems involved continuous, inequalities involving integer and continuous variables.
discrete dynamics and constraints. The changes or switches
This allows obtaining a mixed logical dynamical
which may appear over such dynamics are modelled her
using the auxiliary variables witch to take into account the (MLD) systems described by linear dynamic equations
interconnections. This approach will be illustrated by the subject to linear mixed-integer inequalities, i.e.
modelling of the two tank system. inequalities involving both continuous and binary (or
The resultant system is well-posed for Model Predictive logical) variable.
Control (MPC) that is used as control strategy for the system.
Simulations were performed using the Hysdel compiler to In fact, the MLD allows to describe a broad number
illustrate the efficiently of this formalism. of important classes of hybrid systems, like piecewise
linear systems, systems with mixed discrete/continuous
Keywords Hybrid System, MLD, propositional
inputs and state, and more others [11].
logic rules, MPC.
This framework permits to include and prioritize
constraints, and incorporate heuristic rules in the
1 INTRODUCTION description of the model. Different capabilities and
applications of MLD modeling approach have been
reported in [4], [5], [8].
H ybrid systems are a class of systems that has been
an attractive subject of research during the last
decades since it is an aspirate class of systems to
In this paper, MLD approach is used for modeling
and predictive control of a two tank system. The goal is
model the practical systems behaviour. Hybrid systems to verify the capabilities, design tradeoffs and
may also be defined as a combination of discrete part computational aspects of MLD framework to deal with
and continuous part. In past, dynamics of these systems hybrid systems modeling and control problem.
were studied separately. Models like automata or Petri The paper is organized as follows: in section 2, we
net were used for the event subsystem, and the introduce basic propositional logic rules, Boolean
differential or difference equations were used for the algebra, and mixed-integer linear inequalities. These
continuous subsystem. In processes where the discrete tools are used to define the MLD systems. Different
and continuous parts work together and a significant steps followed to obtain the MLD model and detailed
interaction is observed between them, a thorough modeling of tow-tank system in MLD framework is
analysis of the system performance and achieving high expressed in section 3. Predictive control of fluid level
efficiency requires that all the dynamic parts and their
is proposed in section 4 and simulation results are
interactions be studied completely. In this way, the
presented.
exact analysis and optimization of a system becomes
possible.
The control problems of hybrid systems have been II. MIXED LOGICAL-CONTINUOUS
invested in many filed as robust control of state feed PROPOSITIONAL
backs static output feedback [12], optimal control and
predictive control. A. Mixed logical continuous propositional

## Y. Hammi. yosrahammi@yahoo.fr Mixed logical dynamical formalism is a powerful

N. Zanzouri. Nadia.Zanzouri@enit.rnu.tn modeling approach in hybrid systems theory. It
M. Ksouri . mekkiksouri@yahoo.fr
Unit of Research Analyze and Control of System (ACS) National transforms dynamics, logic and constraints of a
School of Engineering of Tunis BP, 37, Le Belvdre, 1002 Tunis, complex system into an integrated model. Logical and
Tunisia dynamical constraints are translated to mixed-integer
inequalities [1]-[3] Mixed-integer inequalities contain
continuous and integer variables. Using binary and
auxiliary variables, hybrid systems are modelled as

## ISSN: 1792-4324 140 ISBN: 978-960-474-208-0

Latest Trends on Circuits, Systems and Signals

## linear dynamical systems with mixed-integer xc

x = , xc nc , xl {0,1} l , x n , n = nc + nl
n
inequalities constraints. Mixed logical dynamical
x
l
modeling allows the state and control inputs to be
continuous or discrete.
A binary variable is associated with each logical y are the continuous and binary outputs:
relation like:

X i = True i = 1 (1)
xl
Discrete / Logic dynamics

## Propositional logic is also translated an equivalent

linear inequalities. As an example can be shown that: A/D D/A
z = f ( x)
X1 X 2 is equivalent to 1 + 2 1 f ( x) 0 = 1

## Another basic principle of MLD modelling is the

interaction between logical and dynamical variables. It Continous dynamics
z
can be proved that [ = 1] [ f ( x ) 0] is true if xc

## Fig. 1 MLD hybrid system structure

f ( x) M M
(2)
f ( x) + (m )
yc
y = , yc pc , yl {0,1} l , y p , p = pc + pl
p
Where M (m) is maximum(minimum) or an upper yl
(lower) bound of f and is a small positive number.
This equivalence permits the assignment of binary u are the continuous and binary inputs:
variables to dynamical constraints which may define
the different operation modes of hybrid system. uc
u = , uc c , ul {0,1} l , u m , m = mc + ml
m m
Another useful equivalence that deals with the
interaction of logical and dynamical variables is as ul
follows: The equality relation z (k ) = f ( x) regardless
{0,1} l are the auxiliary binary variables
r
of the relation between and f ( x) could be translated
to the following four mixed integer inequalities: z rc are the auxiliary continuous variables
The variables and z are introduced when
z (k ) M translating logic propositions into linear inequalities.
z (k ) m Figure 1 shows the MLD hybrid system structure and
the various connections between continuous / discrete
(3)
z (k ) f ( x) m(1 ) variable.
z (k ) f ( x) M (1 ) The auxiliary variables and z are used to define the
relations between continuous and discrete parts. Thus,
B. Mixed logical dynamical system structure the passage from continuous to the discrete part
requires the addition of logical variables. In general, an
The MLD modeling framework is based on the idea auxiliary logical variable reflects a switching
of translating logic relations, discrete/logic dynamics, phenomenon.
A/D (analog to digital (logic)), D/A conversion and
logic constraints into mixed integer linear inequalities. III. HYBRID MODELING OF A TOW TANK
These inequalities are combined with the continuous SYSTEM WITH MLD APPROACH
dynamical part, which are described by linear This benchmark has been used in many fields of
difference equations. The resulting MLD system is research to illustrate the work realized in the CNRS
described by the following relations: research group especially in AS 193 Diagnostic and
hybrid systems [13]. We propose here a MLD model
x(k + 1) = Ax(k ) + B1u(k ) + B2 (k ) + B3 z(k ) for such process.
y ( k ) = Cx ( k ) + D1u (k ) + D2 (k ) + D3 z (k ) (4) The system consists of two liquid tanks that can be
E2 ( k ) + E3 z ( k ) E1u ( k ) + E4 x (k ) + E5 filled with two identical, independent pumps acting on
Where: the outer tanks 1 and 2. The pumps deliver the liquid
A, B1 , B2 , B3 , C , D1 , D2 , D3 , E1 , E2 , E3 , E4 and E5 are flows Qp1 and Qp2 and they can be manipulated from
a flow of 0 to a maximum flow Qmax. The tanks are
matrixes of appropriate dimension.
interconnected to each other through upper and lower
x are the continuous and binary states:
pipes. The flow through these pipes can be interrupted

## ISSN: 1792-4324 141 ISBN: 978-960-474-208-0

Latest Trends on Circuits, Systems and Signals

with switching valve V4 that the liquid levels h1 and h2 In our case we obtain:
in each tank can be measured with continuous valued
level. 1
To simplify the study, we can assume that P2 is used h1 = A (Q p1 Q1 Q2 Q3 )
to make an initial water level in the reservoir R2 (This (6)
h = 1 (Q + Q Q )
pump is then stopped for the duration of operation) and 2 A 2 3 4
that valves V1 and V3 are kept constantly open.
The valve V2 is manual manipulated. It can be
opened or closed at any time by the user. Two discrete Q1 = S1 2 g h1 (7)
inputs are considered: the condition of the valve V4 and Q2 = S2 2 g h1 h2 (8)
V 2.
Q3 = S3 2 g sup(h1 , 0.5) sup( h2 , 0.5) (9)
Q4 = S4 2 g h2 (10)

## Derivation of the MLD Model of the Tow Tank

System.
The two tank system can be modelled in MLD form.
To this purpose, the following five main steps are
given:
1. Linearization of nonlinear relations. For this
system, this concerns the inflow and the outflow (6) .
2. Introduction of binary level indicator variables,
denoting whether the liquid level has reached the
height of the upper pipes.
3. Introduction of the states of the valves as binary
Fig. 2 Two tank system inputs Vi.
4. Elimination of products of binary and continuous
Table I variables using the mixed-integer inequalities (1) - (2)
Tow tank System Parameters 5. Description of the system in discrete domain time.
Meaning Symbol Value

Tank section A These steps are now outlined for the two tank
0.0154 m 2
system. In order to express the physical model (6) in
Cross-section of valve V1
V2,V3 and V4 S
3.6105 m 2 the MLD form, we approximate the non linearity in(7)-
(10). with a linear function (straight line
Gravity constant G approximation), the flows are linearized as follows:
9.81 m / s 2
Q1 (V1 ), Q2 (C1 ), Q3 (C2 ), Q4 (V2 )
Upper level water Q1 (V1 )
Hmax 0.8 m
Height of valves V4 Q1 = S1 2 g h1 (11)
hv 0.5 m 2g
maximum inflow through 4 3 Q1 h1k1V1 k1 S1
pump Qp1
Qmax 3.10 m / s H max
Q2 (C1 )
Sampling time Ts 5s
Q2 = S2 2 g h1 h2 (12)
Q2 k1 (h1 h2 )V3
From the conversation of the mass in the tanks we
2g
obtain the differential equation k1 S1
H max
V = Ah = Q Q
in out (5) Q3 (C2 )

Q3 = S3 2 g h1 0.5 (13)
With: Qin is the sum of flows in input, Qout is the sum
of flows in output , A is the section of the tank and V
is the volume of liquid in the tank and h is level liquid Q3V4 k2 V4 (max(hv , h1 ) max(hv , h2 ))

## ISSN: 1792-4324 142 ISBN: 978-960-474-208-0

Latest Trends on Circuits, Systems and Signals

2g TS
k2 S1 h1 (k +1) = h1(k) + (Q1(k) kV (h (k) h2 (k)) Vk h (k) k2 zV4 )
H max hv
1 3 1 1 1 1
A
Q4 (V2 ) T
h2 (k +1) = h2 (k) + S (kV (h (k) h2 (k)) + k2 zV4 k1zV2 )
1 3 1
(21)
Q4 = S1 2 g h2 (14) A
Q4 h2 k1V2 E2 ( k ) + E3 z ( k) Eu
1
(k) + E4 x(k) + E5

2g
k1 S1 The matrices Ei (i = 1,...,5) in collect all constraints of
H max
Applying the equation eq (2) and (3) we can obtain the the two tank system and all inequalities stemming from
MLD form. In order to take into account the flows the propositions (15) - (20).
through the upper valve V4, we define the auxiliary The transformation of the hybrid system equations
into the MLD form requires the application of a set of
binary variables:
given rules. A higher level language and associated
compiler (HYSDEL, see [6]) is used here to avoid the
[ 1 (k ) = 1] [ h1 (k ) hv ] (15)
tedious procedure of deriving the MLD form by hand.
[ 2 (k ) = 1] [ h2 (k ) hv ] (16) Given the MLD model, the scenarios is simulated using
the Hybrid Toolbox for Matlab [2].
By introducing the continuous auxiliary variables: In our case the MLD hybrid model generated from the
HYSDEL file <tank.hys> is composed of:
z0i max {hv , hi } hv - 2 states (2 continuous, 0 binary)
for i = 1, 2 (17) - 3 inputs (1 continuous, 2 binary)
= i ( hi hv ) - 0 outputs (0 continuous, 0 binary)
and zV 4 = V4 ( z01 z02 ) (18) - 4 continuous auxiliary variables
- 2 binary auxiliary variables
- 26 mixed-integer linear inequalities
According h1 and h2 level, the flow Q3 (C2 ) is expressed
as: III. PREDICTIVE CONTROL METHOD
Q 3V4 k2 zV 4 USING MLD MODEL
The valve V2 is manual operated. The user can open
In [1], Bemporad and Morari introduced a model
and closed it. Indeed the flow can be written as:
predictive control of hybrid systems using mixed logical
Q 4 V2
dynamical (MLD) system description and a mixed
Q 4 V2 k1 zV 2 zV 2 = V2 h2 (19) integer linear program solver.
In addition, hi and Q must fulfill the operating The main idea of MPC is to use a model of the
system to predict the future evolution of the system in a
constraints: fixed prediction horizon with the measurements of the
system. Based on this prediction at each time step k,
0 hi hmax the controller selects a sequence of future command
0 Q Qmax (20) inputs through an optimization procedure, which aims
at minimizing a suitable cost function and enforces
Finally, the differential equations (6) are discretized fulfilment of the constraints. Then, only the first
sample of the optimal sequence is applied to the plant
with the Euler method by replacing h with
at time step k, and at time step k+l, the whole
h(k + 1) h(k ) optimization procedure is repeated with new plant
the where TS is the sampling time.
TS measurements this online replanning provides the
Letting first defining the following: desired feedback control action. Let k be the current
time step, N is the prediction horizon, and x(k) is the
the state vector variables x [ h1 h2 ]T , current state.
The input vector u [Q1V4 V2 ]T combined a Assuming a quadratic cost function from the MLD
model the optimization has the following form:
continuous part and discrete part,
N 1 2 2

## [1 2 ]T are the auxiliary binary variables min J (u k

k + N 1
, x ( k )) = u ( k + i ) ue + (k + i / k ) e
i =0 Q1 Q2

## [ z01 z02 zV 4 zV 2 ] are the auxiliary continuous

T 2 2
and z + z ( k + i / k ) ze + x ( k + i / k ) xe
Q3 Q4
modelled the changes or switches which may appear 2

Q5

## ISSN: 1792-4324 143 ISBN: 978-960-474-208-0

Latest Trends on Circuits, Systems and Signals

## Subject to (22) In order to show the capability of handling a

multivariable hybrid control problem we have used
x(k + N / k) = xe pumps and switching valves figure(6) .
x(k +i +1/ k) 1 (k +i) + B2(k +i / k) + B3 (k +i / k)
= Ax(k +i / k) + Bu
y(k +i +1/ k) = Cx(k +i / k) + Du
1
(k +i) + D2(k +i / k) + Dz
3
(k +i / k)
Table II
E2 ( k +i / k) + E3z( k +i / k) Eu
1
(k +i) + E4x( k +i / k) + E5 Parameters of the control
N 2
Where Q4 Diagonal matrix [10 10]
2 T T
x Q
= x Q x , Qi = Qi 0, i = 1, ..., 5 are given weight Q1, Q2, Q3 Diagonal matrix
matrices [ 0.02, 0.02,...]
The vectors xe and ue are identifying the equilibrium r1 = 0.6 + 0.1sin( 0.04 k )
k [ 0 :100]
Reference h1
point where the system has to be driven. The vectors
e , ze are auxiliary variable corresponding to this Reference h2 0.3
equilibrium point and can be calculated solution of the
system of inequalities in (21) for u = ue and x = xe
The results of the predictive control described by
A general scheme for MPC problem is shown in figure Equation (22) are shown in Figure 4.
3. The resulting state trajectory using the predictive
h1 tank level
ye u y
0.8

## y MPC System 0.6

0.4

0.2

x 0
0 50 100 150 200 250 300 350 400 450 500
time [s]
h2 tank level
0.8

0.6
Fig. 3 General Scheme of MPC
0.4

0.2

## This problem can be rewritten as following standard 0

0 50 100 150 200 250 300 350 400 450 500
problem: time [s]

1 T
min H + f
T
2 (23)
subject to A b
-4
x 10 Pump action

3.5
in in
3

## z T (k ),..., zT (k + N 1), xT (k + 1),..., xT ( k + N ) 1

, yT (k ),..., yT (k + N 1)]T
0.5
0 50 100 150 200 250 300 350 400 450 500

Containing both logical and real components. Fig. 5 Pump action during control he maximum flow is
Note that the MPC of the MLD system can be solved limited to 3 10-4
using powerful mixed integer quadratic programming
(MIQP) algorithm.
MIQP problem at each time step k, the optimal control is described by the figure (4). As can be seen
the states reaches to the given reference signal h1 and
control sequence uk k + N 1 = {u (k ),..., u (k + N 1)} can
h2
be computed. According to the moving horizon The switching valves required to keep track of the
philosophy, only the first sample u(k) is applied to the reference the states of the system remain close to the
system, and all the rest are disregarded. At the next reference, this objective is reached by a switching in
time step k+1, the whole procedure is repeated. theV2 and V4 valves.
The main parameters are listed in table II.

## ISSN: 1792-4324 144 ISBN: 978-960-474-208-0

Latest Trends on Circuits, Systems and Signals

input V2
1 [9] G. Ferrari-Trecate, D. Mignone, D. Castagnoli, and, M. Morari,
Hybrid Modeling and Control of a Hydroelectric Power Plant.
Technical Report AUT00-11, Automatic Control
0.5
Laboratory, ETH Zurich, Switzerland, 2000.
[10] G. Ferrari-Trecate.,D. Mignone, and, M. Morari.Moving horizon
estimation for hybrid systems. IEEE Transactions on Automatic
0
0 50 100 150 200 250 300 350 400 450 500 Control 47 (10), 1663-1676. 2002.
inputV4
[11] H. P. Williams, Model building in mathematical programming.
1 (3rd ed.). New York:Wiley, 1993.
[12] S. Ben Attia, S.Salhi and M.Ksouri LMI formulation for static
output feedback desing of discrete time switched systems.
0.5 Journal of control science and Engineering,Vol 2009.
[13] D. Lefebvre, and al Diagnostic des SDH. Quelques
contributions issues des approches continues Journal Europen
0 des Systmes
0 50 100 150 200 250 300 350 400 450 500
[14]W.P.M.H. Heemels, B. de Schutter, and A. Bemporad.
Equivalence of Hybrid Dynamical Models. Automatica, 37(7),
pp. 1085-1091, July
Fig. 6 Discrete control action of the switching valves 2001.

APPENDIX
V. CONCLUSION
0.8612 0.0694 389.6104 0 0
A= B1 = 0
0.0694 0.9306 0 0
In this paper, we have presented a methodology of
modelling and control applied to tow tank system. 0 0 0 0 0.1133 0
B2 = B3 =
The methodology is based on several ideas from hybrid 0 0 0 0 0.1133 0.0694
dynamical systems theory, in particular uses Mixed
Logical and Dynamical (MLD) approach as model of

0 0 0

-0 .5 0 0 0 0

0 0 0 0 .5 0 0 0 0
the systems and Model Predictive Control (MPC) for

0 0 0

0 -0 .5 0 0 0

control strategy.

0
0
0
0
0
0

0
0 .5 0 0 0
0 .5 0 0 0
0

Mixed logical dynamical approach appears as a

0 0 0 0 .5 0 0 0 0
0 0 0 -0 .5 0 0 0 0

systematic way for modelling hybrid system. The 0 0 0 -0 .5 0 0 0 0

design objectives and constraints could also be

0
0 0
0 0
0

0
0
0 .5 0 0
0 .5 0 0
0
0

transformed into mixed-integer inequalities. Detailed

0 0 0 0 -0 .5 0 0 0
0 0 0 0 -0 .5 0 0 0
hybrid modeling and predictive control of tow tank
0 -1 0

0 0

E = E =
1
0 2
system using MLD approach were explained. Using

0
0
-1
1 0

0
0
0
0

predictive control strategy, fluid levels in multiple 0 1 0 0 0
0 0 -1 0 0
tanks could be optimally controlled using MLD
0 0 0

0 0

0
approach.
0 0

0 0

0 0 1 0 0
0 0 0 0 0

0 0 0 0 0
REFERENCES
0 0 0

0 0

0 0 0 0 0

-1 0 0 0 0
[1] A. Bemporad and, M. Morari, Control of System Integrating
1 0 0
0 0

Logic, Dynamics, and Constraints, Automatica 35(3), 407-427,
(1999).
[2] A. Bemporad. Hybrid Toolbox for real time applications, User
0 0 0 0 -1 0 0 .5 0 0 0
Guide, April 2006. 0 0 0 0 1 0 0

[3] Williams, H. P. (1987). Linear and integer programming applied

0 0 0 0

0 -1

0 .5 0 0 0

0 0 0 0 0 1 0
to the propositional calculus. Int. J. Systems Res. Inform Sci., 2,
-1 0 0 0

-1 0

1 .0 0 0 0

pp81-100 1 0 0 0 1 0 0
0 0
[4] D. Mignone, A. Bemporad, and M. Morari, A Framework for
-1 0 0

0

0

1 0 0 0 0 0 0
Control, Fault Detection, State Estimation, and Verification of
0 -1 0 0

0 -1

1 .0 0 0 0

Hybrid Systems Proceedings of the American Control

0 1 0 0

0 1

0

0 -1 0 0 0 0 0
Conference, San Diego, pp. 134-138,1999. 0 1 0 0 0 0 0

[5] F.Torrisi, A. Bemporad, and D. Mignone, Hysdel a tool for 1 -1 -1 0 0 0 1 .0 0 0 0
E = E = E =
0 0 1 .0 0 0 0
3 4 5
generating hybrid models. Technical report, AUT00-03,
-1 1 1

0

0 0 -1 0 0 0 0
Automatic control laboratory, ETH Zuerich, 2000.
0 0 1 0

0 0

0

[6] F.Torrisi and, A. Bemporad, Hysdel - a tool for generating

0 0 0 -1

0 -1

1 .0 0 0 0

computational hybrid models for analysis and synthesis 0 0 0 1 0 1 0
0 0 0 -1 0 0 0

problems. IEEE Trans Contr. Syst. Technol. 12(2), 235249, 0 0 0 1 0 0 0
0 0 0 . 8 0 0 0
2004. 0 0 0 -1
0 0 0 0 0 -1 0 .8 0 0 0
[7] F.Torrisi and, A. Bemporad., HYSDEL Modeling and Simulation
0 0 0 0

1 0

0

of Hybrid Dynamical Systems. Proceedings of MATHMOD

0 0 0 0

0 1

0

Conference, Vienna University of Technology, Vienna, Austria, 0 0 0 0 0 0 0 .3 0 0 0
0 0
0 0 0 0 0
February 5-7, 2003.
[8] G .Ferrari-Trecate, D. Mignone, and, M. Morari 2002. Moving
horizon estimation for hybrid systems. IEEE Transactions on
Automatic Control 47 (10), 1663-1676.