|
|
|
| R2012a Documentation → Model Predictive Control Toolbox | |
Learn more about Model Predictive Control Toolbox |
|
| Contents | Index |
The are many ways to analyze a controller design. This section highlights two functions that support analysis of Model Predictive Control Toolbox controllers:
The cloffset function computes the closed-loop, steady-state gain for each output when subjected to a sustained, 1-unit disturbance added to each output. It assumes that no constraints will be encountered.
For example, consider the controller operating at the final steady-state of the nonlinear CSTR of the previous section. To compute its gain, type
cloffset(MPCobj)
which gives the result:
ans =
1.0000 14.5910
-0.0000 -0.0000
The interpretation is that the controller doesn't react to a sustained disturbance of 1 unit in the first output (the reactor temperature). Recall that we assigned zero weight to this output in the controller design, so the controller ignores deviations from its setpoint. The same disturbance has no effect on the second output (the 2,1 element is zero).
If there is a 1-unit disturbance in the second output, the controller reacts, and the first output increases 14.59 units. This is again due to the zero weight on this output. The second output stays at its setpoint (the 2,2 element is zero).
Use the ss function to obtain an LTI representation of an unconstrained Model Predictive Control Toolbox controller. You can use this to analyze the controller's closed-loop frequency response, etc.
For example, consider the controller designed in Creating a Controller Object. To extract the controller, you could type:
MPCss = ss(MPCobj);
You could then construct an LTI model of the closed-loop system using the feedback function (see the Control System Toolbox documentation for details) by typing:
CSTRd = c2d(CSTR, MPCss.Ts); Feedin = 1; Feedout = 1; Sign = 1; CLsys = feedback(CSTRd, MPCss, Feedin, Feedout, Sign);
Note The CSTR model must be converted to discrete form with the same control interval as the controller. |
Recall that the CSTR plant has two inputs and two outputs. The first input is the manipulated variable and the other is an unmeasured disturbance. The first output is measured for feedback and the other is not. The Feedin and Feedout parameters specify the input and output to be used for control. The Sign parameter signifies that the MPC object uses positive feedback, i.e., the measured outputs enter the controller with no sign change. Omission of this would cause the feedback command to use negative feedback by default and would almost certainly lead to an unstable closed-loop system.
You could then type
eig(CLsys)
to verify that all closed-loop poles are within the unit circle, or
bode(CLsys)
to compute a closed-loop Bode plot.
![]() | Control Based On Multiple Plant Models | Bibliography | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |