You are on page 1of 11

2.

Motion Analysis - Sim-Mechanics

Figure 1 - The RR manipulator frames

The following table tabulates the summary of different types of analysis that is performed for
the RR manipulator introduced in the theory section.
DOF
Input , ,
Input , ,
Output , ,
Output

Forward
Kinematics
known

Inverse
Kinematics

Inverse
Dynamics

unknown

unknown

unknown

known

known

unknown

Forward
Dynamics
Unknown
Accelerations,
Others known as
initial conditions
known

unknown

unknown

, ,

Internal forces

This tutorial will cover how to model a mechanism in Sim-mechanics and how to configure the
model for the different types of analysis given above.

For this exercise the COG are placed at the middle of each link, and each link is assumed to be a
cylinder with radius 10mm. The parameters of the mechanism are given below:
Link 1: = 300
,
= 0.5
Link 2: = 500
,
=1
The moment of inertia of a cylinder with height h, radius R, and mass M, with axis aligned at the
middle of the cylinder is given by the following equation.

2.1 Modelling the mechanism

Open a new sim mechanics model by selecting new> simulink model in the Matlab
home tab. Save the model with the name manipulator_example.

Select the simulink library browser button

Navigate to Simscape>SimMechanics> Second generation to find the blocks used to


model the mechanism. First let`s model the first link of the manipulator.

Figure 2

The configuration block is used to specify gravity. The transform block is used to apply a
fixed transformation between a base and a follower frame. Therefore, the lines in a sim
mechanics model relates to a frame in the mechanism.
Revolute joints in sim mechanics always apply rotation about the z axis of the base
frame. Therefore, you have to introduce an initial rotation to align the z axis of the base
frame, such that its coming out of the screen.
The solid block is used to attach a mass to a rigid body.

Implement the set of blocks shown in the figure 2. Use the following parameters for the
blocks

Block
Transform 1
Transform 2
Transform 3

Base frame

Follower frame

WA
1A
1B

WB
1B
1C

Rotation

Y,90
0
0

Translation (mm)

[0,0,0]
[150,0,0]
[150,0,0]

Solid
Solid

Center of
Gravity (mm)

[0,0,0]

Mass (kg)

0.5

Moment of Inertia
(kg mm^2)

[25, 3762.5, 3762.5]

Product of Inertia
(kg mm^2)

[0, 0, 0]

You should be able to figure out the parameters from the sketch of the mechanism given in
figure 1. The moment of inertia values were found by assuming that the link is a cylinder. To
give visual properties for the link, open the geometry block and select brick under geometry
and specify the parameters [300 20 20]mm.

Set gravity to [0 0 -9.81] in the configuration block


and press run. A mechanics
explorer will open up. Select view> show frames and show COMs. Click the front view
button to see the mechanism. You can select view>background color to change the
background. The link should perform a free vibration (non-decaying swinging).

Lets add some damping to the link. Open Revolute joint 1 and under internal
mechanics> damping coefficient enter 0.01 m*s*N/rad. The link should now perform a
damped free vibration (decaying swinging).

Complete the model as shown in figure. .Use the parameters given in the table. The
planar joint is used to close the loop. But it does not constraint frame {2C} in this planar
mechanism.

Block
Transform 1
Transform 2
Transform 3
Transform 4
Transform 5
Solid
Solid 1
Solid 2

Base frame

Follower frame

WA
1A
1B
2A
2B

WB
1B
1C
2B
2C

Center of
Gravity(mm)

[0,0,0]
[0,0,0]

Rotation

Y,90
Z,0
Z,0
Z,0
Z,0

Mass (kg)

0.5
1

Moment of Inertia
(kg mm^2)

Translation (mm)

[0,0,0]
[150,0,0]
[150,0,0]
[300,0,0]
[300,0,0]
Product of Inertia
(kg mm^2)

[25, 3762.5, 3762.5] [0,0,0]


[50, 20858, 20858] [0,0,0]

Add link geometry and joint damping to link 2 and run the model.

2.2 Initializing the mechanism


The state target tab in the joint block allows to specify the initial condition of each joint. The
state target should be specified as a high priority (exact) or low priority(approximate) value.
Let's try to initialize the mechanism as shown.
Configuration 1:

= 30,

= 30

Open each joint block and specify the following state targets.

DOF
Revolute 1
Revolute 2
Planar 1 x
Planar 1 y

Position State target


value

30
30

Priority
setting

Initialized value

High
High
disabled
disabled

0.509 m
0.583 m

The initialized value is found by clicking tools>model report in the mechanics explorer
Configuration 1:

= 0.5 ,

= 0.5 ,

> 45

There are two solutions for x,y= 0.5m. Let`s say you want to initialize as given in figure 3.
For this, the
value can be set approximately. Open each joint block and specify the
following state targets.

