Society of Robots - Robot Forum

Software => Software => Topic started by: andreahmed on March 20, 2008, 03:38:15 PM

Title: PID Line following !
Post by: andreahmed on March 20, 2008, 03:38:15 PM
Hi, I used only P control to make a line follower robot , which is like if (000001) do pwm on the faster wheel .. i think that's only P control , at fast speed i found my robot overshoots and crawls over the line , and after searching i found that i need to add the D term to compensate for that shoots .. how do i implement the idea in C code ? i already read the tutorial here about pid but its only for motors ...
Title: Re: PID Line following !
Post by: hazzer123 on March 21, 2008, 04:03:17 AM
Derivative is implemented into microcontrollers by finding the difference between consecutive input values, multiplying them by a suitable derivative constant, and adding it to the output.

To learn why PID works see this link - http://www.embedded.com/2000/0010/0010feat3.htm (http://www.embedded.com/2000/0010/0010feat3.htm)

And to find out how calculate the most efficient constants, search google - http://www.google.co.uk/search?q=pid+tuning&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-GB:official&client=firefox-a (http://www.google.co.uk/search?q=pid+tuning&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-GB:official&client=firefox-a)

Harry