Hydro ug-SIMHYDRAULICS PDF
Hydro ug-SIMHYDRAULICS PDF
Hydro ug-SIMHYDRAULICS PDF
User’s Guide
R2012a
How to Contact MathWorks
www.mathworks.com Web
comp.soft-sys.matlab Newsgroup
www.mathworks.com/contact_TS.html Technical Support
508-647-7000 (Phone)
508-647-7001 (Fax)
Trademarks
MATLAB and Simulink are registered trademarks of The MathWorks, Inc. See
www.mathworks.com/trademarks for a list of additional trademarks. Other product or brand
names may be trademarks or registered trademarks of their respective holders.
Patents
MathWorks products are protected by one or more U.S. patents. Please see
www.mathworks.com/patents for more information.
Revision History
March 2006 Online only New for Version 1.0 (Release 2006a+)
September 2006 Online only Revised for Version 1.1 (Release 2006b)
March 2007 Online only Revised for Version 1.2 (Release 2007a)
September 2007 Online only Revised for Version 1.2.1 (Release 2007b)
March 2008 Online only Revised for Version 1.3 (Release 2008a)
October 2008 Online only Revised for Version 1.4 (Release 2008b)
March 2009 Online only Revised for Version 1.5 (Release 2009a)
September 2009 Online only Revised for Version 1.6 (Release 2009b)
March 2010 Online only Revised for Version 1.7 (Release 2010a)
September 2010 Online only Revised for Version 1.8 (Release 2010b)
April 2011 Online only Revised for Version 1.9 (Release 2011a)
September 2011 Online only Revised for Version 1.10 (Release 2011b)
March 2012 Online only Revised for Version 1.10.1 (Release 2012a)
Contents
Getting Started
1
Product Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-2
Key Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-2
v
Product Workflow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-5
Examples
A
Getting Started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-2
vi Contents
Index
vii
viii Contents
1
Getting Started
Product Description
Model and simulate hydraulic systems
The SimHydraulics® product extends Simscape™ software with tools for
modeling and simulating hydraulic power and control systems. It enables
you to describe multidomain systems containing connected hydraulic and
mechanical components as physical networks. It provides a representative
library of hydraulic components and building blocks that lets you implement
other components.
Key Features
• Modeling environment for building hydraulic and hydromechanical systems
as physical networks
• More than 45 hydraulic and mechanical components, including pumps,
valves, accumulators, and pipelines
• Customizable library of common hydraulic fluids
• Access to linearization and steady-state capabilities in Simscape
1-2
Assumptions and Limitations
SimHydraulics software does not have the capability to model the following
types of systems:
• Fluid transportation
• Water supply and sewer systems
• Distributed parameters systems
1-3
1 Getting Started
Related Products
In this section...
“Product Requirements” on page 1-4
“Other Related Products” on page 1-4
Product Requirements
SimHydraulics software is the extension of Simscape platform product,
expanding its capabilities to model and simulate hydraulic elements and
devices.
• MATLAB®
• Simulink®
• Simscape
1-4
Modeling Physical Networks with SimHydraulics® Blocks
General rules that you must follow when building a hydraulic model are
described in “Basic Principles of Modeling Physical Networks” in the
Simscape documentation. “Essential Hydraulic Modeling Techniques” on page
2-6 briefly reviews these rules and provides specific examples of modeling
hydraulic systems and their components, such as power units and directional
valves.
1-5
1 Getting Started
Simulation Basics
SimHydraulics software gives you multiple ways to simulate and analyze
hydraulic power and control systems in the Simulink environment. Running
a hydraulic simulation is similar to running a simulation of any other
Simscape model. See “Model Simulation” in the Simscape documentation for
a discussion of the following topics:
All these aspects of simulating SimHydraulics models are exactly the same as
for Simscape models.
Selecting a Solver
SimHydraulics software supports all of the continuous-time solvers that
Simscape supports. For more information, see “Setting Up Solvers for
Physical Models” in the Simscape documentation.
You can select any of the supported solvers for running a SimHydraulics
simulation. The variable-step solvers, ode23t and ode15s, are recommended
1-6
Simulating Hydraulic Models
for most applications because they run faster and copy better for systems with
a range of both fast and slow dynamics.
In most cases, the default tolerance values produce accurate results without
sacrificing unnecessary simulation time. The parameter value that is most
likely to be inappropriate for your simulation is Max step size, because the
default value, auto, depends on the simulation start and stop times rather
than on the amount by which the signals are changing during the simulation.
If you are concerned about the solver’s missing significant behavior, change
the parameter to prevent the solver from taking too large a step.
• “Relative tolerance”
• “Absolute tolerance”
• “Max step size”
1-7
1 Getting Started
MathWorks recommends that you build, simulate, and test your model
incrementally. Start with an idealized, simplified model of your system,
simulate it, verify that it works the way you expected. Then incrementally
1-8
Simulating Hydraulic Models
1-9
1 Getting Started
Model Sharing
The Simscape Editing Mode functionality lets you open, simulate, and save
models that contain blocks from add-on products, including SimHydraulics
blocks, in Restricted mode, without checking out add-on product licenses, as
long as the products are installed on your machine.
This functionality allows a user, model developer, to build a model that uses
Simscape and SimHydraulics blocks and share that model with other users,
model users. When building the model in Full mode, the model developer
must have both a Simscape license and a SimHydraulics license. Once the
model is built, model users need only to check out a Simscape license to
simulate the model and fine-tune its parameters in Restricted mode. As long
as no structural changes are made to the model, model users can work in
Restricted mode and do not need to check out SimHydraulics licenses.
Another workflow lets multiple users, who all have Simscape licenses, share
a small number of SimHydraulics licenses by working mostly in Restricted
mode, and temporarily switching models to Full mode only when they need to
perform a specific design task that requires being in Full mode.
1-10
2
Modeling Hydraulic
Systems
You can combine all these blocks in your SimHydraulics diagrams to model
hydraulic systems. You can also use the basic Simulink blocks in your
diagrams, such as sources or scopes. See “Connecting Simscape Diagrams to
Simulink Sources and Scopes” for more information on how to do this.
2-2
SimHydraulics® Block Libraries
For more information on using the Library Browser, see “Library Browser” in
the Simulink Graphical User Interface documentation.
2-3
2 Modeling Hydraulic Systems
2-4
Product Workflow
Product Workflow
When you model and analyze a hydraulic power or control system using
SimHydraulics software, your workflow might include the following tasks:
For more information about modeling the physical system, see “Essential
Hydraulic Modeling Techniques” on page 2-6. For specific modeling
techniques, see category-specific topics like “Modeling Power Units” on
page 2-28 or “Modeling Low-Pressure Fluid Transportation Systems” on
page 2-46.
For more information about the settings that most affect the solution of
a physical system, see “Setting Up Solvers for Physical Models” in the
Simscape documentation..
2-5
2 Modeling Hydraulic Systems
2-6
Essential Hydraulic Modeling Techniques
• You can connect Physical Signal ports to other Physical Signal ports with
regular connection lines, similar to Simulink signal connections. These
connection lines carry physical signals between SimHydraulics blocks.
• You can connect Physical Signal ports to Simulink ports through special
converter blocks. Use the Simulink-PS Converter block to connect Simulink
outports to Physical Signal inports. Use the PS-Simulink Converter block
to connect Physical Signal outports to Simulink inports.
• Unlike Simulink signals, which are essentially unitless, Physical Signals
can have units associated with them. SimHydraulics block dialogs let you
specify the units along with the parameter values, where appropriate. Use
the converter blocks to associate units with an input signal and to specify
the desired output signal units.
MathWorks recommends that you build, simulate, and test your model
incrementally. Start with an idealized, simplified model of your system,
simulate it, verify that it works the way you expected. Then incrementally
make your model more realistic, factoring in effects such as friction loss,
motor shaft compliance, hard stops, and the other things that describe
real-world phenomena. Simulate and test your model at every incremental
step. Use subsystems to capture the model hierarchy, and simulate and test
your subsystems separately before testing the whole model configuration.
This approach helps you keep your models well organized and makes it easier
to troubleshoot them.
2-7
2 Modeling Hydraulic Systems
2-8
Creating and Simulating a Simple Hydraulic Model
The following schematic represents the model you are about to build.
It contains a single-acting hydraulic cylinder, which is controlled by an
electrically operated 3-way directional valve. The cylinder drives a load
consisting of a mass, viscous friction, and preloaded spring.
2-9
2 Modeling Hydraulic Systems
2 Create a new model. To do this, click the New button on the Library
Browser’s toolbar or choose New from the library window’s File menu
and select Model. The software creates an empty model in memory and
displays it in a new model editor window.
3 Open the Simscape > Foundation Library > Hydraulic > Hydraulic Sources
library and drag the Hydraulic Pressure Source block into the model
window.
4 Open the Simscape > SimHydraulics > Hydraulic Cylinders library and
place the Single-Acting Hydraulic Cylinder block into the model window.
5 To model the valve, open the Simscape > SimHydraulics > Valves library.
Place the 3-Way Directional Valve block, found in the Directional Valves
sublibrary, and the 2-Position Valve Actuator block, found in the Valve
Actuators sublibrary, into the model window.
2-10
Creating and Simulating a Simple Hydraulic Model
2-11
2 Modeling Hydraulic Systems
2-12
Creating and Simulating a Simple Hydraulic Model
8 Model the mechanical load for the cylinder. Open the Simscape >
Foundation Library > Mechanical > Translational Elements library and
add the Mass, Translational Spring, Translational Damper, and three
Mechanical Translational Reference blocks to your diagram.
2-13
2 Modeling Hydraulic Systems
9 Now you need to add the sources and scopes. They are found in the regular
Simulink libraries. Open the Simulink > Sources library and copy the
Constant block and the Sine Wave block into the model. Then open the
Simulink > Sinks library and copy two Scope blocks. Rename one of the
Scope blocks to Valve. It will monitor the valve opening based on the input
signal variation. The other Scope block will monitor the position of the
cylinder rod; rename it to Position.
2-14
Creating and Simulating a Simple Hydraulic Model
10 Double-click the Valve scope to open it. In the scope window, click to
access the scope parameters, change Number of axes to 2, and click OK.
The scope window now displays two sets of axes, and the Valve scope in
the diagram has two input ports.
2-15
2 Modeling Hydraulic Systems
12 To specify the fluid properties, add the Hydraulic Fluid block, found in the
Simscape > SimHydraulics > Hydraulic Utilities library, to your diagram.
You can add this block anywhere on the hydraulic circuit by creating a
branching point and connecting it to the only port of the Hydraulic Fluid
block.
2-16
Creating and Simulating a Simple Hydraulic Model
1 Select a Simulink solver. On the top menu bar of the model window,
select Simulation > Configuration Parameters. The Configuration
Parameters dialog box opens, showing the Solver node.
Under Solver options, set Solver to ode15s (Stiff/NDF) and Max step
size to 0.2.
2-17
2 Modeling Hydraulic Systems
2-18
Creating and Simulating a Simple Hydraulic Model
3 Specify the units for the pressure input signal. Simulink signals are
unitless. When you convert them to physical signals, you can supply units
by using the converter blocks. Double-click the Simulink-PS Converter1
block, enter Pa in the Input signal unit combo box, and click OK. When
the physical modeling software parses the model, it matches the input
signal units with the block input ports and provides error messages if there
is a discrepancy. For more information, see “Model Validation”.
4 Specify a realistic value for the pressure input signal. Double-click the
Constant block, enter 10e5 in the Constant value text box, and click OK.
5 Open the 2-Position Valve Actuator block and note that its Nominal
Signal Value parameter is set to 24.
2-19
2 Modeling Hydraulic Systems
6 Double-click the Sine Wave block and change its Amplitude to a value
greater than 50% of the nominal signal value for the 2-Position Valve
Actuator block, for example, to 20.
2-20
Creating and Simulating a Simple Hydraulic Model
9 Double-click the Mass block and change its Mass to 4.5 kg.
11 Double-click the Translational Spring block. Set its Spring rate to 6e3
N/m and Initial deformation to 0.02 m.
2-21
2 Modeling Hydraulic Systems
1 The input signal for the valve opening is provided by the Sine Wave block.
The Valve scope reflects both the input signal and the valve opening as
functions of time. The Position scope outputs the cylinder rod displacement
as a function of time. Double-click both scopes to open them.
2 To run the simulation, click in the model window toolbar. The physical
modeling solver evaluates the model, calculates the initial conditions,
and runs the simulation. For a detailed description of this process, see
“How Simscape Simulation Works”. Completion of this step may take a
few seconds. The message in the bottom-left corner of the model window
provides the status update.
3 Once the simulation starts running, the Valve and Position scope windows
display the simulation results, as shown in the next illustration.
2-22
Creating and Simulating a Simple Hydraulic Model
In the beginning, the valve is closed. Then, as the input signal reaches 50%
of the actuator’s nominal signal, the valve gradually opens to its maximum
value and moves the cylinder rod in the positive direction. When the input
signal goes below 50% of the nominal signal, the actuator closes the valve.
The spring returns the cylinder rod to its initial position.
You can now adjust various inputs and block parameters and see their effect
on the valve opening profile and the cylinder rod displacement.
2-23
2 Modeling Hydraulic Systems
1 Double-click the Sine Wave block, enter 40 in the Amplitude text box,
and click OK.
2 Run the simulation. The simulation results are shown in the following
illustration. With the increase in the input signal amplitude, it reaches
50% of the actuator’s nominal signal sooner, and the valve stays open
longer, which in turn affects the cylinder rod position.
2-24
Creating and Simulating a Simple Hydraulic Model
1 Double-click the Translational Spring block. Set its Spring rate to 12e3
N/m.
2 Run the simulation. The valve opening profile is not affected, but
increase in spring stiffness results in smaller amplitude of cylinder rod
displacement, as shown in the following illustration.
2-25
2 Modeling Hydraulic Systems
2-26
Creating and Simulating a Simple Hydraulic Model
2-27
2 Modeling Hydraulic Systems
2-28
Modeling Power Units
The simulation starts with the variable orifice opened, which results in a low
system pressure and the maximum flow rate going to the system. The orifice
starts closing at 0.5 s, and is closed completely at 3 s. The output pressure
builds up until it reaches the pressure setting of the relief valve (75e5 Pa) and
is maintained at this level by the valve. At 3 s, the variable orifice starts
opening, thus returning system to its initial state.
2-29
2 Modeling Hydraulic Systems
Using the Ideal Angular Velocity Source Block in Modeling Power Units
2-30
Modeling Power Units
The two previous examples demonstrate that the use of ideal sources is a
powerful means of reducing the complexity of models. However, you should
exercise extreme caution every time you use an ideal source instead of a real
pump. The substitution is possible only if there is an assurance that the
controlled parameter (angular velocity in the first example, and pressure
in the second example) remains constant. If this is not the case, the power
unit represented with an ideal source will generate considerably more power
than its simulated physical counterpart, thus making the simulation results
incorrect.
2-31
2 Modeling Hydraulic Systems
2-32
Modeling Directional Valves
• P — Pressure port
• T — Return (tank) port
• A, B — Actuator ports
• X, Y — Pilot or control ports
The basic 4-Way Directional Valve block lets you model eleven most popular
configurations by changing the initial openings of the orifices, as shown in the
following table.
2-33
2 Modeling Hydraulic Systems
2-34
Modeling Directional Valves
2-35
2 Modeling Hydraulic Systems
The other nine configurations are covered by the remaining 4-way directional
valve blocks (A through K), as shown in the next table.
2-36
Modeling Directional Valves
2-37
2 Modeling Hydraulic Systems
2-38
Modeling Directional Valves
• Annular Orifice
• Orifice with Variable Area Round Holes
• Orifice with Variable Area Slot
• Variable Orifice
• Ball Valve
• Ball Valve with Conical Seat
• Needle Valve
• Poppet Valve
2-39
2 Modeling Hydraulic Systems
h = x0 + xsp or
where
The number of variable orifices and the way they are connected are
determined by the valve design. Usually, the model of a valve mimics the
physical layout of a real valve. The illustration below shows an example of a
4-way valve, its symbol, and an equivalent circuit of its SimHydraulics model.
2-40
Modeling Directional Valves
The 4-way valve in its simplest form is built of four variable orifices. In the
equivalent circuit, they are named P_A, P_B, A_T, and B_T. The Variable
Orifice block, which is the most generic model of a variable orifice in the
SimHydraulics libraries, is used in this particular example. You can use any
other variable orifice blocks if the real valve design employs a configuration
backed by a stock model, such as an orifice with round holes or rectangular
slots, poppet, ball, or needle. In general, all orifices in the model can be
simulated with different blocks or with the same block, but with different
way of parameterization. For instance, two orifices can be represented by
their pressure-flow characteristics, while two others can be simulated with
the table-specified area variation option (for details, see the Variable Orifice
block reference page).
2-41
2 Modeling Hydraulic Systems
2-42
Modeling Directional Valves
way that the pump delivery is diverted to tank (unloaded) if both cylinders
are commanded to be in neutral position. The pump is disconnected from the
tank if either of the two control valves is shifted from neutral position.
To develop a model, the physical version of the valve must be created first.
The following illustration shows one of the possible configurations of the valve.
2-43
2 Modeling Hydraulic Systems
The SimHydraulics model, shown below, is an exact copy of the physical valve
configuration.
2-44
Modeling Directional Valves
All the orifices in the model are closed (overlapped) in valve neutral position,
except orifices P_T1_1 and P_T1_2. These two orifices should be set open to an
extent that allows pump delivery to be discharged at low pressure.
2-45
2 Modeling Hydraulic Systems
W V 2 − V12 p2 − p1
s
− = 2 + + z2 − z1 + hL
mg 2g ρg (2-1)
where
m Mass flow rate
Subscripts 1 and 2 refer to the entrance and exit, respectively. All the terms
in Equation 2-1 have dimensions of height and are named kinematic head,
2-46
Modeling Low-Pressure Fluid Transportation Systems
piezometric head, geometric head, and loss head, respectively. For a variety of
reasons, analysis of hydraulic power and control systems is performed with
respect to pressures, rather than to heads, and Equation 2-1 for a typical
passive component is presented in the form
ρ 2 ρ
V1 + p1 + ρgz1 = V22 + p2 + ρgz2 + pL
2 2 (2-2)
where
ρ
Term V 2 is frequently referred to as kinematic, or dynamic, pressure, and
2
ρgz as piezometric pressure. Dynamic pressure terms are usually neglected
because they are very small, and Equation 2-2 takes the form
The size of a typical power and control system is usually small and rarely
exceeds 1.5 – 2 m. To add to this, these systems operate at pressures in the
range 50 – 300 bar. Therefore, ρgz terms are negligibly small compared to
static pressures. As a result, SimHydraulics components (with the exception
of the ones designed specifically for low-pressure simulation, described in
“Available Blocks and How to Use Them ” on page 2-48) have been developed
with respect to static pressures, with the following equations
p = pL = f (q)
q = f ( p1 , p2 ) (2-4)
where
2-47
2 Modeling Hydraulic Systems
Fluid transportation systems usually operate at low pressures (about 2-4 bar),
and the difference in component elevation with respect to reference plane can
be very large. Therefore, geometrical head becomes an essential part of the
energy balance and must be accounted for. In other words, the low-pressure
fluid transportation systems must be simulated with respect to piezometric
pressures p pz = p + ρgz , rather than static pressures. This requirement is
reflected in the component equations
p = pL = f (q, z1 , z2 )
q = f ( p1 , p2 , z1 , z2 ) (2-5)
2-48
Modeling Low-Pressure Fluid Transportation Systems
account for the port elevation above reference plane and differ in the extent of
idealization, just like their high-pressure counterparts:
Use these low-pressure pipe blocks to connect all hydraulic nodes in your
model with difference in elevation, because these are the only blocks that
provide information about the vertical location of the ports. Nodes connected
with any other blocks, such as valves, orifices, actuators, and so on, will be
treated as if they have the same elevation.
2-49
2 Modeling Hydraulic Systems
the connecting pipe that can be caused by a filter, fittings, or some other
local resistance. The loss is specified with the pressure loss coefficient.
The block computes the volume of fluid in the tank and exports it outside
through the physical signal port V.
• Variable Head Tank — Represents a pressurized hydraulic reservoir,
in which fluid is stored under a specified pressure. The pressurization
remains constant regardless of volume change. The block accounts for the
fluid level change caused by the volume variation, as well as for pressure
loss in the connecting pipe that can be caused by a filter, fittings, or
some other local resistance. The loss is specified with the pressure loss
coefficient. The block computes the volume of fluid in the tank and exports
it outside through the physical signal port V.
• Variable Head Two-Arm Tank — Represents a two-arm pressurized tank,
in which fluid is stored under a specified pressure. The pressurization
remains constant regardless of volume change. The block accounts for the
fluid level change caused by the volume variation, as well as for pressure
loss in the connecting pipes that can be caused by a filter, fittings, or some
other local resistance. The loss is specified with the pressure loss coefficient
at each outlet. The block computes the volume of fluid in the tank and
exports it outside through the physical signal port V.
• Variable Head Three-Arm Tank — Represents a three-arm pressurized
tank, in which fluid is stored under a specified pressure. The pressurization
remains constant regardless of volume change. The block accounts for the
fluid level change caused by the volume variation, as well as for pressure
loss in the connecting pipes that can be caused by a filter, fittings, or some
other local resistance. The loss is specified with the pressure loss coefficient
at each outlet. The block computes the volume of fluid in the tank and
exports it outside through the physical signal port V.
2-50
Modeling Low-Pressure Fluid Transportation Systems
The models of tanks account for the fluid level heights F1, F2, and F3,
respectively, and represent pressure at their bottoms as
pi = ρgFi for i = 1, 2, 3
2-51
2 Modeling Hydraulic Systems
2-52
A
Examples
Getting Started
“Creating and Simulating a Simple Hydraulic Model” on page 2-9
A-2
Modeling Directional Valves
A-3
A Examples
A-4
Index
A
Index block library structure 2-2
accuracy simulating models 1-6
model parameter values 1-7 speed
model parameters that affect 1-7 model parameter values 1-7
model parameters that affect 1-7
H
W
hydraulic fluids
specifying properties 2-7 workflow
SimElectronics® 2-5
S
SimHydraulics® software
Index-1