Friday, February 23, 2007

I've added a map of my apartment, so that I can easily see where the robot thinks it is. The results graphically illustrates just how badly the compass is performing indoors. In the screenshot below, robot's measured path is drawn in red. The robot was actually traveling in a straight line from left to right:
The huge error was caused by a loudspeaker on the next room.

From this and other tests, it has become crystal clear that the compass is useless as it is currently being used.

My current plan is to measure the actual magnetic field at lots of points in a grid-pattern throughout the apartment. These robot can then use these measurements to figure out the correct heading based on the compass-reading and the robot's location.

To do this manually would take a loong time (since I need hundreds of measurements just to cover the most important areas). I therefore plan to have the robot do most of the work: I'll try to get the robot to drive along a laser beam while it records the compass-readings every few centimeters. This will result in very precise and fine-grained data, since the robot can measure the straight-line distance it has traveled to within the nearest centimeter.

Ideally, the whole apartment should be crisscrossed with a fine-grained grid of measurements, but that would take a lot of time to do. As first step, however, I only need to do the measurements along the path that the robot is expected to follow. To make a path between the living-room and the kitchen, for instance, I only need measurements along a handful of lines.

The required hardware:
The laser itself is easy to set up. A cheap keyring laser-pointer mounted on a piece of steel wire, or on some Lego will do nicely. I think I have a laser-pointer laying around somewhere.

The laser-detector on the robot might be more tricky. I'll first try to mount two light-sensitive resistors side by side at the front of the robot, separated by a few millimeters. The resistors will be connected to two of the microcontroller's analog/digital converter inputs. When the robot is on course, the laser-beam will hit between the two resistors, and both resistors will measure the same amount of light. When the robot starts to deviate from its course, the laser-beam will start to hit one of the resistors more than the other. The microcontroller will notice that the measurements of the two resistors are starting to differ, and can steer the front wheels accordingly.

Monday, February 19, 2007

In other news: My girlfriend has bought a 50" Pioneer plasma tv:
Nice girlfriend :-)

Friday, February 16, 2007

It' s been a while since my last posting, but I haven't been totally idle.

Firstly: the robot body has undergone yet another rebuild. I discovered that the wheels I used in the previous version wasn't robust enough to handle turning properly: The tires tended to get twisted off the rims. I've instead reverted to some smaller wheels with harder and wider tires. These have less grip than the others, but the robot still manages to climb over the door-sills. The robot chassis has also been completely rebuilt, since the previous one didn't feel robust enough. The new chassis consist of a box made up of interlocking beams, and feels much more rugged:



Secondly, I have received the bluetooth radio-module, and all the sensors that I ordered from Sparkfun. I've currently hooked up the radio, the compass, and a distance measurement wheel. I've also made a PC-program that communicates with the robot via bluetooth:
This program can be used to manually control the robot with a gamepad, and to display various status-information from the robot, like the current compass heading, battery voltage, etc.

So much for the fun stuff. I've learned a lot from this project, but one of the things I've learned is that a magnetic compass's are a hassle to work with.
1. The robot has to move relatively close to large speakers, which can totally confuses the compass (with up to 180 degrees).
2. The magnetic fields of the front-wheel motors are also a problem, since these motors are rotated when the front wheels are steered. This distorts the compass reading with up to ten degrees.
I'm not quite sure how to overcome these problems. It should be possible to compensate for the distortion caused by the robots own front motors, since the robot knows the angle of each of the front wheels. But problem (2) is harder. I might have to measure the magnetic field at several places in the appartment, so that the robot can compensate the measured heading with the known properties of the magnetic field at its current position.