General Information
The command Generate from Kinematic enable you to generate a Modelica behavior (model) of a selected mechanism of a physical product. The Modelica code is automatically generated, and can then be simulated as-is, or further extended with other Modelica components.
Instead of the command you can also use an Engineering Knowledge Language (EKL) scripting method to generate the Modelica behavior.
Data converted from the mechanism are (details below):
- Parts, including mass and inertia, and optionally VRML 3D representations. Note: VRML 3D representations can only be handled by the command, not the EKL scripting method.
- Supported mechanical joints.
- Mechanism commands, including mechanical motors attached to such commands.
- Published axis system, when publication is directly under the same product as the mechanism.
- Acceleration of gravity.
Other data is not used for model generation.
Overview of Generated Modelica Representation
As a result of the Modelica model generation, a number of classes are created under the selected target package:
- A locked base class containing the generated model. This class is inserted in the class InternalGenerated.
- An extended class from the generated model class, where you can add your modifications, for example, extend the model or replace components.
Structure of the Generated Model
The selected mechanism includes mechanical constraints, from which the parts are retrieved. The components in the generated Modelica representation are corresponding to sets of identified parts. Parts included in the root product but not involved in the mechanism are ignored.
In the generated model, all components are replaceable, except the "world" component. This component is by default added if the initial physical model does not contain any published axes. However, if you generate the Modelica model using the command, you can select to always generate a "world" component and have it connected to the fixed parts, even if the physical model contains published axes.
Naming Rules
The name of the components (bodies, joints) is generated from the instance name in the physical product model. The description of the components is the occurrence path from the physical product model. To comply to Modelica name rules, special characters in names are replaced, and prefixes may be included to ensure unique entities.
Supported Mechanical Joints
The supported mechanical joints are those corresponding to classes in the CATIAMultiBody library. User-defined joints are also supported, if they are equivalent to the standard CATIA joints. Joints that have no corresponding classes are ignored when translating the mechanism model.
Generated Diagram Layer and 3D Representation
The diagram layer is generated from the topology of the mechanism. The 3D body components have picture representation from 3D screen shots of the 3D shapes.
Optionally, when generating the Modelica representation with a command, the generated model can include a 3D representation of the shape, in VRML format as resource of the generated model. In this mode, the VRML visualization is used for animation instead of the physical model itself. This can be useful if you want to export the model to another tool, for example, Dymola.
If you select not to generate a VRML representation, the generated model includes links to the initial 3D physical model, so it can be animated from the results.
The pictures are stored as resources of the generated Modelica model.
Generated Icon Layer
The icon layer of the generated Modelica model has a different extent value from the diagram layer. Also, a screen shot of the physical product containing the originating mechanism is used for the image of the icon layer.
Model Documentation
The generated base model includes an annotation with some information about the origin model. That information is available from the documentation editor.
Handling of Mechanism Commands and Attached Motors
The commands of the mechanism are the driven DOF (degrees of freedom) of the joints of the mechanism. In the generated Modelica representation, the joints with driven DOF are converted into joints with visible flanges.
For each command of the mechanism, a corresponding flange connector is created in the generated model. That flange connector is internally connected to the flange of the joint. These connectors are intended to be driven by force or torque inputs. To drive a connector by position, you must, depending on the type of joint, specify the rotationControl or translationControl parameter of the corresponding joint to By position. (The default value is By force.) In the generated model, a small ruler is present on the icon of the joint if it is driven by position.
In the diagram and icon layer, the flange connectors corresponding to mechanism commands are located at the bottom of the diagram layer and icon layer. They are equally distributed along the width of the model.
For joints that are not controlled at all, that is, they are not connected to any command in the mechanism, the rotationControl or translationControl parameter (depending on the type of joint) is specified to None. This means that no corresponding flange connector is created in the generated model.
If mechanical motors are attached to commands, these motors can optionally be included in the generated Modelica code. If you select to include mechanical motors, motors instead of simple connectors are instantiated from the CATIAMultiBody library in the generated code to implement such motors in Modelica. These motors use the same equations as the motors in the Physical mechanism.
Driven Point-Curve Joints
A generated Point-Curve joint by default contains a translational flange that you can use to drive the joint.
To drive the Point-Curve joint, you can use any kind of Modelica translational source, for example:
- Modelica.Mechanics.Translational.Sources.Position
- Modelica.Mechanics.Translational.Sources.Speed
- Modelica.Mechanics.Translational.Sources.Force
To use the position source, you must specify the translationControl parameter of the corresponding Point-Curve joint to By position. (The default value is By force.) In the generated model, a small ruler is present on the icon of the joint if it is driven by position.
To avoid conflicts with the initial position of the Point-Curve, you must:
- Set the parameter fixedStartValues to false
- Make sure that the initial value of the input for the translational source matches the initial value of the Point-Curve joint. The initial value can be retrieved from the physical mechanism or from the parameter s_lenght_start of the generated Point-Curve joint.
Limiters on Joints
For revolute, prismatic, and cylindrical joints you can select how the limiters for these joints are handled when generating the Modelica model. You can also fine-tune the kind of limiters you want ("limiterType") and the limits to apply.
When translating the model, you can select between three alternatives how to handle the limiters:
- Warning: When the joint reaches the limit value, a warning appears and the simulation continues.
- Error: When the joint reaches the limit value, an error appears and the simulation stops.
- Limiter: A Modelica limiter is inserted between the flanges of the Modelica joint, limiting the joint´s movements between the defined limits.
- The values for the minimum and maximum limits are taken from the physical mechanism, when possible. If no limit is defined, the behavior of the joint is not impacted.
- If you want to redeclare the limiter, you should use any of the
following depending on which limiter you redeclare:
CATIAMultiBody.Interfaces.PartialRotationalLimiter
CATIAMultiBody.Interfaces.PartialPrismaticLimiter
To fine-tune the kind of limiters you want ("limiterType") and the limits to apply, the revolute, prismatic, and cylindrical Modelica joints you can use, in the parameter dialog, the tab Limiters that contain a number of parameters to do this.
Handling of Dress-Up Pattern
When parsing the physical model, a simplification of the diagram is done when a dress-up pattern is detected. This pattern corresponds to a wireframe part that is connected to an isolated 3D shape with a rigid connection. The simplification consists in replacing the wireframe components in the diagram with the detected 3D shape component. As a result, the diagram of the generated model is more compact and it is easier to replace body components (to have flexible bodies for example).
Handling of Published Axis
In the case of the physical model contains publication of axes (or a publication of a publication of axes; no limit on the number of intermediate publications), directly under the product that contains the selected mechanism; then:
- The generated model does by default not contain any World model. However, if you generate the Modelica model using the command, you can select to generate a World model and have it connected to the fixed parts even if the physical model contains publication of axes.
- The generated model includes some frames corresponding to the published axis systems.
In the diagram and icon layer, the connectors corresponding to the published axis systems are located at the top edge of the diagram/icon.
Handling of Knowledgeware Parameters
If the physical model contains any publications of Knowledgeware parameters directly under the product that contains the selected mechanism, then the corresponding Modelica parameters are created in the generated model. Those Modelica parameters are exposed in Knowledgeware, and a formula is created to assign the same value as the value of the published parameter.
Important: To keep the link between Knowledgeware parameters in the physical model and the Modelica parameters, select Keep link with selected object from . For more information, see Native Apps Preferences Guide: 3D Shape Infrastructure. |
Dynamic Features from the Physical Model
Acceleration of Gravity
The gravity data from the physical model is transformed into the Modelica World component created in the generated Modelica representation. It is mainly the value of gravity acceleration.
Force Elements
Supported force elements in the physical model are included in the generated Modelica representation. For the force element from the physical model, the corresponding components are created in the generated Modelica representation, and connected to the joint component.
Native Force Elements
The following predefined force elements are supported, both linear and non-linear:
- Springs
- Dampers
- Bushings
For adding springs and dampers, see Mechanical Systems Design User´s Guide: Defining Mechanisms: Adding an Axial Spring. For adding bushings, see Mechanical Systems Design User´s Guide: Defining Mechanisms: Adding a Bushing.
Modelica Force Elements
Supported Modelica force elements can be used when building the kinematic model. They are included in the generated Modelica representation of the kinematic model.
Supported force elements must contain a connector frame_a and a connector frame_b.
Working with Force Elements
It is possible define force elements in the Dymola Behavior Modeling app that can be used and parametrized directly in the Mechanical Systems Design app. To expose the force elements, they can be added in a Classes for Force Elements browser. They are then automatically exposed to the Mechanical Systems Design app and can in this app be used from the Force Element tab of the Engineering Connection Definition dialog box when you engineer connections. You can parametrize the force elements from this tab as well.
One way of working is that an engineer with Modelica knowledge prepares the required force elements in the Dymola Behavior Modeling app and adds them to the Classes for Force Elements browser. An engineer working with the mechanical model uses these force elements, and parametrize them according to the physical model.
- The predefined force elements are by default displayed in the Classes for Force Elements browser.
- There might be limitations in the physical model what force elements can be used.
For using the Classes for Force Elements browser, see Add a Class to the Classes for Forced Elements Browser.
For use in the Mechanical Systems Design app, see Mechanical Systems Design User´s Guide.
Customization of the Orientation of the Part Frame Connectors
By default, the axis system of the frames of the part components in the generated Modelica model corresponds to the local axis system of the corresponding physical product.
To specify the customized axis system for the frame of that part component, a publication
named ModelicaAxisSystem
must be created in the reference of
the corresponding product.
Customization of Color Animation of Physical 3D Parts
In the class CATIAMultiBody.Parts.BodyShapeWithFrame
, you can specify the
parameter UseModelicaColor
to true to display input connectors
for color handling. The default value of the parameter is false. One Boolean
input connector is used to switch the color animation on or off, while an array
connector of four Reals is used to specify the color of the shape with RGBT
coding (red, green, blue, transparency). The Real values must be in the range of
0–255 .
Handling Replaceable Components
The generated Modelica components are all replaceable. You can replace a component with a more specialized version, for example, replacing a rigid body with a flexible body.
To do so, you must create a dedicated Modelica class extending
CATIAMultiBody.Interfaces.PartialArrayofFrames
. The
frame_a
array can then be connected to the relevant
internal geometry of the specialized class.
Tip: If you replace a joint of another type with a cut joint, you must also recompute the cut joint configuration. This may also be required in other cases. See Recomputing the Cut Joint Configuration. |
If you specify the hidePhysicalPart
parameter to true, the corresponding 3D
physical shape is hidden when the 3D animation is displayed.
Links and Relations from the Kinematic Model to Its Modelica Representation
You can see the relationships between the generated Modelica representation and the original Kinematic model using the command Links and Relations from the Dymola Behavior Modeling app. For more information about this command, see Mechanical Systems Design User´s Guide: Links and Relations.
Updating a Modelica Model Corresponding to a Modified Mechanism
When the physical data involved in a mechanism generating a Modelica model is modified, you can update the corresponding generated model using any of the following commands:
- The model generation command Generate from Kinematic
- The dedicated update command Update Current Model from Physical Model
- Any of the generic PLM update commands Update
or
Update Assistant
Note: There are conditions for using any generic PLM update command.
Retrieving the Kinematic Model from the Generated Modelica Model
You can retrieve the physical model from the generated Modelica model. For more information, see Retrieving the Kinematic Mechanism, the 3D Piping Model, or the 3D HVAC Model.
Detecting and Handling Physical Clashes
You can detect and handle clashes in simulations of Modelica models generated from physical mechanisms. If a clash occurs, clashing objects are highlighted, and the simulation can be stopped. For more information, see Detecting and Handling Physical Clashes.