Top Banner
EC IST Project RealSim - No. 11979. MathCore AB (Sweden) in cooperation with PELAB, Link¨ oping University (Sweden) Kinematic information formats. Standards applicable for mechanical model translation from CAD to Modelica. Delivery D1 Report for Task 3.1 Release 1: August 18th, 2000 Revised Release 2: December 13th, 2000 Vadim Engelson Contents 1 Introduction 2 2 Format requirements 3 3 Comparison of Various Mechanical Design tools and the Formats These Use 4 3.1 SolidWorks ............................... 6 3.1.1 Mating Example ........................ 7 3.1.2 Classification of mates ..................... 8 3.1.3 Interfaces with other kinematic information formats ...... 8 3.2 ADAMS ................................. 9 3.2.1 Adams Plug-in Integrated with CAD Environment....... 11 3.3 Working Model 3D ........................... 13 3.4 3D Studio Max ............................. 14 1
43

Kinematic information formats. Standards applicable for · PDF fileKinematic information formats. Standards applicable for mechanical model translation from CAD to Modelica. Delivery

Mar 28, 2018

Download

Documents

tranxuyen
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Kinematic information formats. Standards applicable for · PDF fileKinematic information formats. Standards applicable for mechanical model translation from CAD to Modelica. Delivery

EC IST Project RealSim - No. 11979.

MathCore AB (Sweden)

in cooperation with

PELAB, Link oping University (Sweden)

Kinematic information formats.

Standards applicable for mechanical model

translation from CAD to Modelica.

Delivery D1

Report for Task 3.1

Release 1: August 18th, 2000

Revised Release 2: December 13th, 2000

Vadim Engelson

Contents

1 Introduction 2

2 Format requirements 3

3 Comparison of Various Mechanical Design tools and the Formats TheseUse 43.1 SolidWorks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

3.1.1 Mating Example . . . . . . . . . . . . . . . . . . . . . . . . 73.1.2 Classification of mates . . . . . . . . . . . . . . . . . . . . . 83.1.3 Interfaces with other kinematic information formats. . . . . . 8

3.2 ADAMS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93.2.1 Adams Plug-in Integrated with CAD Environment.. . . . . . 11

3.3 Working Model 3D . . . . . . . . . . . . . . . . . . . . . . . . . . . 133.4 3D Studio Max . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

1

Page 2: Kinematic information formats. Standards applicable for · PDF fileKinematic information formats. Standards applicable for mechanical model translation from CAD to Modelica. Delivery

3.5 Mechanical Desktop . . . . . . . . . . . . . . . . . . . . . . . . . . 173.6 Pro/ENGINEER Tool Family . . . . . . . . . . . . . . . . . . . . . . 183.7 STEP formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

3.7.1 STEP – AP 203 . . . . . . . . . . . . . . . . . . . . . . . . . 213.7.2 IAP 105 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213.7.3 AP 214 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223.7.4 Using STEP format as an interface format. . . . . . . . . . . 24

3.8 CATIA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243.9 I-DEAS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253.10 VRML . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263.11 STL, DXF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26

3.11.1 STL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263.11.2 DXF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27

3.12 IGES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273.13 XML . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29

4 Using the Modelica Language for Dynamic Analysis of Mechanical Models 304.1 Modelica . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 304.2 Basic Features of the Modelica Language . . . . .. . . . . . . . . . 314.3 Introduction to the Modelica Multibody System Library . .. . . . . . 314.4 Using the MBS library . . . . . . . . . . . . . . . . . . . . . . . . . 33

4.4.1 Kinematic outline . . .. . . . . . . . . . . . . . . . . . . . . 334.4.2 Example: Kinematic Outline of Double Pendulum. . . . . . 354.4.3 Adding masses. . . . . . . . . . . . . . . . . . . . . . . . . . 364.4.4 Adding Masses to the Double Pendulum Example.. . . . . . 364.4.5 Adding Geometrical Shapes . . . . . . . . . . . . . . . . . . 374.4.6 Adding Shapes for Double Pendulum . . .. . . . . . . . . . 384.4.7 Interface to Non-Mechanical Parts of the Model . . . . . . . . 39

4.5 Advantages of Using MBS for Dynamic Analysis . . . . . . . . . . . 404.5.1 Interpretation and Compilation in Mechanical Simulation . . . 404.5.2 Multidomain Simulation . . . . . . . . . . . . . . . . . . . . 40

5 Conclusion 41

Note

This is the second revision of the report. The changes have been done in Sections 2,Tables 1, 2, 3 on page 5, 6, 7 . Ourconclusionswere inserted in several places inSection 3. New sections were added: 3.8, 3.9, 3.10, 3.11, 3.12, 3.13.

1 Introduction

In order to simplify the process of construction of simulation for mechanical models,these models are first designed in a CAD tool. After that the models are translated intoa format that can be used by a simulation tool, in particular, Modelica.

Many various tools can be used for mechanical model design. Models made inall these tools should be translated so that various simulation tools can use them fordynamic simulation.

2

Page 3: Kinematic information formats. Standards applicable for · PDF fileKinematic information formats. Standards applicable for mechanical model translation from CAD to Modelica. Delivery

It would be logical to use a single format for mechanical model description. Me-chanical models designed in various tools (see Figure 1) can be translated into thisneutral format. Other translators can convert the neutral format into formats readableby simulation tools.

Simulationtool

Simulationtool

Simulationtool

neutralformatCAD Tool

CAD Tool

CAD Tool

Figure 1: The role of a neutral mechanical data representation format

Currently there is no satisfactory ready standard for description of mechanical mod-els for the purpose of simulation. This reports contains the requirements for such a for-mat. The report includes a comparative study of several existing CAD tools and formatsthey use. We come to the conclusion that the format used for description of mechanicalmodels based on the Modelica multi-body system (MBS) library is the most appro-priate one.Decision was made in May 2000 to use Modelica/MBS format for thispurpose.

2 Format requirements

The minimal requirements for kinematic data representation necessary for dynamicanalysis are:

Body definition A multibody mechanical model is a collection of bodies. The formatshould contain information about 3D mechanical components (bodies) whichcan serve as point masses. A point mass is an abstraction of rigid body with allits mass concentrated at the center of mass. Each body should have a uniqueidentifier in the model.

Body position There should be some way to specifyinitial position and orientationof three-dimensional bodies in 3D coordinate space. These can be either speci-fied with respect to the global coordinate system, or via the coordinate frame ofanother body.

Constraint (joint) definition The format must be able to describe mobility of bodiesvia mechanicalconstraintsbetween the bodies, such as joints. It should be pos-sible to specify reference points (alternatively axes, edges, faces, planes) on twobodies and specify which constraints apply to the bodies at the reference points.The type of constraint (rigid, rotational, translational, etc.) and direction shouldbe specified. If axes, edges, faces, planes, i.e. body features and mates betweenthem are specified, we call such specificationfeature mobility . If just the refer-ence points with local coordinates and joints between them are specified, we callsuch specificationjoint mobility . Tools and formats implement feature mobility,joint mobility or both of them at once (e.g. CATIA, Section 3.8).

3

Page 4: Kinematic information formats. Standards applicable for · PDF fileKinematic information formats. Standards applicable for mechanical model translation from CAD to Modelica. Delivery

Physical body attributes The format should contain themass, the position ofcenterof mass, and (preferably) thematrix of inertiafor each component1.

Prescribed motion. This is anadditionalrequirement necessary for simulation in caseswhen motion of some parts of the mechanism is predefined in the experiment.

Force and torque generators.This is anadditionalrequirement necessary for simu-lation in cases when certain known forces and torques are applied to some pointsin the model. This information can be included in the format, or it can be definedin the simulation environment for a particular simulation run.

Body geometry. This is anadditional requirement necessary for model design andsimulation result visualization. The shapes can be either primitives (box, sphere,cylinder, cone), or complex (combination of primitive shapes), or feature-based(constructed by applying a sequence of operations in 3D), or arbitrary polytope(constructed by specifying a set of triangles or arbitrary polygons in 3D).

Format features. It is useful to have a human-readable format. This format can beparsed by the translator in order to pass information to simulation tools.

Control system integration. This is an additional requirement needed in control ap-plications. Mechanical or mechatronical model is augmented with procedural orequation-based program fragment that gets data from modeled sensors and sendsdata to modeled actuators.

These requirements are enough for the description of mechanical models whichhave no external interactions (forces, torques, collisions) applied. Typically someinformation should be specified in addition to this format in order to simulate somemechanisms. For instance,definition of an external forceor prescrobed motion tra-jectory should be attached to some point of certain body. The varying magnitude anddirection of force (or trajectory) can be either specified within the same format, or itcan be described later, by using a simulation environment interface. In the first casethese specifications are stored as additional, user-defined attributes (user-defined prop-erties) of mechanical parts. In the later case all the bodies should have some distinctivenames and the name of the body should be used as a reference.

3 Comparison of Various Mechanical Design tools andthe Formats These Use

In this section we consider several CAD tools and storage formats (see Tables 1, 2, 3on page 5, 6, 7 ). We investigate whether and how it is possible to extract and storeinformation necessary for dynamic simulation from these tools.

1In many cases CAD tools are able to automatically compute volumes of complex shapes and their centersof mass. The densities of bodies are considered as homogeneous. Therefore the mass can be found fromthe volume and density. In the general case the computation of the volume and the center of mass can bea complicated and computationally intensive task. It should be noted that many CAD tools (e.g. VRMLconstruction tools) operate with surface presentation only, and therefore volume and mass cannot be found.

4

Page 5: Kinematic information formats. Standards applicable for · PDF fileKinematic information formats. Standards applicable for mechanical model translation from CAD to Modelica. Delivery

CAD For-mats

Solid-works

Mechani-cal De-signer(ADAMSin CAD)

Mechani-calDesktop(DWG)

Pro-Engineer(MNF)

CATIA I-DEAS

see Section 3.1 3.2.1 3.5 3.6 3.8 3.9Bodies + + + + + +Geometry + + + + + +Joint mobil-ity

– – – – + +

Feature mo-bility

+ + + – + +

Mass andinertia

+ + ? + – +

Prescribedmotiongenerators

– +(4) – – – +(14)

Force andtorquegenerators

– +(4) – – – +(14)

Controlsystemintegration

– – – – – –

Readabilityfor humans

– +(9) – ? – –

Textual rep-resentation

– +(9) – ? – –

Table 1: CAD Formats and their properties. See notes on Page 5.

Notes for Tables 1, 2, 3: + means that feature is present– means that feature is absent? means that feature is not relevant in the scope of the project, and therefore we did

not investigated the details.= means that feature is partially present(1) Primitive object can be described directly in Modelica. External files are used

for objects with complex geometry.(2) Uses STEP AP 203.(3) Uses STEP IAP 105 notation.(4) Limited; only simple expressions can be used.(5) Control system can be written in Modelica or using Simulink(6) Using Simulink(7) Using Java Interface (EAI, External Authoring Interface)(8) Only mass is available(9) The output (ADAMS data file) is readable, but cannot be modified and reused

in this tool(10) There are no standard XML schemas for 3D geometry description(11) Joint mobility is limited and used for predefined motion only(12) Numerical constants describing a spline can be used only

5

Page 6: Kinematic information formats. Standards applicable for · PDF fileKinematic information formats. Standards applicable for mechanical model translation from CAD to Modelica. Delivery

StorageFormats

STEPAP 203

STEPAP 214

VRML STL,DXF

XML IGES

see Section 3.7.1 3.7.3 3.10 3.11 3.13 3.12Bodies + + + - + +Geometry + +(2) + + =(10) +Joint mobil-ity

– +(3) +(11) – =(10) –

Feature mo-bility

– – – – – –

Mass andinertia

– + – – + –

Prescribedmotiongenerators

– – +(12) – +(12) –

Force andtorquegenerators

– – - – +(12) –

Controlsystemintegration

– – +(7) – – –

Readabilityfor humans

= = + – = –

Textual rep-resentation

