30/11/06
Fun and games last night. Bradley Robinson (who absolutely refuses to have his photo taken) bought a Lego Mindstorms NXT kit. Brad has had it a few days before I had a chance to see it. When I first saw it it was configured as a walking bi-ped, though it more a shuffle than a walk. The system has four sensors:
- Ultrasonic distance and movement sensor
- Sound sensor, with sound pattern and tone recognition
- Light sensor, detecting light intensity
- Touch sensor (press/release/bump detection)
and also three servo motors with rotation sensors.
After some discussion, food, and music, we decided to revisit our Bilby Competition days, where in Newcastle in 2000 we won 2nd place in the competition with "Little Jim", an autonomous path following robot.

From Left: Ian Peacock (Dad), Trevor Peacock (Me), Bradley Robinson, John Dietsch (Teacher)
The NXT kit comes with a paper "field" with lines and patterns printed on it for testing and sensing. Printed on this field is an inch-wide oval circle. Using this path and the single light sensor we started to build our robot.
Much of the challenge was similar to the original bilby, determining the best sensor placement, and adjusting sensor sensitivity. An additional problem encountered due to the single sensor was the fact that while correcting the robot would miss the path if it was moving too quickly. After several attempts to increase the accuracy of the sensing (trying to sense more quickly) the final solution was simply to slow down the motors.
A further limitation was the programming interface, a graphical interface with simple programming constructs. It took some re-arrangement of our logic to code. The pseudo-code:
WAIT UNTIL (2 seconds pass) OR (sensor sees black)
required re-factoring as:
LOOP 20 times:
if sensor sees white:
WAIT 0.1 seconds
The language does not allow the use of any sort of variable or constant, re-usable functions of any type, or multi-parameter tests (with ORs or ANDs), but after some rearranging the few problems we found could be overcome.
After some research it seems there are several other programming interfaces available for the NXT. I haven't tried any, but of the ones I've found, the promising ones are:
- Bricx Command Centre, with available debugger
- NXT Python
- nxtC
The blog nxtacy has many links to other projects and seems about the best resource for the NXT hacker.
The practical result is, after 3 hours tinkering (before 1. flat batteries, and 2. sleep time) we had an almost functioning line following robot.
With any luck tonight we will have a chance to finish and fine tune it. I'll report back with the end results and programming ASAP.
This post is followed up by This Post.
Bilby Mark II (Part 1) -
Categories: