2 ms·
It’s funny, a while back I was working on a video game and starting writing a dumb AI driver for a semi-physical car. I started by doing the thing in the articl
by dahart 4y ago
It’s funny, a while back I was working on a video game and starting writing a dumb AI driver for a semi-physical car. I started by doing the thing in the article, using the P term only, for the steering input to the car. It’s the same thing I’d done for follow-cameras in games with success.
Much to my surprise, steering a car in proportion to how far off track it is turns into an oscillation, and the more you damp the proportional term, the more unstable and divergent the oscillation gets! Well I’d had differential equations in college, but when someone told me that me PID controllers were the solution to my driving AI, I was very surprised I’d never heard of them before.
PID controllers are neat, they’re almost like a suspension shock with an adjustable spring that has damping and rebound controls, but unitless and you can plug them into anything.