28.01.2013 Views

Build Your Own Combat Robot

Build Your Own Combat Robot

Build Your Own Combat Robot

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

290 <strong>Build</strong> <strong>Your</strong> <strong>Own</strong> <strong>Combat</strong> <strong>Robot</strong><br />

next<br />

goto main<br />

pulsout 0, 200 'Send a 2 ms pulse to the right servo<br />

pulsout 1, 200 'Send a 2 ms pulse to the left servo<br />

pause 15<br />

back: 'This routing causes the mini sumo to back up.<br />

for b2=1 to 25 'This loop determines how far the mini<br />

pulsout 0, 200 'sumo backs up. Increasing the value<br />

pulsout 1, 100 '(25) will cause the robot to back up<br />

pause 15 'more, decreasing the value will cause<br />

next 'the sumo the back up less.<br />

return<br />

Object Detector<br />

The goal of the object detector is to enable your bot to detect or “see” your opponent<br />

while it is far away from your bot, so that your bot can position itself to push<br />

the opponent out of the sumo ring. There are many different ways to locate your<br />

opponent, including bump switches, infrared reflective sensors, ultrasonic sensors,<br />

laser range finders, and vision cameras. The most common are infrared reflective<br />

sensors.<br />

An infrared reflective sensor consists of an infrared LED and phototransistor.<br />

They are placed next to each other, facing the same direction. When the LED turns<br />

on, infrared light is emitted forward. If an object gets in front of the infrared light,<br />

some of the light is reflected back toward the phototransistor. The transistor turns<br />

on when it detects the infrared light. This type of sensor will actually work with<br />

any type of light, as long as the phototransistor is sensitive to the same wavelength<br />

as the emitted light.<br />

Because normal light usually contains all wavelengths in the visible light spectrum<br />

and light in the near infrared wavelength spectrum, it becomes difficult to<br />

distinguish the difference between natural light and the light we are trying to detect.<br />

One way to distinguish a man-made (or bot-made) light source from natural<br />

light is to modulate the light source at some frequency that is not found in nature.<br />

A sensor tuned to this frequency will ignore all of the light sources except for the<br />

light source of interest.<br />

The easiest way to make this type of object detector is to use the same type of<br />

infrared sensor that is found inside a standard TV remote control. You probably<br />

already know that you can change the TV channel just by aiming the remote at a<br />

wall opposite the TV set. The TV detects the reflection of the infrared light off of<br />

the wall, which in essence is the same way your object detector should work. Inside<br />

the TV is a small sensor that contains all of the filters and amplifiers needed<br />

to act as a stand-alone infrared sensor. Most of these sensors are tuned to receive<br />

a modulated infrared light source operating at either 38 kHz or 40 kHz.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!