btGeneric6DofSpringConstraint explodes

Post Reply
thloh85
Posts: 26
Joined: Mon Feb 09, 2009 10:07 am

btGeneric6DofSpringConstraint explodes

Post by thloh85 » Mon Nov 16, 2009 2:30 pm

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

User avatar
rponomarev
Posts: 56
Joined: Sat Mar 08, 2008 12:37 am

Re: btGeneric6DofSpringConstraint explodes

Post by rponomarev » Wed Dec 02, 2009 2:17 am

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

thloh85
Posts: 26
Joined: Mon Feb 09, 2009 10:07 am

Re: btGeneric6DofSpringConstraint explodes

Post by thloh85 » Wed Dec 02, 2009 9:22 am

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

Post Reply