+ + + + + +

Table 2: Portable storage formats and their properties. See notes on Page 5.

(13) The mobility information is, however, available via Max SDK (C++ basedAPI).

(14) Uses embedded ADAMS solver.

3.1 SolidWorks

The SolidWorks[23] environment supports two kinds of documents for mechanical de-sign: thepart model and theassemblymodel. An assembly might consist of parts andother assemblies. Each part corresponds to mechanical body. The parts are constructedby applying a sequence of CSG (constructive solid geometry) operations, calledfea-tures. Each such operation converts a solid body model (or a closed contour in 2D) toanother solid body model. The operations preserve or update some important featuresof solid bodies, for instance mass, position of the center of mass and value of the tensorof inertia.

Theassemblydocument defines the mobility between the parts of an assembly.SolidWorks does not support the description of movement constraints between the

bodies in the form of joints. Instead a set of mates between points, axes, edges, facesor planes of two bodies is configured by the user.

A part consist of entities, such as planes, faces, edges, axes and points. A mateconnects two entities from different parts. There exist several mate types. The mosttypical arecoincident(all the points of one entity are inside another entity) orparallel(it keeps entities parallel to each other).

6

Page 7: Kinematic information formats. Standards applicable for · PDF fileKinematic information formats. Standards applicable for mechanical model translation from CAD to Modelica. Delivery

Other toolFormats

Modelica/ MBS

ADAMS WorkingModel3D

3D Stu-dio -MAX

3DStudio -MaxScript

see Section 4 3.2 3.3 3.4 3.4Bodies + + + + +Geometry – (1) – + + +Joint mobil-ity

+ + + + –(13)

Feature mo-bility

– – – – –

Mass andinertia

+ + + (8) –

Prescribedmotiongenerators

– + +(4) + +

Force andtorquegenerators

+ + +(4) + +

Controlsystemintegration

+(5) +(6) – – –

Readabilityfor humans

+ + – – +

Textual rep-resentation

+ + – – +

Table 3: Other tool formats and their properties. See notes on Page 5.

Two parts can be connected by one, two or more mates. Some combinations ofmates are valid, some are not. Invalid combinations of mates (over-constrained sys-tems) are automatically rejected by SolidWorks.

The translation between such representations is a difficult problem. A translatorhas been developed at PELAB (Link¨oping University); it is discussed in [8, 14]. Solid-Works automatically computes the volume of a part, the center of the volume and thetensor of inertia, assuming that the part has uniform density. The value of the densitycan be specified as a property of the part when it is created.

3.1.1 Mating Example

The example in Figure 2(a) describes a fragment of the pendulum model. The partP1has a front face (f1 ) and an upper edge (e1). The partP2 has a front face (f2 ) anda bottom edge (e2). There is a mate that specifies that the planes off1 andf2 arecoincident. Another mate specifies that the edgese1 ande2 are coincident, i.e. theybelong to the same line in the coordinate space. The SolidWorks system analyzes themates and adjusts the positions of the parts (Figure 2(b)). The system automaticallyrejects invalid mate combinations. In this case our translator [14] finds that there is ajoint with one rotational degree of freedom between the partsP1 andP2, and calculatesthe position and orientation of the rotation axis. This pair of mates corresponds to aninstance of classRevolute from the Modelica MBS library with an attachedBody

7

Page 8: Kinematic information formats. Standards applicable for · PDF fileKinematic information formats. Standards applicable for mechanical model translation from CAD to Modelica. Delivery

Z

X

Y

(a) (b)

Figure 2: Parts and their mates specification before (a) and after (b) adjustment accord-ing to the mates.

instance.

3.1.2 Classification of mates

There are seven different mate types:

Coincident: One entity belongs to another entity

Concentric: Cylinders and cones have a center line. This line can be shared betweenseveral round entities, or it can be coincident with some other line in the model.

Perpendicular: Planes or lines keep a90◦ degree angle to each other.

Parallel: Entities are parallel to each other

Tangent: An entity touches a cylindrical entity

Distance: Two entities keep a fixed distance.

Angle: Two entities keep a fixed angle

When mates are applied to entities, the number of degrees of freedom (3 transla-tional and 3 rotational degrees) are reduced. Table 4 shows the degrees of freedombetween two parts with plane and line entities connected by one of the four most usedmates. The complete table can be found in [14].

SolidWorks uses an application programming interface based on COM (MicrosoftComponent Object Model) to give access for browsing and modification of virtuallyall properties of parts and assemblies. This way all information about the kinematicfeatures of the model can be extracted.

3.1.3 Interfaces with other kinematic information formats

SolidWorks stores information about the mates in internal, proprietary, encoded binaryformat. Existing export options for conversion of SolidWorks to other formats (STEP

8

Page 9: Kinematic information formats. Standards applicable for · PDF fileKinematic information formats. Standards applicable for mechanical model translation from CAD to Modelica. Delivery

Entities Mate type Translational DOF Rotational DOF

coincident 2 1Plane/Plane distance 2 1

parallel 3 1perpendicular 3 2

coincident 2 2Line/Plane distance 2 2

parallel 3 2perpendicular 3 1

coincident 1 1Line/Line distance – –

parallel 3 1perpendicular 3 2

Table 4: Degrees of freedom which are left between parts connected by mates in theirentities.

AP 2013, VRML, STL, ParaSolid, DWG) preserve the geometry of parts and assem-blies, but theydo notinclude mobility information.

In order to preserve this information, a special plug-in has been constructed thatbrowses the internal CAD database and extract the mobility information.

3.2 ADAMS

Adams[1] is the world’s most widely used multibody mechanical simulation software.It can be used in different configurations: as a full simulation package (Adams/View,Adams/Solver and other components) or as Adams prototyping capabilities integratedwithin CAD/CAM environments.

user

modeling

GUI

(3D CAD−like)

Adams/Viewdataset

(statements)

Adams/Solver

experiment

specification

shell

result analysis

GUI (2D charts)

commands

trace with

results

Figure 3: Cooperation between simulation engineer, Adams/View and Adams/Solver

Full simulation package In the full simulation package (see Figure 3) machine partsare initially created using a 3D graphical user interface (called Adams/View) and as-sembled. The parts are connected by joints, and motion generators (motors) are at-tached. The items causing forces, such as springs, dampers, friction and impact, can beapplied to certain points on the machine parts.

9

Page 10: Kinematic information formats. Standards applicable for · PDF fileKinematic information formats. Standards applicable for mechanical model translation from CAD to Modelica. Delivery

PART/partid,QG=x,y,z,REULER=e1, e2, e3,MASS=m,CM=markerid,IP= i1, ..., i6

Eachmarkerin Adams represents a local coordinate system,i.e. a point in 3D space serving as an origin of a coordinatesystem rotated in a certain way. ThePARTspecification de-scribes a rigid body of massm located atx,y,zin the worldcoordinate system, and rotated by anglese1, e2, e3. The cen-ter of mass of this body is a markermarkerid; the inertiamatrix is given asi1, ..., i6.

MARKER/markerid,PART=partid,QP=x,y,z,REULER=e1, e2, e3

The reference pointmarkeridis attached to the partpartid ata certain position (in the coordinate system of the part)x,y,zand it has rotatione1, e2, e3.

JOINT/ jointid,REVOLUTE,I= marker1id,J=marker2id

A revolute joint is attached to two markers, which apparentlybelong to different parts and are joined at the same locationin the 3D space.

MOTION/motionid,I= marker1id,J=marker2id, B3,FUNCTION=expr

There is a prescribed motion of the joint around theZ axis(i.e. the 3rd axis – therefore the keywordB3 is used), and thejoint angle during this motion is defined by the expressionexpr.

Table 5: Four typical ADAMS statements.

The results of the model definition phase are stored as anAdams dataset file, essen-tially Adams program code in a proprietary declarative language.

The simulation engine (package Adams/Solver) is “hidden” behind the user inter-face and can be invoked when the user requires.

The initial model can be refined in order to apply more realistic features of themodel.

• By default all the bodies are assumed to be rigid. Using a finite element modelingprogram and the Adams/Flex package, flexible body deformations can also bemodeled. The flexibility of bodies and the dynamic behavior of the total systemaffect each other.

• Automatic collision detection between parts can be performed. For this purposedescriptions of part geometries are supplied.

When a series of computational experiments should be organized, parametric proper-ties can be swept through a range of values, and parametric design relationships can beset up.

If necessary, external functions in FORTRAN can be specified in addition to ADAMSdataset files, and these functions are linked to the application when the models are sim-ulated.

The Adams program code is normally generated via a graphical user interface andthe code is not intended to be very “user-friendly”. However, it is easy to modify al-ready written code. The four statements described in Table 5 give some clues about theAdams program notation (words initalics are replaced by relevant numbers). Adamsnotation is based on statements, where integers are used to refer to other statements.

The expressions in Adams may contain any geometric, kinematic and dynamicvalues available in the model, logical conditions (IF -functions) as well as the current

10

Page 11: Kinematic information formats. Standards applicable for · PDF fileKinematic information formats. Standards applicable for mechanical model translation from CAD to Modelica. Delivery

modeled time. External functions written in FORTRAN can be called within theseexpressions. Also these functions can obtain values from “input channels” in order tocooperate with a control system. Such control systems are described outside Adams,using, e.g., the MATLAB tool.

The notation provides a relatively high flexibility of Adams models. The samemodel can be used for three different kinds of simulations:

• Kinematic simulation:All motions are already prescribed by the user. The sys-tem has zero degrees of freedom. All part positions can be computed from themotions. Forces are ignored.

• Static simulation:This simulation re-positions parts so that all forces are bal-anced. It finds the so called equilibrium configuration.

• Dynamic simulation:This simulation computes the combined effect of forcesand constraints. It can be used for any number of degrees of freedom. Thedynamic simulation package contains four different integrators. The user shouldtune these integrators by giving appropriate accuracy, integration step minimumand maximum, as well as other tuning parameters.

Adams in Control System Context. Integration of model simulations specified inAdams with external input and output (such as control systems or operator controlgraphical user interface) requires some special adjustments in the model structure. Inorder to integrate Adams with control systems, the mechanical model is exported fromAdams into a special module. Then this module can be used in SIMULINK, and controlsystem components should be designed and coded in SIMULINK.

Visualization. During simulation or after the simulation terminates (in Adams/Solver)the user can see dynamic visualizations of machine elements. However there are no op-tions to steer an ongoing simulation. Adams has a rich set of constructs helping to runa series of simulations as a batch. In the 3D visualization the results of two (or more)simulations can be displayed and compared. However, this is only possible if all thesimulations have the same number of steps and the same step size. This limitationmakes it difficult to visualize the results from simulations that require varying timesteps.

3.2.1 Adams Plug-in Integrated with CAD Environment.

When Adams is integrated with CAD tools (see Figure 4), the user works in his or hernative CAD environment where parts and assemblies are normally designed. Whendynamic simulation is required, the parts and assemblies are translated internally toAdams program code, the model is simulated and feedback in the form of animationwithin the same CAD environment is returned. Additionally many parameters of sim-ulations (forces, torques, speed etc.) can be measured and displayed in form of 2Dgraphs.

Integration of Adams with CAD tools from Autodesk, Unigraphics, SolidWorksand many other products is available.

The Dynamic Designer (ADAMS plug-in for SolidWorks, Mechanical Desktop andSolidEdge) simulates the model and the model movement is displayed online, duringthe simulation. When more detailed modeling is necessary, the Adams program codecan be saved, modified and later used with the full Adams simulation package.

11

Page 12: Kinematic information formats. Standards applicable for · PDF fileKinematic information formats. Standards applicable for mechanical model translation from CAD to Modelica. Delivery

user

dataset

(statements)

Adams/Solver

(dynamic simulation)

Native

CAD tool

with

Adams

plug−in

result analysis

GUI (2D charts)

trace with

results

movements

Figure 4: Cooperation between a simulation engineer (user), and Adams plug-in em-bedded in a CAD application.

