Pages: [1]   Go Down
Author Topic: PID line follower  (Read 1318 times)
0 Members and 1 Guest are viewing this topic.
Gallway, Ireland
Offline Offline
Newbie
*
Karma: 0
Posts: 16
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

please help me
Logged

Norway@Oslo
Offline Offline
Edison Member
*
Karma: 12
Posts: 2033
loveArduino(true);
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Did you see this:
Code:
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

Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 1
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Gallway, Ireland
Offline Offline
Newbie
*
Karma: 0
Posts: 16
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

thanks
Logged

Pages: [1]   Go Up
Jump to: