English subtitles

← PID Implementation Solution - Artificial Intelligence for Robotics

Get Embed Code
4 Languages

Showing Revision 3 created 05/24/2016 by Udacity Robot.

  1. Here is my solution. I implement a variable int crosstrack error outside my main loop
  2. then initialize with zero.
  3. I then add to the int crosstrack error my local crosstrack_error.
  4. Then I have a controller that steers in proportion to the intcrosstrackerror.
  5. When I hit run, I find that my y variable slowly converges all the way down to 0 or 0.05.
  6. I get even faster conversions when I set this parameter to 0.01,
  7. looking down you can see a little overshoot, but my controller converges to 0.0 fairly quickly
  8. and then tends to stay close to 0.0.
  9. This PID controller is kind of the best solution for the control problem at hand.
  10. You just implemented one.
  11. Now, here's the big question for you.
  12. How can we find good control gains
  13. where control gains are these parameters tau p, d, and i.
  14. Now, this is my favorite part of this class.
  15. Every one of my students has made it through it, and every one of my students
  16. is puzzled why I insist on this, but when they implement it they get to love what I'm just about to show you.
  17. The answer is to called "twiddle."
  18. Twiddle is my favorite algorithm that I have used in my entire life.
  19. Some people call it "coordinate ascent" to make it sound a little more sophisticated,
  20. but I just called it twiddle, because it really gets to the heart of what's happening.