In SimMechanics is it possible to change the Actuation input?

1 view (last 30 days)
I have a SimMechanics model where one of the inputs is at a Revolute Joint. In some cases I'd like to prescribe the motion at the joint and in others I'd like to prescribe the torque. Since I can't specify both on a joint block, is it possible to change which actuation method is used based on workspace variables, or is there a way to switch from using one Joint block or another based on the workspace?

Answers (1)

Vineeth Kartha
Vineeth Kartha on 15 Mar 2016
Hi
Could you please try adding 'Revolute Joint' with Torque as an input in an 'If Action Subsystem' and Similarly another 'Revolute Joint' with Motion as input in another if action subsystem. The If action subsystems should be enabled based on when you want torque input or motion input. Please try this approach and share your observations.
Regards Vineeth
  2 Comments
Daniel Stuewe
Daniel Stuewe on 15 Mar 2016
Vineeth,
Thank you for your answer. As you recommended, I've added two 'If Action Subsystem' blocks and replaced the connected Inport and Outport blocks with ports.
When I run the system I get the results expected with the prescribed angle input no matter what constant value is passed into the 'if' block. I think I'm missing something obvious, but I can't find it.
Dan
Daniel Stuewe
Daniel Stuewe on 15 Mar 2016
I've got the if blocks working correctly now (I don't know how I fixed it since all I did was switch the blocks - pointed the torque joint to the 'if' block and the angle joint to the 'else' block - and when that worked correctly, I switched them back) but the results from the torque joint are different than expected. If I comment out the angle joint as well as all of the if blocks and tie the torque joint directly to the output the mechanism behaves as expected. When I hook up the if blocks and run with the applied torque joint, the mechanism is locked. The input torque is the correct value, but nothing moves.
Note: when I run using the angle joint I set the input to the torque joint to 0 and when I run using the torque joint I set the input to the angle joint to 0. Also I defined the position target in the angle joint block. When I tried to define it in the torque joint block (with the same value) the model wouldn't compile due to a kinematic loop. Is this because the model is over constrained?

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!