I am getting started in the world of mpc and optimal control. I have used acados with hpipm recently for drone mpc with decent success and I want to use the framework in another closed loop control problem. My low-level understanding of the solver is still limited so I apologize in advance.
I would like to know if the following mpc problem is too much of a stretch for the target formulation of acados, or otherwise how you would implement the solver.
Let us assume we have a vehicle we want to drive to a certain position
p_f with a certain non-zero terminal velocity
v_f, at exactly time
t_f. However, currently, my reference
y_ref only contains the instantaneous values for
t_f without any actual reference sequence. Assuming
v(t) are observable, is it possible to formulate such a problem in acados using linear least squares cost?
As my first intuition, I thought about using a terminal-cost only cost function. Note
t_f remains fixed as the system evolves with time, so effectively the time horizon of the problem would shrink with each iteration.
After some thinking and trying to compile such a solver, I thought of other possible options:
- (Not preferred) Implementing a reference generator and use a normal fixed time-horizon formulation
tfas a problem parameter or a problem variable with equality constraints, such that I can choose the time horizon on-line without needing to re-compile the solver (does not seem possible with acados)
- Using an extenal cost function defined in casadi syntax with parameters (is there any example for defining such a cost?), such that I can define a cost function unique for every shooting node
- Doing a state augmentation of the sort
p'(i) = d(i) * (p(i) - p_f)(and similar for
d(i)would be a dirac-style function for each node
i, such that the cost is only defined at the shooting node closest to my time target. Since my state is 6 dimensional, probably this is not a very nice idea either.
As stated above, due to my problem circumstances I would prefer not to have an intermediate planning algorithm. Is any of the above options feasible with acados?
Thank you very much!