Search code examples
matlabmodelingsimscape

matlab - simscape begins simulation outside of joint limits


I am trying to model a closed kinematic chain in simulink, and i get problems with having meaningful initialization. Matlab ignores the joint limits for some joints.

What i have done:

I imported a urdf (which it self doesn't close the chain) and added a bushing joint to close the chain at the required point). There are 5 links, but only three of them are independent (and actuated), thus i have set a position target to those with high priority (to set the desired initial conditions). In the bushing joint, in all the DOFs i want to constraint i have set a position target to zero with low priority.

Thus, the 2 unactuated joints do not have a specified position target and are passive joints.

Problem

When i launch the simulation at specified initial conditions, matlab ignores the limits of the unactuated joint to close the chain, even though there is a solution. See below: (1.22 rad ~= 70 deg)

enter image description here

And i get this initialization while there is the one i skethed: enter image description here


Solution

  • Simscape does not satisfy all joint limits by default in model assembly as it seems. However, i could bias simscape to select the desired configuration when i put a position target with low priority for (Ry) in the bushing joint. The acceptable angles were positive in my case, so i put 45degrees as the position target and it works. enter image description here

    More info for guiding an assembly here: https://www.mathworks.com/help/sm/ug/assembling-multibody-systems.html#busaiy6-1

    PS. Also in my case, it turned out i could simulate the system with a planar joint.