Slip ratio and angle precision at low speeds

Started by
1 comment, last by Aressera 5 months, 1 week ago

This is my first post on the gavedev.net forum. Hi all!!!

I'm finally working on my first car simulator project, and I'm getting to the point where tires become important.

I'm experiencing a problem - which is probably one that most people have run into - where at low speeds, slip angle and ratio based off velocity start to become imprecise.

For people who don't know, if my forward velocity is 0 and my lateral velocity is 0.0000000001, then my slip angle solves to 90 degrees, which jerks my car to the side.

Here is my code on getting slip angle and ratio, which is based off velocity. My simulation uses a Y up axis.

local slipAngle = math.asin(velocity.X)

local slipRatio = (velocity.Z-self.spin*self.tireRadius)/math.abs(velocity.Z)
if slipRatio ~= slipRatio then slipRatio = 1 end -- NaN, incase dividing by zero

At very speeds, my car ends up being shoved around due to precision, and isn't stable.

If you need any more info on my code or how I'm implementing different things, please dont be scared to ask.

If anybody well-versed in vehicle dynamics is able to send me papers I can read or solutions I can implement for both slip ratio and angle to improve it, it would really help. Thanks!

Advertisement

Perhaps at low speeds you should switch to rigid body simulation, though I'm not an expert in this at all. AFAIK you need a low-speed approach and a high-speed approach (I guess you already have this), because no single method works for all situations. Rigid body physics would fail at high speeds and reasonable time steps.

This topic is closed to new replies.

Advertisement