Generate MPC controller using generalized predictive controller (GPC) settings
mpcObj = gpc2mpc(plant)
gpcOptions = gpc2mpc
mpcObj = gpc2mpc(plant,gpcOptions)
generates a single-input single-output MPC controller with default GPC settings and sample
time of the specified plant, mpcObj
= gpc2mpc(plant
)plant
. The GPC is a nonminimal state-space
representation described in [1]. plant
is a discrete-time LTI model with sample time greater than
0.
creates a structure
gpcOptions
= gpc2mpcgpcOptions
containing default values of GPC settings.
generates an MPC controller using the GPC settings in mpcObj
= gpc2mpc(plant
,gpcOptions
)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 % [1]. 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 % [1]. % 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.
[1] Maciejowski, J. M. Predictive Control with Constraints, Pearson Education Ltd., 2002, pp. 133–142.