Desktop Line Following RobotRecentlymany kind of robot contests have being opened and some interestingreports of the challenge are found on the web. The Line Following isone of the robot contests to vie running speed on the line. I build atiny line following robot which can run on the desk. It is for only apersonal toy reduced its size to less than one fifth compared totypical line following robots, not in formula. But I believe that it issuitable for in-door use in the small Japanese houses said that rabbitburrow...(^_^;. Of course I have no time to appear the robot contests :-
About Line FollowerTheline follower is one of the self operating robot that follows a linethat drawn on the floor. The basic operations of the line following areas follows:
1. Capture line position with optical sensorsmounted at front end of the robot. Most are using several number ofphoto-reflectors, and some leading contestants are using an imagesensor for image processing. The line sensing process requires highresolution and high robustness.
2. Steer robot to track the linewith any steering mechanism. This is just a servo operation, any phasecompensation will be required to stabilize tracking motion by applyingdigital PID filter or any other servo algorithm.
3. Control speedaccording to the lane condition. Running speed is limited duringpassing a curve due to friction of the tire and the floor.
Thereare two line styles, white line on the black floor and black line onthe white floor. Most contest are adopting the first one in line widthof between 15 and 25 millimeters.
HardwareMechanicsRightimage shows bottom view and side view of the built line followingrobot. All mechanical and electrical parts are mounted on a protoboard, and it also constitutes the chassis.
The line following robotis upheld in three points of two driving wheels and a free wheel. Thedriving wheels are made with a 7 mm dia ball bearing and a rubber tire.The free wheel is a 5 mm dia ball bearing attached loosely. To drivedriving wheels, two tiny vibration motorsthat used for cellular phone, pager or any mobile equipment are used.Its shaft is pressed onto the tire with a spring plate, the outputtorque is transferred to the wheels.
The steering mechanism is realized in differential methodthat steer the robot by difference in rotation speed between the leftwheel and the right wheel. It does not require any additional actuator,only controlling the wheel speed will do.
ATmega8 is used for the controller and it is powered by a lithiumcoin cell. The other lithium coin cell is for only motors. Separatingthe power supply into two cells is to avoid accidental reset of themicrocontroller due to voltage dip by motor current. Sixphoto-reflectors are mounted at front end of the chassis. They sensereflection rate of the floor under them. Motors are driven in PWM tocontrol rotation speed linearly. The latest circuit diagram is here.
SoftwareUsing photo-reflectorsTodetect a line to be followed, most contestants are using two or morenumber of photo-reflectors. Its output current that proportional toreflection rate of the floor is converted to voltage with a resisterand tested it if the line is detected or not. However the thresholdvoltage cannot be fixed to any level because optical current by ambientlight is added to the output current like the image shown right.
Mostphoto-detecting modules for industrial use are using moderated light toavoid interference by the ambient light. The detected signal isfiltered with a band pass filter and disused signals are filtered out.Therefore only the moderated signal from the light emitter can bedetected. Of course the detector must not be saturated by ambientlight, this is effective when the detector is working in linear region.
Inthis project, pulsed light is used to cancel ambient light. This issuitable for arrayed sensors that scanned in sequence to avoidinterference from next sensor. The microcontroller starts to scan thesensor status, sample an output voltage, turn on LED and sample againthe output voltage. The difference between the two samples is theoptical current by LED, output voltage by the ambient light iscanceled. The other sensors are also scanned the same above in sequence.
Above image shows the actualline position vs detected line position in center value of 640. Themicrocontroller scans six sensors and calculates the line position byoutput ratio of two sensors near the line. Thus the line position canbe detected linearly with only six sensors. All the sensor outputs arecaptured as analog value that proportioning to reflection ratio, andthe sensitivity have variety between each one of them. In this system,to remove the variations from the outputs, calibration parameters foreach sensor can be held into non-volatile memory. This can be done withonline mode.
Tracking controlTheline position is compared to the center value to be tracked, theposition error is processed with Proportional/Integral/Differencefilters to generate steering command. The line following robot tracksthe line in PID control that the most popular algorithm for servocontrol.
The proportional term is the common process in the servosystem. It is only a gain amplifier without time dependent process. Thedifferential term is applied in order to improve the response todisturbance, and it also compensate phase lag at the controlled object.The D term will be required in most case to stabilize tracking motion.The I term is not used in this project from following reasons. The Iterm that boosts DC gain is applied in order to remove left offseterror, however, it often decrease servo stability due to its phase lag.The line following operation can ignore such tracking offset so thatthe I term is not required.
When any line sensing error has occurredfor a time due to getting out of line or end of line, the motors arestopped and the microcontroller enters sleep state of zero powerconsumption.