Guy on Simulink

Simulink & Model-Based Design

SimMechanics Second Generation 23

Posted by Guy Rouleau,

SimMechanics users, the first time you opened the Simulink Library Browser in R2012a, you probably noticed a big change: SimMechanics Second Generation

SimMechanics Second generation in Simulink Library Browser

SimMechanics Second Generation is a complete redesign of SimMechanics. Let's see what this means.

A new way of thinking: Frame Centered

In the First Generation, all rigid body coordinate systems are defined in the Body block, using a dialog. Coordinate systems can be defined relative to different frames, including both local and the global World frame.

Defining Coordinate systems in SimMechanics First Generation

In SimMechanics Second Generation, each coordinate frame is defined locally, using a Rigid Transform block:

Defining Coordinate systems in SimMechanics Second Generation

Notice that the lines in the diagram correspond to coordinate frames in your model. This makes reusing coordinate frames much easier – you just branch the line any time you want to connect something new to that frame.

Improved Joints

Let's look at the dialog of the Revolute Joint:

Revolute Joint Dialog

We can see that:

  • Standard Z axis: In SimMechanics Second Generation, the revolute joint has a standard convention for its degree of freedom that is always defined locally by the parts it connects. This local definition makes it easy to reuse mechanisms in other configurations. Other joints have similar standardized axes, following the standards used in robotics.

  • State Target Priority: When designing complex closed-loop mechanisms, it can be difficult to specify the initial condition of joints consistently. With the low priority, you can specify a value close to the desired configuration and SimMechanics will calculate the exact consistent initial condition for you.

  • Internal Mechanics: No more need to connect sensors and actuators to add stiffness and damping to your joints!

  • Integrated Sensors: No need for joint sensor blocks anymore.

Mechanics Explorer

Compared to the First Generation visualization, the Mechanics Explorer offers a lot advantages:

  • Speed: Negligible effect on the simulation speed. No more need to close the visualization to speed up your simulation.

  • Control Animation Speed: Many options to display the animation: as fast as possible, real-time, step-by step, etc.

  • Replay: Replay the animation without re-running the simulation... this can save a lot of time!

  • Multiple Views Simultaneously: You can view your system from multiple viewpoints at the same time.

  • Tree Browser: Easily navigate through complex models with a tree structure that matches your block diagram hierarchy

Here is what it looks like:

Mechanics Explorer

Interface to Simscape

SimMechanics Second Generation is built on the Simscape Engine. This means that you can directly connect Simscape components to SimMechanics joints, without going through Simulink signals.

I am not going into details here because I am planning a future post on this topic, but I think this is a significant advantage.


In need to warn you that some features from First Generation are not yet available in Second Generation.

Before converting your models to Second Generation, I recommend going through the documentation to verify it meets your needs.

Now it's your turn

Give SimMechanics Second Generation a try by opening some demonstration models, including sm_stewart_platform and sm_wing_landing gear.

You can also watch a video, such as Modeling an Engine, or download an example from MATLAB Central like Mini Golf.

Let us know what you think by leaving a comment here.

23 CommentsOldest to Newest

Pietro replied on : 1 of 23

Simmechanics second generation is great, but it misses an important feature to be very competitive as a multibody tool: the position actuator, that it was present in the first generation. Hopefully to have it in the next release.

qing replied on : 2 of 23

That’s true. Without position actuator I cannot evaluate even basic kinematic simulation with 2nd generation. This actuator doesn’t appear in 2012b again.

John Beard replied on : 3 of 23

I would like to use the SimMechanics, gen 2, for my class, but it doesn’t have a position actuator. When will that be available?

I am not able to say when motion actuation will be available in SimMechanics Second Generation. this is also a feature I miss.

All I can say is that we are working actively to provide motion actuation as soon as possible.

Pietro replied on : 5 of 23


I need to create a multibody model where I need to actuate few joints in terms of displacement, but simmechanics 2nd generation doesn’t allow it. Since simmechanics 1st generation allows it, is it possible to connect 1st gen block with 2nd gen ones?




Jakub replied on : 6 of 23


As a temporary workaround for a lack of position actuation one can implement simple high-gain tracking controller.


Jakub replied on : 7 of 23

Hi again,

Sorry for double post.
Feature I really miss in second generation is reaction forces sensing. Do you know if such functionality will be ever possible in second generation?


@Jakub: We are working very hard to provide motion actuation and reaction forces in SimMechanics Second Generation as soon as possible. I cannot guarantee in which release this will be available, but I will definitely publish a post on this blog when it is.

For now, you need to use the temporary workaround of implementing a controller to get the desired motion. This also applies to reaction forces.

Le Corre replied on : 9 of 23

Hello. I have a problem of visualization with Matlab 2013b. There is no graphics in the windows mechanics Explorer.
Can you help me ?
Thank you.

AAArthur replied on : 11 of 23


Thanks for the great work done in the second generation. It is very powerful. But I met some problems at the force sensing and friction application. Is there an alternative way I can sense the force and apply the friction effect?


DucAnh replied on : 12 of 23

hello every body, i have a question want to asked some people ,
when i connect Second Generation Block when i simulation ,but i can’t conect them,
i don’t understand why it is not connect, the picure when i simulation below:
if you know please help me!!! thanks for reading and help me.

DucAnh replied on : 13 of 23

you can see the red line i can’t connect beetwen the PS-Simulink Converter with (intergrator1 and Scope )

Melih replied on : 14 of 23

The design of the second generation is really better. But I wonder if there is any plan to add the time-varying mass and inertia feature.

Rodrigo Orellana replied on : 16 of 23

Excusame, i have a problem trying to understand the second generation, can you give me the link of a tutorial of it?, or may be you can give me an example that contains a motor, i don’t know how to introduce a motor in a simulation using the blocks of the second generation.

kasra replied on : 19 of 23

I love it. About those how have questions on ‘reaction forces sensing’ I should say that for example in translation domain by using force and velocity as an input and output out of a joint respectively, plus some sources and sensors available in simscape foundation library, you can easily make an interface and connect them to all actuators available in simscape library as you can see this method has been used frequently in Matlab Second Generation examples. with the name of ‘interface” blocks.

Nithin Xavier replied on : 20 of 23

how can i convert a model in first generation to second generation, is there any cinversion tool?

biswajit swain replied on : 21 of 23

I want to simulate gear joint in matlab simulink, which I have created in solidworks. I tried with both 1st generation and 2nd generation while exporting to simulink. But both the time its showing gear joint is not there , it is taken as welded joint
What should I do?

Rajesh Kumar replied on : 22 of 23

How to get force output from the cg of a body in simscape second gen, please help!!!!

Keerthi replied on : 23 of 23

Hi. I am modeling a system in simscrape multibody 2nd gen. the input data i have to model the parts is the co-ordinates but in simmechanics 2nd gen the bodies are modeled using fixed dimensions.. what is the best way to convert these co-ordinates to fixed dimensions. and model it in Simmechanics 2nd Gen. its really important pls someone reply for this quesiton and give me a solution

Add A Comment

What is 1 + 4?

Preview: hide