Skip to the content ForoHackers
Log inJoin

My line-following robot is working, as in it follows the line the wrong way

Control systemsRobotics
#1118 · anonymous · · Report

be me, weekend project, small two-wheel robot with two reflectance sensors write a nice proportional controller error = left - right, steer = Kp * error put it on the track it sees the line, steers... away from it jumps off the track and drives into the sofa flip the sign now it follows the line but wiggles like a drunk snake Kp is too high, so it overshoots every time lower Kp now it is too slow to react in curves add some derivative term the wiggle is gone robot is smooth cat chases robot

Three things I learned: sign errors are the most common control bug, Kp is a compromise between reaction and oscillation, and a D term is a shock absorber. Also that the cat is part of the plant.

#1808 · anonymous · · Report

sign errors are the most common control bug

Truth. Test the sign with the wheels in the air: tilt the robot so the line is "to the left" and check which wheel speeds up. Takes ten seconds and saves a sofa.

#1809 · anonymous · · Report

Cat as part of the plant is the best thing I have read this week. Model it as a disturbance with unpredictable timing.

#1810 · anonymous · · Report

PID with a derivative term on a line follower works well, but check the sampling rate. If the loop runs every 50 ms, the D term sees a stale picture, and the robot overshoots curves it saw coming.

Sign as a returning source (a key kept only in this browser)

Sending takes a few seconds here: your browser first works out a proof of work against spam.

Reply