(Digital Extremities home page)

LEGO Robotics and Medibotics

This course is based on the idea that you can learn a lot and also have a lot of fun by building and programming Lego robots.

Current Events Sources for Robotics

IEEE Robotics Blog, good stuff and links to more good stuff
Science Daily's Robot News
MIT News Office: Robotics/Artificial Intelligence
AAAI's Robot News
Try Google News for Medical Robotics. Don't just take the first one, look through a page or two and find something interesting.

Other Labs

Here are some labs I've written up and tried, but that are not currently part of my course:

Tug of War
Relay Race

Here are two worksheets based on Robot-C, a more flexible but more challenging alternative to NXT-G programming, based on the C language:

Robot-C introduction
Some Robot-C programming challenges

Great Robot Videos

Yellow Drum Machine cutest robot ever?
Sumotori Dreams inexplicably funny.
Sony QRIO dancing.

Welcome!

This site contains the assignments, project handouts, and background material that I use in the Lego Robotics class I teach to high-school juniors at AAHS. It was inspired by a program I've been involved with at NJIT called Medibotics: The Merging of Medicine, Robotics and IT, using Lego NXT robotics as a stepping-off point for teaching concepts in anatomy and medicine, math, physics, and programming. Students work in groups of two with a single NXT kit (with one group of 3 if necessary) so there's some substantial teamwork challenges as well.

This course meets every other day for one marking period, which works out to about 22 sessions and roughly 33 hours of classroom time. That's not enough time to turn the kids into experts, but it seems like enough to get many of them excited about the possibilities. Here's the sequence of topics, with labs and assignments, that we do over that time. Labs 1 and 2 are based on activites from NJIT, and lab 3 is based on one from CMU:

  1. Assignment 0: Current events in robotics
  2. Assignment 1: What is a robot?
  3. Assignment 2: What cool things have people done with Lego NXT?
  4. Lab 0: Following a line
  5. Lab 1: Around the paper, around the plate
  6. Lab 2: Sense, plan, and act: bypass surgery using the light sensor
  7. Lab 3: Exploring the ultrasonic sensor's field of view
  8. Assignment 3: Engineering Design, Shai Agassi and "Better Place"
  9. Lab 4: Sumo

Another major goal of the course is to help students develop a "guy under the car" mindset. To me, this is the most important benefit of this topic.

Assignment 0: Current Events

Every student has to write up and turn in three robotics-related current events over the duration of the course, about one every three weeks. He or she has to find an current robotics-related news story, and write two paragraphs about it. The first paragraph is a summary of the article, and the second paragraph tells why the student found it interesting. In addition to the written portion, the student must also briefly tell the class about it.

Assignment 1: What is a Robot?

The first assignment (due on the 2nd class day) is to turn in a written definition of a robot that the student likes and understands, along with an APA citation for its source. I am only interested in mechanical robots, not "web-based robots". Then give me examples of 2 complex machines that ARE robots according to this definition, and 2 other complex machines that are NOT robots according to this definition. For each of these 4 examples, explain why it is or is not a robot.

Assignment 2: What Cool Things Have People Done With Lego NXT?

The second assignment (due on the 3rd class day) is to use the web to find something interesting that someone out in the world has done with Lego robotics – either NXT or the previous version, RCX. You will write up a description of what the robot does, and as much as you can find out about how it works – what kinds of movements it makes, what sensors it uses and why they're used, what language it is programmed in, and so forth. The writeup must include at least one picture of the device, and references to whatever sources were used, in APA format. Use your own observations and deductions from photos or videos as well as any published description.

Grading for this assignment is based on how cool the thing is and how thoroughly you described it. I am the sole judge of robotic coolness, and one of the dimensions of coolness is to not come up with the same thing as everyone else.

Lab 0: Following a Line

This "lab" is not graded, and there's nothing to turn in. The goal is to immediately get the students building a robot that does something interesting, and to start to get some familiarity with the NTX-G programming environment. The student's instructions are to construct the standard Lego "Tri-Bot" by following the steps on pages 8 thru 22 of the NXT instruction book (steps 1-17), and then add the light sensor as details on pages 32 thru 34 (step 22). I demonstrate the basics of NXT-G, and the students recreate this line-following program that I give them: NXT-G line follower program They need to pick appropriate values for the motor block power settings to make the robot track the line reasonably well. The line here is a swervy line of light masking tape, on a dark carpet.

Lab 1: Around the Paper, Around the Plate

This lab introduces the students to real-world issues of planning, measuring, and reproducibility of results. It is also a good lesson in geometry and spatial reasoning. The handout sheet is here. It's just about impossible to get this lab completed perfectly, and realizing that is an important part of the lesson. Don't beat this one to death, they'll get most of the value of the activity in one or two periods.

Lab 2: Sense, Plan, and Act: Bypass Surgery Using the Light Sensor

This builds on the skills of Lab 1, but now the students create an autonomous robot that does coronary artery bypss surgery. Well, not really, actually it examines a pipe cleaner, and decides to either leave it alone (if it's red) or replace it with a red one (if it's black). The idea is that black pipe cleaners represent unhealthy arteries, and red pipe cleaners represent healthy ones. The handout is here.

This lab introduces the "sense-plan-act" model of robot operation, highlighting 3 basic capabilities required of any interesting robot:

  1. Sense: use sensors to detect and/or measure important aspects of the robot's environment.
  2. Plan: given the information from the sensors and any other available information, figure out what to do.
  3. Act: take the actions required to carry out the plan.

