Search code examples
matlabphysicssimulinkmodelingsimscape

Modelling a closed kinematic chain in simscape


I am trying to model a close kinematic chain in simulink. However the model fails to be created and i get the following error:

*** Model not assembled: position violation ***

I am looking for any suggestions to get it working.

Current modelling

I have the following link structure:

  • MH
    • link11
      • link21
    • link12
      • link22

All the above joints are revolute joints (MH-link11,MH-link12,link11-link21,link12-link22).

I want to connect link21 and link22. I have found the exact intersection point and even used a transform sensor to compensate small errors (order of magnitude 1e-5). So the frames i want to attach match exactly.

The transform sensor gives me the following translation: [x,y,z] = [3.2594e-10,1.2520e-10,3.3367e-11]

and the following axis and angle: axis: -z , angle = 67.329 (degrees).

The transform sensor measurement frame is the Base frame, and the sensor is in the following figure:

Transform sensor

Closing the chain

So i add a revolute joint with a state target of -67.329 degrees and low priority, seen below. enter image description here

From the mechanics explorer tab, i see the base and follower frames of the revolute joint match the joint21_EE (B) and joint22_EE (F) frames exactly.

What i tried

  1. I followed this example: https://ch.mathworks.com/help/sm/ug/model-four-bar.html which says the following:

In the Base-Crank Revolute Joint block dialog box, expand State Targets and select Specify Position Target.

Specify the Value parameter as -30 deg.

For the Coupler-Rocker Revolute Joint block, in the Z Revolute Primitive (Rz) > State Targets section, select the Specify Position Target parameter, and specify the Value parameter as 0 deg and Priority parameter as Low (approximate).

On the Modeling tab of the Simulink® Toolstrip, click Update Model. Mechanics Explorer opens with a static display of the four-bar linkage in its initial configuration. The image shows the isometric view of the four-bar linkage.

  1. Adding state targets (with high priority) to all joints. Then i get the error:

Targets or motion inputs are specified for every joint around a kinematic loop:

  1. Adding state targets to only one joint. Then i get the error:

High priority position target +0 (deg) not achieved; actual value: -0.000717909 (deg) You can configure this diagnostic in the Simscape Multibody Configuration Parameters dialog.

  1. Having no state target. Then i get the initial error.

Extra info

  • I use matlab R2022b

Solution

  • So, after a while, i found the root of the problem.

    In the mathworks example, the close chain can move in 2D. So, by trying to close the chain, the error was only in the relative angle. and thus a low priority angle was sufficient. One can see that the angle error was quite large 103 degrees:

    Angle error in example

    In my example, the kinematic chain can move in 3D, and thus kinematic loop errors are in [x,y,z] and [Rx,Ry,Rz]. So, to close the chain, i need a bushing joint, to add position targets for all directions/orientations apart Rz, to let it rotate.

    Bushing joint