> Is a machine learning algorithm capable of getting better results than a PID? Is the extra effort worth it?
Potentially yes, but by it being a component of a completely different control paradigm (MPC). ML itself will probably not improve on PID while still keeping it PID.
So, there are two parts to a control system:
1) The predictive model (prediction)
2) The feedback control law (action)
ML primarily concerns itself with function approximation from data, y = f(x, p), where p are parameters -- in the parametric model case. ML practitioners create predictive models but don't really consider feedback loops. That is more the domain of control theory, which is concerned with system behavior when exogenous inputs (actions) act on the system. The math is different.
ML can be used to fulfill the role of (1). It has nothing to say about (2).
In the PID case, (1) is extremely simple -- it is simply an error function (difference). (2) is where the magic happens... based on the error, the controller computes the right action. The beauty of PID control is that it is technically "model-free" (if you don't consider an error function a model). You can apply it to systems where you have very little data, and still be able to do fairly good job. You could replace (1) in PID with an ML model, but then you would defeating one of the some of attractive qualities of PID control: effectiveness under uncertainty without a model. You can use ML to guide the tuning of PIDs, but that's about it.
That said, ML models have a place. In advanced controllers like MPC, (1) is typically a dynamic (state-space, FIR/FSR, physics equations-based) causal model of the system under control. (2) is an optimization algorithm.
You could conceivably replace (1) with an ML model. This is done in many cases -- in many plants, there is a predictive model that infer states based on images and sound (for instance, using Near Infra Red sensors to inferentially predict certain chemical properties). But that's no longer PID.
For a non-linear system, machine learning can perform much better and solve more complex tasks. Like walking for a humanoid robot. A linearzied PID solution can not beat that.
For linear systems:
Depends of what you mean with better I guess. My understanding is that you can place some of the poles of a system with a PID pretty much where you want. So for a simple linear system: no.
There exist also other controllers where a LQR can be used in linear systems to get a perfect theoritical controller based upon to minimize the cost of control outputs. (yes, several outputs).
However maybe a ML can be used to choose and tune the controllers better than humans?
EDIT:
Also, the discretication is not always perfect (backward or forward euler is common estimates). So maybe ML can help in that too?
> For a non-linear system, machine learning can perform much better and solve more complex tasks. Like walking for a humanoid robot. A linearzied PID solution can not beat that.
Right but you are comparing a nonlinear regression model with a linear control scheme, which isn't really fair. Plenty of nonlinear control strategies exist and are used in practice for things like humanoid walking. Moreover, many people prefer these controllers due to the theoretical guarantees they provide over a learned control policy.
That said, ML does have a place in control theory, and you can find papers going back to at last the 90s (I never looked earlier but they probably exist) that combine the two, and not just in a reinforcement learning context.
> However maybe a ML can be used to choose and tune the controllers better than humans?
Probably not, assuming you are discussing linear systems. You would need to come up with some cost function for your ML algorithm to determine the performance of a particular control policy, but then why not just use that as the objective function for your optimal control algorithm?