DOF
Revolute 1
Revolute 2
Planar 1 x
Planar 1 y

Position State
target
value

Priority
setting

50

Low
Disabled

0.5
0.5

Initialized value

81.73
-57.76

High
High

Figure 3

Notice that sim mechanics will give an error if you try to specify revolute 2 as well. In sim
mechanics you cannot specify state targets to all the joints around a loop.

2.3. Performing different types of analysis

To do a forward dynamics study first go to file>save as and save the model with the
filename manipulator_example_FD.
Open the revolute joints. under actuation torque select provided by input. Attach a sine
wave as the torque signal with 0.01 amplitude. You must use a simulink to physical
signal converter block.

Give a torque of 0 to joint 2. run the model to see results. select file>save.

For a forward kinematic study, first go to. file>save as and save the model with the
filename manipulator_example_FK.
Disable all initialization of joints. Since we are specifying all input kinematic variables
which fully define the configuration, there is no need of specifying initialization.
Open the two revolute joints and under actuation select provided by input for motion
and automatically computed for torque for both revolute joints.
Add sine signals as input motion with an amplitude of 1rad for both. You need to tell
sim mechanics to automatically compute the velocity and acceleration of the input
position signals. Open the simulink to physical signal converter blocks and under the
input handling tab select filter inputs in the first drop down, and select second order
filtering in the second drop down.
Run the model to see results. select file>save.

The forward kinematic setup is good to verify trajectory plans where we can validate
that a given motion profile to the joints would generate desired results. ex: tool path
simulation.
The forward dynamic setup is good to verify controllers where we can validate different
controllers to see the response.
The following table summarizes the settings used for the two analysis.
"

DOF
Motion
Torque
Motion
Torque
Motion
Torque
Motion
Torque

Revolute 1
Revolute 2
Planar 1 x
Planar 1 y

Forward
Kinematics
Input
computed
Input
computed
computed
none
computed
none

Forward
Dynamics
computed
Input
computed
Input
computed
none
computed
none

Inverse studies

Similarly for the inverse studies the settings for each joint can be summarized as follows:

DOF
Revolute 1

Motion
Torque

Inverse
Kinematics
computed
computed

Inverse
Dynamics
computed
computed

Revolute 2
Planar 1 x
Planar 1 y

Motion
Torque
Motion
Torque
Motion
Torque

computed
computed
Input
none
Input
none

computed
computed
Input
none
Input
none

Both looks identical, The only difference is that in inverse kinematics we are looking for the
motion of the revolute joints for the given output motion. And in the inverse dynamics study
we are looking for the torques of the revolute joints. So it`s a difference in where we connect
the scopes.

Sim mechanics has the following rule:


Each kinematic loop must contain at least one joint that has no motion from input and no
automatically computed forces or torques among its primitives.

So setting up the the joints as in table would give an error. We create a dummy joint to satisfy
the condition.
first go to file>save as and save the model with the filename manipulator_example_IK.
Add a weld joint between the prismatic joint and frame {WB}.
.
Apply sine motion inputs to both the axis of the planar joints with 0.05 amplitude and
0.5 bias. In S-PS blocks make sure you have enabled input filtering.
For the inverse kinematic study open the revolute joints and under the sensing tab
enable position.
Connect a scope using a PS-S converter block.
Since the inverse position has two solutions we can use a low priority state target to
specify the desired configuration. Open Revolute join 1 and specify a low priority state
target position of 50 degrees.

Run the model to see the results. You can use the configuration button of the scope to
adjust display style of the scope. And use zoom buttons to adjust axis limits. select
file>save.
.

The inverse kinematic setup is good to generate a reference trajectory for a given
desired output motion. So this is crucial for motion planning of automated machines.

Go to file>save as and save the model with the filename manipulator_example_ID.

Settings for an inverse dynamic study is same as the inverse kinematic study. The only
difference is that you will enable actuator torque sensing under the sensing tab of each
revolute joint.
Enable velocity sensing of each revolute joint as well.
Use a product block to calculate the power requirement of each actuator.

The inverse dynamic setup is good for sizing of actuators for a design. It allows to calculate
the power requirement. The torque speed operating regions for an actuator can also be
found so you can design suitable power transmission for the actuators to operate in the
region identified by the study. select file>save.

You might also like