Lejun's Blog

'22 MSE in Robotics @ Penn
'20 BSE in MechE, Minor in EE @ UMich
'20 BSE in ECE @ SJTU

0%

F1Tenth Autonomous Racing Cars - Lab 3 (Wall Following with PID Controller)

During the Spring 2021 semester, I joined the F1Tenth team at Penn to conduct an interest project on multi-vehicle coordination. To get prepared for the project, I self-learned and completed Lab 1, 2, 3, 4, and 6 of the “F1Tenth” course.

Overview

This post contains my results for Lab 3, where a PID controller for wall following is implemented for the race car so that it can follow the inner walls of the Levine Hall and complete a loop smoothly. See the video below for a demonstration of the wall follower:

Demonstration

Procedure

I calculated the vehicle’s distance to the wall from its 2d-lidar scan information, this is done by using the 2d-lidar scan data from two directions as shown below:

Calculation of vehicle's distance to the wallCalculation of vehicle's distance to the wall

I then applied PID control to its steering wheels to maintain the desired distance.

where the error term e(t) is the difference between the desired wall distance and the actual wall distance calculated previously. I also introduced a “distance delay” in order to account for time delay between perception and control. More technical details can be found in the below prompt document:

However, given the nature of a single PID controller, I have to tune the parameter precisely so that the car can complete a loop. If the parameters are not well tuned, it is very likely that the controller would fail in some edge cases. See the failed case here:

In fact, even if the parameters have been well tuned, this simple controller could still fail in some extreme cases. Therefore, I am going to explore more sophisticated Planning and Control methods in the future labs.

My source codes for this lab can be found on github through this link.

Reference

The lecture video can be found below: