MMehrez / MPC-and-MHE-implementation-in-MATLAB-using-Casadi

This is a workshop on implementing model predictive control (MPC) and moving horizon estimation (MHE) on Matlab. The implementation is based on the Casadi Package which is used for numerical optimization. A non-holonomic mobile robot is used as a system for the implementation. The workshop video recording can be found here https://www.youtube.com/playlist?list=PLK8squHT_Uzej3UCUHjtOtm5X7pMFSgAL ... Casadi can be downloaded here https://web.casadi.org/

Home Page:https://www.youtube.com/playlist?list=PLK8squHT_Uzej3UCUHjtOtm5X7pMFSgAL

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

NLP solver returning over-constrained warning and wrong results

karthyyy opened this issue · comments

Hi,

Python = 3.9
Casadi = 3.6.4

I was trying out the python code shared by Mr. Mehrez during his workshop on Casadi (https://github.com/MMehrez/MPC-and-MHE-implementation-in-MATLAB-using-Casadi) and it's working fine.

While slightly modifying the problem to include acceleration as input in-lieu of velocity for similar system, I am facing an issue. The solver is returning "over constrained" warning and output is not correct (the control outputs are near zero).

"WARNING("NLP is overconstrained: There are 99 equality constraints but only 86 variables.") [.../casadi/core/nlpsol.cpp:630]"

I have rechecked the number of equality constraints given by "g" and is same as specified during the problem which is 66 (the warning specifies 99 equality constraints).

The system dynamics is based on following set of equations.

image

The modified code is attached herewith. Can you please see what can be wrong. Any help will be much appreciated.

FFR_casadi_v3.txt

Thanks and Regards
Karthik