Professional Documents
Culture Documents
=
(1)
with: Q flow rate through orifice,
4 / D A
2
0
= area,
C
d
discharge coefficient,
fluid density,
P = P
1
- P
2
pressure differential.
The gain of the orifice, i. e. dQ / d(P), is given by:
p o
d
d
P 2
2
C A
P d
P
2
C A d
P d
dQ
(2)
with:
p o
P pressure drop evaluated at the operating point.
Equation 2 shows that the gain goes to infinity as the pressure drop P
|op
goes towards zero.
The reason for this effect is the fact that Equ. 1 is a good model for turbulent flow but a very
bad one for laminar which exists for small values of P. Another effect is that the infinite gain
may lead to severe numerical problems for algorithms with variable step size. In the library a
model based on the former German national standard TGL 38188 [11] is used.
The cylinder can be modeled with the library model Cylinder, see Fig. 6. An object
diagram of this model is given in Fig. 7. The complete mass of the moving parts is lumped
into the Piston.
- 8 -
Fig. 6 Model of cylinder Fig. 7 Object diagram of library model Cylinder
Modelica is an object-oriented language that supports hierarchical modelling of physi-
cal systems. For the cylinder that means that the component consists of several simple sub-
models, both from the mechanical and the hydraulic domain. Figure 7 shows the object dia-
gram of the cylinder. The green connectors and connection lines are mechanical parts, the red
ones are hydraulic components. This is an example how complicated systems can be easily
composed from the libraries using the graphical interface.
For submodels it is usually more convenient to use textual input instead of graphical icons
as the next section demonstrates.
7 Hierachical modelling
A very simple hydraulic component is a restriction with laminar flow. In the cylinder
model one is used to describe the leakage between the two chambers. The LaminarResistance
is a typical example of a component that has two ports. To get a structured library it makes
sense to start modelling this kind of component with a class that models a component with
two ports and no energy storage (s. Fig. 9). The Modelica code looks like (graphical informa-
tion omitted)
model TwoPortComp Superclass of circuits with TWO hydraulic ports
Modelica.SIunits.Pressure dp Pressure drop;
Modelica.SIunits.VolumeFlowRate q Flow rate through component;
Modelica.SIunits.Pressure pA_limited;
Modelica.SIunits.Pressure pB_limited;
HyLib.Interfaces.Port_A port_A Port A, were oil flows into the component ;
- 9 -
HyLib.Interfaces.Port_B port_B Port B, were oil leaves the component;
equation
pA_limited = max(port_A.p, HyLib.Interfaces.FluidProp.pvapour);
pB_limited = max(port_B.p, HyLib.Interfaces.FluidProp.pvapour);
dp = pA_limited - pB_limited;
q = port_A.q;
port_A.q + port_B.q = 0;
end TwoPortComp;
It is worth to note that Modelica uses equations and not assignment statements as pro-
gramming languages usually do. That means that the sequence of equations in a model doesn't
matter. It also means that every variable has to be defined by exactly one equation; the num-
ber of variables and the number of equations must be equal. The symbolic engine that makes
this modelling approach possible can also break algebraic loops, either by solving the system
of (linear) equations or by numerical iteration. This capability enables the modeller to just
write the equations without having to simplify of solve them by hand. The equations of the
generic LS-system are a good example. With block-oriented, assignment statements using
simulation languages this time-saving way could not be used.
The max operator limits the lower value of the pressure because the pressure of a
technical fluid cannot fall below vapour pressure; a technical fluid can transmit only positive
forces. This is a very crude model of the very complex effects of cavitation but is has proven
helpful especially when starting a simulation.
Fig. 8 Object diagram of TwoPortComp
Using this class it is simple to model a laminar resistance. Only the equation that de-
scribes the relation between pressure drop P (already defined as dp and computed) and flow
rate q has to be added. The key word for this inheritance is extends.
model LamResNoStates Resistance with laminar flow.
extends HyLib.Interfaces.TwoPortComp;
parameter HyLib.Interfaces.HyLibUnits.Conductance G=4.2e-13 conductance of laminar resistance;
equation
q = G*dp;
end LamResNoStates;
The class TwoPortComp can also be used for other components, e. g. a relief valve. The ex-
ample shows how easy relations can be expressed in Modelica (if ... then ... else). These
- 10 -
statements are translated into elaborated machine code that uses switching functions and not
the simple if ... then ... else statements from programming languages.
model ReliefValveNoStates Ideal model of a relief valve.
extends HyLib.Interfaces.TwoPortComp;
parameter Modelica.SIunits.Pressure
pclosed(final min=0) = 190e5 valve closed if dp smaller;
parameter Modelica.SIunits.Pressure
popen=205e5 valve wide open if dp higher;
parameter HyLib.Interfaces.HyLibUnits.
Conductance GLeak=1.111e-12 conductance of closed valve, i. e. leakage;
parameter HyLib.Interfaces.HyLibUnits.
Conductance GOpen=1.666e-9 conductance of wide open valve;
Boolean closed(start=false) closed: .true. => valve closed, only leakage;
Boolean open(start=false) open : .true. => valve wide open;
equation
closed = dp < pclosed;
open = dp > popen;
q = if closed then dp*GLeak else if open then (dp - pclosed)*GOpen + dp*GLeak
else (dp - pclosed)^2*GOpen/(popen pclosed) + dp*GLeak;
assert(popen > pclosed, Parameter popen MUST be greater than parameter pclosed.);
end ReliefValveNoStates;
The relief valve model uses an assert statement to make sure that the selected parameters
make sense. The pressure that opens the valve completely must be greater than the pressure
when the valve is completely closed. The discrete states closed and open help the user to de-
termine the state of the valve during a simulation run.
These kind of models (Fig. 9) can already be used to build a system and are contained
in the Basic library windows. When connecting them to a system the user has to add manually
lumped volumes to model the pressure dynamics, however. The ports of a real component are
oil filled and therefore lumped volumes are added at the ports for the main library model
LamRes (Fig. 10) or ReliefValve.
Fig. 9 Library model of a laminar resistance,
LamResNoStates
Fig. 10 Main Model, volumes (states) at the ports,
LamRes
- 11 -
This approach makes it very easy to build a model because the user only has to select
components, input parameters and connect them. The user doesnt have to include lumped
volumes as with other hydraulic simulation packages. The reason that it can be done this way
is that Dymola can cope with the resulting higher index system. During the system analysis
Dymola finds volumes that are connected in parallel and lumps them together.
8 Computer Model of Benchmark Problem
Fig. 11 Object diagram of simulation model
The object diagram in Fig. 11 shows the graphically composed part of the model. The
submodels were chosen from the appropriate libraries, connected and the parameters input. As
the friction model of the cylinder supports only speed dependent (viscous) friction a submodel
from the translational Modelica library was added to model a constant friction force of
4,000 N that the author has identified in cylinders of this size and this application area (exca-
vators). The input signals Z1 and Z2 are given by the tables, specifying the diameter of the
metering orifice. The maximum diameter was calculated to be 5.75 mm and a linear interpo-
lation between the given points was used.
To demonstrate how simple signal processing can be implemented the calculation of
the hydraulic power is shown. Two measuring devices give the pressure and flow rate, re-
- 12 -
spectively, and those values are multiplied. Another approach was used for Fig. 15 were the
pressure and flow rate trajectories from the simulation were used for a post processing with a
detailed mathematical model of the torque and volumetric losses of a typical pump [1]. This
mixed approach - simple loss model in the simulation and detailed one afterwards - has
proven to be very time efficient. A detailed pump model would have increased the simulation
time considerably.
The generic LS controller uses the variables from the hydraulic part. They can be ac-
cessed directly, using a dot notation. The pressure at port A of the first metering orifice is
named MeteringOri1.port_A.p. The calculated values of the controller, e. g. the pump flow
rate, is input at the filled blue triangles, e. g. Pump.inPort.signal[1] = ... .
The mathematical effort to analyse the textual and graphical input and set up a system of
equations that can be successfully solved numerically is immense. The user doesn't notice that
however. For the model in Fig. 11 translation of the Modelica model to C code, compiling and
linking takes 12 s on a Pentium III with 566 MHz, simulating the model for 9 s takes 10 s
computing time. All this is simply done by pressing the appropriate buttons. Then Dymola
starts, giving the following message:
- translateModel("BenchA")
Translation started
DAE with 371 unknown scalars and 371 scalar equations.
11 constants found.
33 parameter bound variables found.
151 alias variables found.
176 remaining time dependent variables.
The next step is the index reduction, i. e. lumping directly connected volumes together. An
example is:
Constraint equation found. Reduced state space.
equation
MeteringOri2.VolumeA.port_A.p = MeteringOri1.VolumeA.port_A.p;
Non-state variable chosen: MeteringOri2.VolumeA.port_A.p
Differentiated the equation
MeteringOri2.VolumeA.port_A.p = MeteringOri1.VolumeA.port_A.p;
giving
der(MeteringOri2.VolumeA.port_A.p) = der(MeteringOri1.VolumeA.port_A.p);
- 13 -
Finally there are 11 states left for the simulation model
/* There are 11 continuous time states:
Stop2.s
Stop2.v
C2.Chamber_B.port_A.p
C2.Chamber_A.port_A.p
Stop1.s
Stop1.v
C1.Chamber_B.port_A.p
MeteringOri1.VolumeB.port_A.p
C1.Chamber_A.port_A.p
MeteringOri2.VolumeB.port_A.p
MeteringOri1.VolumeA.port_A.p
End of list of continuous time states. */
Finished
9 Results
Two typical results are shown in Fig. 12 and 13. Plotted are the position of the cylinders and
the relevant pressure, i. e. pump pressure, pressure in cylinder chambers, pressure differential
across the metering orifices. Used are SI-Units.
Fig. 12 Simulation result from Dymola. Piston position in m over time in s
- 14 -
Fig. 13 Simulation result from Dymola. Pressures in Pa over time in s
The required plots of the velocity of the cylinders in cm/s and the power on the pump shaft
were made with Matlab to have the required scaling of the variables and a postprocessing of
the simulation result for the power, respectively. The required data was read from a file in
Matlab-format generated by Dymola.
0 1 2 3 4 5 6 7 8 9 10
Time in s
0
5
10
15
20
25
30
35
V
e
l
o
c
i
t
y
i
n
c
m
/
s
cylinder 2
cylinder 1
Fig. 14 Velocity of cylinders, experiment A
0 1 2 3 4 5 6 7 8 9 10
Time in s
0
10
20
30
40
50
60
P
o
w
e
r
o
n
p
u
m
p
s
h
a
f
t
i
n
k
W
Fig. 15 Power on the pump shaft, experiment A
- 15 -
0 1 2 3 4 5 6 7 8 9 10
Time in s
0
5
10
15
20
25
30
35
V
e
l
o
c
i
t
y
i
n
c
m
/
s
cylinder 1
cylinder 2
Fig. 16 Velocity of cylinders, experiment B
0 1 2 3 4 5 6 7 8 9 10
Time in s
0
10
20
30
40
50
60
P
o
w
e
r
o
n
p
u
m
p
s
h
a
f
t
i
n
k
W
Fig. 17 Power on the pump shaft, experiment B
10 Conclusion
Using a modern simulation tool a model was built that describes the behaviour of the cylin-
ders very detailed while using a generic LS-system as controller. The model uses both a
graphical interface for standard hydraulic or mechanical components and a textual input for
the specific control algorithms. This approach made it possible to give an answer to the posted
questions in reasonable time.
References
[1] Beater, P. (1999) Entwurf hydraulischer Maschinen Modellbildung, Stabilittsanalyse und Simulation
hydrostatischer Antriebe und Steuerungen. Springer Verlag.
[2] Beater, P. (2000) Modeling and Digital Simulation of Hydraulic Systems in Design and Engineering Edu-
cation using Modelica and HyLib. pp. 33 - 40. Modelica Workshop 2000, October 23 24, 2000, Lund,
Sweden.
[3] Dransfield, P. (1981) Hydraulic Control Systems - Design and Analysis of Their Dynamics. Springer, Ber-
lin, Heidelberg New York.
[4] Elmqvist, H. (1978) A Structured Model Language for Large Continous Systems. . PhD-Thesis Lund Insti-
tute of Technology, Lund, Sweden.
[5] Elmqvist, H., B. Bachmann, F. Boudaud, J. Broenink, D. Brck, T. Ernst, R. Franke, P. Fritzson, A.Jeandel,
P. Grozman, K. Juslin, D. Kgedahl, M. Klose, N. Loubere, S. E. Mattsson, P.Mostermann, H. Nilsson, M.
Otter, P. Sahlin, A. Schneider, H. Tummescheit, H.Vangheluwe. (1999) Modelica - A Unified Object-
Oriented Language for Physical Systems Modeling.TUTORIAL and RATIONALE. Version 1.3. December
15, 1999.
[6] Kraft, W. (1996) Experimentelle und analytische Untersuchungen hydrostatischer Fahrantriebe am Beispiel
eines Radbaggers. PhD-Thesis RWTH Aachen, Germany.
- 16 -
[7] Larsson, M. (2000) ObjectStab - A Modelica Library for Power System Stability Studies. pp. 13 - 22.
Modelica Workshop 2000, October 23 24, 2000, Lund, Sweden.
[8] Merrit, H. E. (1967) Hydraulic Control Systems. New York: John Wiley & Sons.
[9] Nikolaus, H. W. (1994) Loadsensing - lastunabhngige Dosierung von Verbraucherstrmen. lhydraulik
und Pneumatik, o+p, 38, pp. 196- 201.
[10] Schulz, R. (1979) Berechnung des dynamischen Verhaltens hydraulischer Antriebe groer Leistung fr
Umformmaschinen. PhD-Thesis. RWTH Aachen.
[11] TGL 38 188. (1982) Widerstandscharakteristik fester hydraulischer Widerstnde - Ermittlung.
[12] Tummescheidt, H. (2000) Development of a Modelica Base Library for Modeling of Thermo-hydraulic
Systems. pp. 41 - 52. Modelica Workshop 2000, October 23 24, 2000, Lund, Sweden.
[13] Viersma, T. J. (1980) Analysis, Synthesis and Design of Hydraulic Servosystems and Pipelines. Amster-
dam: Elsevier Scientific Publishing Company.
[14] Will, D. (1968) Der Einflu der ltemperatur auf das Durchfluverhalten von Drosselventilen unter beson-
derer Bercksichtigung der Kavitation. PhD thesis. Technische Universitt Dresden.
[15] FPN Simulation Benchmark (2001). Bench case problem for 2
nd
Intl Workshop on Computer Software for
Fluid Power Systems. Malenovice, Czech Republic, September 5-7, 2001,
http://fluid.power.net/fpn/simula2001/Bench_2000.pdf .
[16] www.Dynasim.se
[17] www.HyLib.com
[18] www.Modelica.org