Game Development Community

Friction and slope physics

by Gary Preston · in Technical Issues · 02/08/2006 (2:22 pm) · 6 replies

I want to calculate the acceleration applied to an object on a slope. Well, I want to do more than that, but this is the simple case I want to understand before I try applying anything more complex. Even with this I think there are some flaws in my understanding. I'd appreciate it if someone could point out where I'm going wrong or any flawed assumptions on my part.

Heres my current understanding:

Assuming the forces on the object are gravity, the normal force and friction. and the object is currently at rest.

NormalForce = mg cos angle
PerpForce = mg sin angle
sFrictionForce = sFricCoef * NormalForce

If the perpForce > sFrictionForce the object would slide down
the slope. If not it remains at rest. So far hopefully I'm on track?

If we now apply a force "appliedForce" that helps overcomes the static friction, the object will slide down the slope (assuming the applied force runs parallel to the slope surface downwards)

If I understand correctly, we now apply kinetic friction since the object is in motion.

kFrictionForce = kFircCoef * NormalForce

So the net force acting on the object is
netForce = PerpForce + appliedForce - kFrictionForce

Gravity and normal forces cancel each other out so I've not included those, also subtracting kinetic force as this acts opposite to the applied force (should I be taking into account the objects current velocity here as well?)

From this I can calulate the acceleration as

accel = netForce / objectMass

and thus adjust the objects velocity

velocity = velocity + accel *dt

where dt is the time elapsed since last tick.

At this point, I'm pretty sure I've made a mistake in understanding how the calculation works when kinetic friction is a part of the picture and things just get worse now :P

So long as the appliedForce remains (assuming it was enough to get the object in motion) the object will
continue to accelerate. As the net force is positive and down the slope.

If however the appliedForce is removed and the perpForce is less than the kinetic friction we'll see a negative net force (or a positive force up the slope) causing a negative acceleration on the object. So in effect the object will slow.

But how does the object stop? Since afaik nothing I've mentioned above is calculated based on the current
velocity of the object, it appears that when the applied force is removed, the negative accel will over time
reduce the velocity towards zero, however at some point it will pass zero becoming negative and thus causing the object to start sliding up the hill, which in this case makes no sense?

Is it simply that when the netForce < kinetic friction we kill the objects velocity?

I would have thought that the initial velocity would need to be taken into account somehow? For example imagine the box started off 10 meters above the slope, so for the first t seconds it accelerates under gravity towards the surface. When it impacts the suface it will have a downwards velocity. Assuming the surface is sloped, this would result (I think) in the object having a force applied parallel to the slope surface (where as in the original case the only force parallel to the slope surface was a component of gravity).

Is that correct? If so how would this initial velocity be integrated into the above calculations? Would it simply be that the perpForce is calculated off of the objects velocity+accel due to gravity ?

I'm pretty confused now. Anyone able to clear things up a little for me? Or have I managed to confuse everyone reading this to the point you've no idea what I'm after :)

#1
02/08/2006 (6:37 pm)
After further reading, I think I may be utilising the kinetic friction incorrectly.

If I take the total force as
Ft = Fa + Fn - Fg - (V *kf)
Where
Ft = total force
Fa = Applied force
Fn = normal force
Fg = gravity force
V = velocity
and kf = kinetic friction coeff

then plug that into F=ma such that accel = F / m all thats left is to integrate it with the Tick rate to give
newVelocity = V + accel * dt

I'm not sure if I've accoutned for all forces applied here, nor if the above is correct, but it does now take into account the objects existing velocity before calculating the next step of the sim. Hopefully between the original posts static friction calculation and this one I should be all set :)
#2
02/09/2006 (6:18 am)
Uhh, so did you figure it out? ;)

If not, here's some nitpicky stuff that may send your brain in other directions:

Quote:
Gravity and normal forces cancel each other

That doesn't seem to be right to me because if the normal is pointing off in a 45 degree angle and gravity is pulling you down, then they don't cancel. The normal of the slope is what will bring you down into the valley.

Quote:
kFrictionForce = kFircCoef * NormalForce

I would think that friction is always counteracting the velocity. So if I'm moving horizontally across a slope, the friction would point backwards. So I'd say kFrictionForce = kFricCoeff * CurrVelocity.

Hopefully that helps a bit. I'll have to re-read this a few more times. I think I might be getting caught up on mg sin angle and mg cos angle because I usually think about these problems purely with vectors. Also the wheeledvehicle.cc should have a good example of static vs. moving friction in it.

bzztbomb -- Knowhere Studios
#3
02/09/2006 (11:18 am)
Quote:
That doesn't seem to be right to me because if the normal is pointing off in a 45 degree angle and gravity is pulling you down, then they don't cancel. The normal of the slope is what will bring you down into the valley.

You're definatly right on that one, I'd confused myself whilst writing the post since I was testing friction in a simple case with a flat plane where the contact normal would be the exact opposite of gravity.

Quote:
I would think that friction is always counteracting the velocity. So if I'm moving horizontally across a slope, the friction would point backwards. So I'd say kFrictionForce = kFricCoeff * CurrVelocity.

That's one of the things that seems to be confusing me. I would expect kinetic friction to be based on velocity also (and in opposite direction). However the few books I've looked at on this list the force due to kinetic friction as

Fk = kCoeff * NormalForce

Perhaps I'm missing another piece of the puzzle by considering forces, I guess I need to spend a little more time reading up on this.
#4
02/09/2006 (10:32 pm)
I can imagine they left out these discussions making Invisible War.

"Do grenades roll slowly around slowly rotating 1 foot off the floor in real life?" - Lead HAVOK programmer at Ion Storm
"I think they do" - Harvey Smith
#5
02/09/2006 (11:20 pm)
"But how does the object stop? Since afaik nothing I've mentioned above is calculated based on the current
velocity of the object, it appears that when the applied force is removed, the negative accel will over time
reduce the velocity towards zero, however at some point it will pass zero becoming negative and thus causing the object to start sliding up the hill, which in this case makes no sense?"

the object stops when the forces cancel each other out and the system goes back to equilibrium. friction is a retarding force like drag. it adds a force which opposes the current motion.

friction slows the object so deceleration is taking place. so we have:

vf=vi+at

a is negative acceleration, vf is zero, and vi is the velocity right before the force was removed.

the reason the deceleration doesn't make the object go back up the hill is because friction only occurs while the object is moving. once the velocity is zero, the frictional force is zero as well and the system is back at equilibrium.
#6
02/10/2006 (6:46 am)
Fyi, friction is related to the normal force, and the frictional coefficient of the surface.


to help visualize, imagine an empty cardboard box on a wood floor. it is easy to push (overcome the friction) and it will slide for a little bit before comming to a halt.

now load that box full of bowling balls, then try pushing it. it wont move. The main contributing factor is the normal force is now much greater magnitude.