Choosing between two separate joints with a switch? Simmechanics 2nd gen

3 views (last 30 days)
So, I have this problem where I want to change the type of joint connected to the body depending upon a condition(like y>0). I know this sounds a bit circular, but I wanted to know if this was actually implementable, and if so, how do I do this? I can't directly connect the joints to a switch, is there any kind of converter I can use.
Example: If y > 2 , use 6-dof joint else, use planar joint

Accepted Answer

Sebastian Castro
Sebastian Castro on 11 Nov 2015
Edited: Sebastian Castro on 11 Nov 2015
Suppose you want to switch between a Planar (PX, PY, RZ) and 6-DOF (PX, PY, PZ, RX, RY, RZ) joint.
The only approach I know of is to add variable springs and dampers to each of the "tunable" joint primitives -- in this case, PZ, RX, and RY which you want to enable and disable.
When your condition is true, set the springs and dampers to a really high value, effectively constraining their motion with a little bit of compliance. When your condition is false, set these spring and damper values to zero, or a low number, effectively making them free to move.
These variable springs and dampers can be implemented using Physical Signal blocks (Fspring = K*x, Fdamper = D*v). So, for each joint primitive you measure the position and velocity, multiply them by variable gains as above, and feed them back to the joint as forces and torques.
Below is a screenshot showing an example for one joint primitive. I'd highly recommend using subsystems :)
NOTE: Based on sign convention, those constant values would have to be negative.
- Sebastian

More Answers (1)

Sarvesh Srinivasan
Sarvesh Srinivasan on 11 Nov 2015
Thanks. Actually I had already prepared such a damping+spring system, but just wondered if there was a better way. Again, thanks a ton for your quick response

Categories

Find more on General Applications in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!