MATLAB: How to switch some degrees of freedom in a Simscape Multibody joint off and on

degreefreedomjointmultibodyofSimscapeSimscape Multibody

How do I switch some degrees of freedom in a Simscape Multibody joint off and on?

Best Answer

There are two main approaches:
1. We can restrict the motion of an individual revolute or translational primitive in a joint to be near some set position (e.g. 0) using the Equilibrium Position, Spring Stiffness, and Damping Coefficient in the Internal Mechanics settings for that primitive. We could effectively remove a degree of freedom from a joint by specifying 0 equilibrium position and a very high stiffness and damping to essentially approximate a hard stop with no range of motion. This may cause degradation in performance since we are not really eliminating a degree of freedom, rather introducing extremely tight dynamic bounds which may allow for small amplitude, high frequency oscillation or chatter. We may be able to avoid performance degradation in this situation by using a stiff solver. See https://blogs.mathworks.com/simulink/2012/07/03/why-do-we-need-stiff-ode-solvers/ and https://www.mathworks.com/help/simulink/ug/types-of-solvers.html#f11-41989 for reference on stiff solvers. The attached model 'joint_constraints_18b.slx' has an example of this approach.
2. We can use Variant Subsystems and have pre-configured joints with the desired degrees of freedom in each of the subsystem options. See the attached model 'joint_switching.slx' for an example of this approach.