Skip to content

herzogmartin/CarND-PID-Control-Project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CarND-Controls-PID

Self-Driving Car Engineer Nanodegree Program


Dependencies

Basic Build Instructions

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

Reflection of implementing PID-control

After PID was working in principle manual initial controler weights were chosen. Afterwards twiddle was used to optimize the weights. The simulator is automatically reseted if the vehicle leaves the track. The weights are only used if the driven distance is long enough and the error of the summed absolute cross track error (cte) is getting smaller.

Initial P-Part

Kp is always steering towards the center. A high Kp is reaching faster the center of the track but results in overshooting the middle. A start value of 0.1 was chosen.

Initial D-Part

Kd is damping the oscillation of the controler. This result in a smoother approach of the middle position and less overshooting. A start value of 1.0 was chosen.

Initial I-Part

Ki is responsible to eliminate the static control error. But the I-part tends to make the controler unstable.

For steering PID a start value of 0 was chosen. The value was chosen by twiddle.

For speed PID-control a value of 0.005 was tested and sufficent to hold the speed. The speed control was not optimized any more but this could also be done with twiddle.

Optimization with twiddle

If the #define TWIDDLE_ON statement is set to 1 twiddle optimization is done for steering PID. In the final release it is set to 0.

Twiddle was performed with 60 mph. For the finial release the target speed is set to 50 mph. This can be changed with #define TARGET_SPEED.

Final controler weights

The following final controler weights are chosen with twiddle:

  • Kp = 0.116
  • Kd = 1.86086
  • Ki = 0.00252475

Outlook

It would be possible to change the target speed depending on the steering angle. From the steering angle, the speed and the wheel base the lateral acceleration of the vehicle can be calculated. The the target speed could be limited so that the lateral acceleration is not too high.

If this would be done the speed PID needs to do more and its controler weights should be optimized (e.g. with twiddle).

About

udacity project PID control

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages