Chapter 19. Racing Against Time

Solutions in this chapter:

Introduction

This chapter explores the world of MINDSTORMS robotics contests and challenges. The information in this chapter is mainly based on direct experience, accumulated while participating in competitions organized by various organizations. Some of the competitions referenced in the following pages are routinely run in various locations. They include the following:

  • The Northeast Indiana Robot Games (NEIRG)February and August

  • Chicago Area Robotics (Chibots) competitionsMay and November

  • Central Illinois Robotic Club (CIRC)March

  • Lafayette LEGO Robotics Club (LafLRC) competitionsMay (typically)

  • HiTechnic sponsored competitionsAugust (typically)

  • BrickworldJune

  • RTL Torontoyear-round

This chapter won’t be discussing the specific details of the contests; instead, it provides you with a good starting point for more general considerations. But we do recommend that you look up the competition rules on the Web sites of the competitions listed and learn more about the variations for competitions that may sound simple, such as “line following.”

The first section of this chapter is about robotics contests in general. It explains what robotics contests are all about, from the definition of the rules to the course of competition. For those of you interested in participating in LEGO robotics contests, the chapter will give you some hints about how to find a LEGO Users Group not far from where you live.

In the later sections of the chapter, contests related to pure speed, as well as those demanding great amounts of mechanical and programming acumen, are introduced. There are many different kinds of contests and challenges. Because of this, they are grouped into three categories: contests based on speed, contests based on strength, and contests based on ability. These categories are not absolute, because most of the competitions require a mix of these capabilities. For example, a line-following contest is mainly about speed, but each robot is also required to run without veering too far from the line. Nevertheless, we tried to sort a few typical contests into the categories previously mentioned because in our opinion, this helps in focusing on their key points.

Hosting and Participating in Contests

A contest offers many opportunities to learn new concepts and build some experience. There are at least four main phases of participating in a contest, each one requiring extensive usage of your know-how while contributing to your knowledge base. They are:

  1. Defining the rulesParticipating in this phase depends on whether you are the one who organizes the contest, or you are part of a group that does. Unless you’re deciding on your own, this will prove to be a very creative moment, where the group develops a list of rules, adjusting them until it feels they are meaningful and consistent. A set of rules always has a specific purpose (whether declared or not), which has been chosen to test the ability of the competitors on a specific field. The “legislator” should take care to close any possible loopholes that might allow a contestant to escape the main difficulties of the contest, which requires that he or she imagine all the possible approaches to the problem. The rules should also try to ensure that the contest is fair to all competitors, regardless of their monetary resources. Luckily, most of the time, you don’t have to worry about defining the rules because you are a competitor, not a sponsor.

  2. Studying the rules and deciding on a strategyFrom this moment on, you are in the competitive arena, and you must find a strategy to beat your competitors. Don’t limit your choices to what the organizing committee expects you to do. In our experience, most contests have been won by people who found a very original way to interpret the rules without violating them. Don’t be afraid to find loopholes and take advantage of them. Visualize different solutions on your own and determine the pros and cons of how they comply with the rules.

  3. Building the robotThis phase will very likely present some surprises to you. Implementing your desired strategy, you’ll discover new constraints and opportunities you hadn’t thought of while imagining your robot. As for programming, we strongly suggest that you stay with simple but solid strategies. Only when you’re sure the basic behaviors work as expected should you add the more sophisticated components, making sure not to introduce bugs in the previous code. You won’t believe how many matches people win by keeping it simple!

  4. Attending the contestThis is the most exciting moment—on the field, testing your ability against your competitors! It’s also the moment to learn: Study the other robots and their strategies; observe the course of the matches. Don’t be frightened to ask for explanations and details; most of the builders are usually more than happy to describe their creatures. All that you learn will be useful for other contests, whether run on the same set of rules or not. One last suggestion: Never throw in the towel before the end, because anything can happen during the event. The strongest competitors aren’t always crowned the winners. Learn from each match. Would your robot do better if you moved its starting point or direction slightly while still complying with the rules? In a head-to-head competition, pay attention to other matches and learn how to best position your robot to beat other robots.

