Read an Excerpt
Hopper is a four-legged robot designed to move in a loping, hopping motion. Unlike most robots with legs, Hopper's design is extremely simple, which makes it an excellent starter project, and its unique gait makes it a fun robot to play with and program.
I spent quite a while trying to select an appropriate name for this robot. Having rejected such names as FleaBot, Skipper, and even Dennis (the Hopper), simplicity won out. Sometimes naming a robot can be the most difficult part of the invention process.
Hopper's hopping action is generated by the spinning action of the large pulley wheels, which drive the legs down and back, then retract them quickly. Although Hopper doesn't actually leave the ground on each hop, it does drive itself forward, and even has the ability to turn left and right. Positioning the weight correctly is crucial to achieve the desired hopping motion: Place the heavy RCX brick too far forward and there is too much weight on the front legs for Hopper to move; place it too far to the rear and the robot will flip onto its back.
Programming Hopper poses an interesting challenge. In order to hop forward, the legs need to move synchronously despite the fact that the motors run independently. You can synchronize the legs by simply allowing a small rest time between movements, during which the robot's own weight will return the legs to the resting state before starting movement again. If you're programming using the NQC (Not Quite C) programming language, use the Float command in place of the Off command. Float allows the motors to turn freely when they are turned off, which lets the legs return to the resting state in about half a second. If you program using the LEGO RCX language, allow at least a second or so between movements because the motors tend to resist turning.
The program for Hopper is designed to let it hop around the RIS Test Pad, following the black oval and hopping on the green rectangles. Due to the way the legs move, Hopper will only work on a smooth surface, so the Test Pad is an excellent place to let it roam. You can download the Hopper program from the Syngress Solutions Web site (www.solutions.com/syngress).