MATLAB: How to limit angle rotation in Multibody 1G ? [URGENT!]

constraintfirst generationjoint angle rotationlimitMATLAB and Simulink Student Suitemultibody 1gr2016bSimscape Multibodysimulink

Hi, everyone. I have trouble applying angle rotation range of revolute joint using multibody first generation (R2016b). In multibody, not 1G version, there's an angle constraints block, however it seems that it does not exist in Multibody 1G.
If I want to limit joint rotation angle from 30 to 90 degree at revolute joint, how should I do ? Also, How should I do to keep joint rotation angle at 90 degrees constant?
Could you please give me a hand about these two questions?
Thank you.

Best Answer

As you already figured out, there is no angle constraint block in SimMechanics 1G. In the first generation you could connect a Joint Sensor and a Joint Actor to the revolute joint. Then you can use the information about the position (and possibly of the torque) to calculate the torque needed to enforce the ranges. Using the Joint Actuator you can apply this force to the revolute joint. Keep in mind, that depending on the implementation of the controler, the system might get very stiff.
So generally I would advise to update to the second generation of Simscape Multibody since it has a easy solution for this issue and is also updated regularly.
Related Question