Unfortunately, the integrated variant of the Adams package has some limitationsregarding the complexity of the simulation system. In particular, expressions that areused to specify the force values cannot call external functions, and cannot interfacewith external programs.

Example. An experiment has been done with the Mechanical Designer, a plug-inutility for the SolidWorks CAD tool. A double pendulum has been constructed (seeFigure 5). The pendulum consists of two bars and one box in a fixed position; theseare connected by a revolute joint, i.e. a joint with one rotational degree of freedom.Such revolute joints are labeled as door hinges in the schematic presentation of thismechanism. The tool generates code in Adams dataset format:

ADAMS/View model name: DesignerUNITS/, FORCE=NEWTON, MASS=KILOGRAM,

LENGTH=MILLIMETER, TIME=SECOND

PART/1, GROUNDMARKER/54, PART=1, QP=-248.06, 147.27, -162.19

PART/2, QG=-595.51, -50.91, -162.19,REULER=119.700423D, 90D, 180D, MASS=0.64, CM=10000,IP=8618.6, 8618.6, 170.66, 0, 0, 0

MARKER/50, PART=2, QP =0,0, 0, REULER=0D, 90D, 60.29DMARKER/53, PART=2, QP =0,0, 400, REULER=0D, 90D, 60.29DMARKER/10000, PART=2, QP=20, -20, 200

PART/3, QG=-611.96, -14.45, -122.19,REULER=-65.71D, 90D, 0D, MASS=0.64, CM=10001,IP=8618.66, 8618.66, 170.66, 0, 0, 0

MARKER/49, PART=3, QP=40, -40, 0, REULER=180D, 90D, -114.28DMARKER/10001, PART=3, QP=20, -20, 200

JOINT/1, REVOLUTE, I=49, J=50JOINT/2, REVOLUTE, I=53, J=54ACCGRAV/, JGRAV=-9810

END

Ourconclusionis that ADAMS format is a good candidate for being the kinematicdata exchange format. There is a tool for conversion of ADAMS models to extendedADAMS-compatible Modelica library, built on top of MBS library [32].

12

Page 13: Kinematic information formats. Standards applicable for · PDF fileKinematic information formats. Standards applicable for mechanical model translation from CAD to Modelica. Delivery

Figure 5: Pendulum model designed in SolidWorks with Adams plug-in.

3.3 Working Model 3D

Working Model 3D [13] is an advanced tool providing dynamic analysis within anintegrated modeling and simulation environment.

In the Working Model 3D tool users create set of bodies (mechanical parts) anddescribe how these are pairwise connected by joints. Only primitive shapes can beconstructed within Working Model 3D. However, it supports not only design of sim-ple mechanical models, but import of CAD models from SolidWorks, SolidCad andMechanical Desktop as well.

The tool performs dynamic simulation of systems of rigid bodies. When a systemis constructed, the revolute, prismatic, spherical and many other kinds of joints canbe specified (Figure 6). The tool is able to detect collisions and produce responseimpulses. The results of analysis can be displayed as 3D scenes as well as 2D graphsof any variables computed during simulation.

Mechanical joints that can be specified in Working Model 3D directly correspondto joints in the Modelica MBS library. The mass, the center of mass and the inertiatensor are automatically computed from user-specified density. However, all these canbe overridden by the user. The major drawback of Working Mode 3D is the absence ofcommunication with the ”outer world”.

Models in Working Model 3D (version 4.0) cannot interact with any external soft-ware during simulation (see also Section 3.3). There is no way to attach multidomaincomponents, and no options to attach controls to steer the model during running simu-lation. There is no experimentation language and no batch simulation is possible.

The information in Working Model 3D is available mainly inside the tool. Some-

13

Page 14: Kinematic information formats. Standards applicable for · PDF fileKinematic information formats. Standards applicable for mechanical model translation from CAD to Modelica. Delivery

times useful information is displayed by the tool but cannot be automatically extractedfor use by external programs. The data export capabilities of Working Model 3D arelimited: simulation results can be exported, but joint information cannot. The internalformat of Working Model 3D is binary, proprietary and encoded.

Prescribed motion, or prescribed external forces can be described in the form ofmathematical expressions. Such expressions can be arbitrarily complex and nested.The expressions can include other variables of the system (position, velocity of thebodies) as well as the current value of time.

Figure 6: Double pendulum model in Working Model 3D

Since Working Model 3D stores information about the model only for internal op-eration, weconcludethat it cannot be used for kinematic data storage.

3.4 3D Studio Max

This tool ([3]) is able to specify object geometry in a very detailed way. However,there is a gap between geometry and physical properties. 3D Studio Max has severaldegrees of approximation between its objects and the corresponding physical objects.This quite useful approximation feature does not appear in other modeling tools.

14

Page 15: Kinematic information formats. Standards applicable for · PDF fileKinematic information formats. Standards applicable for mechanical model translation from CAD to Modelica. Delivery

The objects can initially be constructed as solid bodies or as surfaces. When suchobjects are used for dynamic simulation either a bounding volume (box or sphere),or a mesh subdivision of the object can be used as the geometry model for dynamicsimulations. This choice is up to the user. Obviously, computations using boundingvolumes are much faster and usually more inaccurate than computations using a mesh.

3D Studio Max is primarily oriented towards description of graphical and geomet-rical properties of surfaces. Therefore the computation of certain physical properties isnot always adequate: objects might contain just a surface (e.g. a square) which has nosolid body properties such as mass and volume. To solve this problem, the tool com-putes mass and volume using a certain degree of accuracy, in particular using boundingbox around the surface, bounding sphere or (much more exact for complex shapes)using mesh subdivision.

Movement constraints in 3D Studio Max are specified aslocks2 ( these forbid trans-lation and rotation of child objects with respect to parent object in certain directions).

The mass and the position of the center of mass are either computed using the rulesmentioned above, or can be overridden by the user. The inertia tensor is not computednor used at all.

3D Studio Max uses MaxScript (a proprietary interpreted command and program-ming language) or a C++ API for manipulation and extraction of data from 3D scenes.Geometry can be extracted in VRML, STL, DXF and some other formats. Specificationof locks and physical (dynamic properties) overridden by the user cannot be extractedby MaxScript, but apparently can be accessed via the C++ API. A tool for extraction ofthis information from 3D Studio Max to Modelica is being designed by Dynabits[5].

Figure 7: A pendulum model in 3D Studio Max

Computer animation software (such as 3D Studio Max and Maya) provides a largevariety of features in order to make computer-based animations more realistic in move-

2This is 3D Studio Max terminology.

15

Page 16: Kinematic information formats. Standards applicable for · PDF fileKinematic information formats. Standards applicable for mechanical model translation from CAD to Modelica. Delivery

Figure 8: Hierarchy of objects in the model of a pendulum in 3D Studio Max

ments. For this purpose these tools can model mechanical systems (see Figure 7) andcompute trajectories of rigid and flexible bodies according to physical laws. Thesetrajectories can be saved in the proprietary format of the computer animation tools.Normally there are no options for external steering of the mechanical model duringcomputation of the trajectories.

Instead, computer animation packages can quickly compute rough approximationsof dynamic movements.

In 3D Studio Max, mechanical or similar models with moving parts are constructedin a hierarchical fashion. All the objects of a mechanism should belong to a directedacyclic graph (see Figure 8). The edges of the graph define relations between parentsand children and there is one and only one parent for every node (except the root of thehierarchy which has no parents).

The lock (constraint rules) of a child node defines how it can be translated and/orrotated with respect to the parent (see Figure 9). If, for instance,Rotate/X andRotate/Z are selected, the child object can only rotate around its localY axis. IfMove/X andMove/Z are selected, the child can only move along the Y axis.

