The improvements to the minimum curvature race line optimization

Motorsports is gaining increasingly large and broad attention and simulations using modern information technology on race performance are in demand. This paper focuses on the improvements of the minimum curvature method on optimal racing lines for a race car. The key contribution of the improvements is to generate a more realistic optimal racing line, therefore getting a better description of the car and driver performance. The improvements contain the introduction of the kerb of the track and the late apex technique applied by drivers during the race. The effect of two improvements is verified in the simulation racing software Assetto Corsa and the result shows that the introduction of the kerb raises the lap time accuracy by 90% and the late apex trajectory is matched with the actual path.


Introduction
The racing line is the path that allows a race car to complete a circuit in the shortest time.In order to help the drivers and teams to have a better and more accurate understanding of the track and their performance, finding the optimal racing line is necessary.With the data of the track and minimum curvature method, people are able to calculate the optimal racing line.The minimum curvature trajectory planning method is an optimization problem with inequality constraints [1].The method minimizes the curvature of the circuit and the track width is the constraint.
However, there are two problems that may make the result inaccurate.First is the kerb of the track.In some cases, drivers would drive the car outside the circuit in order to gain the advantage.This means the map of the track should be expanded so the kerb can be included.The second is the late apex technique [2].It is a technique that most drivers would use to turn the corner more smoothly and gently.This will help decrease the consumption of the tire and the stability of the car.This paper focuses on improving the minimum curvature method developed by Alexander Heilmeier by modifying the original map of the track and adding correction factors [1].Then the results of the changes would be verified in the simulation software Assetto Corsa and by various drivers' data from Hipole Racing [3].
The result of this paper proves that the improvements are effective and can better simulate the race line, thus helping drivers and racing teams to better understand a circuit, as well as improve performance.The two improvements provided innovative prospects in minimum curvature and path planning problems, a possible solution to the kerbs and Late Apex problem.

Track
To study the racing line of a certain circuit, transforming the geographic information of the track into numbers and data is needed.With the LiDAR scanning of the track and computer vision, we are able to get the data of the track described in the form of centerline [4].The centerline is oriented in coordinate [x, y] and together with the width information [−w L , w R ] ( w L stands for the distance between centerline and left boundary, and w R stands for the distance between centerline and right boundary), form the complete information of the track.In this paper, the red bull ring in Austria is chosen as an example.

Kerb
Drivers sometimes go off track in order to gain advantages.On most track, there are kerbs at the start and end of a corner.Drivers sometimes go on kerbs so they can go through the corner with less distance or exit the corner with a smaller angle.However, a track limit is set by the race official.The 2021 FORMULA ONE SPORTING REGULATIONS writes that drivers will be judged to have left the track if no part of the car remains in contact with it [5].And the track is defined by a white line around the track.So the driver should use the kerbs while at least one wheel of the car is still inside the white line.And also, some parts of the track is covered with grass or sand, which would cause the car to lose control once the car contact with.So some parts of the offtrack space cannot be used.

Late apex
Late apex is a technique many racers would use during the races [6].The apex is the point at which you are closest to the inside of the corner, also referred to as the clipping point.For normal race line the apex is at the geometric center of a corner.Late apex however, choose an apex point further in the corner.This technique allows the car entering the corner with a lower speed to steer the direction of the car faster, and accelerate earlier to carry a higher speed into the straight line.This technique is frequently used by racers in order to conserve the tyre and increase the stability when turning corners.

Minimum curvature
Minimum curvature is a method for solving the optimal race line problem.To finish the lap in a shortest time, the velocity must be maximized.Velocity can be described by v = α k , in which the α is the lateral acceleration and k is the curvature.The minimum curvature method focuses on minimizing the curvature of the race line throughout the whole circuit.And by turning the curvature into a quadratic optimization problem, an optimal race line can be generated [1].

Time simulation
Time simulation is used in the variation part of this paper to help estimate the effect of the improvements.Using a quasi-steady-state lap time simulation python code [4], we can estimate the lap time of the generated racing line.Giving a race line described with coordinates and the data of the car, the code will calculate the lap time of the car running on the provided race line.In this paper, the formula 3 car of 2019 was chosen and the model and data of the car were provided by Racing Sim Studio(RSS) formula 3 V6.

Assetto Corsa
Assetto Corsa (AC) is a well-known racing simulator that provides authentic simulation of race cars.Choosing AC as the simulator can simulate the situation closest to reality.And because of its popularity, large numbers of players can provide the necessary data for this paper.Hipole is a sim racing club and it holds online race events regularly.All the race information and result can be found on the official website, so it can provide the critical data of hundreds of human drivers which can be used in the variation part of this paper.

