Documentation |
Optimal control action
u = mpcmove(MPCobj,x,ym,r,v)
[u,Info] = mpcmove(MPCobj,x,ym,r,v)
[u,Info] = mpcmove(MPCobj,x,ym,r,v,Options)
u = mpcmove(MPCobj,x,ym,r,v) computes the optimal manipulated variable moves, u(k), at the current time. u(k) is calculated given the current estimated extended state, x(k), the measured plant outputs, y_{m}(k), the output references, r(k), and the measured disturbances, v(k), at the current time k. Call mpcmove repeatedly to simulate closed-loop model predictive control.
[u,Info] = mpcmove(MPCobj,x,ym,r,v) returns additional information regarding the model predictive controller in the second output argument Info.
[u,Info] = mpcmove(MPCobj,x,ym,r,v,Options) overrides default constraints and weights settings in MPCobj with the values specified by Options, an mpcmoveopt object. Use Options to provide run-time adjustment in constraints and weights during the closed-loop simulation.
MPCobj |
mpc object that defines the model predictive controller. |
x |
mpcstate object that defines the current controller state. Before you begin a simulation with mpcmove, initialize the controller state using x = mpcstate(MPCobj). Then, modify the default properties of x as appropriate. If you are using default state estimation, mpcmove expects x to represent x[n|n-1]. The mpcmove command updates the state values in the previous control interval with that information. Therefore, you should not programmatically update x at all. The default state estimator employs a steady-state Kalman filter. If you are using custom state estimation, mpcmove expects x to represent x[n|n]. Therefore, prior to each mpcmove command, you must set x.Plant, x.Disturbance, and x.Noise to the best estimates of these states (using the latest measurements) at the current control interval. |
ym |
1-by-n_{ym} vector of current measured output values at time k, where n_{ym} is the number of measured outputs. If you are using custom state estimation, set ym = []. |
r |
Plant output reference values, specified as a p-by-n_{y} array, where p is the prediction horizon of MPCobj and n_{y} is the number of outputs. Row r(i,:) defines the reference values at step i of the prediction horizon. r must contain at least one row. If r contains fewer than p rows, mpcmove duplicates the last row to fill the p-by-n_{y} array. If you supply exactly one row, therefore, a constant reference applies for the entire prediction horizon. To implement reference previewing, which can improve tracking when a reference varies in a predictable manner, r must contain the anticipated variations, ideally for p steps. |
v |
Current and anticipated measured disturbances, specified as a p-by-n_{md} array, where p is the prediction horizon of MPCobj and n_{md} is the number of measured disturbances. Row v(i,:) defines the expected measured disturbance values at step i of the prediction horizon. Modeling of measured disturbances provides feedforward control action. If your plant model does not include measured disturbances, use v = []. v must contain at least one row. If v contains fewer than p rows, mpcmove duplicates the last row to fill the p-by-n_{md} array. If you supply exactly one row, therefore, a constant measured disturbance applies for the entire prediction horizon. To implement disturbance previewing, which can improve tracking when a disturbance varies in a predictable manner, v must contain the anticipated variations, ideally for p steps. |
Options |
Override values for selected properties of MPCobj, specified as an options object you create with mpcmoveopt. These options apply to the current mpcmove time instant only. Using Options yields the same result as redefining or modifying MPCobj before each call to mpcmove, but involves considerably less overhead. Using Options is equivalent to using an MPC Controller Simulink^{®} block in combination with optional input signals that modify controller settings, such as MV and OV constraints. |
Use sim for plant mismatch and noise simulation when not using run-time constraints or weight changes.
Use mpctool to graphically and interactively combine model predictive design and simulation.
Use the MPC Controller block in Simulink and for code generation.
getEstimator | mpc | mpcmoveopt | mpcstate | review | setEstimator | sim