Engineers-Excel.com

     
Engineering using Spreadsheets

MPC Simulator: How it works

Description
How it works








This tool is a simple version of a full fledged Model Predictive Controller. It works by using the Solver Tool to minimise the sum of the squared error between the predicted output and the reference trajectory. Excessive movement of the MV is penalised using the Move Penalty tuning parameter. Control and prediction horizons are fixed, they are not usually used as tuning parameters for an MPC.

A more realistic controller will have move sizes constrained. This makes the optimisation problem a Quadratic Programme (QP) which is quite hard to solve. The solver that comes with Excel is designed for linear programming (LPs) and does not work well for QPs. I have tried using advanced versions of the solver but could not achieve much success with it either. It could be to do with the problem formulation, and I will be grateful for suggestions on solving the full QP. Indeed, I find that occassionally, the solver is unable to get an optimum even with the current formulation.

Note the sensitivity of the MPC to changes in the plant model. If the identification is not good, the predicted output will be quite different from the actual plant behaviour. An MPC without some form of feedback is unlikely to have robust performance.

Tuning an MPC controller can be quite challenging. This tool only has 2 tuning parameters - the output response time and move penalty (it is possible to include the control and prediction horizon times as tuning parameters by modifing the tool). However, a more complete controller will have even more parameters - move sizes, MV penalty weights and CV target weights. That is quite a lot of parameters to manage!