Friction acting on a ball (2D)

  • Context: Graduate 
  • Thread starter Thread starter Xcrypt
  • Start date Start date
  • Tags Tags
    2d Ball Friction
Click For Summary

Discussion Overview

The discussion revolves around the implementation of friction in a 2D rigid body physics engine, specifically focusing on the behavior of a rolling ball on a flat surface. Participants explore the mechanics of collision resolution and the effects of friction, including static and dynamic friction, as well as the implications of surface deformation.

Discussion Character

  • Technical explanation
  • Conceptual clarification
  • Debate/contested

Main Points Raised

  • One participant describes their impulse-based collision resolution system and notes that the calculated relative velocity in the contact tangent direction (Vr_C.y) is close to zero for a rolling ball, leading to no visible friction.
  • Another participant suggests that the lack of friction may be due to the ball not slipping along the surface, indicating that static or dynamic friction does not act to slow the ball in this model.
  • Concerns are raised about the assumption of a rigid surface, with a participant proposing that real surfaces are elastic and deform under the ball's weight, affecting the contact normal direction.
  • A suggestion is made to introduce a "rolling friction" term proportional to the normal force to account for energy losses, along with the potential impact of air resistance on the ball's motion.
  • Further clarification is sought regarding the role of deformation in determining the contact normal and whether it is the collision force that ultimately stops the ball rather than friction.
  • Another participant proposes modifying the normal vector to include a small horizontal component to better reflect real-world conditions.
  • A reference to a Wikipedia article on rolling friction is provided, which discusses real-world examples and the effects of normal force on rolling objects.

Areas of Agreement / Disagreement

Participants express differing views on the role of friction and deformation in the context of rolling balls. There is no consensus on how to accurately model these effects, and multiple competing perspectives remain throughout the discussion.

Contextual Notes

Participants acknowledge limitations in their models, such as the assumption of rigid surfaces and the simplification of friction effects, which may not fully capture the complexities of real-world interactions.

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 :)
 

Similar threads

  • · Replies 20 ·
Replies
20
Views
2K
Replies
9
Views
1K
  • · Replies 35 ·
2
Replies
35
Views
5K
  • · Replies 60 ·
3
Replies
60
Views
7K
  • · Replies 22 ·
Replies
22
Views
5K
  • · Replies 3 ·
Replies
3
Views
1K
  • · Replies 18 ·
Replies
18
Views
3K
  • · Replies 16 ·
Replies
16
Views
3K
Replies
4
Views
2K
  • · Replies 9 ·
Replies
9
Views
2K