~ / projects /

Lap Time Optimization for Formula One Cars

The fastest way around a circuit is not the shortest. Cornering speed is capped by how much lateral force the tires can generate, and that cap falls as the corner tightens. The shortest path forces the slowest corners, while the widest, gentlest line covers far too much ground. The quick lap is somewhere between the two, and finding it is an optimal control problem. This was our project for CMU 16-745 (Optimal Control and Reinforcement Learning).

Formulation

The racing line was built as a minimum-curvature trajectory: enter wide, clip the apex, unwind onto the exit, using the full width of the track to keep the curvature, and therefore the speed penalty, as low as the geometry allows.

The path itself is a closed natural cubic spline, and that choice does real work.

Why splines. Curvature depends on the second derivative of the path. A closed natural cubic spline is $C^2$ continuous everywhere, including at the joins between segments, so the curvature being minimized is defined at every point and changes smoothly with the decision variables. That smoothness is what makes the problem well posed for a gradient-based solver like IPOPT.

With the geometry parameterized, the control problem becomes a nonlinear program, minimizing lap time subject to vehicle dynamics and track boundaries, solved with IPOPT, an interior-point solver suited to nonlinear problems of this size and constraint structure.

Results

Plot of a circuit outline with outer track, inner track and centerline traces, with an inset zooming into a chicane to show the lines separating.
The optimized circuit, with outer and inner track limits and the centerline; the inset zooms into a chicane.

The solver recovers the line a racing driver would recognize, arrived at from dynamics and constraints rather than experience: brake in a straight line, turn in late, get the car rotated early, and accelerate from the apex outward.

  • Controls
  • Optimization
  • Planning
  • Simulation