YCSU / Udacity_SDC_T2P4_PID_Control

PID in C++

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CarND-Controls-PID

Self-Driving Car Engineer Nanodegree Program


Dependencies

  • cmake >= 3.5
  • make >= 4.1
  • gcc/g++ >= 5.4
  • uWebSockets == 0.13, but the master branch will probably work just fine

Basic Build Instructions

  1. Clone this repo.
  2. Make a build directory: mkdir build && cd build
  3. Compile: cmake .. && make
  4. Run it: ./pid.

The effect of PID components

The value of Kp, Ki, and Kd was chosen by manually tuning. The tuning process is similar to twiddle but mixed with the human intelligence :D

The effect of the PID component is demonstrated by the following examples. The car drove on the same path with different coefficients.

Kp=0, Kd=0, Ki=0

When all the coefficients are zeros, the CTE increased indefinitely.

Kp=0.09, Kd=0, Ki=0

As we increased Kp, the CTE initially decreased. However, the car overshot the ideal trajectory and started to oscillate.

Kp=0.09, Kd=1.3, Ki=0

We also increased Kd. The car was able to stay on the track. Notice that there is a spike.

Kp=0.09, Kd=1.3, Ki=0.003

We also increased Ki. the amplitude of oscillation increased a bit. There is no steady state error in this case. However, if there was, Ki component would help correct this error.

About

PID in C++


Languages

Language:C++ 99.7%Language:Shell 0.1%Language:CMake 0.1%