Methodology
In this section, two improvements will be discussed and the result of which will be verified.

Kerb
As mentioned in section 2.2, drivers use kerbs to increase their performance.In previous work on minimum curvature path planning, the kerb is not included in the track data because the work of Heilmeier is focused on Formula-E, which has a smaller scale of track and has walls right next to the track, so there is not much offtrack space to use.But for other tracks like the red bull ring in Austria, which is an open circuit, have a lot of kerbs that can be used.So, to generate a racing line more accurately, we improve the method by expanding the track and adding kerbs to the track data.

Modify data.
The car must stay in track limits, which means at least one side of the car must be within the white line.So, the track will be expanded by the car's width.Change the value of the width of the track: When the offtrack space is not enough, the track will only be expanded by the available width.
[−  −   ,  +   ] (2)  Figure 4 shows turn 3 of the red bull ring circuit.In the figure, the darker line is the minimum curvature trajectory after expanding the track.The white line is the minimum curvature trajectory before expanding the track.Compare to the original optimal racing line, the newly generated racing line has a different path and uses more space on the track including kerbs.The lap time of the improved race line is 77.981s while the original race line is 78.229s.The gap is 0.248s and the figure above showed that when driving through corners, kerbs can help you pass the corner with a higher velocity.
In Assetto Corsa, 90 drivers in Hipole event finished over 1500 laps on the red bull ring with the RSS formula 3 V6 car.The top 10 drivers achieve an average lap time of 78.002s.That means the accuracy of the improved method is 90.7% more accurate than the original method.In which α stands for the distance between the car position and the center line that describes the track.And α is constrained by the width of the circuit.Parameter k is the curvature of the optimal race line, and can be defined by the following formula: The x and y in the formula can be defined by α as: In the formula above, r is the coordinates [x, y] for the optimal race line and p is the coordinates of the track center line.n is the unit length normal vector whose direction is perpendicular to the center line.
In order to simulate the late apex technique, the vector can be modified to change the value of α.If the vector of a certain point is replaced by the last point, the car would continue to stay in the previous direction.This method can change the trajectory of the car while still performing the optimization of the curvature.Rather than replacing the vector, this method uses a smoother approach by using the average of the current and last vector.
The vector change process will only be conducted during the first of a corner.In this way, the race line has the characteristic of the late apex technique and continues to perform the optimization process.Figure 7 shows the turn1(a), turn 3(b), turn 4(c), and turn5-7(d) as the representative corners of the circuit.The white line is the race line with a late apex and the blue line is the race line with a normal apex.

Result.
At the start of the corner, the white line is outside the blue line.After the center point of the corner, the white line is at the inside of the blue line.This means the late apex race line tends to turn later and change direction faster than the normal apex.Figure 8 shows the velocity and the distance of the circuit of the simulation result.The blue line represents the result of the normal apex and the black line represents the late apex.
The lap time of the late apex method is 78.489s and the lap time of the normal apex is 78.229.The figure above showed that when using the late apex method, the car tends to brake later in the distance, and turn the corner with a lower velocity.However, the late apex method has the advantage on the straight line.As the result, the late apex is 0.26s slower than the normal apex.This shows that the late apex is a widely adopted technique and is similar with the late apex race line created by the minimum curvature method.

Kerb
As already stated in 3.1, the introduction of the kerbs of the track changed the trajectory of the race line.The race line uses more space on the circuit, move to the further side of the circuit when entering the corner, turn into the inner side apex point and leave the corner on the further side again.This wider race line results in lower curvature and higher speed during the corner, and thus complete the lap in a shorter amount of time.Compared with the lap time created by human drivers from the Hipole, the lap time of the race line involving kerbs is 90 percent closer than the race line without kerbs.Also, the velocity and distance diagram also showed that the cornering speed and top speed created by the simulation and human driver are highly matched.
The result proved that using kerbs on the circuit can produce a better race line and made a positive effect on the lap time.So introducing kerbs into the track data is necessary and it can make the simulation result closer to the actual situation.

Late apex
The late apex technique discussed in 3.2 also changed the behavior of the race line.The race line tends to turn later in the distance and redirect the car at a faster rate.After redirecting the car, the driver can finish the rest of the corner with full throttle.
Compared with the original race line, the generated race line has the characteristic of the late apex.At the entrance of a corner, the race line curves later and changes direction faster.After changing direction, the race line has a smaller curvature, thus providing greater acceleration.This behavior is highly similar to the human drivers' late apex technique.However, the race line results in a slower speed.The lap time is 0.26s slower than the original.
Though the race line generated does not have significant change and the lap time is not improved, the technique of late apex was simulated under the condition of the curvature optimization method.This results in a completely different strategy of optimizing the race line and can predict and simulate the drivers' behavior better.

Conclusion
In this paper, two improvements to the minimum curvature method for generating an optimal race line are discussed.Starting with the related work and the basis we worked on, the idea and the meaning of kerbs and the late apex are introduced, as well as minimum curvature in quadratic optimization.For the result, the introduction of the kerb and the late apex technique both change the behavior of the race line and provide a more realistic race line.Adding kerbs to the track increase the accuracy of lap time simulation by 90%.Though the late apex method does not help with the lap time, it reflects the pattern of the late apex technique and makes the race line closer to reality.The late corner technique should be applied to corners ahead of long straights to provide greater straight-line speed, rather than all the corners analyzed in the paper.In actual racing, the best and late corner lines are used in combination to achieve the fastest full speed.Then the result was verified by the data collected from Hipole racing club.In this paper, many parameters are not considered or ignored.Such as the temperature, aerodynamic changes and etc.More efforts should be made to further evaluate the optimization approaches that consider more parameters and develop a detailed vehicle dynamics model that can better indicate the simulated race car performance.

Figure 1 .
Figure 1.A demonstration of the Late Apex technique.

3. 1 . 1 .
Track data.The original track data does not include the kerbs on the track.By comparing the track map with the full-scale 3D model of the track, the kerbs on the track can be located.The length and width of the kerbs can also be measured in the full-scale model.

Figure 2 .
Figure 2. The true-scale 3D model of the red bull ring GP circuit.

Figure 3 .
Figure 3.Comparison of circuit modify.Figure 3 shows turn 3 as a representative part of the circuit.The left side of the figure shows the track without kerbs.The right side of the figure shows the track after kerbs are added.After setting up the new track data, run the minimum curvature optimization and generate the new optimal race line.

Figure 4 .
Figure 4. Comparison of race line with kerbs and without kerbs.Figure4shows turn 3 of the red bull ring circuit.In the figure, the darker line is the minimum curvature trajectory after expanding the track.The white line is the minimum curvature trajectory before expanding the track.Compare to the original optimal racing line, the newly generated racing line has a different path and uses more space on the track including kerbs.

3. 1 . 3 .
Variation.Run the time simulation and compare the result of two race lines generated in the last step.

Figure 5 .
Figure 5. Velocity comparison of race line with kerbs and without kerbs.Figure5shows the velocity and the distance of the circuit of the simulation result.The darker line represents the result of the race line involved with kerbs and the black line represents the result of race line without kerbs.The lap time of the improved race line is 77.981s while the original race line is 78.229s.The gap is 0.248s and the figure above showed that when driving through corners, kerbs can help you pass the corner with a higher velocity.In Assetto Corsa, 90 drivers in Hipole event finished over 1500 laps on the red bull ring with the RSS formula 3 V6 car.The top 10 drivers achieve an average lap time of 78.002s.That means the accuracy of the improved method is 90.7% more accurate than the original method.

Figure 5
Figure 5. Velocity comparison of race line with kerbs and without kerbs.Figure5shows the velocity and the distance of the circuit of the simulation result.The darker line represents the result of the race line involved with kerbs and the black line represents the result of race line without kerbs.The lap time of the improved race line is 77.981s while the original race line is 78.229s.The gap is 0.248s and the figure above showed that when driving through corners, kerbs can help you pass the corner with a higher velocity.In Assetto Corsa, 90 drivers in Hipole event finished over 1500 laps on the red bull ring with the RSS formula 3 V6 car.The top 10 drivers achieve an average lap time of 78.002s.That means the accuracy of the improved method is 90.7% more accurate than the original method.

Figure 6 .
Figure 6.The result of an online event of Hipole [3].

Figure 7 .
Figure 7.The race line comparison of normal apex and late apex.Figure 7 shows the turn1(a), turn 3(b), turn 4(c), and turn5-7(d) as the representative corners of the circuit.The white line is the race line with a late apex and the blue line is the race line with a normal apex.

Figure 8 .
Figure 8. Velocity comparison of race line with normal apex and late apex.Figure8shows the velocity and the distance of the circuit of the simulation result.The blue line represents the result of the normal apex and the black line represents the late apex.The lap time of the late apex method is 78.489s and the lap time of the normal apex is 78.229.The figure above showed that when using the late apex method, the car tends to brake later in the distance, and turn the corner with a lower velocity.However, the late apex method has the advantage on the straight line.As the result, the late apex is 0.26s slower than the normal apex.

Figure 9 .
Figure 9. the turn 3 average trajectory of the top 10 driver in the Hipole event.This shows that the late apex is a widely adopted technique and is similar with the late apex race line created by the minimum curvature method.