# friction and instability

This topic is 4145 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I'm writing a physics engine for a game (university project). I was able to implement rigid body collisions and ground contact forces resolving, although it's not ideal. I use the Euler integrator. However, I have a little problem with friction. I needed to implement car physics and for that I calculated friction on the tires, etc. It works ok, but at small velocities the forces are too big and the velocities go back and forth on the +- sides. So the bodies get a little shaky. Increasing the frame rate doesn't help much. At 100 fps I can still see them shaking. I can't really make the forces smaller, as then the cars will slide off slopes, etc. I know that this must be a common problem, but couldn't really find any easy solutions. Can this be solved by tweaking the forces or adding some correcting factors? Or switching to 2nd order Euler or other integrators? I exactly know what the problem is, but cannot think of anything to solve it. Thanks, Michal.

##### Share on other sites
you could limit the force so that its never too large to do that, otherwise, you could check if the dot product with the previous velocity and current velocity is less than 0, which would imply its changed direction, and then set it to 0, or zero it in the plane its on if you know what i mean.

##### Share on other sites
have you seen this already?

http://channel9.msdn.com/showpost.aspx?postid=314874

##### Share on other sites
Thanks, this is a nice interview, but doesn't really provide any solutions. Unless I'll go with the harmonic rods engine or something :).

To the previous poster: I tried zeroing the force when the velocity changes direction, but it didn't help much as in the next frame it would change direction anyway.

Zeroing the velocity is not an option, as I've got 4 tires and if I zero it at one of them, calculating the other 3 will make it nonzero again anyway.

Anyway, if I had a single point of contact I could binary search for a force that exactly zeroes the velocity and it would work great. But having 4 tires, I'd have to search a 4D space and I probably wouldn't find a solution anyway.

Maybe there is some iterative method similar to collision resolving ones, but I'm not advanced enough to come up with something like that.

##### Share on other sites
This might be useful for you:

##### Share on other sites
I hope you mean this integrator
va = va0 + a*dt
position = position0 + va*dt

If so you might compute it by your original way, and show smoothed results on the screen. (basically cancel that wobbling) The other way would be using symplectic six order integrator. Considering your function is cheap to evaluate, it would be slight slowdown. However high order integrators might hate discontinuities.

Are you using doubles? This should be computed in 64 bit precision.

1. 1
Rutin
33
2. 2
3. 3
4. 4
5. 5

• 13
• 76
• 11
• 10
• 14
• ### Forum Statistics

• Total Topics
632968
• Total Posts
3009585
• ### Who's Online (See full list)

There are no registered users currently online

×