Generate MPC controller using generalized predictive controller (GPC) settings
mpc = gpc2mpc(plant)
gpcOptions = gpc2mpc
mpc = gpc2mpc(plant,gpcOptions)
mpc = gpc2mpc(plant) generates a single-input single-output MPC controller with default GPC settings and sampling time of the plant, plant. The GPC is a nonminimal state-space representation described in . plant is a discrete-time LTI model with sampling time greater than 0.
gpcOptions = gpc2mpc creates a structure gpcOptions containing default values of GPC settings.
mpc = gpc2mpc(plant,gpcOptions) generates an MPC controller using the GPC settings in gpcOptions.
Discrete-time LTI model with sampling time greater than 0.
GPC settings, specified as a structure with the following fields.
Design an MPC controller using GPC settings:
% Specify the plant described in Example 1.8 of . 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 . % 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);
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.