Vehicle simulation shenanigans: My car slides uncontrollably and I have no idea why…

So, I have all of this cool, fancy vehicle physics stuff which are forced to stay in my Excel sheets, because the basis of my simulation is wrong somewhere, the cars oversteer in every corner and are very twitchy in general. I kept throwing complexity at it, thinking the too simple simulation is the problem. Well, it wasn’t…

I use Pacejka’s formulas for tyre modelling. Currently the simplified model is in use. The code should be right (?):

  • get the contact velocity of the wheel transform or the ray cast hit point
  • convert it into local space
  • separate the vector into VCx(lon) and VCy(lat), Pacejka naming
  • calculate the angular velocity of the wheel
  • calculate the slip velocities VSx(from angular velocity, radius and lon contact velocity) and VSy(which is the same as lat contact velocity)
  • using your standard slip ratio and angle formulas
  • clamp the SR +/-1 and SA to +/- whatever 90deg in radians is, or convert them to whatever the tyre model needs
  • Fz is the suspension force for now
  • calculate pre-combination Fx/Fy
  • then calculate feedback torque from Fx, apply it to the angular velocity calculation

I used the coefficient from Edy’s site among others, but none of them really worked, I even tried curves that have basically no falloff and produce peak force after a set slip.

As for combined forces, I have Beckman’s formulas, although I also have MF6.x model as well.

I thought maybe the setup of the car was wrong, I tried super stiff front swaybars, stiff suspensions, low CGs etc. even though I had the “real” values

Honestly, I’m lost… I’ve spent a lot of time trying stuff, but none of them really worked, or were completely unrealistic. Maybe I have wrong values somewhere, if you could provide some from your project, I’d be glad. Maybe the local velocity needs some extra vector math magic, or I’m not using the correct axis system or I got the formulas wrong, although I double checked them a lot of times.

I think that is the problem. Do the opposite: remove as much complexity as you possibly can.

You should be able to do good car physics with extremely simple code. For example, my very first car physics model used no more than simple vector math. Not even tire friction curves at all. Yet the car could drive, steer, brake, drift and even do burnouts quite realistically. Once you can get into the very basics of what car physics is about, and understand every aspect of “why” and “how”, then you may start adding complexity and get more realistic behaviors consistently.

1 Like