Software for Fluid Power Technology
From Editor
The purpose of the Software Review section of the Journal is to present information to the reader about engineering software, including simulation programs, to highlight their specific features and their "fitness to purpose" in the unique field of fluid power and motion control. It is, of course, impossible to establish evaluation criteria matching the needs of all readers, therefore readers should not look for absolute ratings but more or less "fuzzy" opinions of the reviewer. A software program is like a wrench, just a tool to solve problems. It is good to solve some problems and not so good for others and this depends on both the nature of the problem and the users' attitude - and generally when we review software we do not know either. A software tool can be highly specialised and great for a some applications but not so well suited for others, on the other hand another software tool can be more flexible and generally applicable but without outstanding features. It is impossible, and even misleading, to say which one is better. What we hope to accomplish is to give the reader information necessary to take his/her own decision.
Co-simulation Method for a Hydro-Mechanical System Using
ADAMS and MATLAB/Simulink®
Introduction
In mechatronic systems it is common to connect different kind of elements like pneumatics, hydraulics, electronics, mechanics and control systems together to work as a machine system. The difficulties encountered in the simulation of the behaviour of e.g. a hydromechanical system are slightly different from those en-countered in the simulation of mechanical or hydraulic systems. Simulating a dynamical system in only one simulation program is usually extremely demanding or even impossible. Nevertheless, from an engineer’s point of view, it is much more convenient to model the different subsystems directly in their original physical domain or at the most appropriate environment. This simulation method, where two different programs trade parameters with each other at a preset time step, is known as co-simulation.
The co-simulation method introduced here is im-plemented by using ADAMS/Controls software for mechanics simulation and MATLAB/Simulink® for hydraulics simulation. Generally MATLAB/Simulink® is used to model those parts of the system that it does best, the controllers which drive the dynamic of the system based on sensor feedback, while ADAMS is used to model the mechanical parts of the system that are influenced by the geometric layout.
MATLAB/Simulink®
MATLAB integrates mathematical computing, visualization, and a powerful language to provide a flexible environment for technical computing. The open architecture makes it easy to use MATLAB and its companion products to explore data, create algorithms, and create custom tools. One of these kinds of add-ons is Simulink® which is MatLab’s extension tool for modelling, simulating and analysing dynamic, multidomain systems. In Simulink® models are expressed as block diagram form and there are extensive libraries of predefined blocks. In Fig. 1 is an overview of MATLAB/Simulink® software.
MATLAB and Simulink® are better introduced previously in this Journal. The article called "Modelling and Simulation of Fluid Power Systems with MATLAB/Simulink®" can be found in Volume 2 (2001), No. 3, pp. 55-58.

Fig. 1: The MATLAB/Simulink® environment
ADAMS
ADAMS software package is developed by Mechanical Dynamics about 20 years ago. Nowadays ADAMS is one of MSC.Software’s owned brands and ADAMS has raised the world’s most widely used mechanical system simulation software. ADAMS enables building and testing of virtual prototypes ,i.e., the simulation of the behaviour of mechanical systems as well as the 3D visualization without using a physical prototype. ADAMS basic simulation environment consists of ADAMS/View and ADAMS/Solver™ software. ADAMS/View is basic GUI tool for mechanical system design and ADAMS/Solver™ is an environment for generation of calculation routines in text mode. Solver can be used alone to build and analyse models, and after that the results can be imported into ADAMS/View for animating the model or plotting the results. The steps in creating model in AD-AMS/View are as follows:
- Create the parts using ADAMS/View library of parts or importing geometry from CAD.
- Add constraints that define how parts are attached and how they are allowed to move relatively to each other, and apply forces that act on your model.
- Test, validate, and simulate the model.
The advantage of ADAMS vs. for example MATLAB is that mechanical dynamical systems are described geometrically. This means in ADAMS you can define mechanics by building model with ADAMS’s own library of parts or you can use CAD geometry to layout the system, so the deriving of complex equations of motion is eliminated. Below are some aspects, which the geometrical representation enables:
- The true CAD Geometry can be used to accurately layout the system. The user does not have to gather key geometric features and program them into a block diagram.
- The geometry can be efficiently parameterised, allowing the user to easily see the effect of changes, and go through "what-if" design problems that trade off packaging against dynamic behaviour.
- Geometric representation allows you to directly see how the mechanical system will behave, instead of inferring the response from plots.
- With the geometric representation in ADAMS, you automatically get critical loads information at contact points and joint locations. Using MATLAB, to obtain the loading information in addition to kinematic and dynamic behaviour, it will depend greatly on how the equations are formulated.
- With ADAMS, it is easy to incorporate component flexibility into the system that is quite complex in the geometry it represent as well as how that component connects to other. Again, this is information about a system that is best described geometrically instead of mathematically.
There are also loads of optional ADAMS modules for different kind of simulations. We have used so called ADAMS/Controls add-on product, which enables co-simulation between ADAMS and several control system software. Other examples of these modules are ADAMS/Car for vehicle design, ADAMS/Aircraft for aircraft design and so on. There is also available add-on product called ADAMS/Hydraulics for simulation mechanics with hydraulic elements. Advantage of using ADAMS/Controls and Simulink is that in Simulink you can model more versatile systems, for example control system can be connected to hydraulics model and also all other toolboxes (e.g. control system toolbox) are available in Simulink.
Co-simulation
ADAMS/Controls "plug-in" module enables the data exhance between ADAMS and Simulink. There are four steps according to ADAMS/Controls brochure to model co-simulation model by ADAMS/Controls and Simulink:

Fig. 2: Steps for creating co-simulation model
ADAMS/Controls enables the exchange of data between these two programs in three ways. In the discrete mode, the integrators in both software applications run parallel and they exchange data as specified by the step-size. In this mode, MATLAB uses inputs from ADAMS, calculates the output and sends it back to ADAMS. It is the responsibility of ADAMS to integrate the mechanical system for a single time step with the specified inputs. The sampling rate at which the ADAMS receives input updates is critical - it must be ensured that the mechanical system is sampled at more than twice the highest interested frequency on the me-chanical side. Otherwise, aliasing might occur in the mechanical model. The effect of aliasing is that high-frequency noise can be converted into a lower frequency, which could change the response of the sys-tem. The order of data exchange in discrete mode is as follow:
- When you start simulation in Simulink®, software tells to ADAMS to start and loads up your model.
- After the initialisation task, Simulink® and ADAMS exchange data regarding system states. At the same time the plant outputs from ADAMS are being sent to Simulink®.
- Now ADAMS has required input values and dynamic analysis has begun on the ADAMS side. At this point the inputs to the plant are held fixed from the current time until the next output time step.
- When the dynamic analysis in ADAMS has proceeded the dynamic simulation has halted.
At specified time interval Simulink® and ADAMS stop, update one another with new state values. Each software then runs it’s simulation independently, using the fixed values throughout the following interval.
The second simulation method is the function evaluation method, which is called also the continuous mode. In this mode ADAMS acts as nothing but a function evaluator. This means that the Jacobian matrix, which describes the mechanical system, is evaluated by ADAMS, and the values are sent to MATLAB to populate the equations integrated by the Simulink. In other words, MATLAB integrates all the equations. At each integration step, ADAMS provides the necessary information, such as inputs and states to MATLAB. Because the function evaluation mode creates a large system Jacobian matrix that represents both the motor scheme and the mechanical system at once, simulating with this method is extremely slow. This means that the function evaluation mode is appropriate for simple systems. The downside is that all of MATLAB’s integrators are not finely tuned for solving mechanical systems and hence, have a tendency to fail for complex systems and, particularly, for those with high frequency mechanical system effects.
As a new method for control system modelling in ADAMS 12.0 is that Simulink® model can be imported into ADAMS/View as C-code. In this method you first describe the mechanical model in ADAMS/Controls and export the plant into Simulink® where the hydraulics or control model is implemented. Then the C-code is generated of Simulink® model by using MATLAB Real-Time Workshop (RTW) tool. RTW exports the Simulink® model as set of C-code files. Then these files can be compiled into an object library, which can then be imported into ADAMS and linked to the ADAMS plant. The simulation with the control system then runs entirely within ADAMS using the ADAMS integrators. Imported control systems can have continuous or discrete states. In Fig. 3 is a principle of the method described above.

Fig. 3: Using C -code, generated from Simulink® model, as a subprogram in ADAMS
Example Applications
As an example application we have a hydraulically driven loggrane system presented in Fig. 4. In this system the mechanical construction is modelled in ADAMS and the hydraulic circuit is modelled in Simulink®. The co-simulation has done by using ADAMS/Controls.

Fig. 4: Hydraulics and control system in Simulink® and mechanics in ADAMS/Controls
Another example, presented in Fig. 5, contains hydro-mechanical system, modelled in ADAMS, and a control system, modelled in Simulink®.

Fig. 5: Control system in Simulink® and hydromechanical system in ADAMS/Controls
Conclusion
MATLAB/Simulink® environment is very versatile to simulate all kind of mathematically represented systems and ADAMS is one of the bests in its category. Together these software forms a powerful tool for co-simulations. We have many experiences of the afore-mentioned methods utilized for co-simulations in several applications, and exposes are positive.
MH TE
Facts about ADAMS and MATLAB/Simulink®
BACK
©2002 Fluid
Power Net All rights reserved. Disclaimer