Today I found an interesting bit of information in the ODE mailing
list archives:
0) make sure you're using a constant step size. If you vary your step
size at all, you will introduce jitter because of the ODE integrator,
even for bodies at rest (because "rest" means that the ground contact
cancels out the gravity acceleration for the current time step).
I was already experiencing problems with stability in the mechtest
demo that I recently added to CEL (to test the mechanics plugin). i.e.
objects would sometimes suddenly jump up slightly or move a small
amount. And then I found the message above in relation to that error.
So I fixed both the mechanics plugin and phystut so that they now have
a constant stepsize but STILL do framerate independent physics
simulation speed. Here is an example of how it works:
Assume that at some point you have elapsed time equal to 90ms and step
size is defined as 30ms. In that case for a given frame you would get
3 steps and everything is fine. However at another point you get an
elapsed time of 100ms. In that case you would get 3 steps of 30ms each
and then one step of 10ms to make sure the physics simulation really
accomodates 100ms. ODE doesn't like this because this makes the step
size variable. So what I do now instead is to do 3 steps of 30ms and
the 10ms I keep in a variable. Next frame I add that 10ms to the
elapsed time that is valid for that frame. That way no time is lost
but I make sure that the step size is constant.
This helps a great deal with stability.
Greetings,