Use the Internet to search for other MINDSTORMS fans. One popular resource is the LEGO Users Group Network (LUGNET), which lists dozens of local groups. Many of them also have their own Web sites, which shouldn’t be difficult to find using any search engine. Once you’ve found a group, or some individual users, there’s no certainty that anyone’s going to leap up and organize a robotics contest from time to time. But you, yes you, can be the one to get the ball rolling (or robots, rather).

LUGNET is the best place to find information about contests of all sorts, as most local groups advertise the contests they organize there. Usually they refer you to a Web site where you can find all the details about the time, place, and rules of the contest. Some contests require a small admission fee for each robot, which funds the prize for the winner. Events are characterized by a very friendly atmosphere, and you’ll be welcomed even if you just go to watch and learn.

Optimizing Speed

The first challenge described here concerns pure speed. Don’t make the mistake of thinking speed is purely trivial and poses few challenges in terms of robotics. We’ve been proven wrong on this score ourselves. Even a straight-out speed race promises surprises.

Drag Racing

”A starting line; a finish line; the fastest robot to cover the distance wins.” Described in these terms, the race sounds boring. But stay tuned, and take a closer look at the implications of this definition.

The speed of a vehicle is affected by a number of factors: motor power, gear ratio, mass, and friction. Using electric motors, the maximum power you can apply to your race car depends on the kind and number of motors, and the current you supply them. With the addition of the new NXT motors, three types of motors are widely available. Also available are the traditional MINDSTORMS “gray” motors, as well as the black “RC Buggy” motors that are now available as a separate motor pack (LEGO set #8287) and as part of kits such as the yellow crane (LEGO set #8421). Of course, the rules of the competition will probably specify the allowed motor type and a restriction on power source.

For the purposes of this chapter, it is assumed that the competition limits the vehicle to two NXT motors and an NXT as the power source. Even with these limits, there are still many variables to consider in your design process.

The gear ratio and mass will have a strong influence on the acceleration rate of your vehicle; here is a short list of tips:

  • The shorter the gear, the shorter the time it takes to reach the maximum speed. The problem is that a short gear also has low top speed. You have to balance the two effects, and the optimal choice depends also on the length of the race: Favor acceleration on short tracks, and maximum top speed on longer ones.

  • Build your robot in a way that allows easy replacement of the gears, so you can experiment with different ratios in a time-efficient manner.

  • Keep the gearing pared down to the essentials. Remember that each stage adds some friction. There’s no need for a differential gear, because the dragster travels on a straight run.

  • The diameter of the wheels has its role in the conversion of power to speed. If you substitute the wheels of your car with ones half the diameter in size, you get the same effect as though you had reduced the gear ratio by a factor of two.

  • Acceleration is also influenced by the mass you have to move: Under the same power, higher mass equates to lower acceleration. This is due to inertia (see Chapter 6), which explains why it’s harder to get a car rolling than it is to push a child in a stroller. So, a very important thing to do is to keep the mass at a minimum. Build a lightweight structure.

  • Another factor related to mass is the center of gravity of the vehicle. As with a top fuel racer that goes 300+ miles per hour, your vehicle should center the weight almost over the drive axle at the rear of the vehicle. The center of gravity should be just far enough in front of the rear axle to keep the vehicle from lifting its front wheels off the ground for a significant amount of time.

At this point, you haven’t yet considered the modes of operation allowed by the NXT.

Up to this point, the challenge is essentially electro-mechanical. There’s no need for an NXT; a vehicle supplied by a battery box would perform the same, or even better (recall that the RCX has an inner current-limiting device, and the battery box doesn’t). To create the necessity of at least a few lines of code, we suggest that the dragsters be run down a narrow corridor with a three-quarter-inch black line down the center. Just as top fuel dragsters need to stay in their lanes, our robotic counterparts will incur their own time penalty by bumping the walls. Of course, there will need to be a rule against the vehicle intentionally riding against the wall.

Combining Speed with Precision

When you move from races based on pure speed to those that require additional skills, your projects become more complex, and more than likely, the resulting vehicle will move slower. All the considerations listed in the preceding section still apply—batteries, motors, gear ratio, mass—but you must also take new variables into account. Speed will actually become whatmakes your task more difficult: When you design a robot for yourself, you usually feel satisfied when it works; but when you have to build and program it to be as fast as possible, some techniques that worked at a slower pace prove unsuccessful at higher speeds.

Sometimes you reach a point where you cannot increase speed without compromising the reliability of your robot. This is the time when a further improvement can come only from a paradigm shift, a change from one way of thinking to another. This principle can be summarized in a few words: Don’t set your heart on a particular solution. Try to look at the problem from different angles and keep your mind open to any idea, even those which initially seem strange or impractical may lead to a winning configuration.

Line Following

Don’t worry, this chapter doesn’t start discussing line following again! Jump back to Chapter 14 if you feel compelled to revise some of those concepts. Line following just couldn’t be ignored in a chapter that talks about races against time, because it presents many interesting discussion points.

If you are the one who decides the rules, don’t underestimate the importance of the details. State the number and kind of the allowed parts—motors and sensors in particular. More important, be very precise regarding the nature of the path, informing competitors about the width of the line and the minimum radius of the turns, the latter having a strong influence on the structure of the robots.

Line-following contests are usually judged by speed alone. Evaluating accuracy, though theoretically possible, is not a very practical option. However, if you want to try this option, you can use a paper pad and attach a pen to each robot so that they draw a line as they move. At the end of each run, measure the maximum distance between the course of the robot and the main line, and apply greater penalties to greater distances.

Line following allows for many interesting variations, including these:

  • Round tripWhen the line ends, the robots must return to the starting point.

  • Short interruptions in the line, specified by number and lengthFor the robots, it’s like hanging in midair for a while. The restart point of the line might even be offset from where the line broke.

  • Small obstacles to overcomeThe robots should detect these with bumpers, suspend line following, pass the obstacle, and resume line following again.

  • Obstacle removalSimilar to the preceding variation, except that objects of a specific size and shape must be removed instead of climbed over.

  • Specific robotic architectureSpecifying that a particular type of architecture be incorporated into the robot design. For example, all the robots must use legs instead of wheels.

Wall Following

Conceptually similar to line following, in this challenge, the competing robots must follow a wall instead of a line. The software is actually very similar to what works for line following, with only a few adjustments to reflect the difference in sensors.

If you decide to organize a wall-following competition, remember that the walls used need not be real walls. You can create temporary walls with wood, cardboard, or any other material of your choice. Wall following can be as simple to set up as having the robot find its way around the perimeter of a large cardboard box. As with all competitions, it’s important that you put a lot of care in specifying the details, including the following:

  • The height of the walls, their color, and the material they are made of

  • The color of the floor and the material it is made of

  • Whether the robots are required to remain in constant contact with the wall, or if they can move apart from it for a while

  • The shape of the course, or at least what kind of angles the robots should expect

  • Whether the robots are allowed to “hook” the upper edge of the walls

Moving to the point of view of the participant, the hardware configuration required to follow walls can be very similar to that of a wall-maze-solving robot (maze solving actually being a sophisticated variant of wall following). However, this is one of those cases where an increase in speed brings new difficulties. Similar to what happens in high-speed line following, the critical factor here is the reaction time of the robot. In fact, anytime it loses contact with the wall and needs to undertake a corrective action, that longer reaction time entails a stronger correction.

As mentioned in Chapter 14 when discussing how to optimize line following, this is easier said than done. To recapitulate, the elements you have to consider include:

  • The mechanical configuration of your robotThese include the type of drive, number of motors, position of the sensors, gear ratio, and backlash within gears.

  • The firmware you installed on your NXTAlternative firmware installations are available and the variants that are available are constantly changing. Some alternatives support the standard NXT-G language as well as other programming environments. You need to choose a firmware and environment that you can use effectively to provide the fastest response time for your robot.

  • The algorithms used in the softwareThis comprises strategies adopted to keep the robot on course as much as possible.

The mechanical configuration of your robot is something you have to experiment with. The optimal solution depends on the set of rules with which you’ll use to race. As for the firmware options, this is an opportunity to study a new language and install a new system, though not everyone will want to do that just to attend a contest.

As for the strategies, some of you may recall that Chapter 12 introduced hysteresis as a technique aimed at improving the efficiency of a system, because it reduces the number of corrections it has to make. It was definitely an interesting option for line following, but is it applicable to wall following too? The answer depends on the configuration of your robot. If it relies on a touch sensor to “feel” the wall, hysteresis will be of no help, because all you can determine from the robot is whether it’s touching the wall. To take advantage of hysteresis, you need finer information—you need to know the distance from the wall, so you can make your robot decide when and how much to correct the route. This implies that you have to replace the touch sensor with a more sophisticated device. For example, you could arrange a bumper, or antenna, connected to a rotation sensor in such a way that the count of the sensor is proportional to the distance. Or you may be able to use the Ultrasonic Sensor to detect a distance from the wall—like the Maze Runner of Chapter 17.

Other Races

Many other type of contests require your robot to perform some action as quickly as possible. As we explained in the introduction, most of them require some additional capability rather than just speed. In Chapter 20, we will describe contests in which speed is important, but this is usually in the background when compared to other factors, such as efficiency in finding and gathering objects. In the following list, we suggest a few ideas for competitions in which speed is the most important component:

  • Car racingCar racing is similar to drag racing, but the robotic cars run on a circuit that is more complex than just a straight track. The circuit may be delimited with colored tape on the floor, or with side walls. Avoid reducing the contest to line or wall following; instead, design the circuit so that a robot that follows one of the sides takes a longer route than those that run inside the track. If the circuit is delimited with real walls, encourage the competitors to use sophisticated detection techniques, such as proximity sensing, by applying a penalty for every collision with a wall. Another approach to the car racing track was developed by the Lafayette LEGO Robotics Club. They use an oval track that is about 2 feet wide and has a black-to-white gradient across the track.

  • Fast paintingEach robot is equipped with a felt-tip pen and is asked to paint a given area on a sheet of paper. The robot that covers the surface fastest wins. Consider basing the results of each competitor on a combination of the elapsed time with the comprehensiveness of the coverage. The panel could be provided with a robot designed to scan the sheet and evaluate the result!

  • Wall climbingPrepare a climbing wall equipped with special holds that a robot can seize (this could be as simple as a grid of horizontal bars); the fastest robot to reach the top wins. You can keep the competition open to ideas, allowing any kind of technique to reach the top, including lifting mechanisms and the launching of ropes. Be sure to provide a soft surface under the wall as you don’t want anyone to break his NXT if it were to fall off the wall.

Summary

This chapter introduced you to the world of contests which represent a great opportunity to expand your knowledge, stimulate your creativity, and compare your ideas with others.

Even races that seem the least “robotic” of all the possible types of competitions can spur you to find new solutions or improve old ones. During contests, the details are very important. Your robot should not only work, but work better than its competitors. For this reason, an apparently simple task such as going straight and fast requires thoughtful planning of your project: batteries, motors, geartrains, wheels, the weight of the vehicle, and the center of gravity... all of these elements are crucial to success.

When you move to contests that involve highly specialized capabilities, such as navigation, the problems become much more complex. Tasks as simple as line following and wall following require a tremendous effort when your purpose is to design, build, and program a robot tuned for optimal performance. This is a process which proceeds by trial and error, and which will test your skills, your experience, your creativity, and, most of all, your patience!

We encourage you to participate in contests. They can really be a great experience. Be humble enough to learn from your mistakes, or from more effective techniques rather than completely different approaches adopted by other robots. Take everything very seriously during preparation: Try different solutions; perfect the details; test your program thoroughly until you feel satisfied. But don’t take the final rankings too seriously—remember, it’s all in fun!

 

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.119.117.207