Using equation-based laws in CATIA Kinematics

December 18, 2018 Iouri Apanovitch

By Iouri Apanovitch

 

This is a follow-up to my previous post “Using sketch-based laws in CATIA Kinematics.”

Just to refresh your memory what this is all about…

CATIA Law features can be used to link all commands in the mechanism to a single parameter – time. This enables the mechanism’s motion to be simulated by manipulating the time parameter alone, so multiple commands are varied simultaneously and, in a user-defined way. Also, this enables calculation of time-dependent quantities in the mechanism, such as velocities and accelerations.

There are two types of Laws in CATIA – sketched-based and equation-based. The sketch-based laws (explained in my above-mentioned post) require definition of the motion profile as a sketch, which works well in many cases. But – sketch-based laws have their limitations.

Consider this task: How do I simulate motion of a pendulum? From physics, we know that motion of the pendulum follows the sine-wave law, but – there’s no tool in the Sketcher workbench to draw a sine-wave!

In this post, I’ll explain how to use equation-based laws to work around such limitations.

The sample model is shown below. The model consists of the axis part and the pendulum part. The axis part is fixed, and the pendulum is linked with the axis with a Revolute joint, Angle-commanded. The goal is to simulate motion of the pendulum according to the sine-wave law, with 30-degree swing amplitude.

Fig1

First, we need to write down the motion equation. The swing angle during the pendulum’s motion is described by the following equation:

Equation-1

Where A is the swing amplitude, t  is time, ω is cyclical frequency in radians per second, f  is frequency in cycles per second (Hertz), and φ is phase in radians.

For instance, if pendulum completes one full swing forth and back in 1 second, then frequency f =1Hz. Assuming the maximum swing 30deg and the start of the motion at the leftmost swing position, the motion equation becomes:

Equation-2

Now we need to create the Law feature. Click the Icon1 (Law) icon in the Knowledge toolbar to display the Law Editor dialog box. The right-hand side allows you to create formal parameters to be used in the law (“formal” in the sense that these are not actual parameters in a CATIA model, rather, they serve as the “input” and the “output” parameters in the law definition), the left-hand side is the law edition box.

Fig2

Now we need to figure out the types of the formal parameters we need. In the Dictionary section, scroll down to the Law chapter and examine the function Evaluate – this is the function we will later use to link the angle command in the mechanism with the Law.

Fig3

Note that the function requires input parameter of type Real and produces output value of type Real too. Therefore, using the New parameter of type button, create two parameters of type Real, and rename them as y and t.

Fig4

Now, in the law edition section, type the following equation (the function sin can be found in chapter Math and the constant PI in chapter Constant in the Dictionary section):

y = 30*sin(2*PI*t*1rad – PI/2*1rad)

Fig5

Note the use of units in the law code – this is quite important! If no units are specified, CATIA will interpret the values in international SI system of units. Click OK to complete the law definition.

Next, we need to link the command in the mechanism to the law. Double-click Command.1 in the tree, right-click in the Command value field, and select Edit formula in the contextual menu.

Fig6

 

In the Formula Editor, type the following formula:

 

Fig7

Fig8

Close the Formula Editor. Note that the Command value is now controlled by the formula, and its start value is -30deg, which is the leftmost swing position of the pendulum. Click OK to close the Command Edition box.

Fig9

 

We’re done! Now select the Icon2  (Simulation with Laws) tool, select Maximum time bound and Number of steps, and run the simulation.

Fig10

 

The use of laws in Kinematics is covered in the Rand 3D DMU Kinematics Classwww.Rand3D.com

 

About the Author

Iouri Apanovitch

Senior Technical Training Engineer<br><br>As a senior member of the Rand 3D team with a doctorate degree in Finite Element Analysis (FEA) and over 35 years of experience, Iouri provides design, consulting, and training services to those in the aerospace, automotive, electronics, and consumer goods industries. Iouri is a seasoned pro in 3D parametric design and prototyping using knowledge-based engineering methods, and has worked on a wide range of projects including BOM automation, CMM points generation, automated 3D annotation creation, and die tooling automation design. He is also a sought-after instructor and holds the designations of both CATIA Certified Professional (Expert level) and CATIA Certified Instructor.

Follow on Linkedin Visit Website More Content by Iouri Apanovitch
Previous Article
Displaying Bend Radius on Drawings in CATIA V5
Displaying Bend Radius on Drawings in CATIA V5

By Scott Henderson The Generative Sheetmetal Design workbench is an excellent tool to create bendable, fold...

Next Article
Using sketch-based laws in CATIA Kinematics
Using sketch-based laws in CATIA Kinematics

By Iouri Apanovitch If more than one command exists in a CATIA Kinematics mechanism, the commands are not l...