Computer Science 014
LEGO Robot Engineering

Williams College
Winter 2007


Lab 2: The Robot Base
Due: 10:00 AM, Friday, January 5, 2007


In this lab you will build the robot base. You may follow the design for the Handy Bug as described in Martin's Robotic Explorations, beginning on page 28. You may, of course, come up with your own design, as long as your robot is capable of performing the required tasks.

Your robot should have two wheels, each driven by a motor that is centered under the mass of the robot. You may need additional, unpowered wheels for balance. You should include enough space for the Handy Board and for mounting sensors in front and in back. In particular, you should mount two touch sensors on the front of the vehicle at this time. You may decide to modify your robot over the course of the month, but you should try to come up with a lasting design.

The major goals for this base are robustness and driving control. Your robot should be able to move straight as well as quickly turn to the left or right. The smaller the turning radius it has, the better.

To test for robustness, you should be able to drive your robot around and sustain repeated mild collisions with walls without serious disintegration. Your base should feel solid, not flexible.

To achieve good driving control, make sure that the drive wheels are even with each other and that the axles are well-supported. Be sure that your gear assemblies don't have too much or too little play in them. You should gear down the motors to get a good balance between speed and torque. Faster robots are more exciting, but harder to control. You're welcome to add nifty aesthetic elements, but it's best to do so only after your base is driving reliably.

Testing the Robot Base

I have provided you with a program that you can download to your Handy Board in order to test your robot base. The program is in the file baseTest.c and can be found on each lab Mac in /usr/mac-cs-local/share/cs014/labs/base/baseTest.c and here.

Copy the file baseTest.c to a folder in your own account.

Start up Interactive C as you did last time, and open the file baseTest.c. Note that the program defines the left motor to be the one connected to motor port 3 and the right motor to be connected to motor port 1. Also, the test program assumes that the left and right digital sensors will be connected to ports 11 and 14, respectively. Either make sure that your motors and sensors are connected in this way, or modify the program accordingly.

To do the test:

  1. Connect the Handy Board to your computer and turn it on (if you haven't already done so).
  2. Download baseTest.c by clicking on "Download". If you need help with this step, please ask.
  3. Turn the Handy Board off, and disconnect it from the Serial Interface Board (i.e., unplug the phone connector from the Handy Board). Now place it on the base you have constructed. Make sure that you've attached the motors and touch sensors to the board.

Now place your robot on the floor, turn it on, and get ready to test it. To start the test, press the "Start" button on the board.

The robot should move forward, turn right, and turn left. It should then spin to the right and spin to the left. It will repeat this process until the "Stop" button is pressed or the robot hits an obstacle (as detected by one of its touch sensors).

There is a very good chance that it will not work as expected the first time. For example, you might find that the wheels are moving backward, rather than forward. If this is the case, then unplug the problematic motor from the Handy Board, and plug it in again, reorienting the pins in the opposite direction.

You will need to demonstrate your robot's correct behavior for this test by the start of tomorrow's meeting.