Problem with designing MPC

I created an MPC block and try to use the 'Design option'. I put into field some MPC name and click 'Design'. An error appears: 'Specified MPC object 'name' cannot be found in base workspace.
What to do?

Answers (1)

Because you need to have the MPC object in the Workspace. And this is how you create a basic one:
Plant = tf([1], [1 0 0]); % double integrator
Ts = 1; % sample time
b1 = 3.60e-05; % upper bound of manipulated variable (MV)
b2 = 4.32e-07; % upper bound of MV rate
% bounds on the controller
MV = struct('Min', -b1, 'Max', b1, 'RateMin', -b2, 'RateMax', b2);
Np = 300; % prediction horizon
Nc = 0.01*Np; % control horizon
MPCobj = mpc(Plant, Ts, Np, Nc, [], MV)
Then, you can click on the "Design" button to launch the MPC Designer App.
Hope this info is helpful to you.

Products

Release

R2022a

Tags

Asked:

on 16 Apr 2022

Answered:

on 17 Apr 2022

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!