Sign in to follow this  

how do you calculate lateral and longtitudinal forces?

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
When we were developing FragFist I tried to implement this

[url="http://www.racer.nl/reference/pacejka.htm"]Pacejka magic formula[/url]

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.

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
[quote name='Bow_vernon' timestamp='1298162258' post='4776507']
Anyway do you use same function to calculate both forces?
[/quote]

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.

Share this post


Link to post
Share on other sites
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..

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
I found the [url="http://www.asawicki.info/Mirror/Car%20Physics%20for%20Games/Car%20Physics%20for%20Games.html"]original page[/url] 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

Share this post


Link to post
Share on other sites
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...

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
It's ok. Anyway, my method is quite good. It didnt turn because the torque was too big that the car's front tires lifted up so of course it wont turn. I lowered the engine power and now it behaves quite well. Anyway, do you implement axle(so the angvel of both tires are equalized)?

Share this post


Link to post
Share on other sites

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

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this