1 / 10

Proportional, Integral, Derivative Line Following

October 5, 2013. Proportional, Integral, Derivative Line Following. Welcome and Introductions. Line Following. Why is line following useful in FLL? Wide black lines with surrounding white area can be used for successful navigation.

ata
Download Presentation

Proportional, Integral, Derivative Line Following

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. October 5, 2013 Proportional, Integral, Derivative Line Following

  2. Welcome and Introductions

  3. Line Following • Why is line following useful in FLL? • Wide black lines with surrounding white area can be used for successful navigation. • Light sensor is preferable to color sensor due to: (a) higher resolution, and (b) ability to calibrate. • As with all line following, steering the robot is accomplished by independently controlling the power of the left and right motors. The motors work to keep the light sensor at the edge of the line.

  4. What is PID? A PID (Proportional, Integral, Derivative) controller is a common technique used to control a wide variety of machinery including vehicles, robots, and rockets. A PID controller compared to a standard 2 and 3 level line follower. The x - axis is the light sensor reading. The y - axis is the amount of turn. Note that the threshold for the 2 level and 3 level line following is 50. PID

  5. We will construct a PID line follower which… • Moves the robot forward. • Uses light sensor in port 2 to follow the line. • Follows the left-hand-side edge of the line. 2 B C

  6. PID Pseudocode – Initial variables to be used • Let “Kp” = some number • Let “Ki” = some number • Let “Kd” = some number • Let “Tp” (target power) = some power level • Let “Integral” = 0 • Let “Derivative” = 0 • Let “Last Error” = 0

  7. Pseudocode – some calculations to perform • Reset rotation sensor B • Begin Loop • Let “Error” = light sensor intensity reading – (minus) 50 • Let “Integral” = “Error” + (plus) “Integral” • Let “Derivative” = “Error” – (minus) “Last Error” • Let “PTerm” = “Kp” x (times) “Error” • Let “ITerm” = “Ki” x (times) “Integral” • Let “DTerm” = “Kd” x (times) “Derivative” • Let “Turn” = “PTerm” + “ITerm” + “DTerm” • Let “Turn” = Turn / (divided by) 100 • Let “PowerB” = “Tp” + (plus) “Turn” • Let “PowerC” = “Tp” - (minus) “Turn” • Let “LastError” = “Error”

  8. Pseudocode – establish power levels • If “Power B” > 0, then motor block B forward unlimited at “Power B” power level, • else motor block B reverse unlimited at negative “Power B” power level but with direction or movement reversed (We want a negative number to mean that the motor should reverse direction. But the data port on a NXT-G MOTOR block does not understand that. The power level is always a number between 0 and +100. The motor's direction is controlled by a different input port. Negative motor power needs to be made into a positive number and the motor direction needs to be reversed on the control panel • If “Power C” > 0, then motor block C forward unlimited at “Power C” power level, • else motor block CB reverse unlimited at negative “Power C” power level but with direction or movement reversed • End Loop • Stop Motors C and B

  9. PID Calculations for “P”

  10. Questions?

More Related