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

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

 채택된 답변

Sebastian Castro
Sebastian Castro 2015년 11월 11일
편집: Sebastian Castro 2015년 11월 11일

0 개 추천

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

추가 답변 (1개)

Sarvesh Srinivasan
Sarvesh Srinivasan 2015년 11월 11일

0 개 추천

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

카테고리

도움말 센터File Exchange에서 General Applications에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by