Stanford's autonomous driving research vehicle, "Shelly"

Stanford's autonomous driving research vehicle, "Shelly"

AUTONOMOUS DRIVING

The goal of the final team project for my vehicle dynamics class at Stanford was to code controllers to drive "Shelly", which is a vehicle used in Stanford's autonomous driving research (shown above). Our task was to drive the vehicle autonomously around a predetermined, oval-shaped path around a parking lot. In order to do this, we coded two controllers - one for the longitudinal (forward/backwards) motion, and another for the lateral (left/right) motion. The vehicle was already equipped with a number of sensors and actuators to enable autonomous driving, so we only had to write the controller code.

Besides moving along the pre-determined path, there were 4 requirements for the motion of the vehicle

  1. Maximum speed is limited to 10 m/s
  2. The vehicle must stop at the end of the path
  3. Lateral acceleration must be less than 0.3 g
  4. Longitudinal acceleration must be less than 0.2 g

Ideal speed profile calculated given the constraints.

In this project, I had two major roles: First, to create an algorithm that creates a speed profile as a function of the position on the path, such that it satisfies the 4 algorithms above. Second, to create an algorithm so that the vehicle follows the the designated path at the desired speed given by the speed profile.

Velocity Profile

There are primarily 2 limitations to the speed: lateral acceleration, and longitudinal acceleration. Since the curvature of the path was given, it was easy to calculate the maximum speed in which we could stay under the lateral acceleration limit at any point on the path. The next step was to create a velocity profile that complied with that maximum speed, along with the longitudinal acceleration limit. In short, the algorithm repetedly drew parabolas on the speed profile that indicated maximum longitudinal acceleration, until it found the fastest profile that would still comply with the maximum speed given by the lateral acceleration.

Controllers

The longitudinal controller was a proportional controller with a feedforward term. The feedforward term took advantage of the fact that the ideal acceleration along the path is known, given the ideal speed profile calculated. The input of for this controller was the current speed and distance along the path, and the output was the breaking/accelerating force.

"d" is the lookahead error in the "bicycle model" of our vehicle.

The lateral controller controlled the steer angle of the vehicle. This was also implemented as a proportional controller with a feedforward term. The proportional term looked at the lookahead error, which is the distance between the path and the vehicle's current trajectory. The feedforward term used the knowledge of the stead-state slip angle of the tires, given by the current speed and the curvature of the path.

Tuning of the gains was done in using a simulation in MATLAB. Using this controller, we were able to minimize our maximum lateral deviation from the path down to 20cm. 

View final report for the class here.

See video footage from our test run below.