## Documentation |

On this page… |
---|

The model structure used in the MPC controller appears in the illustration below. This section explains how the models connect for prediction and state estimation.

The plant model may be in one of the following linear-time-invariant (LTI) formats:

Numeric LTI models: Transfer function (

`tf`), state-space (`ss`), zero-pole-gain (`zpk`).Identified models (requires System Identification Toolbox™):

`idss`,`idtf`,`idproc`, and`idpoly`.

The MPC controller performs all the estimation and optimization calculations using a discrete-time, delay-free, state-space system, with dimensionless input and output variables. Therefore, when you specify a plant model in the MPC controller, the following model-conversion steps are automatically carried out (if needed):

Conversion to state-space. The

`ss`command appropriate for the supplied model format generates an LTI state-space model.Discretization or resampling. If the model's sample time differs from the MPC controller's sample time (defined in the

`Ts`property), one of the following occurs:If the model is continuous-time, the

`c2d`command converts it to a discrete-time LTI object using the controller's sample time.If the model is discrete-time, the

`d2d`command resamples it to generate a discrete-time LTI object using the controller's sample time.

Delay removal. If the discrete time model includes any input, output, or internal delays, the

`absorbDelay`command replaces them with the appropriate number of poles at*z*= 0, increasing the total number of discrete states. The`InputDelay`,`OutputDelay`, and`InternalDelay`properties of the resulting state space model are all zero.Conversion to dimensionless input and output variables. The MPC controller allows you to specify a scale factor for each plant input and output variable. If you do not specify scale factors, they default to unity. The software converts the plant input and output variables to dimensionless form as follows:

$\begin{array}{c}{x}_{p}\left(k+1\right)={A}_{p}{x}_{p}\left(k\right)+B{S}_{i}{u}_{p}\left(k\right)\\ {y}_{p}\left(k\right)={S}_{o}^{-1}C{x}_{p}\left(k\right)+{S}_{o}^{-1}D{S}_{i}{u}_{p}\left(k\right).\end{array}$

Here, where

*A*,_{p}*B*,*C*, and*D*are constant state space matrices determined in step 3, and:*S*— Diagonal matrix of input scale factors in engineering units._{i}*S*— Diagonal matrix of output scale factors in engineering units._{o}*x*— State vector from step 3 in engineering units. No scaling is performed on state variables._{p}*u*— Dimensionless plant input variables._{p}*u*— Dimensionless plant output variables._{p}

The resulting plant model has the following equivalent form:

$\begin{array}{c}{x}_{p}\left(k+1\right)={A}_{p}{x}_{p}\left(k\right)+{B}_{pu}u\left(k\right)+{B}_{pv}v\left(k\right)+{B}_{pd}d\left(k\right)\\ {y}_{p}\left(k\right)={C}_{p}{x}_{p}\left(k\right)+{D}_{pu}u\left(k\right)+{D}_{pv}v\left(k\right)+{D}_{pd}d\left(k\right).\end{array}$

Here, ${C}_{p}={S}_{o}^{-1}C$,

*B*,_{pu}*B*and_{pv}*B*are the corresponding columns of_{pd}*BS*. Also,_{i}*D*,_{pu}*B*and_{pv}*B*are the corresponding columns of ${S}_{o}^{-1}D{S}_{i}$. Finally,_{pd}*u*(*k*),*v*(*k*) and*d*(*k*) are the dimensionless manipulated variables, measured disturbances, and unmeasured input disturbances, respectively.MPC controller enforces the restriction of

*D*= 0, which means that MPC controller does not allow direct feedthrough from any manipulated variable to any plant output._{pu}

If your plant model includes unmeasured input disturbances,
labeled as *d*(*k*) in the diagram
of the MPC system, the input disturbance model indicates how *d*(*k*)
evolves with time. That is, the input disturbance model specifies
what type of signal you expect from *d*(*k*).
If you do not provide an input disturbance model, the controller
uses a default input disturbance model. The `getindist` command
provides access to the model being used.

The input disturbance model is a key factor influencing the following controller performance attributes:

