GithubHelp home page GithubHelp logo

qiyd81 / carnd-pid-control-project-1 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from murasr/carnd-pid-control-project

0.0 1.0 0.0 75 KB

License: MIT License

CMake 0.12% Shell 0.33% C++ 99.55%

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

CarND-Controls-PID

Self-Driving Car Engineer Nanodegree Program

Implementation

The PID controller is implemented in PID.cpp file. The PID controller is initialized and the "cross track error" (cte) is used to calculate the steering value from it.

PID Explanation:

P parameter - It is required to adjust the steering value in proportion to the cross track error D parameter - Only "proprotion" characteristic is not enough as the car has the accumulated memory of direction which results in oscillating behaviour. So a "Derivative" of previous cte is taken into account to reduce the oscillation I Parameter - Sometimes the car has some fixed bias which makes the correction done by P and D parameters ineffective. So an additional correction based on history (ie., sum) of cte is considered is provided by I parameter.

Approach

Manual approach is used to find out and fine tune the hyperparameters (P, I, D constants). It is done in the below steps:

P I D Throttle Notes
0 0 0 0.30 This makes PID output the steering value as zero. With this values, the car is able to drive straight in straight road. The steering angle feedback received is also 0. This indicates there is no bias in the car. So the "I" constant can be set to zero always
0.33 0 0 0.30 The range of cte is approximately -3.0 to 3 when the car is near the lane boundaries. So the initial value of P is set to 1/3 = 0.33. With this values, the car is able to turn directions when reaches the lane boundary and it keeps oscillating right from the beginning
0.33 0 0 0.05 The throttle is reduced to have finer control with the PID. With this values, the car is able to drive properly but with reduced speed.
0.33 0 1.0 if abs(cte) > 3.0, then throttle = 0.05 if 3.0 > abs(cte) > 1.5, then throttle = 0.10 otherwise throttle = 0.30 Here D constant is increased to 1.0 and conditional throttle is introduced. Because of D constant, the oscillations amplitude is reduced. With this conditional throttle, the vehicle slows down at curves and finer control of PID controller is acheived. But the car is still oscillating at the curves
0.33 0 2.25 if abs(cte) > 3.0, then throttle = 0.05 if 3.0 > abs(cte) > 1.5, then throttle = 0.10 otherwise throttle = 0.30 To reduce the amplitude of oscillations, it is necessary to change D. By further increasing and fine tuning the D constant, a value of 2.25 is good enough to provide a smoother control across the complete track

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

Contributors

murasr 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.