MPC Controller Design in MATLAB
- 59Unfamiliar
- 0Learning
- 0Familiar
- 0Mastered
- spaceFlip card
- KI knew it
- DI didn't know it
- ←Previous card
- →Next card
What is model predictive control (MPC)?
A controller that repeatedly solves an optimization problem online to choose input moves that optimize a specified objective.
Or swipe the card
59 cards
What is model predictive control (MPC)?
A controller that repeatedly solves an optimization problem online to choose input moves that optimize a specified objective.
How does MPC use a model to control a process?
It uses a model to predict future outputs and selects input moves to optimize a chosen objective over a prediction horizon.
Why is MPC well suited to handling constraints?
MPC can incorporate constraints directly into its optimization problem.
What type of optimization problem is commonly solved in MPC?
A quadratic program is commonly used to compute optimal input moves.
What determines whether an MPC input move is optimal?
The objective defines what “optimal” means, such as reducing setpoint-tracking error while penalizing input effort.
What does the prediction horizon P represent?
The prediction horizon P is the number of future output steps considered in the prediction and tracking objective.
What does the control horizon M represent?
The control horizon M is the number of future input moves treated as decision variables.
How is an MPC solution used in receding-horizon control?
Only the first computed input move is applied; the optimization is then run again at the next time step using updated information.
How are future inputs treated after the control horizon?
The control horizon is generally shorter than the prediction horizon; after the control horizon, future inputs are held at the last optimized value.
Can MPC be used for MIMO systems, and what must be adapted?
MPC can be extended to MIMO systems, but the prediction and objective matrices must account for multiple inputs and outputs.
How does the finite impulse-response model predict an output?
The impulse-response model predicts future outputs by combining past and planned inputs with response coefficients h1,…,hγ.
What is the impulse-response expression for the predicted output at k+1?
For example, y^(k+1)=h1u(k)+h2u(k−1)+⋯+hγu(k−γ+1).
How does the input sequence in an impulse-response prediction shift from one step to the next?
At each prediction step, the impulse-response coefficients multiply the inputs at the corresponding time offsets.
Which inputs are optimization decision variables in the MPC formulation?
The decision vector contains the unknown planned moves u(k),u(k+1),…,u(k+M−1).
Why do past input contributions form a constant term in the prediction model?
Inputs before the current time are known, so their contributions to future predictions are constants in the optimization.
What equality constraint is used to hold inputs constant after the control horizon?
For prediction indices beyond the control horizon, the constraint is u(k+i)=u(k+M−1) for i=M,…,P.
How is setpoint-tracking error represented in the MPC objective?
The objective sums squared tracking errors (yref(k+i)−y^(k+i))2 over the prediction horizon.
How can MPC penalize input magnitude in addition to tracking error?
The demonstrated objective can also penalize the squared input magnitude, summing u(k+i)2 over the control horizon; a tuning weight scales this term.
What do the decision-variable and known-input terms represent in the MPC prediction?
A matrix multiplying the decision variables captures their effects on predicted outputs; another term captures contributions from known past inputs.
Why can MPC prediction matrices be precomputed for a linear time-invariant model?
For a linear time-invariant model, the prediction matrices are time-invariant and can be computed before the optimization loop to reduce computation.
What transfer function is used in the MATLAB MPC example?
The example uses the continuous transfer function 2s2+5s+13s+1.
How is the example system discretized and its impulse response obtained?
The example discretizes the system with a sampling time of 1 second and computes impulse coefficients using MATLAB’s impulse function.
How does the MATLAB example introduce plant-model mismatch?
The example initially uses the same system as both plant and model, then changes a model parameter to study plant-model mismatch.
What simulation setup is specified in the MATLAB example?
The simulation length is 100 seconds; the example initializes the input and output trajectories before running the controller.
Which kinds of settings are included in the example’s MPC tuning parameters?
The tuning structure includes the prediction horizon, control horizon, sampling time, bias-correction settings, and the weight on the input penalty.
What input bounds and setpoint are used in the MATLAB example?
The example sets the input limits to −0.5 and 10, and uses a setpoint of 2.5.
Where are the precomputed prediction matrices stored in the example?
The precomputed matrices and related tuning values are stored in a structure for use by the MPC routine.
What information is passed to the example’s MPC optimization routine?
The routine receives the reference, model, tuning structure, previous input, and an initial guess for the optimization.
How are input bounds assembled for all control moves in the MATLAB example?
The routine repeats the input lower and upper bounds across the control horizon to form optimization bounds; MATLAB’s
repmatis used for this.What are the main tasks performed by the MPC routine at each iteration?
The routine calculates predicted outputs from the decision variables and known past inputs, then forms the objective and solves the optimization.
Why does the example calculate both predicted and actual outputs?
The script calculates predicted output using model coefficients and actual output using plant coefficients, allowing their difference to be used for bias correction.
How does the MATLAB script present the MPC simulation results?
The script plots the output and input trajectories to assess the controller’s response.
What response is observed when the plant and model match in the example?
With the model matching the plant, the output reaches the setpoint fairly quickly—about 10 to 15 seconds in the example.
What trade-off can result from penalizing input magnitude?
Adding an input-magnitude penalty can reduce input variation, but may introduce a steady tracking bias unless the penalty weight is tuned appropriately.
How does reducing the input-penalty weight affect the objective?
Reducing the weight on the input-magnitude penalty makes setpoint tracking more influential relative to minimizing input magnitude.
What approximate input variation is reported for the first example response?
The example’s first response starts near an input of 3.3 and moves toward 2.5, a variation of about 0.8.
What effect does the input-magnitude penalty have in the example before retuning?
With the input-magnitude objective, the example reports a smaller variation, from about 3.3 to 2.8, but notes that the output has a tracking bias.
What can happen when there is plant-model mismatch and no bias correction?
A change in a model coefficient can cause oscillatory behavior when bias correction is not used; the example also shows the input reaching its lower bound.
What coefficient values illustrate large and smaller model mismatch in the example?
Changing the model’s second coefficient from its plant value of 0.6323 to 0.1323 produces a large mismatch; using 0.3323 produces a smaller deviation in the example.
Does bias correction necessarily remove all tracking error under model mismatch?
Bias correction can reduce the effect of mismatch, but its settings may need tuning; the example’s initial correction does not fully eliminate the offset.
How can state estimation help MPC when the model does not match the plant?
A Kalman filter can estimate states online from measurements and can be coupled with MPC to improve control under model mismatch.
Can MPC track a changing reference, and what trajectory is demonstrated?
A time-varying reference trajectory can be used instead of a single fixed setpoint; the example uses a first-order trajectory with a 5-second time constant.
What effect does increasing the control horizon have in the example?
Increasing the control horizon from 1 to 3 gives the optimizer more input moves to choose and produces a smoother input variation in the example.
How can changing both horizons affect MPC performance?
Increasing the prediction horizon together with the control horizon can improve prediction and control performance in the demonstrated setup.
How can weighting different prediction terms customize MPC?
The prediction and objective terms can be assigned different weights to emphasize some future predictions more than others.
How can output constraints be expressed in MPC?
Output limits can be added by constraining predicted outputs to lie between specified lower and upper bounds.
Why might output-limit constraints make an MPC optimization infeasible?
Output constraints may be infeasible because the prediction model is approximate or mismatched; allowing the constraints to relax can help preserve feasibility.
What additional constraint can be imposed on changes in the input?
Constraints can also be placed on input increments, requiring Δu to remain within specified limits.
What is a coincidence-point constraint intended to accomplish?
A coincidence-point constraint specifies that a predicted output at a chosen future step equals its reference, potentially helping the output reach the setpoint faster.
What is a terminal constraint in the MPC formulation?
A terminal constraint sets the final predicted output equal to the final reference, such as y^(k+P)=yref(k+P).
What benefits are attributed to the terminal constraint in the tutorial?
The tutorial describes a terminal constraint as straightforward to implement and as helping stabilize the controller and avoid oscillatory response.
Why can output equality constraints cause feasibility problems?
Coincidence-point and terminal conditions constrain outputs, so they can create feasibility problems if the model cannot satisfy them.
How does the impulse-response model change when extended from SISO to MIMO?
For MIMO systems, each impulse-response coefficient becomes a matrix describing the effects of multiple inputs on multiple outputs.
What optimization issue can arise when a nonlinear model is used in MPC?
MPC formulations can use nonlinear prediction models, but the resulting optimization is nonlinear and may find a local rather than a global optimum.
Does MPC inherently require a linear prediction model?
The MPC formulation itself does not require a particular prediction-model type; using a linear model is required when the optimization is formulated as a linear or quadratic program.
Which kinds of variables or quantities can MPC constraints address?
Depending on the application, constraints may be placed on inputs, outputs, input increments, and other relevant quantities.
How can an MPC objective be customized beyond setpoint tracking?
The objective can be customized to penalize quantities such as input magnitude, input changes, or time, in addition to tracking error.
What theoretical issues must be considered when adding constraints to MPC?
Each added equality or output constraint can make the optimization infeasible, so feasibility and stability require theoretical justification for the chosen formulation.
What is one alternative to implementing MPC manually in MATLAB?
MATLAB’s MPC Toolbox provides an alternative to hand-coding MPC and offers diagnostic facilities and additional options.

Ask anything
We've read this whole study set, so questions about it get the best answers.