3 ms·
Yup. And an integral term too. Writing racing AI for a video game is exactly why I ran into PID controllers (Proportional-Integral-Derivative). If you steer onl
by dahart 5y ago
Yup. And an integral term too. Writing racing AI for a video game is exactly why I ran into PID controllers (Proportional-Integral-Derivative). If you steer only in proportion to error, not only will you overshoot, but it’s super easy to get into a divergent state where the overshoot gets bigger with each turn. The very surprising thing from an intuition perspective is that if you dampen the proportional term, the instability only gets worse!
When this happened on my job, I was very surprised that I hadn’t heard of PID controllers in CS school. They’re standard in other kinds of engineering.
There are often better variants and alternatives to a basic PID controller, but I’m quite partial to the core idea - the three terms in the PID controller are analogous to car/bike suspensions. It’s a unitless suspension system for sensors & data. Spring rate is like your proportional term, and compression damping and rebound damping are like the derivative and integral terms. This analogy ain’t perfect, but I dig the concept.
- learc83 5y agoI took a class in my CS program where we had to write PID controller software running on a microcontroller to keep water at a specific temperature using a hot plate. My concentration was embedded systems but the majority of the class were just regular CS students.
- jakear 5y agoI’m not aware of an analog for Integral control in standard bike/car suspension. Integral control is steady state loss minimization, and the precise steady state position isn’t a big deal for most suspension systems. An exception could be “air ride” suspensions, where once the driver has “keyed in” a 1’ clearance target, the car could adjust the air levels to maintain that despite changes in load (person gets in, car drops due to gravity, air pressure increases until 1’ clearance is regained). I am not sure if this is how such systems work in practice. But yes, I couldn’t imagine a CS education without controls. My intro CS class in college explored controls in some depth and I took a follow up class. Some of the most incredible things I’ve created were control systems, and it’s one of the primary classes I think of when people ask about the merits of a college education.
- dahart 5y agoLike I said, the analogy isn’t perfect. However, I’d argue that rebound damping is loosely analogous to integral control, because half of it’s purpose is to control how much “pack down” you get, which is the suspension terminology for failure to return to the right steady state quickly enough. Too little rebound damping and you get overshoot, too much rebound damping, and your steady state drifts (integrates) away from nominal and your suspension performance can suffer or even fail.