Rolling friction model

Please don't post Bullet support questions here, use the above forums instead.
Post Reply
colinvella
Posts: 24
Joined: Sat Feb 09, 2008 2:38 pm
Location: Malta
Contact:

Rolling friction model

Post by colinvella »

Hi,

For my master's dissertation I'm developing a plugin-driven physics engine framework. So far I have successfully developed rigid bodies with oriented box geometry. I am using an impulse-based coulomb friction model that seems to work adequately for boxes.

I'm now experimenting with rigid spherical geometry and the rolling behaviour is working quite well as a side effect of static and dynamic friction. However I noticed that once a ball settles in a natural non-slipping roll, it keeps on rolling indefinitely. This is to be expected since at the point of contact, there is no tangential relative motion, and hence no further friction is generated.

I'm assuming here that the friction model needs to be elaborated further to incorporate rolling friction. My questions are:
a) how to best detect when rolling friction is occurring?
b) what model is typically adopted for implementing rolling friction?

Finally, I also noticed that some balls tend to spin indefinitely, again because the balls's contact point coincides with the axis of rotation and hence is considered static with respect to the adjacent body (the ground). The first solution that comes to mind for this is to make the collision detector report multiple contact points around the original one reported. This would ensure that at least one of the points is in relative motion, thus causing an element of spinning friction. I'm curious to hear what spinning friction models are adopted for real-time physics.

I look forward to your comments,
Thanks,
Colin
Dirk Gregorius
Posts: 861
Joined: Sun Jul 03, 2005 4:06 pm
Location: Kirkland, WA

Re: Rolling friction model

Post by Dirk Gregorius »

In university we applied a simple trick to mimic rolling friction. We just moved the contact point slight in front of the rolling direction. So in order to detect rolling you can measure the relative velocity at the contact point in the tangent plane. If this relative velocity vanishes and there is still some linear motion you should be rolling. Then adjust your contact point and move it slightly in front (in the direction of the linear motion in the contact plane). Erin Catto suggested a constraint based approach somewhere on the forum as well. I could imagine it works something like this. Let n be you rotation (rolling) axis. Define a constraint C = ( 0 -n 0 n ) and solve this like a usual friction constraint. I am note sure how to choose the maximum force at the moment, so you maybe search the forum quickly.

W.r.t. to your other post. I wouldn't pertubate any normal since this will have impact on the overall quality of the solver. Usually the crappy convergence of the iterative solver leads to enough noise. If you really need this let the user overwrite the normal using some callback, but don't bake this into your solver.


HTH,
-Dirk
colinvella
Posts: 24
Joined: Sat Feb 09, 2008 2:38 pm
Location: Malta
Contact:

Re: Rolling friction model

Post by colinvella »

I think I understand what you mean. Effectively, you are applying an artificial frictional component even when the ball is in natural rolling state. Not sure I understand the quadruple definition for C though... is that Bullet-speak? :)

Thinking further about my idea of multiple sphere contact points to allow for spinning friction, I believe this might also work for rolling friction. Consider that additional contact points may occur in front of the ball and hence produce the desired effect.

I seem to recall somewhere that in Half-Life 2, barrels where actually modeled as polyhedral objects and rolling friction occurred as a result of the flat segments around the barrel's circumference. The train of collisions around the barrel as it rolls would result in loss of energy thanks to the coefficient of restitution until the barrel eventually settles on one of the segments.

As for my normal perturbation post, the coefficient may be zeroed to prevent normal perturbation. In addition, the simulation algorithm is itself a plugin within my framework and hence may be replaced by a version that ignores the perturbation coefficient completely. I understand that my ball stacking example is contrived, but I also fear it might occur more often than common sense dictates due to the simplified nature of rigid body modeling.
Dirk Gregorius
Posts: 861
Joined: Sun Jul 03, 2005 4:06 pm
Location: Kirkland, WA

Re: Rolling friction model

Post by Dirk Gregorius »

As you mention Half_Life 2. I lately looked with one of our artists into their level editor (forgot the name) and they have a huge amount of physic examples. One example to show one effect. Very cool actually. So I checked to see rolling barrels and they look quite cool and you don't notice that they are polytopes. But it is a welcome side-effect that you have naturally some rolling resistance. Personally I use polytopes for cylinders and cones as well. The nice thing is that it is very easy to compute good contact points for them (with both methods GJK or SAT).

The "C" thing was actually wrong. Sorry, I was in a hurry. I wanted to say that you define an angular constraint C = ( omega2 - omega1 ) * n = 0 and this gives you a Jacobian J = ( 0 -n 0 n ). This can be used easily in any iterative solver scheme. I need to think about how to clamp the impulse. Maybe Erin reads the thread and clears things up.



Cheers,
-Dirk
Erin Catto
Posts: 316
Joined: Fri Jul 01, 2005 5:29 am
Location: Irvine
Contact:

Re: Rolling friction model

Post by Erin Catto »

How about just using this velocity constraint:

omega2 - omega1 = 0

And use a maximum torque for this constraint of:

torqueMax = roll_spin_factor * choose_a_length_scale * sum_of_normal_forces.

You can safely use this in all cases, even with multiple contact points. So you wouldn't need to detect rolling or spinning.

Just a thought, I haven't tried this. There may be some undesirable side effects.
Dirk Gregorius
Posts: 861
Joined: Sun Jul 03, 2005 4:06 pm
Location: Kirkland, WA

Re: Rolling friction model

Post by Dirk Gregorius »

Before I forget I think most people simply use angular damping for this. You might also look into the Guendelman paper. He deals with rolling friction in it.
Erin Catto
Posts: 316
Joined: Fri Jul 01, 2005 5:29 am
Location: Irvine
Contact:

Re: Rolling friction model

Post by Erin Catto »

Yeah, you could use relative angular damping.
colinvella
Posts: 24
Joined: Sat Feb 09, 2008 2:38 pm
Location: Malta
Contact:

Re: Rolling friction model

Post by colinvella »

Erin, Dirk, I'm not entirely sure I understand the constraint approach but it does sound to me like the torque is a corrective one that tries to achieve zero relative angular velocity. I suppose it's net effect is similar to that of angular damping.

Damping should indeed also solve the spinning-on-the-spot problem. One limitation of damping however is that it forces objects to slow down to an absolute stationary point, so it wouldn't work, say, with a rolling ball on a platform moving at constant speed (i.e. an inertial frame).
Erin Catto
Posts: 316
Joined: Fri Jul 01, 2005 5:29 am
Location: Irvine
Contact:

Re: Rolling friction model

Post by Erin Catto »

Relative damping should work ok.

However, damping wouldn't support static rolling/spinning friction. You may want a ball to stop rolling on mildly flat surfaces.
Post Reply