Curved-ribbon-based track modelling for minimum lap-time optimisation

Three-dimensional road models for vehicular minimum-lap-time manoeuvring are typically based on curvilinear coordinates and generalizations of the Frenet–Serret formulae. These models describe the road as a parametrized ‘ribbon’, which can be described in terms of three curvature variables. In this abstraction the road is assumed laterally flat. While this class of road models is appropriate in many situations, this is not always the case. In this research we extend the laterally-flat ribbon-type road model to include lateral curvature. This accommodates the case in which the road camber can change laterally across the track. Lateral-position-dependent camber is introduced as a generalisation that is required for some race tracks. A race track model with lateral curvature is constructed using high-resolution LiDAR measurement data. These ideas are demonstrated on a NASCAR raceway, which is characterized by large changes in lateral camber angle (≈10∘\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\approx 10^\circ$$\end{document}) on some parts of the track. A free-trajectory optimization is employed to solve a minimum-lap-time optimal control problem. The calculations highlight the practically observed importance of lateral camber variations.


Introduction
Early track models for closed-circuit minimum-laptime 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 curvaturerelated 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.
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 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.

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 j and torsion s. 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 m 0 , is required to represent the track's camber [10]. A moving trihedron C, called Darboux frame, moves along the road centreline with its x-y plane tangent to the road surface. An orthogonal basis for C is ½t n m (see Fig. 2a), which can be obtained according to the attitude-pitch-roll convention as follows where R z ðhÞ; R y ðlÞ and R x ð/Þ are the elementary rotation matrix around the z, y and x axis respectively; h; l and / 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, h, l and / are obtained by integrating the curvature variables that are referred to more conveniently as the relative torsion X 0 x , normal curvature X 0 y and geodesic curvature X 0 z ; the angular rate of the Darboux frame is the vector X 0 ¼ ½X 0 x ; X 0 y ; X 0 z T . The Euler angles and the angular rate are related by   where 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 t-n plane that will be represented by a function m(s, n). In order to accommodate this extension, the road surface is described by The vector x P is the location of the vehicle's reference point on the road surface, while 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(n, s) is function of both n and s -this detail has been omitted from (6) to avoid excessive notational clutter.
In contrast to previous work, the road surface now varies relative to the tangent plane with these variations described by m(s, n)-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 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 /ðsÞ þ D/ðs; nÞ and a slope variation Dl (around the y axis) is also required, where 2 D/ðs; nÞ %o n m ¼ for small road elevation changes, and rates of change (in Darboux coordinates). Note that n is in the n direction (i.e. the y direction of the Darboux frame) rather than the n y direction 3 , which is along the curved 1 In the unit-speed case s is the speed along the centre line. 2 We use the notation o n m to denote om on , and o sn m to denote o 2 m oson and so on. 3 If the road elevation changes are assumed small (in Darboux coordinates), the lateral displacement of the car can be approximated by R n 0 ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi 1 þ ðo g mðg; sÞÞ 2 q dg % n. section of the ribbon; see Fig. 2. The legacy threedimensional 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 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 where for small D/ and Dl 4 l ¼l þ Dl cos/ ð12Þ It now follows from (2) that the curvature at P is given by which can also be written as The first term on the right-hand side expresses X 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 X 0 x ðsÞ, X 0 y ðsÞ and X 0 z ðsÞ, plus the coefficients of the algebraic function m(s, n) 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 X 0 and X respectively. The curvature properties of the track can be found by solving a secondary OCP that is described below.

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 where s is the displacement along the centre line and around the closed track T. The performance index 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 f ðx; 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 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 The system equations are f ðx; uÞ ¼ ½c h c l ; s h c l ; À s l ; / 0 ; / 00 ; u / ; l 0 ; l 00 ; u l ; h 0 ; h 00 ; u h ; u rw ; a 0 2 ; . . .; a 0 J ; a 00 2 ; . . .; a 00 J ; u a2 ; . . .; u aJ T : ð20Þ The state-and control-related terms in the performance index (16) are Sðx; sÞ ¼ For each value of the elapsed distance fx k0 ; y k0 ; z k0 gðsÞ represent the survey data, or interpolated values thereof, with fx k ; y k ; z k g the corresponding model estimates. These estimates are given by in each case the third terms represent the influence of m(s, n). The control weights are W / , W l , W h , 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 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 resampling so that Dn 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 for all the state variable except the yaw angle h. In this case with the sign determined by the running direction.

