3 ms·
Excellent 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 ha
by whatever1 3y ago
Excellent 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!
- Loic 3y agoTo complement your comment, you anyway need a set of PIDs to control your process to your set point defined by your MPC, so good underlying PIDs are a prerequisites to the higher up algorithms (but unlike you, I am not an expert in control, only dynamic simulation...).
- gmadsen 3y agoyou can output a control action with mpc
- polishdude20 3y agoCan you give examples of when you'd want to use the other methods?
- rcxdude 3y agoGenerally speaking, if you have a horrifically non-linear system you still want good performance on, or you have a very predictable system and enough sensor inputs to predict its behaviour and you want to get better performance than you can get from a purely reactive form of control (though, in a lot of cases like that, PID + some form of feedforward control is almost as simple and can work really well without needing to dive into more advanced controllers). PIDs can control most any system but they are rarely the optimal controller for any given system. That gap only tends to be really large in the situations I've mentioned, though.
- carlmr 3y ago>if you have a horrifically non-linear system you still want good performance on Even in that case PID is often the answer. Only that you vary the P, I, and D factors. It's called gain-scheduling [1]. You linearize your non-linearities at multiple points, and change your PID parameters to match. Of course non-linearity is a very broad concept. So this may or may not apply to your non-linear system. The class of linear systems is easily described. The class of non-linear systems is everything else. [1] https://en.wikipedia.org/wiki/Gain_scheduling https://en.wikipedia.org/wiki/Gain_scheduling
- nihzm 3y agoPID control becomes kinda useless as soon as you have a coupled high dimensional system, think something like a drone with aerodynamics or a robot a high number of DOF. There are of course patches so that you can still apply multiple PIDs but the intuition on why it won't work is that each PID doesn't know what the other PIDs are doing, and this often leads to unstable control actions. Another place where PID cannot be applied is in discrete-event systems (eg network of devices that needs to sync up using messages and do something).
- blagie 3y ago
- DannyBee 3y agoAgree 100% The hardest part of PID for folks to get a handle on is how to tune it, ideally automatically. People often just twiddle with numbers and get frustrated For hobbyists, the availability of correct automated tuning algorithms is sparse, even though the algorithms are well known and actually not that hard once you translate "control theory speak" into "computer science speak". Most folks would be better off autotuning for their systems. I actually wrote and published some auto pid tuning code years ago that uses the relay method here: https://github.com/dberlin/PLC-PID-Autotuner https://github.com/dberlin/PLC-PID-Autotuner (It's in PLCopen, but i can give you codesys versions/etc if you want, and converting to something like arduino would take no time, but someone finally made a working arduino library i think) Nowadays you can find a few more working libraries, but still. One example: I use a PID to control a vacuum motor on my CNC machine being used to hold down parts, set to achieve a certain amount of PSI in clamping pressure. The system is basically undisturbed for long periods of times, but a hole gets cut in the part and the amount of vacuum needed to maintain hold-down goes up. This is a very simple system - it needs fast response, but the response is very straightforward - there is a very direct relationship between speed of vacuum motor and hold down pressure. It can also be safely overshot, but not undershot. (IE if it goes wild and moves the motor too fast nothing bad happens, but if it wildly undershoots it the parts move and get ruined :P) Simple autotuning methods work great on this kind of system. I watch people twiddle with values, you name it. It takes about 2 minutes to auto-tune a pid here (mostly swapping a part with no hole and a part with a hole) and the result will be better than anything you come up with manually. There are more complex methods, as GP mentioned, but they won't drive much better results than you are already geting for this kind of system. The place where PIDs fall down (in systems hobbyists might use) tends to be something like controlling the temperature on a big green egg. They can maintain a steady state to within 0.1degrees or whatever once warmed up, but they get super-confused by the warm-up time. They can also oscillate into chaos very easily because of the lag time between "blowing on fire" and "temperature probe notices result" (which is highly dependent on accuracy and response tme of the probe). Overshoot is also bad because the only way to make temperature go down is to stop blowing on the fire, etc. The result is that most smoker controllers have a warmup time/phase before they engage a PID, and then carefully adjust to avoid overshoot. While more advanced methods might control this completely without the need to do the initial warmup phase, it's not obvious to me the complexity is worth it for that sort of thing. You are talking about going from simple loop that you can plot and reason about to often much more complex mathematical formalisms. It can quickly become an even more magic box that you can't touch. There are of course, places it is worth it, i just doubt most hobbyists will run into them.