# Adaptive Planning and Control with Time-Varying Tire Models for Autonomous
Racing Using Extreme Learning Machine

Dvij Kalaria1, Qin Lin2, and John M. Dolan1 1The authors are with the Robotics
Institute, Carnegie Mellon University
dkalaria<EMAIL_ADDRESS>Lin is with the Electrical
Engineering and Computer Science Department, Cleveland State University
<EMAIL_ADDRESS>
###### Abstract

Autonomous racing is a challenging problem, as the vehicle needs to operate at
the friction or handling limits in order to achieve minimum lap times.
Autonomous race cars require highly accurate perception, state estimation,
planning and precise application of controls. What makes it even more
challenging is the accurate identification of vehicle model parameters that
dictate the effects of the lateral tire slip, which may change over time, for
example, due to wear and tear of the tires. Current works either propose model
identification offline or need good parameters to start with (within 15-20% of
actual value), which is not enough to account for major changes in tire model
that occur during actual races when driving at the control limits. We propose
a unified framework which learns the tire model online from the collected
data, as well as adjusts the model based on environmental changes even if the
model parameters change by a higher margin. We demonstrate our approach in
numeric and high-fidelity simulators for a 1:43 scale race car and a full-size
car.

###### Index Terms:

Learning-based control, adaptive vehicle control, extreme learning machine

##  I INTRODUCTION

The estimation of tire conditions is critical for the performance and safety
of racing. Racing teams usually pre-estimate tire models and tire traction to
assist in decision-making on when to change tires [1], and what tire to use
for minimal cumulative lap times to win the race. Race drivers adjust their
behaviors with each lap, adjusting speeds at the turns based on their
estimates of how well the tire traction will support them. Estimating the
vehicle’s handling capacity is particularly challenging due to a lot of
variables around the actual race such as temperature, weather conditions, etc.
For example, the tire forces depend on the racing surface and temperature.

To build an autonomous racing car, a model-based planning and control
framework is commonly used, assuming precise vehicle model parameters are
available. While estimating the kinematics of the vehicle is pretty
straightforward, as it only requires calculating geometric parameters of the
vehicle, estimating precise dynamics, especially lateral tire forces, requires
interacting with the road material and hence requires time-intensive system
identification and verification. We propose an online learning strategy that
first uses a geometric-based kinematic nominal model [2] and identifies the
complicated dynamics such as tire model, aerodynamic forces, and longitudinal
friction from the collected data even under environmental changes due to wear
and tear of the tires. This significantly reduces the effort required in model
identification and allows online adaptation of racing line reference speeds to
adjust the driving behavior accordingly. Specifically, we propose the use of
an Extreme Learning Machine (ELM)-based tire force prediction model for
lateral forces and longitudinal tire model, which captures the discrepancy
between the nominal model and the dynamic model. Our approach using ELMs
separately for rear and front tires allows interpreting the coefficient
friction of the tires, which can be used for adaptive speed planning along the
racing line in contrast to existing approaches assuming time-invariant
friction. Our approach significantly improves the safety of a race car. First,
we demonstrate our results in a 1:43-scale numeric simulator [3], where we
change the tire coefficient of friction to simulate wear and tear of the tires
during the run. We then demonstrate in the high-fidelity Carla simulator with
additional sensor and model noise, and a sloped racetrack.

The main contributions of our work are summarized as follows:

  * •

We propose a novel unified optimization framework for model identification, as
well as online adaptation for autonomous racing. Our approach outperforms the
state-of-the-art Gaussian process (GP)-based controller [2] on lap time,
safety, and computation efficiency.

  * •

Unlike existing approaches that assume time-invariant friction, our ELM model
estimates time-varying friction online to enable adaptive speed planning along
the race line for safe racing.

  * •

We demonstrate results in a 1:43 numeric simulator and Carla with simulated
wear and tear of the tires.

##  II RELATED WORKS

The task of autonomous racing has been actively explored both in the optimal
control and reinforcement learning communities. The existing approaches can be
briefly classified into model-free and model-based categories. Some model-free
works, e.g., [4, 5, 6] train end-to-end policies to directly take images as
input and output throttle and steering.

In the model-based category, [3] and [7] propose modular frameworks for
autonomous racing using uncertainty-aware nonlinear Model Predictive Control
(MPC) with accurate tire model parameters.

MPC can be implemented either in a receding horizon manner or a contouring
manner (called MPCC [3]). The high performance of MPC relies on accurate
dynamic models. As a remedy, learning-based control algorithms are expected to
robustly reject disturbances caused by inaccurate dynamic models. In light of
this, [8] [2] propose an iterative procedure that uses data from previous laps
to correct the vehicle model. [9] proposes using GP and linear MPC [10] to
enable learning vehicle parameters. Model mismatch errors of up to 15% can be
compensated. All these methods assume the availability of nearly-accurate tire
parameters, which is practically difficult.

[2] proposes using an extended kinematic model and applies GP to learn the
difference between the high-fidelity dynamic model and the extended kinematic
model from collected data offline. However, using GP in optimization is
computationally expensive (0.25s-0.3s according to [2]), which makes it
practically infeasible to deploy on an actual car. Our work is closest to [2],
but it is importantly able both to learn the vehicle model and adapt online.
Both of these advantages are realized by using ELMs, which are computationally
lightweight (0.02s-0.06s per iteration), to estimate tire model instead of GP.

