In automation systems, a controller for a process is very important to implement. When I mention controllers here, it does not mean a PLC or something. Controller here refers to a mathematical calculation which works automatically to maintain a process variable near the set variable. This ensures that your process is working near the desired value.
PID Controller vs. MPC Controller
There are two types of controllers which are widely used in automation, which are PID and MPC. Both have vast differences in their working and motives. In this post, we will see the difference between a PID controller and an MPC controller.

What is a PID controller?
PID stands for proportional, integrative and derivative. These three parameters are the basis for calculating the values. Let us understand with a simple example. You have a furnace with a temperature sensor and a control valve to regulate the flow of steam to the furnace. The control valve functions to pass only the required amount of steam to the furnace, so that the temperature inside the furnace is maintained. For this, a PID controller will be used, which takes input from the temperature sensor and controls the output of the control valve. Due to this, the temperature will be maintained around the desired setpoint.
PID is an error correction algorithm. It does this by considering proportional value, integral value and derivative value. Due to this, if the temperature sensor shows that the temperature is rising above the setpoint, then the controller will command the valve to start closing. If the temperature sensor shows that the temperature is falling below the setpoint, then the controller will command the valve to start opening. How fast the valve should operate, after what time the action command needs to be given and what difference the controller will consider between errors, depends on the values of P, I and D.
A higher P means faster response with a larger action, and a lower P means slower response with a smaller action. The higher I is, the more quickly the action will be taken to minimise error, whereas a lower I means the action will be taken slowly to minimise error. D adds damping and stability.
These calculations are embedded inside the controller, and you just need to link the input and output. The values of P, I and D vary based on the process conditions and how fast the process can change. It can happen, like your process is slow and you operate it rapidly, which is not good. The same can happen vice versa.
What is an MPC controller?
MPC stands for model predictive control. As the name says, this model works on prediction. So, where the PID was able to control only one input and one output, MPC can work with multiple such numbers. It predicts the future outputs and checks which is the best possible control output by trying all combinations internally and then deciding. So, for example, let’s say the PID is just trying to correct the errors by comparing the set value with the process value, MPC will do the same thing by predicting all possible input conditions, how the output will work in each case and then select the best required control method for keeping the process variable constant.
In our example of the furnace discussed above, let us add one more parameter – oxygen level. If the temperature increases, then the oxygen level will change. But how to control it, because the PID loop was only considering temperature, and there is no control for oxygen. So here comes the role of the MPC controller, which will take both the inputs of temperature and oxygen, perform all internal combinations of high, low and medium values, and generate the outcome. This will give the controller beforehand predictions on what will happen, and accordingly, it will choose the best control output for the same.
At every second, MPC will predict how temperature and oxygen will behave and affect the output. With all these combinations, it finds the one which will give the best control output. Every cycle, it updates the measurements, predicts again and finds the next optimal moves. In short, it takes corrective action from the very first step and does not wait for error deviation. Due to this, the process variable is always maintained around the set point.
Difference between PID and MPC

- PID uses only the present value to minimise the error, whereas MPC uses both the past and present values to minimise the error.
- The nature of PID is reactive, whereas the nature of MPC is predictive.
- PID can work even in a PLC, but MPC does not work in a PLC. It works on higher levels like DCS, MATLAB, IIoT controllers and SCADA.
- PID can handle only a single input or output, whereas MPC can work with multiple values.
- PID is used for simple applications, whereas MPC is used for complex applications.