PID controller for Line following robot help [Arduino]?

Post Reply
PraveenAlexis
Moderator
Moderator
Posts: 78
Joined: Wed Jul 20, 2011 3:06 pm
Location: Sri lanka,Wattala

PID controller for Line following robot help [Arduino]?

Post by PraveenAlexis » Wed Aug 26, 2015 6:28 pm

Well im making an arduino line following robot for a project, and i need some help with using a PID controller for the sensors.
Im a total beginner and i have no idea whats PID is and how to use that concept in the MCU code, if there is an example code anyone can provide is much appreciated :)

Thank you!
User avatar
Neo
Site Admin
Site Admin
Posts: 2642
Joined: Wed Jul 15, 2009 2:07 am
Location: Colombo

Re: PID controller for Line following robot help [Arduino]?

Post by Neo » Thu Nov 12, 2015 1:21 am

For a line following robot, I'm wondering whether it is really necessary to use a PID controller for the motors. You may use stepper motors to make it simple. PID controllers is a bit of an advance concept where each letter stands for Proportional Integral Derivative respectively. If you are using DC motors, it is essential to use a PID controller for smooth control of the robot.

As always wikiperdia article is a good starting point.
https://en.wikipedia.org/wiki/PID_controller

This is another good article that covers the theoretical background of the PIC controllers.
http://ctms.engin.umich.edu/CTMS/index. ... ControlPID

There is a Arduino library which you can directly use.
http://playground.arduino.cc/Code/PIDLibrary

Hope these will give you a good start.

PS: Sorry for the delay in answering the question. I missed it :)
PraveenAlexis
Moderator
Moderator
Posts: 78
Joined: Wed Jul 20, 2011 3:06 pm
Location: Sri lanka,Wattala

Re: PID controller for Line following robot help [Arduino]?

Post by PraveenAlexis » Thu Nov 12, 2015 11:01 pm

Hey thanks for the reply, well yeah its a bit late but thank you for the reply, i managed to use PID controller and it worked pretty smooth on the line but i had some issues while i was calibrating KP,Ki,Kd constants :roll:

i didn't use the arduino PID library instead i coded my own PID algorithm :)

ps : i can attach the code here for references :geek:
User avatar
Shenal
Moderator
Moderator
Posts: 29
Joined: Tue Feb 09, 2010 3:29 pm
Location: Wattala

Re: PID controller for Line following robot help [Arduino]?

Post by Shenal » Wed Nov 18, 2015 9:13 am

Well done Praveen
Sorry I couldn't help you.
Post Reply

Return to “Arduino”