By combining different degrees of freedom all typical joint types can be modeled(revolute, prismatic, spherical, cylindrical, etc.). The joint properties are not clearlyvisualized during model editing, and it can be difficult to choose correct directions ofconstraints. External force (Pushoption) and torque (Motor option, as well as envi-ronment settings (Gravity andWind) can be applied to the objects. These objects areincluded in the hierarchy of a 3D Studio Max scene (see Figure 8)

The 3D Studio MaxDynamicssubsystem analyses collisions and generated motiontaking collision response into account. Collisions can be computed at different levelof accuracy (using just bounding box, bounding sphere, or using a detailed mesh ofthe object). There exist material properties, which are applied to the object: collision

16

Page 17: Kinematic information formats. Standards applicable for · PDF fileKinematic information formats. Standards applicable for mechanical model translation from CAD to Modelica. Delivery

Figure 9: Lock (i.e. degrees of freedom) specification for a pendulum model in 3DStudio Max. The child object can rotate around theY axis only. Scaling is not lockedbut it cannot happen in dynamic analysis.

restitution coefficient (bounce coefficient), static and sliding friction coefficient. Thesenumbers are in the [0.0,1.0] interval.

The dynamic capabilities of 3D Studio Max do not include springs and dampers.Kinematic loops cannot be constructed because the kinematic skeleton always has treestructure. Tests we have run show that computations are very approximate and some-times they produce non-adequate results (objects penetrate, or locks are broken).

Weconcludethat 3D Studio Max should not be used for kinematic information def-inition. However it can be used for high quality visualization of mechanical simulationsin Modelica.

3.5 Mechanical Desktop

Mechanical Desktop (version 4)[4] is an environment which integrates the AutoCAD2000 (a tool for modeling of parts and surfaces), ACIS 5.1 kernel for modeling complexgeometry as well as features of Genius Desktop 3 and AutoCAD Mechanical 2000.Details about these products and various formats mentioned in this section can be foundin [4].

It is one of the most popular tools for mechanical design. This tool is one of about200 CAD tools related to AutoCad, which use the ACIS engine for internal represen-tation and processing of CAD information.

All tools using the ACIS engine can exchange geometry data using the ACIS for-mat (ASCII .sat files and binary.sab files). However applications use specializedformats for storage of all other information but geometry. In particular MechanicalDesktop uses binary DWG format.

Products of the AutoCad family have specialized support for many areas of computer-aided design. Special applications are targeted for building industry, geographical in-formation systems and mechanical design. Also there is a whole series of applicationsfor static and dynamic visualization of AutoCad models, including 3DStudio Viz. Ituses Mechanical Desktop files for automatic assembly animation. Each modificationof a model in 3DStudio Viz is reflected in Mechanical Desktop and vice-versa.

In order to construct an assembly, all the parts should be first referenced or localized

17

Page 18: Kinematic information formats. Standards applicable for · PDF fileKinematic information formats. Standards applicable for mechanical model translation from CAD to Modelica. Delivery

into the assembly drawing. Mechanical models with motion constraints (assemblyconstraints in the AutoCad terminology) are constructed in Mechanical desktop bymeans of menu commands (Mate , Insert , Flush , Angle ). These menu choicesinvoke command line interface commands with corresponding prompts:

• AMFLUSHspecifies two parallel planes and a fixed distance between the planes(the distance is 0 by default).

• AMANGLEspecifies an angle between two planes, two vectors (or axes) or be-tween a plane and a vector (or an axis). The angle is 0 by default.

• AMMATEspecifies that two planes, axes, points or non-planar faces (sphere, cone,cylinder, or torus) are coincident.

• AMINSERTspecifies that two faces (e.g. cylindrical surfaces or edges) are copla-nar and share common axis.

In order to extract information about relations between bodies it is possible to useObjectARX (Object AutoCAD Runtime Extension) which provides a mechanism tomanipulate the Mechanical Desktop programmatically from within or outside of theMechanical Desktop. This Automation (Application Program Interface) gives C++programs (clients) access to the internal representation of assembly information. Pro-grams written using this interface are installed as plug-ins in the Mechanical Desktopenvironment.

In particular, C++ clients can accessMcadConstraintDescriptor objectwhich contains information about two geometric objects operated on by this constraint,the type of constraint (one ofmcCompMate, mcCompFlush , mcCompInsert ,mcCompAngle) as well as a value which for example could be the offset distanceor the angle.

The facilities for constraint definition in Mechanical Desktop are similar to those inSolidWorks. Ourconclusionis that AutoCAD native format cannot be used as a formatfor kinematic data exchange, since it is a proprietary binary format.As part of futurework within the Realsim project (Task 3.2) we plan at PELAB (Link oping Univer-sity), in cooperation with MathCore AB, to design a converter from MechanicalDesktop assemblies to Modelica/MBS.

3.6 Pro/ENGINEER Tool Family

Pro/ENGINEER[17] is one of the most widely spread tool families for mechanicaldesign. It is targeted primarily for industrial applications and design optimization ofproducts. Several different environments for different purposes are combined together,and a common CAD data representation model is used for information exchange. Inorder to create a mechanical model consisting of several bodies, a static model of col-lection of parts is created initially in the Pro/ENGINEERFoundation Tool(see Figure10). When an assembly is created from parts, locations of future joints should be cor-rectly aligned.

Pro/ENGINEER has several extension packages, in particularMechanical DesignExtension. This extension enables designers to specify motion of assembled Pro/ENGINEERparts. When the parts are assembled, joints of different types connect them. Thesejoints are Pin, Slider, Cylinder, Planar and Ball. Every such joint define certain limita-tions of part movement relatively to each other. Rotational and translational degrees offreedom are reduced, and the motion is constrained.

18

Page 19: Kinematic information formats. Standards applicable for · PDF fileKinematic information formats. Standards applicable for mechanical model translation from CAD to Modelica. Delivery

Pro/ENGINEERFoundation (GUI)

Mechanical DesignExtension (GUI)

Design Automation Option (GUI)

ApplicationProgramming Toolkit (API)

Motion SimulationPackage (GUI)

Structural SimulationPackage (GUI)

Motion SimulationProgramming Toolkit (API)

Pro/MECHANICA

Pro/ENGINEER

No API ?

Figure 10: Structure of layers of Pro/ENGINEER and related tools.

Mechanical Design Extension has other important facilities for assemblies: ev-ery part of the assembly can be moved (dragged by mouse); predefined (prescribed)movements can drive the parts. Some performance features of the mechanisms can beassessed at this stage, e.g. clashes can be detected, and model extents in the coordinatespace can be evaluated.

Pro/ENGINEER has aDesign Automation option. This makes it possible to createanimation sequences of moving mechanisms. The designer specifies positions of partsin assemblies for some key frames, and smooth movement of these parts is automati-cally generated.

Pro/MECHANICA is another product family which is built on top of core Pro/EN-GINEER, and used for model simulation. This package contains several simulationtools, in particular theMotion Simulation Packagefor kinematic analysis (using equa-tions of motion of rigid bodies) andStructure Simulationfor structure deformation andstress studies (using finite element analysis). Kinematic analysis uses description ofparts defined in Pro/ENGINEER Foundation Tool, and joint definitions defined in Me-chanical Design Extension. Since Mechanical Design Extension is useful in the contextof Pro/MECHANICA only it can be also considered as part of Pro/MECHANICA.

Kinematic simulation is used as a foundation for the more advanced features ofPro/MECHANICA: sensitivity analysis and automated design optimization. Whenmultiple design parameters are specified and a design goal is expressed in measurablephysical quantities, the tool can perform automatic design optimization. These simula-tion capabilities can be augmented even more by theMotion Simulation ProgrammingToolkit. This toolkit enables in particular extracting the equations of motion (in an en-

19

Page 20: Kinematic information formats. Standards applicable for · PDF fileKinematic information formats. Standards applicable for mechanical model translation from CAD to Modelica. Delivery

capsulated form) so that the simulation can be driven by an external program. This waycomponents from other application domains (electric, control, hydraulic, etc.) can beattached to mechanical simulation in order to build a single application.

Access to information describing model geometry and all model features createdby the Pro/ENGINEER Foundation Tool can be done by exporting data in the MNF(Mechanica Neutral File) format or via theApplication Programming Toolkit. Thefeatures specified by theMechanical Design Extension(i.e. joints of different kinds)are stored in MNF and not accessible via the toolkit. This API offers the possibility ofadding user-defined objects to the model. This way it would be possible to add specialjoints. These new joints would not be compatible with the joints defined in MechanicalDesign Extension.

Regarding translation of mechanical models with joints from Pro/ENGINEER toModelica we can conclude in its current version (Pro/ENGINEER 2000) neitherAppli-cation Programming Toolkitnor MNF can be used for this purpose. New user-definedobjects can be created, however. These objects can be defined in the same way asjoints. The model together with such objects (Modelica’s joints) can be translated toModelica. The disadvantage of this approach is that these joints cannot be used inPro/MECHANICA.

3.7 STEP formats

A large international effort is underway within the International Standards Organiza-tion (ISO) to develop standards for representing information about products in manydifferent industries. The standard is generally known as the Standard for the Exchangeof Product Model Data, or STEP (officially known as ISO Standard 10303, ProductData Representation and Exchange)[24]. STEP is intended to provide an internationalstandard for computer-based description and exchange of the physical and functionalcharacteristics of products throughout their life cycle, independent of any particularsystem. STEP provides the overall framework and the implementation technologiesfor representing product design and production data in a form that can be exchangedbetween computer systems as files or direct on-line access – the type of data used byComputer-Aided Design (CAD), Computer-Aided Engineering (CAE), and Computer-Aided Manufacturing (CAM) applications, for example. This overall framework isapplied to specific industry applications through STEP product models.

STEP technology is being aggressively pursued in many industries as both a ma-jor enabling technology of future international commerce in the global economy andas a key to implementing informational technologies for productivity improvementthroughout enterprises. Active participation has come from industries such as automo-tive (including companies like Ford, General Motors, BMW, Chrysler, and Mercedes-Benz); aerospace (e.g., Boeing, GE Aircraft Engines, Pratt and Whitney, and Rolls-Royce); and electronics (e.g., IBM, Digital Equipment Corporation, and Hewlett-Packard).Efforts to apply STEP to the Architecture, Engineering, and Construction (AEC) indus-tries are also underway.

An initial set of STEP parts were released as an international standard in December,1994.

STEP does not attempt to produce a single standard model that applies across dis-ciplines. Rather, the STEP approach is to produce standard product models for usewithin specific areas of application, called Application Protocols (AP’s), and to striveto harmonize and coordinate these models across application areas to the greatest ex-tent possible. Various Application Protocols commonly use Integrated Application

20

Page 21: Kinematic information formats. Standards applicable for · PDF fileKinematic information formats. Standards applicable for mechanical model translation from CAD to Modelica. Delivery

Resources (IAR’s). IARs contain conceptual constructs for specific application areas.For the purpose of mechanical analysis three STEP parts are important: AP-203,

IAR-105 and AP-214.

3.7.1 STEP – AP 203

The Application protocol AP 203 (Configuration-controlled design) defines entity-relationship rules for description of object geometry. Theimplementationis a file thatcomply with these rules. Records in the file contain references to other records (e.g.#5).

There are translating tools for AP 203 from and to Catia, IDEAS and Pro/ENGINEER.There are also translating tools for AP 214 from and to IDEAS and Pro/ENGINEER[25]. Unigraphics can read and write AP 203 and AP 214. SolidWorks can read AP203and AP214, and write AP203 only. XChangeWorks is a plug-in for Mechanical Desk-top that reads AP203 and AP214 files and converts them to Mechanical Desktop mod-els.

ISO-10303-21;HEADER;FILE_DESCRIPTION((’This file contains an AP 203 implementation’),’1’);FILE_NAME(...)FILE_SCHEMA(’Config_Control_design’);ENDSEC;DATA;#1 = CARTESIAN_POINT((0.176777,0.176777,0.5));#2 = VERTEX_POINT(#1);#3 = CARTESIAN_POINT((0.,0.,0.5));#4 = DIRECTION((0.,0.,-1.));#5 = DIRECTION((0.176777,0.176777,0.));#6 = AXIS2_PLACEMENT_3D(#3,#4,#5);#7 = CIRCLE(#6,0.25);#8 = EDGE_CURVE(#2,#2,#7,.T.);#9 = ORIENTED_EDGE(*,*,#8,.F.);#10 = EDGE_LOOP((#9));#11 = FACE_BOUND(#10,.T.);....

Kinematic features arenot included to AP3203. Other parts, in particular AP214should be used for storage of this information.

3.7.2 IAP 105

This STEP part definesconceptsnecessary for kinematic design in different applicationareas. It introduces joints, links, several types of joints and relationships between them.The following STEP terms defined in this protocol apply also to other protocols: base,frame, joint, link, mechanism, motion, pair, placement, world coordinate system.

The scope [26] of this protocol includes:

• definition of kinematic relationships between rigid objects called links;

• representation of the topology for a kinematic structure;

• definition of a kinematic motion as a sequence of discretised positions and ori-entations;

• representation of the input to and the result of a kinematic analysis.

The following items areout of Scopeof the protocol:

21

Page 22: Kinematic information formats. Standards applicable for · PDF fileKinematic information formats. Standards applicable for mechanical model translation from CAD to Modelica. Delivery

• description of tolerances and clearances in kinematic structures;

• description of motion parameters in terms of a continuous time variable;

• representation of intermittent joints with variable constraints on motion;

• representation of dynamic mechanical assemblies;

• representation of force, mass, and friction.

It should be noted that IAP 105 does not define a separate application protocol.Therefore data files cannot be created based on just this part. Instead, it is assumed thatAP214 should use IAP105 to define the details of kinematics.

3.7.3 AP 214

This STEP part defines Core Data for Automotive Mechanical Design. This is not anISO standard yet (currently it is a Draft Standard), but it is expected to become an ISOstandard in year 2000.

This part is extremely large (just a concise description of the terms and syntaxoccupies 5 Megabytes of plain text). It consists of 31 units of functionality, and onlyone of them (calledK1) is devoted to kinematics.

This unit of functionality (K1/kinematics) provides the capability to represent kine-matic aspects of a mechanical product as required for the communication between CADsystems and kinematic analysis systems, including robotic simulation systems, as wellas between dissimilar kinematic analysis systems. A mechanism as described usingthis unit is regarded as being composed of rigid links mating in the following types ofjoints: cylindrical pair, gear pair, homokinetic pair, planar pair, point on surface pair,prismatic pair, rack and pinion pair, revolute pair, rolling curve pair, rolling surfacepair, screw pair, sliding curve pair, sliding surface pair, spherical pair, universal pair.

The mechanism may contain open or closed kinematic chains. This informationis implicitly defined by the topology of the kinematic structure. A mechanism maybe connected to another mechanism. Both planar and 3D mechanisms can be defined.The rigid links may be described by a 3D geometric shape description. A link mayhave additional frames attached to it, to allow application specific kinematic forwardanalysis to be performed. The following application objects are used by the kinemat-ics unit of functionality: Actuator, Groundrepresentation, Initialconfiguration, Inter-polatedconfigurationsequence, Kinematicconfigurationdefinition, Kinematicconfi-gurationinterpolation, Kinematiccontrol, Kinematicelement, Kinematicjoint, Kine-matic link, Kinematic link representation, Kinematicmechanism, Kinematicpair, Kine-matic simulationinformation, Kinematicstructure, Kinematictransformationresult,Pair value, Pathapproximation, Simplepair range, Toolattachmentpoint frame, Tool-centrepoint frame, Transformationto referenceframe. This format contains alsophysical values necessary for kinematic simulation.

A Momentsof inertia describes the law of inertia in the context of the rotation ofa rigid body. The moments of inertia I are described with a symmetric second leveltensor. A Mass is a quantity of matter that an item contains. A Centreof mass is thecentre of the mass of a body. This data is necessary for kinematic simulations, but doesnot belong toK1.

The scope of the application protocol is rather broad. It is much broader than justkinematic analysis. It includes

22

Page 23: Kinematic information formats. Standards applicable for · PDF fileKinematic information formats. Standards applicable for mechanical model translation from CAD to Modelica. Delivery

• products of automotive manufacturers and of their suppliers. These productsinclude parts, assemblies of parts, tools, assemblies of tools, and raw materials.The considered parts include the constituents of the car body, of the power train,of the chassis, and of the interior. The tools include those specific to the productsproduced and used by various manufacturing technologies.

• product definition data and configuration control data for managing large num-bers of variants of automotive products during the design phase;

• data describing the changes that have occurred during the design phase, includingtracking of the versions of a product and of the data related to the documentationof the change process;

• the following eight types of representation of the shape of a part or of tool:

a) 2D-wireframe representation;

b) 3D-wireframe representation;

