Friction acting on a ball (2D)

In summary, the coder is using an impulse-based approach to resolve velocities in their collision resolution system. One issue they are facing is friction not acting on a rolling ball. This is due to the assumption that the surface is rigid, when in reality it is elastic and causes the ball to constantly roll up a small hill. To account for this, the coder can add a "rolling friction" term to their code. Additionally, air resistance may also play a role in slowing down the ball.
  • #1
Xcrypt
21
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
  • #2
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.
 
  • #3
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 :)
 
  • #4
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.
 
  • #5
Thanks :)
 

What is friction?

Friction is the force that resists the relative motion between two surfaces that are in contact with each other.

How does friction act on a ball?

Friction acts on a ball as a force that opposes its motion when it rolls on a surface.

What factors affect the amount of friction acting on a ball?

The amount of friction acting on a ball is affected by the roughness of the ball's surface, the type of surface it is rolling on, and the weight of the ball.

How is friction calculated on a ball?

The amount of friction acting on a ball can be calculated using the formula F = μN, where F is the frictional force, μ is the coefficient of friction, and N is the normal force.

How can friction be reduced on a ball?

Friction can be reduced on a ball by using a smoother surface, applying lubricants, or reducing the weight of the ball.

Similar threads

Replies
22
Views
2K
  • Introductory Physics Homework Help
Replies
4
Views
845
Replies
3
Views
929
Replies
3
Views
738
  • Introductory Physics Homework Help
Replies
14
Views
1K
Replies
1
Views
794
Replies
5
Views
994
Replies
32
Views
4K
Replies
9
Views
1K
  • Introductory Physics Homework Help
Replies
19
Views
1K
Back
Top