Dynamic response to apparent disturbances, i.e., the character of the controller's response when the measured plant output deviates from its predicted trajectory (due to an unknown disturbance or modeling error).

Asymptotic rejection of sustained disturbances. If the disturbance model predicts a sustained disturbance, controller adjustments continue until the plant output returns to its desired trajectory. This emulates an integral mode in a classical feedback controller.

You can provide the input disturbance model as an LTI state-space
(`ss`), transfer function (`tf`),
or zero-pole-gain (`zpk`) object. See Controller State Estimation for
more details about the input disturbance model.

The MPC controller converts the input disturbance model to a discrete-time, delay-free, LTI state-space system using the same steps used to convert the plant model (see Plant Model). The result is:

$\begin{array}{c}{x}_{id}\left(k+1\right)={A}_{id}{x}_{id}\left(k\right)+{B}_{id}{w}_{id}\left(k\right)\\ d\left(k\right)={C}_{id}{x}_{id}\left(k\right)+{D}_{id}{w}_{id}\left(k\right).\end{array}$

Here, *A _{id}*,

*x*(_{id}*k*) —*n*≥ 0 input disturbance model states._{xid}*d*(_{k}*k*) —*n*dimensionless unmeasured input disturbances._{d}*w*(_{id}*k*) —*n*≥ 1 dimensionless white noise inputs, assumed to have zero mean and unity variance._{id}

The output disturbance model is a special case of the more general input disturbance model. Its output is directly added to the plant output rather than affecting the plant states. The diagram shows its location in the MPC model hierarchy. The output disturbance model indicates how the disturbance will evolve with time (in other words, what type of disturbance signal you would expect) and it is often used in practice. See Controller State Estimation for more details about the output disturbance model.

If you don't provide an output disturbance model, the MPC controller will create one by default when there is no input disturbance model and augmenting the plant model does not violate state observability.

The `getoutdist` command provides
access to the model being used.

Using the same steps as for the plant model (see Plant Model), the MPC controller converts the output disturbance model to a discrete-time, delay-free, LTI state-space system. The result is:

$\begin{array}{c}{x}_{od}\left(k+1\right)={A}_{od}{x}_{od}\left(k\right)+{B}_{od}{w}_{od}\left(k\right)\\ {y}_{od}\left(k\right)={C}_{od}{x}_{od}\left(k\right)+{D}_{od}{w}_{od}\left(k\right).\end{array}$

Here, *A _{od}*,

*x*(_{od}*k*) —*n*≥ 1 output disturbance model states._{xod}*y*(_{od}*k*) —*n*dimensionless output disturbances to be added to the dimensionless plant outputs._{y}*w*(_{od}*k*) —*n*dimensionless white noise inputs, assumed to have zero mean, unity variance._{od}

One of the controller design objectives is to distinguish disturbances, which require a response, from measurement noise, which should be ignored. The measurement noise model has this purpose. The diagram shows its location in the MPC model hierarchy. The measurement noise model indicates how the noise will evolve with time (in other words, what type of noise signal you would expect).

See Controller State Estimation for more details about this model model.

Using the same steps as for the plant model (see Plant Model), the MPC controller converts the measurement noise model to a discrete-time, delay-free, LTI state-space system. The result is:

$\begin{array}{c}{x}_{n}\left(k+1\right)={A}_{n}{x}_{n}\left(k\right)+{B}_{n}{w}_{n}\left(k\right)\\ {y}_{n}\left(k\right)={C}_{n}{x}_{n}\left(k\right)+{D}_{n}{w}_{n}\left(k\right).\end{array}$

Here, *A _{n}*,

*x*(_{n}*k*) —*n*≥ 0 noise model states._{xn}*y*(_{n}*k*) —*n*dimensionless noise signals to be added to the dimensionless measured plant outputs._{ym}*w*(_{n}*k*) —*n*≥ 1dimensionless white noise inputs, assumed to have zero mean, unity variance._{n}

If you do not supply a noise model, the default is a unity static
gain: *n _{xn}* = 0,

For an `mpc` controller object `MPCobj`,
the property `MPCobj.Model.Noise` provides access
to the measurement noise model.

Was this topic helpful?