Giter VIP home page Giter VIP logo

carnd-pid-control-project's Introduction

CarND-Controls-PID

Self-Driving Car Engineer Nanodegree Program


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

Reflection

Below i am going to briefly describe some of the steps i took in this project.

I started of by coding the various template functions in PID.cpp. This was relatively straightforward and I essentially replicated the code/formula from the project lessons.

Thereafter, i had to call the Init, UpdateError and TotalError for the steering value. After a lot of manual tuning I settled for the following values.

Kp = 0.15 Ki = 0.001 Kd = 2.75

As comments in the code, I still have other combinations that worked as well.

With the above values for steering PID, the car will not leave the track at all.

After this, I took notice of the fact that there was a comment in the code which said that another PID could be used.

I decided to use another PID for the throttle value. I was successful to some extent or so i believe. I decided to cap my speed at 45 MPh.

Again after some manual tuning i settled for the following values for the throttle PID.

Kp = 0.2 Ki = 0.01 Kd = 1.0

The issue with the throttle PID, is in the first quarter of lap 1, the car accelerates to a very high speed of almost 75 Mph. Thereafter, the car can go around any number of laps and the speed will be fixed at around 45 Mph.

I tried to fix this by tracking the speed. Whenever the speed is more than 46 Mph, I cap the throttle value at 0.1 However, I got mixed results with this. This is something that I will need to work on later.

For the submission i commented out the above mentioned code snippet to avoid wild oscillations. Though the second PID seems to work, i need to perfect it to avoid instability. Things were more stable with just one PID for the steering value.

carnd-pid-control-project's People

Contributors

domluna avatar sandeeppaulraj avatar baumanab avatar swwelch avatar davidobando avatar htuennermann avatar mvirgo 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.