1 Introduction

Early track models for closed-circuit minimum-lap-time optimal control calculations are two-dimensional (i.e. ‘flat’)—there are many such examples in the existing literature [1,2,3,4,5,6]. A significant drawback with these road representations is that they only reproduce geodesic curvature related phenomena (cornering). More recently three-dimensional road models have been developed, which have the advantage of recognising gradient and camber variations in the road surface [7, 8]. Road undulations and camber can have a significant effect on both optimal road positioning and the associated cornering speed [9,10,11,12]. When the available engine power is limited, it is self evident that a vehicle’s top speed may increase on downhill sections, while being correspondingly reduced on uphill portions of the track. Gradient changes are accompanied by normal curvature influences—the vehicle tends to become ‘light’ if it is driven over the brow of a hill, while becoming ‘heavier’ when drive through a dip. These road-curvature-related changes in tire loading are somewhat akin to those produced by aerodynamic effects, and can have a significant impact on a vehicle’s race performance. The third curvature-related variable, the relative torsion, describes the way in which the road changes camber. Camber variations produce steady-state tire-loading changes as well as centripetal and gyroscopic forces that too can have a significant impact on the dynamics and operating envelope of the vehicle.

Three-dimensional road characteristics are arguably more important in NASCAR (National Association for Stock Car Auto Racing) as compared with other form of four-wheeled motor sport. This follows from the fact that: (1) high cornering speeds are involved, (2) typical NASCAR ‘ovals’ are highly banked, and (3) the cars spend a lot of their time turning left. This means that many of the car’s characteristics and design features are highly asymmetric; none of this could be studied in a ‘flat-earth’ environment. Typical asymmetries include the vehicle’s aerodynamics, very different left- and right-hand tire characteristics, and a highly asymmetric suspension system. In many cases these asymmetries can be adequately dealt with using a flat-ribbon type road models. This is not always true, however, because some NASCAR tracks resemble the surface of a doughnut, where the track is laterally curved. In the case of closed race circuits, conventional ribbon-based road model presuppose a road surface that resembles a piece of ‘tagliatelle’ that is joined end-to-end. Under this assumption the track’s curvature is invariant under lateral translations across the track surface. For some NASCAR tracks this flat-ribbon model is insufficiently accurate, because the track surface has significant lateral curvature that cannot be neglected. Geometrically, this means that the road prototype must now resembles a length of ‘tagliatelle’ that is laterally curved. In other words, the road camber can vary as one moves laterally between the inner and outer track boundaries. We will assume that these camber variations are mathematically ‘small’, but are nonetheless dynamically significant.

Fig. 1
figure 1

Darlington Raceway, Darlington, South Carolina. The left-hand part of figure a shows the circuit, the start-finish line and the racing direction. The right-hand part of figure a shows the LiDAR survey measurement points that are spaced on a 1 m\(^2\) mesh—the circled data points are on the start-finish line. Figure b shows the track elevation as a function of elapsed distance and lateral position. The variable lateral camber at 600 m (marked with a vertical arrow) is shown in detail in Fig. 3b

To fix ideas, we consider the Darlington Raceway in a little more detail. The right-hand portion of Fig. 1a shows the racetrack, the start-finish line and circulation direction. All turns are left-handed and the lap distance is approximately 2095 m. The right-hand side shows a sketch of part of the survey mesh that will be used as a basis for the track model developed here. The raw survey data comprises approximately 28,000 3D points. Fig. 1b shows the track elevation as a function of lateral position and elapsed distance. The track’s lateral camber variations can be seen in the ‘sky line’ at 600 m—these camber variations are approximately \(10^\circ\) as shown in detail in Fig. 3b below.

The remainder of the paper will focus on the development of a curved-ribbon-based track model, and the optimisation of the model parameters—the road reconstruction problem. It will then study briefly the impact that lateral curvature has on a race car’s performance. The track model is described in Sect. 2, while the solution of the associated road-reconstruction optimal control problem is discussed in Sect. 3. The vehicle positioning and kinematics are reported in Sect. 4. The formulation and solution of the minimum-lap-time (optimal control) problem is presented in Sect. 5. The conclusions in Sects. 6 and acknowledgements appear after the conclusion section.

2 Road model

Three-dimensional road modelling and vehicle positioning problems are solved using curvilinear coordinate descriptions of the track; the mathematical detail is covered in a number places including [9, 10, 13, 14]. In order to avoid needless repetition, the background material will be covered briefly.

