Examine MPC controller for design errors and stability problems at run-time
review(mpcobj) checks for potential design issues in the Model Predictive Controller mpcobj and generates a report. review performs the following diagnostic tests:
Is the optimal control problem well defined?
Is the controller internally stable?
Is the closed loop system stable when no constraints are active and there is no model mismatch?
Is the controller able to eliminate steady-state tracking error when no constraints are active?
Is there a likelihood that constraint definitions will result in an ill-conditioned or infeasible optimization problem?
If the controller were used in a real-time environment, what memory capacity would be needed?
Use review iteratively to check your initial MPC design or whenever you make substantial changes to mpcobj. Make the recommended changes to your controller to eliminate potential problems. review does not modify mpcobj.
Non-empty Model Predictive Controller (mpc) object
Examine an MPC Controller for Design Errors and Stability Problems
Create a Model Predictive Controller. For this example, use a controller with hard upper and lower bounds on the manipulated variable and its rate-of-change.
Plant = tf(1, [10 1]); ts = 2; MPCobj = mpc(Plant,ts); MV = MPCobj.MV; MV.Min = -2; MV.Max = 2; MV.RateMin = -4; MV.RateMax = 4; MPCobj.MV = MV;
-->The "PredictionHorizon" property of "mpc" object is empty. Trying PredictionHorizon = 10. -->The "ControlHorizon" property of the "mpc" object is empty. Assuming 2. -->The "Weights.ManipulatedVariables" property of "mpc" object is empty. Assuming default 0.00000. -->The "Weights.ManipulatedVariablesRate" property of "mpc" object is empty. Assuming default 0.10000. -->The "Weights.OutputVariables" property of "mpc" object is empty. Assuming default 1.00000.
Review the design.
review flags the potential constraint conflict that could result if you applied this controller to a real process.
Examine the warning by clicking Hard MV Constraints.
review automates certain tests that you can perform at the command line.
To test for steady-state tracking errors, use cloffset.