Lego Mindstorms NXT



This was inspired by my daughter's constant requests for cups of tea to be delivered to her either in her bedroom or to the TV lounge.

Navigating accurately around a room is hard enough let alone going from one room to the next. So in order to better keep track of where the robot was I decided to use the grid of floor tiles as a guide.

The idea was to use two sensors to detect the joints between the tiles and then realign the robot at certain points. However it still had to travel straight accurately enough to cross over mats and carpets. Then it needed someway of knowing where it was and where it had to go next. I could have used the screen and buttons on the brick but decided this was too small and hard to see so built a 'dial' with the different possible destinations (K= kitchen, C=chair in TV room etc) and a large knob with a pointer. It also needed to be able to handle obstacles that may have been left in its path, or doors that had been closed, so I added two touch sensors and a large front bumper assembly.

Front Top


In order for the robot to work out how to get from point A to point B I divided the house into a grid made up of the floor tiles (even though there is carpet in some rooms). Each 'tile' was then set to 'Tile', 'Wall' or 'Mat' or to the predefined locations ('Chair', 'Kitchen' etc). This array was too large to hold in memory on the Brick so I split it into several pieces. These layouts were stored in files on the Brick using another program ('Saverooms.c').


I then wrote an 'A Star' algorithm so the robot could work out a path from where it was to where it had to get to. If it encountered an unexpected obstacle it would then back up to the last 'clear' tile and calculate a new path. When it arrived at its destination the recipient could remove the cargo, dial a new destination or send it back to the last location.


In order to correct its position the first thing it would do before leaving would be to centre itself on the tile it was in (assuming it was not on carpet). Then each time it changed direction such that it was travelling at right angles to the tiles, it would align itself with the edge of that tile. In this way it was able to travel a long distance and still arrive at the correct spot in the end. In general this worked pretty well although sometimes on longer runs it would get so far out of line that it would end up on the tile next to the one it should have been on which then threw all future calculations out the window.


Back Side with cargo
Rear with cargo Optional Remote


The Robot used a lot of sensors:


The HiTechnic Compass sensor to determine the approximate initial heading. I found I could not use this for navigation because there is a lot of metal in my house; the door frames for example are metal.

Two Touch sensors for collision detection.

Another Touch sensor for an input button. This meant I also needed the HiTechnic Touch Multiplexor.

The HiTechnic IR Link to control the Power Functions lift motor.

The HiTechnic IR Receiver for the optional Remote Control mode.

A Light sensor as one of the sensors to detect the joints between tiles.

The HiTechnic EOPD sensor which makes a really great light sensor as the other tile join detector.

The HiTechnic Colour sensor (V2) to detect the limits for the lift mechanism.

With so many sensors I then needed the HiTechnic Sensor multiplexer.


Two NXT motors were used as drive motors, the third as a rotation sensor for the destination dial.


A small power functions motor was used to power the lift mechanism. At first I had just a Ball castor as a third wheel so that the robot could rotate about its own axis, but I found that when the ball went over a join between tiles it tended to sometimes 'throw' the robot off course. So I decided the easiest way around this was to add two rear wheels which I could lift off the ground when the robot needed to turn and then could be lowered when the robot needed to go straight. This slowed things down but worked well and speed was never a requirement of the design.


Then just for fun I added head lights, flashing lights, lots of sounds and the ability to override the automatic navigation and control it with a remote. All in all a pretty complicated project that required many many redesigns and a lot of testing but which actually worked really well in the end (even it it did sometimes seem to get totally lost for no apparent reason!)


Destination dial Underneath  

    Home    The NXT Step    Nxtasy    RobotC    Bricklink    HiTechnic    Mindstorms Home    Contact Me

LEGO, MINDSTORMS and NXT are registered trademarks of The LEGO Group.