Git Product home page Git Product logo

sdcnd_pid_control's Introduction

CarND-Controls-PID

Self-Driving Car Engineer Nanodegree Program


Rubric Discussion

Effect of the P, I, and D components

The P in the PID controller stands for the "proportional" part. It lets the car react proportionally to the offset to the reference trajectory. This means the farther the car is away from the reference trajectory (high CTE) the bigger the steering angle will be. The parameter tau_p determines how heavy the controller reacts.

The I in the PID controller stands for the "integral" part. It handles bias which would otherwise keep the PD controller from reaching the reference trajectory. This components assures that the car will not drive on one side of the reference trajectory for a long period of time. To do this it takes into account the total sum of CTE.

The D in the PID controller stands for the "differential" part. It helps the controller to not overshoot and oscillate around the reference trajectory. Without it the car would reach the reference trajectory in an angle and then stop steering. This would lead the car to overshoot. This happens over and over again which lets the car oscillate arount the reference trajectory. The D component takes the difference between the previous and the current CTE and adjusts the steering accordingly. This lets the car approach the reference trajectory smoothly.

Finding the Parameter Values

At first I tried to implement the Twiddle algorithm in order to optimize the control parameters. However, this did not work well because my manually set values combined with the changes by the twiddle algorithm made the car leave the road and invalidated the tuning. I then decided to use the values of the class as a reference (0.2, 0.004, 3.0) which turned out to work fine. I manually tweaked the values and figured out that it would even work with an I component of zero. However, in the end I decided to set it back to 0.004 to be able to react when drift sets in. The final parameters for the steering controller are (0.15, 0.004, 3.0).

After the steering parameters were set I startet with the controller for throttle. I took the steering angle as input for that controller so that for high steering angles the car would slow down. The direction of the steering angle doesn't matter which is why I used the absolute value. I started with the same parameters as for the steering controller, but removed the integral component which would infinitely grow when using the absolute steering angle. I increased the proportional component to be more reactive in curves. I also removed the differential component to avoid breaking for a short time often. I ended up with the parameters (0.35, 0.0, 1.5).

Dependencies

There's an experimental patch for windows in this PR

Basic Build Instructions

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

Tips for setting up your environment can be found here

sdcnd_pid_control's People

Contributors

baumanab avatar bentocin avatar davidobando avatar domluna avatar htuennermann avatar mvirgo avatar swwelch avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.