Keywords

1 Introduction

To be the fastest on track, the car has to drive on the performance limits. In autonomous racing, this requires a combination of optimal path planning and motion control that also guarantees safe driving and vehicle stability. Nonlinear Model Predictive Control (NMPC) is a popular method for solving both path planning and motion control, where a trade-off has to be made between performance, accuracy, and computational complexity.

In [1], a hierarchical motion planning strategy combines offline path optimization and online reference tracking using NMPC. Consequently, [2] extends this work by integrating the low-level vehicle control for Torque Vectoring (TV). Good performance gains are obtained, however, path planning is computed offline due to computational complexity. Computational complexity can be reduced by exploiting Linear Parameter Varying (LPV) models. For example, in [3] an LPV model is used to implement a similar control strategy as [1], or in [4] where an LPV model is used to implement online path planning. However, using an LPV model requires linear tire dynamics, limiting the performance and accuracy. As an alternative to hierarchical methods, single-layer control structures are developed to prevent infeasible trajectories between different controllers at the cost of increasing model complexity. In [5] both online path planning and motion control are solved using a single-layer NMPC. The problem is solved using a cascaded vehicle model where a bicycle model’s prediction horizon, including nonlinear tire dynamics, is extended with a point mass. Using lower fidelity models reduces computational complexity, allowing for an increased prediction horizon therefore increasing performance. The controller concept is proven to work on a full-scale racing car, excluding TV.

In this manuscript, we want to exploit that race cars are equipped with four in-wheel motors, as seen in Formula Student Driverless cars, developed by student teams like University Racing Eindhoven [6]. Using a two-track model to solve the NMPC provides the performance gains from TV [1, 2], while using a cascaded vehicle model to reduce computational complexity [5].

Fig. 1.
figure 1

Cascaded vehicle model horizon, consisting of a two-track model, single-track model, and a point-mass model.

2 Cascaded Prediction Horizon

In the single-layer NMPC for autonomous racing, there are two objectives; 1) motion control, and 2) path planning. The former requires a highly non-linear vehicle model to predict vehicle behavior, describing the longitudinal, stiff lateral, and stiff yaw dynamics. The latter requires a sufficiently long prediction horizon to determine an optimal path to avoid road departure and a safe velocity profile, which can be performed with a lower-fidelity vehicle model. As suggested in [5], these control objectives do not necessarily have a constant level of relevance or criticality throughout the prediction horizon. Therefore, the principle of cascaded vehicle models in a single planning horizon is introduced.

2.1 Vehicle Models

At first, a high-fidelity model is required to perform motion control. Therefore, we adopt a two-track model for the first part of the planning horizon to include TV in the NMPC, then extend the horizon with a single-track model. The two-track and single-track models, as depicted in Fig. 1, are characterized by the same states, namely; \(v_{x,i|k}, \ v_{y,i|k},\) and \(\omega _{i|k}\) represent the longitudinal, lateral, and yaw velocity, respectively, \(\delta _{i|k}\) the steering angle, \(e_{y,i|k}\) and \(e_{\psi ,i|k}\) represent the lateral and heading difference between the vehicle and the reference path, and \(s_{i|k}\) the curvilinear coordinate along the reference path. We obtain the following two state-vectors \(x_{i|k} = [v_{x,i|k}, v_{y,i|k}, \omega _{i|k}, \delta _{i|k}, e_{y,i|k}, e_{\psi ,i|k}, s_{i|k}]^\top \), and \(\tilde{x} = [\tilde{v}_{x,z|k}, \tilde{v}_{y,z|k}, \tilde{\omega }_{z|k}, \tilde{\delta }_{z|k}, \tilde{e}_{y,z|k}, \tilde{e}_{\psi ,z|k}, \tilde{s}_{z|k}]^\top \), for the two-track and single-track model, respectively. Here \(i \in \{0, 1, ..., N \}\) and \(z \in \{0, 1, ..., H \}\) represent the prediction steps at iteration k with horizon length N and H.

