Giter Site home page Giter Site logo

carnd-pid-control-project's Introduction

CarND-Controls-PID

This project is part of the Self-Driving Car Engineer Nanodegree Program.


Dependencies

If the environment you set up for the Sensor Fusion projects does not work for this project, fellow students have put together a guide to Windows set-up for this project. There's also an experimental patch for Windows in this PR.

Basic Build Instructions

  1. Clone this repository.
  2. Create a build directory: mkdir build && cd build
  3. Compile: cmake .. && make
  4. Run the program: ./pid

For tips on setting up your environment, refer to the Udacity classroom.

Editor Settings

Editor configuration files have been intentionally kept out of this repository to keep it simple and environment-agnostic. However, we recommend using the following settings:

  • Indent using spaces.
  • Set tab width to 2 spaces to maintain alignment of matrices in the source code.

Code Style

Please adhere (to the best of your ability) to Google's C++ style guide.

Project Instructions and Rubric

Please note that regardless of the changes you make

, your project must be buildable using cmake and make.

Additional information and instructions are available only to students enrolled in Term 2 of the CarND program. If you are enrolled, refer to the project page for instructions and the project rubric.



Addressing Project Rubric

Udacity - Self-Driving Car NanoDegree

Compilation

The code compiles without errors using cmake and make.

Implementation

The base algorithm follows what is presented in the lessons, and hyperparameter tuning/optimization is done manually.

Reflection



Describe the effect of each of the P, I, and D components in your implementation.

A Proportional-Integral-Derivative (PID) controller is a control loop mechanism used in various applications, including industrial control systems. It employs feedback and consists of three terms: proportional (P), integral (I), and derivative (D). The controller continuously calculates an error value by comparing a desired setpoint (SP) to a measured process variable (PV) and applies a correction based on the weighted sum of the three terms. [Source: Wikipedia]

Proportional (P)

The proportional component sets the control input in proportion to the current cross-track error (CTE). However, if the proportional gain is set too high, the system becomes unstable.

Integral (I)

The integral component increases the action in relation to both the error and the duration for which it has persisted. This component is effective in eliminating systematic biases.

Derivative (D)

The derivative component considers the rate of change of the error and aims to bring this rate to zero. It flattens the error trajectory, reducing overshoot.



Describe how the final hyperparameters were chosen.

The parameters were selected through a trial-and-error approach based on an intuitive understanding of the impact of different values. Initially, the gains were set using the values presented in the PID implementation lecture by Sebastian Thrun. These values were then tuned to achieve the desired performance in the simulator environment.

Multiple iterations were performed, and the parameter values were continuously adjusted until the car could successfully and safely complete a lap. The table below shows some of the tested parameter combinations and their results:

Kp Ki Kd Result
0.1 0.001 1.8 Fail
0.15 0.001 1.8 Fail
0.12 0.001 1.8 Fail
0.09 0.001 1.8 Pass
0.1 0.001 1.8 Pass
0.13 0.001 1.8 Good
0.16 0.001 1.8 Better

Note that the throttle value was modified between 0.18 and 0.3 for the above combinations and finally set to a constant value of 0.18 for stability.

Simulation

The vehicle successfully drives a lap around the track.

A simulation video has been recorded and attached in the results directory. The GIF below shows the result for one of the experimented parameter combinations:

carnd-pid-control-project's People

Contributors

baumanab avatar citlaligm avatar davidobando avatar domluna avatar htuennermann avatar mvirgo avatar praveenkumar-rajendran 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.