Adaptive Cruise Control with MPC

The MPC problem could be finally formed with our cost function and constraint as:

\[\begin{aligned} \min_{\tilde{W}(k)} \quad J(k) &= J_{\text{track}}(k) + \lambda J_{\text{input}}(k) \\ &= \| M_{1}\tilde{W}(k)+M_{2}v(k) - \tilde { v } _ { \operatorname { ref } } ( k ) \| _ { \infty } + \lambda \| M_{3}\tilde{W}(k) \| _ { 1 } \\ &{\rm{s.t.}} \quad F_{1}\tilde{W}(k) \leqslant F_{2} + F_{3}v(k) \end{aligned} \label{eq:MPC_dir}\]

Now, we introduce dummy variables \(\tau \in \mathbb{R}\) and \(\rho \in \mathbb{R}^N_{p}\) to transform the MPC optimization problem above into a mixed-integer linear programming problem (MILP). According to the notes given in the assignment, we transform our cost function as following:

\[\begin{aligned} J(k) &=\| M_{1}\tilde{W}(k)+M_{2}v(k) - \tilde { v } _ { \operatorname { ref } } ( k ) \| _ { \infty } + \lambda \| M_{3}\tilde{W}(k) \| _ { 1 } \\ &= \tau + \sum_{i} \rho_{i} \end{aligned}\]

with new corresponding constraints:

\[\begin{aligned} -\tau &\leqslant (M_{1}\tilde{W}(k)+M_{2}v(k) - \tilde{v}_{\rm{ref}})_{i} \leqslant \tau \quad \text{for $i = 1, \cdots, N_{p}$}\\ -\rho &\leqslant M_{3}\tilde{W}(k) \leqslant \rho \end{aligned}\]

Then, we can rewrite our MPC problem to an MILP problem as following:

\[\begin{aligned} \min_{\tau, \ \rho, \ \tilde{W}(k)} \quad & \tau + \lambda\sum_{i}\rho_{i} \\ {\rm{s.t.}} \quad & F_{1}\tilde{W}(k) \leqslant F_{2} + F_{3}v(k) \\ & -\tau \leqslant (M_{1}\tilde{W}(k)+M_{2}v(k) - \tilde{v}_{\rm{ref}})_{i} \leqslant \tau \quad \text{for $i = 1, \cdots, N_{p}$}\\ & -\rho \leqslant M_{3}\tilde{W}(k) \leqslant \rho \end{aligned}\]

Now we can efficiently optimize this problem with existed MILP solver. We choose to use the glpk function of the MPT toolbox.