The difference in the vehicle models is the required number of inputs, namely, the two-track model utilizes the four in-wheel motors by modeling the four longitudinal tire forces \(F_{x,a,i|k}, a\in \{1,2,3,4\}\), whereas the single track model only considers the total longitudinal force input \(\tilde{F}_{x,z|k}\). To enhance TV, a TV moment \(\tilde{M}_{TV,z|k}\) is considered an input in the single-track model. At last, the steering rates \(\dot{\delta }_{in,i|k}\), and \(\dot{\tilde{\delta }}_{in,z|k}\) are considers input.

Secondly, a low-fidelity model is used for path planning, namely a planar point-mass model as depicted in Fig. 1. Here \(\bar{V}_{j|k}\) denotes the resulting velocity, \(\bar{e}_{y,j|k}\) and \(\bar{e}_{\psi ,j|k}\) the lateral distance to the path and the heading difference between the velocity vector and the reference path, respectively, and \(\bar{s}_{j|k}\) is the curvilinear coordinate along the reference path. We obtain the state vector \(\bar{x} = [\bar{V}_{j|k}, \bar{e}_{y,j|k}, \bar{e}_{\psi ,j|k}, \bar{s}_{j|k}]\), where \(j \in \{0, 1, ..., M \}\) represent the prediction steps, with horizon length M. As the point-mass model does not require a tire model, the total longitudinal force \(\bar{F}_{x,j|k}\) and total lateral force \(\bar{F}_{y,j|k}\) are considered inputs. Due to the low-dimensional model, excluding stiff dynamics, a larger look-ahead distance is obtained at a low computational cost.

The presented vehicle models combined form the cascaded vehicle model with horizon length \(N + H + M\). Due to space restrictions, the reader is referred to [7, Section 2] for the corresponding dynamic models.

2.2 Mapping

The first step in serially cascading different vehicle models is carefully defining a mapping where the final state of one vehicle model propagates towards the initial state of the following vehicle model. Since the same states describe the two-track model and the single-track model, the two-track states at prediction N define the initial state of the single-track model for \(z=0\), yielding

$$\begin{aligned} \tilde{v}_{x,0|k} &= v_{x,N|k}, \ \ \ \ \tilde{v}_{y,0|k} = v_{y,N|k}, \ \ \ \ \tilde{\omega }_{0|k} = \omega _{N|k}, \ \ \ \ \tilde{\delta }_{0|k} = \delta _{N|k} \end{aligned}$$
(1a)
$$\begin{aligned} \tilde{e}_{y,0|k} &= e_{y,N|k}, \ \ \ \ \tilde{e}_{\psi ,0|k} = e_{\psi ,N|k},\ \ \ \ \tilde{s}_{0|k} = s_{N|k}. \end{aligned}$$
(1b)

The mapping between the single track and point-mass model is defined differently, as the point-mass does not consider yaw dynamics and only a single velocity vector, and is adopted from [5]

$$\begin{aligned} \bar{V}_{0,k} &= \sqrt{\tilde{v}_{x,H|k}^2 + \tilde{v}_{y,H|k}^2}, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \bar{e}_{y,0|k} = \tilde{e}_{y,H|k}, \end{aligned}$$
(2a)
$$\begin{aligned} \bar{e}_{\psi ,0|k} &= \arctan {\left( \tfrac{\tilde{v}_{y,H|k}}{\tilde{v}_{x,H|k}} \right) } + \tilde{e}_{\psi ,H|k}, \ \ \ \ \ \ \bar{s}_{0|k} = \tilde{s}_{H|k}. \end{aligned}$$
(2b)

Combining the mappings () and () with the corresponding dynamics provides the cascaded vehicle model, which can be used to predict the vehicle behavior.

3 Optimization Problem

The optimization problem formulation used in this manuscript is an extension of the work presented in [5], but then applied to a four-wheel drive vehicle. Therefore, due to the extensive expressions, only the changes and newly introduced objectives and constraints are discussed in this section. For the overall problem, the reader is referred to [7, Section 4.2].

3.1 Objective

The goal of the NMPC is to minimize the objective function,

