1. Home
  2. Explore
  3. Engineering
  4. MPC Controller Design in MATLAB

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

MPC Controller Design in MATLAB

  • 40Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: MPC Fundamentals

What is the central operating principle of model predictive control (MPC)?

40 questions

  1. 1

    What is the central operating principle of model predictive control (MPC)?

    1. A

      It adjusts the model parameters without changing the control input.

    2. B

      It selects the next input using only the current setpoint.

    3. C

      It applies a fixed input sequence calculated only before operation.

    4. D

      It solves an optimization problem online to choose input moves.

    Correct answer
    D

    It solves an optimization problem online to choose input moves.

    Explanation

    MPC repeatedly solves an optimization problem online to choose input moves that best satisfy its objective.

  2. 2

    Which type of optimization problem is commonly used to calculate MPC input moves?

    1. A

      MPC avoids optimization by using a fixed lookup table.

    2. B

      MPC often solves a quadratic program to determine optimal input moves.

    3. C

      MPC always solves a linear program with no quadratic terms.

    4. D

      MPC solves a nonlinear program in every application.

    Correct answer
    B

    MPC often solves a quadratic program to determine optimal input moves.

    Explanation

    A quadratic program is a common form of the optimization problem used in MPC, though the formulation can vary.

  3. 3

    Why is MPC well suited to applications with input constraints?

    1. A

      MPC handles constraints by removing the prediction model.

    2. B

      MPC requires all inputs and outputs to remain unconstrained.

    3. C

      MPC can handle constraints only when the plant has one output.

    4. D

      MPC can incorporate constraints into its optimization problem.

    Correct answer
    D

    MPC can incorporate constraints into its optimization problem.

    Explanation

    Constraints can be included directly in the optimization problem, which is one of MPC's practical advantages.

  4. 4

    What does the tutorial's SISO example imply about MPC's applicability to MIMO systems?

    1. A

      MPC can control MIMO systems only by treating each output independently.

    2. B

      MPC is limited to SISO systems because its input sequence has one element.

    3. C

      MPC supports MIMO systems only when all outputs have identical models.

    4. D

      MPC can be extended to MIMO systems by adapting the relevant matrix structures.

    Correct answer
    D

    MPC can be extended to MIMO systems by adapting the relevant matrix structures.

    Explanation

    The example uses a SISO system, but the method can be extended to MIMO systems by adapting the prediction and objective-function structures.

  5. 5

    What is a potential computational drawback of applying MPC to a large system?

    1. A

      Computational effort depends only on the sampling time, not system size.

    2. B

      Larger numbers of inputs and outputs can increase the computation needed for optimization.

    3. C

      MIMO systems require less computation because their variables can be ignored.

    4. D

      Larger numbers of inputs and outputs always eliminate the need for optimization.

    Correct answer
    B

    Larger numbers of inputs and outputs can increase the computation needed for optimization.

    Explanation

    Larger systems with many inputs and outputs require more computation to find the optimal solution.

  6. 6

    Which components can appear in the MPC objective described in the tutorial?

    1. A

      It minimizes only the difference between consecutive measured outputs.

    2. B

      It minimizes the number of outputs while leaving tracking error unrestricted.

    3. C

      It minimizes model error without considering the reference trajectory.

    4. D

      It minimizes predicted setpoint error and can also penalize input moves.

    Correct answer
    D

    It minimizes predicted setpoint error and can also penalize input moves.

    Explanation

    The objective includes tracking error over the prediction horizon and can include a penalty on input moves.

  7. 7

    How does the tutorial construct predicted outputs in its impulse-response formulation?

    1. A

      The predicted output uses only the current input and ignores earlier inputs.

    2. B

      The predicted output is calculated from future measurements alone.

    3. C

      The predicted output is set equal to the reference at every future instant.

    4. D

      The predicted output is calculated using impulse-response coefficients and input history.

    Correct answer
    D

    The predicted output is calculated using impulse-response coefficients and input history.

    Explanation

    The predicted output is constructed from impulse-response coefficients and present and past input values.

  8. 8

    What role does the control horizon play in the formulation?

    1. A

      It determines how many future outputs are measured by the plant.

    2. B

      It determines how many future input moves are treated as decision variables.

    3. C

      It determines how many past output measurements are discarded.

    4. D

      It determines how many output constraints are automatically removed.

    Correct answer
    B

    It determines how many future input moves are treated as decision variables.

    Explanation

    The control horizon determines how many future input moves are independently optimized.

  9. 9

    What does the formulation assume about input moves beyond the control horizon?

    1. A

      The input is allowed to vary freely at every remaining prediction step.

    2. B

      The input is set to zero beyond the control horizon.

    3. C

      The input repeats the first optimized move throughout the prediction horizon.

    4. D

      The input is held equal to the last optimized move beyond the control horizon.

    Correct answer
    D

    The input is held equal to the last optimized move beyond the control horizon.

    Explanation

    After the independently optimized moves, the future input is held at the final control-horizon move through the rest of the prediction horizon.

  10. 10

    How do the prediction horizon and control horizon differ?

    1. A

      The prediction horizon counts future outputs considered, while the control horizon counts optimized input moves.

    2. B

      The prediction horizon specifies model order, while the control horizon specifies sampling time.

    3. C

      The prediction horizon sets input limits, while the control horizon sets output limits.

    4. D

      The prediction horizon counts optimized inputs, while the control horizon counts past outputs.

    Correct answer
    A

    The prediction horizon counts future outputs considered, while the control horizon counts optimized input moves.

    Explanation

    The prediction horizon covers the future outputs considered in the tracking objective, while the control horizon counts the independently chosen input moves.

  11. 11

    How are input limits treated in the formulation?

    1. A

      Input limits apply to the input moves and are selected for the application.

    2. B

      Input limits must be identical to the setpoint values.

    3. C

      Input limits are fixed universally and apply only to the final predicted output.

    4. D

      Input limits are imposed only on past inputs stored in the model.

    Correct answer
    A

    Input limits apply to the input moves and are selected for the application.

    Explanation

    Input limits apply to the optimized input moves, and their values depend on the specific application.

  12. 12

    Why does the MATLAB implementation precompute prediction matrices for its LTI model?

    1. A

      They can be omitted because the controller uses no prediction model.

    2. B

      They must be recalculated at every iteration because the model is nonlinear.

    3. C

      They change at every iteration whenever the setpoint changes.

    4. D

      They can be precomputed because they are time-invariant for an LTI model.

    Correct answer
    D

    They can be precomputed because they are time-invariant for an LTI model.

    Explanation

    For a linear time-invariant model, the matrices multiplying the decision variables and the known terms do not change with time, so they can be computed in advance.

  13. 13

    What sequence of steps is used to obtain the example system's impulse coefficients?

    1. A

      It keeps the model continuous and calculates step-response coefficients at every iteration.

    2. B

      It discretizes the model with a one-second sampling time and computes impulse coefficients.

    3. C

      It replaces the model with measured output values before computing impulse coefficients.

    4. D

      It discretizes the model with a one-minute sampling time and estimates frequency coefficients.

    Correct answer
    B

    It discretizes the model with a one-second sampling time and computes impulse coefficients.

    Explanation

    The example discretizes the transfer-function model with a one-second sampling time before calculating impulse-response coefficients.

  14. 14

    How does the tutorial establish a baseline before studying plant-model mismatch?

    1. A

      It begins with a plant that has no model and then estimates one online.

    2. B

      It begins by replacing the plant with a reference trajectory.

    3. C

      It begins with different plant and model structures and later makes them identical.

    4. D

      It begins with the same system as plant and model, then examines mismatch.

    Correct answer
    D

    It begins with the same system as plant and model, then examines mismatch.

    Explanation

    The code first uses the same system as both plant and model, providing a baseline before plant-model mismatch is introduced.

  15. 15

    Which setup is performed in the example's control-specification section?

    1. A

      It initializes only the prediction horizon and leaves signals undefined.

    2. B

      It sets a 100-second simulation length and initializes output and input variables.

    3. C

      It initializes the bias correction but does not define simulation signals.

    4. D

      It initializes only the input limits and calculates the simulation length afterward.

    Correct answer
    B

    It sets a 100-second simulation length and initializes output and input variables.

    Explanation

    The example initializes the simulation length and the output and input variables before running the controller.

  16. 16

    How does the example use the optimized input sequence produced at each iteration?

    1. A

      It returns one input and applies it for the entire prediction horizon.

    2. B

      It returns a complete input sequence and applies every move without reoptimization.

    3. C

      It returns a predicted output and applies that output as the plant input.

    4. D

      It returns optimized input moves and applies the first move for the current step.

    Correct answer
    D

    It returns optimized input moves and applies the first move for the current step.

    Explanation

    The MPC routine returns a sequence of optimized moves, but the implementation applies only the first move before repeating the optimization.

  17. 17

    Which information is supplied to the tutorial's MPC-running function?

    1. A

      It receives the future plant inputs and returns the reference trajectory.

    2. B

      It receives the plant constraints and returns a revised sampling time.

    3. C

      It receives the reference, model, tuning data, previous input, and an initial guess.

    4. D

      It receives only the measured output and calculates a new model from scratch.

    Correct answer
    C

    It receives the reference, model, tuning data, previous input, and an initial guess.

    Explanation

    The routine receives the reference, model, tuning structure, previous input, and an initial guess for the optimization.

  18. 18

    Why does the implementation use a function such as repmat when setting input bounds?

    1. A

      It repeats the input lower and upper limits across the control moves.

    2. B

      It repeats the output reference across the number of prediction steps.

    3. C

      It repeats the previous output across the number of model coefficients.

    4. D

      It repeats the model parameters across the number of simulation seconds.

    Correct answer
    A

    It repeats the input lower and upper limits across the control moves.

    Explanation

    The implementation repeats the input lower and upper limits across the number of optimized moves to construct the optimization bounds.

  19. 19

    Why does the code calculate both predicted and actual outputs?

    1. A

      It determines the sampling time without using the model.

    2. B

      It removes the need to apply input constraints.

    3. C

      It provides the information needed to update bias correction under model mismatch.

    4. D

      It ensures that predicted and actual outputs are forced to be identical.

    Correct answer
    C

    It provides the information needed to update bias correction under model mismatch.

    Explanation

    Comparing predicted output with actual output allows the controller to identify and correct bias caused by plant-model mismatch.

  20. 20

    What is the role of lambda in the example's objective function?

    1. A

      It changes the impulse-response coefficients without changing the objective.

    2. B

      It sets the number of outputs and the length of the simulation.

    3. C

      It determines the input limits while leaving the objective unchanged.

    4. D

      It weights the input-related penalty relative to the tracking-error term.

    Correct answer
    D

    It weights the input-related penalty relative to the tracking-error term.

    Explanation

    The second term penalizes input magnitude or movement, and lambda adjusts the relative weight of this term against tracking error.

  21. 21

    What does the tutorial demonstrate about reference trajectories?

    1. A

      A time-varying reference trajectory can be used, including a first-order response with a five-second time constant.

    2. B

      The reference must remain constant because MPC cannot follow trajectories.

    3. C

      A first-order reference trajectory can be used only when the model is nonlinear.

    4. D

      A time-varying reference can be used only if input constraints are disabled.

    Correct answer
    A

    A time-varying reference trajectory can be used, including a first-order response with a five-second time constant.

    Explanation

    A reference trajectory can vary with time; the tutorial demonstrates one shaped as a first-order response with a five-second time constant.

  22. 22

    What effect does the tutorial report when increasing the control horizon from one to three?

    1. A

      Increasing the control horizon forces every input move to its lower limit.

    2. B

      Increasing the control horizon can provide more optimization freedom and smoother variation.

    3. C

      Increasing the control horizon removes the prediction model from the objective.

    4. D

      Increasing the control horizon prevents the controller from tracking a changing reference.

    Correct answer
    B

    Increasing the control horizon can provide more optimization freedom and smoother variation.

    Explanation

    In the example, increasing the control horizon from one to three gives more room for optimization and produces a smoother input variation.

  23. 23

    What is the stated potential benefit of increasing both horizons?

    1. A

      Increasing both horizons makes the model independent of impulse coefficients.

    2. B

      Increasing both horizons prevents the optimizer from considering future outputs.

    3. C

      Increasing both horizons can improve prediction approximations and control.

    4. D

      Increasing both horizons guarantees that plant-model mismatch disappears.

    Correct answer
    C

    Increasing both horizons can improve prediction approximations and control.

    Explanation

    The tutorial notes that increasing the prediction horizon together with the control horizon can improve predictions and control performance.

  24. 24

    What tuning lesson does the comparison of objectives with and without an input penalty illustrate?

    1. A

      An input penalty guarantees exact setpoint tracking regardless of its weight.

    2. B

      An input penalty changes the plant model but does not affect controller behavior.

    3. C

      An input penalty can bias tracking if weighted too strongly, so its weight can be reduced.

    4. D

      Removing the input penalty always causes a larger steady-state tracking error.

    Correct answer
    C

    An input penalty can bias tracking if weighted too strongly, so its weight can be reduced.

    Explanation

    The tutorial compares objectives with and without an input-related penalty and observes that excessive emphasis on small input variation can bias tracking; reducing lambda can lessen that effect.

  25. 25

    How can additional objective weights affect MPC behavior?

    1. A

      Weights must be identical for every predicted output and input move.

    2. B

      Weights can only change the simulation duration, not the optimization objective.

    3. C

      Weights can replace all input and output constraints in the formulation.

    4. D

      Weights can emphasize or de-emphasize selected terms in the objective function.

    Correct answer
    D

    Weights can emphasize or de-emphasize selected terms in the objective function.

    Explanation

    Different prediction terms can be weighted to tell the optimizer which predicted outputs matter more or less.

  26. 26

    What problem can arise when the model differs from the actual plant?

    1. A

      Mismatch can create prediction errors that the controller may correct using bias estimates.

    2. B

      Mismatch makes predicted and actual outputs identical, so correction is unnecessary.

    3. C

      Mismatch can be corrected only by changing the sampling time.

    4. D

      Mismatch affects only the setpoint and cannot affect predicted outputs.

    Correct answer
    A

    Mismatch can create prediction errors that the controller may correct using bias estimates.

    Explanation

    A mismatch between the model and plant can make predicted and actual outputs differ, which may require real-time bias correction.

  27. 27

    What explanation does the tutorial give for oscillations in one plant-model mismatch case?

    1. A

      The response can oscillate when mismatch interacts with an active input constraint.

    2. B

      The response becomes oscillatory because the model and plant are identical.

    3. C

      The response becomes oscillatory because the prediction horizon is zero.

    4. D

      The response becomes oscillatory because the reference trajectory is constant.

    Correct answer
    A

    The response can oscillate when mismatch interacts with an active input constraint.

    Explanation

    The tutorial reports oscillatory behavior when a model coefficient is substantially changed, with the input reaching its lower bound; the input constraint is identified as a cause of the oscillation.

  28. 28

    What does the tutorial observe when it reduces the size of the model-coefficient mismatch?

    1. A

      A smaller mismatch can yield a more stable response while leaving some offset.

    2. B

      A smaller mismatch makes the response more oscillatory and increases the offset.

    3. C

      A smaller mismatch guarantees exact tracking without any bias correction.

    4. D

      A smaller mismatch prevents the controller from reaching a stable response.

    Correct answer
    A

    A smaller mismatch can yield a more stable response while leaving some offset.

    Explanation

    A smaller coefficient mismatch produces a more stable response in the example, although the output still deviates from the setpoint.

  29. 29

    What is the tutorial's advice about bias correction under plant-model mismatch?

    1. A

      Bias correction is used only to set the input upper limit.

    2. B

      Bias correction always eliminates mismatch regardless of its parameter settings.

    3. C

      Bias correction may help, but its parameters need tuning when the model is inaccurate.

    4. D

      Bias correction replaces the need for a prediction model.

    Correct answer
    C

    Bias correction may help, but its parameters need tuning when the model is inaccurate.

    Explanation

    Bias correction can improve performance under mismatch, but its parameters must be tuned to suit the difference between model and plant.

  30. 30

    How might a Kalman filter help address plant-model mismatch in an MPC system?

    1. A

      A Kalman filter converts every nonlinear optimization into a quadratic program.

    2. B

      A Kalman filter replaces the reference trajectory with input limits.

    3. C

      A Kalman filter removes the need to measure plant outputs.

    4. D

      A Kalman filter can estimate states online from measurements and be combined with MPC.

    Correct answer
    D

    A Kalman filter can estimate states online from measurements and be combined with MPC.

    Explanation

    The tutorial mentions Kalman filtering as an alternative approach that estimates states online using measurements and can be coupled with MPC.

  31. 31

    Why might output constraints need to be relaxed in the tutorial's formulation?

    1. A

      Output limits eliminate the effects of plant-model mismatch.

    2. B

      Output limits can be imposed only when input limits are removed.

    3. C

      Output limits are always met exactly because the prediction model is finite.

    4. D

      Output limits may cause feasibility problems, so allowing some relaxation can help.

    Correct answer
    D

    Output limits may cause feasibility problems, so allowing some relaxation can help.

    Explanation

    Output limits can be included as constraints, but model mismatch and the assumed linear finite-impulse-response model may make exact satisfaction impossible; allowing relaxation can help preserve feasibility.

  32. 32

    Which description correctly distinguishes input-change constraints from coincidence-point constraints?

    1. A

      Input-change constraints set the prediction horizon, and coincidence points set the sampling time.

    2. B

      Input-change constraints apply only to output measurements, and coincidence points apply only to model coefficients.

    3. C

      Input-change constraints limit changes in the input, and coincidence points impose predicted-output targets.

    4. D

      Input-change constraints remove the input bounds, and coincidence points remove the objective.

    Correct answer
    C

    Input-change constraints limit changes in the input, and coincidence points impose predicted-output targets.

    Explanation

    Constraints on input changes can be added, and coincidence points can require selected predicted outputs to equal reference values.

  33. 33

    What benefit does the tutorial associate with its terminal output constraint?

    1. A

      A terminal output-equals-reference constraint is easy to implement and can help stabilize MPC.

    2. B

      A terminal constraint removes all future input moves and destabilizes MPC.

    3. C

      A terminal constraint replaces the prediction horizon with the control horizon.

    4. D

      A terminal constraint forces the output to equal its lower limit at every step.

    Correct answer
    A

    A terminal output-equals-reference constraint is easy to implement and can help stabilize MPC.

    Explanation

    A terminal constraint equating the predicted output at the end of the prediction horizon to its reference is described as relatively easy to implement and as helping stabilize the controller.

  34. 34

    Why should feasibility and stability be analyzed when adding constraints to MPC?

    1. A

      Adding constraints always guarantees feasibility without further analysis.

    2. B

      Added equality or output constraints may cause infeasibility, requiring theoretical checks.

    3. C

      Stability is guaranteed whenever an input lower bound is present.

    4. D

      Feasibility depends only on whether the plant is SISO or MIMO.

    Correct answer
    B

    Added equality or output constraints may cause infeasibility, requiring theoretical checks.

    Explanation

    The tutorial warns that equality and output constraints can make the optimization infeasible, so stability and feasibility require theoretical analysis.

  35. 35

    Which statement best describes the flexibility of the MPC formulation?

    1. A

      MPC permits only output limits and a fixed input-magnitude objective.

    2. B

      MPC does not allow input-change constraints or alternative objectives.

    3. C

      MPC permits only input limits and a fixed tracking-error objective.

    4. D

      MPC can customize constraints and objectives to suit the application.

    Correct answer
    D

    MPC can customize constraints and objectives to suit the application.

    Explanation

    The framework can be customized with constraints on inputs, outputs, and input changes, and with different objective terms such as input magnitude or input variation.

  36. 36

    How does the impulse-response representation extend from SISO to MIMO systems?

    1. A

      For MIMO systems, impulse-response coefficients are replaced by setpoint values.

    2. B

      For MIMO systems, each impulse-response coefficient becomes a single scalar shared by all signals.

    3. C

      For MIMO systems, the impulse-response model cannot predict outputs.

    4. D

      For MIMO systems, each impulse-response coefficient can become a matrix of input-output relationships.

    Correct answer
    D

    For MIMO systems, each impulse-response coefficient can become a matrix of input-output relationships.

    Explanation

    For MIMO systems, impulse-response coefficients become matrices containing the relationships among multiple inputs and outputs.

  37. 37

    What is a consequence of using a nonlinear prediction model in MPC?

    1. A

      A nonlinear prediction model cannot be used in MPC under any circumstances.

    2. B

      A nonlinear prediction model can be used, but it leads to nonlinear optimization that may find a local optimum.

    3. C

      A nonlinear prediction model always produces a quadratic program with a global optimum.

    4. D

      A nonlinear prediction model removes the need to solve an optimization problem.

    Correct answer
    B

    A nonlinear prediction model can be used, but it leads to nonlinear optimization that may find a local optimum.

    Explanation

    The MPC framework does not itself require one specific prediction-model type, but using nonlinear models makes the optimization nonlinear and can lead to local rather than global optima.

  38. 38

    When does the tutorial say a linear prediction model is required?

    1. A

      Nonlinear models are required whenever the controller has input constraints.

    2. B

      Linear models are needed for the stated linear or quadratic programming approaches, not for every MPC formulation.

    3. C

      The MPC framework permits only models obtained from impulse responses.

    4. D

      The MPC framework always requires a linear model, regardless of the solver.

    Correct answer
    B

    Linear models are needed for the stated linear or quadratic programming approaches, not for every MPC formulation.

    Explanation

    Linear models are required when the chosen solution approach relies on linear or quadratic programming principles, while the broader MPC framework does not dictate one model type.

  39. 39

    What advantage of MATLAB's MPC Toolbox is mentioned in the tutorial?

    1. A

      The toolbox is described as a way to avoid specifying controller tuning.

    2. B

      The toolbox is described as supporting only the tutorial's specific SISO example.

    3. C

      The toolbox is described as a replacement for all prediction models.

    4. D

      The toolbox offers diagnostic facilities and additional options compared with hand coding.

    Correct answer
    D

    The toolbox offers diagnostic facilities and additional options compared with hand coding.

    Explanation

    The tutorial distinguishes a hand-coded implementation from MATLAB's MPC Toolbox, which offers diagnostic facilities and additional options.

  40. 40

    Which conclusion best summarizes the tutorial's view of the MPC framework?

    1. A

      MPC is flexible in models and objectives, but each application requires careful customization.

    2. B

      MPC uses one fixed objective and cannot include application-specific constraints.

    3. C

      MPC is inherently limited to constant setpoints and single-input systems.

    4. D

      MPC requires a linear model and has no options for modifying its objective.

    Correct answer
    A

    MPC is flexible in models and objectives, but each application requires careful customization.

    Explanation

    The tutorial emphasizes that MPC can be extended to different models and constraints, but its objective and constraints must be customized carefully for the application.

Question 1 of 40
Question 1 of 40

Ask anything

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

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent