MIMO MPC reference tracking

137 views
Skip to first unread message

Mike

unread,
Jun 4, 2020, 5:38:09 PM6/4/20
to YALMIP
Dear Johan, 

I have tried to rebuild your MPC reference tracking example for a double input double output system. However, for some reason, my states are staying the same for the whole simulation time while my inputs are changing. Could you point me in the right direction?  I hope my question is clear or I would be happy to elaborate. 
Thank you for creating this tool btw, really appreciate it!!
MPC_controller3.m
Models_ctrl.mat
Screenshot 2020-06-04 at 23.36.26.png
Screenshot 2020-06-04 at 23.36.32.png

Johan Löfberg

unread,
Jun 4, 2020, 5:55:50 PM6/4/20
to YALMIP
you've commented away the state-update. fixing that (with the obvious bug in the use of U) gives a periodic movement on the two outputs

Mike

unread,
Jun 5, 2020, 2:54:11 AM6/5/20
to YALMIP
Thank you for your quick reply, Johan! That was indeed fairly obvious. Stupid mistake. How would I address the problem if I just wanted an already follow an already predefined output reference vector? Then I wouldn't need to define r as an sdpvar right? 

Johan Löfberg

unread,
Jun 5, 2020, 3:12:21 AM6/5/20
to YALMIP
If r is the same at every sample and you know that fixed r before setting up the problem and you only want to simulate that particular example then you can just use that constant instead of course. If you want to create an optimizer parameterized in r and r is constant along the prediction, you can use a scalar sdpvar r and change indexing accordingly. Regardless of how you do it, it will have minor impact on the simulation performance since the model is linear in r and thus the overhead to replace the parameterized r when calling the solver is close to 0


Reply all
Reply to author
Forward
0 new messages