$$\begin{aligned} \min _{X_k \ U_k} \bar{t}_M + J_M + J_U + J_{\varDelta U} + J_e + J_\alpha + J_\beta + J_{tr}, \end{aligned}$$
(3)

which is the sum of seven different terms. At first, the primary objective is to minimize the lap time, hence minimizing the required time for the point-mass to reach the end of the planning horizon, denoted by \(\bar{t}_M\). The cost \(J_M\) denotes the terminal cost, which controls the horizon to a safe terminal set. In path planning, the velocity, and lateral and heading deviation from the reference path define the safe terminal set and are penalized as such

$$\begin{aligned} J_M &= W_{\bar{e}_y,M} \bar{e}_{y,M|k}^2 + W_{\bar{e}_\psi ,M} \bar{e}_{\psi ,M|k}^2 + W_{\bar{V}_M} \bar{V}^2_{M|k}, \end{aligned}$$
(4a)
$$\begin{aligned} W_{\bar{V}_M} &= {\left\{ \begin{array}{ll} W_{\bar{V}_{M}}, & \text {if }\bar{V}_{M|k} \ge \bar{V}_{\text {safe}}, \\ 0, & \text {otherwise,} \end{array}\right. } \end{aligned}$$
(4b)

where \(W_{\bar{e}_y,M}\) and \(W_{\bar{e}_\psi ,M}\) are static weights, and \(W_{\bar{V}_{M}}\) is a dynamic weight only to penalize the horizon velocity when it exceeds a velocity that could result in road departure. In Formula Student, the track layout is unknown, however, the smallest radius is defined beforehand. Therefore, a safe horizon velocity can be defined assuming steady-state cornering and using the tire characteristics

$$\begin{aligned} \bar{V}_{\text {safe}} = \sqrt{\tfrac{D_y R}{m}}, \end{aligned}$$
(5)

with \(D_y\) the tire force peak factor according to a simplified Pacejka tire model [8] and R denotes the track radius. This cost forces the NMPC to slow down such that enough lateral grip is available to make the smallest turn.

In (3), \(J_U\) and \(J_{\varDelta U}\) represent a penalty on the input and change in input, respectively, \(J_e\) penalizes the lateral and heading deviations of the vehicle models. Furthermore, \(J_\alpha \) and \(J_\beta \) represent a penalty on the tire slip and vehicle side slip angles. The former is already introduced in [5] to prevent excessive tire slip, whereas the latter is newly introduced. As the NMPC pushes the vehicle towards the limits, there is a chance the vehicle will start drifting. Since this is at the vehicle handling limit, any model mismatch can result in vehicle instability. Therefore, a penalty on excessive vehicle side slip angle \(\beta \) is applied at the point where gripping can not be guaranteed, yielding

$$\begin{aligned} \begin{aligned} J_{\beta } &= W_{\beta _0} \sum _{i=0}^{N} {\left\{ \begin{array}{ll} (|\beta _{i|k}| - \beta _{\text {max}})^2, & \text {if }|\beta _{i|k}|\ge \beta _{\text {max}} \\ 0, & \text {otherwise.} \end{array}\right. } \\ &+ W_{\beta _0}\sum _{z=0}^{H}{\left\{ \begin{array}{ll} (|\tilde{\beta }_{z|k}| - \beta _{\text {max}})^2, & \text {if }|\tilde{\beta }_{z|k}|\ge \beta _{\text {max}} \\ 0, & \text {otherwise.} \end{array}\right. }, \end{aligned} \end{aligned}$$
(6)

where \(\beta _{\text {max}}\) depends on many non-linear terms and usually is hard to predict, but the results in [9] indicate that it is between \({5}^{\circ }\) and \({7.5}^{\circ }\).

Lastly, \(J_{tr}\) penalizes a non-smooth longitudinal and lateral forces transition, where \( J_{tr} = J_{F|\tilde{F}} + J_{\tilde{F}|\bar{F}}\), \(J_{F|\tilde{F}}\) is the penalty on the transition between the two-track and single-track vehicle model, and \(J_{\tilde{F}|\bar{F}}\) the penalty on the transition between the single-track and point-mass model [7, Equation 4.28].

3.2 Constraints

The newly introduced TV moment \(\tilde{M}_{TV}\) should not exceed the maximum moment a two-track model can generate. Therefore, it is constrained by the resulting moment when all four wheels use their longitudinal peak force \(D_{x,a}, a \in \{1,2,3,4\}\) to rotate the vehicle, resulting in

$$\begin{aligned} |\tilde{M}_{TV}| \le \tfrac{w_f}{2}(D_{x,1} + D_{x,2}) + \tfrac{w_r}{2}(D_{x,3} + D_{x,4}). \end{aligned}$$
(7)

The two-track and single-track vehicle models use a simplified Pacejka tire model for the lateral tire forces and consider the longitudinal tire force as input. The tire friction ellipse is applied as a constraint to couple the lateral and longitudinal tire forces. Since the single-track model only considers a single longitudinal force, the distribution between the front and rear axles has to be defined. The grip of the axle scales with the vertical load acting on the axle, therefore, a fixed longitudinal force distribution between the front and rear axle is defined by the weight distribution \(w_{\text {dis}}\), providing the following constraints

$$\begin{aligned} \left( \tfrac{w_{\text {dis}} \tilde{F}_x}{\tilde{D}_{x,f}}\right) ^2 &+ \left( \tfrac{\tilde{F}_{y,f}}{\tilde{D}_{y,f}} \right) ^2 \le 1, \left( \tfrac{(1-w_{\text {dis}}) \tilde{F}_x}{\tilde{D}_{x,r}}\right) ^2 + \left( \tfrac{\tilde{F}_{y,r}}{\tilde{D}_{y,r}} \right) ^2 \le 1, \end{aligned}$$
(8a)
$$\begin{aligned} \left( \tfrac{F_{x,a}}{D_{x,a}}\right) ^2 &+ \left( \tfrac{F_{y,a}}{D_{y,a}} \right) ^2 \le 1, \ \ \ \ \forall a \in \{1,2,3,4\}. \end{aligned}$$
(8b)

The point-mass force inputs \(\bar{F}_x\) and \(\bar{F}_y\) are also constrained via the friction ellipse, as described in [7, Equation 4.49]. The following section illustrates the advantages of a cascaded horizon via a simulation study.

4 Results

The influence of the cascaded vehicle model is evaluated through a simulation study comparing different horizon lengths. As baselines, the presented optimization problem is executed using a two-track and single-track model. The track layout, vehicle specifications, and cost weights are adopted from [7, Chapter 5].

In the left figure in Fig. 2, the lap times are compared with the average computation time of one iteration. Results from the single-track and two-track models are depicted in black and magenta, respectively. These results show the benefits of using TV, as the two-track model outperforms the single-track model by several seconds for every horizon length. However, the baselines also show a rapid increase in average computation time for longer prediction horizons.

It can be observed that the cascaded vehicle model not only improves lap time but also significantly reduces the average computation time. The point-mass model’s non-stiff dynamics allow for a larger discretization step, which increases the look-ahead distance. Comparing the two-track model (with \(N = 130\)) to the cascaded vehicle model (with \(N = 10\), \(H = 10\), \(M = 30\)), both achieve a lap time of 22.8 s. However, the average computation time is reduced from 3.24 s to 0.46 s, marking an 86% reduction.

The GG-diagram in Fig. 2 shows that the use of TV results in faster cornering, evident from the increased lateral acceleration. The cascaded vehicle models obtain similar performance in terms of g-forces as the two-track baseline. Additionally, the single-track model does not push the vehicle to its full limits, as it underperforms in terms of g-forces.

Fig. 2.
figure 2

Left) Computation time vs lap time. Right) GG-diagram.

5 Conclusion

A popular method to find the optimal control input to drive at the limits of the car is nonlinear model predictive control (NMPC). However, when NMPC is used, often a trade-off has to be made between performance, accuracy, and computational complexity. The results in this manuscript highlight the computational benefit that can be obtained by utilizing a cascaded vehicle model, reducing the trade-off between computational complexity and performance.