The rest of the paper is organized as follows: Section III briefly defines
some preliminaries used in the work. Section IV elaborates on our proposed
method. Section V reports the simulation experiments. Finally, in Section VI
we make concluding remarks and discuss some interesting future directions.

##  III PRELIMINARIES

###  III-A Racing Line

During a race, professional drivers follow a racing line while using specific
maneuvers that allow them to use the limits of the car’s tire forces. This
path can be used as a reference by the autonomous racing motion planner to
effectively follow time-optimal trajectories while avoiding collision, among
other objectives. The racing line is essentially a minimum-time path or a
minimum-curvature path. They are similar but the minimum-curvature path
additionally allows the highest cornering speeds given the maximum legitimate
lateral acceleration [11].

In our work, we calculate the minimum-curvature optimal line, which is close
to the optimal racing line as proposed by [11]. The race track information is
input by a sequence of tuples ($x_{i}$,$y_{i}$,$w_{i}$),
$i\in\\{0,...,N-1\\}$, where ($x_{i}$,$y_{i}$) denotes the coordinate of the
center location and $w_{i}$ denotes the lane width at the $i^{th}$ point. The
output trajectory consists of a tuple of seven variables: coordinates $x$ and
$y$, longitudinal displacement $s$, longitudinal velocity $v_{x}$,
acceleration $a_{x}$, heading angle $\psi$, and curvature $\kappa$. The
trajectory is obtained by minimizing the following cost:

$\begin{split}&\mathop{\min}\limits_{\alpha_{1}...\alpha_{N}}\quad\sum_{n=0}^{N-1}\kappa_{i}^{2}(n)\\\
\text{s.t.}&\quad\alpha_{i}\in\left[-w_{i}+\frac{w_{veh}}{2},w_{i}-\frac{w_{veh}}{2}\right]\\\
\end{split}$ (1)

where the vehicle width is $w_{veh}$, and $\alpha_{i}$ is the lateral
displacement at the $i^{th}$ position with respect to the reference center
line. To generate a velocity profile, the vehicle’s velocity-dependent
longitudinal and lateral acceleration limits are required [11]. We generate
velocity profiles for different lateral acceleration limits determined based
on the coefficients of friction of the front tire ($\mu_{f}$) and rear tire
($\mu_{r}$), with mass $m$ and the gravity constant $g$, as described next.

We define multiple velocity profiles for a range of maximum lateral forces
from $\mu_{eff}$ in $[\mu_{min},\mu_{max}]$ so that we can obtain the velocity
at any given values of $\mu_{l}$ and $\mu_{r}$ by interpolating between the
known values. The racing line and velocity profiles at $\mu_{eff}=1$ are shown
for the two tracks used in our experiments, see Fig. 1 and Fig. 2.

(a)

(b)

Figure 1: Racing line (Carla track) and speed profile. The $x$ axis of the
speed profile is the longitudinal displacement.

(a)

(b)

Figure 2: Racing line (ETHZ track) and speed profile. The $x$ axis of the
speed profile is the longitudinal displacement.

###  III-B Vehicle models

The most widely used vehicle models in the context of autonomous driving and
racing are the kinematic and dynamic bicycle models. The kinematic model uses
$x$, $y$ coordinates, $\phi$ heading angle in the global inertial frame,
velocity $v$, and acceleration $a$. The dynamic model has states $x$, $y$, and
$\phi$ in the global frame; longitudinal velocity $v_{x}$, lateral velocity
$v_{y}$, and yaw angular velocity $\omega$ in the vehicle’s body frame; and
steering angle $\delta$. For the kinematic model, the control variables are
acceleration $a$ and steering $\delta$, and throttle $d$ and change in
steering $\Delta\delta$ define the action space. For the dynamic model,
$F_{r,x}$ is the longitudinal force on the rear tire in the tire frame
assuming a rear-driven vehicle, $F_{f,y}$ and $F_{r,y}$ are the forces on the
front and rear tires, respectively, and $\alpha_{f}$ and $\alpha_{r}$ are the
corresponding slip angles. We denote the mass of the vehicle $m$, the moment
of inertia in the vertical direction about the center of mass of the vehicle
$I_{z}$, the length of the vehicle from the COM (center of mass) to the front
wheel $l_{f}$, and the length from the COM to the rear wheel $l_{r}$.
$B_{f/r}$, $C_{f/r}$, $D_{f/r}$ are the Pacejka tire model parameters specific
to the tire and track surface. Just to avoid confusion, these are used only in
numeric simulation to simulate the vehicle dynamics; our goal is to estimate
the tire curve (slip angle vs. lateral force generated by the tire) using
ELMs, as we discuss later. For longitudinal force, $C_{m1},C_{m2}$ are known
constants obtained from the gear model and $C_{r},C_{d}$ are aerodynamic force
constants which are learned from vehicle interactions.

####  III-B1 Kinematic model

This model is defined exclusively by the geometric parameters of the vehicle
that can be physically measured, without taking into consideration any contact
surfaces. It ignores the effect of lateral tire slip, which is crucial at high
speeds. Hence, it is suitable for lower speeds, but at cornering speeds, it is
inaccurate due to considerable lateral tire slip.

