Model Predictive Control Toolbox    
smpccl

Combines a plant model and a controller model in the MPC mod format, yielding a closed-loop system model in the MPC format. This can be used for stability analysis and linear simulations of closed-loop performance.

Syntax

Description

pmod
Is a model (in the mod format) representing the plant in the above diagram.

imod
Is a model (in the same format) that is to be used to design the MPC controller block shown in the diagram. It may be the same as pmod (in which case there is no model error in the controller design), or it may be different.

Ks
Is a controller gain matrix, which must have been calculated by the function smpccon.

Kest
Is an (optional) estimator gain matrix. If omitted or set to an empty matrix, the default is to use the DMC estimator index DMC estimator. See the documentation for the function smpcest for more details on the design and proper format of Kest.

smpccl
Calculates a model of the closed-loop system, clmod. It is in the mod format and can be used, for example, with analysis functions such as smpcgain and smpcpole, and with simulation routines such as mod2step and dlsimm. smpccl also calculates a model of the controller element, cmod.

The closed-loop model, clmod, has the following state-space representation:

    xcl(k + 1) = clxcl(k) + clucl(k)

    ycl(k) = Cclxcl(k) + D clucl(k)

where xcl is a vector of n state variables, ucl is a vector of input variables, ycl is a vector of outputs, and cl, cl, Ccl, and Dcl are matrices of appropriate size. The expert user may want to know the significance of the state variables in xcl. They are (in the following order):

The closed-loop input and output variables are:


where is the estimate of the noise-free plant output at sampling period k based on information available at period k. This estimate is generated by the controller element.

Note that ucl will include d and/or w automatically whenever pmod includes measured disturbances and/or unmeasured disturbances. Thus the length of the ucl vector will depend on the inputs you have defined in pmod and imod. Similarly, ycl depends on the number of outputs and manipulated variables. Let m and p be the lengths of ucl and ycl, respectively. Then

The state-space form of the controller model, cmod, can be written as:

    xc(k + 1) = cxc(k) + cluc(k)

    yc(k) = Ccxc(k) + D cuc(k)

where


and the controller states are the same as those of the closed loop system except that the np plant states are not included.

Examples
Consider the linear system:


We build this model using the MPC Toolbox functions poly2tfd and tfd2mod.

Now we design the controller. Since there is delay, we use M < P: We specify the defaults for the other tuning parameters, uwt and ywt, then calculate the controller gain:

Now we can calculate the model of the closed-loop system and check its poles for stability:

The result is:

Since this is less than 1, the plant and controller combination will be closed-loop stable. (The closed-loop system has 20 states in this example).

You can also use the closed-loop model to calculate and plot the step response with respect to all the inputs. The appropriate commands are:

Since the closed-loop system has m = 6 inputs and p = 6 outputs, only one of the plots is reproduced here. It shows the response of the first 4 closed-loop outputs to a step in the first closed-loop input, which is the setpoint for y1:


Closed-loop outputs y1 and y2 are the true plant outputs (noise-free). Output y1 goes to the new setpoint quickly with a small overshoot. This causes a small, short-term disturbance in y2. The plots for y3 and y4 show the required variation in the manipulated variables.

The following commands show how you could use dlsimm to calculate the response of the closed-loop system to a step in the setpoint for y1, with added random measurement noise.

Restrictions

See Also
mod2step, scmpc, smpccon, smpcest, smpcgain, smpcpole, smpcsim



sermod smpccon