CD Implement MPC Controller VI
- Updated2023-03-14
- 9 minute(s) read
CD Implement MPC Controller VI
Owning Palette: Predictive Control VIs
Requires: Control Design and Simulation Module
Calculates the Control Action u(k) to apply to the plant. This VI uses the Output Reference Window, Disturbance Window, and Control Action Reference Window parameters to calculate the control action along the control horizon at time k. You must manually select the polymorphic instance you want to use.
CD Implement MPC Controller (MIMO)

![]() |
Manual? is TRUE if you want to provide the Control Action u(k) by wiring values to the Manual Control Action parameter. Manual? is FALSE if you want the MPC Controller to calculate the Control Action u(k). The default value is FALSE. | ||||||||||
![]() |
Manual Control Action specifies the values to use for the Control Action u(k). This parameter is valid only if you specify TRUE for the Manual? parameter. | ||||||||||
![]() |
Specifies whether to restart the calculation from any initial values you provide. The default is FALSE. | ||||||||||
![]() |
MPC Controller specifies the predictive controller model this VI uses. You create this model by using the CD Create MPC Controller VI. | ||||||||||
![]() |
Output Reference Window specifies the interleaved values of the plant output setpoints. This window applies to the current prediction horizon. You can obtain this window by using either the CD Step Forward MPC Window VI or the CD Read MPC FIFO VI. | ||||||||||
![]() |
Disturbance Window specifies the interleaved values of the disturbance that affects the plant outputs. This window applies to the current prediction horizon. You can obtain this window by using either the CD Step Forward MPC Window VI or the CD Read MPC FIFO VI. | ||||||||||
![]() |
Control Action Reference Window specifies the interleaved values of the control action setpoints. This window is for the current prediction horizon. You can obtain this window by using either the CD Step Forward MPC Window VI or the CD Read MPC FIFO VI. National Instruments recommends that you specify Control Action Reference Window for systems with more inputs than outputs. |
||||||||||
![]() |
error in describes error conditions that occur before this node runs. This input provides standard error in functionality. | ||||||||||
![]() |
Measured Output y(k) specifies the measured outputs of the plant at the current sample time k. You can obtain these outputs by using sensors to measure the plant output.
|
||||||||||
![]() |
Estimated State xhat(k) specifies the estimated values of the plant states at the current sample time k. Providing state values is optional but improves the accuracy of the MPC Controller.
|
||||||||||
![]() |
Measured Control Action u(k–1) specifies the measured control action from the previous sample time k–1. This information is useful because the actuator might not be able to implement the Control Action u(k) this VI returns. In this situation, the MPC Controller takes the limitations of the actuator into account.
|
||||||||||
![]() |
Control Action u(k) returns the control action to apply to the plant at the current sample time k. This control action results in the Estimated Output yhat(k) from the plant. | ||||||||||
![]() |
MPC Final Conditions returns the final data for the MPC Controller.
| ||||||||||
![]() |
Estimated Output yhat(k) returns the predicted output of the plant after applying all control action changes along the control horizon. | ||||||||||
![]() |
Lagrangian Multipliers returns the coefficients of the lagrangian function that corresponds to the equality and inequality constraints on the MPC controller. For example, if you specified three equality constraints and two inequality constraints by using the MPC Optimization Parameters parameter of the CD Create MPC Controller VI, the first three values of the Lagrangian Multipliers parameter correspond to the equality constraints and the last two correspond to the inequality constraints. |
||||||||||
![]() |
error out contains error information. This output provides standard error out functionality. |
CD Implement MPC Controller (SISO)

![]() |
Manual? is TRUE if you want to provide the Control Action u(k) by wiring values to the Manual Control Action parameter. Manual? is FALSE if you want the MPC Controller to calculate the Control Action u(k). The default value is FALSE. | ||||||||||
![]() |
Manual Control Action specifies the value to use for the Control Action u(k). This parameter is valid only if you specify TRUE for the Manual? parameter. | ||||||||||
![]() |
Specifies whether to restart the calculation from any initial values you provide. The default is FALSE. | ||||||||||
![]() |
MPC Controller specifies the predictive controller model this VI uses. You create this model by using the CD Create MPC Controller VI. | ||||||||||
![]() |
Output Reference Window specifies the interleaved values of the plant output setpoints. This window applies to the current prediction horizon. You can obtain this window by using either the CD Step Forward MPC Window VI or the CD Read MPC FIFO VI. | ||||||||||
![]() |
Disturbance Window specifies the interleaved values of the disturbance that affects the plant outputs. This window applies to the current prediction horizon. You can obtain this window by using either the CD Step Forward MPC Window VI or the CD Read MPC FIFO VI. | ||||||||||
![]() |
Control Action Reference Window specifies the interleaved values of the control action setpoints. This window is for the current prediction horizon. You can obtain this window by using either the CD Step Forward MPC Window VI or the CD Read MPC FIFO VI. National Instruments recommends that you specify Control Action Reference Window for systems with more inputs than outputs. |
||||||||||
![]() |
error in describes error conditions that occur before this node runs. This input provides standard error in functionality. | ||||||||||
![]() |
Measured Output y(k) specifies the measured output of the plant at the current sample time k. You can obtain this output by using sensors to measure the plant output.
|
||||||||||
![]() |
Estimated State xhat(k) specifies the estimated values of the plant states at the current sample time k. Providing state values is optional but improves the accuracy of the MPC Controller.
|
||||||||||
![]() |
Measured Control Action u(k–1) specifies the measured control action from the previous sample time k–1. This information is useful because the actuator might not be able to implement the Control Action u(k) this VI returns. In this situation, the MPC Controller takes the limitations of the actuator into account.
|
||||||||||
![]() |
Control Action u(k) returns the control action to apply to the plant at the current sample time k. This control action results in the Estimated Output yhat(k) from the plant. | ||||||||||
![]() |
MPC Final Conditions returns the final data for the MPC Controller.
| ||||||||||
![]() |
Estimated Output yhat(k) returns the predicted output of the plant after applying the control action change along the control horizon. | ||||||||||
![]() |
Lagrangian Multipliers returns the coefficients of the lagrangian function that corresponds to the equality and inequality constraints on the MPC controller. For example, if you specified three equality constraints and two inequality constraints by using the MPC Optimization Parameters parameter of the CD Create MPC Controller VI, the first three values of the Lagrangian Multipliers parameter correspond to the equality constraints and the last two correspond to the inequality constraints. |
||||||||||
![]() |
error out contains error information. This output provides standard error out functionality. |
CD Implement MPC Controller Details
Refer to Chapter 18, Creating and Implementing a Model Predictive Controller, of the LabVIEW Control Design User Manual for information about using this VI.









