Go Down

Topic: PID line follower (Read 1 time) previous topic - next topic

RuH_iranga

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

please help me

AlphaBeta

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


maxshelor

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


Go Up