Page 1 of 1

Featherstone Stability

Posted: Tue Jan 30, 2007 2:11 am
by Erin Catto
I've implemented Featherstone's algorithm in 2D and I've observed some stability problems for multi-link pendulums at large angular velocities.

The case I'm using is identical to Demo 0 in Box2D: a 10-link pendulum starting with zero velocity, aligned with the horizontal axis. The pendulum swings down then folds over onto itself (no collision), then starts whipping around and shortly blows up.

My integrator is semi-implicit Euler:
qDot = qDot + dt * qDotDot
q = q + dt * qDot

I believe the instability is due to velocity-squared inertia forces. I can't remove the v-squared terms because they are necessary to get a plausible simulation.

Here are some solutions:
- clamp the joint's relative angular velocity and use damping.
- if the angular velocity is large then integrate the v-squared terms with sub-steps. This can be viewed as adaptive integration.

Has anyone ran into this problem? Are there any other tricks to deal with the instability?

Re: Featherstone Stability

Posted: Tue Jan 30, 2007 3:55 pm
by Antonio Martini
Erin Catto wrote:I've implemented Featherstone's algorithm in 2D and I've observed some stability problems for multi-link pendulums at large angular velocities.

The case I'm using is identical to Demo 0 in Box2D: a 10-link pendulum starting with zero velocity, aligned with the horizontal axis. The pendulum swings down then folds over onto itself (no collision), then starts whipping around and shortly blows up.

My integrator is semi-implicit Euler:
qDot = qDot + dt * qDotDot
q = q + dt * qDot

I believe the instability is due to velocity-squared inertia forces. I can't remove the v-squared terms because they are necessary to get a plausible simulation.

Here are some solutions:
- clamp the joint's relative angular velocity and use damping.
- if the angular velocity is large then integrate the v-squared terms with sub-steps. This can be viewed as adaptive integration.

Has anyone ran into this problem? Are there any other tricks to deal with the instability?
- increase inertia
- add joint limits . This will definitely fix it

cheers,
Antonio

Posted: Tue Jan 30, 2007 7:52 pm
by mewert
I had the same problem with Featherstone. Since the joints are stiff you end up with an effect like cracking a whip; in the demo you described. So the angular velocity for the last link in your chain gets really high. Semi-implicit Euler did not seem to be much better than Euler. I had good results with RK45 and Midpoint, but they are more expensive ( I can't recall if they were better than equivilant substeps of Euler or not ).

Adding joint damping helps. Most actual applications to constrained systems will have plenty of limits and collisions, so the stability in practice is not a problem.