c) geometrically bounded surface representation;

d) topologically bounded surface representation;

e) faceted-boundary representation;

f) boundary representation;

g) compound shape representation;

h) constructive solid geometry representation.

• simulation data for the description of kinematic structures (unitK1); The simu-lation data for a windshield wiper may include the geometry of the windshieldas well as the kinematic structure of the wiper including all necessary links andjoints. properties of parts or of tools;

• data defining surface conditions, dimensional data and geometrical tolerancedata.

The items out of Scope are:

• product definition data pertaining to any life cycle phase of a product not relatedto the design phase;

• business or financial data for the management of a design project;

• a general parametric representation of the shape of a part or of a tool;

• data describing the pneumatic, hydraulic, electric, or electronic functions of aproduct;

• continuous kinematics simulations over time;

• data describing the input or the results of finite element analysis

23

Page 24: Kinematic information formats. Standards applicable for · PDF fileKinematic information formats. Standards applicable for mechanical model translation from CAD to Modelica. Delivery

3.7.4 Using STEP format as an interface format.

Weconcludethat the STEP format is a good candidate for being an interface format forsimulations. The protocols are already standardized or being standardized now. How-ever the tools necessary to take in account whole protocol data will be too complicated.Since only small part of these protocol specifications is used for simulation we needto use a subset of there protocol. As result the translation tools will not conform theSTEP standard.

STEP is a quite new standard at it will take some time to mature. Currently STEPis primarily used for production data storage, sometimes as intermediate format fordata exchange between CAD tools. Recent benchmarks revealed that import/exportof STEP preserves information better than IGES and VDAFS[27]. There are no sim-ulation tools based on STEP simulation data yet. Creation of a STEP AP214/K1 toModelica/MBS translation tool can become one of future projects.

3.8 CATIA

The CATIA [33] is one of the most advanced high-end CAD tools widely used inindustry. The CATIA kernel can be complemented by a number of additional packages.The kernel configuration includes traditional part modeling capabilities.

CATIA Assembly Designis additional package that defines and manages assemblystructures. Users can design parts and sub-assemblies to any number of levels. Whenthe designers work with assemblies, they specify assembly constrains and establishcontacts between planar, cylindrical, spherical and conical faces. A constraint solverautomatically adjusts the positions of parts in accordance with the specified constrains.The tool can perform collision detection between parts (in their static positions) andperform clearance analysis.

In order to exchange data with other tools, CATIA is able to import and exportSTEP AP203 format (Section 3.7.1). The assemblies in addition to CATIA parts canalso include VRML (Section 3.10) files in order to enable heterogeneous digital mock-ups with input from different systems.

CATIA Kinematic Simulator package performs analysis of mechanism move-ment. This analysis tool can import a number of geometry definition formats: CATIA,STL, IGES and some others. These objects are connected with joints; the follow-ing joint types are available: point/surface, curve/curve, revolute, prismatic, actuator,planar, spherical, gear, rack, universal, constant, velocity and more. Typically usersdirectly drive parts with mouse movements. This direct screen manipulation allowusers to comprehend possible kinematic motions. Similarly to Assembly Design pack-age, this tool performs interference and clearance checking as well as computing theminimum distance between bodies.

CATIA IGES Interface enables users to exchange data with other systems usingIGES(see Section 3.12) format. The geometrical information can be retrieved fromIGES files to create features such as wireframes, surfaces and other 3D geometry com-ponents for solid body definition.

CATIA STEP AP203 Interface reads and writes data in STEP AP203 formats(Section3.7.1). This application protocol consists of several classes. Class 2 describes curvesand surfaces. Class 3 describes curves and associated topology (edges). Class 4 in-cludes faces, class 6 includes so called exact solids. CATIA STEP AP203 interfacesupports classes 2,3,4 and 6. There is no interface for reading and writing AP214data, and therefore no way to communicate constraints information to tools external to

24

Page 25: Kinematic information formats. Standards applicable for · PDF fileKinematic information formats. Standards applicable for mechanical model translation from CAD to Modelica. Delivery

CATIACATIA has options for export and import of DXF, STL, VRML and some others

less known formats.For internal storage CATIA uses a proprietary binary format which cannot be used

for information exchange with other tools.We concludethat CATIA format cannot be used for data exchange since it is a

proprietary binary format, and CATIA tool is too expensive for most potential users.

3.9 I-DEAS

I-DEAS is a group of products developed by SDRC. These products can be packagedin various ways, but the major functionality we are interested in is included in I-DEASMaster Modeler and Master Assembly. Additional important components are I-DEASMechanism Design and I-DEAS STEP Data Translator.

I-DEAS Core Master Modeler is the common generic modeling foundation of I-DEAS. It is used in other I-DEAS applications, such as finite element modeling, draft-ing and some others. The models made in this tool include open part or solid geometry,parametric and variational design features, engineering equations, dimensions, physi-cal properties (mass and volume) etc. When parts are designed, extrude, revolve, fillet,chamfer and other features are combined. Part components can be cut and joined to-gether. Graphical history tree browser makes possible to perform modification rollbackwhen necessary.

The major data exchange format I-DEAS supports is IGES (see Section 3.12).Other less known formats using polynomial representation of curves and surfaces areVDA-FS and SET ( developed and used mainly in France). Export to the STL form isused for stereolitography purposes.

I-DEAS Master Assemblycan integrate unlimited number parts in hierarchy lev-els. The VGX technology within I-DEAS makes possible to interactively specify con-straints, including parallel, perpendicular, coincident, collinear, tangent and lock. Gen-eral assembly equations can be written to include engineering parameters, part dimen-sions, and orientation dimensions. These equations are solved in the tool to give moreflexibility for the designer.

The tool checks interferences between parts in assembly, The motion of kinematicassemblies can be animated, and mechanism work can be evaluated visually. The toolcomputes surface area, volume, mass, moment of inertia, center of gravity and someother mechanism features.

TheMechanism Designcapabilities include joints (revolute, translational, cylin-drical, universal, spherical, planar, fixed, rack and pinion, screw and constant velocity).Applied loads include gravity and contacts. A predefined relative motions can be spec-ified between the translational, rotational, or cylindrical joints. Spring and dampersfacilitate ease-of-friction modeling. Results of motion simulation include velocities,accelerations, magnitudes. Depending on the remaining degrees of freedom, kinematicor dynamic solve is performed via embedded ADAMS solver. The tool also providesan automatic interface to external solvers, using ADAMS data format. Mechanisms canbe defined within I-DEAS, data can be exported for more advanced study of model be-haviour; the results can be later read back into I-DEAS for post-processing or iterationson the design.

I-DEAS supports input and output of STEP data in two application protocols,AP203 and AP214. In AP203 the conformance classes 1, 2, 4, 6 can be used. In

25

Page 26: Kinematic information formats. Standards applicable for · PDF fileKinematic information formats. Standards applicable for mechanical model translation from CAD to Modelica. Delivery

AP214 basic product data management can be described as well as solid geometry de-scription. Assembly information, including kinematic specification is not included intoAP214 units of functionality supported in I-DEAS interface capabilities.

For internal storage I-DEAS uses a proprietary binary format which cannot be usedfor information exchange with other tools.

We concludethat I-DEAS format cannot be used for data exchange since it is aproprietary binary format, and I-DEAS tool is quite expensive for most potential users.However, in future conversion tool from I-DEAS to Modelica can be designed.

3.10 VRML

VRML (Virtual Reality Modeling Language) is a textual format for description of staticor dynamic 3D scenes consisting of geometrical objects. Geometry can be described invarious levels, i.e. as set of polygons, or as predefined primitive surfaces. Predefinedmotion can be described using control points used for linear interpolation in time do-main. Various coordinate systems can be used, and transforms between these systemsis described via hierarchical scene graph.

The VRML language is used by many tools as intermediate format for geometrypresentation, specially when this presentation is oriented to visualization. VRML doesnot contain solid body geometry description; instead surfaces only are described.

VRML is extensible (users can add new attributes to the scene hierarchy). For thepurpose of kinematics, several fields can be added, such as mass, inertia tensor, jointpositions and types etc. These fields would be used just by several specialized toolsworking with kinematic applications, and these can be effectively ignored by all othertools working with VRML.

In most cases, however, kinematic information should be separated from geometryinformation.

We concludethat VRML format cannot be used for kinematic data exchange sincethere is no standard way to describe mass, inertia, and joint freedom information.VRML can complement other kinematic data formats when geometry description isnecessary. This approach is implemented in Modelica add-on tools for visualizationpurposes. However, in future necessary nodes can be added to extended VRML and aconversion tool from CAD systems to “Extended VRML” and from “Extended VRML”to Modelica can be designed.

3.11 STL, DXF

These are two surface description formats. They describe only surface geometry. In-formation about the solid body features is not preserved in these descriptions.

We concludethat these formats cannot be used for kinematic data exchange, butthey can complement other kinematic data formats when geometry description is nec-essary. This approach is implemented in Modelica and add-on tools for visualizationand collision processing purposes.

3.11.1 STL

The STL (STereo Lithography) format [34] is a very simple format suitable for visual-ization. All surfaces are divided into triangles. The coordinates of the triangle vertices,as well as the normal vectors of the triangles, are listed in the STL-file.

The text below is an example of one triangle in STL.

26

Page 27: Kinematic information formats. Standards applicable for · PDF fileKinematic information formats. Standards applicable for mechanical model translation from CAD to Modelica. Delivery

facet normal 0.000000e+000 -1.000000e+000 0.000000e+000outer loop

vertex 5.000000e+001 -5.000000e+001 1.000000e+002vertex -5.000000e+001 -5.000000e+001 0.000000e+000vertex 5.000000e+001 -5.000000e+001 0.000000e+000

endloopendfacet

3.11.2 DXF

The DXF format developed by Autodesk [4] is a more advanced format suitable forvisualization and geometry data storage. In addition to triangles (3DFACE entities) itcontains some more information about colors and more specialized primitive objects.

The text below is an example of a triangle in DXF (normally each word in DXF iswritten in a separate line; the example below is compressed).

3DFACE 8stldxf 62 710 0.4 20 0 30 -0.211 0.4 21 0 31 -0.212 0 22 0 32 013 0 23 0 33 -0.2

0...

3.12 IGES

The Initial Graphics Exchange Specification (IGES) [31, 29, 30] is the U. S. nationalstandard for the exchange of data between dissimilar CAD systems. The IGES stan-dard, now in its sixth revision, has been expanded to include most concepts used inmajor CAD systems. All major and most minor non-PC-based CAD systems supportsome version of the IGES standard. Some of the over 1000 PC-based CAD systems(including all of the major ones) include some IGES support.

IGES is intended as a ”neutral” format, not tied to any particular CAD system. Still,IGES better represents the entities of some CAD systems than it does others.

IGES is a file structure format, a language format, and the representation of geo-metric, topological, and nongeometric product definition data in these formats. Prod-uct definition data represented in these formats will be exchanged through a variety ofphysical media. The specific features and protocols for the communications media arethe subject of other standards. The methodology for representing product definitiondata is extensible and independent of the modeling methods used.

IGES contains descriptions of parts using Constructive Solid Geometry. There is noinformation about kinematic relationships between parts collected in IGES documents.Descriptions contains a table of entities where each entity contains space coordinatesand relationships to other entities in the model.

