MATLAB: How to introduce a rotary motor in simulink multibody

electric_motor_controlmultibodypower_electronics_controlrotary motorSimscape

I want to create a model of a crank-slider mechanism, I have already assembled the mechanism (file attached) but I don’t know how to introduce a constant angular velocity rotary motor correctly. I have defined a specific velocity state target at the first revolute joint, but the angular velocity isn't constant (see scope image), I think I must do it in another way. Does anybody know how to introduce a rotary motor in simulink multibody?
Maybe an example could help me. Does anybody know where to find a full example of a crank-slider mechanism or similar? I can’t find what I want.
Captura3.JPG

Best Answer

Torque is needed at the revolute joint to make the follower speed stayed constant. Here is how to do it: In the actuation property of the revolute joint, set Toque to be Automatically Computed, set Motion to be Provided by Input. Then connected a Simulink-PS Converter block to the motion input q. In the Input Handling tab of the Simulink-PS Converter block, set the Filtering and derivatives to Filter input and Input filtering order to Second-order filtering. In essence, we are doing inverse dynamics here.
Related Question