Code Monkey home page Code Monkey logo

carnd-pid-control-project's Introduction

CarND-Controls-PID

Self-Driving Car Engineer Nanodegree Program


The effects of PID

The “P” stands for “Propositional” part that applies steering in proportion to error input. It is just a multiple of error input. The problem is that it tends to oscillate as shown in below video:

P controller

The “D” stands for derivative. It is a multiple of the rate of change of the error input. It is just a multiple of (current_error - previous_error), divided by time between the two.If time internal is always constant then it can be incorporated into the D constant directly. If the current error is less than previous error then this reduces the effect of “P” term and smooths out the system. In my project when I introduced the D part, the oscillations shown above were cured.

The “I” stands for Integral. It is the accumulated error term. In its simplest form it is just a running sum of error term. This can fix any bias in system, like misaligned wheels. Since this project uses simulator so no bias is present hence I term is zero

How final parameters were chosen?

Manually. First altered the "P" part keeping "D and "I" zero. Then increased D from zero in increments of 0.1 and system stabilized quickly. Didn't need to touch the I part.

Caveat

The use of PID for steering control is purely academic. PID is best suited for for simple situations where we don't have to bother with the ‘laws of physics, like cruise control or industrial valves. PID would fail when a fast moving car approaches a sharp turn. Since PID; in its purest form; only looks at current error, it would issue extreme steering angle correction when it would notice high error term as the car enters the turn. The inertia of a high velocity vehicle would overwhelm its tyre friction and the car would skid out of control. Similarly at high speeds a constant sampling interval and the delay between sensing input and turning physical wheels can lead to unstable behavior.

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

carnd-pid-control-project's People

Contributors

domluna avatar asadziach avatar baumanab avatar swwelch avatar davidobando avatar htuennermann avatar

Watchers

James Cloos avatar  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.