[ODE] Collision constraint

Bob Dowland Bob.Dowland at blue52.co.uk
Thu Jun 19 06:23:02 2003


I think you've hit the nail on the head here - this is the main snag with "penalty methods" (penetration correction force). I don't know how ODE's "correction" works, perhaps someone can explain but using a simple spring model (force proportional to error) can give rise to these additional "bouncing" effects.

If you think of the penetration as an error call it e and note that it is a function of time e = e(t) then a simple spring correction also called "proportional controller" generates a force proportional to that error

F = F (e(t)) = kp.e(t)

this is the same ode as for a spring (giving "shm"). It's nice and simple but does produce, well, a certain springyness. An improvement on this is "proportional, derivative control":

F = kp.e(t) + kd.d/dt{e(t)}

a spring with a damper. A little more complicated but gives you a fighting chance at least. The trick, then, is to find "good values" for kp and kd, (ie ones that make e go to zero as quick as poss, not overshoot, and not oscillate about zero - aka "critically damped") unfortunately this often comes down to manual tweaking - depending on the situ.

I don't know if this helps in any way - I guess it would be more useful to hear what some of the ODE vets have to say on this.


> -----Original Message-----
> From: Joakim Eriksson [mailto:jme@snowcode.com]
> Sent: 18 June 2003 09:42
> To: ode@q12.org
> Subject: [ODE] Collision constraint
> 
> 
> I have been looking a bit at the constraint system and there is one
> thing I wonder.
> 
> As far as I can tell so does the constraint solver only 
> return a force.
> That force
> is then applied to the bodies. So the force turns into a velocity that
> changes the body.
> Now what happens if a body is far into for example a plane. So the
> penetration
> depth is large. That would force the 'c' part of the 
> constraint equation
> to have a
> large value (To fix the penetration). If we would set the ERP to 1.0
> then he
> would need to fix the error as quickly as possible. Now 
> because we calc
> a force
> wont that mean that the body will get a velocity that forces 
> it not only
> to quickly
> move out of plane but also to continue away from the plane? Or am I
> missing
> something?
> 
> If the problem actually does exists it would show in the 
> following way.
> A fast moving object with a coeffiecent of resitition that equals 0.0f
> that collides
> with for example a plane would still get a bounce effect. How high the
> bounce would be would depend on the ERP and the penetration depth.
> 
> /Joakim E.
> 
> 
> _______________________________________________
> ODE mailing list
> ODE@q12.org
> http://q12.org/mailman/listinfo/ode
>