GepocUS / Spcies

Suite of Predictive Controllers for Industrial Embedded Systems. A Matlab toolbox for automatic code generation of solvers for MPC controllers.
Apache License 2.0
13 stars 2 forks source link

ADMM-based solvers only accept non-diagonal Q and R #22

Open pablokrupa opened 2 years ago

pablokrupa commented 2 years ago

The functions that compute the ingredients (for instance, compute_ellipMPC_ADMM_ingredients.m) currently assume that Q and R are diagonal, which is not necessary. It should be changed so that they can be non-diagonal.

This change will also require changing the part of the C code of each solver where vector q is updated (see for instance code_ellipMPC_ADMM_C.c).

pablokrupa commented 2 years ago

Right now they need to be diagonal in the laxMPC, equMPC and ellipMPC solvers due to the way in which z_k is computed (I assume that the inverse of the Hessian is diagonal to speed up computations).

I have started working on making a version for non-diagonal matrices in the branch dev/non_diag, but I will not continue pursuing this line for now.

pablokrupa commented 5 months ago

Support for non-diagonal Q and R matrices was added to the MPCT/EADMM solver in f030de196adc59f6147d86286fffd4c0f6421efe. A similar approach could probably be used in the other ADMM-based solvers.