Skip to main content
GameDev.net gamedev.net
🔒 Locked

Car Physics Wheel Angular Velocity and Wheel Spin

Started by mayonakadigital Jan 3 at 10:09 PM 1 replies 900+ views
Original Post
mayonakadigital
mayonakadigital

I'm working on a physics simulation for a vehicle. I'm calculating each wheel's angular velocity by taking the velocity at the wheel's contact point and dividing by the wheel radius (ω = v / r). This works as I need to know the angular velocity for engine braking.

But I'm stuck on how torque works during wheel spin. If the wheel is in contact with the ground and not slipping, the velocity at the contact point is 0, but if I want to apply torque to make the wheel spin (like accelerating or losing traction), I still need the wheel to rotate.

So how do you correctly apply angular velocity to a wheel in this case? Because using v_contact / r breaks down when v_contact = 0, and doesn't let the wheel spin even if torque is applied.

Aressera
Aressera

Angular velocity is in units of radians per second. If you want the wheel to turn so that the vehicle moves forward at a certain speed Vf (units per second), you first calculate the desired angular velocity of the wheels as Va = 2*pi * (Vf / (2*pi*r)) = Vf / r. This equation says that when the wheel rotates once (2*pi*r units), it goes 2pi radians. So if the vehicle goes Vf units per second, (Vf / r) is how many radians per second the wheel must spin.

Given the target angular velocity Va and current angular velocity Vac, you can determine how much torque can be applied to make the angular velocity converge to the target as Torque = InertiaTensor * ((Va - Vac) / deltaTime), where deltaTime is how long the torque is applied. This torque is simply the time derivative of angular momentum. You probably want to clamp the torque magnitude to the maximum torque that can be produced at the wheels, to avoid instantaneous acceleration.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.