Sumo purists will notice that instead of sticking with
traditional “metric” units, I’ve reverted to “English” units
when defining the SuGO class. As an Australian who grew
up with the metric system, it’s not that I don’t like meters
and grams, it’s just that most American kids don’t know
what they mean. It’s ironic that even the English don’t use
”English” units anymore. Too bad the colonists didn’t throw
them overboard with the tea.
Here are the resulting SuGO Class specifications:
• The Dohyo diameter is 36”.
•The robot must be made exclusively out of LEGO
•The only exceptions to this are batteries and IR eyes.
•The robot may only use the following electrical parts:
— 1 RCX Brick with batteries.
— Up to three LEGO motors.
— Up to two light sensors.
— One set of DROD40 eyes.
— One touch sensor.
— Interconnecting cables as required by the motors
•The maximum robot size is 6” x 6” x unlimited
• The maximum robot weight is 1 lb, 8 oz.
Finally, Some Software
Once I’d decided on the class specifics, I had to work
on some programs. Embedded programming is my “thing,”
so I was looking forward to this.
During the experimental SuGO matches, it was quite
common for the robots to get locked together and either
bog down or circle the table in a very non-dancing-with-the-stars kind of way. To keep things interesting, I needed to
Figure 2. The GEARS color scheme is “Sponge Bob Yellow,” so your
energy level peaks just by entering the room. The electrical parts
are seen in the foreground and are controlled by the event
coordinator. Teams are given a basic kit of electrical parts when
they register; this includes the pre-programmed RCX, two motors
with leads, a line sensor, and a set of IR eyes. The bulk of the
remaining LEGOS are laid out on a 4x8 table in the center of the
room and are up for grabs.
58 SERVO 11.2008
restart matches quite often. The problem was that my initial
SuGO program demonstrated the classic Sumo behavior:
Go forward until you either see the white line or see the
opponent. If you see the line, back up and turn. If you see
the opponent, turn towards it and push! Unfortunately, it
didn’t know how to get unstuck from another robot.
What I needed was some method to break a deadlock
between the robots, and to implement that method; I
needed a better language. So, I got back on Google and
discovered NQC (Not Quite C) and the Brickx Command
Center. These two tools let me get back into my
programming comfort zone and think in terms of
functions, tasks, and variables rather than sub-VIs and
What I ended up with was a system whereby the robot
keeps track of how long it’s been doing the current action,
and if it gets stuck doing the same thing for too long, it
backs off and makes a random evasive maneuver. This is
implemented as two tasks: A “Move_Sugo” task that deals
with normal Sumo behavior; and a “Deadlock” task that
kicks in to break an obsessive behavior.
In the end, the implementation was pretty simple.
A number is assigned to each action the robot takes in
response to sensor input (e.g.: turning away from the
whiteline sensor is action 1; turning left based on the left
eye is action 4, etc.). The Move_Sugo task is responsible
for polling the sensors and taking the appropriate
action (setting the motor speeds, etc.). It then sets an
“Action” variable to indicate what action the robot is
The Deadlock task runs in the background watching
the Action variable. Whenever the variable changes to a
new value (indicating a new action), the task clears a timer
back to zero. However, if the timer ever reaches a certain
value (called BREAK_DEADLOCK), then it’s time to break
things up. The Deadlock task shuts down the Move_Sugo
task and drives the robot through a random avoidance
motion. Once that’s complete, it resets the timer and
restarts the Move_Sugo task. Just for fun, the robot plays
a tune to let everyone know that it’s not giving up, it’s just
getting a better grip.
Since the RCX brick has five program slots, I configured
four SuGO strategy programs and one test program. (All
five programs may be downloaded from the SERVO website
The four SuGO programs are almost the same except
for the type and duration of turns that are made. Whereas
a tankbot needs to use full differential steering, a
speedybot needs to keep one wheel stopped when turning.
The programs are called Elephant, Rhino, Lion, and Cheetah
to help the kids figure out which program they should use
based on their robot’s own characteristics.
The test program (or Mechanic) is used to verify that
all the robot’s cables are plugged in correctly and that the
motors are running in the correct directions. It directs the
robot through a sequence of motions that let you isolate
any problems, and then makes noises based on what the
various sensors see. Trust me, a set of eyes that are