Non-linear Model Predictive Control Toolbox: manipulated variable remains constant
6 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Jorge Pereira
am 28 Apr. 2023
Kommentiert: Jorge Pereira
am 2 Mai 2023
Hello,
I am using the Non Linear MPC toolbox for controlling one variable in the BSM1 benchmark simulator. Only one state and one manipulated variable are used, other variables are required for the model but are considered measured disturbances. Everything is defined along with the nlmpc object (Prediction and Control horizons, minimum and maximum values of state and manipulated variables, cost function) and no error is given. The simulation runs fine, the nlp.status variable gives positive values (1 or 2) and everything seems to work, apart from the fact that the manipulated variable remains constant, at the maximum possible value defined in the constraint. If I set the maximum as 140, it stays at 140, if I set to 360, it stays at 360.
The controlled variable (dissolved oxygen in Tank 5) is always very far away from the required set point of 2. I used the 'ref' ability of the nlmpc object for set-point tracking and then changed for a cost function equal to:
nlobj.Optimization.CustomCostFcn = @(X,U,e,data) sum((X(1:10, 1) - ref(:)).^2)
where
ref = 2*ones(1, 10) (10 here is the prediction horizon).
In the diagnostic viewer the only message that pops up is:
Slack variable unused or zero-weighted in your custom cost function. All constraints will be hard.
Any clue on what might not be working?
Thank you!
0 Kommentare
Akzeptierte Antwort
Emmanouil Tzorakoleftherakis
am 1 Mai 2023
Well maybe that's the best the controller can do. I suggest removing the constraint on the manipulated variable temporarily and run the simulation. If you get the desired behavior then, that just means that the constraint is to blame and you should consider either relaxing it or making it soft.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Controller Creation finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!