$\begin{bmatrix}\dot{x}\\\ \dot{y}\\\ \dot{\phi}\\\ \dot{v}\\\ \dot{\delta}\\\
\beta\end{bmatrix}=\begin{bmatrix}v\cos(\phi+\beta)\\\ v\sin(\phi+\beta)\\\
\frac{v\sin(\beta)}{l_{r}}\\\ a\\\ \frac{\Delta\delta}{\Delta t}\\\
\tan^{-1}(\frac{l_{f}}{l_{f}+l_{r}}tan\delta)\end{bmatrix}$ (2)

####  III-B2 Dynamic model

The dynamic model, on the other hand, is complex and takes into consideration
the lateral tire slip but requires time-intensive identifications to determine
the Pacejka tire model parameters of the tire, drivetrain, and aerodynamic
resistance parameters. It is highly suitable for autonomous racing, as it
accurately models the dynamics at cornering speeds during turns. However,
accurate values of parameters are needed, and these values may change over
time. Also, the tire lateral slip curves must be re-calibrated if the surface
changes, which is common for autonomous racing. Here, $p$ and $r$ are the roll
and pitch respectively of the vehicle which are assumed to be numerically less
in magnitude such that $\cos(p)\approx 1$ and $\cos(r)\approx 1$

$\begin{split}&\begin{bmatrix}\dot{x}\\\ \dot{y}\\\ \dot{\phi}\\\
\dot{v}_{x}\\\ \dot{v}_{y}\\\ \dot{\omega}\\\ \dot{\delta}\\\
\end{bmatrix}=\begin{bmatrix}v_{x}\cos(\phi)-v_{y}\sin(\phi)\\\
v_{x}\sin(\phi)+v_{y}\cos(\phi)\\\ \omega\\\
\frac{1}{m}(F_{r,x}-F_{f,y}\sin(\delta)+mv_{y}\omega-mg\sin(p))\\\
\frac{1}{m}(F_{r,y}+F_{f,y}\cos(\delta)-mv_{x}\omega+mg\sin(r))\\\
\frac{1}{I_{z}}(F_{f,y}l_{f}\cos(\delta)-F_{r,y}l_{r})\\\
\frac{\Delta\delta}{\Delta t}\\\ \end{bmatrix}\\\ \end{split}$ (3)

where $F_{r,x}=(C_{m1}-C_{m2}v_{x})d-C_{r}-C_{d}v_{x}^{2}$,
$F_{f,y}=D_{f}\sin(C_{f}\tan^{-1}(B_{f}\alpha_{f})),\alpha_{f}=\delta-\tan^{-1}\left(\frac{\omega
l_{f}+v_{y}}{v_{x}}\right)$, and
$F_{r,y}=D_{r}\sin(C_{r}\tan^{-1}(B_{r}\alpha_{r})),\alpha_{r}=\tan^{-1}\left(\frac{\omega
l_{r}-v_{y}}{v_{x}}\right)$.

####  III-B3 Extended kinematic model

The essential difference between the two models is that the dynamic model has
additional states $v_{x}$, $v_{y}$ and $w$ which are not in the kinematic
model. Also, slip angles $\alpha_{f}$ and $\alpha_{r}$ are assumed to be $0$
in the kinematic model. We therefore consider a variant of the kinematic model
called the extended kinematic or E-kinematic model [2]. It is derived just by
having $\dot{\alpha}_{f}=0$ and $\dot{\alpha}_{r}=0$. Also, for longitudinal
forces, the effect of aerodynamic forces is ignored in this model. Hence, we
have:

$\begin{split}&\begin{bmatrix}\dot{x}\\\ \dot{y}\\\ \dot{\phi}\\\
\dot{v}_{x}\\\ \dot{v}_{y}\\\ \dot{\omega}\\\ \dot{\delta}\\\
\end{bmatrix}=\begin{bmatrix}v_{x}\cos(\phi)-v_{y}\sin(\phi)\\\
v_{x}\sin(\phi)+v_{y}\cos(\phi)\\\ \omega\\\ \frac{F_{r,x}}{m}\\\
\frac{l_{f}}{l_{f}+l_{r}}(\dot{\delta}v_{x}+\dot{v_{x}}\delta)\\\
\frac{1}{l_{f}+l_{r}}(\dot{\delta}v_{x}+\dot{v_{x}}\delta)\\\
\frac{\Delta\delta}{\Delta t}\\\ \end{bmatrix}\end{split}$ (4)

where $F_{r,x}=(C_{m1}-C_{m2}v_{x})d$.

This model also has only geometric parameters $l_{f}$, $l_{r}$, and $m$ as
model parameters. Unlike the dynamic model, it doesn’t consider tire forces.
It extends the dimension of the kinematic model to obtain the same number of
states as the dynamic model. In our work, the E-kinematic model will serve as
a nominal model. The difference between the dynamic model and the nominal
model will be learned and compensated by our learning component - ELM.

###  III-C Extreme Learning Machine

For modeling tire friction curves, we use extreme learning machines (ELMs). An
architecture of a single-layer ELM is shown in Fig. 3. Let the no of input
nodes be $n_{i}$, no of hidden nodes $n_{h}$ and no of output nodes $n_{o}$.
Let the input be $x\in R^{n_{i}}$, then the output $y\in R^{n_{o}}$ can be
obtained as:

$\mathbf{y}=\mathbf{H}(\mathbf{x})\boldsymbol{\beta}=g(\mathbf{w}^{T}\mathbf{x})\boldsymbol{\beta}$
(5)