The lab writeup requires that the students write pseudo-code. Pseudo-code is. . .

Lab 3: Exploring the Ultrasonic Sensor's Field of View

For students to succeed with the Sumo project, it helps for them to have had some practice with the quirks of the ultrasonic sensor. This lab is based on one from CMU's Robotics Academy curriculum. Here is some simple background material to get you started. The project handout is here, and here is graph paper made using Excel, that might save you some grief.

Assignment 3: Engineering Design, Shai Agassi and "Better Place"

One of the goals of this class is to give students an appreciation of the engineering design process, the repeated sequence of brainstorming, research, consideration of alternatives, prototyping, evaluation, and redesign. Or, as Henry Ford may have said, "Failure is simply the opportunity to begin again, this time more intelligently." In my experience, talking about this kind of thing is pretty ineffective, but that doesn't stop me from spending a few minutes going over some powerpoint slides on the topic. I also show this segment from CMU that talks about iterative design.

From there, I take a two-pronged attack. First, I have the students read about an incredibly difficult engineering problem, and the incredibly ambitious plan to tame it. Here is the actual assignment:

Carefully read the article "Driven: Shai Agassi's Audacious Plan to Put Electric Cars on the Road" from the September 2008 issue of Wired Magazine. From the link, click on the big "The Future of the Electric Car" picture to get to the article.

Write a description of Shai's proposal -- at least 2 full pages, double-spaced. Focus on the engineering and social problems that he is faced with, and his proposals for how to deal with them.

Please, don't write an editorial about global warming or sending U.S. oil money to unfriendly nations. Those things are incredibly important, of course, but that's not what I'm asking about in your paper. Concentrate on the specific technical, social, and economic challenges that have to be overcome to make this scheme work. (ex: keep constantly up-to-date information about charging stations that are in use, find a partner to build the cars, etc.)

Be concise but thorough. Don't give me a list, give me well-formed sentences and paragraphs. You are encouraged to find other sources of information about Agassi and Better Place to round out the story. In the months since this article came out, this project has grown and gained momentum. The New York Times magazine published a substantial article about Agassi in April 2009.

List any other sources you use beyond the Wired article at the end of your writeup, in APA format.

The other prong is to walk the students through the design process. That's what the Sumo project is about. Read on …

Lab 4: Sumo

The Sumo project is the highlight of the course, and takes about 40% of the total class time. The students basically walk through the engineering design process while trying to construct a Sumo warrior robot that can push another Sumobot out of a ring, without going out of the ring itself.

Here is the handout that I use in class. The project sequence is:

  1. With a partner, do research and brainstorming, and produce a planning document.
  2. Try to carry out the plan and produce your robot. Keep track of what happens in a construction diary.
  3. Have the sumo competition/party.
  4. Write up a post-mortem document on what happened

Sumo provides a natural opportunity to reinforce physics concepts like work and power, torque and angular velocity, and gears. Here is a powerpoint presentation that I use. I also like to demonstrate by building two robots, one powering the wheels directly from the motors and the other using a small gear on the motor to spin a larger gear on the wheel, decreasing the wheel's angular velocity and increasing its torque. I then race the robots agains each other, and then have them push each other head-to-head.

Most interesting Sumobots use at least two sensors: the light sensor to detect the edge of the ring, and the ultrasonic sensor to find the other robot. A reasonable piece of pseudocode would be:

# this is written in the style of the Python programming
# language -- lines that begin with '#' are comments
repeat forever:
  while ultrasonic sensor doesn't detect anything in range:
    spin around
    if light sensor detects the edge of the ring
      # don't go over the edge while spinning
      back up
  # when something IS in range, stop spinning and ram it!
  while light sensor doesn't detect the edge of the ring:
    go forward (to ram the other sumobot)
  # when we reach the border, that's far enough
  back up

Here is a NXT-G program that implements this: (Click on the image for a readable version)


Classroom Management

I expected it to be a nightmare to try to keep all the little pieces sorted out and with the right kits, but it actually hasn't been bad. Here is an excerpt from the handout I give on the first day:.

One additional rule for this class is that you are personally responsible for maintaining the integrity of your NXT kit. These kits are not cheap, and they have to last us for many years. We simply cannot afford any carelessness or sloppiness in handling the pieces, many of which are quite small. Everything must be carefully put away carefully in your group’s designated spot in the cabinet before you leave the room. The punishment is draconian: for the first offense, every member of your team who was in class that day will lose 1 point from their marking period grade. For the second offense, every member will lose an additional 2 points. For the third offense, the penalty will be an additional 3 points, and so forth. Obviously it will be in the interest of every member of every team to double-check one another’s work.

Every time I've taught the class, a few kids have lost one point, but no one has ever lost two. The biggest problem is kids leaving the USB cables in the computers. Sometimes I (or the custodian) will find pieces on the floor at the end of the day. There's no way to figure out where they came from. I collect them over the marking period in an Altoids tin.

On the last day of class, one of the activities is to do an inventory of every part in every kit, to see what all has been lost. It's a pain, but not a huge one. Each kit is inventoried with this form, which refers to part according to which tray compartment they belong to. If you can't tell what a part looks like from the description, Use the cardboard inserts that come with the NXT kits to sort it all out. This PDF shows the layout of the compartments in the trays.