McGraw-Hill - The Robot Builder''''s Bonanza Episode 2 Part 9 pps

35 311 0
McGraw-Hill - The Robot Builder''''s Bonanza Episode 2 Part 9 pps

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

sound to quickly and efficiently navigate through dark caves. So accurate is their “sonar” that bats can sense tiny insects flying a dozen or more feet away. Similarly, robots don’t always need light-sensitive vision systems. You may want to con- sider using an alternative system, either instead of or in addition to light-sensitive vision. The following sections outline some affordable technologies you can easily use. ULTRASONICS Like a cave bat, your robot can use high-frequency sounds to navigate its surroundings. Ultrasonic transducers are common in Polaroid instant cameras, electronic tape-measuring devices, automotive backup alarms, and security systems. All work by sending out a high-fre- quency burst of sound, then measuring the amount of time it takes to receive the reflected sound. 616 ROBOTIC EYES Diffraction grating Laser Video camera Main beam Sub-beams FIGURE 37.14 When projected onto a flat surface, the beams from the diffracted laser light form a regular grid. FIGURE 37.13 A penlight laser, diffraction grat- ing, filter, and video camera can be used to create a low- cost machine vision system. Ch37_McComb 8/21/00 4:26 PM Page 616 Ultrasonic systems are designed to determine distance between the transducer and an object in front of it. More accurate versions can “map” an area to create a type of topo- graphical image, showing the relative distances of several nearby objects along a kind of 3-D plane. Such ultrasonic systems are regularly used in the medical field. Some trans- ducers are designed to be used in pairs—one transducer to emit a series of short ultrason- ic bursts, another transducer to receive the sound. Other transducers, such as the kind used on Polaroid cameras and electronic tape-measuring devices, combine the transmitter and receiver into one unit. An important aspect of ultrasonic imagery is that high sound frequencies disperse less readily than do low-frequency ones. That is, the sound wave produced by a high-frequen- cy source spreads out much less broadly than the sound wave from a low-frequency source. This phenomenon improves the accuracy of ultrasonic systems. Both DigiKey and All Electronics, among others, have been known to carry new and surplus ultrasonic compo- nents suitable for robot experimenters. See Chapters 36 and 38 for more information on using ultrasonic sensors to guide your robots. RADAR Radar systems work on the same basic principle as ultrasonics, but instead of high-fre- quency sound they use a high-frequency radio wave. Most people know about the high- powered radar equipment used in aviation, but lower-powered versions are commonly used in security systems, automatic door openers, automotive backup alarms, and of course, speed-measuring devices used by the police. Radar is less commonly found on robotics systems because it costs more than ultra- sonics. But radar has the advantage that radar it is less affected by wind, temperature, and distance. For example, radar can be used up to several miles away; ultrasonics is useful only up to about 10 or 20 meters. PASSIVE INFRARED A favorite for security systems and automatic outdoor lighting, passive pyroelectric infrared (PIR) sensors detect the natural heat that all objects emit. This heat takes the form of infrared radiation—a form of light that is beyond the limits of human vision. The PIR system merely detects a rapid change in the heat reaching the sensor; such a change usu- ally represents movement. The typical PIR sensor is equipped with a Fresnel lens to focus infrared light from a fairly wide area onto the pea-sized surface of the detector. In a robotics vision application, you can replace the Fresnel lens with a telephoto lens arrangement that permits the detec- tor to view only a small area at a time. Mounted onto a movable platform, the sensor could detect the instantaneous variations of infrared radiation of whatever objects are in front of the robot. See Chapter 36, “Collision Avoidance and Detection,” for more information on the use of PIR sensors. TACTILE FEEDBACK Many robots can be effective navigators with little more than a switch or two to guide their way. Each switch on the robot is a kind of “touch sensor”: when a switch is depressed, the GOING BEYOND LIGHT-SENSITIVE VISION 617 Ch37_McComb 8/21/00 4:26 PM Page 617 robot knows it has touched some object in front of it. Based on this information, the robot can stop and negotiate a different path to its destination. To be useful, the robot’s touch sensors must be mounted where they will come into con- tact with the objects in their surroundings. For example, you can mount four switches along the bottom periphery of a square-shaped robot so contact with any object will trig- ger one of the switches. Mechanical switches are triggered only on physical contact; switches that use reflected infrared light or capacitance can be triggered by the proximity of objects. Noncontact switches are useful if the robot might be damaged by running into an object, or vice versa. See Chapter 35, “Adding the Sense of Touch,” for more informa- tion on tactile sensors. From Here To learn more about… Read Using a brain with your robot Chapter 28, “An Overview of Robot ‘Brains’” Connecting sensors to a robot Chapter 29, “Interfacing with Computers and computer or microcontroller Microcontrollers” Using touch to guide your robot Chapter 35, “Adding the Sense of Touch” Getting your robot from point Chapter 38, “Navigating through Space” A to point B 618 ROBOTIC EYES Ch37_McComb 8/21/00 4:26 PM Page 618 The projects and discussion in this chapter focus on navigating your robot through space—not the outer-space kind, but the space between two chairs in your living room, between your bedroom and the hall bathroom, or outside your home by the pool. Robots suddenly become useful once they can master their surroundings, and being able to wend their way through their surrounds is the first step toward that mastery. The techniques used to provide such navigation are varied: path-track systems, infrared beacons, ultrasonic rangers, compass bearings, dead reckoning, and more. A Game of Goals A helpful way to look at robot navigation is to think of it as a game, like soccer. The aim of soccer is for the members of one team to kick the ball into a goal. That goal is guarded by a member of the other team, so it’s not all that easy to get the ball into the goal. Similarly, for a robot a lot stands between it and its goal of getting from one place to anoth- er. Those obstacles include humans, chairs, cats, a puddle of water, an electrical cord—just about anything can prevent a robot from successfully traversing a room or yard. To go from point A to point B, your robot will consider the following process (as shown in Fig. 38.1): 38 NAVIGATING THROUGH SPACE 619 Ch38_MCComb 8/29/00 8:32 AM Page 619 Copyright 2001 The McGraw-Hill Companies, Inc. Click Here for Terms of Use. 1. Retrieve instruction of goal: get to point B. This can come from an internal stimulus (battery is getting low; must get to power recharge station) or from a programmed or external command. 2. Determine where point B is in relation to current position (point A), and determine a path to point B. This requires obtaining the current position using known landmarks or references. 3. Avoid obstacles along the way. If an immovable obstacle is encountered, move around the obstacle and recalculate the path to get to point B. 620 NAVIGATING THROUGH SPACE Go to Point B Locate Point B Obstacle in way? Move around obstacle No Ye s Read wheel odometers Errors in travel? No Ye s Correct for heading Stop at point B At point B? Ye s No FIGURE 38.1 Navigation through open space requires that the robot be programmed not only to achieve the “goal” of a specific task but to self-correct for possible obstacles. Ch38_MCComb 8/29/00 8:32 AM Page 620 4. Correct for errors in navigation (“in-path error correction”) caused by such things as wheel slippage. This can be accomplished by periodically reassessing current position using known landmarks or references. 5. Optionally, time out (give up) if goal is not reached within a specific period of time or distance traveled. Notice the intervening issues that can retard or inhibit the robot from reaching its goal. If there are any immovable obstacles in the way the robot must steer around them. This means its predefined path to get from point A to point B must be recalculated. Position and navigation errors are normal and are to be expected. You can reduce the effects of error by having the robot periodically reassess its position. This can be accomplished by using a number of referencing schemes, such as mapping, active beacons, or landmarks. More about these later in the chapter. People don’t like to admit failure, but a robot is just a machine and doesn’t know (or care) that it failed to reach its intended destination. You should account for the possibility that the robot may never get to point B. This can be accomplished by using time-outs, which entails either determining the maximum reasonable time to accomplish the goal or, better yet, the maximum reasonable distance that should be traveled to reach the goal. You can build other fail-safes into the system as well, including a program override if the robot can no longer reassess its current location using known landmarks or references. In such a scenario, this could mean its sensors have gone kaput or that the landmarks or references are no longer functioning or accurate. One course of action is to have the robot shut down and wait to be bailed out by its human master. Following a Predefined Path: Line Tracing Perhaps the simplest navigation system for mobile robots involves following some prede- fined path that’s marked on the ground. The path can be a black or white line painted on a hard-surfaced floor, a wire buried beneath a carpet, a physical track, or any of several other methods. This type of robot navigation is used in some factories. The reflective tape method is preferred because the track can easily be changed without ripping up the floor. You can readily incorporate a tape-track navigation system in your robot. The line-trac- ing feature can be the robot’s only means of semi-intelligent action, or it can be just one part of a more sophisticated machine. You could, for example, use the tape to help guide a robot back to its battery charger nest. With a line-tracing robot, you place a piece of white or reflective tape on the floor. For the best results, the floor should be hard, like wood, concrete, or linoleum, and not carpet- ed. One or more optical sensors are placed on the robot. These sensors incorporate an infrared LED and an infrared phototransistor. When the transistor turns on it sees the light from the LED reflected off the tape. Obviously, the darker the floor the better because the tape shows up against the background. In a working robot, mount the LED and phototransistors in a suitable enclosure, as described more fully in Chapter 36, “Collision Avoidance and Detection.” Or, use a FOLLOWING A PREDEFINED PATH: LINE TRACING 621 Ch38_MCComb 8/29/00 8:32 AM Page 621 commercially available LED-phototransistor pair (again, see Chapter 36). Mount the detectors on the bottom of the robot, as shown in Fig. 38.2, in which two detectors have been placed a little farther apart than the width of the tape. I used 1/4-inch art tape in the prototype for this book and placed the sensors 1/2 inch from one another. Fig. 38.3 shows the basic sensor circuit and how the LED and phototransistor are wired. Feel free to experiment with the value of R2; it determines the sensitivity of the photo- transistor. Fig. 38.4 shows the sensor and comparator circuit that forms the basis of the line-tracing system. Refer to this figure often because this circuit is used in many other applications. You can use the schematics in Fig. 38.5 and Fig. 38.6 to build a complete line-tracing system (refer to the parts lists in Tables 38.1 and 38.2). You can build the circuit using just three IC packages: an LM339 quad comparator, a 7486 quad Exclusive OR gate, and a 7400 quad NAND gate. Before using the robot, block the phototransistors so they don’t receive any light. Rotate the shaft of the set-point pots until the relays kick in, then back 622 NAVIGATING THROUGH SPACE White or reflective strip on ground Front view Left LED-Phototransistor Right LED-Phototransistor FIGURE 38.2 Placement of the left and right phototransistor-LED pair for the line-tracing robot. LED1 Q1 +5V R2 10K R1 270Ω Output FIGURE 38.3 The basic LED-photo- transistor wiring dia- gram. Ch38_MCComb 8/29/00 8:32 AM Page 622 FOLLOWING A PREDEFINED PATH: LINE TRACING 623 LED1 Q1 - + IC1 339 (1/4) Output 4 5 2 +5V +5V R2 10K R3 10K R1 270Ω R4 10K FIGURE 38.4 Connecting the LED and phototransistor to an LM339 quad comparator IC. The output of the comparator switches between HIGH and LOW depends on the amount of light falling on the phototransistor. Note the addition of the 10K “pullup” resistor on the output of the comparator. This is needed to assure proper HIGH/LOW action. LED1 Q1 +5V - + IC1 339 (1/4) 4 5 2 12 3 LED2 Q2 - + IC1 339 (1/4) 6 7 1 12 3 To Relay #2 To Relay #1 IC2 7486 (1/4) 7 14 1 2 3 1 2 3 4 5 6 R2 10K R1 270 Ω +5V +5V +5V R4 270Ω R5 10K +5V R6 10K IC3 7400 (1/4) 14 7400 (1/4) IC3 R3 10K R7 10K R8 10K FIGURE 38.5 Wiring diagram for the line-tracing robot. The outputs of the 7400 are rout- ed to the relays in Figure 38.6. Ch38_MCComb 8/29/00 8:32 AM Page 623 624 NAVIGATING THROUGH SPACE Ground RL1 M1 D1 1N4003 +V +5V Ground RL2 M2 D2 1N4003 +V +5V From Detector # 1 From Detector# 2 FIGURE 38.6 Motor direction and control relays for the line-tracing robot. You can substitute the relays for purely electron- ic control; refer to Chap. 18. TABLE 38.1 PARTS LIST FOR LINE TRACER. IC1 LM339 Quad Comparator IC IC2 7486 Quad Exclusive OR Gate IC IC3 7400 Quad NAND Gate IC Q1,Q2 Infrared-sensitive phototransistors R1,R4 270-ohm resistor R2,R5, R7,R8 10K resistor R3,R6 10K potentiometer LED1,2 Infrared light-emitting diode Misc. Infrared filter for phototransistor (if needed) All resistors are 5–10% tolerance. TABLE 38.2 PARTS LIST FOR RELAY CONTROL. RL1,RL2 DPDT fast-acting relay; contacts rated 2 amps or more D1, D2 1N4003 diodes Ch38_MCComb 8/29/00 8:32 AM Page 624 off again. You may have to experiment with the settings of the set point pots as you try out the system. Depending on which motors you use and the switching speed of the relays, you may find your robot waddling its way down the track, overcorrecting for its errors every time. You can help minimize this by using faster-acting relays. Another approach is to vary the gap between the two sensors. By making it wide, the robot won’t be turning back and forth as much to correct for small errors. I have also found that you can minimize this so-called overshoot effect by carefully adjusting the set-point pots. You’ll hardly ever see a railroad track with a turn tighter than about 8°. There is good reason for this. If the turn is made any tighter, the train cars can’t stay on the track, and the whole thing derails. There is a similar limitation in line-tracing robots. The lines cannot be tighter than about 10° to 15°, depending on the robot’s turning radius, or the thing can’t act fast enough when it crosses over the line. The robot will skip the line and go off course. The actual turn radius will depend entirely on the robot. If you need your robot to turn very tight, small corners, build it small. If your robot has a brain, whether it is a computer or central microprocessor, you can use it instead of the direct connection to the relays for motor control. The output of the comparators, when used with a ϩ5 volt supply, is compat- ible with computer and microprocessor circuitry, as long as you follow the interface guide- lines provided in Chapter 29. The two sensors require only two bits of an eight-bit port. Wall Following Robots that can follow walls are similar to those that can trace a line. Like the line, the wall is used to provide the robot with navigation orientation. One benefit of wall-following robots is that you can use them without having to paint any lines or lay down tape. Depending on the robot’s design, the machine can even maneuver around small obstacles (doorstops, door frame molding, radiator pipes, etc.). VARIATIONS OF WALL FOLLOWING Wall following can be accomplished with any of four methods: ■ Contact. The robot uses a mechanical switch, or a stiff wire that is connected to a switch, to sense contact with the wall, as shown in Fig. 38.7a. This is by far the simplest method, but the switch is prone to mechanical damage over time. ■ Noncontact, active sensor. The robot uses active proximity sensors, such as infrared or ultrasonic, to determine its distance from the wall. No physical contact with the wall is needed. In a typical noncontact system, two sensors are used to judge when the robot is parallel to the wall (see Fig. 38.7b). ■ Noncontact, passive sensor. The robot uses passive sensors, such as linear Hall effect switches, to judge distance from a specially prepared wall (Fig. 38.7c). In the case of Hall effect switches, you could outfit the baseboard or wall with an electrical wire through which a low-voltage alternating current is fed. When the robot is in the prox- imity of the switches the sensors will pick up the induced magnetic field provided by WALL FOLLOWING 625 Ch38_MCComb 8/29/00 8:32 AM Page 625 [...]... on the rim of the wheel or wheel shaft THE FUNCTION OF ENCODERS IN ODOMETRY As the wheel or motor shaft turns, the encoder (optical or magnetic) produces a series of pulses relative to the distance the robot travels Assume the wheel is 3 inches in diameter (9. 42 inches in circumference), and the encoder wheel has 32 slots Each pulse of the encoder represents 0 . 29 4 inches of travel (9. 42/ 32) If the robot. .. provided either 2. 5 or 5 times per second Vector claims accuracy of 2 The 2X is meant to be used in level applications The more pricey 2XG has a built-in gimbal mechanism that keeps the active magnetic-inductive element level, even when the rest of the unit is tilted The gimbal allows tilt up to 12 Ch38_MCComb 8 / 29 /00 8: 32 AM Page 6 32 6 32 NAVIGATING THROUGH SPACE FIGURE 38.11 The Dinsmore 1 490 digital... toward the wall again This process is repeated, and the net effect is that the robot “follows the wall.” With the other methods, the preferred approach is for the robot to maintain proper distance from the wall Only when proximity to the wall is lost does the robot go into a “find wall” mode This entails arcing the robot toward the anticipated direction of the wall When contact is made, the robot alters... Ch38_MCComb 8 / 29 /00 8: 32 AM Page 6 42 6 42 NAVIGATING THROUGH SPACE 1 2 GP2D 12 3 +V Output Gnd FIGURE 38.18 Basic connection diagram for the Sharp GP2D 12 analog output infrared ranging sensor The sensor is powered by ϩ5 vdc Output (3.1V) (0.6V) 10cm 80cm Distance FIGURE 38. 19 The output of the GP2D 12 sensor is a voltage that changes as the distance between sensor and detected object varies The output is... mounted on the robot, as shown in Fig 38 .20 The laser light would be reflected from the tape and received by a sensor on the robot Since the speed of the laser scan is known, the timing between the return “pulses” of the reflected laser light would indicate the relative distance between the robot and the doorway You could use additional tape strips to reduce the ambiguity that results when the robot approaches... denote objects at the far end of the detection range, which is 80 cm The accuracy of the readings will depend greatly on the width of the target You may wish to experiment by placing the sensor in front of a smooth white wall Vary the distance between wall and sensor and note your results USING THE GP2D 12 ANALOG OUTPUT INFRARED RANGING SENSOR The GP2D 12 is similar to the GP2D 02 of the last section,... a small diode (the diode drops the voltage to the sensor) one or more analog-to-digital converter (ADC) inputs Examples of microcontrollers with ADC inputs include the BasicX (see Chapter 32) and the OOPic (see Chapter 33) Fig 38.18 shows the connection of the GP2D 12 When powered by ϩ5 vdc, the GP2D 12 outputs a voltage that is related to the distance between it and the detected object The voltage span... to substantially simplify the sensors and control electronics by placing an idler roller made of soft foam as an outrigger to the robot and then having the robot constantly steer inward toward the wall This can be done simply by running the inward wheel (the wheel on the side of the wall) a little slower than the other The foam idler roller will prevent the robot from hitting the wall DEALING WITH DOORWAYS... is an eight-bit serial digital train The hookup diagram is Ch38_MCComb 8 / 29 /00 8: 32 AM Page 640 640 NAVIGATING THROUGH SPACE 1 2 GP2D05 3 4 Ctrl signal in Gnd Output +V FIGURE 38.16 The Sharp GP2DO5 infrared distance judgment sensor has a “one-bit” output that is either HIGH or LOW depending on whether an object was detected in the sensor’s preset range shown in Fig 38.17 To use the GP2D 02, you must... clock signal to the sensor, then store each of the eight bits that are returned Convert those eight bits into a value (from 0 to 25 5), and this is the range (in noncorrelated “units”) from the sensor to the detected object Listing 38 .2 demonstrates a simple Basic Stamp II program for use with the GP2D 02 sensor It displays the eight-bit result from the sensor in the debug window LISTING 38 .2 DataInput con . and the encoder wheel has 32 slots. Each pulse of the encoder represents 0 . 29 4 inches of travel (9. 42/ 32) . If the robot senses 10 pulses, it knows it has moved 2. 94 inches. If the robot uses the. LED-photo- transistor wiring dia- gram. Ch38_MCComb 8 / 29 /00 8: 32 AM Page 622 FOLLOWING A PREDEFINED PATH: LINE TRACING 623 LED1 Q1 - + IC1 3 39 (1/4) Output 4 5 2 +5V +5V R2 10K R3 10K R1 27 0Ω R4 10K FIGURE. (1/4) IC3 R3 10K R7 10K R8 10K FIGURE 38.5 Wiring diagram for the line-tracing robot. The outputs of the 7400 are rout- ed to the relays in Figure 38.6. Ch38_MCComb 8 / 29 /00 8: 32 AM Page 623 624 NAVIGATING THROUGH SPACE Ground RL1 M1 D1 1N4003 +V +5V Ground RL2 M2 D2 1N4003 +V +5V From Detector

Ngày đăng: 10/08/2014, 04:22

Từ khóa liên quan

Tài liệu cùng người dùng

Tài liệu liên quan