It's really my go-to reference for any practical control theory application.
I've heard someone say that PID is the deepest you can get without in control systems without advanced mathematics and I think hey might be right.
If you know linear algebra, that opens up a variety of state space techniques. If you know a little optimization, that opens up optimal control, including the incredibly common LQR strategy. This stuff is typically accessible for an advanced undergrad with a few of the right prereqs.
But control theory is a deep field. You can find papers that use differential geometry, topology, information theory, etc. for designing control systems.
And this in turn overlaps with machine learning techniques since a problem generalized in this way can subsequently be adapted into a trained system that approximates the same result as the brute force answer.
Ideally, you can use an analytic solution, of course, and that's what you really want to use to get a result that is both fast and precise, but to do that, the "advanced mathematics" are necessary to define the problem appropriately.
It was fascinating, but I just couldn’t grok it. Whatever weaknesses I had in the relevant maths, that class just seemed to amplify it x10.
I still wish I could have absorbed more of the knowledge
It's true that there is a lot of surprisingly deep math in control theory, but even learning just a little bit of the theory can be greatly illuminating.
The trouble with PID is that it is typically treated as a black box with three magic knobs that you twiddle until your system works. This can be very frustrating.
By contrast, by applying a little bit of theory, you will be able to calculate the PID gains and have your controller work the first time.
When things get more complicated like with flight controllers or advanced motor drives PID is not recommended. Another problem I've seen is people gloss over tuning a PID controller properly too.
Funny, in automotive we always left out the derivative component not the integral which IMHO is the most useful component of the controller.
The main price of an integrator is 90 degrees of phase lag; this will harm the stability of many systems but as long as it's kept at a low bandwidth it's usually fine.
The main price of derivative gain is high frequency noise amplification, and so a well designed PID will have a limited bandwidth for the D term as well. For many systems, especially those that are already damped or don't need the extra phase margin, it's not needed or not worth the noise cost.
This, a million times. My senior design project in college was building a quadcopter from scratch (including the control software).
We basically built a test harness out of two poles with strings attached to the quadcopter so once we lifted it off, we could just test different PID parameters until it was stable. I think we eventually built an app to vary them in flight, which was definitely a terrible idea, and we crashed many, many quadcopters this way.
I think the answer is basically "build a simulated quadcopter with the same parameters as yours and test parameters in the simulation", but that probably would have been an equivalent senior project... IIRC, this is basically what you have to do for state-variable feedback, so it's much, much more effort than simply do what we did (especially when the cost of failure is low).
The control loop code is actually fairly straightforward , it was mapping what exactly the PID controller was controlling to the real world application (turning motors on and off).
Should i keep tinkering or try something different (maybe multiple loops or something?) What's next after PID?
Also this is an ambient pressure system with multiple safety precautions to ensure it stays that way.
For a more systematic design, construct a simple mathematical model of your plant. If nothing else, this will allow you to run faster-than-realtime simulations to experiment with parameters. (Thermal time constants are typically annoyingly slow to fiddle with in real time.)
Simulink is an ideal tool for this, but you can just as well use Python or C++. One way to do it is to structure your model as a differential equation and then use a solver to integrate it.
There are several typical lines of attack. Write the plant either as a transfer function and then think about poles and zeros. Write it as coupled first-order linear differential equations and think about state space.
"Feedback systems: An intro for scientists and engineers" by Åstrom and Murray is a popular introductory text. "Feedback control of dynamic systems" by Franklin and Powell is a superb, slightly more advanced college textbook. (The current edition is wildly expensive but older editions are just as good and nearly free.) I also like "Control System Design: An Intro to State-Space Methods" by Friedland (an inexpensive paperback published by Dover).
I really appreciate it! Thanks!
There was, and still is, a comparatively scarcity of documentation on these as most of the content online only tackles PID when it comes to "control systems".
There's also the Control Systems Design Guide, but that's more of a cookbook-style. Dorf and Bishop is a theory book, but a good one.
I remember my PID lab in college - we had two plexiglass towers with water in them and a pump - our task was to calculate the PID parameters so that one of the columns reached a certain level. I think it was measured by a buoy, so we had a pretty noisy input to begin with, but that was part of the problem at hand.
It was a great introduction because the lab was 2h and the pump rather slow, so we couldn't just half-ass it.
A few minor bugs:
- The gray area is always too small, so there's plenty of area of the canvas that never gets cleared.
- Perhaps this is intended, or maybe it's caused by by the demo running at 144Hz, but the drone is always swept away by the wind for me. It doesn't even stand a chance to fight it.
Works fine after setting refresh rate to 60 Hz. (Btw, amazing how bad scrolling looks at 60 Hz after getting used to 120 Hz! Never noticed it before nor did I think it could matter...)
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.
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.
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.
I've since seen something similar but not identical in the Statistical Process Control world: robust process (or product) design. 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.
 Web search results are underwhelming, I refer you instead to Douglas Montgomery's Introduction to Statistical Process Control.
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.
Actually, CVT Management is an interesting control system question in and of itself, especially when fake gears are involved.
Oh, and anecdotally I'll state that while Ziegler-Nicholls was great for my lab exercises, it was, ahem, quickly dropped when I started tuning heavy lifting equipment. Increasing proportional gain until stable oscillation was achieved with 160 metric tons in the test tower outside was, ahem, not boring. Not in the least.
In my class, at no point was it explained why we would want to do this. It was "This is the math for a P controller. Here's some homework. Now test. This is the math for a PID controller....". Things didn't click until years later.
Looking back, it was a shortcoming in so many classes I took. Actually discussing the problem we were trying to solve adds so much intuition and understanding to the mathematics.
Our task was to tune two PID controllers (one for each motor) to move the "head/pickup tip" to the color balls on the screen and then drive back to "drop" the ball in its respective "bucket". We were given the forward and inverse kinematic models, as well as a black box piece of code to actuate the motors, so we could focus on just tuning the PIDs. Lots of fun!
Edit: found a video of a project from a different year, also really cool and about tuning PIDs:
The visualization used here could also work as a nice foundation for more complex controls algorithms for 2D space like path planning splines and pure pursuit.
Any "drone" logic to do with some kind of builder unit or even a literal drone in something like COD needs rules like this.
People could be genuinely interested in this stuff if engineering tried to focus more on creativity than memorization.
Fortunately, for me at least this was fixed when as a postgraduate I joined a research group that was largely control engineers!
We'd already done a form of proportional control with op-amps. It would have been enormously helpful to start control theory with discrete PI and PID to give us a practical grounding and something we could actually use before leaping off into the wider theory, but that's not how academia works...
Happily the guy teaching the lab portion of the class was himself an experienced controls engineer who actually knew how to use the math to accomplish something useful. We learned far more from him than from the lecture classes.
I had always wanted to get a physical intuition for how PID changes led to different behaviors. (And for example, in practical life, how an autopilot doesn't wildly overshoot and oscillate around a VOR radial when trying to intersect it).
also you can use bang bang demo and inertia to orbit the thing moving the point on the tangent at the fastest approach, which is awesome.
This matches my understanding of a simple thermostat, is it wrong?
Why can’t it apply to real drone? Interrupt needed?
Google: 90% of our engineers use the software you wrote (Homebrew), but you can’t invert a binary tree on a whiteboard so fuck off.