# Motion Actuation in SimMechanics R2013b 19

Posted by **Guy Rouleau**,

In R2013b, it is possible to specify joint motion in SimMechanics Second Generation models. In this post, I will use a simple pendulum with internal friction and subject to gravity to highlight different ways to actuate a mechanism.

If you look at the dialog of a joint like the Revolute Joint, you will notice that each primitive now has two fields in the *Actuation* section: **Torque** and **Motion**.

The **Torque** field gives you 3 options: **None**, **Provided by Input** and **Automatically Computed**.

The **Motion** field two: **Provided by Input** and **Automatically Computed**.

This makes a total of 6 possible configurations for each joint primitive. In the Joint Actuation documentation page, you can find a description of all the modes into which a joint primitive can be actuated.

**Passive: No torque and Automatically Computed Motion**

This is the default setting, where the joint primitive is passive. For our example, the pendulum will simply fall under the effect of gravity.

**Forward Dynamics: Torque Specified by Input and Automatically Computed Motion**

A force or torque is specified for the joint primitive and the engine computes the resulting motion. For example, if we take the same pendulum as in the previous case and apply a constant torque, it will stabilize at an angle.

**Inverse Dynamics: Motion specified by Input and Automatically Computed Torque**

If you know how a joint should move and want to know the amount of torque or force necessary to make that happen, this mode is for you. For example, we can apply a sine wave motion to our pendulum and measure the torque required to generate this motion:

One important thing to note is that when specifying motion to a joint primitive, position, velocity and acceleration must be specified. To help with that, the Simulink-PS Converter gives the possibility to filter the desired motion and internally compute the first and second derivative of the input signal.

****Note: By default, the time constant in the Simulink-PS Converter block is 1e-3s. This value is appropriate for most Simscape domains, but for many SimMechanics models increasing it to 1e-2s can speed up the simulation without affecting the results significantly.*

If filtering is not appropriate for your application, you can always turn it off and manually provide position, velocity and acceleration to the Simulink-PS Converter.

**Indirect Inverse Dynamics**

This mode was not available in SimMechanics First Generation, and I decided to invent the expression *indirect inverse Dynamics* to describe it. As it is the case for *Inverse Dynamics*, the user specifies the motion of the mechanism. However the term *Indirect* means that SimMechanics automatically computes and applies the Forces and/or Torques necessary to produce the motion using joint primitives other than the ones where the motion is specified.

If we keep going with the same example, we can use the y-axis translational primitive of a Planar Joint to specify the translational motion of the pendulum extremity. SimMechanics can then compute the torque necessary at the pendulum base to generate this motion.

****Note that I included a Weld Joint in the previous model. In R2013b, SimMechanics Second Generation has a constraint that every kinematic loop must contain at least one joint with no motion actuation and no computed torque.*

**Indirect Inverse Dynamics... plus external forces**

The last combination available is an extension of the previous. In addition to specifying the motion, it is possible to add an additional disturbance force or torque.

**Now it's your turn**

Try the new motion actuation in SimMechanics R2013b and let us know what you think by leaving a comment here.

**Category:**- Physical Modeling,
- What's new?

## 19 CommentsOldest to Newest

**1**of 19

Dear Guy Rouleau,

First problem

I want apply motion to revolution joint that include angular, angular velocity, angular acceleration. It easy with 1st generation so I can not do this with second generation. In second generation, it only accept input angular and it calculation angular velocity, angular acceleration by itself. So the results do not same with mine.

So, how to I input angular, angular velocity, angular acceleration to revolution joint in second generation?

Second

I want to apply force on the point of body, this position of point change according to time. How can I import the position of that point?

**2**of 19

To specify position, velocity and acceleration, you can open the dialog for the S->PS block. In the “Input Handling” tab, select “Provide Input Derivatives” and “Provide First and Second Derivative”. That way, the S-> PS block will have 3 ports for your 3 signals.

**3**of 19

Great !

Thank you very much, Guy Rouleau!

**4**of 19

Dear Guy Rouleau,

I have problem with set up the initial angle of revolution. When I change the “value” of “specify position” in “State Target”, it not change anything with the same input angle data. How can I set up the initial angle of revolution? And the initial angle was calculated by what are frames between?

Thank you in advanced!

**5**of 19

My model is imported from Creo 2.0

**6**of 19

Hi Guy Rouleau,

Is there any way to input external motion, similar to the “Indirect Inverse Dynamics… plus external forces” section, but with motion instead of forces? I am trying to leave a joint to automatically compute its state for most of the simulation, but at a few (triggered) instants, I want to have direct control over the angular velocity of the joint (instead of messing around with forces and torques). What’s the best way to do this?

Thanks!

**7**of 19

Hi Guy Rouleau,

Thanks for the great work done and the detailed example and explanation!

I have a question that since it was mentioned of “internal friction” in the description. However, it was not elaborated in the description. Could you give some suggestions on the realization of the friction?

Thank you in advance!!!

**8**of 19

hello,

Can you help me with the following problem?

I have a platform which is connected to the ground using a spherical (S), a prismatic (P) and a rotary (R) joints. There are 3 such legs as shown in the attached image

<>

attached. Only the P joints are actuated. Also I know the position of the P joints at every instant of time. For eg: at time t1, P1=1m, p2=1.2m and P3=1.5m etc. The idea is to move and orient the top platform according to some predefined path by varying the length of the P joins. How can I provide inputs to P joints in Simmechanics to achieve this? I have prepared a CAD model in SolidWorks and using it made a Simmechanics model also.

<>

**9**of 19

Hello Guy Rouleau

My system consists of a motorized arm which opens a shutter. My problem: I don’t know how to impose to it an initial position of the beginning of movement. At present it starts from inside of the wall …

If you have a solution I would be most grateful to you for this.

Thank you for all.

Franck

**10**of 19

In fact I did it directly in Autodesk Inventor. It’s more simple.

Thanks for your work.

Franck

**11**of 19

Hello i don’t know that how can i combine 2 part and how did you make this bodies?

**12**of 19

Hi

I generated a SimMechanics model from the model inventor of a real manipulator arm. I would like to add torque at the actuations, how proceed?

**13**of 19

I would like to input angular velocity to revolute joint. But when i select provide 1st derivative of S-PS block it gives me error.Kindly i will be really very happy if you post certain example in which angular velocity is taken as input

**14**of 19

Hi,

What is the unit of the torque of the revolute joints input and output? Is it always Newton.meter or what?

Thank you.

Unver

**15**of 19

Hi Unver. The units are specified in the S->PS and PS->S blocks. you can select any unit of torque: N*m, Lbf*feet, etc.

**16**of 19

Great Presentation,

Though for future reference can you make the gifs be able to be paused…?

i had an epileptic seizure reading this.

but great help thanks !

**17**of 19

Hi Guy Rouleau

I have problem with motion actuation in first generation(in joint actuator),I want to apply angle,angular velocity and angular acceleration,I have angle’s data and for angular velocity and angular acceleration i use derivative block but my simulation has wrong motion.If you have a solution I would be most grateful to you for this.

**18**of 19

@sfr: See this older post for SimMechanics first generation:

http://blogs.mathworks.com/simulink/2012/02/01/applying-motion-to-simmechanics-models

**19**of 19

Thank you. It’s very helpful post. I had hardship to solve the issue to set joint as motion actuation.

## Recent Comments