Non-linear Model Predictive Control Toolbox: manipulated variable remains constant
Mostrar comentarios más antiguos
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!
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Controller Creation en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!