First Place Solution in Summer 2024 Simulation Racing Series
Written by Derek Chen, Dylan Hackos, and Ron Veksler from Burlingame High School.
Table of Contents
Introduction
This solution was based on our Spring 2024 solution. While that solution failed, it laid the groundwork for this more polished solution. Compared to the Fall 2023 solution it was initially based on, this solution has custom waypoints, a new steering system, a modified throttle system, updated track sections, general section-specific tuning, and a basic debugging tool. It has also been split into multiple files for easier readability.
Waypoints
We recognized that the major issue with all the existing solutions for the Monza track
was that the waypoints stuck to the center of the track, dramatically decreasing the potential for
racing lines and inhibiting fast lap times, with the only solution being to create them manually
through complex equations. To remedy this, we used the waypoint collector from ROAR_PY and
loaded the file with this line:
This allowed us to create waypoints by driving around the track manually, enabling the car to use the full width of the track and the creation of proper racing lines, dramatically increasing the speed of the car. In addition to utilizing the existing waypoint collector, we developed tools that allowed us to splice waypoint files together, remove waypoints, and check them against the track’s boundaries. These tools eliminated the need to drive a perfect lap, as we only needed to drive the specific section perfectly and then slot it into our primary waypoint file. We also changed the section designation system from our Spring 2024 solution to be designated by specific points on the map rather than splitting the track into even sections, allowing us to better tune specific sections.
We also cut off the first 50 waypoints, allowing us to travel at an angle out of the final corner and creating a smoother transition to the first corner, saving us a small amount of time.
Pure Pursuit
We decided to use a pure pursuit algorithm for our steering rather than a PID, which works by setting the steering angle to 1.5 times the angle difference between the car’s heading and the waypoint it’s following. While this does not offer a clear speed advantage, it made the solution less complicated and easier to tune, as we no longer had to tune PID values for specific speeds and sections. To tune the pure-pursuit algorithm, we added a steering multiplier variable given by the formula speed / 120, which gave a nice steering multiplier that worked for most corners. We then added specific tuning to some sections to create a more stable and consistent solution. However, the 6th major corner requires more tuning to eliminate the bounciness as it approaches and rounds the corner.
Throttle and Braking
We modified the throttle to use absolute speed change rather than percent speed change. As the speed change during braking appears to be the same regardless of the car’s speed, using percent speed change is inaccurate. We also increased the number of calculated radii for the braking system by 1 to increase the accuracy of the calculated radius, which resulted in a decent speed advantage and significant stability improvement. We also tuned the friction coefficients for each corner.
Debugging
We also created a debugging tool to help us identify sections of the track that were having problems. We saved the location, speed, throttle, brake, steering, tick number, and lap values to a JSON file and created a debug data reader to take the position, throttle, and brake values and overlay them over a map of the track. This allowed us to realize that there are major issues with the braking system that resulted in inconsistent braking. In the graph below, red points represent the car braking, and green represents varying throttle levels, with bright green being full throttle. The points are also different shapes depending on the lap the car was on, though this is not visible.
As you can see, there are three corners where the car brakes, accelerates briefly, and then brakes again. While we did not completely fix the inconsistent braking, we alleviated it by calculating another radius and braking later. This issue could likely be fixed by precalculating the true radius of the curve and improving the throttle-brake algorithm.
We also modified the debug competition runner to run multiple times in a row. This allowed us to easily run long-term stability testing and identify sporadic crashes and lucky solutions that only worked once. It also allowed us to get a good idea of the spread of times that we could expect and be more hands-off when testing a solution’s consistency and stability. It also gave us an average time to benchmark other iterations against.
Conclusion
Thank you to Dr. Allen Yang, Mr. Huo Chao Kuan, and the rest of the UC Berkeley team for the time and effort you put into the competition. We have enjoyed working together on this competition and are excited to see where the competition goes next.