In cooperation with I-DEAS this format may contain 3D wireframes, parametricspline surfaces, B-spline surfaces of high polynomial order. This way some analyticgeometry descriptions can be translated between CAD systems without loss of preci-sion.

This is the list of available entities:

27

Page 28: Kinematic information formats. Standards applicable for · PDF fileKinematic information formats. Standards applicable for mechanical model translation from CAD to Modelica. Delivery

100 Circular Arc102 Composite Curve104 Conic Arc106 Copious Data108 Plane110 Line112 Parametric Spline Curve114 Parametric Spline Surface116 Point118 Ruled Surface120 Surface of Revolution122 Tabulated Cylinder124 Transformation Matrix125 Flash126 Rational B-Spline Curve128 Rational B-Spline Surface130 Offset Curve140 Offset Surface141 Boundary (see Appendix G)142 Curve on a Parametric Surface143 Bounded Surface (see Appendix G)144 Trimmed_Parametric_Surface150 Block152 RightAngular Wedge154 RightCircular Cylinder156 RightCircular Cone Frustum158 Sphere160 Torus162 Solid of Revolution164 Solidof Linear Extrusion168 Ellipsoid180 Boolean Tree182 Selected Component184 Solid Assembly186 Manifold Solid B-Rep Object502 Vertex504 Edge508 Loop510 Face114 Parametric Spline Surface118/1 Ruled Surface120 Surface of Revolution122 Tabulated Cylinder128 Rational B-Spline Surface140 Offset Surface190 Plane Surface192 Right Circular Cylindrical Surface194 Right Circular Conical Surface196 Spherical Surface198 Toroidal Surface106/11 2D Path106/12 3D Path106/63 Closed Planar Curve

This is an example of part fragment in IGES format:

28

Page 29: Kinematic information formats. Standards applicable for · PDF fileKinematic information formats. Standards applicable for mechanical model translation from CAD to Modelica. Delivery

,,8HPANEL123,10HPANEL.IGES,4HEX 2,4HHAND,16,38,7,38,14,8HPANEL123,1.0, G 11,4HINCH,1,0.028,13H900729.231652,0.0005,100.0, G 225HIGES RFC Review Committee,8HIPO/NIST,6,0; G 3

124 1 1 1 0 0 0 0 0D 1124 0 0 2 0 0D 2212 3 1 1 5 0 0 0 10100D 3212 0 0 2 0 0D 4214 5 1 1 5 0 0 0 10100D 5214 0 0 1 2 0D 6210 6 1 1 5 0 0 0 101D 7210 0 0 1 0 0D 8

...124,0.70710678,-0.70710678,0.0,1.0,0.70710678,0.70710678,0.0, 1P 11.0,0.0,0.0,1.0,0.0,0,0; 1P 2212,2,10,0.98,0.1,1,1.571,0.0,0,0,3.21,1.656,0.0,10HDRILL .010, 3P 310,1.02,0.1,1,1.571,0.0,0,0,3.210,1.506,0.0,10H(6 PLACES),0,0; 3P 4214,2,0.150,0.050,0.0,4.800,2.000,4.562,1.546,4.262,1.546,0,0; 5P 5210,3,1,5,0,0; 7P 6...

We concludethat this format cannot be used for kinematic data exchange. It iseven too complex in order to complement other kinematic data formats when geometrydescription is necessary. If models described in IGES should be modeled, kinematicinformation should be restored (e.g. using SolidWorks) and geometry can be translatedto one of simple formats (STL or DXF) for visualization.

3.13 XML

XML [35] is the “Extensible Markup Language”. According to the specification XMLis not a single, predefined markup language: it’s a metalanguage – a language fordescribing other languages – which lets the user design his own markup. Predefinedmarkup languages like HTML define a way to describe information in one specificclass of documents only; XML lets the user to define a customized markup languagefor limitless different classes of document. It can do this because it’s written in SGML,the international standard metalanguage for text markup systems.

XML is designed to make it easy and straightforward to use SGML on the Web:easy to define document types, easy to author and manage SGML-defined documents,and easy to transmit and share them across the Web.

It defines an extremely simple dialect of SGML which is completely described inthe XML Specification. The goal is to enable generic SGML to be served, received,and processed on the Web in the way that is now possible with HTML.

XML can be used for storage of kinematic information, as any other information.For instance, tree-like structures containing kinematic elements like bodies and joints,as well as their numerical attributes can be described in XML. For this purpose DTDschemas for kinematics should be defined, standardized and translation tools (parserand generator) should be implemented. Unfortunately, there is no DTD for CAD infor-mation standardized. Therefore there is no substantial motivation to design necessarytranslation tools.

The example below shows a sample XML description for a body, a local coordinateframe and a revolute joint connecting two local coordinate frames.

29

Page 30: Kinematic information formats. Standards applicable for · PDF fileKinematic information formats. Standards applicable for mechanical model translation from CAD to Modelica. Delivery

<model name="pendulum"><body name="abc" mass="7.456">

<inertia i11="0.45" i22="0.23" i33="0.45"i12="0.05" i13="0.0045" i23="0.1"/>

<center x="0.4" y="0.5" z="0.2"/><geometry xx="1">

<origin x="0.5" y="0.2" z="0.3"/><x-axis x="1.0" y="0.0" z="0.0"/><y-axis x="0.0" y="1.0" z="0.0"/><presentation language="stl" file="abc.stl"/><color r="0.5" y="0.0" z="1.0" transparency="0.5"/>

</geometry></body>

<coord name="c1"><relative name="abc"/><translation x="0.5" y="0.2" z="0.3"/>

</coord>

<joint name="j1" type="revolute"obj1="c1" obj2="c2">

<axis x="0.0" y="1.0" z="1.0"/></joint></model>

We concludethat this format can be used for kinematic data exchange, but addi-tional efforts for standardization will be necessary.

4 Using the Modelica Language for Dynamic Analysisof Mechanical Models

4.1 Modelica

A new language called Modelica [11, 7, 16, 18] for hierarchical object-oriented phys-ical modeling is being developed through an international effort. The first version ofModelica, version 1.0, was announced in September 1997. The most recent, version1.3, was released in December 15, 1999. It is an object-oriented language for model-ing of physical systems for the purpose of efficient simulation. The language unifiesand generalizes previous object-oriented modeling languages, e.g. such as Dymola[6], Omola [2], ObjectMath [10, 19], Smile [9], NMF [21], etc. Compared with thewidespread simulation languages available today this language offers three importantadvances:

• non-causal modeling based on differential and algebraic equations;

• multidomain modeling capability, i.e. it is possible to combine electrical, me-chanical, thermodynamic, hydraulic etc. model components within the sameapplication model;

• a general type system that unifies object-orientation, multiple inheritance, andtemplates within a single class construct.

Modelica is a general standard notation which can be used for standard applicationdomain libraries and for applications that use these libraries. Tools and environmentsare built to comply with this standard.

30

Page 31: Kinematic information formats. Standards applicable for · PDF fileKinematic information formats. Standards applicable for mechanical model translation from CAD to Modelica. Delivery

4.2 Basic Features of the Modelica Language

The Modelica language is primarily intended for the description of systems that havevariables with continuously changing values. Additionally, discrete variables are sup-ported giving the language hybrid modeling capabilities. Models written in Modelicaspecify which variables exist in the mathematical model, and how the variable valuesare related. Values of continuously changing variables are usually represented as float-ing point values. The floating point variables are usually involved in such models. Thetype of these is denoted asReal . Relations between the variable values are describedby differential-algebraic equations (DAE), such as

x+ 1 = cos(T ime)

ory′ = x

Equations and variables used in equations are collected in Modelica classes. Mod-elica classes are intended for reuse. The classes are collected into packages. One orseveral related packages form a library. There exist libraries for electrical, mechan-ical, thermodynamics, hydraulic and other application domains. Libraries serve ascollections of knowledge for each application domain. Equations based on the lawsof physics, as well as rules describing how the classes can be applied are stored in thelibraries.

4.3 Introduction to the Modelica Multibody System Library

To facilitate mechanical system modeling a standard Modelica class library has beendeveloped for modeling multi body mechanical systems (MBS) [15, 20], i.e., systemsof rigid bodies connected to each other with certain degrees of freedom.

This object-oriented library was developed and described by Martin Otter in hisdissertation [20]. Overviews of the library are given in [28]. This library was firstimplemented in the Dymola language. Later this library was translated to Modelica.

It should be noted that anbeta-versionof the library is discussed in this report.Another 3D-mechanical library for Modelica is currently under development.

The purpose of the MBS library is to simplify modeling and dynamic analysisof mechanical models. Given an idealized mechanical model and external forces, aModelica simulation can compute the position and orientation of each body (pointmass) as a function of time. The MBS library is based on Newton’s laws. Since theseare applied to multiple and connected bodies, coordinate transformations are taken intoaccount. Since the library works with bodies that have some extent, their dynamicscannot be simplified to the dynamics of point masses. The rotation of bodies, as wellas the speed and acceleration of rotation are taken into account.

The MBS library operates on idealized rigid bodies described by mass and inertiatensors. Massless joints and coordinate frame transformations can be set up betweenbodies with mass. Motors and other driving and braking forces and torques can beapplied to the joints. Also, springs, dampers and external forces can be modeled.

The unique feature of the Multibody library is the efficient treatment of joint lock-ing and unlocking. This allows e.g. easy modeling of friction or brakes in the joints.This locking information is not used in the kinematic data format discussed in thisreport. However it can be added for simulation purposes.

The major areas that MBS does not handle (and is not intended to handle) are flex-ible bodies (bodies with deformations). This requires solution of partial differential

31

Page 32: Kinematic information formats. Standards applicable for · PDF fileKinematic information formats. Standards applicable for mechanical model translation from CAD to Modelica. Delivery

equations which currently cannot be formulated in Modelica. Furthermore, these equa-tions require very high efficiency in computation, as well as very detailed control ofsolution method choice, which is missing in current implementations. However thereis ongoing research in this area[12, 22].

The MBS library is a collection of Modelica classes. In order to do modeling of amechanical system certain classes need to be instantiated in the user’s model. Theseshould be properly connected, according to certain rules. Mechanical system modelscan be used for several purposes, since there are different ways to analyze dynamicsystems. However, the most typical use of such models is to analyze the movementsof bodies resulting from the application of certain forces and torques, as well as otherchanges in the environment. The forces and torques can have different origins: thesecan produced by drive trains, electrical motors, controlling devices, or combination ofthose. Additionally, external forces and torques can be directly applied to bodies inmechanical models.

i.Frame_a

i.OneFrame_a

i.OneFrame_b

i.Frame_b

i.TwoTreeFrames

i.ExtForceBase

f.ExtForce,

f.ExtLineForce

i.ExtTorqueBase

f.ExtTorque,

f.ExtLineTorque

i.Interact

i.TreeJoint

i.Interact2

i.CutJoint

i.Force

i.LineForce

f.Spring

f.Damper

f.Spring−

DamperPar

f.Spring−

DamperSer

p.FrameTranslation

i.BodyBase

p.Body

p.Shape

y.VisualShape

c.ConnectingRod

c.ConnectingRod2

c.Spherical

c.Revolute

c.Prismatic

c.Revolute−

2Dloop

c.Prismatic−

2Dloop

i.Frame

i.FrameBase

i.FrameRotation

i.FrameAxes

i.FrameAngles

bi.InPort

p.CylinderBody

p.BoxBody

p.Body2

p.ShapeBody

2

i.TwoNoTreeFrames

p.Inertial

x.BodyV

j.Spherical

j.FreeMotion

j.Revolute

j.Screwj.Prismatic

ri.Flange_a

ri.Flange_b

ti.Flange_a

ti.Flange_b

j.Cylindrical

j.Universal

j.Planar

2

3

Figure 11: Classes of the MBS library. The graphical notation is explained in Figure12.

The figure 11 contains the inheritance and aggregation hierarchy of the 60 classes ofthe library. We use non-traditional notation for inheritance and aggregation relations inthese diagrams. This notation is explained in Figure 12. The links used in the diagrams