where $\mathbf{H}=[H_{1},H_{2},\cdots,H_{j},\cdots,H_{n_{L}}]$ is the non-
linear transformation, $\mathbf{w}=[w_{1},\cdots,w_{n_{I}}]$ are input
weights, and $\boldsymbol{\beta}=[\beta_{1},\cdots,\beta_{n_{L}}]$ are output
weights. Furthermore, $g(\cdot)$ corresponds to a kernel function that
fulfills the condition for universal approximation [12].

Figure 3: Architecture of a single layer ELM.

For training, let us consider the dataset to be of $N$ size with each element
of the form $(\mathbf{x}_{n},\mathbf{t}_{n})$, where
$\mathbf{t}_{i}\in\mathbb{R}^{n_{O}}$ is the true label corresponding to
$i^{th}$ datapoint. ELM has a fixed input weight denoted as $\hat{\mathbf{w}}$
unlike a traditional feedforward single layer neural network. Using ELM
instead of a single layer neural network is more efficient as according to
[13], if we initialize input weight $\mathbf{w}$ with random values drawn from
a distribution and keep them fixed, it can theoretically get the same results
even if it is not optimized. The learning objective of ELM is to obtain the
optimal $\boldsymbol{\beta}^{*}$ which satisfies the following minimization
objective:

$\boldsymbol{\beta}^{*}=\underset{\boldsymbol{\beta}}{\operatorname*{arg\,min}}\;\mathcal{L}\left(\mathbf{y}(\boldsymbol{\beta}),\mathbf{t}\right)=\underset{\boldsymbol{\beta}}{\operatorname*{arg\,min}}\;\|\mathbf{H}(\mathbf{x})\boldsymbol{\beta}-\mathbf{t})\|_{2}$
(6)

where $\mathcal{L}$ is the loss function defined as $l^{2}$-norm between the
output $y$ and the label $t$. We can solve for $\boldsymbol{\beta}^{*}$
analytically using the following relation

$\boldsymbol{\beta}=\mathbf{H}^{+}\mathbf{t}$ (7)

Where $\mathbf{H}^{+}$ is the pseudo inverse of $\mathbf{H}$. However, such
standard analytical solution is possible only when the output labels
$\mathbf{t}$ are directly available or if the dataset is fixed. In our case,
we use separate ELMs for rear and front tire slip-curve estimation. Here the
inputs are the slip angle $\alpha_{f|r}$ and unity $1$ to add bias on the
first linear layer, thus $n_{I}=2$ and the output is the lateral force,
$F_{[f|r]y}$, thus $n_{o}=1$. $n_{h}$ is a hyperparameter which we choose as
$40$ for the experiments. We will discuss in Sec. IV-B2 why we use a gradient
variant of the standard ELM called tuning ELM [14], where the gradient signal
to reduce the model error is passed through both front and rear tire ELMs.

##  IV METHODOLOGY

###  IV-A Problem setting

We first perform experiments on the 1:43-scale numeric autonomous racing
platform [3], where the dynamic model with the Pacejka tire model is used. We
then also demonstrate our results on the more complicated and close-to-real
Carla simulator, where the simulator vehicle model is unknown, but we have
estimates of the engine like throttle and rpm-to-torque mapping that can be
used to get approximate values of $C_{m1}$ and $C_{m2}$ to use in the
e-kinematic model (nominal model $f_{e-kin}$). Later, through the collected
data, we learn the residual error $f_{err}$ to obtain the final corrected
model, i.e., $f_{corr}=f_{e-kin}+f_{err}$. The learnable parameters here are
the ELM tire slip models, longitudinal friction $C_{r}$ and aerodynamic force
constant $C_{d}$.

Figure 4: Training cycle

Our goal is to learn $f_{corr}$ from the vehicle interactions to make real-
time decisions to minimize lap time and also adapt to the changing
environment, which is simulated in the experiments by reducing the coefficient
of friction of the tires and adjusting the speeds accordingly for safety.

###  IV-B Learning based control

We break down our approach into three parts as follows:

####  IV-B1 Collecting data

The collected data can be represented as a pair of states from consecutive
time steps, i.e., as $\\{x_{k},u_{k},x_{k+1}\\}$. Hence, the error between the
actual state $x_{k+1}$ and the one estimated from the discretized e-kinematic
model can be represented as:

$e_{(x_{k},u_{k})}=x_{k+1}-f_{e-kin}(x_{k},u_{k})$ (8)

The e-kinematic vehicle model is discretized using Runge-Kutta $6^{th}$-order
approximation. We collect the data online, hence the dataset at the $n^{th}$
time step $D_{n}=\\{(e(x_{k},u_{k}))|k\in\\{1,2,..,n-1\\}\\}$.

####  IV-B2 Training and online adaptation

Our goal is to learn the model mismatch error, $e(x_{k},u_{k})$. The training
cycle can be briefly visualized as in Fig. 4. The predicted value
$e_{pred}(x_{k},u_{k})$ is obtained as follows:

