4 ms·
A good demonstration of the perils of Proportional-only control -- if the only input to the system is only the instantaneous distances to obstacles, the car can
by jakear 5y ago
A good demonstration of the perils of Proportional-only control -- if the only input to the system is only the instantaneous distances to obstacles, the car can't make any decisions that take into account its momentum. This means it's destined to overshoot the target, as we see in the demos.
Consider: if you were given a freeze-frame view of the car in the exact right spot, what controls would you send it to keep it there? It'd be impossible to say without knowing the car's velocity - if the car was in the process of reversing, it should apply forwards acceleration to come to a stop, but if it was in the process of going forwards it should apply reverse acceleration.
The solution is to add Derivative control. This would look like a second set of inputs to the system comprised of the difference between the current measurements and the prior ones.
- deleted 5y ago[deleted]
- dahart 5y agoYup. 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.
- polishdude20 5y agoI've actually used a PID controller on my thrust vectoring rocket (actually there are two controllers, one for each axis). I made a sim to try and find the correct PID terms needed before flight : https://codesandbox.io/embed/rocket-sim-final-with-position-control-0oq6u?file=/src/index.js&codemirror=1 https://codesandbox.io/embed/rocket-sim-final-with-position-...
- mr337 5y agoSame, also amazing how simple it is to implement a PID controller and how well the results are. I use them all the time for computer mechanical control interfaces. There are supposed to be better controllers but dang PID just work.
- Gibbon1 5y agoWhat one of my book on process control said was anything 'better' than a PID controller needs to be carefully matched to the process being controlled. That involves some sort of model which then needs to be accurately match what's happening with the process. That itself is hard. Usually better to design the process to be controlled by a PID than the other way around.
- deleted 5y ago[deleted]
- LorenPechtel 5y agoAnd note that if it's more than 4m from the space it has absolutely no ability to find it other than luck.
- quickthrower2 5y agoIn real life if you are more than 4m from the space, someone else has taken it. The real AI challenge is to automate the yelling at the person who took your space.
- xixixao 5y agoWe used PID in our robotics class (for driving). But I was dismayed how little literature there was on the topic. From my research back then “the details are closely guarded company secrets”.
- quickthrower2 5y agoSome espresso machines use PID to give a consistent temperature - I think I now understand better what it does based on this explanation. Thanks!