Free Programming Books
Free download ebooks on computer and programming

Free Ebook "Dave Baum's Definitive Guide To LEGO MINDSTORMS, Second Edition" Sample Chapter

Guide To LEGO MINDSTORMS
Chapter 13, from Dave Baum's Definitive Guide To LEGO MINDSTORMS
Download chapter

The LEGO MINDSTORMS Robotics Invention System kit enables anyone to build programmable robots with an assortment of LEGO pieces that snap, slide, and click into place. In this exciting second edition from MINDSTORMS expert Dave Baum, you'll be able to take your robotics experiments to a new level.

Baum takes you step-by-step through the entire process of building and programming MINDSTORMS robots using both LEGO's RCX code and the author's own, more powerful programming language, Not Quite C (NQC). This edition has been updated with new programs that take advantage of the LEGO MINDSTORMS Robotics Invention System 2.0 and includes instructions for building 14 different robots including Tankbot, Bugbot, and Brick Sorter.

With Definitive Guide to LEGO MINDSTORMS, Second Edition, you will master the challenging yet always fun creation of your own robots from the ground up!

< < prev next > >

Steerbot

Many of the previous robots have been based on the tread-driven chassis introduced with Tankbot. Although such designs are easy to build and program, they are limited by the size and traction of the treads themselves. This puts a practical limitation on the size and speed of robots that can be built with the standard LEGO treads. In this chapter, we will construct a faster robot using a new steering mechanism. In addition, proximity detection will be used (instead of physical bumpers) to avoid obstacles.

RACK AND PINION STEERING

In the real world a different steering mechanism, known as rack and pinion steering, is much more common. In fact, it is the same mechanism used in virtually all automobiles. Rack and pinion steering provides complete flexibility on the shape and size of tires, thus it is often a good choice for vehicles that do not perform adequately with tracks. In the case of Steerbot, the steering will be done by the front wheels, and the drive train will power the rear wheels. Other combinations are also possible-forklifts often steer the rear wheels, sport utility vehicles power all four wheels, and some cars even provide four-wheel steering-however, the basic principles are the same.

When driving straight, a vehicle's wheels are parallel to one another. In order to turn, the front wheels are angled slightly. In a sense, this angle aims the front of the vehicle to the right or left. As long as the wheels remain angled, the vehicle will continue to turn.

In order for the wheels not to slide, the outside wheels must turn slightly faster than the inside wheels. This is the same effect that we exploited in the track-based designs, but this time cause and effect are reversed. Whereas before we changed the speed of one side in order to cause a turn, now the turn (which is caused by the angle of the wheels) will cause a difference in speed to be required. Even if we were willing to use two motors (one for the right-rear wheel, and one for the left-rear wheel), the required difference in speed depends on the sharpness of the turn and is rather complicated.

The solution involves using a differential, which was described in Chapter 4. We can use a motor to turn the shell of the differential. The differential functions by distributing power to both wheels in such a way as to minimize the overall friction. When driving straight, this means that both wheels will turn at the same speed. When turning, however, the inside wheel will turn slightly slower than the differential shell, and the outside wheel will turn slightly faster. This variation in speed will happen without any direct intervention-the only thing we need to do is spin the differential itself.

CHASSIS CONSTRUCTION

Steerbot is mechanically the most complicated robot so far, but if you look carefully you will see the same familiar techniques employed on earlier robots. The only truly unique portion of Steerbot is the rack and pinion steering. LEGO manufactures several specialized pieces that can be used to easily build a compact rack and pinion mechanism. Unfortunately, the RIS set does not include all of the necessary pieces, so we will have to use a little creativity and build the mechanism from scratch.

Figures 13-1 and 13-2 show the initial construction of the chassis, including a differential and the special brackets used to mount a motor. The new pieces near the front of the frame (left side of the illustration) are something of a "hack." This is the area where the rack will need to slide back and forth; thus a smooth surface is required. Ideally, a couple of tiles (plates without studs on top) would be used. Since the Robotics Invention System doesn't include any regular tiles, these odd pieces are used instead.

The motor (with a crown gear attached) is shown in Figure 13-3, slid into position in Figure 13-4, then locked in place in Figure 13-5. The crown gear is a 24-tooth gear with curved teeth that allows it to mesh at a right angle with another gear (see Chapter 4 for a more detailed explanation of the crown gear). The gearing between the motor and differential may appear a bit odd. The motor turns a crown gear (24 teeth), which meshes with an 8-tooth gear for a 3:1 reduction.

This 8-tooth gear then meshes with the 24-tooth side of the differential for a 1:3 gear ratio. The resulting ratio is simply 1:1. So why not skip the 8-tooth gear and mesh the crown gear directly with the differential? In order to do this, the crown gear would need to be moved closer to the differential. Unfortunately, at such close proximity, the center of the crown gear would collide with the shell of the differential. By introducing the 8-tooth gear, space is added between the crown gear and the differential without altering the overall speed and power (aside from a minor amount of friction).