Kemmel - Combining Line Following and Formula 1
Posted: 08 Apr 2011, 16:53
Being a big fan of Lego NXT robots, and Formula 1, I thought building line following robots that race at high
speed (relatively speaking), change lanes, and make pit stops would be a great project. It first turned into a great
challenge, then a MOC for BrickFair. The attached zip file contains my NXC program and text files with a description
of my race track. The file Kemmel_Read_Me_R02.txt gives more details of what is in the various files.
Videos of a high speed pass and pit stops are at and shown below
<http://www.youtube.com/watch?v=r8zh20PsiAI> - shows lane changing.
<http://www.youtube.com/watch?v=awrkmwdM1jc> - shows robot details.
<http://www.youtube.com/watch?v=H0g7U_GRUKc> - shows robots making pit stop.
For the robots, I started with the idea that I wanted a very stiff chassis to improve handling and thus improve line
following. Having 2 caster wheels at the rear resulted in a stiffer chassis and the sensors remaining vertical.
Combining ideas from several web sites and NXT books resulted in a working design. The robots use a color sensor
to read color markers on the track and a light sensor for line following.
I started with NXT-G, but this proved to be too slow, and couldn't handle all the choices at various points in the
program. Using NXC, I was able to write a multi-threaded program that executes fast enough. One thread monitors
the color sensor that reads the color markers on the track. This thread interprets the color marker, and writes an
action in a circular queue. The second thread thread monitors the light sensor, reads actions from the circular
queue (producer / consumer model), and controls the drive motors.
Although I'm very familiar with 'C' programming, and traditional (castle, space) Lego building, I'm a novice to NXT
robot building, so feedback is very welcome. One problem that I am still working on is wobble / over correction on
line following with the large wheel robot at high speed.
For anyone coming to BrickFair 2011, my 8 ft x 23 ft racetrack will be open to all registrants' robots for several hours each day.
Howard - TabbyCat Robots
speed (relatively speaking), change lanes, and make pit stops would be a great project. It first turned into a great
challenge, then a MOC for BrickFair. The attached zip file contains my NXC program and text files with a description
of my race track. The file Kemmel_Read_Me_R02.txt gives more details of what is in the various files.
Videos of a high speed pass and pit stops are at and shown below
<http://www.youtube.com/watch?v=r8zh20PsiAI> - shows lane changing.
<http://www.youtube.com/watch?v=awrkmwdM1jc> - shows robot details.
<http://www.youtube.com/watch?v=H0g7U_GRUKc> - shows robots making pit stop.
For the robots, I started with the idea that I wanted a very stiff chassis to improve handling and thus improve line
following. Having 2 caster wheels at the rear resulted in a stiffer chassis and the sensors remaining vertical.
Combining ideas from several web sites and NXT books resulted in a working design. The robots use a color sensor
to read color markers on the track and a light sensor for line following.
I started with NXT-G, but this proved to be too slow, and couldn't handle all the choices at various points in the
program. Using NXC, I was able to write a multi-threaded program that executes fast enough. One thread monitors
the color sensor that reads the color markers on the track. This thread interprets the color marker, and writes an
action in a circular queue. The second thread thread monitors the light sensor, reads actions from the circular
queue (producer / consumer model), and controls the drive motors.
Although I'm very familiar with 'C' programming, and traditional (castle, space) Lego building, I'm a novice to NXT
robot building, so feedback is very welcome. One problem that I am still working on is wobble / over correction on
line following with the large wheel robot at high speed.
For anyone coming to BrickFair 2011, my 8 ft x 23 ft racetrack will be open to all registrants' robots for several hours each day.
Howard - TabbyCat Robots