Impulse-based dynamic simulation system

Please don't post Bullet support questions here, use the above forums instead.
Jan Bender
Posts: 111
Joined: Fri Sep 08, 2006 1:26 pm
Location: Germany
Contact:

Post by Jan Bender »

I tried already applying friction impulses at the end of all iterations. The results didn't convince me of this. I had more problems than now. The problem with this approach is that a friction impulse in general causes a change of the normal velocity in the contact point. So the normal velocity after contact resolution is not correct anymore. And since the normal velocity in the contact point is not correct the normal impulse is wrong as well. And so in the end the friction impulse which depends on the normal impulse is not correct.

It is hard to find a correct solution for this problem. But I can say that I have already made some nice simulations with my method and even mechanical toys like the tippe top or the rattleback worked very well :D

Jan
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA
Contact:

Post by Erwin Coumans »

Dirk Gregorius wrote:What I don't see is the problem with wild impulses. I compulte the friction using the accumulated impulse, not the intermediate "Delta Impulses". I don't see how this should get wild, since the accumulated converges
It really depends when you perform static-friction clipping. If you clip during the iterations, it will be not correct, even if you use accumulated impulse.

Say, for one contact point, 2 iterations with 1.0 being the static friction clipping treshold

incremental impulse, first iteration: 1.5, second iteration -0.5
accumulated, first iteration:1.5, second iteration 1.0

if you perform friction clipping between first and second iteration, 1.5 will be clipped to 1. If you wait until all iterations are over, no clipping is performed, which is correct.
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA
Contact:

Post by Erwin Coumans »

Erin Catto wrote:I actually did the sphere stacking test awhile ago with PGS. Top down gives you approximately a one iteration advantage over bottom up. I also found this counter intuitive. You might think of it as getting the full weight to ground quicker.

With regard to going back-and-forth, this is called Symmetric Successive Over Relaxation (SSOR). I also thought this sounded good. Apparently it has provably worse convergence than regular SOR (of which GS is a subset). See Matrix Computations by Golub.

Randomization of constraints kills the cache. I saw solver performance double on the PS2 by turning off randomization.

Dirk, convergence of GS is determined by the eigenvalues. These should be immutable under row and column swaps. I think ordering can only affect convergence in small ways (like 1 iteration).
Thanks for the explanation. Things can be counter-intuitive indeed.
I tested the convergence with the CcdPhysicsDemo stack, and the symmetric version (back-and-forth) gave more stable results. Same for the friction model.

So rather then a global mathematically correct statement, I just used the very restricted domain, being my stacking rigid bodies demo.
Jan wrote: tippe top or the rattleback worked very well
We all use different testbeds, and make assumptions based on our own testbed. It would be good to re-use the same tests at least. If we all support COLLADA physics import, we can share complex setups, including articulated models :-)
dog
Posts: 40
Joined: Fri Jul 22, 2005 8:00 pm
Location: Santa Monica

Post by dog »

Sorting my constraints so I process the deepest penetrations first has been far more effective (speed of convergence and stability over multiple frames) than randomizing or sweeping up and down.

Whether this would help other people's solvers is debatable.
Erin Catto
Posts: 316
Joined: Fri Jul 01, 2005 5:29 am
Location: Irvine
Contact:

Post by Erin Catto »

It would be great if someone in academia could spend the time to compare these methods and write a nice paper with pictures and graphs (pssst ... Jan). :wink:
sbroumley
Posts: 15
Joined: Sun Aug 07, 2005 6:31 am
Location: Austin

Post by sbroumley »

Dirk Gregorius wrote: Regarding friction:
I apply the friction at the manifold center as we discussed a while ago :-). And of course I have all normal impulses then. What I don't see is the problem with wild impulses. I compulte the friction using the accumulated impulse, not the intermediate "Delta Impulses"....
With regards to applying the friction at the manifold center - I'm actually experimenting with the same thing. My approach is as follows:

Before the solver loop I:

1) Compute the friction information by taking the average of the position, normal, and accumulated normal (impulse) force of all the contacts from the previous frame. eg. for a cube lying on a plane, this will be the center of the 4 contact points, with normal pointing upwards. From this I have "FrictionPoint", "FrictionNormal" and "NormalForce"

2) Compute the relative velocity of FrictionPoint. From this I can compute the velocity into the collision plane (FrictionNormal) and along the collision plane (I call this the FrictionDirection). If the FrictionPoint is not moving I use the previous frames FrictionDirection

3) Compute the impulse at FrictionPoint required to stop the FrictionPoint moving along the FrictionDirection. I call this impulse the FrictionForce

4) I then use the NormalForce information from 1) so I can compute the friction limits. In the case that contacts have just been added (no normal impulse force info available from the previous frame) and NormalForce=0, I compute the appropriate normal impulse force at the friction point to stop movement (or bounce etc) into the collision plane and assign it to NormalForce.

5) So with the approx FrictionForce and NormalForce available, I can then decide on what friction limits to use like so:

MaxStaticForce = MaterialStaticFriction * NormalForce
MaxDynamicForce = MaterialDynamicFriction * NormalForce

FrictionLimit = ( FrictionForce < MaxStaticForce ) ? MaxStaticForce : MaxDynamicForce

I then setup 3 friction constraints for the solver using FrictionPosition, FrictionLimit, FrictionDirection, and FrictionNormal like so:
a) 1 constraint for movement along FrictionDirection,
b) 1 constraint for movement along CrossProduct( FrictionDirection, FrictionNormal )
c) 1 constraint for rotation only around FrictionNormal

It seems to be working okay, although I'm not sure how mathmatically correct it is.

A couple of questions I have is

A) For 1) when computing the "NormalForce" do I take the average of all the contact point normal forces or the total?

B) Is my static/dynamic friction limit test mathematically correct?

thanks
Steve.
Erin Catto
Posts: 316
Joined: Fri Jul 01, 2005 5:29 am
Location: Irvine
Contact:

Post by Erin Catto »

You definitely should sum the accumulated normal impulses when determining the maximum centeral friction. This will approximate integration over the manifold surface.

I would use the dynamic friction limit if the tangential velocity from the end of the last step is above a threshold, otherwise I would use the static friction limit.
Jan Bender
Posts: 111
Joined: Fri Sep 08, 2006 1:26 pm
Location: Germany
Contact:

Post by Jan Bender »

It would be great if someone in academia could spend the time to compare these methods and write a nice paper with pictures and graphs (pssst ... Jan).
Nice try. But I think first I will finish writing another nice paper... my PhD thesis :wink:

By the way, if somebody is very interested in my work then visit the VRIPHYS '06 in Madrid. I will present my newest paper with the title

"Fast Dynamic Simulation of Multi-Body Systems Using Impulses".

Or you wait until I put it on my homepage :wink:

Jan
Jan Bender
Posts: 111
Joined: Fri Sep 08, 2006 1:26 pm
Location: Germany
Contact:

Post by Jan Bender »

I moved the webpage to

http://www.impulse-based.de/

Jan
Post Reply