PID line follower

anyone have an example PID algorithm code for line follower. i want it to study.

please help me

Did you see this:

previous_error = 0
integral = 0 
start:
  error = setpoint - actual_position
  integral = integral + (error*dt)
  derivative = (error - previous_error)/dt
  output = (Kp*error) + (Ki*integral) + (Kd*derivative)
  previous_error = error
  wait(dt)
  goto start

Pseudo code from: http://en.wikipedia.org/wiki/PID_controller

No PID algo was used in the document recommended by feiutm9898. However, in my opinion, we do not need PID controller for line follower... ON-OFF control or Bang-Bang control will do...


Downloadvlcplayer.org

thanks