Generate MPC controller using generalized predictive controller (GPC) settings
creates a structure
gpcOptions = gpc2mpc
gpcOptions containing default values of GPC settings.
Design an MPC controller using GPC settings
% Specify the plant described in Example 1.8 of % References. G = tf(9.8*[1 -0.5 6.3],conv([1 0.6565],[1 -0.2366 0.1493])); % Discretize the plant with sample time of 0.6 seconds. Ts = 0.6; Gd = c2d(G, Ts); % Create a GPC settings structure. GPCoptions = gpc2mpc; % Specify the GPC settings described in example 4.11 of % References. % Hu GPCoptions.NU = 2; % Hp GPCoptions.N2 = 5; % R GPCoptions.Lam = 0; GPCoptions.T = [1 -0.8]; % Convert GPC to an MPC controller. mpc = gpc2mpc(Gd, GPCoptions); % Simulate for 50 steps with unmeasured disturbance between % steps 26 and 28, and reference signal of 0. SimOptions = mpcsimopt(mpc); SimOptions.UnmeasuredDisturbance = [zeros(25,1); ... -0.1*ones(3,1); 0]; sim(mpc, 50, 0, SimOptions);
plant — plant model
Single-output LTI model with sampling time greater than 0, and only one manipulated variable input.
gpcOptions — GPC settings
GPC settings, specified as a structure with the following fields.
Starting interval in prediction horizon, specified as a positive integer.
|Last interval in prediction horizon, specified as a positive integer
greater than |
Control horizon, specified as a positive integer less than the prediction horizon.
Penalty weight on changes in manipulated variable, specified as a positive integer greater than or equal to 0.
Numerator of the GPC disturbance model, specified as a row vector of polynomial coefficients whose roots lie within the unit circle.
Index of the manipulated variable for multi-input plants, specified as a positive integer.
For plants with multiple inputs, only one input is the manipulated variable, and the remaining inputs are measured disturbances in feedforward compensation. The plant output is the measured output of the MPC controller.
Use the MPC controller with Model Predictive Control Toolbox™ software for simulation and analysis of the closed-loop performance.
 Maciejowski, J. M. Predictive Control with Constraints, Pearson Education Ltd., 2002, pp. 133–142.
Introduced in R2010a