$\begin{split}&\begin{bmatrix}e_{\dot{v}_{x}}\\\ e_{\dot{v}_{y}}\\\
e_{\dot{\omega}}\\\
\end{bmatrix}_{pred}=\begin{bmatrix}\frac{1}{m}(-C_{r}-C_{d}v_{x}^{2}-F_{f,y}\sin(\delta)+mv_{y}\omega)\\\
\frac{1}{m}(F_{r,y}+F_{f,y}\cos(\delta)-mv_{x}\omega)\\\
\frac{1}{I_{z}}(F_{f,y}l_{f}\cos(\delta)-F_{r,y}l_{r})\\\ \end{bmatrix}\\\ &\
\ \ \ \ \ \ \ -\begin{bmatrix}m\sin(p)\\\
-m\sin(r)+\frac{l_{f}}{l_{f}+l_{r}}(\dot{\delta}v_{x}+\dot{v_{x}}\delta)\\\
\frac{1}{l_{f}+l_{r}}(\frac{\Delta\delta}{\Delta t}v_{x}+\dot{v_{x}}\delta)\\\
\end{bmatrix}\\\ \end{split}$ (9)

where $F_{f,y}=ELM_{f}(\alpha_{f})$, $F_{r,y}=ELM_{r}(\alpha_{r})$.

The loss to be minimized is defined as:

$\begin{split}&L=\sum_{k\in\\{i,..,j\\}}\bigg{(}(e_{\dot{v}_{x}}(x_{k},u_{k})-e_{\dot{v}_{x},pred}(x_{k},u_{k}))^{2}\\\
&\ \ \ \ \ \ \ \ \ \ \ \
+(e_{\dot{v}_{y}}(x_{k},u_{k})-e_{\dot{v}_{y},pred}(x_{k},u_{k}))^{2}\\\ &\ \
\ \ \ \ \ \ \ \ \ \
+(e_{\dot{\omega}}(x_{k},u_{k})-e_{\dot{\omega},pred}(x_{k},u_{k}))^{2}\bigg{)}\end{split}$
(10)

We minimize the loss $L$ iteratively using stochastic gradient descent with
momentum. Letting the update rate be $\alpha$ and the momentum be $\gamma$,
the model parameters are updated as follows:

$\begin{split}&p=\begin{bmatrix}C_{r}&C_{d}&\beta_{elm,f}^{T}&\beta_{elm,r}^{T}\end{bmatrix}^{T}\\\
&v(t)=\gamma v(t-1)+(1-\gamma)\frac{\partial L}{\partial p}\\\
&p(t)=p(t-1)-\alpha v(t)\end{split}$ (11)

We use a mini-batch with the size $K_{batch}$ for a robust update.

####  IV-B3 Adaptive speed planning

Along with updating the vehicle model, what also becomes crucial is to update
the reference speeds along the race line. For example, if the friction
coefficient reduces, the vehicle can only complete a turn successfully at
lower cornering speeds. This requires reducing the reference speeds along the
whole track accordingly. So, we generate the racing line speeds offline (c.f.
Section III-A) and use the predicted value of the coefficient of friction for
adaptive speed planning, i.e., assigning reference speed online according to
time-varying friction. The friction coefficient dictates the maximum ratio of
the force exerted to the normal force. Hence, we can obtain the predicted
friction coefficient as the ratio of the maximum force exerted to the
available normal force, which remains almost constant. As we predict the tire
slip vs. force curve, we can obtain maximum force as the maximum magnitude of
predicted values from ELM with slip angle inputs ranging from the observed
slip angle values. Hence, the predicted friction coefficient is calculated as:

$\begin{split}&\mu_{pred}=\frac{1}{m}\bigg{(}\max_{\alpha_{f}\in[\alpha_{f,min},\alpha_{f,max}]}|ELM_{f}(\alpha_{f})|+\\\
&\ \ \ \ \ \ \ \ \ \
\max_{\alpha_{r}\in[-\alpha_{r,min},\alpha_{r,max}]}|ELM_{r}(\alpha_{r})|\bigg{)}\\\
\end{split}$ (12)

where $\alpha_{(f/r),min}$ and $\alpha_{(f/r),max}$ are the min and max values
of the slip angles observed at any of the tires as of the current time step.

The optimization for control is formulated as follows:

$\begin{split}\min_{u_{0},...u_{n-1}}&\sum_{k=1}^{N}\begin{Vmatrix}x_{k}-x_{ref,k}\\\
y_{k}-y_{ref,k}\end{Vmatrix}_{Q}+\sum_{k=1}^{N-1}\begin{Vmatrix}d_{k}-d_{k-1}\\\
\Delta\delta_{k}\end{Vmatrix}_{R}+\|\epsilon_{k}\|_{S}\\\ \text{s.t.
}&x_{k+1}=f_{corr}(x_{k},u_{k})\\\ \text{ }&x_{0}=x(t)\\\ \text{
}&x_{0}=x(t)\\\ \text{ }&A_{k}\begin{bmatrix}x_{k+1}\\\
y_{k+1}\end{bmatrix}\leq b_{k}+\epsilon_{k}\\\ \text{ }&d_{min}\leq d_{k}\leq
d_{max}\\\ \text{ }&\delta_{min}\leq\delta_{k}\leq\delta_{max}\\\ \text{
}&\Delta\delta_{min}\leq\Delta\delta_{k}\leq\Delta\delta_{max}\end{split}$
(13)

