.comment-link {margin-left:.6em;}

February 12, 2007

 

Robot Challenge No. 1 - Results and My Solution

Well, I've been very busy preparing my robot for the science fair it was for. The demonstration was last Friday, and after an initial period of setup that lasted too long, it was a success. My robot wrote kids' initials (usually one or two letters) about 50 times during a two-hour period complete with two battery changes.

My robot uses three motors, for X-axis, Y-axis and pen control (up and down). The whole robot moves like a car (with a long side-car) along the X-axis. At first it passes by a Lego wall that held a strip of paper with 26 bubbles. Each bubble had a different letter on it. Fill in the letter you want drawn, and a light sensor determines which bubble is filled in, and converts that to a number from 1 to 26. At the beginning of the strip is an alignment start mark. At the other end of the strip, past Z, is and end mark. The end mark can be narrow or wide. Narrow means to back up and wait for another strip that indicates the second letter to draw. The last letter is indicated on a strip with a wide mark.

When the last letter is read, the robot moves a little further down and starts writing on a piece of paper (or on the table, um, if there is no paper). Up to five letters can be drawn, though it is difficult to correctly read that many letters and end marks. I have done successfully that once.

The X- and Y-axis motion is controlled with two rotation sensor hooked up to the RCX. This makes it sound easy to go exactly where want to draw, but it isn't that easy! It took me two weeks of work on many evenings to get the program close to working perfectly. You must slow down the motors as you approach an ending position, or the motors will cruise past.

The programming is in NQC. The program is about 775 lines long, and compiles to about 6000 bytes, which almost fills the RCX's memory! When combined with a calibration program, and two programs to change the calibration manually up or down, there are only 10 bytes left!

As you can see from this movie (11M), it is now working pretty well. It can draw all 26 letters, and does an OK job on the diagonals. I'll try to post some other pictures and information when I have more time. Some slightly out-of-date pictures are in the gallery here.

As for the contest, I think I'll declare Mark the winner as I think he was the only one who submitted an entry on time that was made solely for this competition. Congratulations! That and a quarter will get you a cup of coffee (back in 1975, perhaps).

This page is powered by Blogger. Isn't yours?