Controller Design for Buggy Racing
The Buggy Racing project series explores advanced control strategies for autonomous vehicles using the Webots simulation environment. Across five project phases, the overarching goal is to design, implement, and benchmark various controllers that enable a simulated Tesla Model 3 to successfully navigate a challenging "buggy" track, inspired by the iconic CMU tradition. This series leverages a realistic bicycle vehicle model, focusing on tasks like trajectory tracking, path planning, and localization to address modern robotics and control theory problems .
Problem Statement & Objectives:
Develop robust control solutions to autonomously complete the buggy track—minimizing deviation, optimizing lap times, and handling real-world vehicle dynamics. Each project part investigates different strategies: from classical PID controllers to optimal control, path planning, and SLAM-based localization, building toward fully autonomous performance.
The simulation flowchart illustrates how vehicle states from virtual sensors feed into our custom controller, which computes steering and throttle commands. The main objective was to build and test this controller to enable autonomous driving around the buggy track.
Phase 1: PID Controllers
PID controllers are a classic control strategy used to minimize errors and stabilize dynamic systems. Here, I applied independent PID controllers to enable the simulated vehicle to accurately follow the racecourse, focusing on precise steering and speed control.
Actual (red) vs Reference (gray) trajectory
Two independent PID controllers were designed and tuned to steer and control the speed of a simulated vehicle based on the linearized bicycle model. The final controller achieved a lap completion time of 270 seconds, exceeding the project’s performance requirements.
Phase 2: State Feedback (Pole Placement) Control
State feedback control is an advanced control strategy that uses the full state of a system to compute control inputs, aiming to stabilize the system and improve tracking performance. In this project phase, I implemented a lateral full-state feedback controller via pole placement to enhance the vehicle’s trajectory tracking on the buggy track, building on the previous PID control foundation.
The objective was to design a controller that actively adjusts the steering angle by placing closed-loop poles to achieve desired stability and responsiveness, while maintaining consistent speed control from the longitudinal PID controller.
Key tasks included analyzing the controllability and observability of the vehicle’s linearized lateral dynamics across different speeds, followed by the design and tuning of the state feedback gain matrix through pole placement. The controller was integrated into the simulation framework and validated using performance plots comparing the vehicle’s actual path to the reference trajectory.
The implemented controller successfully completed the buggy track lap in 285 seconds.
Phase 3: LQR Control and A* Path Planning
The Linear Quadratic Regulator (LQR) is an advanced optimal control strategy used for stabilizing dynamic systems while minimizing a user-defined cost based on deviations from a desired path and the magnitude of control effort. In the context of autonomous vehicles, LQR uses a full-state feedback approach, where the controller continuously measures the system’s states—such as lateral and orientation errors—and applies steering corrections to minimize those errors with respect to a reference trajectory. By tuning two key matrices (Q and R), LQR balances precision in path following against the need to avoid aggressive, unstable steering inputs, enabling smooth and reliable trajectory tracking.
I first designed and implemented a discrete-time infinite-horizon LQR controller for the vehicle’s lateral dynamics, using the linearized state-space model from previous work. The controller was carefully tuned to complete the buggy track within strict benchmarks for speed and trajectory deviation. The longitudinal PID controller from earlier phases was reused for speed control.
The A* algorithm is a widely used graph-based search method for optimal path planning. A* uses a cost function that combines the known distance traveled with a heuristic estimate of the distance to the goal, efficiently generating the shortest or safest path between start and goal amidst defined obstacles. This allows real-time replanning for dynamic environments, such as rerouting an autonomous vehicle to avoid collisions or overtake another car on the track.
Additionally, I integrated the A* algorithm for dynamic path planning, enabling the vehicle to autonomously replan its route and safely overtake obstacles (such as another car) placed on the track. The custom A* implementation was tested both in standalone simulation cases and within the Webots environment to ensure robust performance.
The combined LQR and A* control strategy successfully completed the course in 140 seconds.
Phase 4: EKF SLAM
The Extended Kalman Filter (EKF) SLAM is a method that helps a robot or vehicle simultaneously figure out where it is and build a map of its surroundings—all at once. In simple terms, EKF SLAM uses noisy sensor measurements and a mathematical model to estimate both the vehicle’s position and the location of certain landmarks, even when the GPS or direct measurements are unavailable.
The main goal of this project phase was to let the autonomous vehicle localize itself accurately and map out features along the buggy track using EKF SLAM, improving its ability to navigate in situations with limited or uncertain position data.
The key tasks involved implementing a full EKF SLAM pipeline to estimate the vehicle’s position, heading, and landmark locations using range and bearing sensors. This included integrating the EKF with the simulation framework and tuning it to enable real-time state correction and effective mapping performance. Additionally, an earlier trajectory tracking controller was reused and retuned as needed to ensure smooth operation alongside the new localization module.
The completed system allowed the vehicle to successfully complete the buggy track in 126 seconds.