# Learning-Based Model Predictive Control for Autonomous Racing

^{1}

^{2}

^{*}

## Abstract

**:**

## 1. Introduction

_{ML}. We show that TC-LMPC reduces the best lap time by 10% for the 10-lap FSD race. In the work of Kabzan et al. [20], a 10% lap time reduction was also achieved. However, when we activate the model learning component, we show that a 10% lap time reduction can be sustained throughout the event but with a total race time reduction of 3% when compared to the TC-LMPC without the model learning part.

_{ML}architecture uses GPR for system dynamics learning. Finally, we introduce the implementation details and show the simulation results for model learning and for both architectures in Section 5. Section 6 provides a summary of the main contributions and suggestions for future research directions.

## 2. Learning-Based Model Predictive Control

#### 2.1. Model Predictive Control

#### 2.2. TC-LMPC—Terminal Component Learning

- Nonincreasing cost at each iteration;
- Recursive feasibility, i.e., state and input constraints are satisfied at iteration j if they were satisfied before;
- Closed-loop equilibrium is asymptotically stable.

#### 2.3. Gaussian Processes Regression

#### 2.4. Sparse Approximations for Gaussian Process Regression

## 3. Performance-Driven Controller Learning

#### 3.1. Learning Terminal Components for Autonomous Racing

#### 3.2. TC-LMPC for Formula Student Driverless

#### 3.3. Formula Student Driverless Vehicle Model

## 4. System Dynamics Learning

## 5. Implementation and Results

#### 5.1. Implementation

