Accelerating the pace of engineering and science

# Documentation

## Two Cylinder Model with Load Constraints

This example shows how to model a rigid rod supporting a large mass interconnecting two hydraulic actuators. The model eliminates the springs as it applies the piston forces directly to the load. These forces balance the gravitational force and result in both linear and rotational displacement.

See two related examples that use the same basic components: four cylinder modelfour cylinder model and single cylinder modelsingle cylinder model.

• Note: This is a basic hydraulics example. You can more easily build hydraulic and automotive models using SimDriveline™ and SimHydraulics®.

• SimHydraulics extends Simulink® with tools for modeling and simulating hydraulic power and control systems. It enables you to describe multi-domain systems containing connected hydraulic and mechanical components as physical networks.

• SimDriveline extends Simulink with tools for modeling and simulating the mechanics of driveline (drivetrain) systems. These tools include components such as gears, rotating shafts, and clutches; standard transmission templates; engine and tire models.

Analysis and Physics of the Model

We assume the rotation angle of the rod is small. The equations of motion for the rod are given below in Equation Block 1. The equations describing the cylinder and pump behavior are the same as in the single cylinder example.

Equation Block 1:

The positions and velocities of the individual pistons follow directly from the geometry. See the corresponding equations below in Equation Block 2.

Equation Block 2:

Opening the Model and Running the Simulation

To open this modelopen this model, type sldemo_hydrod at MATLAB® terminal (click on the hyperlink if you are using MATLAB Help). Press the "Play" button on the model toolbar to run the simulation.

• Note: The model logs relevant data to MATLAB workspace in a structure called sldemo_hydrod_output. Logged signals have a blue indicator (see the modelsee the model). Read more about Signal Logging in Simulink Help.

• Note: The model logs all the continuous states of the system to MATLAB workspace in a structure called xout. Each state is assigned a name to facilitate data logging. The names of the states are available in the 'stateName' field of xout.signals. Read more about state names in Simulink Help.

Figure 1: Two cylinder model and simulation results

This subsystem is shown in Figure 2. It solves the equations of motion, which we compute directly using standard Simulink blocks. It is assumed that the rotation angle is small. Look under the mask of the 'Mechanical Load' subsystem to see its structure (right click on the subsystem > select "Look Under Mask").

Simulation Parameters

The parameters used in this simulation are identical to the parameters used in the single cylinder modelsingle cylinder model, except for the following:

L     = 1.5 m
M     = 2500 kg
I     = 100 kg/m^2
Qpump = 0.005 m^3/sec (constant)
C2    = 3e-10 m^3/sec/Pa
Fext  = -9.81*M Newtons

Although the pump flow is constant, the model controls the valves independently. Initially, at t = 0, the cross-section of valve B is zero. It grows linearly to 1.2e-5 m^2 at t = 0.01 sec, and then linearly decreases to zero at t = 0.02 sec. The cross-section of valve A is 1.2e-5 sq.m. at t = 0 and it linearly decreases to zero at t = 0.01 sec, then it linearly increases to 1.2e-5 sq.m. at t = 0.02 sec. Then the behavior of the valves A and B repeats periodically with the same pattern. In other words the valves A and B are 180 degrees out of phase.

Results

Figures 3 and 4 show the linear and angular displacements of the rod. The linear displacement response is typical of a type-one integrating system. The relative positions and the angular movement of the rod illustrate the response of the two pistons to the out-of-phase control signals (the cross-section of the valves A and B).

Figure 3: Linear displacement of the pistons and the load (load is in the middle of the rod)

Figure 4: Angular displacement of the rod

Close Model

Close the model and clear all generated data.

Conclusions

Simulink provides a productive environment for simulating hydraulic systems, offering enhancements that provide enormous productivity in modeling and flexibility in numerical methods. The use of masked subsystems and model libraries facilitates structured modeling with automatic component updates. As users modify library elements, the models that use the elements automatically incorporate the new versions. Simulink can use differential-algebraic equations (DAEs) to model some fluid elements as incompressible and others as compliant, allowing efficient solutions for complex systems of interdependent circuits.

Models such as this one can ultimately be used as part of overall plant or vehicle systems. The hierarchical nature of Simulink allows independently developed hydraulic actuators to be placed, as appropriate, in larger system models (for example adding controls in the form of sensors or valves). In cases such as these, tools from the MATLAB Control System Toolbox™ can analyze and tune the overall closed-loop system. The MATLAB/Simulink environment can thus support the entire design, analysis, and modeling cycle.