How can I create a custom joint or constraint in SimMechanics?

5 views (last 30 days)
Hello,
I have a SimMechanics model where I'd like to include a weld joint (or, alternatively, a 3D translational+rotational constraint) that could be deactivated after a certain simulation time.
I've tried to create such a component using Simscape language, but with no success since I couldn't interface it with the SimMechanics body coordinate connector port.
Does anyone know if it's possible to create this interface? Alternatively, how can we access the source code of the weld joint and start from there? Or is there another way of achieving my objective?
Thank you so much!

Answers (1)

Abe
Abe on 30 Sep 2014
Hello Pedro. Objects of different domains (SimMechanics vs Simscape) cannot be connected. Same idea with (SimEletronics vs SimPowersystems vs SimFoundation vs etc). What you can do is use a Simscape->PS block or PS->Simscape block to to send signals to force actuator inputs within the SimMechanics environment. For instance, you can tell it to apply a force for up to six seconds after which you make the force step down to a value of zero.
As you have found joints within the SimMechanics environments, you should be able to double-click the joint and tell it you want to add a force actuator and/or force sensor if I recall.
Maybe this will help you get to the next step. Cheers.
  1 Comment
Pedro Simplicio
Pedro Simplicio on 1 Oct 2014
Thank you so much for your reply, Abe. That's indeed the workaround approach I'm employing right now, although it's not very robust because of the stiffness of the solution. The possibility of interfacing Simscape code with SimMechanics 3D connectors would clearly introduce a nice degree of modelling flexibility here.

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!