A Line Follower Robot (LFR) is one of the most important concepts in robotics. In this project we developed a platform that enables controlling the robot in 2 operating modes: A manual mode for robot maneuvering using joystick, and an automatic mode where the LFR comes into picture. The platform is controlled by the user with HTML-based GUI, where the LFR performance can be evaluated by several criteria.
Line identification is done using an array of five light reflecting sensors that are located as shown below:
Each sensor returns a value in the range [0-1000] that represents the amount of black it sees. It is common practice to use a formula where the sensors values are linearly weighted.
In order to evaluate the line position more accurately, each sensor value can be proportionally weighted according to its real location.
In this project, both methods were implemented.
The LFR consists of a Raspberry Pi and a Zumo 32U4 robot, connected by USB. The RPi runs an HTML-based GUI (Python) and communicates with the Zumo, that runs an Arduino sketch.
The PID controller produces speedDifference using the formula:
Three parameters were defined to evaluate the performance:
Average – average of line position samples.
SD – standard deviation of the samples.
Accuracy – percentage of samples within a predetermined range around the center.
These parameters were inserted to the performance formula:
The plots of the 3 performance evaluation parameters change in tune to the speed and the proportional gain.
After some system optimizations, such as transitioning from a linear method of sensors distribution to a proportional one and increasing the sampling rate, the shape of the performance plot has dramatically changed.
In order to achieve better results, the step response was optimized using a PID controller. The overshoot and the rise time were reduced to the minimal values possible.
Video - Auto mode control: Driving in auto mode, applying changes of speed and proportional gain (Kp) via sliders, examining effects on the line position plot and line sensors values bar chart.
LFR.-.auto.mode.control.-.Trim.2.mp4
Video - Sweeping over the line sensors: Presenting the dynamic line sensors barchart.