32

Page 33: Kinematic information formats. Standards applicable for · PDF fileKinematic information formats. Standards applicable for mechanical model translation from CAD to Modelica. Delivery

class

class used in CAD−to−Modelica translation

superclass

subclass

class A

class includes

an object of class A

class A

class includes

N objects of class A

N

Figure 12: Notation for class diagrams (Figure 11)

are more convenient for libraries with multiple levels of inheritance. In aggregationwe emphasize how many subcomponents are used in the class. Package name in thediagram is abbreviated to a single character. Packages used in MBS are:

i - Interfacesc - CutJointsf - Forcesj - Jointsp - Partsri, ti - Rotational.Interfaces, Translational.Interfacesx - Additional Extensionsy - base library componentsbi - Blocks.Interfaces

Our detailed description covers few major classes only. Most mechanical systemscan be constructed from these. Many other classes are variations and optimized com-binations of the basic classes.

4.4 Using the MBS library

4.4.1 Kinematic outline

There can be different approaches to constructing an MBS model for a mechanicalmodel using a collection of Modelica classes. If a CAD-to-Modelica translator is used,there is no need for manual construction of the MBS model. Otherwise, the construc-tion process depends on the context, in particular what type of analysis that will beapplied to the model, and whether simulation efficiency should be taken into account.Here we suggest here the process of stepwise refinement of an MBS model first usingso called kinematic outline (kinematic skeleton), and later introducing details of modeldynamics and visualization based on this outline.

The kinematic outline is a graph consisting of nodes, connectors belonging to thenode, and edges between the connectors. Thenodesof the outline correspond to co-ordinate frame transformations and joints. Theedgesof the outline are connectionsbetween them. The edges are attached to the nodes in connectors that correspond tomechanical connectors.

In many cases the graphs are acyclic. However there exist mechanisms that corre-spond to graphs with loops. Such loops are calledkinematic loopsand may sometimesrequire special treatment when MBS library classes are used.

