Problem with mpc controller for a LPV system

190 views
Skip to first unread message

Ali Reza

unread,
Jan 19, 2021, 12:57:16 PM1/19/21
to casadi...@googlegroups.com
Hi
I am new to casadi.I am writing a code to design a mpc controller for a LPV system. Everything seems simple but  the output doesn't follow the set point. I checked it multiple times, but no improvement was achieved.
Tnx for Help
MPC_using_DP_CASADI.m

Joris Gillis

unread,
Feb 7, 2021, 3:48:16 AM2/7/21
to CasADi
Hi there,

You have a linear system and quadratic objective, so best is to to start from an infinite-horizon unconstrained controller (lqr in Matlab).
Compare that result with an unconstrained MPC with long horizon; and only then check behavior when constraints are added and horizon becomes very short.
The jump from infinite-horizon to finite-horizon brings stability issues. It may be that you need a terminal/arrival cost as well as a terminal set constraint.
Consult any textbook on linear MPC for this.

Some remarks on your code:
 - D has wrong dimensions
 - your joint x,y update is wrong; write y=Cx+Du before x=Ax+Bu
 - you have a single Opti instance that you grow by adding variables and constraints all the time.
   Instead, do a fresh Opti instance for each sampling time, or do a parametric one upfront.


Best regards,
  Joris

Ali Reza

unread,
Feb 14, 2021, 11:34:01 AM2/14/21
to CasADi
Dear  Joris 

thank you for your help. 

Reply all
Reply to author
Forward
0 new messages