Model Predictive Control Toolbox™ design generates a discrete-time controller—one that takes action at regularly spaced, discrete time instants. The sampling instants are the times at which the controller acts. The interval separating successive sampling instants is the sampling period, Δt (also called the control interval). This section provides more details on the events occuring at each sampling instant.
The figure, Controller State at the kth Sampling Instant, shows the state of a hypothetical SISO model preditive control system. This system has been operating for many sampling instants. Integer k represents the current instant. The latest measured output, yk, and previous measurements, yk–1, yk–2, ..., are known and are the filled circles in the figure Controller State at the kth Sampling Instant (a). If there is a measured disturbance, its current and past values would be known (not shown).
Figure Controller State at the kth Sampling Instant (b) shows the controller's previous moves, uk–4, ..., uk–1, as filled circles. As is usually the case, a zero-order hold receives each move from the controller and holds it until the next sampling instant, causing the step-wise variations shown in figure Controller State at the kth Sampling Instant (b).
To calculate its next move, uk the controller operates in two phases:
Estimation. In order to make an intelligent move, the controller needs to know the current state. This includes the true value of the controlled variable, , and any internal variables that influence the future trend, . To accomplish this, the controller uses all past and current measurements and the models , , , and . For details, see Prediction and State Estimation.
Optimization. Values of setpoints, measured disturbances, and constraints are specified over a finite horizon of future sampling instants, k+1, k+2, ..., k+P, where P (a finite integer ≥ 1) is the prediction horizon —see figure Controller State at the kth Sampling Instant (a). The controller computes M moves uk, uk+1, ... uk+M–1, where M ( ≥ 1, ≤ P) is the control horizon—see figure Controller State at the kth Sampling Instant (b). In the hypothetical example shown in the figure, P = 9 and M = 4. The moves are the solution of a constrained optimization problem. For details of the formulation, see Optimization Problem.
In the example, the optimal moves are the four open circles in figure Controller State at the kth Sampling Instant (b). The controller predicts that the resulting output values will be the nine open circles in figure Controller State at the kth Sampling Instant (a). Notice that both are within their constraints, umin≤uk+j≤umax and ymin≤yk+i≤ymax.
When it's finished calculating, the controller sends move uk to the plant. The plant operates with this constant input until the next sampling instant, Δt time units later. The controller then obtains new measurements and totally revises its plan. This cycle repeats indefinitely.
Reformulation at each sampling instant is essential for good control. The predictions made during the optimization stage are imperfect. Periodic measurement feedback allows the controller to correct for this error and for unexpected disturbances.