Mechanical connectorFrame (also referred as classFrame a or Frame b spec-ifies a local coordinate system (a local frame of reference).

33

Page 34: Kinematic information formats. Standards applicable for · PDF fileKinematic information formats. Standards applicable for mechanical model translation from CAD to Modelica. Delivery

A frame transformation (class FrameTranslation ) describes the (static)position of one mechanical connector with respect to another. A joint specifies howone mechanical connector can move with respect to another. The possible movementsare constrained by certain degrees of freedom: rotational (class Revolute , trans-lational (class Prismatic ) or their combinations.

The kinematic outline consists of the inertial system, the coordinate frame transla-tions, and the joints that define the kinematic features of the system. Given angles ofrotation for revolute joints and the length of translation for prismatic joints, the MBSsystem can compute the position of any mechanical connector. For this purpose it usesthe coordinate transformation matrix between adjacent mechanical connectors.

The following classes are used for constructing the kinematic outline:

connector Frame a Each instance ofFrame a describes a local coordinatesystem (also calledframe A). This connector contains several non-flow variables:

• Real S[3,3] - rotation matrix describing frameA with respect to the inertialframe.

• Real r0[3] - vector from inertial frame toA.

• Real v[3], w[3], a[3], z[3] - translational and angular velocities andaccelerations

According to Modelica semantics, if connectors from several objects are connected, thenon-flow variables with the same name become constrained to have identical valuesthrough equality equations. This corresponds to a common local coordinate systemused by several model components.

Connectors also contain two flow variables:

• Real f[3] - resultant force acting onA.

• Real t[3] - resultant torque acting onA.

According to Modelica semantics, ifn connectors from several objects are con-nected together, the sum of allflow variables is equal to zero, i.e.F1 +F2 +...+Fn =0.

connector Frame b This connector has exactly the same variables, but uses theB frame.

The Connection Rules There is a rule regarding connections between the MBS li-brary classes discussed further. Connectorframe a of type Frame a can be con-nected only to connectorframe b of typeFrame b of other object3.

This rule implies the three-like structure of the kinematic skeletons. When a con-nection between two connectors is set up, the coordinate frames that the two connec-tors represent become identical: the position, rotation, velocities and accelerations areequal. However, the sum of all acting forces (plus the resulting force taken with neg-ative sign) and the sum of all torques (plus the resulting torque taken with negativesign) are zeroes. This equation is implied by the fact that force and torque areflowvariables of the connector.

3This rule, however can be violated when closed kinematic loops and external forces are used.

34

Page 35: Kinematic information formats. Standards applicable for · PDF fileKinematic information formats. Standards applicable for mechanical model translation from CAD to Modelica. Delivery

class InertialSystem An MBS model should contain one (and only one)object (class InertialSystem ) representing the global coordinate system andforce of gravity. It has a connectorframe b . All other components in the modelshould be directly or indirectly connected to the connectorframe b of theInertialSystemobject.

class FrameTranslation This class has connectorsframe a andframe b, as well as parameterReal r[3] . This parameter describes a fixed translation be-tween the framesA andB in the coordinates ofA. An object of this class represents amassless bar between these two points.

class Revolute This class has connectorsframe a and frame b , as wellas parameterReal n[3] . This vector defines the direction of the axis of rotationwhen theB frame rotates around theA frame. There is a variableq which contains thecurrent angle of the joint. There is also aconnector axis which allows connectingthe driving force (i.e. motors) to state variables for objects of classRevolute .

class Prismatic This class has connectorsframe a andframe b , as wellas parameterReal n[3] . This vector defines the direction of translation when theB frame moves relatively to theA frame. There is a variableq which contains thecurrent relative distance of the joint. There is also aconnector axis which al-lows connecting the driving force (i.e. motors) to state variables for objects of classPrismatic .

4.4.2 Example: Kinematic Outline of Double Pendulum

In this section an idealized model of a double pendulum is considered. This pendu-lum consists of two boxes linked by a hinge. The upper box is lined by a hinge to anon-movable platform, i.e. an inertial system. Both the boxes can move in theXYplane. The corresponding kinematic outline consists of two revolute joints, one frametranslation and one inertial system. The structure is displayed in Figure 13.

Revolute rev1

Revolute rev2

b

InertialSystem i

FrameTranslation arm

b

b

a

a

a

Figure 13: Connection diagram of a kinematic skeleton of a double pendulum withoutmasses.

35

Page 36: Kinematic information formats. Standards applicable for · PDF fileKinematic information formats. Standards applicable for mechanical model translation from CAD to Modelica. Delivery

4.4.3 Adding masses.

The motion of dynamic system cannot be defined just by its kinematic outline, since anoutline does not contain mass objects yet. The classBodyBase represents mechan-ical objects with mass. This class has a connectorframe a as well as the followingparameters supplied by the user:

• Real m- mass of the body.

• Real rCM[3] - position of center of mass with respect to framea.

• Real I[3,3] - inertia tensor with respect to the position of the center ofmass. This 3 by 3 tensor is defined by six numbers since it is symmetric: I11 I21 I31

I21 I22 I32

I31 I32 I33

4.4.4 Adding Masses to the Double Pendulum Example.

In the double pendulum example two bodies can be added to the kinematic outline.Since the description of classBodyBase contains the distance between its frame

A and its center of mass, such objects can be directly connected to connectorframe bof revolute jointsrev1 andrev2 . The kinematic skeleton with masses is displayedin Figure 14.

Revolute rev1

Revolute rev2

Body P1

Body P2

InertialSystem i

FrameTranslation arm

b

b

b

a

a

a

a

a

Figure 14: Connection diagram of a kinematic skeleton of a double pendulum withmasses.

The instances of Modelica classes (such asP1, P2, rev1 etc.) have attributes thatcan be modified. For instance,Body has attributes that define mass, inertia tensor andthe location of its center of mass relative to the local coordinate system (rCM). Instancesof Revolute (revolute joint) have an attributen that define the direction of axis ofrotation. Instances ofPrismatic (prismatic joint) have an attribute that specify thedirection of the allowed translation. For aFrameTranslation the coordinates ofits end are specified by the vectorr .

Several important parameters should be defined for a double pendulum:L1 andL2

are the lengths of the boxes. Their masses arem1 andm2. The center of mass of thefirst box is located at the distanceL1/2 from the first rotation point. Rotation axes of

36

Page 37: Kinematic information formats. Standards applicable for · PDF fileKinematic information formats. Standards applicable for mechanical model translation from CAD to Modelica. Delivery

the revolute joints are directed along theZ axis. Therefore these are described as thevector{0,0,1 }.

The textual representation of the Modelica model is as follows:

class Pendulumparameter Real L1;parameter Real L2;Multibody.Parts.InertialSystem I;Multibody.Parts.Body P1(rCM= {L1/2,0,0 });Multibody.Parts.Body P2(rCM= {L2/2,0,0 });Multibody.Joints.Revolute rev1(n= {0, 0, 1 });Multibody.Joints.Revolute rev2(n= {0, 0, 1 });Multibody.Parts.FrameTranslation arm(r= {L1, 0, 0 });

equationconnect (I.frame b, rev1.frame a);connect (rev1.frame b, P2.frame a);connect (rev1.frame b, arm.frame a);connect (arm.frame b, rev2.frame a);connect (rev2.frame b, P1.frame a);

end Pendulum;

The corresponding mechanical structure is shown in Figure 15.

������

������

������������

����������������

������������������

������������������

��������������������

��������������������

������������

��������

������

����������������������������arm

rev1

rev2

Inertial

L/2L

L/2

P2

P1

Figure 15: Mechanical structure of the pendulum.

4.4.5 Adding Geometrical Shapes

There are two ways to create 3D visualizations of mechanical models for systems con-structed from the MBS library. The information about object position and rotation canbe saved in a file and read back later for visualization. Alternatively, this data can besent to external functions for visualization. There exist several classes in the MBS li-brary intended for saving position and rotation of objects during each time step of thesimulation. In particular,BodyV requires the following parameters and variables forvisualization:

• Connectorframe a which is connected to connectorframe a of the corre-sponding body.

• Real nx[3], ny[3] specify the orientation of the visualized shape (direc-tion of its axesX andY) with respect to the frame of the connectora.

37

Page 38: Kinematic information formats. Standards applicable for · PDF fileKinematic information formats. Standards applicable for mechanical model translation from CAD to Modelica. Delivery

• The vectorReal r0[3] specifies the point of insertion of the shape with respectto the rotated frame of the connectora.

• The arrayReal Material[4] specifies the color of the shape.

Other variables specify a predefined shape4 (and its size) or the custom shape. Thedetailed description of geometry and other graphical properties of custom shape can bestored outside Modelica code in some standard format, e.g. STL or VRML (see [8]),or can be stored inside the Modelica code as annotations, as proposed in [8].

4.4.6 Adding Shapes for Double Pendulum

In order to use shapes for pendulum visualization we can utilize classBodyV whichinherits classBodyBase (Section 4.4.3) and includesVisualShape (Section 4.4.5).The parts of the pendulum can be treated as a box of sizeL1 × K1 × K1 andL2 ×K2 ×K2. Such points have the default point of insertion in the center of the left face(Figure 16).

Z

Y

X

Figure 16: The default position and rotation of a¨box¨ – a predefined shape of theMBS library.

The textual representation of Modelica model is following:

class Pendulumparameter Real L1;parameter Real L2;Multibody.Parts.InertialSystem I;BodyV P1(mass=M1,r= {L1/2,0,0 }

Shape="box", Size= {L1,K1,K1 }, r0= {0,0,0 },Material= {1,0,0,0.5 });

BodyV P2(mass=M2,r= {L2/2,0,0 }Shape="box", Size= {L2,K2,K2 }, r0= {0,0,0 },

Material= {0,1,0,0.5 });Multibody.Joints.Revolute rev1(n= {0, 0, 1 });Multibody.Joints.Revolute rev2(n= {0, 0, 1 });Multibody.Parts.FrameTranslation arm(r= {L1, 0, 0 });

equationconnect (I.frame b, rev1.frame a);connect (rev1.frame b, P1.frame a);connect (rev1.frame b, arm.frame a);

4The standard predefined shapes are box, cylinder, sphere, pipe, cone and beam.

38

Page 39: Kinematic information formats. Standards applicable for · PDF fileKinematic information formats. Standards applicable for mechanical model translation from CAD to Modelica. Delivery

connect (arm.frame b, rev2.frame a);connect (rev2.frame b, P2.frame a);

end Pendulum;

4.4.7 Interface to Non-Mechanical Parts of the Model

When a multidomain model in Modelica is designed, mechanical part of the model re-ceives energy from some other parts of the model. The mechanical part should usuallybe connected with the part describing the drive train, which is in turn connected to thepart describing the energy source, e.g. electrical circuit. There are standard Modelicalibraries for all these components.

However, sometimes the attention is focused on anisolatedmechanical part of themodel. In this case the forces and torques acting on the model can be specified directly.

There exist three major ways to set up an interface between the mechanical part ofModelica model and other parts. These ways correspond to three connector types:Multi-body.Interfaces.Frame ,Rotational.Interfaces.Flange a andTrans-lational.Interfaces.TransCut .

Using Frame b Any object with connector of typeFrame b can be connected tomodel of external force or torque. This external force (or torque) will be appliedto the corresponding point on the relevant body. This can be demonstrated asfollows:

...Multibody.Forces.ExtForce E;// or Multibody.Forces.ExtTorque E;Frame_b b;

equationsconnect(b,E.frame_b);

E.inPort.signal={fx, fy, fz};// Force given in the local coordinate frame// orE.inPort.signal=E.frame_b.S’*{fx, fy, fz};// Force given in the global coordinate frame

Using Rotational.Interfaces.Flange . A torque can be applied to a revo-lute joint. First, a torque source model is declared, and then it is used. In asimple controllerk andd are large constants obtained from experiments, andqref is the reference angle which can vary. The motor steers the joint so thatqtends to be very close toqref . The intermediate connectorframe a is some-times used whenR is encapsulated in some other class (e.g. this occurs in theSolidWorks-to-Modelica translator output).

model SimpleRotationalController;Real qref;parameter Real k,d;Rotational.Interfaces.Flange_b flange;

equationsflange.tau=k*(flange.phi-qref)+d*der(flange.phi);

end SimpleController;...

Multibody.Joints.Revolute rev;SimpleRotationalController m;Rotational.Interfaces.Flange_a flange_a;

equationsconnect(m.flange,flange_a); connect (flange_a,rev.axis);// or connect(m.flange,rev.axis);

39

Page 40: Kinematic information formats. Standards applicable for · PDF fileKinematic information formats. Standards applicable for mechanical model translation from CAD to Modelica. Delivery

Using Translational.Interfaces.Flange . A force can be applied to a pris-matic joint. First, a force source model is declared, and then it is used. In a sim-ple controllerk andd are large constants obtained from experiments, andqrefis the reference distance which can vary. The motor steers the joint so thatqtends to be very close toqref . The intermediate connectorframe a is some-times used whenR is encapsulated in some other class (e.g. this occurs in theSolidWorks-to-Modelica translator output).

model SimpleTranslationalController;Real qref;parameter Real k,d;Translational.Interfaces.Flange_b flange;

equationsflange.f=k*(flange.s-qref)+d*der(flange.s);

end SimpleController;...

Multibody.Joints.Prismatic prism;SimpleTranslationalController m;Translational.Interfaces.Flange_a flange_a;

equationsconnect(m.flange,flange_a); connect (flange_a,prism.axis);// or connect(m.flange,prism.axis);

4.5 Advantages of Using MBS for Dynamic Analysis

There are two major advantages in using the MBS and Modelica library for DynamicAnalysis.

• The simulation is notinterpreted, butcompiled.

• Multidomain modeling is made possible.

4.5.1 Interpretation and Compilation in Mechanical Simulation

There exist two ways to specify a model for mechanical simulation software. Thesoftware caninterpretthe model orcompileit to an executable code.

In mechanical simulation libraries a particular mechanical model is usually de-scribed as a collection of program objects. These objects can be created by callinglibrary functions, or they can be created by instantiating some classes from a class li-brary. Alternatively the mechanical model is described in a proprietary format (or spec-ified via graphical user interface), as this is done in Working Model 3D and ADAMS.In all these casesinterpretationof the model information takes place.

In contrast, when using Modelica/MBS the mechanical model is first compiledto a set of equations, which are optimized. Then C code only including necessaryarithmetic operations for the specific mechanical model is generated, optimized by Ccompiler, and finally compiled into a specific executable application. This results inmuch faster applications.

4.5.2 Multidomain Simulation

Modeling mechanical systems is one of the major Modelica applications. In Modelicathis can be done by employing the Multi-Body System library (MBS). Classes fromthis library can be instantiated. A proper collection of instances as described in section4.4 constitutes a system of differential and algebraic equations. The solution of thissystem yields the dynamic behavior of the corresponding mechanical system.

40

Page 41: Kinematic information formats. Standards applicable for · PDF fileKinematic information formats. Standards applicable for mechanical model translation from CAD to Modelica. Delivery

Another major Modelica application area is modeling of multi-domain systems.This means that for instance electric, hydraulic and control models can be incorpo-rated into the same mathematical model as the model of a mechanical system. This isobtained by instantiation of classes from the corresponding libraries.

5 Conclusion

This report make a comparative study of twelve different formats for kinematic infor-mation storage. All the formats and their advantages and disadvantages are summarizedat Tables 1, 2, 3 on page 5, 6, 7.

After discussion at the Realsim consortium meeting in May 2000, a decision wasmade to use Modelica/MBS format (see Section 4) for this purpose.

Modelica/MBS format is not an industrial standard yet, but given characteristicsand scope of the Realsim project we came to the conclusion that this format is mostadequate for the goals of the project. In addition we believe that Modelica will becomein future an international standard for description of physical systems, and MBS canbe appended to this standard as a validated (it has been successfully used in manyapplications already) and recommended library for mechanical system simulation.

This wayonly onetranslation tool is necessary. In future, however, other formats(STEP AP214 and ADAMS) can be easily generated by extending this translator. Thiscan be done in the framework of other projects, when Realsim will be finished.

References

[1] ADAMS and Mechanical DynamicsAdams, ADAMS and Mechanical Dynamics,Inc., http://www.adams.com

[2] Mats AnderssonObject-Oriented Modeling and Simulation of Hybrid Systems.PhD thesis ISRN LUTFD2/TFRT–1043–SE, Department of Automatic Control,Lund Institute of Technology, Lund, Sweden, December 1994.

[3] Autodesk Inc.,3DStudioMax, http://www.ktx.com

[4] Autodesk Inc.,Mechanical Desktop, http://www.autodesk.com

[5] Dynabits,WWW page, http://www.dynabits.com

[6] Dynasim AB,Dymola Home Page, http://www.dynasim.se

[7] Hilding Elmqvist, Sven-Erik Mattsson, Modelica – The Next Generation ModelingLanguage – An International Design Effort, InProceedings of First World Congressof System Simulation, Singapore, September 1–3 1997.

[8] Vadim Engelson,Tools for Design, Interactive Simulation, and Visualization ofObject-Oriented Models in Scientific Computing. Linkping Studies in Science andTechnology. Dissertation No 627. Department of Computer and Information Sci-ence, Linkping University, May 2000. 340 pp.

[9] Thilo Ernst, Stefan J¨ahnichen, and Mattias Klose, The Architecture of the Smile/MSimulation Environment, inProceedings of the 15th IMACS World Congress on Sci-entific Computation, Modeling and Applied Mathematics, Vol. 6, Berlin, Germany,pp. 653-658, 1997

41

Page 42: Kinematic information formats. Standards applicable for · PDF fileKinematic information formats. Standards applicable for mechanical model translation from CAD to Modelica. Delivery

[10] Peter Fritzson, Lars Viklund, Dag Fritzson, Johan Herber. High-Level Mathemat-ical Modelling and Programming,IEEE Software, 12(4):77-87, July 1995

[11] Peter Fritzson, Vadim Engelson, Modelica – A Unified Object-Oriented Lan-guage for System Modeling and Simulation, inProceedings of European Confer-ence on Object-Oriented Programming (ECOOP98), Brussels, July 20–24, 1998.

[12] Peter Fritzson, personal communication.

[13] Knowledge Revolution Inc.,Working Model 3D, MSC Working Knowledge /Knowledge Revolution Inc., http://www.krev.com

[14] Hakan Larsson,Translation of 3D CAD Models to Modelica, Master Thesis,LiTH-IDA-Ex-99/30, IDA, Linkoping Univ., Sweden, March 1999.

[15] Sven Erik Mattsson, Hilding Elmqvist, Martin Otter, Physical system modelingwith Modelica,Control Engineering Practice, 1998, vol. 6, pp. 501–510.

[16] Modelica Design Group,Modelica WWW site, http://www.modelica.org

[17] Parametric Technologies Inc.,Pro/ENGINEER, http://www.ptc.som

[18] PELAB Modelica activities in PELAB, Programming Environments Labora-tory, Department of Computer and Information Science, Link¨oping University,http://www.ida.liu.se/˜pelab/modelica

[19] PELAB, ObjectMath Home Page, http://www.ida.liu.se/labs/pelab/omath

[20] Martin Otter, Objektorientierte Modellierung mechatronischer Systeme amBeispiel geregelter Roboter. Dissertation, Fortschrittberichte VDI, Reihe 20, Nr.147, 1995.

[21] Per Sahlin, Alex Bring, and Ed F. Sowell,The Neutral Model Format for buildingsimulation, Version 3.02. Technical Report, Department of Building Sciences, TheRoyal Institute of Technology, Stockholm, Sweden, June 1996.

[22] Sheshardi, K., Peter Fritzson, A Mathematica-based PDE-Solver Generator,in Proceedings of 1999 Conference of the Scandinavian Simulation Society,Linkoping, Sweden, October 18-19, 1999.

[23] SolidWorks, SolidWorks Corporation, http://www.solidworks.com

[24] Thomas Froese, STEP Data Standards and the Construction Industry,http://www.civil.ubc.ca/˜tfroese/pubs/fro96astep/fro96a.html

[25] GaTech EIS Lab STEP Page, http://www.eislab.gatech.edu/step/

[26] STEP Overview : Integrated Resources, APs and AICs ,http://public.prostep.de/spo/

[27] Hans Johansson, C. Wiidemann.Summary of Introducing STEP Data Transfer inIndustry. IVF, Sweden.

42

Page 43: Kinematic information formats. Standards applicable for · PDF fileKinematic information formats. Standards applicable for mechanical model translation from CAD to Modelica. Delivery

[28] Martin Otter, Hilding Elmqvist, and F.E Cellier: Modeling of Multibody Sys-tems with the Object-Oriented Modeling Language Dymola .Proceedings of theNATO-Advanced Study Institute on Computer Aided Analysis of Rigid and FlexibleMechancial Systems, Volume II, pp. 91-110, Troia, Portugal, 27 June - 9 July, 1993.Also in: Nonlinear Dynamics, 9:91-112, 1996, Kluwer Academic Publishers.

[29] IGES overview, http://www.tailormade.com/IgesOverview.htm

[30] The IGES 5.x Preservation Society, http://www.iges5x.org/

[31] NIST IGES pages, http://www.nist.gov/iges/

[32] Michael Tiller, Paul Bowles, Hilding Elmqvist, Dag Bruck, Sven Erik Mattsson,Anderas Moller, Hans Olsson, Martin Otter, Detailed Vehicle Powertrain Modelingin Modelica, Modelica 2000 Workshop, Lund, October, 2000.

[33] CATIA, www.catia.com

[34] 3D Systems,Stereo Lithography Interface Specification, 3D Systems, Inc., Va-lencia, CA 91355. Available via http://www.vr.clemson.edu/credo/rp.html.

[35] XML, Iformation on XML can be found at www.xml.org and www.xml.com

43