Darlington Raceway
The raw LiDAR survey data for the Darlington Speedway was re-sampled so that it covered a uniform grid (i.e. with Dn=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 h, slope l and camber / angles are approximatively 1:5 Â 10 À3 rad/m 3 , 2:5 Â 10 À4 rad/m 3 , and 3:5 Â 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 firstorder derivative of the road width r w are approximatively 5 Â 10 À9 m À4 , 10 À9 m À5 , and 0.05, respectively. The running direction for the circuit is counterclockwise so that hðf i Þ À hðf f Þ ¼ 2p (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 % 10 , with a related elevation change of approximatively 0.5 m in Darboux coordinates (which are cambered by À 22 ). The result of the optimal-control-based reconstruction (solid line) is almost indistinguishable from the least-squares interpolation (dashed line); the leastsquare interpolation was calculated on a row-by-row basis for a cubic function on n only. 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.
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  (7) is deemed adequate in this instance.

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 v relative to the track centre line tangent. The yaw angle v 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(s, n) that results in camber and slope changes D/ and Dl (relative to the Darboux frame); see Fig. 5.
The relationship between s, n, v, 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 % where D/ and Dl 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 see (7). Equation (29) can be solved to give Equation (29) may be solved by pre-multiplying it by R T y ðDlÞR T x ðD/Þ, linearizing the result around mðs; nÞ ¼ 0, and equating to R z ðvÞ½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 dx=dt ¼ _ sdx=ds, where _ s is given by (32).
The temporal angular velocity ½x x ; x y ; x z T of the body-fixed vehicle frame, and the road curvature at point P are related by where ½X x ; X y ; X 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 Dl 0 % À n 0 o ns m À o ss m; ð37Þ x y and the linear acceleration € 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 _ x x ; _ x 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 respectively. The terms wx y ; wx x are usually neglected when the track camber is less than 5-10 . However, in the case of some NASCAR ovals, the camber can reach 30 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.

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 quasisteady-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.

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 for a simple cornering stiffness type tyre model. In (41) F yij , N ij , and C a;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 yawmoment M z . Thus where q a is the air density, A is the reference crosssectional 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 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 threedimensionality: 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).

Optimal-control problem
The states x and controls u of the three-dimensional free-trajectory quasi-steady-state minimum-lap-time OCP are x ¼½V; n;v T ; ð45Þ where These equations are expressed in the spatial domain using dx=dt ¼ _ s dx=ds, and where _ s is given by (32) and X 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 b ¼ atan ðv=uÞ. In this framework the vehicle positioning is obtained replacing u and v with V ¼ ffiffiffiffiffiffiffiffiffiffiffiffiffiffi ffi The cost functional J of the OCP is the manoeuvre time where the closed contour integral is evaluated around the track. In order to enforce continuity across the start-finish line the cyclic constraints are enforced in the optimal control problem. Initially the vehicle is constrained to move within the track boundaries where T is the track width. The constraint related to the g-g map is whereq andã are the engaged friction radius and its orientation respectivelỹ whileq max is the maximum friction radius, i.e. the boundary of the g-g-g envelope, which depends on the orientationã, together with the speed V and the appartent gravityg. The accelerationsã x ,ã y , andg are given by (for small D/ and Dl) a x ¼â x À h _ x y Àx zxx h þ g½ðs l þ Dlc l c / Þcv À ðs / þ D/c / Þc l sv; ð56Þ a y ¼â y þ h _ x x Àx zxy h À g½ðs l þ Dlc l c / Þsv þ ðs / þ D/c / Þc l cv; 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.

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 curvedribbon 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 flatribbon road (see Fig. 7b), so that the camber angle seen by the vehicle is larger, even though a longer trajectory results.
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 .
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 wx y and Àwx x terms in (38) and (39), the elapsed time difference was as high as 0.003 s. For this particular track, the camber change D/ is the dominant influence, with Dl having a negligible effect on the lap time-the elapsed time difference remained below 0.003 s when neglecting the slope change.

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. otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/. Tables 2 and 3.