Giter Club home page Giter Club logo

udacity-carnd-pid-control-project's Introduction

Udacity-CarND-Controls-PID

Goals

This project implements a PID controller in C++ to maneuver the vehicle's steer angle and throttle around the track. The simulator will provide the cross track error (CTE) as input for PID controller.

Dependencies

Simulator

Dependencies

Running the Code

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

Implementation

PID Controller

  • Propotional component steers the vehicle back to the center. Its output is -1 x proportiona x cte.
    P alone will lead vehicle prone to overfshoot.
  • Integral componet account not only to the cte but also the time for which it has persisted. It accumulates the cte over time.
    For biased system, it can eliminate this bias.
  • Derivative component aims at flattening the error trajectory into a horizontal line, damping the force applied, and so reduces overshoot A pure D controller cannot bring the system to its setpoint

Paramater Tuning

  1. Replace main.cpp with twiddle.cpp

  2. Check system bias, set steer = 0, observe vehicle behavior in simulator.
    During simulation angle = 0 and vehicle dirves straight forward, therefore system is bias free, integral component is not necessary.

  3. Initial twiddle parameter , para = {0.5, 1.0, 0.0} delta_p = {0.5, 1.0, 0.0} each test loop_val 450

  4. Wait tunning process finished when delta_p[0]+delta_p[1]) < 0.2

  5. Final PID parameter Kp = 1.28212 Kd = 8.226

udacity-carnd-pid-control-project's People

Contributors

kuan-hc 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.