Giter Site home page Giter Site logo

carnd-t2-project4's Introduction

CARND Term 2

Project 4 - PID controller


P, I and D

Proportional controller

This is the first term I played with. In short, the P factor determines how sharp the vehicle turns. A higher value makes the vehicle turn faster.

Below is a video of a scenario where the P factor is too high.

You can see the vehicle's turn rate is excessive.

Integral controller

The Integral factor dampens the steering angle based on the cumulative error (cte). This includes the sum of positive and negative values, which means that pendulum-esque movements of the vehicle (as views from above) decreases this adjustment.

Below is a video of a scenario where the I factor is too high.

Differential controller

The differential controller aims to smooth out the steering angle based on the change in cte. As the vehicle gets closer the the ground truth (the cte value decreases), the steering angle will become less acute.

Having a large D value will make the vehicle become too excited to get back on track, which will make it overshoot the ground truth mark.

Tuning

This was done manually, my C++ expertise was not on the level to dynamically tune the parameters on the fly. The steps can also be found in the main.cpp script, but here was what I experienced:

  • I started with PID = [2.9, 10.3, 0.5], which was taken as is from the lessons. It was way too extreme, the vehichle took super sharp turns and couldn't 'stick' to the groud truth.

1

  • After that I decreased the P factor to 0.3: [0.3, 10.3, 0.5]. This did not have the desired change. The vehicle still turned too sharply.

2

  • Next step was to decrease the I value so that the vehicle is less sensitive the the cumulative errors. [0.3, 1.0, 0.5]

3

  • This kept the vehicle on the road at least, but the sporadic left/ right turning was not desired [0.3, 0.1, 0.5]

4

  • Decreasing I even more: [0.3, .001, 0.5]

5

  • Did not have the desired effect, need to decreasse D [0.3, .001, 0.05]

6

  • Close, but still too jerky: [0.03, .0005, 0.015]

7

  • This works

carnd-t2-project4's People

Contributors

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