First Place Solution in Summer 2023 Simulation Racing Series
Written by Derek Chen, this paper describes his thought process for his first place solution in the Summer 2023 Simulation Racing Series Competition.
The code for the solution can be found here: https://github.com/DerekChen1/ROARRacing
Table of Contents
Introduction
For this solution, I built off of the solution that Aaron Xie created, modifying and tuning the PID to get the best results.
Strategy
In order to get the fastest lap time, I decided to not follow road safety rules. I also created two more zones for the throttle control in order to better tune the controller to account for the different areas of the track.
Waypoints
I decided to modify the waypoints by using some waypoints from 2022’s winning solution by Daniel Chuang and his team, as I felt that these waypoints were quite good and were able to accommodate higher speeds. Unfortunately, due to their extensive use of shortcuts, I was unable to use most of their waypoints and was only able to incorporate their waypoints into the first ⅓ of section 2. The waypoints that I created through driving were not an improvement over the ones that I created by merging the two sets of waypoints.
Controller and PID Tuning
The solution I created hinged on tuning the throttle response and lateral PID controller. I doubled the number of throttle control zones from 2 to 4, giving me significantly more control over what the throttle did in different parts of the map. I ended up with zones for both occurrences of the town, the majority of the hills, as well as the downhill stretch. I also modified the waypoints slightly, and significantly tuned the PID to give the highest speeds possible.
Disregarding conventional road safety rules gave a significant increase, as well as increasing the overall throttle throughout the course. By increasing the threshold at which the controller recognized a turn and didn’t use full throttle, I was able to increase the average speed of the car. Reducing the reduction in throttle as the turn angle increased also enabled me to significantly increase the speeds at which the car cornered.
Using the hills throttle control in the last section of the map meant that the response to sharp turns was gradual and wasted acceleration time. I modified the throttle to have a significantly higher turn threshold for wide turns, as well as a response for tighter turns.
elif wide_error > 0.17 and current_speed > 100: # wide turn
throttle = max(0, 1 - 6*pow(wide_error + current_speed*0.002535, 6))
brake = 0
The second controller section that was added was for the long downhill stretch right before the second part of the town. Due to its high speed, this section required plenty of attention, and simply using the hills controller didn’t allow for the control that I needed while still providing an optimal response for the vast majority of the map. The high speed of this section also necessitated the increase of the PID values for the lateral PID.
"180": {
"Kp": 0.25,
"Kd": 0.015,
"Ki": 0.015
},
"200": {
"Kp": 0.25,
"Kd": 0.015,
"Ki": 0.015
},
"300": {
"Kp": 0.23,
"Kd": 0.012,
"Ki": 0.012
I found that at the speeds reached (200+ kph) meant that the turn angle supplied by the PID were insufficient to keep the car from moving off course and onto the curb, resulting in a significant speed reduction and possibly a crash. This also made the car unreliable in this section, as run-to-run variance meant that the car would crash here on some runs, while managing to complete this section on others. Increasing the PID values for high speeds meant that the car was better able to follow the waypoints, as the response to turns would be much sharper and higher than they were originally.
Conclusion
This was a very long endeavor given the task at hand. However, thorough tuning of Aaron Xie’s 2023 Spring solution allowed me to significantly improve upon his time. I would like to thank Professor Yang and his team for putting together this competition, as well as introducing me to artificial intelligence and some of its practical applications. I look forward to what future competitors will be able to do to advance autonomous racing.