MATLAB: Is measured joint velocity zero in the Simscape Multibody model

derivativejointmultibodySimscape Multibodyvelocityzero

I have a Simscape Multibody model which simulates without errors. In the model, I provide a motion input to a prismatic joint and can successfully measure its position. However, when I try to sense the velocity it is always equal to zero. In the example models from the documentation I can successfully sense the velocity. What can be wrong here?

Best Answer

In the "Simulink-PS" block that converts the motion input to a physical signal, under the Input Handling tab, make sure that the signal derivatives are not set to “Zero (piecewise constant)”. By changing this entry to, e.g., "Filter input, derivatives calculated", and selecting a filtering method with a reasonable time-constant, the velocity signal appears as expected..
Another reason why the measured velocity is zero could be because the motion input signal to the joint is very "aggressive" and numerical calculation of its derivative (which is also dependent on the time step) might not be accurate. In this case, appropriate tuning of the solver step should resolve the issue.
Related Question