`albatross`(https://swiftnav-albatross.readthedocs.io/en/latest/index.html (accessed on 20 April 2023)) library developed by Swift Navigation.

#### 5.2. Model Learning Analysis

#### 5.3. Simulation Results—Model Mismatch Influence

_{ML}—shows that the last lap is 41% and 10% faster when compared to the pre-collected path-following lap and the first lap, respectively. Furthermore, the total event time, 176.5 s, is 5.9 s faster than when using TC-LMPC, a 3% improvement. These results correspond to the online SoD model with ${m}_{SoD}=200$. Figure 6 shows the corresponding 10-lap FSG trackdrive trajectories. It is clear that the reduced model mismatch prevented the vehicle from violating the track constraint. However, it seems that there is still room for improvement during the slalom segment.

#### 5.4. Simulation Results—Prediction Horizon Influence

_{ML}with increasing prediction horizons. In Table 3, we display the lap times and modeling errors for two sets of controller gains with $N=30$ or a look-ahead time of 1.5 s. The results on the left correspond to the parameters used thus far in this section. For the controller on the right, we reduced some derivative costs and the regularization cost on ${v}_{y}$ and increased the Q-function-associated cost to promote greater track progress at each sampling time.

## 6. Conclusions and Future Work

## Author Contributions

## Funding

## Data Availability Statement

## Conflicts of Interest

## Abbreviations

AD | Autonomous Driving |

MPC | Model Predictive Control |

FSD | Formula Student Driverless |

ML | Machine Learning |

LMPC | Learning-Based Model Predictive Control |

GPR | Gaussian Process Regression |

BLR | Bayesian Linear Regression |

MPCC | Model Predictive Contouring Control |

TC-LMPC | Terminal Component Learning-Based Model Predictive Control |

FITC | Fully Independent Training Conditional |

RHC | Receding Horizon Control |

FTCOC | Finite-Time Constrained Optimal Control |

SoD | Subset of Data |

## References

- Scanlon, J.M.; Kusano, K.D.; Daniel, T.; Alderson, C.; Ogle, A.; Victor, T. Waymo simulated driving behavior in reconstructed fatal crashes within an autonomous vehicle operating domain. Accid. Anal. Prev.
**2021**, 163, 106454. [Google Scholar] [CrossRef] - Stogios, C.; Kasraian, D.; Roorda, M.J.; Hatzopoulou, M. Simulating impacts of automated driving behavior and traffic conditions on vehicle emissions. Transp. Res. Part D Transp. Environ.
**2019**, 76, 176–192. [Google Scholar] [CrossRef] - Bischoff, J.; Maciejewski, M. Simulation of City-wide Replacement of Private Cars with Autonomous Taxis in Berlin. Procedia Comput. Sci.
**2016**, 83, 237–244. [Google Scholar] [CrossRef] [Green Version] - Srinivas, S.; Ramachandiran, S.; Rajendran, S. Autonomous robot-driven deliveries: A review of recent developments and future directions. Transp. Res. Part E Logist. Transp. Rev.
**2022**, 165, 102834. [Google Scholar] [CrossRef] - Engholm, A.; Björkman, A.; Joelsson, Y.; Kristoffersson, I.; Pernestål, A. The emerging technological innovation system of driverless trucks. Transp. Res. Procedia
**2020**, 49, 145–159. [Google Scholar] [CrossRef] - Kim, H.; Choi, Y. Autonomous Driving Robot That Drives and Returns along a Planned Route in Underground Mines by Recognizing Road Signs. Appl. Sci.
**2021**, 11, 10235. [Google Scholar] [CrossRef] - Betz, J.; Wischnewski, A.; Heilmeier, A.; Nobis, F.; Stahl, T.; Hermansdorfer, L.; Lohmann, B.; Lienkamp, M. What can we learn from autonomous level-5 motorsport? In 9th International Munich Chassis Symposium 2018; Pfeffer, P., Ed.; Proceedings; Springer: Wiesbaden, Germany, 2019; pp. 123–146. [Google Scholar] [CrossRef]
- Paden, B.; Čáp, M.; Yong, S.; Yershov, D.; Frazzoli, E. A survey of motion planning and control techniques for self-driving urban vehicles. IEEE Trans. Intell. Veh.
**2016**, 1, 33–55. [Google Scholar] [CrossRef] [Green Version] - Thrun, S.; Montemerlo, M.; Dahlkamp, H.; Stavens, D.; Aron, A.; Diebel, J.; Fong, P.; Gale, J.; Halpenny, M.; Hoffmann, G.; et al. Stanley: The robot that won the DARPA Grand Challenge. J. Field Robot.
**2006**, 23, 661–692. [Google Scholar] [CrossRef] - Kim, E.; Kim, J.; Sunwoo, M. Model predictive control strategy for smooth path tracking of autonomous vehicles with steering actuator dynamics. Int. J. Automot. Technol.
**2014**, 15, 1155–1164. [Google Scholar] [CrossRef] - Santos, S.D.; Azinheira, J.R.; Botto, M.A.; Valério, D. Path Planning and Guidance Laws of a Formula Student Driverless Car. World Electr. Veh. J.
**2022**, 13, 100. [Google Scholar] [CrossRef] - Srinivasan, S.; Nicolas Giles, S.; Liniger, A. A Holistic Motion Planning and Control Solution to Challenge a Professional Racecar Driver. IEEE Robot. Autom. Lett.
**2021**, 6, 7854–7860. [Google Scholar] [CrossRef] - Hosseinzadeh, M.; Sinopoli, B.; Kolmanovsky, I.; Baruah, S. Implementing Optimization-Based Control Tasks in Cyber-Physical Systems with Limited Computing Capacity. In Proceedings of the 2022 2nd International Workshop on Computation-Aware Algorithmic Design for Cyber-Physical Systems (CAADCPS), Milan, Italy, 3–6 May 2022; pp. 15–16. [Google Scholar] [CrossRef]
- Feller, C.; Ebenbauer, C. A stabilizing iteration scheme for model predictive control based on relaxed barrier functions. Automatica
**2017**, 80, 328–339. [Google Scholar] [CrossRef] [Green Version] - Hewing, L.; Wabersich, K.P.; Menner, M.; Zeilinger, M.N. Learning-Based Model Predictive Control: Toward Safe Learning in Control. Annu. Rev. Control Robot. Auton. Syst.
**2020**, 3, 269–296. [Google Scholar] [CrossRef] - Hewing, L.; Kabzan, J.; Zeilinger, M.N. Cautious Model Predictive Control Using Gaussian Process Regression. IEEE Trans. Control Syst. Technol.
**2020**, 28, 2736–2743. [Google Scholar] [CrossRef] [Green Version] - Carron, A.; Arcari, E.; Wermelinger, M.; Hewing, L.; Hutter, M.; Zeilinger, M.N. Data-Driven Model Predictive Control for Trajectory Tracking with a Robotic Arm. IEEE Robot. Autom. Lett.
**2019**, 4, 3758–3765. [Google Scholar] [CrossRef] [Green Version] - McKinnon, C.D.; Schoellig, A.P. Learn Fast, Forget Slow: Safe Predictive Learning Control for Systems With Unknown and Changing Dynamics Performing Repetitive Tasks. IEEE Robot. Autom. Lett.
**2019**, 4, 2180–2187. [Google Scholar] [CrossRef] [Green Version] - McKinnon, C.D.; Schoellig, A.P. Context-aware Cost Shaping to Reduce the Impact of Model Error in Receding Horizon Control. In Proceedings of the IEEE International Conference on Robotics and Automation, Virtual Event, 31 May–31 August 2020; pp. 2386–2392. [Google Scholar] [CrossRef]
- Kabzan, J.; Hewing, L.; Liniger, A.; Zeilinger, M.N. Learning-Based Model Predictive Control for Autonomous Racing. IEEE Robot. Autom. Lett.
**2019**, 4, 3363–3370. [Google Scholar] [CrossRef] [Green Version] - Liniger, A.; Domahidi, A.; Morari, M. Optimization-Based Autonomous Racing of 1:43 Scale RC Cars. Optim. Control Appl. Methods
**2015**, 36, 628–647. [Google Scholar] [CrossRef] [Green Version] - Rosolia, U.; Borrelli, F. Learning model predictive control for iterative tasks. A data-driven control framework. IEEE Trans. Autom. Control
**2018**, 63, 1883–1896. [Google Scholar] [CrossRef] [Green Version] - Rosolia, U.; Carvalho, A.; Borrelli, F. Autonomous racing using learning Model Predictive Control. In Proceedings of the 2017 American Control Conference (ACC), Seattle, WA, USA, 24–26 May 2017; pp. 5115–5120. [Google Scholar] [CrossRef] [Green Version]
- FORCES Professional. Available online: https://embotech.com/FORCES-Pro (accessed on 15 April 2023).
- Zanelli, A.; Domahidi, A.; Jerez, J.; Morari, M. FORCES NLP: An efficient implementation of interior-point methods for multistage nonlinear nonconvex programs. Int. J. Control
**2020**, 93, 13–29. [Google Scholar] [CrossRef] - Xu, S. Learning Model Predictive Control for Autonomous Racing Improvements and Model Variation in Model Based Controller Examiner. Master’s Thesis, KTH Royal Institute of Technology, Stockholm, Sweden, 2018. [Google Scholar]
- Lawrence, N.D.; Platt, J.C. Learning to Learn with the Informative Vector Machine. In Proceedings of the Twenty-First International Conference on Machine Learning, Banff, AB, Canada, 4–8 July 2004; p. 65. [Google Scholar] [CrossRef]
- Borrelli, F.; Bemporad, A.; Morari, M. Predictive Control for Linear and Hybrid Systems; Cambridge University Press: Cambridge, UK, 2017. [Google Scholar] [CrossRef] [Green Version]
- Rasmussen, C.E.; Williams, C.K.I. Gaussian Processes for Machine Learning; The MIT Press: Cambridge, MA, USA, 2005. [Google Scholar] [CrossRef] [Green Version]
- Quiñonero-Candela, J.; Rasmussen, C.; Williams, C. Approximation methods for Gaussian process regression. In Large-Scale Kernel Machines; MIT Press: Cambridge, MA, USA, 2007. [Google Scholar]
- Snelson, E.; Ghahramani, Z. Sparse Gaussian Processes Using Pseudo-Inputs; MIT Press: Cambridge, MA, USA, 2005; pp. 1257–1264. [Google Scholar]
- Rosolia, U.; Borrelli, F. Sample-Based Learning Model Predictive Control for Linear Uncertain Systems. In Proceedings of the IEEE Conference on Decision and Control, Nice, France, 11–13 December 2019; pp. 2702–2707. [Google Scholar] [CrossRef] [Green Version]
- Jazar, R.N. Vehicle Dynamics: Theory and Applications; Springer US: New York, NY, USA, 2008; pp. 1–1015. [Google Scholar] [CrossRef]
- Kabzan, J.; Valls, M.; Reijgwart, V.; Hendrikx, H.; Ehmke, C.; Prajapat, M.; Bühler, A.; Gosala, N.; Gupta, M.; Sivanesan, R.; et al. AMZ Driverless: The full autonomous racing system. J. Field Robot.
**2020**, 37, 1267–1294. [Google Scholar] [CrossRef] - Coulter, R. Implementation of the Pure Pursuit Path Tracking Algorithm. 1992. Available online: https://www.ri.cmu.edu/publications/implementation-of-the-pure-pursuit-path-tracking-algorithm/ (accessed on 20 April 2023).

**Figure 3.**Dynamic bicycle model (reprinted from [34]). The red arrows represent forces applied in the vehicle. The blue arrows represent both linear and angular velocities. The green arrows represents the position vector of the vehicle’s center of gravity with respect to the global coordinate frame.

**Figure 6.**TC−LMPC

_{ML}FSG trackdrive trajectory [$N=20$]. The grey arrow shows the track direction.

${\mathit{m}}_{\mathit{S}\mathit{o}\mathit{D}}$ | $\overline{\left|\right|{\mathit{e}}_{\mathit{n}\mathit{o}\mathit{m}}\left|\right|}$ | $\overline{\left|\right|{\mathit{e}}_{\mathit{G}\mathit{P}}\left|\right|}$ | ${\mathit{m}}_{\mathit{F}\mathit{I}\mathit{T}\mathit{C}}$ | $\overline{\left|\right|{\mathit{e}}_{\mathit{n}\mathit{o}\mathit{m}}\left|\right|}$ | $\overline{\left|\right|{\mathit{e}}_{\mathit{G}\mathit{P}}\left|\right|}$ |
---|---|---|---|---|---|

300 | 0.26 | 0.08 | 10 | 0.26 | 0.17 |

600 | 0.25 | 0.07 | 20 | 0.26 | 0.15 |

200 | 0.27 | 0.09 | 10 | 0.27 | 0.12 |

300 | 0.27 | 0.07 | 20 | 0.27 | 0.13 |

TC-LMPC | TC-LMPC_{ML} | ||||
---|---|---|---|---|---|

Lap | Time [s] | $\overline{\left|\right|{\mathit{e}}_{\mathit{n}\mathit{o}\mathit{m}}\left|\right|}$ | Time [s] | $\overline{\left|\right|{\mathit{e}}_{\mathit{n}\mathit{o}\mathit{m}}\left|\right|}$ | $\overline{\left|\right|{\mathit{e}}_{\mathit{G}\mathit{P}}\left|\right|}$ |

1 | 19.36 | 0.22 | 18.92 | 0.21 | 0.06 |

2 | 19.33 | 0.21 | 18.75 | 0.21 | 0.07 |

3 | 19.34 | 0.21 | 18.73 | 0.21 | 0.07 |

4 | 19.33 | 0.22 | 18.71 | 0.21 | 0.07 |

5 | 17.78 | 0.29 | 17.17 | 0.29 | 0.08 |

6 | 17.45 | 0.30 | 16.85 | 0.31 | 0.11 |

7 | 17.44 | 0.31 | 16.77 | 0.32 | 0.13 |

8 | 17.51 | 0.29 | 16.84 | 0.32 | 0.11 |

9 | 17.43 | 0.30 | 16.80 | 0.31 | 0.12 |

10 | 17.43 | 0.30 | 16.96 | 0.32 | 0.13 |

Default Parameters | Aggressive Parameters | |||||
---|---|---|---|---|---|---|

Lap | Time [s] | $\overline{\left|\right|{\mathit{e}}_{\mathit{n}\mathit{o}\mathit{m}}\left|\right|}$ | $\overline{\left|\right|{\mathit{e}}_{\mathit{G}\mathit{P}}\left|\right|}$ | Time [s] | $\overline{\left|\right|{\mathit{e}}_{\mathit{n}\mathit{o}\mathit{m}}\left|\right|}$ | $\overline{\left|\right|{\mathit{e}}_{\mathit{G}\mathit{P}}\left|\right|}$ |

1 | 17.16 | 0.27 | 0.07 | 16.37 | 0.39 | 0.14 |

2 | 16.92 | 0.26 | 0.07 | 16.18 | 0.37 | 0.15 |

3 | 16.91 | 0.26 | 0.07 | 16.17 | 0.37 | 0.15 |

4 | 16.88 | 0.26 | 0.07 | 16.13 | 0.37 | 0.15 |

5 | 16.69 | 0.28 | 0.08 | 16.17 | 0.36 | 0.15 |

6 | 16.66 | 0.28 | 0.09 | 16.21 | 0.37 | 0.15 |

7 | 16.67 | 0.28 | 0.08 | 16.19 | 0.36 | 0.15 |

8 | 16.68 | 0.28 | 0.08 | 16.14 | 0.37 | 0.16 |

9 | 16.68 | 0.27 | 0.08 | 16.15 | 0.37 | 0.16 |

10 | 16.69 | 0.27 | 0.08 | 16.11 | 0.36 | 0.15 |

Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |

© 2023 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Pinho, J.; Costa, G.; Lima, P.U.; Ayala Botto, M.
Learning-Based Model Predictive Control for Autonomous Racing. *World Electr. Veh. J.* **2023**, *14*, 163.
https://doi.org/10.3390/wevj14070163

**AMA Style**

Pinho J, Costa G, Lima PU, Ayala Botto M.
Learning-Based Model Predictive Control for Autonomous Racing. *World Electric Vehicle Journal*. 2023; 14(7):163.
https://doi.org/10.3390/wevj14070163

**Chicago/Turabian Style**

Pinho, João, Gabriel Costa, Pedro U. Lima, and Miguel Ayala Botto.
2023. "Learning-Based Model Predictive Control for Autonomous Racing" *World Electric Vehicle Journal* 14, no. 7: 163.
https://doi.org/10.3390/wevj14070163