Control theory was also one of my favorite classes that a low of software people should learn (at least the very basics). So many hand rolled heuristically driven if/else type systems that can simply be replaced more reliably with a PID.
Control theory was also one of my favorite classes that a low of software people should learn (at least the very basics). So many hand rolled heuristically driven if/else type systems that can simply be replaced more reliably with a PID.
Absolutely the worst control systems of all time have been written by software engineers that don’t understand control theory. The second worst control systems are designed by those who only know the PID heuristic, and can’t be bothered to model a little non-linearity from motor drives saturating.
The biggest problem with PID control is that the integral term performs double duty as both a signal that accumulates small errors to minimize the steady state error, but also as a signal that shows deviation from the target due to unmodeled constraints.
It should be pretty obvious that you cannot overcome constraints by moving even harder in the direction of the constraint, which is what the integral term does.
I've played around with this over the years in my career but have found that tuning PID loops is very tricky, much trickier than creating a soup of if/else clauses and much less auditable to those who don't understand the math.
PID is standard in the industry, but the reality is it is infinitely easier to model in the discrete domain. The z-plane if math, but you don’t really need much math. Just model like a games developer. Simulate with a bit of JS or python. Add the motor saturation! Play with feedback and disturbances.
I just think this gives much better results. The model can be as simple or complex as you need, and we aren’t trapped in the linear response range. PID is good enough for many tasks, but it’s never good.
Yes, but...
If you can model your problem with linear differential equations then control theory replaces the need for tuning. The coefficients you need just pop directly out of the analysis.
Maybe I should add more context. I have specifically tried applying PID style feedback systems to computational problems, not controllers that interface with hardware, circuits, etc. My undergrad was in math and electrical engineering, I "pivoted" to software as a grad student (though I was always very involved in the software side of my department; I was a coder from when I was a kid.) The place I found it to work the best is with designing a homegrown autoscaler years before k8s ever became a viable thing for a company to play with [1]. Most of the problem domains I applied it to do not have linear models that can effectively model the theory. Yes I know that a PID is only proven to be stable when working with linear systems, but this is the reality of the problems I've worked with.
Eventually when if statements stop working I found that decision trees work great and XGBoost continues to be a great iteration of a decision tree.
[1]: I was an early hire at a tech unicorn and we built an autoscaler pretty early into the company's tenure. While it was a great success for a long time once k8s became established in the industry we had a really hard time training new talent to it and I left as we began a massive company-wide effort to move our workloads onto k8s.