how do you calculate lateral and longtitudinal forces?

Started by
9 comments, last by Bow_vernon 13 years, 1 month ago
Im doing the tyre physics part. I calculate them based on velocity of the contact patch of the tyre. It's like
Lon=dot(v,d)*mc1
Lat=dot(v,s)*mc2
v is velocity of contact
d is forward direction of wheel
s is side direction of wheel
mc1,mc2 are magic constant. Do you know How to calc it correctly?
Advertisement
When we were developing FragFist I tried to implement this

Pacejka magic formula

which is supposed to give pretty realistic cornering forces.

However we ended up with a much simpler homebrew "hack". Don't know anymore what formula we used, though
Basically the force will grow up to a certain point but then begin to decline as relative velocity increases even more.
So...basically the pacejka also depends on relative velocity right? I just cant find a straight article that explain it in a more friendly manner...
All they suggest is that I look into phors source code...
Anyway do you use same function to calculate both forces?

Anyway do you use same function to calculate both forces?


I think, yes, you do. But you use the "slip ratio" as the input for calculating longitutinal force, and the "slip angle" as input to calculate lateral force.
where slip ratio = vTyreRot/dot(vTyreDir, vVehicle) and slip angle = angle between tyre direction and actual vehicle velocity.

Then there is something like a friction circle that limits the total amount of force the tyre can generate. That means when you slide around a curve you cannot accelerate or brake as much as on a straight line.
So you cap the force to the max friction value, right? oh and by the way what about low speed cornering? my friend said I'd get trouble using pacejka for this...
Anyway, I make the mc2 bigger than mc1, so the car would turn "tightly" without much slip. But I cap em to the max load plus some magics..
As I said I haven't implemented Pacejka fully as I switched to a custom method which was more arcade-y. The problem seems to be that Pacejka can only be applied to sliding patches. But during normal cruise or low-speed cornering the rubber kind of sticks to the ground creating an adhesion friction which is not modelled by that formula. Another thing to consider: What does Pacejka give you when accelerating from a stand-still? The slip angle and relative velocity are undefined in that case.

I think you have to implement some other methods for those special scenarios.
Unh, seems I will give up on pacejka and develop my own solution then... :(
Thanks for the response but hey, do you know about marco monster cardemo's sourcecode? The original site is down, and I couldnt depend on mirror for the source.
I remember ever downloaded it and it has realistic turning IIRC
I found the original page but the link to the demo seems to be broken :(
You could look into the source code to racer.nl as their cars behave pretty realistic. Or you can just goof around and create your own formula.
You have to judge whether you want driving physics like Gran Turismo or rather Need for speed underground.
The latter feeling more like pushing a 20t cargo container down a pair of rails :D
Well Id like to have one like the GTA, arcadey but still controllable. I take wheel load into my calculation, but now the car wont turn when accelerating(it does a little). Can you share how you calculate the lateral forces? If you mind, just dont then. I dont want to disturb anyone...
I just looked into our old source code. Seems I used the Physx wheel primitive. There you can (could?) just set a few parameters. hm...
Anyway I don't have anymore info to share with you as I was not very satisfied with our car behavior at that time, wouldn't be of much help.
Maybe someone else will jump in who has had more success. Sry.

This topic is closed to new replies.

Advertisement