Here, the reference trajectory is obtained by sampling points on the target
racing line at distances according to reference velocities at those points,
similar to [2]. The positive semi-definite matrices $Q$, $R$ and $S$
characterize the tracking, actuation and slack penalties, respectively. Slack
variable $\epsilon_{k}$ is introduced to prevent infeasibilites.
$f_{corr}=f_{e-kin}+e_{pred}$ is the corrected model, which outputs the next
state. We set $f_{corr}=f_{e-kin}$ for $t\leq N$ to train the models
initially. $d_{min},d_{max},\delta_{min},\delta_{max}$ are the actuation
limits and $\Delta\delta_{min},\Delta\delta_{max}$ are the steering rate
limits. The final algorithm is described in Algorithm 1. We first run the
e-kinematic model to train the dynamic model parameters for $K$ iterations,
then we use the trained dynamic model to run the car while also updating the
vehicle model with more collected data and adapt according to any changes in
the model parameters. The reference position and speeds are obtained based on
the current estimates of $\mu$, see Eq. 12.

Input: learning rate $\alpha$, momentum $\gamma$, Initial friction coefficient
$\mu_{init}$, model parameters $m,l_{f},l_{r},I_{z}$, initialized estimators
$ELM_{f}$, $ELM_{r},C_{r},C_{d}$, final time $t_{f}$, time step $dt$, offline
training time threshold $t_{th}$.

Output: Optimized estimators and online control $k(x)$ at each time step

1 dataset $\xleftarrow{}\Phi$

2 for  _t = 0 to $t_{f}/dt$ _ do

$x_{t+1}\xleftarrow{}\textnormal{{dynamics}}(x_{t},u_{t})$

// Get new state

$e_{(x_{t},u_{t})}\xleftarrow{}x_{t+1}-f_{e-kin}(x_{t},u_{t})$
dataset.append($e_{(x_{t},u_{t})}$) // Collect data

$L\xleftarrow{}\textnormal{{loss}}(dataset[max(0,t-K_{batch}),t])$

// Eqn 10

$p\xleftarrow{}\textnormal{{estimator.update}}(L,\alpha,\gamma)$

// Eqn 11

3 if  _$t >t_{th}$_ then

4 $f_{corr}\xleftarrow{}f_{e-kin}+e_{pred,p}$

$\mu_{pred}\xleftarrow{}\textnormal{{calc-mu}}(ELM_{f},ELM_{r})$

// Eqn 12

5

6 else

7 $f_{corr}\xleftarrow{}f_{e-kin}$

8 $\mu_{pred}\xleftarrow{}\mu_{init}$

$X_{ref}\xleftarrow{}\textnormal{{path-planner}}(x_{t+1},\mu_{pred})$
$u_{t+1}\xleftarrow{}\textnormal{{controller}}(X_{ref},x_{t+1})$

// Eqn 13

9

Algorithm 1 Online Learning based Adaptive Controller

##  V RESULTS

We perform experiments on the 1:43 numeric simulator and Carla high-fidelity
vehicle simulator [15].

###  V-A Numeric simulator

We use the 1:43 autonomous open-source race car simulation [3] to validate our
algorithm. We first demonstrate our results on the ETHZ track [3]. For the
numeric simulator experiments, we set
$\alpha=0.002,\gamma=0.9,\mu_{start}=1.0,K_{batch}=300,t_{th}=6.2s,n_{h}=40,N=50,Q=\begin{bmatrix}1&0\\\
0&1\end{bmatrix},R=\begin{bmatrix}0.005&0\\\ 0&1\end{bmatrix}$.

####  V-A1 Wear and tear of the tire

We first show that our model is able to learn from offline data to draw a
comparison with [2], which used GP to estimate the difference between dynamic
and e-kinematic models. Our model is able to train quite well on the same
collected data from the ETHZ track, as shown by the fitted errors in state
predictions $v_{x}$, $v_{y}$ and $w$ in Fig. 5. Fig. 5 also shows that our
trained model gives quite comparable results to GP. Note that the computation
time when the model is used for optimization with MPC is $0.04-0.07s$, while
the GP requires computation times as long as $0.25-0.3s$ under the same
condition. This clearly demonstrates ELM’s improved computation efficiency
over GP while yielding comparable accuracy.

(a)

(b)

(c)

Figure 5: Offline validation. Predictions of (a) $e_{v_{x}}$, (b) $e_{v_{y}}$
(c) $e_{\omega}$ using GP and Ours

We also compare path-following respectively without and with the use of
adaptive model compensation in Fig. 6 and Fig. 8. We modify the actual $\mu$,
i.e., change parameters $D_{f}$ and $D_{r}$, as shown in Fig. 8(c), and the
predicted values as well. As can be seen, using our approach with adaptive
model compensation clearly yields better performance. Using adaptive speed
planning also allows the vehicle to stay within lane boundaries. If speed
references are not changed, as can be observed in Fig. 7, the vehicle is still
able to complete its maneuvers, but leaves the track several times. This is
because even with a good updated model, unadjusted reference speeds push the
vehicle beyond its limits at turns. Not updating the vehicle model leads to
the vehicle completely failing and losing control at a region on the $3^{rd}$
lap where it had to completely stop to gain control. Finally, we also compare
against an oracle (Fig. 9(b)), where we use the exact Pacejka friction
parameters and make the run with the same parameters. As can be observed, the
trajectory followed with our method (Fig. 8.a) and the lap times are almost
the same as those of the oracle (Fig. 9(b)).

