Hints and Tips

About Lego Motors

The Lego motors are actually quite powerful little geared motors (although they do have plenty of inertia). The RCX commands the motors using an H-bridge motor controller. This means that a motor can be in one of four states: forward and backward (obvious), locked, or floating. A locked motor uses electricity to actively resist motion, whereas a floating motor is only slowed by friction. You can also program the RCX brick to change each motor's duty cycle to change speeds without totally stopping or floating the motors.


We have three types of lego sensors: rotation sensors, light sensors, and touch sensors. If the light sensors are mounted close to a surface (such as our newsprint), they can distinguish between different colors (like the two tones on the platforms and blocks). The light sensors are more invariant to changes in natural lighting when they are mounted closer to the paper or underneath the shadow of the robot.

Don't forget to tell the NQC what kinds of sensors you are using when you write your program. SetSensorType(SENSOR_1, SENSOR_TYPE_LIGHT);

Gear Ratios

This is just like your bicycle or your car. Remember: small gear driving a big gear gives high torque, low speed. Big gear driving a little gear gives low torque, high speed. Also, don't overlook belts and pulleys for doing various tasks.
Grippers and Motor Speeds

The reference design below features an excellent gripper design by Jason Geist. The gripper is quite controllable, but may rip itself apart if you drive it past its mechanical limits. In order to make sure the motor stalls out instead of breaking the robot, make sure you set the motor to have a low duty cycle: SetPower(OUT_A, OUT_LOW);

Weight and Balance

Because this is a manipulation task, your team will need to pay some attention to weight and balance. If your design seems to be unable to move around the foam block, or if you have trouble crossing over the gap, try redistributing the weight of your robot, relocating casters or skids, or fiddling with motor speeds. Also, feel free to ask an organizer for adivce.
Construction Ideas

Lego construction for robots might be a little bit different than how you use to build houses or spaceships with Legos as a kid. The main thing to remember is that it's usually better to assemble rigid frames of pegged-together Technic-style pieces than it is to simply stack Legos together using the normal Lego adhesion style (see an excellent introduction to the principles of good Lego Design and the definitive Art of LEGO Design by Fred Martin). Probably the most popular design is the differential-drive robot -- the robot described below is differential-drive.

Reference design

Take a look at the reference design we have provided for an example of how to assemble a robot and how to write code to drive the motors simply.

Programming Ideas

This example code demonstrates a basic approach to solving the year before last's task in NQC.You will need to do something completely different, but maybe this code will give you some hints about what can be done in NQC.