Hacker News new | ask | show | jobs
by jagged-chisel 2223 days ago
OT anecdote

If the cruise control in my vehicle is using PID, it still needs some tweaks. It's super aggressive when it's lower by 2pmh and often overshoots.

My mom's is horrid: takes forever to get up to speed, then allows downhill drift to drive the vehicle nearly 5mph over the set speed.

I feel like this kind of stuff would be fun to tweak in a simulator to help me understand why it doesn't work better, or show that I'm not entirely crazy and it can indeed be improved.

5 comments

In cars with manual transmissions, stepping on the clutch turns off the cruise control. In one '96 Honda Civic I was driving, I decided to see what happens if you slip it out of gear while cruise control is on without stepping on the clutch.

Answer: it revs the engine up. I hit the clutch before I got the chance to find out whether the cruise control or the rev limiter has ultimate authority. My guess is the rev limiter, but I didn't want to bet on it.

Still, it's surprising that a computer that clearly knows vehicle speed (well, wheel speed) and engine speed (presumably, for engine control reasons) doesn't know that the vehicle is out of gear (or suffering some kind of serious mechanical malady) and respond appropriately.

What's often hard about this situation is tuning to one problem case (fixing that downhill drift) often makes a different scenario worse. For example, fixing the downhill drift can make that overshoot worse.

I can imagine tuning something like this for a cruise control scenario would be tricky, because there's probably hundreds of different cases to test for.

I think a simulator here could be particularly fun to toy with, because you could have "unit tests" with 200 different scenarios that you try to optimize for. You could set your parameters, and it could run the 200 different scenarios, and show you were your parameters did well and where they did badly.

There's a lot of literature spread across a bunch of fields. The one I first saw was "Active Nonlinear Tests"[0] from the systems dynamics / complex systems area. The idea is that you perform searches of parameter space for a simualation to find the places where it exhibits dramatic nonlinearities.

I've since seen something similar but not identical in the Statistical Process Control world: robust process (or product) design[1]. The idea is that any given system can be thought of as a function that represents X = F(a, b, c, ...) + E, where E is some measure of error or noise that can't be removed. The goal is to find settings for a, b, c etc that minimise the effect of E. So that even if uncontrolled noise swirls around, your process remains stable. You can imagine flipping that to look for maxima instead.

[0] https://www.santafe.edu/research/results/working-papers/acti...

[1] Web search results are underwhelming, I refer you instead to Douglas Montgomery's Introduction to Statistical Process Control.

My wife's Kia downshifts when you go more than a certain amount over the set-speed, which lets it apply "negative" throttle with engine braking.
Adaptive cruise control (ACC) is a common toy control problem. The dynamics can be modeled in a very straight forward way. A little bit of google can probably tell you how to implement one.
That accounts for catching up to other vehicles. It doesn't deal with the problems I mention.
Hrm... I wonder if they use a feed-foward control taking into account the angle of the dangle?
that's an example of non-linearity. probably the car only applies throttle to regulate speed and not brakes.

home heating systems are similar in that the usually only add heat.

in both cases, the PID would be generating the proper output, but it doesn't have a means to drive the system consistent with its output. e.g. it can't turn on the brakes, or air conditioner.

Both vehicles do have some mechanism to slow the vehicle. It feels like a variation on downshifting; it doesn't feel exactly the same as when I'd downshift (whether a manual transmission, or an automatic transmission in 'let the human decide the gear' mode.) When they're "too far gone" (in mine, it's 2mph over, in mom's it's 5mph over), it starts actively reducing speed in this odd way.
If it's a newer vehicle, it's possible there's actually a CVT rather than a traditional automatic. Some Manufacturers will put in 'fake gears' in a CVT because drivers feel like the car is going faster when it shifts (even though it actually doesn't, the CVT itself can keep the vehicle in an optimum power band all the time.)

Actually, CVT Management is an interesting control system question in and of itself, especially when fake gears are involved.