Friction acting on a ball (2D)

  • Thread starter Thread starter Xcrypt
  • Start date Start date
  • Tags Tags
    2d Ball Friction
AI Thread Summary
The discussion focuses on the challenges of implementing friction in a 2D rigid body physics engine, specifically for a rolling ball. The coder's impulse-based collision resolution system is functioning well, but it struggles with accurately simulating friction due to the near-zero relative velocity at the contact point when the ball rolls. Responses suggest that the lack of friction is because the ball isn't slipping, and real-world factors like surface elasticity and air resistance should be considered. It is recommended to incorporate a "rolling friction" term proportional to the normal force to better simulate the behavior. The conversation concludes with a reference to external resources for further understanding of rolling friction dynamics.
Xcrypt
Messages
20
Reaction score
0
Hello, I am a coder trying to build a game 2D rigid body physics engine.
So far I am working with an impulse-based approach and all is going pretty decent.
Everything does it's job, except one thing: friction acting on a rolling ball.

First I will explain how my collision resolution system works and then I will be more specific about the rolling ball.

My collision resolution system:

When a body hits another body, the collision detection system returns some info:
- a contactpoint : P
- a contactnormal : n
- a contacttangent : t

the next step is to resolve the velocities with an impulse-based approach

1) check the relative velocity of both bodies:
Vr = (v0+(w0 X (P-p0)) - (v1+(w1 X (P-p1)))

where
v: velocity of the body,
w: angular velocity of the body,
p: position of the body
X: vector/cross product

2) project Vr on the n & t to find out the relative velocity in contact coordinates
Vr_C.x= Vr ° n
Vr_C.y= Vr ° t

where
°: scalar/dot product

3) find out the required change in velocity along normal due to the collision
dV_C.x = -(1+restitution)(Vr_C.x)

4) find out the required change in velocity along tangent due to (static) friction
dV_C.y = -Vr_C.y

5) find the velocity per impulse applied at contactpoint along n & t
vpi_n= [ [((n X (P-p0))*iit_inv0) X (P-p0)] + 1/m0 + [((n X (P-p1))*iit_inv1) X (P-p1)] + 1/m1 ] ° n
vpi_t= [ [((t X (P-p0))*iit_inv0) X (P-p0)] + 1/m0 + [((t X (P-p1))*iit_inv1) X (P-p1)] + 1/m1 ] ° t

where
iit_inv: inverse moment of inertia tensor
m: mass

6) find the required impulsed we need to apply along n & t
reqI_n = dV_C.x / vpi_n
reqI_t = dV_C.y / vpi_t

7) In the last stage I do some extra fudgy math/physics for dynamic friction.

if(reqI_t > reqI_n*µ)
then reqI_t = reqI_n*µ

else if(reqI_t < -reqI_n*µ)
then reqI_t = -reqI_n*µ

where
µ: friction coefficient
The problem I have with rolling balls
When a ball is rolling over a flat surface, it's Vr_C.y seems to be very close to zero, causing no visible friction to act on the contactpoint.

where
Vr_C.y = (v+(w X (P-p)) ° t

It seems like the v (linear velocity) component and the (w X (P-p) component (linear velocity at P, due to rotation)
cancel each other out.

Have I gone wrong somewhere in my formulas?
How can this be explained?

Thanks for any help.
 
Last edited:
Physics news on Phys.org
I can't follow the specific symbols, but I'd guess that your program is giving you an answer of no friction because the ball is not slipping along the surface, so there are neither static or dynamic friction acting to slow the ball.

When the ball rolls in this model, it will never stop. This unreal situation arises because we falsely assume the surface is rigid; in reality it is elastic and slightly depressed at the point of contact due to the ball's weight. The ball is therefore constantly rolling slightly up the hill of this depression. The same effect occurs when the elastic ball is compressed along the vertical axis due to its own weight, and the energy of this compression is not recovered when the ball completes a 1/4 roll, by which point it has been compressed in the new vertical direction (the old horizontal). These processes convert linear and rotational kinetic energy into the heat of the objects.

These factors are probably far more effort than they're worth to calculate in your code, so I'd just add a "rolling friction" term in the code, I think it should be proportional to the normal force (but you might want to check this).

You may also have air resistance to slow the ball, which will probably be the dominant mechanism for faster/smoother rolling objects. This is proportional to the velocity squared.
 
So, basically, you're saying that due to deformation, the contactNormal I "estimate" in my code is not correct. In reality it would be in a different direction?
But then, is it really friction that stops a ball? This would mean it's actually the collision force (along normal) stopping the ball?

Can I get more information about this please? Thanks MikeyW :)
 
It should suffice to change the normal vector to add a horizontal component (without altering the vertical), perhaps one that is 1% of the magnitude of the vertical. I suppose whether it is friction or not is down to your definition of "friction".

I just found the wikipedia article and it has some good explanations:
http://en.wikipedia.org/wiki/Rolling_friction

This includes some real world examples, eg. a steel ball bearing rolling on a steel plate will have 0.1% of the normal force acting in the opposite direction to the velocity.
 
Thanks :)
 
The rope is tied into the person (the load of 200 pounds) and the rope goes up from the person to a fixed pulley and back down to his hands. He hauls the rope to suspend himself in the air. What is the mechanical advantage of the system? The person will indeed only have to lift half of his body weight (roughly 100 pounds) because he now lessened the load by that same amount. This APPEARS to be a 2:1 because he can hold himself with half the force, but my question is: is that mechanical...
Some physics textbook writer told me that Newton's first law applies only on bodies that feel no interactions at all. He said that if a body is on rest or moves in constant velocity, there is no external force acting on it. But I have heard another form of the law that says the net force acting on a body must be zero. This means there is interactions involved after all. So which one is correct?
Thread 'Beam on an inclined plane'
Hello! I have a question regarding a beam on an inclined plane. I was considering a beam resting on two supports attached to an inclined plane. I was almost sure that the lower support must be more loaded. My imagination about this problem is shown in the picture below. Here is how I wrote the condition of equilibrium forces: $$ \begin{cases} F_{g\parallel}=F_{t1}+F_{t2}, \\ F_{g\perp}=F_{r1}+F_{r2} \end{cases}. $$ On the other hand...
Back
Top