/Vehicle-Steering-Using-PID-Control

In this project, we implement a PID controller to steer the self driving car around the track in Udacity's Simulator.

Primary LanguageC++MIT LicenseMIT

Vehicle Steering Using PID Control

In this project, we implement a PID controller to steer the self driving car around the track in Udacity's Simulator. The project was created based on the Udacity Starter Code.


About PID controller:

PID controllers are named after the Proportional, Integral and Derivative control modes they have. IT's basically a control loop feedback mechanism. As the name suggests, PID algorithm consists of three basic coefficients: proportional, integral and derivative which are varied to get optimal response.

Proportional (P):

The proportional control mode is in most cases the main driving force in a controller. It changes the controller output in proportion to the error. If the error gets bigger, the control action gets bigger. This makes a lot of sense, since more control action is needed to correct large errors. The adjustable setting for proportional control is called the Controller Gain (Kp). A higher controller gain will increase the amount of proportional control action for a given error. If the controller gain is set too high the control loop will begin oscillating and become unstable. If the controller gain is set too low, it will not respond adequately to disturbances or set point changes.

Proportional (P)

Integral (I):

As long as there is an error present, the integral control mode takes into account the integral of error over past time, it will continuously increment or decrement the controller’s output to reduce the error. Given enough time, integral action will drive the controller output far enough to reduce the error to zero. If the error is large, the integral mode will increment/decrement the controller output fast, if the error is small, the changes will be slower.

Integral (I)

Differential (D):

The third control mode in a PID controller is derivative. Using the derivative control mode of a controller can make a control loop respond a little faster than with PI control alone. The derivative control mode produces an output based on the rate of change of the error. The derivative mode produces more control action if the error changes at a faster rate. If there is no change in the error, the derivative action is zero.

Differential (D)

PID:

PID controller output is made up of the sum of the proportional, integral, and derivative control actions. PID control provides more control action sooner than what is possible with P or PI control. This reduces the effect of a disturbance, and shortens the time it takes for the level to return to its set point.

PID


Hyperparameters Tunning:

Hyperparameters were further tuned manually by try-and-error process.


Dependencies

There's an experimental patch for windows in this PR

Basic Build Instructions

  1. Clone this repo.
  2. Run build.sh
  3. Open the simulator and select PID control project.
  4. Run run.sh