virtual prototyping of mechatronic systems [ferretti, magnani, rocco] [annual reviews in control,...

14
Virtual prototyping of mechatronic systems Gianni Ferretti, GianAntonio Magnani, Paolo Rocco * Dipartimento di Elettronica e Informazione, Politecnico di Milano, Piazza L. da Vinci 32, 20133 Milano, Italy Received 19 December 2003; received in revised form 26 January 2004; accepted 23 February 2004 Abstract Mechatronic systems abound in technological fields such as robotics and machine tools industry. Significant advances in dynamic performance of these systems can be achieved provided that mutual interactions of different domains (such as mechanics, electronics, hydraulics and control) are thoroughly understood. Virtual prototyping entails integration of multi-domain dynamic simulation in the design process, in order to reproduce and analyze the effects of design choices on the overall performance. This paper states the requirements of the modeling language and software tool for simulation of mechatronic systems and describes an experience of use of DYMOLA with Modelica language in the simulation of a complete machining center. The model has been successfully validated against experimental results collected on the real machining center. # 2004 Elsevier Ltd. All rights reserved. Keywords: Mechatronics; Modeling; Object-orientation; Simulation; Virtual prototyping 1. Introduction Every technological system where mechanics, electro- nics and control concur in a mutually supportive way to the overall performance belongs to the family of the mecha- tronic systems. Examples are found in robotics, machine tools or machining centers. While the traditional design process of such systems did not entail significant interac- tions between the mechanical designers and the experts of control and drive electronics, the market demand for ever increasing precision calls now for a synergic design, where the mutual interactions of choices made in the mechanical design (possibly including hydraulics) and in the drive electronics design are thoroughly understood. Dynamic performance of the machine has become the real issue, rather than static dimensioning, and dynamic performance cannot be improved unless the machine is studied with electronics and control operating in closed loop with the mechanics. Experimental study on physical prototypes is however expensive and time consuming. Virtual prototyping, a new way of defining dynamic simulation (Cellier, 1991; Ferretti, Filippi, Maffezzoni, Magnani, & Rocco, 1999) of the controlled machine, is more compliant with time and budget constraints of R&D industrial centers. If design choices on the mechanical as well as on the electronic side can be tested before assembling the physical prototype, the time to market is shortened and the knowledge of the system is improved, obviously as long as the simulation plant is a reliable replication of reality and the simulation tool is reasonably easy to use for people coming from different areas. The general impression is that today several companies operating in fields where competition and advances in dynamic precision of the machines are vital issues are somewhat ready to introduce these kinds of tools in the design process, but also that there is not enough conscious- ness on the real potentialities of the new approaches. Uncertainties often arise also on the requirements for the modeling language and software tool to be adopted. Simulation environments such as SIMULINK seem to be extremely powerful to replicate the control system, but difficulties are evident as soon as physical system modeling is attempted, as the unidirectional signal flow implied by the www.elsevier.com/locate/arcontrol Annual Reviews in Control 28 (2004) 193–206 * Corresponding author. Tel.: +39 022 399 3685; fax: +39 022 399 3412. E-mail address: [email protected] (G. Ferretti), [email protected] (G. Magnani), [email protected] (P. Rocco). 1367-5788/$ – see front matter # 2004 Elsevier Ltd. All rights reserved. doi:10.1016/j.arcontrol.2004.02.002

Upload: amolofosgreece

Post on 29-Jul-2015

49 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Virtual Prototyping of Mechatronic Systems [Ferretti, Magnani, Rocco] [Annual Reviews in Control, Elsevier]

www.elsevier.com/locate/arcontrol

Annual Reviews in Control 28 (2004) 193–206

Virtual prototyping of mechatronic systems

Gianni Ferretti, GianAntonio Magnani, Paolo Rocco*

Dipartimento di Elettronica e Informazione, Politecnico di Milano,

Piazza L. da Vinci 32, 20133 Milano, Italy

Received 19 December 2003; received in revised form 26 January 2004; accepted 23 February 2004

Abstract

Mechatronic systems abound in technological fields such as robotics and machine tools industry. Significant advances in dynamic

performance of these systems can be achieved provided that mutual interactions of different domains (such as mechanics, electronics,

hydraulics and control) are thoroughly understood. Virtual prototyping entails integration of multi-domain dynamic simulation in the design

process, in order to reproduce and analyze the effects of design choices on the overall performance. This paper states the requirements of the

modeling language and software tool for simulation of mechatronic systems and describes an experience of use of DYMOLA with Modelica

language in the simulation of a complete machining center. The model has been successfully validated against experimental results collected

on the real machining center.

# 2004 Elsevier Ltd. All rights reserved.

Keywords: Mechatronics; Modeling; Object-orientation; Simulation; Virtual prototyping

1. Introduction

Every technological system where mechanics, electro-

nics and control concur in a mutually supportive way to the

overall performance belongs to the family of the mecha-

tronic systems. Examples are found in robotics, machine

tools or machining centers. While the traditional design

process of such systems did not entail significant interac-

tions between the mechanical designers and the experts of

control and drive electronics, the market demand for ever

increasing precision calls now for a synergic design, where

the mutual interactions of choices made in the mechanical

design (possibly including hydraulics) and in the drive

electronics design are thoroughly understood. Dynamic

performance of the machine has become the real issue,

rather than static dimensioning, and dynamic performance

cannot be improved unless the machine is studied with

electronics and control operating in closed loop with the

mechanics.

* Corresponding author. Tel.: +39 022 399 3685; fax: +39 022 399 3412.

E-mail address: [email protected] (G. Ferretti),

[email protected] (G. Magnani), [email protected] (P. Rocco).

1367-5788/$ – see front matter # 2004 Elsevier Ltd. All rights reserved.

doi:10.1016/j.arcontrol.2004.02.002

Experimental study on physical prototypes is however

expensive and time consuming. Virtual prototyping, a new

way of defining dynamic simulation (Cellier, 1991; Ferretti,

Filippi, Maffezzoni, Magnani, & Rocco, 1999) of the

controlled machine, is more compliant with time and budget

constraints of R&D industrial centers. If design choices on

the mechanical as well as on the electronic side can be tested

before assembling the physical prototype, the time to market

is shortened and the knowledge of the system is improved,

obviously as long as the simulation plant is a reliable

replication of reality and the simulation tool is reasonably

easy to use for people coming from different areas.

The general impression is that today several companies

operating in fields where competition and advances in

dynamic precision of the machines are vital issues are

somewhat ready to introduce these kinds of tools in the

design process, but also that there is not enough conscious-

ness on the real potentialities of the new approaches.

Uncertainties often arise also on the requirements for the

modeling language and software tool to be adopted.

Simulation environments such as SIMULINK seem to be

extremely powerful to replicate the control system, but

difficulties are evident as soon as physical system modeling

is attempted, as the unidirectional signal flow implied by the

Page 2: Virtual Prototyping of Mechatronic Systems [Ferretti, Magnani, Rocco] [Annual Reviews in Control, Elsevier]

G. Ferretti et al. / Annual Reviews in Control 28 (2004) 193–206194

procedural description of the blocks does not seem to match

the physical description of the system adequately. On the

other hand commercial packages (e.g. ADAMS, Altair,

SimMechanics) abound for simulation of the mechanics,

from static dimensioning to vibration study, but users might

experience troubles when attempts are made to simulate

closed loops with electronics and control.

Meanwhile, the research on modular physical modeling

languages and tools, started at the end of the 1970’s, has

evolved into several modeling languages and simulation

environments: ASCEND (Piela, Epperly, Westerberg, &

Westerberg, 1991), OMOLA (Mattsson & Andersson, 1993),

gPROMS(Barton& Pantelides, 1994;Oh& Pantelides, 1996),

MOSES (Maffezzoni & Girelli, 1998), Modelica (Mattsson,

Elmqvist, & Otter, 1998; Tiller, 2001) and DYMOLA

(Elmqvist, Bruck, & Otter, 1996), to name just a few.

This paper first presents a discussion on the requirements

of a software tool for system simulation of mechatronic

devices. Multidomain scope, software reuse, reliability and

efficiency of the numerical simulation, integration with

mechanical CADs are found to be valuable aspects.

An experience is then described of use of DYMOLA with

Modelica language, which seems to comply with most of the

above requirements. The standard libraries of Modelica for

simulation of mechatronic systems are first described. Then

some customized modules, such as brushless motors and

current drivers, are presented, emphasizing the advantages

related to acausal physical system modeling.

As a case study, the results of a research on the sources of

performance limitations in a wood machining center are

presented. The performance limiting factors have been

investigated through linear models of the single axes of the

machining center, suitable to predict the resonant behavior

experimentally identified, and through simulation of a

detailed model developed in the DYMOLA environment.

The overall model of the machine can predict the

performance with noticeable accuracy, thus it can be used

in the design of new machines, with similar structure and

components as the machine studied in this work.

2. Requirements for the modeling language and the

simulation environment

Modeling and simulation of mechatronic systems are

difficult tasks, with several critical points. The choice of the

modeling approach and of the simulation environment thus

deserves particular attention, especially for large scale

industrial projects. The main user requirements for the

modeling approach and the simulation environment can be

specified as follows.

2.1. Multi domain simulation

The simulation environment must deal with equal

comfort with mechanical, hydraulic, electrical, control

and possibly other physical domains. As already mentioned,

a systematic study of dynamic performance of a mechatronic

system should neither privilege aspects relevant only to a

single domain, nor ignore the mutual interactions among

domains. For instance, software tools where mechanics are

simulated in detail, but electronics and control require to the

user ad-hoc additions of modules, written in a different

modeling language, are not advisable for the user due to

longer development times and reduced accuracy

2.2. Modular modeling and software reuse

Modular modeling is a major requirement, if not a need, for

simulation of complex systems like mechatronic ones.

However, real modularization of mechanical, hydraulic ad

electrical systems is hampered in most simulation tools,

which do not allow, for instance, to establish algebraic

relations (constraints) among state variables. Constraints on

state variables arise in the rigid connection of the dynamic

models of a motor shaft and of a gearbox, separately written,

or when more electric currents or liquid flows from different

circuits enter a common node or mixing volume. Modular

modeling permits to split a large model in a number of smaller

and more manageable models, and is a necessary condition to

software reuse. The reusability of modeling software from

project to project is a key requirement for industrial users.

2.3. Built-in model libraries and customisation

Use of built-in libraries of components keeps modeling

costs low and development times short. Libraries that cover

the needs for simulation of simple mechatronic systems are

usually available in most of commercial simulation tools.

Mechatronic systems simulation is especially demanding in

this respect, since libraries from several physical domains are

needed, easy to be integrated one with the others. Never-

theless, situations occur where customised modules must be

written, as is shown in the following Sections. In this respect,

expansion of library modules, rather than writing customised

modules from scratch, obviously facilitates the task of the user.

2.4. Reliability and efficiency of numerical simulation

Reliability and efficiency of the numerical solver are key

requirements for non-skilled users, generally unwilling to

deal with details in numerical integration of equations. A

differential algebraic equations (DAE) (Brenan, Campbell,

& Petzold, 1989) solver is needed, able to handle events,

such as discontinuities and abrupt changes in external

variables. The time instant when the event is triggered must

be detected with precision, thanks to variable step size of

integration. Also simulation of closed loop systems must be

dealt with in the most reliable way: solutions where the

physical part of the system is simulated with a DAE solver

while the procedural control part is simulated with an ODE

solver, and synchronisation is kept between the two solvers,

Page 3: Virtual Prototyping of Mechatronic Systems [Ferretti, Magnani, Rocco] [Annual Reviews in Control, Elsevier]

G. Ferretti et al. / Annual Reviews in Control 28 (2004) 193–206 195

2 The index of a DAE system is the number of times all or part of the

equations of the system must be differentiated, in order to obtain an ODE

do not seem to provide the same reliability as a single solver

integrating the whole system.

2.5. Integration with mechanical CADs

Mechanical designers feel comfortable with software tools

that can be easily integrated with the currently used mechanical

CADs (for example SolidWorks1). Generally speaking,

integration means that the mechanical CAD generates the

mass and inertial parameters to be used in the dynamic

simulation environment, without any manual transcription,

which is both time consuming and error prone. Also integration

with finite element analysis (FEA) packages turns out to be

useful for studies where flexibility of materials is an issue.

2.6. Interfaces for pre- and post-processing

Assembly of modules should be performed through a

Graphical User Interface (GUI). Both 2D and 3D interfaces

are used, the 2D being more common and easy to use. Each

library module should be associated to a graphical symbol as

evocative as possible of the physical nature of the system.

Visualisation of simulation results can be performed both with

2D plots or 3D animation. The 2D plots are more useful for

detailed analysis of dynamic properties, while 3D animation

helps understanding the gross motion of the system.

Compliance with the above requirements 2.1–2.3

(customisation) entails the following properties of a

simulation environment and its modeling language.

2.7. Simulation paradigm

Declarative modeling languages should be used to

simulate the physical parts of the system, be they mechanical,

electrical, hydraulic or pneumatic components. Procedural

languages, where the unidirectional flow of information from

an input to an output is postulated, are inadequate to simulate

systems where instantaneous exchanges of power are

present. Acausal models, described by DAE systems, should

be used to represent in the most natural and physically

consistent way each system component, while the task of

defining the computational causality of the assembled model

should be charged to the simulation environment.

2.8. Object orientation

The modeling language should comply with modern

object-oriented paradigms of software engineering. The most

relevant aspects of object-orientation to the benefit of physical

system modeling are modularization (the system is composed

by aggregation of modules), abstraction (the internal

description of a module is separated from its interface),

information encapsulation (only the interface variables are

1 SolidWorks is a trademark of SolidWorks Corporation.

accessible to the other modules), reuse of the modules through

parameterisation. Structuring the object-oriented models

(modules) in libraries facilitates the extension of existing

models and the simulation of large and complex systems.

2.9. Handling of equations and constraints

Assembling of modules described by DAE equations

generally leads to higher index2 systems and algebraic loops.

Symbolic manipulation of the equations is then required to

yield a set of equations amenable to numerical integration.

Some simulation tools use Pantelides’ (1988) algorithm (or

similar) to reduce the index of the system. Others use

constraint relaxation techniques, generating an ODE system

where, however, constraints are not identically satisfied

during transients. The efficiency of this pre-processing

software layer might be crucial for the efficiency of the

overall simulation environment.

3. Modelica standard libraries for mechatronics

None of the commercial packages on the market fully

complies with all the above user requirements, to our

knowledge. On the other hand, the choice of the package to

adopt may depend on specific issues of the problem and may

require a trade off among the degrees of fulfillment of

different requirements.

In the present work, an experience is reported of use of

DYMOLA (with Modelica language) for simulation of

machining centers. This package fully complies with the

requirements of multi-domain simulation and ease of

customization, and features the acausal declarative model-

ing paradigm as well as the object-oriented approach. The

efficiency of the numerical integration is guaranteed by a

sophisticated software layer where the assembled model is

first translated, i.e. equations are symbolically manipulated,

in order to reduce the index and produce efficient simulation

code. A state of the art numerical solver of DAE’s is then

used for numerical integration. A 2D GUI for model

assembling is available, as well as a simple 3D animation

module for post processing of simulation results.

Concerning interfaces with mechanical CAD packages, a

translator from SolidWorks to Modelica is also available. It

converts bodies and joints of SolidWorks models to

Modelica models, also filling in the templates of the

relevant geometrical and inertia parameters. Additional

mechanical components (external forces, torques, frictions,

etc.) can be easily added using a Modelica editor.

In DYMOLA all models are written in the Modelica

language, the outcome of the efforts of the Modelica

Association, a non-profit, non-governmental organization

system. When the index is higher than one, explicit or hidden algebraic

constraints on the state variables of the system are present.

Page 4: Virtual Prototyping of Mechatronic Systems [Ferretti, Magnani, Rocco] [Annual Reviews in Control, Elsevier]

G. Ferretti et al. / Annual Reviews in Control 28 (2004) 193–206196

born in 1996. The aim of the association is to develop and

promote the Modelica modeling language for modeling,

simulation and programming of physical and technical

systems and processes. The association maintains specifica-

tions of the modeling language and develops free of use

Modelica standard libraries. DYMOLA is one of the

software tools (together with MathModelica (Fritszon,

Gunnarsson, & Jirstrand, 2002) and OpenModelica (Frits-

zon, Aronsson, et al. 2002)) that fully supports the Modelica

language and offers the software environment to actually

perform the simulation.

There are several Modelica libraries relevant for a

mechatronic project: the Modelica.Mechanics.Rotational

package (shown, as an example, in Fig. 1) offers elements to

simulate one dimensional rotational mechanical systems,

useful to reproduce transmission chains, gearboxes, shafts

with inertia, spring/damper elements, frictional and back-

lash elements. Remarkably, rigid connection of two inertia

elements, an operation which is essential for the modular

simulation of transmission chains but generates a higher

(three) index DAE system, can be made without any

concern. The simulation environment is in charge of

resolving the constraint of equality of the angular positions

and velocities of the two inertia elements. A similar library

(Modelica.Mechanics.Translational) is available to simulate

one dimensional translational mechanical systems.

Three-dimensional mechanical systems, such as robots,

machine tools or vehicles, can be modelled with the

ModelicaAdditions.Multibody library. The components of

this library can be combined with the above 1D-mechanical

libraries through flanges in the Joint modules (the joints

introduce the degrees of freedom in the mechanical

systems). The Body elements require specification of

Fig. 1. Modelica standard library for rotational mechanics.

geometrical as well as inertial (mass, center of mass and

inertia tensor) parameters, that can be easily introduced if an

interface with a solid modeller is available.

Differently from other simulation environments, the

electrical and control domains can be simulated with equal

ease as the mechanical domain. The Modelica.Electrica-

l.Analog library allows simulation of simple electrical

circuits. The declarative paradigm is fully respected in this

library, too. All components have electrical cuts where

exchanges of electrical power (through voltage and current

variables) take place. This implies that each physical

element (be it a resistor or a capacitor, for example) has just

one library counterpart, regardless that the element is

actually voltage or current driven. Complete reusability of

the models is thus guaranteed.

The Modelica.Blocks library contains input/output

blocks to build up simple block diagrams for simulation

of controllers (both analogue and digital ones). Based on our

experience, the library, although somewhat limited, allows

to simulate most of the functions of commercial controllers,

obviously through aggregation of the library elements. An

example is given in next section for the simulation of a

current driver for a brushless motor.

Other major libraries suitable for mechatronic systems

are the hydraulic (HyLib) and pneumatic (PneuLib)

libraries. They contain the most important basic compo-

nents, useful to model hydraulic and pneumatic circuits.

Coupling elements exist to connect hydraulic and pneumatic

components with control blocks of the blocks library and

elements of the mechanics library. The libraries support

modeling of one-dimensional rotational and translation

hydraulic and pneumatic systems, and consist of large

varieties of pumps, boosters, motors, cylinders, valves,

restrictions, tanks, reservoirs, sensors, lines and volumes.

4. An example of a customized module

The most common actuation systems adopted in robotics,

machine tools industry and a number of mechatronic

systems are by far servomechanisms with permanent magnet

brushless motors, connected to the loads by transmission

chains (or gearboxes). In a brushless motor the electro-

mechanical commutation typical of brushed dc motors is

replaced by an electronic commutation of the currents in the

three phases of the stator windings. This should in principle

guarantee that the electromagnetic torque delivered on the

motor shaft is independent of the rotor position. However,

some constructive imperfections in the motor or in the drive,

where electronic commutation is implemented, produce an

undulation (ripple) (Ferretti, Magnani, & Rocco, 1998;

Jahns & Soong, 1996) on the actual torque. While this

problem could be considered minor in the static dimension-

ing of the actuation system, it is of utmost importance for its

dynamic performance. Torque ripple might in fact excite the

resonances of the mechanical system, usually associated to

Page 5: Virtual Prototyping of Mechatronic Systems [Ferretti, Magnani, Rocco] [Annual Reviews in Control, Elsevier]

G. Ferretti et al. / Annual Reviews in Control 28 (2004) 193–206 197

Fig. 2. The brushless motor and the driver.

the elastic couplings between motors and loads (Ferretti,

Magnani, & Rocco, 1999).

Dynamic models and simulation are valuable tools to study

these phenomena, and in particular to separate the effects of

the single sources of disturbances on the performance of the

system. Mechanics, electronics and control are different

domains involved in this truly mechatronic problem.

The model of the system in DYMOLA is obtained by the

feedback connection of two sub-models, one representing

the brushless motor, the other the driver (Fig. 2). The two

models are connected through three electrical connectors

(for the phases of the motor) as well as through a control

connector (the measure of the rotor position).

The brushless motor model is shown in Fig. 3. The three

phases are Y connected in the block emf3, that generalizes the

emf model in the Modelica.Electrical.Analog.Basic library.

The equations of the emf3 model are the following ones:

X3

i¼1

ii ¼ 0

Vi ¼ Vn þ ei

ei ¼ kiv � �

ki ¼

2kt sin p#� ði � 1Þ 2

p

3 3

# ¼ v

Fig. 3. Modelica model of

tm ¼ �ðk1i1 þ k2i2 þ k3i3Þ;

where ii, Vi, ei and ki (i = 1, 2, 3) are the phase currents, the

phase input voltages, the back emf’s and the back emf

profiles for each phase, respectively; Vn is the voltage of

the central node of the Y connection; # and v are the angular

position and velocity of the rotor; kt is the torque constant of

the motor, p the number of pole pairs and tm is the electro-

magnetic torque generated by the motor.

The code of the emf3 model is reported in the Appendix

A. Thanks to declarative coding it is straightforward to write

code from equations and read out equations from code.

Remarkably, the algebraic constraint on the currents (which

are state variables) can be specified in the most natural way

the brushless motor.

Page 6: Virtual Prototyping of Mechatronic Systems [Ferretti, Magnani, Rocco] [Annual Reviews in Control, Elsevier]

G. Ferretti et al. / Annual Reviews in Control 28 (2004) 193–206198

(the sum of the currents equal zero). Assigning, in the

simulation code, back emf profiles ki different from the

nominal sinusoidal ones, ripple due to higher order

harmonics can be reproduced.

In addition to the emf3 module, the model of the brushless

motor includes inductance and resistance of stator windings

and the mechanical part, consisting of rotor inertia and

viscous friction.

Just for comparison, Fig. 4 shows the SIMULINK model

of the electrical part of the motor, obtained by resolving the

algebraic constraint and expressing the whole model in

terms of two out of three currents. This operation is time

consuming and error prone and produces a model

description rather difficult to read.

A full digital version of the current controller has been

implemented (Fig. 5). Avector control scheme (Texas, 1997)

has been adopted, where the phase currents are first

transformed into direct and quadrature currents through

Park’s transformation. Two digital loops are closed on

these currents, the quadrature reference being the output of

the outer position/velocity controller, the direct reference

being zero usually. The voltage commands output of the two

anti-windup PI controllers are then back transformed to

voltages on the three phases through inverse Park’s

transformation.

The PWM amplifier has not been simulated since,

operating with a frequency of 10 or 20 kHz and with a

modulation of the pulse width of 1 ms, it requires an

integration step size smaller than 1 ms, which might be

acceptable for the simulation of the electronics of a motor

drive, but is far too small in the joint simulation of the

mechanics and the electronics. This is particularly true if the

Fig. 4. SIMULINK model o

model of the motor is instantiated several times, for the

simulation of a complete machine.

5. A case study

5.1. Preliminaries

The model of the brushless motor described in the

previous section has been included in a library of elements

used to simulate a complete three axes machining center.

This simulation is part of a research aimed at understanding

the sources of performance limitations in mechanical

machining centers and at deriving mathematical models

that can support its mechatronic design.

The structure of the machining center studied in this work

is sketched in Fig. 6. This kind of structure is common to

several machining centers used for wood and metal,

characterized by three linear axes (X, Y, Z).

Motion transmission for X axis is realized through two

reduction stages with belts and pulleys, followed by a

pinion-rack stage, that allows to convert rotational motion to

linear motion. In the Y axis, only one stage with belts and

pulleys is present, besides the pinion-rack pair. In the

following, axis Z will not be considered, as it does not

present critical elements.

5.2. Experimental results

Experimental tests have been performed on the machine,

in order to calculate frequency responses. A new software

package, shipped by the manufacturer of the CN, has been

f the brushless motor.

Page 7: Virtual Prototyping of Mechatronic Systems [Ferretti, Magnani, Rocco] [Annual Reviews in Control, Elsevier]

G. Ferretti et al. / Annual Reviews in Control 28 (2004) 193–206 199

Fig. 5. Model of the digital driver.

Fig. 6. Three linear axes machining center.

Page 8: Virtual Prototyping of Mechatronic Systems [Ferretti, Magnani, Rocco] [Annual Reviews in Control, Elsevier]

G. Ferretti et al. / Annual Reviews in Control 28 (2004) 193–206200

Fig. 7. Test for the computation of the closed loop frequency response.

used, that allows to estimate a closed loop frequency

response with the frequency sweep method. The sweep

signal (a sinusoidal signal whose frequency grows with

time) is summed to the control variable, as shown in Fig. 7.

The closed loop frequency response is obtained from the

ratio of the Fourier transform of the output of the regulator

(TCMD) and of the sweep itself. The other axes, not

involved in the identification experiment, are kept in

assigned positions.

In Figs. 8 and 9 the frequency responses computed by

the software tool for the X axis and for the Y axis are

reported, respectively. The frequency response shows

that both the axes are characterized by two antiresonance

(AR)–resonance (R) pairs (namely lightly damped complex

zeros followed by complex poles). In the case of the X axis

the first resonance is found at about 50 Hz, while the

second one is beyond 200 Hz: a clear frequency separa-

tion thus emerges. This is not true for the Y axis, where

the two resonances are located at 20 Hz and 60–70 Hz,

respectively.

In the following, lumped parameters models of the two

axes are presented, that give an interpretation of these

results.

Fig. 8. Closed loop frequenc

5.3. Modeling and analysis

The goal of the analysis is to determine models of the X

axis and of the Y axis that are able to predict with acceptable

accuracy the dominant AR–R pairs.

For the X axis the base of the machine is assumed to be

rigid and the inertias of the motor, of the pulleys of the belts

and of the load, including the pinion and the cart of the X

axis, also loaded with the other axes, are explicitly

accounted for. Consistent with this, the stiffness constants

considered are those associated to the transmission belts

(first and second stage), to the bearings, to the teeth and to

the bending and torsion of the shaft of the pinion.

y response for X axis.

Page 9: Virtual Prototyping of Mechatronic Systems [Ferretti, Magnani, Rocco] [Annual Reviews in Control, Elsevier]

G. Ferretti et al. / Annual Reviews in Control 28 (2004) 193–206 201

Fig. 9. Closed loop frequency response for Y axis.

In order to assign the values of the stiffness constants,

analytical relations have been derived, that express these

values in terms of geometrical and physical parameters of

the elements of the transmission, as well as of a numerical

coefficient to be adapted on an experimental basis, so as to

maximize the adherence of the results obtained from the

model to those gathered on the machining center. These

relations can then be used in future projects for the best a

priori estimation of similar transmission structures

employed in newly designed machines.

A linear model composed of masses, springs and

dampers has been derived and analyzed in the Matlab

environment, together with the model of the control system

of the X axis, in order to study the closed loop behavior.

The control system parameters have been obtained from the

configuration data and from documentation and, whenever

necessary, with ad hoc measurements on the machine. The

damping coefficients, quite hard to be obtained on an

analytical basis, have been determined so as to obtain the

best approximation of the experimental results. The Bode

diagrams of the closed loop frequency response derived in

this way are reported in Fig. 10. As it can be seen,

comparing with the diagrams in Fig. 8, the model correctly

predicts the frequencies of the two pairs AR–R. To this

purpose, the stiffness constants computed for the bearing

and for the teeth of the pinion and the rack and for the

second stage of the belt transmission had to be halved from

their nominal values. In general, a stiffness constant less

than the computed one is admissible, as it is not easy to

account for all the compliant elements in the transmission

chain.

As far as the Y axis is concerned, the closed loop

frequency response of Fig. 9 cannot be interpreted with a

model that attributes the compliance to the transmission

chain only, as the one used for the X axis. It is in fact

necessary to consider, besides the compliance of the

transmission between the two dominant inertias of the

motor and the load, the compliance at the base of the rotated

‘‘L shaped’’ structure on which the cart of the X axis slides.

This structures is constrained by two rails that block all the

degrees of freedom, except the translation in the X direction.

A compliance of this constraint to moments in the X

direction induces a compliance of the support of the motion

actuator for the Y axis.

A linear model can thus be derived, whose parameters are

computed with the same methodology used for X axis. The

Page 10: Virtual Prototyping of Mechatronic Systems [Ferretti, Magnani, Rocco] [Annual Reviews in Control, Elsevier]

G. Ferretti et al. / Annual Reviews in Control 28 (2004) 193–206202

Fig. 10. Closed loop frequency response of the X axis from the linear model.

closed loop frequency response with Bode diagrams shown

in Fig. 11 is obtained. Comparing with the diagrams in Fig.

9, it can be noted that the model predicts with remarkable

accuracy the experimental results.

Fig. 11. Closed loop frequency response

5.4. Derivation of the complete model in DYMOLA

Fig. 12 shows the top level view of the simulator of

the machining center developed in DYMOLA. The model

of the Y axis from the linear model.

Page 11: Virtual Prototyping of Mechatronic Systems [Ferretti, Magnani, Rocco] [Annual Reviews in Control, Elsevier]

G. Ferretti et al. / Annual Reviews in Control 28 (2004) 193–206 203

Fig. 12. Complete DYMOLA model of the machining center.

Fig. 13. Model of the reductor.

is composed of three parts: the simulation of the CN and

the servodrives, entirely realized with the DYMOLA

blocks, the simulation of the transmission chain for each

axis, where the model of the brushless motor has been

used, and the simulation of the kinematic chain, realized

with the elements of the ModelicaAdditions.MultiBody

library.

Fig. 14. Model of the b

The models of the reductor and of the belt trans-

mission are shown, as examples, in Figs. 13 and 14,

respectively. Both of them contain a customized module:

in the reductor an element which allows simulation of

either a rigid transmission or an elastic (with backlash) one

has been introduced for debugging purposes. In the belt

transmission, an element describing a simplified model

elt transmission.

Page 12: Virtual Prototyping of Mechatronic Systems [Ferretti, Magnani, Rocco] [Annual Reviews in Control, Elsevier]

G. Ferretti et al. / Annual Reviews in Control 28 (2004) 193–206204

Fig. 15. Model of the CN.

Fig. 16. Model of the drive for each axis.

of a belt is present. The first element is realized by

composition of Modelica library elements, the second

one by direct writing of the balance equations on the

belt.

Fig. 15 shows the internal structure of the CN

module, which is made up by an interpolator (responsible

for trajectory generation) and as many closed loop

controllers (drives) as the axes in the kinematic chain. In

turn, each drive has the structure shown in Fig. 16, where

a digital position–velocity controller is closed around

the digital current controller described in the previous

section.

The multi-domain nature of DYMOLA and the physics

driven assembly of the model turned out to be essential

elements to realize a reliable simulation environment, easy

to use for a non specialist of dynamic modeling.

In order to validate the model, comparisons have been

made with experimental results related to the single axes X

and Y, using the responses to the sweep signal. The

comparisons with these responses are shown in Figs. 17 and

18. As it can be seen, the model is able to predict with

noticeable accuracy this type of responses, confirming the

validity of the modeling assumptions.

Page 13: Virtual Prototyping of Mechatronic Systems [Ferretti, Magnani, Rocco] [Annual Reviews in Control, Elsevier]

G. Ferretti et al. / Annual Reviews in Control 28 (2004) 193–206 205

Fig. 17. Responses to the frequency sweep for X axis.

Fig. 18. Responses to the frequency sweep for Y axis.

6. Conclusions

The choice of modeling language and simulation

environment for virtual prototyping of a machine is a

crucial step for the success of the operation. Guidelines have

been given in this paper for a balanced choice. DYMOLA

with Modelica language has been found to comply with most

of the requirements. An experience of its use in the

simulation of a complete machining center has been

illustrated. Some choices in the derivation of the model

have been discussed. The results obtained in terms of

experimental validation confirm the reliability of the model,

that can be proposed as a useful tool for prototyping newly

designed machines.

Acknowledgements

The authors wish to thank Luciano Bonometti and Matteo

Vicini for working together during parts of this project and

CMS SpA for financial support.

Appendix A

Modelica code of emf3 module:

0 = P0.i + P1.i + P2.i;

0 = vn + e0 � P0.v;

0 = vn + e1 � P1.v;

Page 14: Virtual Prototyping of Mechatronic Systems [Ferretti, Magnani, Rocco] [Annual Reviews in Control, Elsevier]

G. Ferretti et al. / Annual Reviews in Control 28 (2004) 193–206206

0 = vn + e2 � P2.v;

k = 2*kt/3;

k0 = k*sin(p*flange_b.phi);

k1 = k*sin(p*flange_b.phi � 2/3*PI);

k2 = k*sin(p*flange_b.phi � 4/3*PI);

e0 = k0*w;

e1 = k1*w;

e2 = k2*w;

w = der(flange_b.phi);

flange_b.tau = �(k0*P0.i + k1*P1.i + k2*P2.i).

References

Barton, P. I., & Pantelides, C. C. (1994). Modeling of combined discrete/

continuous processes. AiChE Journal, 6, 966–979.

Brenan, K. E., Campbell, S. L., & Petzold, L. R. (1989). Numerical solution

of initial-value problems in differential algebraic equations.

Cellier, F. (1991). Continuous system modeling. Springer Verlag.

Elmqvist, H., Bruck, D., & Otter, M. (1996). DYMOLA—User’s manual.

Research Park Ideon, Lund: Dynasim AB.

Ferretti, G., Magnani, G., & Rocco, P. (1998). Modeling, identification and

compensation of pulsating torque in permanent magnet ac motors. IEEE

Transactions on Industrial Electronics, 46(6), 912–920.

Ferretti, G., Magnani, G., & Rocco, P. (1999). Force oscillations in contact

motion of industrial robots: An experimental investigation. IEEE/ASME

Transactions on Mechatronics, 4(1), 86–91.

Ferretti, G., Filippi, S., Maffezzoni, C., Magnani, G., & Rocco, P. (1999). A

modular approach to dynamic virtual reality modeling of robotic

systems. IEEE Robotics and Automation Magazine, 6, 13–23.

Fritszon, P., Gunnarsson, J., Jirstrand, M. (2002). MathModelica: An

extensible modeling and simulation environment with integrated gra-

phics and literate programming, Proceedings of the 2nd International

Modelica Conference, Oberpfaffenhofen, Germany.

Fritszon, P., Aronsson, P., Bunus, P., Engleson, V., Saldalmi, L., Johansson,

H., Karstrom, A. (2002). The open source Modelica project, Proceed-

ings of the 2nd International Modelica Conference, Oberpfaffenhofen,

Germany.

Jahns, T. M., & Soong, W. L. (1996). Pulsating torque minimization

techniques for permanent magnet ac motor drives—A review. IEEE

Transactions on Industrial Electronics, 43(2), 321–330.

Maffezzoni, C., & Girelli, R. (1998). MOSES: Modular modeling of

physical systems in an object-oriented database. Mathematical Model-

ing of Systems, 4(2), 121–147.

Mattsson, S. E., & Andersson, M. (1993). Omola—An object-oriented

modeling language. In M. Jamshidi & C. J. Herget (Eds.), Recent

Advances in Computer Aided Control Systems, Studies in Automation

and Control (pp. 291–310). Elsevier Science.

Mattsson, S. E., Elmqvist, H., & Otter, M. (1998). Physical system modeling

with Modelica. Control Engineering Practice, 6, 501–510.

Oh, M., & Pantelides, C. C. (1996). A modeling and simulation language for

combined lumped and distributed parameter systems. Computers and

Chemical Engineering, 20, 611–633.

Pantelides, C. C. (1988). The consistent initialization of differential-alge-

braic systems. Siam Journal of Scientific and Statistical Computing, 9,

213–231.

Piela, P. C., Epperly, T. G., Westerberg, K. M., & Westerberg, A. W. (1991).

ASCEND: An object oriented computer environment for modeling and

analysis: The modeling language. Computers and Chemical Engineer-

ing, 15(1), 53–72.

Texas. (1997). Digital signal processing solution for permanent magnet

synchronous motor (Application Note, Literature Number: BPRA044).

Tiller, M. (2001). Introduction to physical modeling with Modelica. Kluwer.

Gianni Ferretti received the laurea degree in electronic engineering from

Politecnico di Milano, Italy. From 1990 to 1998 he was with the Department

of Electronics and Information of the Politecnico di Milano, as assistant

professor. His principal research activities are: modeling, simulation and

control of thermohydraulic processes, modeling, identification and simula-

tion of mechanical systems, hybrid force/position control of industrial

robots, compensation of torque disturbances in drives. He is currently

associate professor at the Politecnico di Milano, where he teaches automatic

controls.

GianAntonio Magnani received the laurea degree in electronic engineer-

ing from Politecnico di Milano, Italy, in 1978. From 1978 to mid 1984 he

was with the Automatica Research Center of the Italian Electricity Board

(ENEL), where he participated in research on modeling, simulation and

control of electric power plants. From 1986 to 1992 he was with Fiar Spa,

Robotics and Artificial Intelligence Division and with Tecnospazio, a Fiar

and Comau (Fiat Group) joint company, where he was in charge of research

and development units and led several projects for industrial and space

robotics applications. He is currently with Politecnico di Milano as a

professor of control system technologies and engineering. He also teaches

industrial robotics, and is in charge of research projects awarded by

industrial companies and research agencies. His current research interests

concern robot position and force control, servomechanisms and mecha-

tronics. He is a senior member of IEEE.

Paolo Rocco received the laurea degree in electronic engineering and the

doctorate degree in computer science and automation, both from Politecnico

di Milano, Italy, in 1991 and 1995, respectively. During 1995 he was a

visiting scholar at the School of Mechanical Engineering of Georgia Tech,

Atlanta, GA, under a NATO fellowship. He is currently associate professor

in automatic control at Politecnico di Milano. His research interests include

the force/position control of both industrial and flexible robots, the identi-

fication and suppression of torque disturbances in brushless motors and the

modeling, simulation and control of mechatronic systems.