Dampned Angular Spring Using Revolute Joint Motor (Softness)

I'm trying to implement some interactive dynamics where the mouse position controls the angle between pairs of bodies.

Is it possible to create the equivalent of a dampned angular spring using the Revolute Joint Motor?

The docs show how to use the motor, joint error, and a gain factor to track a desired angle, but I'm having trouble tuning out the "bouncines" when using this technique.

In my Farseer Physics engine, I implemented a "Softness" factor into what I called an "AngleJoint". This softness factor was something mentioned by Erin in some of his papers and discussed on the Bullet physcis forums. I implemented it without fully understanding it. 🙂. It works great and seems much more stable and much less bouncy then what I've been able to achieve using the joint motor in Box2D.

My gut tells me the equivalent of this "Softness" factor is already implemented within the Joint Motor. So, before I start trying to port my "AngleJoint" code from my Farseer Engine to Box2D I want to make sure it's something that is not already part of Box2d.

Anyone have any insight on this? Erin?

-Jeff Weber
Yeah, you can do this using the softness/Baumgarte -- spring/damper equivalence formulas. You'll have to modify the revolute joint motor code to use softness. The Baumgarte parameter is simply the multiplier on your angular error.
Ok, thanks Erin.

I'll work on adding that soon. It's a must for my game(s)
I'm interested in this also. I'm currently setting the MotorSpeed proportionate to the difference between currentAngle and targetAngle, but to reduce bounciness I am:

Using a high AngularDamping value, and
Checking for 'bad momentum' (when the currentAngle is getting further from the targetAngle) and increasing the corrective MotorSpeed if the momentum is 'bad'.

Not the most elegant solution but works for the most part.
I posted something a while back about making the prismatic and revolute joint work like springs:

viewtopic.php?f=3&t=1007

Is that what you're looking to do?
I'm not sure if that is equivalent to the joint softness I used in Farseer or not. From what I understand, using the softness factor actually bakes the spring physics into the joint contraint which makes it more stable

I haven't had a chance to dig into this and compare your solution joint softness implementation, so I'm not sure if they will be equall stable.

Original thread: https://box2d.org/forum/viewtopic.php?t=1678