Page 1 of 1

btGeneric6DofSpringConstraint explodes

Posted: Mon Nov 16, 2009 2:30 pm
by thloh85
Hi all,

I was just trying out the stability of btGeneric6DofSpringConstraint, but it seems that when the setStiffness is set too high, the spring starts to explode. My current wild guess is that the spring springs to and fro too fast, causing them to go unstable.
To reproduce this, just simply create 2 btRigidBody (say cube), then use a btGeneric6DofSpringConstraint to connect them, setStiffness to 2000.
Is this a bug or it's the behaviour of physics that causes me to see this?

Thanks

Re: btGeneric6DofSpringConstraint explodes

Posted: Wed Dec 02, 2009 2:17 am
by rponomarev
Hello,

Frequency of the oscillator is sqrt(stiffness/mass)/2/PI,
so for stiffness == 2000 we have frequency about 7 Hertz
I tried ConstraintDEmo with stiffness 2000, works as expected for me
Simulation is discrete with time step 1/60 sec by default< so you may expect instability for large stiffness

Thanks,
Roman

Re: btGeneric6DofSpringConstraint explodes

Posted: Wed Dec 02, 2009 9:22 am
by thloh85
Hi,

Thanks for the testing. And I'm sorry for my late reply.
I think I did some mistake describing my problem. Actually, I added a spring to body A and B, and further added another spring to body B and C, where body A, B, C all has mass of 1. Then the spring begin to become unstable. Is there any alternate way to attach a "chain" of springs?

Thanks