In accordance with classical Frenet–Serret theory, the track centre line is a space curve that can be described by two curvature variables, namely the curvature \(\kappa\) and torsion \(\tau\). Both variables are a function of the elapsed distance s. When the centre line is ‘broadened out’ into a ribbon-based track description, a third curvature, twist rate \(\nu '\), is required to represent the track’s camber [10]. A moving trihedron \({\mathscr {C}}\), called Darboux frame, moves along the road centreline with its x-y plane tangent to the road surface. An orthogonal basis for \({\mathscr {C}}\) is \([{\varvec{t}}\,{\varvec{n}}\,{\varvec{m}}]\) (see Fig. 2a), which can be obtained according to the attitude-pitch-roll convention as follows

$$\begin{aligned} R = R_z(\theta )R_y(\mu )R_x(\phi ) = \left[ \begin{array}{ccc} c_\theta c_\mu &{} c_\theta s_\mu s_\phi -s_\theta c_\phi &{} c_\theta s_\mu c_\phi +s_\theta s_\phi \\ s_\theta c_\mu &{} s_\theta s_\mu s_\phi +c_\theta c_\phi &{} s_\theta s_\mu c_\phi -c_\theta s_\phi \\ -s_\mu &{} c_\mu s_\phi &{} c_\mu c_\phi \end{array} \right] , \end{aligned}$$
(1)

where \(R_z(\theta ),R_y(\mu )\) and \(R_x(\phi )\) are the elementary rotation matrix around the zy and x axis respectively; \(\theta ,\mu\) and \(\phi\) represent the attitude, slope and camber angles; ‘s’ and ‘c’ refer to the sine and cosine of the corresponding (subscripted) Euler angles.

The Euler angles, \(\theta\), \(\mu\) and \(\phi\) are obtained by integrating the curvature variables that are referred to more conveniently as the relative torsion \(\varOmega _x^0\), normal curvature \(\varOmega _y^0\) and geodesic curvature \(\varOmega _z^0\); the angular rate of the Darboux frame is the vector \({\varvec{\varOmega }}^0=[\varOmega _x^0,\varOmega _y^0,\varOmega _z^0]^T\). The Euler angles and the angular rate are related by

$$\begin{aligned} \left[ \begin{array}{c} \varOmega _x^0 \\ \varOmega _y^0 \\ \varOmega _z^0 \end{array} \right] = \left[ \begin{array}{ccc} 1 &{} 0 &{} -s_\mu \\ 0 &{} c_\phi &{} c_\mu s_\phi \\ 0 &{} -s_\phi &{} c_\mu c_\phi \end{array} \right] \left[ \begin{array}{c} \phi ^\prime \\ \mu ^\prime \\ \theta ^\prime \end{array} \right] , \end{aligned}$$
(2)

where \({\varvec{\varOmega }}^0\) is expressed in the Darboux frame – the skew-symmetric representation of the angular rate of the frame \({\mathscr {C}}\) is \(R^T R'\); see equation (25) in [7]. The primes refers to derivatives with respect to s (the elapsed distance)Footnote 1. The vehicular equations of motion also require an expression for \(({\varvec{\varOmega }}^0)^\prime\), which is given by

$$\begin{aligned}&\left[ \begin{array}{c} (\varOmega _x^0)^\prime \\ (\varOmega _y^0)^\prime \\ (\varOmega _z^0)^\prime \end{array} \right] = \left[ \begin{array}{ccc} 1 &{} 0 &{} -s_\mu \\ 0 &{} c_\phi &{} c_\mu s_\phi \\ 0 &{} -s_\phi &{} c_\mu c_\phi \end{array} \right] \left[ \begin{array}{c} \phi ^{\prime \prime } \\ \mu ^{\prime \prime } \\ \theta ^{\prime \prime } \end{array} \right] \nonumber \\&\quad + \left[ \begin{array}{cc} 0 &{} -\mu ^\prime c_\mu \\ -\phi ^\prime s_\phi &{} \phi ^\prime c_\phi c_\mu -\mu ^\prime s_\mu s_\phi \\ -\phi ^\prime c_\phi &{} -\mu ^\prime s_\mu c_\phi -\phi ^\prime s_\phi c_\mu \end{array} \right] \left[ \begin{array}{c} \mu ^\prime \\ \theta ^\prime \end{array} \right] . \end{aligned}$$
(3)

Inverting (2) gives

$$\begin{aligned} \left[ \begin{array}{c} \phi ^\prime \\ \mu ^\prime \\ \theta ^\prime \end{array} \right] = \frac{1}{c_\mu } \left[ \begin{array}{ccc} 1 &{} s_\mu s_\phi &{} c_\phi s_\mu \\ 0 &{} c_\mu c_\phi &{} -c_\mu s_\phi \\ 0 &{} s_\phi &{} c_\phi \end{array} \right] \left[ \begin{array}{c} \varOmega _x^0 \\ \varOmega _y^0 \\ \varOmega _z^0 \end{array} \right] . \end{aligned}$$
(4)

The location of the origin of the Darboux frame is given by

$$\begin{aligned} \left[ \begin{array}{c} x_C \\ y_C \\ z_C \end{array} \right] = \int {\varvec{t}} ds = \int \left[ \begin{array}{c} c_\phi c_\mu \\ s_\phi c_\mu \\ -s_\mu \end{array} \right] ds, \end{aligned}$$
(5)

where \({\varvec{t}}\) is the tangent to the road centreline (the first columns of (1)).

The point of departure, relative to the prior literature, relates to the introduction of surface undulations relative to the \({\varvec{t}}\)\({\varvec{n}}\) plane that will be represented by a function m(sn). In order to accommodate this extension, the road surface is described by

$$\begin{aligned}&{\mathscr {S}}=\left\{ {\varvec{x}}_P(s,n)={\varvec{x}}_C(s)+{\varvec{n}}(s) n+{\varvec{m}}(s) m (s,n) \in {\mathbb {R}}^3\,: \right. \nonumber \\&\left. \quad \,s\in [s_i,s_f],\,n \in \frac{1}{2} [-r_w,r_w] \right\} . \end{aligned}$$
(6)

The vector \({{\varvec{x}}_P}\) is the location of the vehicle’s reference point on the road surface, while \({\varvec{x}}_C\) is the origin of the Darboux frame (on the centre line). See points P and C, respectively, in Fig. 2a. The lateral position of P with respect to the centre line is n (in Darboux coordinates). The track is assumed to start at \(s_i\) and end at \(s_f\). It is also assumed that the road width \(r_w\) is function of s. The position-dependent elevation m(ns) is function of both n and s – this detail has been omitted from (6) to avoid excessive notational clutter.

Fig. 2
figure 2

Differential geometry of the track surface. a The moving centre-line-following Darboux frame has origin C, and basis \({\varvec{t}}\), \({\varvec{n}}\) and \({\varvec{m}}\). The lateral position (in Darboux coordinates) is n, while the relative torsion, normal curvature and geodesic curvature of the track on the centre line are \(\varOmega _x^0\), \(\varOmega _y^0\), and \(\varOmega _z^0\). On a curved ribbon, these quantities will vary away from the centre line. b Track cross section. The origin C of the Darboux-frame is indicated by the red circle, with \({\varvec{t}}\) pointing into the page. The LiDAR survey points are shown as solid dots. These data are approximated by some form of algebraic function m(sn) (shown as a solid line). The track tangent plane undergoes a lateral position-dependent camber angle change \(\varDelta \phi\) (exaggerated here)

In contrast to previous work, the road surface now varies relative to the tangent plane with these variations described by m(sn)—the point P in Fig. 2b moves along the road surface (rather than along the tangent plane to the centre line). The solid curve in this figure is assumed to take the form of an algebraic function of degree J with no constant or linear terms

$$\begin{aligned} m(s,n) = \sum _{j=2}^J a_j(s) n^j. \end{aligned}$$
(7)

Clearly one could use other functions, but algebraic functions are particularly easy to deal with mathematically. Setting \(a_0(s)=a_1(s)=0\) forces the road surface to coincide with, and be tangent to, the Darboux frame on the centre line. If the road frame is to remain tangent to the road at positions away from the centre line, the camber angle must be adjusted to \(\phi (s)+\varDelta \phi (s,n)\) and a slope variation \(\varDelta \mu\) (around the y axis) is also required, whereFootnote 2

$$\begin{aligned} \varDelta \phi (s,n)\approx & {} \partial _n m = \sum _{j=2}^{J} j\, a_j(s) n^{j-1}, \end{aligned}$$
(8)
$$\begin{aligned} \varDelta \mu (s,n)\approx & {} - \partial _s m=\sum _{j=2}^J a_j'(s)n^j, \end{aligned}$$
(9)

for small road elevation changes, and rates of change (in Darboux coordinates). Note that n is in the \({\varvec{n}}\) direction (i.e. the y direction of the Darboux frame) rather than the \({{\varvec{n}}}^\dagger\) directionFootnote 3, which is along the curved section of the ribbon; see Fig. 2. The legacy three-dimensional road model corresponds to the case \(m(s,n) = 0\).

The impact that these camber and slope changes will make on the track curvature estimate at \({\varvec{x}}_P\) can be calculated using (1) once the Euler angles have been appropriately adjusted. The transformation between absolute and road-fixed coordinates at P is given by the following transformation

$$\begin{aligned} R_P= R_z(\theta ) R_y(\mu ) R_x(\phi + \varDelta {\phi }) R_y (\varDelta {\mu }) = R_z({\hat{\theta }}) R_y({\hat{\mu }}) R_x({\hat{\phi }}), \end{aligned}$$
(10)

where for small \(\varDelta \phi\) and \(\varDelta \mu\)Footnote 4

$$\begin{aligned} \hat{\theta }= & {} \theta + \varDelta {\mu } \frac{\sin \phi }{\cos \mu } \end{aligned}$$
(11)
$$\begin{aligned} \hat{\mu }= & {} \mu + \varDelta {\mu }\, {\cos } {\phi } \end{aligned}$$
(12)
$$\begin{aligned} \hat{\phi }= & {} \phi + \varDelta {\phi } + {\varDelta {\mu }}\, {\sin {\phi }}\, {\tan {\mu }}. \end{aligned}$$
(13)

It now follows from (2) that the curvature at P is given by

$$\begin{aligned} \left[ \begin{array}{c} \varOmega _x \\ \varOmega _y \\ \varOmega _z \end{array} \right] = \left[ \begin{array}{ccc} 1 &{} 0 &{} -s_{{\hat{\mu }}} \\ 0 &{} c_{{\hat{\phi }}} &{} c_{{\hat{\mu }}} s_{{\hat{\phi }}} \\ 0 &{} -s_{{\hat{\phi }}} &{} c_{{\hat{\mu }}}c_{{\hat{\phi }}} \end{array} \right] \left[ \begin{array}{c} \hat{\phi }^\prime \\ \hat{\mu }^\prime \\ \hat{\theta }^\prime \end{array} \right] , \end{aligned}$$
(14)

which can also be written as

$$\begin{aligned}&\left[ \begin{array}{c} \varOmega _x \\ \varOmega _y \\ \varOmega _z \end{array} \right] = R_y^T(\varDelta \mu )R_x^T(\varDelta \phi ) \left[ \begin{array}{c} \varOmega _x^0 \\ \varOmega _y^0 \\ \varOmega _z^0 \end{array} \right] \nonumber \\&\qquad + R_y^T(\varDelta \mu ) \left[ \begin{array}{c} \varDelta \phi ' \\ 0 \\ 0 \end{array} \right] + \left[ \begin{array}{c} 0 \\ \varDelta \mu ' \\ 0 \end{array} \right] . \end{aligned}$$
(15)

The first term on the right-hand side expresses \({\varvec{\varOmega }}_0\) in the road coordinate system at P, while the second and third terms recognise the angular road rates at P, within that coordinate system.

In sum, the three-dimensional road model is described by the three road curvatures at the centreline \(\varOmega _x^0(s)\), \(\varOmega _y^0(s)\) and \(\varOmega _z^0(s)\), plus the coefficients of the algebraic function m(sn) that represents the transverse undulations away from the Darboux frame. The Euler angles associated with the Darboux frame, and the road-fixed frame at P, can be found by integrating the curvatures \({\varvec{\varOmega }}^0\) and \({\varvec{\varOmega }}\) respectively. The curvature properties of the track can be found by solving a secondary OCP that is described below.

3 Road reconstruction

The purpose of this section is to show how to optimally parametrize the track model using survey data. In other words, we seek (s-dependent) Euler angles and polynomial coefficients \(a_i(s)\) in (7) that minimise the distance between the survey data and the track model. The method proposed builds on the methods described in [7, 13, 15]. The optimal-control problem (OCP) takes the standard form

$$\begin{aligned} \underset{\varvec{u}}{\text {minimise}} \quad {\mathscr {J}}= & {} \oint _{{\mathscr {T}}} \big (S(\varvec{x}, s)+U({\varvec{u}})\big )\,ds, \end{aligned}$$
(16)
$$\begin{aligned} \text {subject to}\quad \frac{d\varvec{x}}{ds}= & {} \varvec{f}(\varvec{x},\varvec{u}), \end{aligned}$$
(17)

where s is the displacement along the centre line and around the closed track \({\mathscr {T}}\). The performance index \({\mathscr {J}}\) is chosen so as to minimise errors relative to the survey data (term S), while ensuring that the problem is regular and that the solution is sufficiently smooth (term U). The function \({\varvec{f}}({\varvec{x}},{\varvec{u}})\) encapsulates the track’s geometric constraints.

The model state vector comprises three position variables, integrator chains for each of the Euler angles, a road-width variable, and states relating to the polynomial coefficients in (7) and their derivatives. These can be assembled as follows

$$\begin{aligned}&{\varvec{x}} =[x_C,y_C,z_C,\phi ,\phi ',\phi '',\mu ,\mu ',\mu '',\theta ,\theta ',\theta '', \nonumber \\&\qquad r_w, a_2,\dots ,a_J,a_2',\dots ,a_J' ,a_2'',\dots ,a_J'']^T. \end{aligned}$$
(18)

The model controls manipulate the trajectory of the Darboux frame so that it circumnavigates the race track while minimising an estimation error. These inputs relate to the Euler angles, the road width, and the polynomial coefficients, and are given by

$$\begin{aligned} {\varvec{u}} = [u_\phi ,u_\mu ,u_\theta ,u_{rw},u_{a2},\dots ,u_{aJ}]^T. \end{aligned}$$
(19)

The system equations are

$$\begin{aligned}{\varvec{f}}({\varvec{x}},{\varvec{u}})& = [c_\theta c_\mu ,\; s_\theta c_\mu ,\; \nonumber \\&\quad - s_\mu ,\; \phi ' ,\; \phi '' ,\; u_\phi ,\; \mu ' ,\; \mu '' ,\; u_\mu ,\; \theta ' ,\; \theta '' ,\; u_\theta ,\; u_{rw}, \; \nonumber \\&\quad a_2',\; \dots ,\; a_J',\; a_2'',\; \dots ,\; a_J'',\; u_{a2}, \dots , u_{aJ}]^T. \end{aligned}$$
(20)

The state- and control-related terms in the performance index (16) are

$$\begin{aligned} U({\varvec{u}})= & {} W_\phi u_\phi ^2 + W_\mu u_\mu ^2 + W_\theta u_\theta ^2 + W_{rw}u_{rw}^2 +\sum _{j=2}^J W_{aj}u_{aj}^2, \end{aligned}$$
(21)
$$\begin{aligned} S({\varvec{x}}, s )= & {} \sum _{k=1}^K \left( Q_x (x_k-x_{k0} (s))^2 \right. \nonumber \\&\quad \left. + Q_y (y_k-y_{k0} (s))^2 + Q_z (z_k-z_{k0} (s))^2 \right) . \end{aligned}$$
(22)

For each value of the elapsed distance \(\{x_{k0},y_{k0},z_{k0}\}(s)\) represent the survey data, or interpolated values thereof, with \(\{x_k,y_k,z_k\}\) the corresponding model estimates. These estimates are given by

$$\begin{aligned} x_k= & {} x_C + (-{s}_\theta {c}_\phi +{c}_\theta {s}_\mu {s}_\phi ) n_k+({s}_\theta {s}_\phi +{c}_\theta {s}_\mu {c}_\phi )m_k, \end{aligned}$$
(23)
$$\begin{aligned} y_k= & {} y_C + ({c}_\theta {c}_\phi +{s}_\theta {s}_\mu {s}_\phi ) n_k+(-{c}_\theta {s}_\phi +{s}_\theta {s}_\mu {c}_\phi )m_k, \end{aligned}$$
(24)
$$\begin{aligned} z_k= & {} z_C + {c}_\mu {s}_\phi n_k + {c}_\mu {c}_\phi m_k; \end{aligned}$$
(25)

in each case the third terms represent the influence of m(sn).

The control weights are \(W_\phi\), \(W_\mu\), \(W_\theta\), \(W_{rw}\), and \(W_{aj}\), while \(Q_x\), \(Q_y\), and \(Q_x\) are weights on the track-model estimation errors. Since the survey data is assumed equispaced, \(n_k\) is given by

$$\begin{aligned} n_k=-\frac{r_w}{2} + \frac{k-1}{K-1}r_w, \quad k=1, \dots , K \end{aligned}$$
(26)

where \(r_w\) is the track-width estimate and K is the number of the stations considered in each cross section. Equispaced data can always be obtained from non-uniformly-spaced data by interpolation and re-sampling so that \(\varDelta n_k /r_w\) is constant. The height estimates come from (7) and are given by \(m_k=m(n_k,s)\) for each k and all s. The optimal estimation problem is to minimise the error from the track survey data given by \(x_{k0}\), \(y_{k0}\), and \(z_{k0}\); see the right-hand side of Fig. 1a.

In the case of closed race tracks, cyclic boundary conditions must be enforced. These are

$$\begin{aligned} {\varvec{x}}(s_i)={\varvec{x}}(s_f) \end{aligned}$$
(27)

for all the state variable except the yaw angle \(\theta\). In this case

$$\begin{aligned} \theta (s_i)-\theta (s_f)=\pm 2\pi , \end{aligned}$$
(28)

with the sign determined by the running direction.

3.1 Darlington Raceway

The raw LiDAR survey data for the Darlington Speedway was re-sampled so that it covered a uniform grid (i.e. with \(\varDelta n/r_w\) constant), consisting of \(K=13\) three-dimensional curves across the race track, where \(k=7\) corresponds to the centre line, while \(k=1\) and \(k=13\) correspond to the track boundaries; see Fig. 1a. For numerical reasons this data was also non-dimensionalised with length scale of 100 m. The parameters used for the reconstruction are shown in Table 2. The weights were chosen by trial-and-error to obtain a reconstruction suitable for minimum-lap-time problem applications. With the parameters employed, the maximum third-order derivatives of the attitude \(\theta\), slope \(\mu\) and camber \(\phi\) angles are approximatively \(1.5\times 10^{-3}\,\)rad/m\(^3\), \(2.5\times 10^{-4}\,\)rad/m\(^3\), and \(3.5\times 10^{-4}\,\)rad/m\(^3\), respectively, which are regarded as sufficiently small. Similarly, the third-order derivatives of the polynomial coefficients \(a_2\), \(a_3\) and the first-order derivative of the road width \(r_w\) are approximatively \(5 \times 10^{-9}\) m\(^{-4}\), \(10^{-9}\) m\(^{-5}\), and 0.05, respectively. The running direction for the circuit is counter-clockwise so that \(\theta (\zeta _i)-\theta (\zeta _f)=2\pi\) (with z pointing downwards). The OCP is solved using GPOPS-II, which in turn employs the nonlinear programme (NLP) solver IPOPT [16].

Figure 3a shows the track centre-line curvature. Figure 3b shows the elevation and camber angle deviations across the track; both quantities are expressed in the Darboux-frame. The maximum camber-angle deviation is \(\approx \,10^\circ\), with a related elevation change of approximatively 0.5 m in Darboux coordinates (which are cambered by \(-\,22^\circ\)). The result of the optimal-control-based reconstruction (solid line) is almost indistinguishable from the least-squares interpolation (dashed line); the least-square interpolation was calculated on a row-by-row basis for a cubic function on n only.

Fig. 3
figure 3

Darlington Raceway reconstruction: a track curvatures along the centre line expressed in (rad/m), and b elevation m across the track with respect to the Darboux frame (top), and the corresponding camber-angle variation \(\varDelta \phi\) (bottom) at \(s=600\,\)m; the measured data are shown dotted

Figure 4a shows the reconstructed track centre line and boundaries as compared with the raw survey data in the neighbourhood of 600 m from the start-finish line; this is where the cross-track variable camber is most pronounced.

Fig. 4
figure 4

a Track boundary estimation between 550 m and 650 m; the raw data (dotted) and estimates (solid) are indistinguishable from each other on the length scales shown here. b Camber angle variations as a function of track position. Each curve corresponds to one of the thirteen lateral survey stations; the arrows point from the inner to the outer track boundaries. Camber angle variations are particularly pronounced in Turns 2 (600–800 m) and 4 (1600–1800 m)

Finally, we show how the reconstruction error varies with polynomial order. Table 1 summarises the results in terms of both RMS and maximum errors. The important observation is that in this case there are diminishing returns related to increasing the polynomial order above cubic; increasing the weighting factor \(Q_z\) did not change this observation in any significant way. As a result, a cubic polynomial in n in (7) is deemed adequate in this instance.

Table 1 RMS and maximum reconstruction errors in the elevation estimate m with increased polynomial order; order 0 (first row) means enforcing \(m=0\) (i.e. \(a_j=0\))

4 Vehicle positioning and kinematics

The aim of this section is to derive the constraint equations that ensure that the car remains on the road surface. These will be included in the subsequent formulation of the minimum-lap-time problem.

The vehicle’s position on the road surface can be described in terms of s, n, and its orientation \(\chi\) relative to the track centre line tangent. The yaw angle \(\chi\) is a rotation about the road normal at P, and is measured relative to the track’s centre line. These variables are functions of the elapsed distance s, which is used as the independent variable instead of time. As a result of the ribbon’s curvature, the vehicle undergoes an elevation change m(sn) that results in camber and slope changes \(\varDelta \phi\) and \(\varDelta \mu\) (relative to the Darboux frame); see Fig. 5.

The relationship between s, n, \(\chi\), and the absolute velocity \([u,v,w]^T\) of the reference point P (expressed in the vehicle’s body-fixed reference frame), is required in order to keep track of the vehicle’s road position. When expressed in the Darboux frame, the absolute velocity of the reference point P is

$$\begin{aligned}&\left[ \begin{array}{c} \dot{s} \\ 0 \\ 0 \end{array} \right] +\dot{s} {\varvec{\varOmega }}^0 \times \left[ \begin{array}{c} 0 \\ n \\ m \end{array} \right] + \left[ \begin{array}{c} 0 \\ \dot{n} \\ \dot{m} \end{array} \right] = R_x(\varDelta \phi ) R_y(\varDelta \mu ) R_z(\chi ) \left[ \begin{array}{c} u \\ v \\ w \end{array} \right] \nonumber \\&\quad \approx \left[ \begin{array}{c} u c_\chi -v s_\chi + w\varDelta \mu \\ u s_\chi + v c_\chi - w\varDelta \phi \\ w + \varDelta \phi (u s_\chi + v c_\chi )-\varDelta \mu (u c_\chi -v s_\chi ) \end{array} \right] , \end{aligned}$$
(29)

where \(\varDelta \phi\) and \(\varDelta \mu\) are treated as ‘small’; see (7.99) and (7.100) in [10]. The left-hand side of (29) describes the velocity of the origin C of the Darboux frame, the transferred velocity and the relative velocity with respect to the moving Darboux frame. The elevation rate due to the ribbon curvature is given by

$$\begin{aligned} \dot{m}= & {} \dot{n}\partial _{n}m + \dot{s}\partial _{s}m \end{aligned}$$
(30)
$$\begin{aligned}= & {} \sum _{j=2}^J \left( {\dot{n}} j a_j n^{j-1} + {\dot{s}} a_j' n^j \right) ; \end{aligned}$$
(31)

see (7). Equation (29) can be solved to give

$$\begin{aligned} \dot{s}= & {} \frac{u c_\chi -v s_\chi }{1-n\varOmega _z^0+m\varOmega _y^0 +n\varOmega _x^0\partial _s m} \end{aligned}$$
(32)
$$\begin{aligned} \dot{n}= & {} {u\sin \chi +v\cos \chi + \left( m-n\partial _{n} m\right) \varOmega _x^0\dot{s},} \end{aligned}$$
(33)
$$\begin{aligned} w= & {} {n\left( \varOmega _x^0+\varOmega _z^0\partial _s m\right) \dot{s}.} \end{aligned}$$
(34)

Equation (29) may be solved by pre-multiplying it by \(R_y^T(\varDelta \mu )R_x^T(\varDelta \phi )\), linearizing the result around \(m(s,n)=0\), and equating to \(R_z(\chi )[u,v,w]^T\). The standard (three-dimensional) vehicle-positioning equations are found by setting \(m(s,n)=0\); see (7.101)–(7.103) in [10]. Replacing the elapsed time with the elapsed centre-line distance as the independent variable, means that \(d{\varvec{x}}/dt=\dot{s} d{\varvec{x}}/ds\), where \(\dot{s}\) is given by (32).

Fig. 5
figure 5

Vehicle kinematics. The position of the vehicle’s reference point P is given in terms of nm, while its angular orientation is described by the camber variation \(\varDelta \phi\), slope change \(\varDelta \mu\) (not shown in the figure) and relative orientation \(\chi\). The vehicle’s absolute velocity in body-fixed coordinates is \([u,v,w]^T\)

The temporal angular velocity \([\omega _x, \omega _y, \omega _z]^T\) of the body-fixed vehicle frame, and the road curvature at point P are related by

$$\begin{aligned} \left[ \begin{array}{c} \omega _x \\ \omega _y \\ \omega _z \end{array} \right]= & {} R_z^T(\chi ) \left[ \begin{array}{c} \varOmega _x \\ \varOmega _y \\ \varOmega _z \end{array} \right] \dot{s} + \left[ \begin{array}{c} 0 \\ 0 \\ \dot{\chi } \end{array} \right] \nonumber \\= & {} \left[ \begin{array}{c} (\varOmega _x c_\chi +\varOmega _y s_\chi )\dot{s} \\ (\varOmega _y c_\chi -\varOmega _x s_\chi )\dot{s} \\ \varOmega _z\dot{s} +\dot{\chi } \end{array} \right] \end{aligned}$$
(35)

where \([\varOmega _x,\varOmega _y,\varOmega _z]^T\) is given by (15). These equations are identical to those of the standard three-dimensional road model, once the road curvatures of the centre line are replaced by those at P; see equation (7.106) in [10]. The first two rows of (35) are required when integrating the equations of motion, while the third row of (35) keeps track of the yaw orientation of the vehicle (relative to the road centre line).

The camber and slope variation rates appearing in (15) are obtained using the chain rule

$$\begin{aligned} {\varDelta {\phi }}^\prime\approx & {} n' \partial _{nn} m + \partial _{sn} m, \end{aligned}$$
(36)
$$\begin{aligned} {\varDelta {\mu }}^\prime\approx & {} - n' \partial _{ns} m - \partial _{ss} m, \end{aligned}$$
(37)

where \(n'={\dot{n}}/{\dot{s}}\). The vehicle angular accelerations \({\dot{\omega }}_x,{\dot{\omega }}_y\) and the linear acceleration \({\ddot{n}}\), which appear in the equations of motions, can be computed by differentiating (33) and (35) with the chain rule. It is worth noting that many times the angular accelerations \(\dot{\omega }_x,\dot{\omega }_y\) are neglected in the context of minimum time simulation, because their effect is often quite small.

The longitudinal, lateral and vertical accelerations of the vehicle’s reference point P, expressed in the vehicle frame, are given by

$$\begin{aligned} a_x= & {} {\dot{u}}-v\omega _z+w\omega _y, \end{aligned}$$
(38)
$$\begin{aligned} a_y= & {} {\dot{v}} + u\omega _z-w\omega _x, \end{aligned}$$
(39)
$$\begin{aligned} a_z= & {} {\dot{w}}-u\omega _y+v\omega _x \end{aligned}$$
(40)

respectively. The terms \(w \omega _y,w \omega _x\) are usually neglected when the track camber is less than 5–10\(^\circ\). However, in the case of some NASCAR ovals, the camber can reach 30\(^\circ\) and these terms may become important—their effect is discussed in the numerical example given at the end of the paper. Finally, the time derivative of the vertical velocity is obtained by differentiating (34) with the chain rule.

5 Minimum-lap-time problem

In this section a curved-ribbon model of the Darlington Raceway will be used to investigate the lap-time performance of a NASCAR specification vehicle. A simple car model based on the free-trajectory quasi-steady-state optimal-control methodology proposed in [14], which makes use of g–g–g diagrams to account for the effect of road three-dimensionality. The car is constrained to operate within the road boundaries and the car’s g–g–g envelope.

5.1 Nascar car model

The car is represented by a double-track model operating under quasi-steady-state conditions [14]. The total drive force is divided between the four wheels according to a distribution factor assuming an open differential. Normal load balance, moment balance and roll stiffness equations are used to resolve the lateral load transfers. It is also assumed that the side-slip angles on each axle are the same, and so

$$\begin{aligned} \frac{F_{yfl}}{C_{\alpha ,fl}N_{fl}}=\frac{F_{yfr}}{C_{\alpha ,fr}N_{fr}},\qquad \frac{F_{yrl}}{C_{\alpha ,rl}N_{rl}}=\frac{F_{yrr}}{C_{\alpha ,rr}N_{rr}}, \end{aligned}$$
(41)

for a simple cornering stiffness type tyre model. In (41) \(F_{yij}\), \(N_{ij}\), and \(C_{\alpha ,ij}\) (with \(i=f,r\), \(j=l,r\)) are the four lateral forces, normal loads, and cornering stiffnesses for each tyre.

The aerodynamic forces comprise drag \(F_D\), and side forces \(F_S\), applied at the vehicle reference point P, and four downforces \(F_{Lij}\) applied as normal loads to each wheel. The car body is subject to an aerodynamic yaw-moment \(M_z\). Thus

$$\begin{aligned} F_D= & {} \frac{1}{2}\rho _a C_D A V^2, \quad F_{Lij} = \frac{1}{2}\rho _a C_{Lij} A V^2, \end{aligned}$$
(42)
$$\begin{aligned} F_{S}= & {} \frac{1}{2}\rho _a C_{S} A V^2, \quad M_{z} = \frac{1}{2}\rho _a C_{Mz} L A V^2, \end{aligned}$$
(43)

where \(\rho _a\) is the air density, A is the reference cross-sectional area, L is the moment reference length, V is the vehilce’s speed, while \(C_D, C_{Lij}, C_S\) and \(C_{Mz}\) are the drag, downforce, sideforce and yaw moment coefficients, respectively.

The g–g map is obtained from the envelope of the tyre friction ellipses, as explained in detail in [14]. The longitudinal and lateral tyre-road friction coefficients are described by

$$\begin{aligned} \mu _x=p_{Dx1}+p_{Dx2} \frac{N-N_{0}}{N_{0}}, \qquad \mu _y=p_{Dy1}+p_{Dy2} \frac{N-N_{0}}{N_{0}}, \end{aligned}$$
(44)

respectively, which accommodate the changes in friction coefficient that come with changes in the tyres’ normal loads. The terms \(p_{Dx1}\) and \(p_{Dy1}\), which are always positive, are the friction coefficients at the nominal load \(N_{0}\). The normal-load adjustment terms \(p_{Dx2}\) and \(p_{Dy2}\), which can be of either sign, represents friction coefficient changes that accompany changes in the normal load N.

Figure 6 shows part of the g–g diagram for a typical NASCAR with the dataset given in Table 3. Unlike the more familiar g–g diagrams, the ones shown here are asymmetric, with larger lateral accelerations possible when turning left. Not surprisingly, the car is set up this way because the Darlington Speedway considered in this work is a left-turning oval. Figure 6a shows the effect of the vehicle’s speed: as the speeds increases, the g–g map enlarges and shifts both vertically and laterally because of the aerodynamic force system. Figure 6b shows the effect of road three-dimensionality: the camber angle shifts the g–g map laterally, while the g–g enlarges as the apparent gravity on the car increases. It is also worth noting that the effect of the aerodynamic side can be as large as 0.07 g at 70 m/s (157 mph).

Fig. 6
figure 6

Nascar car g–g diagrams: a at different speed V (50, 70, 90 m/s in solid, dashed and dash-dot lines respectively), and b effect of racetrack three-dimensionality at 70 m/s (with two-dimensional road, camber angle \(-\,20^\circ\), and \({\tilde{g}}/g=1.5\) in solid, dashed, and dash-dot respectively)

5.2 Optimal-control problem

The states \({\varvec{x}}\) and controls \({\varvec{u}}\) of the three-dimensional free-trajectory quasi-steady-state minimum-lap-time OCP are

$$\begin{aligned} {\varvec{x}}= & {} [V,n,{\hat{\chi }}]^T, \end{aligned}$$
(45)
$$\begin{aligned} {\varvec{u}}= & {} [{\hat{a}}_x,{\hat{a}}_y]^T, \end{aligned}$$
(46)

where

$$\begin{aligned} V'= & {} \frac{1}{\dot{s}}({\hat{a}}_x-w{\hat{\omega }}_y), \end{aligned}$$
(47)
$$\begin{aligned} n'= & {} \frac{1}{\dot{s}}V {s}_{{\hat{\chi }}} + \left( m-n\partial _{n} m\right) \varOmega _x^0 \end{aligned}$$
(48)
$$\begin{aligned} {\hat{\chi }}'= & {} \frac{1}{\dot{s}}\frac{{\hat{a}}_y+w\omega _x}{V} - \varOmega _z. \end{aligned}$$
(49)

These equations are expressed in the spatial domain using \(d {\varvec{x}}/dt=\dot{s}\, d {\varvec{x}}/ds\), and where \({\dot{s}}\) is given by (32) and \(\varOmega _z\) by the last row of (15), while (47), (48), and (49) come from (38), (33), and the last row of (35) using (39). In (47)–(49) the hats are used to denote variables related to a frame attached to the vehicle’s reference point P and aligned with the tangent to the trajectory, i.e. rotated by the vehicle side-slip angle \(\beta =\text{ atan }(v/u)\). In this framework the vehicle positioning is obtained replacing u and \(\chi\) with \(V=\sqrt{u^2+v^2}\) and \({\hat{\chi }}=\chi +\beta\) respectively, while enforcing v equal to zero.

The cost functional \({\mathscr {J}}\) of the OCP is the manoeuvre time

$$\begin{aligned} {\mathscr {J}}=\oint _{{\mathscr {T}}} \frac{1}{\dot{s}}ds, \end{aligned}$$
(50)

where the closed contour integral is evaluated around the track. In order to enforce continuity across the start-finish line the cyclic constraints

$$\begin{aligned} {\varvec{x}}(s_i)={\varvec{x}}(s_f) \end{aligned}$$
(51)

are enforced in the optimal control problem.

Initially the vehicle is constrained to move within the track boundaries

$$\begin{aligned} -r_{w}/2+T/2\le n \le r_{w}/2-T/2, \end{aligned}$$
(52)

where T is the track width. The constraint related to the g–g map is

$$\begin{aligned} {{\tilde{\rho }}}({{\tilde{a}}}_x,{{\tilde{a}}}_y) \le {{\tilde{\rho }}}_{\max }({{\tilde{\alpha }}},V,{{\tilde{g}}}), \end{aligned}$$
(53)

where \({\tilde{\rho }}\) and \({\tilde{\alpha }}\) are the engaged friction radius and its orientation respectively

$$\begin{aligned} {\tilde{\rho }}=\frac{1}{g}\sqrt{{{\tilde{a}}}_x^2+{{\tilde{a}}}_y^2}, \end{aligned}$$
(54)
$$\begin{aligned} {\tilde{\alpha }}=\text{ atan2 }({{\tilde{a}}}_x,{{\tilde{a}}}_y), \end{aligned}$$
(55)

while \({{\tilde{\rho }}}_{\max }\) is the maximum friction radius, i.e. the boundary of the g–g–g envelope, which depends on the orientation \({\tilde{\alpha }}\), together with the speed V and the appartent gravity \({\tilde{g}}\). The accelerations \({{\tilde{a}}}_x\), \({{\tilde{a}}}_y\), and \({{\tilde{g}}}\) are given by (for small \(\varDelta \phi\) and \(\varDelta \mu\))

$$\begin{aligned} {\tilde{a}}_x= &\, {} {\hat{a}}_x -{h\dot{{\hat{\omega }}}_y} - {\hat{\omega }}_z{\hat{\omega }}_x h \nonumber \\&+ g[({s}_\mu + {\varDelta \mu } {c}_\mu {c}_{\phi }){c}_{{\hat{\chi }}} -({s}_\phi + \varDelta \phi {c}_\phi ) {c}_{\mu }{s}_{{\hat{\chi }}} ], \end{aligned}$$
(56)
$$\begin{aligned} {\tilde{a}}_y= &\, {} {\hat{a}}_y +{h\dot{{\hat{\omega }}}_x} - {\hat{\omega }}_z{\hat{\omega }}_y h \nonumber \\&-g[({s}_\mu + {\varDelta \mu } {c}_\mu {c}_{\phi }){s}_{{\hat{\chi }}} + ({s}_\phi + \varDelta \phi {c}_\phi ) {c}_{\mu }{c}_{{\hat{\chi }}} ], \end{aligned}$$
(57)
$$\begin{aligned} {\tilde{g}}= & {} -{\hat{a}}_z -h ({\hat{\omega }}_x^2+{\hat{\omega }}_y^2) \nonumber \\&+g ( {c}_\mu ({c}_\phi - \varDelta \phi {s}_\phi ) - \varDelta \mu {s}_\mu ), \end{aligned}$$
(58)

where the right-hand sides comprise the acceleration of P together with the Euler, centrifugal, and gravitational accelerations. Equations (56)–(58) are slightly different to those in [14], where the Euler and centrifugal accelerations have been neglected—however, as it will be shown in the numerical example below, their contribution is negligible.

5.3 Results

The road model proposed in Sect. 2 is now used with the OCP formulated in Sect. 5.2, together with the g–g map derived with the car model in Sect. 5.1, to evaluate the car’s optimal performance. A Nascar car with the dataset given in Table 3 running on the Darlington Speedway considered in Sect. 3 is now simulated. As in the road reconstruction, the minimum-lap-time OCP is solved using GPOPS-II, together with the NLP solver IPOPT [16]; all variables are scaled based on a reference length, reference time, and reference mass [10]. Standard numerical differentiation is employed. All simulations starts with a coarse mesh consisting of 41 equally-spaced mesh points, resulting in 328 equations to solve. When including the effect of curved ribbon, the solution is found after about 60 s (on a Intel Core i7-7700HQ processor, running on Windows 10) and 5 mesh refinements with a mesh tolerance below \(10^{-4}\), resulting in 3 552 equations to solve. The corresponding mesh spacing ranges from 0.7 m to 16 m, for a total of 444 mesh points.

When \(m=0\), ı.e. the flat ribbon case, the lap time is 27.449 s. This time is 27.448 s when running on the Darlington Speedway constructed with the curved-ribbon road introduced in this paper with \(J=3\); see (7). The optimal trajectories of each case are shown in Fig. 7. The change in trajectory is particularly noticeable in Turns 2 and 3-4, where the road camber variation is significant and as large as 10°. In particular, the optimal trajectory resulting from the curved road is up to 5 m (in Turn 2) and 7.3 m (in Turns 3–4) outer than that obtained with the flat-ribbon road (see Fig. 7b), so that the camber angle seen by the vehicle is larger, even though a longer trajectory results.

Fig. 7
figure 7

Minimum-lap-time simulations for a flat ribbon (solid line) and a curved ribbon (dashed line): a optimal trajectory, and b speed profile (top) and lateral position normalized with the road width (bottom)

Further insight into the effect of lateral camber angle variations is obtained from a minimum-time simulation on the curved ribbon model, using the optimal trajectory obtained with a flat ribbon road model. In this case the lap time increases to 28.585 s, which is 1.137 s slower than the lap time obtained for the optimal curved-ribbon trajectory. This sub-optimal behaviour is attributable to not exploiting the higher wide-line camber angle which extracts more side force from the tyres; the increased camber angle can be as much as \(6.5^\circ\).

As a final remark, the elapsed running time obtained when neglecting the Euler and centrifugal accelerations in (56)–(58), as compared with the solution that includes these terms, was never more than 0.003 s and 0.006 s, respectively. Similarly, when repeating the above comparison while neglecting the \(w\omega _y\) and \(-w\omega _x\) terms in (38) and (39), the elapsed time difference was as high as 0.003 s. For this particular track, the camber change \(\varDelta \phi\) is the dominant influence, with \(\varDelta \mu\) having a negligible effect on the lap time—the elapsed time difference remained below 0.003 s when neglecting the slope change.

6 Conclusion

A novel three-dimensional road model suitable for minimum-lap-time simulations that includes lateral curvature variations of the track has been introduced. The model accommodates lateral variation in the camber angle, which can be significant on some NASCAR race tracks. An optimal control based method that identifies the track model parameters from experimentally measured data is explained. An example based on a LiDAR survey on the Darlington Speedway is given. Legacy vehicle positioning and kinematic models based on curvilinear coordinates has been extended to the newly-introduced curved-ribbon road model. Simulations on the Darlington Raceway show that the car’s optimal trajectory can be significantly different on some parts of the track.