Moreover, we also compare against the use of adaptive Gaussian processes,
where we adjust the speeds according to the ground truth value of $\mu$ (see
Fig. 8(c)), and this yields slightly worse (very close) results than ours but
with much higher computation times. Also, as can be observed from Fig. 8 and
Fig. 9(a), the trajectory followed when using GP goes further away from the
reference with decreasing $\mu$ while our method, the trajectory remains
nearly the same similar to the oracle (see Fig. 9(b)). It should also be noted
that if using GP requires a separate $\mu$ prediction process to replace and
obtain an estimate close to the ground truth value, while in our method we
inherently obtain the predicted value of $\mu$ according to Equation 12.

We compare some of the run statistics in Table I. As can be seen: 1) our lap
time is slightly worse than the oracle but the safety (i.e., the violation
time) has been significantly improved; 2) the mean deviation from the racing
line is least when our method is used with adjusted speeds (close to the
oracle); 3) our approach outperforms the state-of-the-art GP-based controller
[2] (when used in online setting) in terms of every criterion as well as the
computation efficiency. The computation times for our method are within
$0.05s\pm 0.02s$ and for GP is $0.3s\pm 0.05s$ when used online on our machine
(AMD Ryzen 7 5000 series CPU, 16 GB RAM).

(a) Trajectory

(b) Speeds

Figure 6: Online run without model compensation

(a) Trajectory

(b) Speeds

Figure 7: Online run with model compensation, without adaptive speed planning

(a) Trajectory

(b) Speeds

(c) $\mu$ predictions

Figure 8: Online run with model compensation & adaptive speed planning

(a)

(b)

Figure 9: Trajectories for Online run with model compensation (a) Using GP (b) Oracle  Method |  | Lap 0
---
time
| Lap 1
---
time
| Lap 2
---
time
| Lap 3
---
time
| Mean dev.
---
from rac-
ing line
| Violation
---
time
| Without
---
adaptation
8.44s | 8.34s | 8.72s | - | 0.141m | 4.32s
| With
---
adaptation
(Constant
speeds)
8.26s | 7.26s | 7.56s | 8.14s | 0.1104m | 2.84s
| With
---
adaptation
(Var speeds, ours)
8.28s | 7.42s | 7.76s | 8.46s | 0.0832m | 0.46s
GP | 8.28s | 7.44s | 7.84s | 8.56s | 0.0989m | 0.62s
Oracle | 7.92s | 7.40s | 7.72s | 8.40s | 0.0511m | 0s
TABLE I: Comparison in statistics for numeric simulator. Violation time is the
total time for which the vehicle was outside the track limits

####  V-A2 Sudden friction change

Now, we test our approach against a situation when the friction coefficient
suddenly changes. This is possible, for example, when a sudden heavy rain
changes the road’s friction coefficient. For this case, we demonstrate the
path followed by our approach (See Fig. 10) and compare it to when the model
compensation is not considered (See Fig. 11). As observed, with model
compensation, the vehicle is able to estimate the change in friction
coefficient quite well and abruptly. It does cross the outer boundary at the
beginning but is able to adjust the speeds to stay safe within the lane limits
later, whereas if compensation is not considered, the vehicle completely loses
control at several points after $\mu$ changes.

(a) Trajectory

(b) Speeds

(c) $\mu$ predictions

Figure 10: Online run with model compensation & adaptive speed planning
(sudden friction change experiment)

(a) Trajectory

(b) Speeds

Figure 11: Online run without model compensation (sudden friction change
experiment)

###  V-B Carla

Finally, we perform experiments in Carla [15] with time-varying tire friction
parameters to test our online adaptation algorithm. We first obtain the racing
line on the Carla track, as depicted in Fig. 1. For offline validation, we
check the lateral and longitudinal forces from the trained model on one lap of
data and compare them to the lateral and longitudinal force values obtained
from the simulator. As shown in Fig. 12, although these values are noisy, our
trained model archives high fitting accuracy. For the online run, we set
$\alpha=0.002,\gamma=0.9,\mu_{start}=1.0,K_{batch}=2000,t_{th}=44s,n_{h}=40,N=50,Q=\begin{bmatrix}0.1&0\\\
0&0.1\end{bmatrix},R=\begin{bmatrix}0.005&0\\\ 0&1\end{bmatrix}$. The online
run with friction decay is shown in Fig. 13. Both tires have the same tire
model. For comparison, we show the results with and without adaptive model
compensation (See Fig. 13 and Fig. 14). As observed, without adaptive model
compensation, the vehicle moves out of bounds after about $60s$ once the
friction coefficient starts reducing and collides with an obstacle.

(a)

(b)

(c)

(d)

Figure 12: Offline validation (Carla). Predictions of (a) $e_{v_{x}}$, (b)
$e_{v_{y}}$ (c) $e_{\omega}$ and (d) observed tire force predictions vs.
predicted values

(a) Trajectory

(b) Speeds

(c) $\mu$ predictions

Figure 13: Online run with model compensation in Carla

##  VI CONCLUSION and FUTURE WORK

