Main Page
|
Course Admin
|
Course Resources
|
Rules & Regulations
|
Team Profiles
|
Photo Gallery
|
Contact Info
 
  You are here: RoboFlag Main Page > Course Resources > Technical Information > Visible Flag Beacon


Visible Flag Beacon

The flag beacon is a critical component of the RoboFlag project and is one of the most important aspects of the competition. This document details the use of a flag beacon detector that is easily interfaced to a PIC microcontroller.

This document is broken down into the following sections:



Introduction and Design Objectives

Along with detecting other robots, one of the most challenging aspects of the RoboFlag project is detecting the two flags used in the games of capture the flag.

The flag must advertise its presence, otherwise how would robots find and grab onto it? The flag must work differently from the infrared robot beacon so robots can detect other robots AND the flag at the same time. Each flag must emit a signal, and each robot needs to be able to detect the signals from each flag.

The design objectives are as follows:

  • robots must be able to detect signals from both flags
  • robots must be able to detect signals within 100ms
  • the signal should only work within line-of-sight
  • the signal must be detectable from 3 inches to 4+ feet
  • the signal must not interfere with any other sensor
Therefore we can't use RF signals (they would penetrate the arena walls) and infrared light signals would interfere with the IR beacon and the IR distance sensors used for navigation. An orange/red (~635nm) visible light signal was identified as our best bet.



Lighting Problems and LEDs

Because our flags must be detectable from more than 4 feet, the intensity of light emitted from the flag must be significant. This visible light needs to be much brighter than the ambient light in the room.

We have two separate flags: one for each team. Robots must be able to detect these flags at the same time, so each flag must have a slightly different beacon. We will therefore operate the two flag beacons at different frequencies.

Another problem lies with the turn-on and turn-off time of the flashing beacon: using a conventional light would make detection harder as the time required to turn the bulb on and off would be excessive.

The solution is ultra-bright (and directional) LEDs that can be driven with very high currents; they can be pulsed very quickly (we use them for IR at 38kHz, so 20-30Hz won't be a problem!). We will use orange-red LEDs in the 615-640nm range due to the high millicandela rating of these diodes. Specifically, our emitters have a wavelength of 635nm.

As mentioned, the flag beacons will flash at 20.01Hz and 29.80Hz, essentially 20 and 30Hz, with a 50% duty cycle.



Detecting the Flag Beacon

Detecting the flag beacon is a challenging task: you must examine multiple angles around the robot and look for the 20 or 30Hz signals. This problem is simplified with a good detector, but the problem is still quite complex.

An excellent detector is a photodiode with built-in amplifier, tuned to the correct wavelength of the LEDs. This photodiode needs to be fairly resistant to higher frequency infrared (from the robot beacon, the IR distance sensors, etc), sensitive to a flashing point source, and insensitive to the ambient light.

The Burr-Brown (a division of Texas Instruments) OPT101P is an excellent selection. The datasheet is here. This device is available from DigiKey as part number OPT101P-ND. You will need multiple detectors, each corresponding to a different direction of detection, connected to a PIC that will perform the sampling and filtering required to make sense of the detector's output.

Rami suggests connecting the OPT101P as follows:

There are a number of operating considerations as follows:

  • The OPT101 is a photodiode with an output voltage that changes as a function of the intensity of incident light. This part has a wide acceptance angle. It is not affected by ambient light as long as it is not pointing directly at a very bright source.
  • The OPT101's output is analog. This makes the detection process more difficult, because not only are there two frequencies, but the peak-to-peak voltage of the output changes with the distance from the flag beacon. A graph, below, shows the output voltage vs. distance from a prototype beacon. The range should be extended to 1Vpp at a distance of four feet.
  • The OPT101 is sensative to infrared light (see the datasheet), but it can be used for our purposes without too many problems. The OPT101 will pick up any IR that is at low frequencies, but high frequencies (anything higher than 20kHz) the interference is an amplitude modulation of the existing signal, and can easily be filtered out. This only occurs at very close range, less than 5".
    • So in order to ensure that the detectors are not affected by the IR emitters (required by the infrared beacon) from another robot, try to position both your IR emitters and your flag beacon detectors closer to the center of the robot. Also make sure that the IR emitters on your own robot is not within line-of-sight of the OPT101.
  • The OPT101 will detect both flags at the same time. Instead of detecting 20Hz or 30Hz, the OPT101 will give a 10Hz (30-20=10) output if both flags are being detected by the same detector.

The following graph shows the range of output voltages of the OPT101 and the general response vs. distance. It is not a calibration graph or a specification curve for the OPT101.



PIC Algorithms

Even though the detector gives a well-formed response to the flashing LEDs, the detection process is far from complete. You will need to sample and analyse the outputs from each detector mounted on your robot.

One of the best ways to do this is with a small microcontroller - the MicroChip PIC is an excellent start, and some technical information is available here. Regardless of the microprocessor you decide to use, your algorithm will be quite complicated.

Your microcontroller algorithm must:

  • sample each detector (one PIC should be able to handle at least four detectors, but remember that each detector returns an analog value that must be converted to digital, either before the PIC (external ADC) or through a built-in ADC)
  • record samples for a certain amount of time (I suggest 100ms)
  • analyse the stored samples to determine if a 20Hz signal is present (I suggest counting the number of levels (ie: in 100ms we see three highs and three lows, it's a 30Hz signal) or edges)
  • analyse the stored samples to determine if a 30Hz signal is present
  • indicate to the HandyBoard that a 20Hz, a 30Hz, or both flags have been detected (two digital lines from PIC to HB required)

There's a FAQ question about this topic here.


 
Main Page
|
Course Admin
|
Course Resources
|
Rules & Regulations
|
Team Profiles
|
Photo Gallery
|
Contact Info