Multiple MPC Controllers: How to set the initial values of the manipulated variables?

7 views (last 30 days)
Hello,
i have 12 MPC-Controllers, each one with manipulated variables:
u1: pump speed
u2 valve opening
The output variable of the system is temperature.
I am switching between the MPCs using the Multiple MPC Controllers block (https://www.mathworks.com/help/mpc/ref/multiplempccontrollers.html)
The manipulated variables should start with inital values of u1 = 2500 RPM and u2 = 0.5 mm, but both start with 0.
Any idea how to do change the initial values of the manipulated variables?
Thanks!
Martin

Answers (1)

Kothuri
Kothuri on 25 Apr 2024
The “Multiple MPC Controller” block manages different MPC Controller objects, each of which have their own initial Manipulated Variable (MV) setting.
To set the initial values for the manipulated variables for different MPC controllers in the “Multiple MPC Controller” block, you can use the MV.Startproperty for each MPC controller object.
This can be done as follows:
% Example for two MPC controllers
mpc1 = mpc(plant1, Ts);
mpc2 = mpc(plant2, Ts);
% Set initial MVs for each controller
mpc1.MV.Start = [0.5]; % Assuming single MV
mpc2.MV.Start = [0.7]; % Adjust these values as per your requirements
% Save the MPC objects in the base workspace or a MAT-file if needed
assignin('base', 'mpc1', mpc1);
assignin('base', 'mpc2', mpc2);
Now add the names of the MPC Objects (mpc1, mpc2, etc.) in the Multiple MPC Controllers Block Parameters named - Cell Array of MPC Controllers.

Community Treasure Hunt

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

Start Hunting!