top of page

Lap Time Simulation

Please enjoy the 2-minute summary gallery below, scroll further to explore my work in greater detail,

or explore my code in this GitHub repository

Lap time simulation can be an invaluable tool for developing a vehicle. The ability to predict the performance of various vehicle configurations can help guide the engineering design process and ensure that resources are being spent in the areas that will reap the highest reward. On this page, I will discuss the process I used to develop my lap time simulation code, and explain the key decisions I made to achieve my target attributes.

Goals and Objectives

Example output plot of a simulated run on the FSAE Michigan 2019 Endurance Map

The first thing to discuss is what utility you are trying to get out of a lap time simulation, as this drives the major development decisions and what features get included. For my FSAE team, the benefit of a lap sim does not come from being able to perfectly recreate a real world lap time. Rather, the focus is in being able to capture changes in relative performance instead of absolute. As long as the representation of vehicle performance is accurate enough to capture the effect of changes such as reducing weight or improving aerodynamic efficiency, then a lap sim can be used to compare concepts and identify areas of development where we can get the most bang for our buck.

With that in mind, these are the primary objectives identified at the beginning of the project:

Vehicle Path Generation

The first step is to be able to chart a feasible and realistic vehicle trajectory for the lap sim to evaluate. My goal was to re-create the 2019 FSAE Michigan Endurance and Autocross courses. These would be the closest representations of potential future courses that our FSAE cars would run, making them the ideal starting point for performance evaluation. As an added bonus, predicting lap time and comparing to the 2019 score sheets enables us to create points scoring predictions as a means of comparing different concepts.

This is an example of a track map provided by FSAE. There are some cones represented by black dots and a scaling legend, but it is a far cry away from a well defined vehicle path. First, I imported images like these into Solidworks and created a sketch over the image, placing dots over each defined gate cone. I also added more gates to more sharply define the intended course trajectory. I was then able to import the coordinates into an Excel spreadsheet, and properly scale them to match the distance units of interest. 

Source: “Endurance 2019.” Fsaeonline.com, Society of Automotive Engineers, Apr. 2019, www.fsaeonline.com/cdsweb/gen/DownloadDocument.aspx?DocumentID=73d7e97f-b223-4a8e-af7d-b7143b5afec2.

Once the points were in excel, I brought them into MATLAB to replicate the track map. At this point, there were enough gates to create a vehicle trajectory. This was defined by a vector the same length as the number of gates, with values between zero and one. Zero meant that the vehicle crossed a given gate right at the very edge of the inside cone, and one meant the vehicle crossed at the absolute outside, and any value in between was an interpolation between the two. These points could be connected to create a fast and distinct definition of vehicle path. On top of that, upper and lower bounds can be automatically updated with vehicle size, allowing a difference in dimensions to affect the final trajectory and helping meet one of the core objectives.

Endurance track represented by gates in MATLAB