11 ms·
PID Without a PhD (2016) [pdf]
- gembeMx 3y agoMost undergrads who took Control Engineering courses can "PID without a PhD", what's the point ?
- Waterluvian 3y agoYeah the title is kinda meh. Teenagers on the robotics team I mentor have figured out PID loops and calibrating them (and how funny robots are when you don’t)
- frisbee6152 3y agoI was on one of those robotics teams, and I recall this document being passed around as suggested reading on that team. It’s probably worth considering that this was written in 2000, when it was a more niche topic, and was probably itself a part of what made PID programming more accessible in the first place.
- jldugger 3y agoI mean, Control Theory has been part of engineering cirricula for a lot longer than that. But the internet wasn't nearly as pervasive then, and Wikipedia wouldn't be founded until the next year.
- zelos 3y agoPID design was on my undergrad Chem Eng 2nd year curriculum in the 90s. I took it the year Starcraft came out, so my grade suffered a bit.
- throwaway143829 3y agoCan confirm, I broke the robot once when I accidentally had the sign flipped on the PID error term.
- mcbits 3y agoSome people aren't undergrads who took Control Engineering courses.
- blagie 3y agoThe whole point of PID is any idiot can tweak things to make it work. Ph.D means you're doing something like: * H2-optimization and optimal controls * System ID * Intuitive classical controls (Bode obstacle course, Nyquist, root-locus, etc.) * Fancy discrete state-space methods / search / shortest path * Machine learning, and the thing training itself ... and so on. PID is nice since it's idiot-friendly. (And even with a Ph.D and a complete understanding of all of the above, it's often more fun or efficient to be an idiot and just use PID; I've never seen a place where PID was the right answer, but it's oh-so-often a good-enough answer)
- WanderPanda 3y agoFor many systems the optimal PD can be seen as the right answer (LQR)
- kurthr 3y agoZ-transforms or bust!
- dwattttt 3y ago> PID is nice since it's idiot-friendly It may be idiot friendly, but boy do I wish the idiots who did the noise cancellation on my earphones had heard of integrator windup.
- neodypsis 3y agoThe linked PDF appears to be an older version (2000), there's a newer one (2018): https://www.wescottdesign.com/articles/pid/pidWithoutAPhd.pdf https://www.wescottdesign.com/articles/pid/pidWithoutAPhd.pd...
- caditinpiscinam 3y agoThankfully. The original had some highly questionable design choices: four parallel columns of text (each ~30 characters wide), images inserted mid-paragraph, and code samples in proportional font.
- deleted 3y ago[deleted]
- dang 3y agoOk, we changed to that from http://manuals.chudov.com/Servo-Tuning/PID-without-a-PhD.pdf http://manuals.chudov.com/Servo-Tuning/PID-without-a-PhD.pdf above. Thanks!
- whatever1 3y agoExcellent source for PID heuristics. That being said PID control is >100 years old concept and we have done tremendous theoretical progress since then and we have access to fast numerical solvers for constrained optimization. Look for Model Predictive control, Dynamic Matrix Control, Adaptive Control, or even Linear Quadratic Regulator.
- pinkmuffinere 3y agoThis comment gives the impression that users should consider other methods instead of PID, but this is not the case. For 99% of applications, PID is more than enough. Many robots are just PID control and trajectory planning. If you are so new to control theory that you’d need the linked article, I want to assure you that PID control is 100% the right starting point for you. If you can’t get it to work, bring in a friend/consultant/professor with controls experience, and they’ll tell you if you need another method. Source: I have a masters in control theory, a publication, and ~5 years industry experience
- Gibbon1 3y agoThe top three things I learned in control theory class were 1. PID's work adequately for more situations than anything else. 2. If a PID doesn't work you should redesign your hardware. 3. Phase noise will totally mess with you.
- regularfry 3y agoThe problem exemplified in the top comment was perfectly demonstrated by my control theory classes, where we ended up with a dramatically distorted view of how you actually use the damn thing because they didn't teach us PID at all. It was treated as a special case that was trivial to analyse given the other techniques they wanted to teach us, so it got no airtime.
- hef19898 3y agoThere are countless AI start-ups that can built around ignoring your point 2), those would even perfectly fit YCs last call for start-ups!
- ducktective 3y agoAh...reminds me of an old saying. It goes like: There are only two types of controllers: PID control, PhD control
- Physkal 3y agoThis was very clear reading, without getting too bogged down in the math equations.any other reading suggestions entering into this topic?
- RossBencina 3y agoThe topic is "Control Theory." The author's book "Applied Control Theory for Embedded Systems" may be a useful addition if you're going to apply this stuff. I found the book helpful, but I personally didn't find it as clear and easy to read as "PID Without a PhD". PID control is probably what you'll see in an introductory undergraduate engineering control theory course (which I haven't taken). I think you'd typically study the dynamics using numerical simulation and Laplace transforms. You might think about making a practical project (I made a PID reflow oven controller). After that you're off to the races with State Space methods (e.g. Chen's "Linear System Theory and Design".) and you can think about problems like stabilizing a quadrocopter based on inertial measurements.
- scrlk 3y agoNot reading, but during my degree, I found the series of control systems lectures from Brian Douglas to be useful: https://engineeringmedia.com/ https://engineeringmedia.com/ He also has a free "The Fundamentals of Control Theory" book (I haven't read it, so unfortunately I can't provide an opinion on it).
- tw1984 3y agois it possible to replace PID with reinforcement learning and get better results in general?
- 317070 3y agoGenerally yes and yes. But you will need _a lot_ more data and compute for reinforcement learning. So RL is usually too cumbersome for relatively little gain. Source: I'm a roboticist working with RL.
- moffkalast 3y agoYeah I doubt there's much point without insane amounts of data, and if you do have the extra onboard compute a particle filter can probably leverage it more effectively.
- HPsquared 3y agoBetter results in general, with the occasional unexplainable glitch.
- elteto 3y ago“Control rods go brrrrrr”
- blagie 3y agoI'll be the odd man out. No and on. 1) One of the key things in control systems is to deal with uncertainty. If you have a hundred trains, none of them should crash. You want a control system which you can understand to work even in corner cases. ML is bad at that. 2) You need to train an ML. Unless you have a very good model of the thing you're controlling (generating which is usually harder than designing an optimal control system), training an RL means crashing airplanes, burning out amplifiers, or destroying self-driving cars as the system "learns." Even so, when moving from model to reality, it's likely you didn't capture some oddball part of the system. 3) In many cases, there is some give-and-take between control system design and system design. In an extreme case, the PID can be purely mechanical or electrical (e.g. an op-amp). In a less extreme case, if you can design the mechanical system to avoid having e.g. a right-half-plane singularity, controls becomes easier. RL isn't at the level where you can do that kind of codesign. 4) It's a lot more complex. So "in general," no. In some specific cases, yes. RL is mostly beneficial for rather complex systems, such as walking robots or anytime a word like "nonholonomic" comes up. For relatively linear, relatively low-dimensional systems, classical methods will give better results for less effort.
- deleted 3y ago[deleted]
- nappy-doo 3y agoPID has been a super power in my career. I've used it to solve problems others couldn't even approach (it helps being the only EE in rooms full of CS people). I can claim to have made hundreds of thousands of dollars by just typing in the control loop from my undergraduate textbooks.
- boffinAudio 3y agoLikewise. I have made hundreds of thousands of dollars building entire embedded execution environments designed just to host and run a 25-line PID function .. its surprising just how valuable a well designed PID can be ..
- chasd00 3y agoWhat was the use case? Maintaining level flight or something like maintaining returns on a stock portfolio?
- nappy-doo 3y agoMost recently, as a manager, I had someone on my team use it to control our memory usage in a garbage collector. I've used it to control temperatures in multiple pieces of high-end scientific equipment. I've used it consulting. It's not a stretch to say I have been a hero multiple times. CS majors (I was EE) aren't generally taught PID, and I have milked my arcane knowledge. It's very profitable to type in the control loop, do some Ziegler-Nichols, and go home early. EDIT Oh, I forgot the most recent time I've used PID was with the high-school robotics team I coach. We used PID for part of our robot. I didn't go too deep with the students, it's really just a P controller, but it solved the problem, and dramatically simplified the code.
- seidleroni 3y agoAt my first real Engineering job, I used this paper to both understand and implement a PID control system. Then by using the Ziegler Nichols method of tuning, the system was controlled way better than anyone had expected. Since then I have used it a handful of times with minor tweaks and each time it feels like magic when things work well. https://en.wikipedia.org/wiki/Ziegler%E2%80%93Nichols_method https://en.wikipedia.org/wiki/Ziegler%E2%80%93Nichols_method
- crispisulcans 3y agoHonestly, I wish folks would stop recommending PID as the go-to tool for control design. Like some others have said, it is never the right answer in any non-trivial system. The problem with newcomers blindly incorporating it into their design for quick satisfaction is that they have just done so at the expense of making someone else's job harder down the line. In a system where many things are interconnected or nested, introducing artificial dynamics via feedback in one part often leads to unpredictable and undesired behaviour in another. Then the next junior engineer comes along and thinks the weird behaviour can be solved with more PID loops, repeating the process until you end up with a un-tuneable mess with a precariously narrow operating region. If you are working in this field, no you don't need a PhD, but for the love of god invest some time into learning more appropriate techniques for the work. Start with learning to work with MIMO systems in state-space, then learn to use LQR (literally a one-liner in MATLAB) and reduced-order observers, then some nonlinear techniques like Lyapunov functions and integrator backstepping for those tricky nested loops. I'm happy to suggest resources for anyone interested.
- Thorondor 3y agoIn my experience, there are a lot of applications that are "trivial" enough that PID works fine. I'm reasonably comfortable with state space modeling for systems with more variables. But OK, I'll bite - always open to picking up something new. What resources would you suggest for someone who wants to learn more about nonlinear controls?
- crispisulcans 3y agoWithout knowing any specifics I would say the most universally useful tool to have in your nonlinear controls belt is Lyapunov control design and its extensions (if you're familiar with Lyapunov equations in linear systems that's where the connection starts). It leads to useful methods that are applicable to many systems, and allows you to handle some particularly tricky situations. Wikipedia's articles on these topics are surprisingly decent: https://en.wikipedia.org/wiki/Control-Lyapunov_function https://en.wikipedia.org/wiki/Control-Lyapunov_function https://en.wikipedia.org/wiki/Backstepping https://en.wikipedia.org/wiki/Backstepping as well as Stanford's lecture notes: https://web.stanford.edu/class/ee363/lectures/lyap.pdf https://web.stanford.edu/class/ee363/lectures/lyap.pdf Check out Robust Nonlinear Control Design by Freeman and Kokotovic for more on this. Compared to linear control theory, nonlinear controls is much more fractured and domain-specific. No concept is as widely applicable as ones from linear controls. Khalil's Nonlinear Systems book is generally considered a top reference, but it does start to get into the PhD-level stuff and I don't recommend it to a non-specialist unless you are really into this stuff. I can give more specific recommendations if you have a particular industry or application in mind.
- imba404 3y agoThe Arduino PID library write up covers more real-world instances such as derivative kick, and set point adjustment. Props to Brett Beauregard for documenting how the code evolves as features are added. http://brettbeauregard.com/blog/2011/04/improving-the-beginners-pid-introduction/ http://brettbeauregard.com/blog/2011/04/improving-the-beginn...
- ngneer 3y agoI am new to control theory, since it was not taught in CS curriculum. Other than reading Maxwell's On Governors and Norbert Wiener to get a sense of the history, there is a lot to explore. I have recently been working with ControlSystems.jl in Julia, and can recommend it as a rather intuitive modeling toolkit. Control math can get involved, but there is no reason why the programming should be. There is a package for discrete PIDs, but also for more advanced analyses noted by other commenters. https://juliacontrol.github.io/ControlSystems.jl/stable/ https://juliacontrol.github.io/ControlSystems.jl/stable/
- vrinsd 3y agoTim Westcott is a great author and this is a solid article. I'll add, I've been meaning to write up my own "realities of PID", one day I'll get around to it. What is NOT readily apparent when you look all these treatments of PIDs is what happens with the poles-zeros of your control-loop (PID) and the interplay with the system or plant. I have consistenly found all these "it's so simple, integrator removes long-term error, differentiation improves response time" ignores the fact that if you don't pay attentions to the poles-zeros of your overall response you get some very puzzling results. In a nutshell, understanding the s-domain (Bode) view of your plant and control-loop means you can usually use PID to sovle control-loop problems. But most people don't have a model of their plant (like some of the examples DannyBee has listed) which means you can't easily auto-tune a PID or most control-loops. Examining the step-response is probably the first clue to your plant, assuming you won't physically break something with that stimulus...
- RCitronsBroker 3y agothat’s what i used to install a PID in my espresso machine, replacing a boring and inaccurate bimetal thermostat.