We present a learning-based control algorithm that both significantly reduces
the effort required for system identification and allows online adaptation.
Starting with a simple geometric model we collect training data which are used
by our algorithm to iteratively correct the mismatch between the geometric and
the actual vehicle model, and also adapt to any changes. This allows racing
algorithms to devise an aggressive strategy without worrying about the vehicle
model parameters and wear and tear of the tires. We demonstrate our
performance in the presence of simulated wear and tear in both the 1:43 scale
autonomous racing platform [3] and the Carla Simulator [15]. In the future it
would be interesting to explore using uncertainty in the trained models, which
can be used in the robust controller formulation. It would also be interesting
to explore how we can guide the training effectively to push the vehicle
beyond it’s known limits to explore it’s limits and improve the model’s
confidence towards it. This can be done using a similar approach to adaptive
$\epsilon-$greedy Q-learning [16], where $\epsilon$ can be changed according
to the vehicle’s current safety index.

(a) Trajectory

(b) Speeds

Figure 14: Online run without model compensation in Carla

## References

  * [1] W. J. West and D. J. Limebeer, “Optimal tyre management of a formula one car,” _IFAC-PapersOnLine_ , vol. 53, no. 2, pp. 14 456–14 461, 2020, 21st IFAC World Congress. [Online]. Available: https://www.sciencedirect.com/science/article/pii/S2405896320318577
  * [2] A. Jain, M. O’Kelly, P. Chaudhari, and M. Morari, “BayesRace: Learning to race autonomously using prior experience,” in _Proceedings of the 4th Conference on Robot Learning (CoRL)_ , 2020.
  * [3] A. Liniger, A. Domahidi, and M. Morari, “Optimization‐based autonomous racing of 1:43 scale RC cars,” _Optimal Control Applications and Methods_ , vol. 36, pp. 628 – 647, 2015.
  * [4] S. N. Wadekar, B. Schwartz, S. S. Kannan, M. Mar, R. K. Manna, V. Chellapandi, D. J. Gonzalez, and A. E. Gamal, “Towards end-to-end deep learning for autonomous racing: On data collection and a unified architecture for steering and throttle prediction,” _ArXiv_ , vol. abs/2105.01799, 2021.
  * [5] Y. Pan, C.-A. Cheng, K. Saigol, K. Lee, X. Yan, E. A. Theodorou, and B. Boots, “Agile off-road autonomous driving using end-to-end deep imitation learning,” _ArXiv_ , vol. abs/1709.07174, 2017.
  * [6] P. Cai, H. Wang, H. Huang, Y. Liu, and M. Liu, “Vision-based autonomous car racing using deep imitative reinforcement learning,” _IEEE Robotics and Automation Letters_ , vol. 6, pp. 7262–7269, 2021.
  * [7] J. Kabzan, M. de la Iglesia Valls, V. Reijgwart, H. F. C. Hendrikx, C. Ehmke, M. Prajapat, A. Bühler, N. B. Gosala, M. Gupta, R. Sivanesan, A. Dhall, E. Chisari, N. Karnchanachari, S. Brits, M. Dangel, I. Sa, R. Dubé, A. Gawel, M. Pfeiffer, A. Liniger, J. Lygeros, and R. Y. Siegwart, “Amz driverless: The full autonomous racing system,” _Journal of Field Robotics_ , vol. 37, pp. 1267 – 1294, 2019.
  * [8] U. Rosolia and F. Borrelli, “Learning how to autonomously race a car: A predictive control approach,” _IEEE Transactions on Control Systems Technology_ , vol. 28, pp. 2713–2719, 2019.
  * [9] L. Hewing, A. Liniger, and M. N. Zeilinger, “Cautious NMPC with gaussian process dynamics for autonomous miniature race cars,” _2018 European Control Conference (ECC)_ , pp. 1341–1348, 2017.
  * [10] M. Ostadijafari and A. Dubey, “Linear model-predictive controller (LMPC) for building’s heating ventilation and air conditioning (HVAC) system,” in _2019 IEEE Conference on Control Technology and Applications (CCTA)_ , 2019, pp. 617–623.
  * [11] A. Heilmeier, A. Wischnewski, L. Hermansdorfer, J. Betz, M. Lienkamp, and B. Lohmann, “Minimum curvature trajectory planning and control for an autonomous race car,” _Vehicle System Dynamics_ , vol. 58, no. 10, pp. 1497–1527, 2020.
  * [12] G.-B. Huang, L. Chen, C. K. Siew, _et al._ , “Universal approximation using incremental constructive feedforward networks with random hidden nodes,” _IEEE Trans. Neural Networks_ , vol. 17, no. 4, pp. 879–892, 2006\.
  * [13] G.-B. Huang, Q.-Y. Zhu, and C.-K. Siew, “Extreme learning machine: theory and applications,” _Neurocomputing_ , vol. 70, no. 1-3, pp. 489–501, 2006.
  * [14] Ö. F. Ertuğrul and Y. Kaya, “A detailed analysis on extreme learning machine and novel approaches based on ELM,” _American Journal of computer science and engineering_ , vol. 1, no. 5, pp. 43–50, 2014.
  * [15] A. Dosovitskiy, G. Ros, F. Codevilla, A. Lopez, and V. Koltun, “CARLA: An open urban driving simulator,” in _Proceedings of the 1st Annual Conference on Robot Learning_ , 2017, pp. 1–16.
  * [16] A. dos Santos Mignon and R. L. de Azevedo da Rocha, “An adaptive implementation of $\epsilon$-greedy in reinforcement learning,” _Procedia Computer Science_ , vol. 109, pp. 1146–1151, 2017, 8th International Conference on Ambient Systems, Networks and Technologies, ANT-2017.