Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống
1
/ 40 trang
THÔNG TIN TÀI LIỆU
Thông tin cơ bản
Định dạng
Số trang
40
Dung lượng
431,87 KB
Nội dung
520 Chapter 26 • Racing Against Time ■ Small obstacles to overcome The robots should detect these with bumpers, suspend line following, pass the obstacle, and resume line fol- lowing again. ■ Obstacle removal Similar to the previous variation except that objects of a specific size and shape must be removed instead of climbed over. ■ Specific robotic architecture Specifying 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 card- board box. For example, you can state in your rules that the robots must run around the MINDSTORMS kit box; the fastest robot being the winner. Most of the participants will likely own the box, which will help them in setting up and testing their robots.As we’ve said before about line following, it’s important you put a lot of care in specifying the details, including: ■ The height of the walls, their color, and the material they are 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 or not 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 shown in Chapter 19 with regard to maze solving (maze solving actually being a sophisticated variant of wall following). However, this is one of those cases where an increase in speed brings www.syngress.com 174_LEGO_26PIII 10/29/01 4:52 PM Page 520 Racing Against Time • Chapter 26 521 new difficulties. Similar to what happens in high-speed line following, the critical factor here is the reaction time of the robot. In fact, any time it loses contact with the wall and needs to undertake a corrective action, that longer reaction time entails a stronger correction. As we mentioned in Chapter 14 when discussing how to optimize line fol- lowing, this is easier said than done.To recapitulate, the elements you have to consider include: ■ The mechanical configuration of your robot Type of drive, number of motors, position of the sensors, gear ratio, and backlash within gears. ■ The firmware you installed on your RCX We explained that some alternative firmware offers faster code execution. ■ The algorithms used in the software Strategies adopted to keep the robot on course as much as possible. The mechanical configuration of your robot is something you have to exper- iment with.You can use the Maze Runner of Chapter 19 as a starting point, but the optimal solution also depends on the set of rules you’ll use to race with.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 in Chapter 12 we intro- duced 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—like the Maze Runner of Chapter 19—hysteresis will be of no help, because all you can determine from the robot is whether it’s touching the wall or not.To take advantage of hysteresis, you need finer informa- tion—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 some 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, if the rules allow for custom sensors, you could successfully use one of the distance sensors described in Chapter 9. www.syngress.com 174_LEGO_26PIII 10/29/01 4:52 PM Page 521 522 Chapter 26 • Racing Against Time Other Races There are many other type of contests that require your robot to perform some action as quickly as possible.As we explained in the introduction, most of them require some additional ability rather then just speed. In Chapter 28, we will describe contests where speed is important, but this is usually in the background when compared to other factors, like the 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 racing Car 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 tech- niques, like proximity sensing, by applying a penalty for every collision with a wall. ■ Fast painting Each 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 sur- face fastest wins. Consider basing the results of each competitor on a combination of the elapsed time with the comprehensiveness of the cov- erage.The panel could be provided with a robot designed to scan the sheet and evaluate the result! ■ Wall climbing Prepare 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 competi- tion open to ideas, allowing any kind of technique to reach the top, including lifting mechanisms and the launching of ropes. ■ Monkey bars The Toronto Users Group (rtlToronto) is very active in organizing robotic contests.Their recent proposals include a monkey bar race.The competing robots are required to traverse a horizontal ladder, racing against another robot.The first one to reach the end, or the one who goes the furthest, wins (see Appendix A for a link to the rtlToronto Web site). www.syngress.com 174_LEGO_26PIII 10/29/01 4:52 PM Page 522 Racing Against Time • Chapter 26 523 Summary This chapter introduced you to the world of contests that 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 competi- tions 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 like going straight and fast requires thoughtful planning of your project: batteries, motors, gear trains, wheels, weight of the vehicle… these elements are all crucial to success. The simple addition of a limited braking space can make drag racing much more interesting, forcing the competitors to devise efficient braking solutions. Similarly, when you move to contests that involve highly specialized abilities, like navigation, the problems become much more complex.Tasks as simple as line fol- lowing 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 pro- cess which proceeds by trial and error, and which will test your skills, your expe- rience, your creativity and, most of all, your patience! We encourage you to participate in contests.They can really be a great expe- rience. 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! www.syngress.com 174_LEGO_26PIII 10/29/01 4:52 PM Page 523 174_LEGO_26PIII 10/29/01 4:52 PM Page 524 Hand-to-Hand Combat Solutions in this chapter: ■ Building a Robotic Sumo ■ Attack Strategies ■ Getting Defensive ■ Testing Your Sumo Chapter 27 525 174_LEGO_27 10/29/01 4:53 PM Page 525 526 Chapter 27 • Hand-to-Hand Combat Introduction The contests described in Chapter 26 are the kind where each competitor has its turn, and the results compare the individual performances. In this chapter, we’ll talk about competitions where the rival robots fight face to face in a more spec- tacular way. In our experience, Sumo is one of the most suitable kinds of competition for small robots, offering the opportunity to test an incredible range of techniques that may prove useful in all your projects, not just during contests.We will take a look at variations on some familiar solutions—like bumpers and proximity detec- tion—and will introduce some new ones. For example, we will explain how to alternate the use of a single light sensor to look down to detect the edge of the playing field and to look ahead to search for the opponent, and we will illustrate a transmission which behaves like a sort of automatic gear switch. Although the technical aspects of building a successful Sumo robot are important, the design requires much more than simply putting together a few mechanical solutions: it requires a strategy.Will your robot be very aggressive, or do you prefer a defensive approach? It could be robust and slow, or lightweight and fast. It could be designed to actively search out its opponent, or to react when it’s under attack.You cannot work at the mechanical configuration and decide how the robot should behave after it’s finished. On the contrary, you have to pick up a strategy and design both the mechanics and the program according to it.This principle applies to any robot, but it is particularly important for Sumo robots, and it is the key to understanding this chapter:We want you to devote the proper attention to the connections between the planned behavior of your robot and the solutions you can adopt to effectively implement it. Building a Robotic Sumo We explained in the Introduction that when you start building a robot for a Sumo contest, you must have a strategy in mind.The process starts before building your robot. It begins by examining the rules carefully, understanding what you can and cannot do, and deciding your line of action.You must try to imagine what the opponents’ strategy can be, and plan your robot to be able to resist their attacks and take advantage of their weak points. Obviously you cannot really know how the other competitors will strategize and behave, but this exer- cise helps you to focus on a well-defined strategy. Remember that any strategy is better than no strategy at all! www.syngress.com 174_LEGO_27 10/29/01 4:53 PM Page 526 www.syngress.com This section starts by describing a typical set of rules, which will help you in framing what a Sumo contest is, and provide a starting point in case you want to organize your own.Then we’ll describe how you can tune your robot to produce maximum force, which is undoubtedly a very important component in a Sumo competition.We will also explain how to configure your robot to take advantage of some important offensive and defensive behavioral strategies. Setting the Rules During our Italian LEGO Users Group (ItLUG) meetings we organized robotic Sumo tournaments based on two separate sets of rules.The first set of rules states that the robots can be made out of any original LEGO piece, in any desired quantity, but that they must be within a maximum size of 32 x 32 studs and a maximum weight of 1.5kg (3lbs). In the alternative set of rules, which we called Mini Sumo, each robot may be built using only parts from a single MIND- STORMS set; there is therefore no need for size and weight constraints. For most other aspects the two sets of rules are almost the same: ■ The field is a circular or square pad with a contrasting external strip of 20cm (8 inches). Usually the pad is white and the strip black, or vice versa. ■ Only two robots can fight on the field at a time. Should one robot for any reason find itself outside the field boundaries, that is, any portion of it touches a point beyond the external strip, the robot loses the round. If neither robot is eliminated within a chosen time limit (e.g., 3 minutes), the match ends in a draw. ■ A robot may also be eliminated if it is overturned by its opponent or it finds itself in a situation where it can no longer maneuver. ■ No “violent” behaviors are allowed.A robot can only push or lift its opponent. It is in no way allowed to damage its opponent’s structure or parts. ■ A robot cannot drop any part or subsystem in the field either deliber- ately or involuntarily.Any part found loose on the field will be removed by a member of the panel. ■ The robots must be fully autonomous; any kind of remote control is forbidden. Hand-to-Hand Combat • Chapter 27 527 174_LEGO_27 10/29/01 4:53 PM Page 527 528 Chapter 27 • Hand-to-Hand Combat ■ Every robot must comply with the limits in size and weight at the beginning of a match, but once the match starts, it can modify its own structure, perhaps extending parts so itself so its dimensions become larger than the initial specified size limits. There are many other less important rules covering items like batteries, com- position of the panel, pre-match test time, and more. Some Sumo competitions require that your robot pass an admission test: It should be able to push a block of wood out of the fighting ring. If it can’t beat a block of wood, it has little chance against another robot, and this rule is meant to screen out robots too weak to enter the contest.We never enforced this rule during our Italian Sumo contests, and have to admit that it’s quite possible a block of wood might have been able to win a few matches! Maximizing Strength and Traction The making of a strong Sumo robot requires much more than just brute force, but we cannot deny that maximizing the generated push will increase your chance of winning some matches and maybe the tournament. When optimizing the pushing power of your robot, the first thing you need is an objective way to measure it.Without measuring the force, the improvements you make are subjective and as a result are very inaccurate. During the prepara- tion for the first ItLUG robotic Sumo contest, our friend and robot builder Sergio Lorenzetti suggested a simple trick based on a very common object: scales, like those used in many kitchens to weigh flour, sugar, or other ingredients. You have to place the scale on its side on the table or the floor, possibly removing the upper tray, and hold it firmly while your robot pushes against it. You’re not interested in the absolute value that the scales indicate, but rather in comparing the push produced by different setups. There are many factors that affect this force; you can imagine a sort of path of power that goes from the batteries to the wheels, passing through the motors and the gearing, decreasing in accordance with the variables that affect each part along the path (see Figure 27.1). We already talked about batteries in Chapter 26; the rules will hopefully specify that all competitors use the same kind of commercial batteries. Between the batteries and the motors, there’s the RCX. It’s worth reminding you once again, that the RCX incorporates a current-limiting device to protect the motors connected to its output ports. If the rules allow the use of extra parts and you have them, you can consider the option to connect the main motors to a battery www.syngress.com 174_LEGO_27 10/29/01 4:53 PM Page 528 Hand-to-Hand Combat • Chapter 27 529 box and a polarity switch, thus implementing the indirect control described in Chapter 3. The number of motors influences the generated power. Simply use the max- imum allowed by the rules and by your own inventory.As for the mobility con- figuration, the differential drive allows for the highest combination of maneuverability and simplicity.The fact that it doesn’t go perfectly straight is not relevant to Sumo fighting, and the dual differential drive has no advantages in this case. On the contrary, the ability to use one motor to turn and the other to move reduces the maximum generated force. The optimal gearing is, as always, easier to determine by experiments than by calculations. Generally speaking, the higher the reduction ratio, the higher the push, but this doesn’t mean you should gear down too much. Speed has its importance (we’ll explain why later in the chapter), and very high reduction ratios introduce too much friction, which uses up precious power. Now we come to the part where you have to convert the produced torque into actual push.The wheels are a critical component: if they don’t grip the pad well, the rest of your efforts will prove fruitless.This is when the scales we men- tioned earlier prove an enormous benefit. By testing different kinds of LEGO wheels, you’ll discover that there are significant variations in grip.The ones from the 8462 Tow Truck work particularly well, as well as the large spoke wheels con- tained in the MINDSTORMS kit. On no account should you use tracks.They offer extremely low grip, and almost no grip at all in the direction perpendicular to its motion.You’d have little hope at all if your opponent broadsided you—an eventuality more probable than a head-on collision. If possible, try to test your robot on a surface similar to the contest’s official pad. Different materials require different wheels. For example, the wheel having the best grip on a smooth tabletop is not necessarily the one with the best grip on a rough plywood surface. www.syngress.com Figure 27.1 Limitations on Force Batteries RCX Gearing Wheels Friction Grip, CoG Resulting Force current limiting device Motor(s) Number of motors 174_LEGO_27 10/29/01 4:53 PM Page 529 [...]... from WinCE platforms EmulegOS (http://sourceforge.net/projects/emulegos) A LegOS emulator, which lets you run and debug your LegOS programs on your Win/Linux PC Started by Mario Ferrari and Marco Beri, emulegOS is currently an Open Source project managed by Mark Falco LegoSim (www.informatik.hu-berlin.de/~mueller/legosim) LegoSim is a Unix-based Simulator for LegOS with an Applet-GUI, written by Frank... Interest Sites LEGO MINDSTORMS (http:/ /mindstorms .lego. com) The first site to mention is, of course, the LEGO MINDSTORMS official site It contains tons of stuff: technical tips, a gallery of inventions, events, contests, answers to frequently asked questions (FAQ), and more.The official LEGO MINDSTORMS FAQ site is: http:/ /mindstorms .lego. com/products/whatis/faq.asp LUGNET (www.lugnet.com) The LEGO Users Group... the LEGO firmware and ROM routines He made the development of firmware like legOS and pbForth possible In his LEGO MINDSTORMS Internals page (www.crynwr.com /lego- robotics), Russell Nelson properly lists him under the heading Heroes! NQC – Not Quite C (www.enteract.com/~dbaum/nqc/ index.html) Dave Baum’s NQC site contains the compiler and the documentation legOS (http://legos.sourceforge.net) The legOS... original post reporting his test about rotation sensors Chapter 5 Building Strategies LEGO Engineering (http://british.nerp.net /lego/ index.html) This helpful site includes a Building Tips section, too Reinard’s LEGO Building Tips (http://british.nerp.net/ lego/ index.html) Reinard van Loo’s page contains building tips and tricks www.syngress.com 174 _LEGO_ AppA 10/29/01 4:55 PM Page 553 Resources • Appendix A... space to show off his or her own LEGO models Fred Martin’s Unofficial Questions and Answers about MIT Programmable Bricks and LEGO MINDSTORMS (http://fredm.www.media.mit.edu/people/fredm/ mindstorms/ index.html) Fred Martin tells the story of the Programmable Brick and provides some other useful information about the RCX LEGO MINDSTORMS Internals (www.crynwr.com/ lego- robotics/) Russell Nelson maintains... Nagata’s LEGO MINDSTORMS Idea Book, by Joe Nagata; No Starch Press, 2001 Joe is without a doubt a great designer In his book, he steers you step by step through the building of some instructive and efficient models LEGO MINDSTORMS: The Master’s Technique, by Jin Sato; No Starch Press, 2001.This is a great book, containing both general building suggestions and programming tips It also includes step-by-step... homepage pbForth (www.hempeldesigngroup.com /lego/ pbFORTH/ index.html) Ralph Hempel’s programmable brick FORTH (pbFORTH) for MINDSTORMS page Gordon’s Brick Programmer (www.umbra.demon.co.uk/ gbp.html) With its graphic-textual interface GBP is a sort of bridge between RCX Code and the pure textual programming environments Bot-Kit (www.object-arts.com/Bower/Bot-Kit/Bot-Kit.htm) An interface to programming the... patience LEGO Parts Reference (http://guide.lugnet.com/partsref/) Created by Steve Bliss and hosted on LUGNET, this database contains information, images, and links for many LEGO bricks and other elements www.syngress.com 549 174 _LEGO_ AppA 550 10/29/01 4:55 PM Page 550 Appendix A • Resources NOTE The official Web site for this book is at www.syngress.com/solutions Check it out for additional MINDSTORMS- related... the diagonals in terms of LEGO units The Brick Bakery (http://web2.airmail.net/sjbaker1 /lego) Steve Baker’s site contains two useful pages about LEGO dimensions and gear spacings Chapter 2 Playing with Gears Fred Martin’s The Art of LEGO Design (ftp://cherupakha.media.mit.edu/pub/people/fredm/ artoflego.pdf) A very good primer about LEGO geometry in general and gearings in particular It also contains... motor (follow the link to Technical Specs and then to Motors) LEGO Motors (www.enteract.com/~dbaum /lego/ motors.html) Dave Baum’s page about LEGO motors and their features Chapter 4 Reading Sensors MindStorms RCX Sensor Input Page (www.plazaearth.com/ usr/gasperi /lego. htm) Michael Gasperi’s super-site about MINDSTORMS sensors—the starting point for any investigation about this component It also contains . its oppo- nents. From then on, our rules introduced a side-by-side start, with random orientation drawn by the panel. Designing & Planning… 174 _LEGO_ 27 10/29/01 4:53 PM Page 530 Hand-to-Hand. structure or parts. ■ A robot cannot drop any part or subsystem in the field either deliber- ately or involuntarily.Any part found loose on the field will be removed by a member of the panel. ■ The robots. autonomous; any kind of remote control is forbidden. Hand-to-Hand Combat • Chapter 27 527 174 _LEGO_ 27 10/29/01 4:53 PM Page 527 528 Chapter 27 • Hand-to-Hand Combat ■ Every robot must comply with the