Page 1 of 1

Limiting joint motion

Posted: Fri Sep 18, 2009 10:51 am
by sherm
(Moved from another thread)
BY: Jean-Philippe Jodoin (jpjodoin)
DATE: 2009-09-18 09:54
SUBJECT: RE: Constraint Missing implementation

I was wondering, what would be the best to set a range to a mobilizer ? For example, I have a MobilizerBody::Ball that I only want to move on 180 degrees (Half-Ball). Or for instance, I have a pin and I want to allow the motion on only 90 degrees. Is there an easy way for this or do I have to create a custom mobilizer ? And if so, how would I do that ?

Thanks a lot,
Jean-Philippe

RE: Limiting joint motion

Posted: Fri Sep 18, 2009 10:52 am
by sherm
Hi, Jean-Philippe.

The best way to limit the motion of a joint is the way it's done in nature -- with forces! Think about how the limited motion is enforced physically and write a Custom Force that resists motion beyond the limit (I believe you can find Custom Force examples in the tutorials).

The functional form I would recommend for a joint stop is something like f(x,xdot)=0 when -x0<=x<=x0, and f(x,xdot)=k*(x-x0)*(1+c*xdot) when x > x0 (and something similar for x < -x0), where x is the joint coordinate, x0 the limit. This gives you stiffness and dissipation but avoids the force discontinuity that you would get with a functional form like k*(x-x0) + c*xdot.

Best regards,
Sherm