I have ported the Pacejka code from the open racer source and got it to draw some graphs. I put together a simple test program with source code and VS9 project, you can download it here. It also includes the live editor from Racer in the "editor" folder that you can play around with to see which parameters change what.
Basically, what the pacejka magic formula does, is describing an empirical tire model, that matches data from real world using a series of coefficients, that you can use the change the behavior of the tire. As input, it takes:
- load - how hard is the tire pressing against the ground
- slip angle - how big is the angle between tire angle and actual heading - for example when your wheels are turned all the way out but you are going straight because of excessive speed, there is a big slip angle (you are understeering)
- slip ratio - how much faster or slower is the wheel turning relative to actual vehicle speed. for example, the slip ratio is positive when there is wheelspin
Take a look at this graph
The black line is longitudinal force (that moves the car forward and helps it to break) and it peaks when the tire is rotating just a bit faster/slower than actual vehicle speed and then drops some when you have excessive wheelspin.
The red line is lateral force (that makes the car steer) and it peaks when you are turning just a bit more then the actual vehicle heading and decreases when you turn too much.
The green line is the feedback that the driver feels on the steering wheel. It increases to a certain angle and then starts to decrease all the way to actually getting positive (helping you steer to the same direction) when your slip angle becomes very large (for example going straight with the wheel turned out). This data can be used to power force-feedback steering wheel.
All the coefficients modify the shape of theses curves to match some tire and conditions.
Now how would I go about using this with NGD?
1. I should be able to get the slip ratio and slip angle relatively easily, this is calculable from what i've already got, right?
2. How would I get tire load when using a car made out of joints (not raycast). The force I am applying as spring-damper is not quite right I guess, can I get the load in the material callback or how?
3. When I have slip angle, slip ratio and load, I can calculate the lateral, longitudinal and aligning forces. How can I apply the longitudinal and lateral forces? I am guessing material callback again, but I'm not quite sure how.
Would be great to get it working, I'm sure this could benefit many trying to make any kind of vehicles with NGD
