Gareth, David, Glen, Chris and I discussed Xbee radio modems. Here are some notes I took.
Watch part I here. Watch part II here.
TAG all your Xbee related content with the tag "xbee", please.
Xbee is a Radio modem system, aimed to replace wires on a serial network. Compared to BlueTooth, it has more features and applications suitable for robotics.
Two Xbee modems out of the box will communicate with each other. They are rigged to communicate on a certain "channel" which defaults to "zero" ("communicate with everyone"). Each Xbee can be configured with a unique "PAN" ID. This will prevent your Xbee from talking with your neighbour's Xbees. Choose the same PAN for all devices that you need to talk with each other.
Lady Ada has this to say about PAN ID: "By default all XBee's use PAN ID #3332. The ID is 4 bytes of hexadecimal and can range from 0000 to FFFF. XBees will only send/receive data to other modems on the same PAN." Compare the SSID in WiFi.
Xbee, like other 2.4 GHz radio data systems (BlueTooth, WiFi) operates in a band of the radio spectrum. Multiple frequencies are available and the device will select the most suitable (available) frequency for the situation.
On top of the standard "wire replacing" point-to-point communications, the Xbees (version 2 or newer) can also do "Meshed Networking". You need to work in "API mode" for this. Meshed networks forward data (in packets) from node to node until they reach their destination. They do not need a human-organized routing table for this, like Internet routers do.
The "get rid of all the cables" application of the Xbee has now been superseded by hobbyists like Gareth. He is trying to prove that you can also replace an expensive many-channel RC transmitter/receiver pair with a couple of Xbees. Most RC plane pilots already rely on Xbee for telemetry feeding back from the plane to the ground. But Gareth wants to see if Xbee would be suitable to actually control hist plane. From the ground to the plane. Potentially risking plane crashes. That is one good reason to build your own, inexpensive plane for experimentation.
Given the 2.4 GHz radio technology, it might be a very bad idea to trust an expensive (or otherwise valuable) vehicle to this radio signal. A dead zone can be hidden behind the smallest of obstacles. Even obstacles on board of your vehicle. It is always a good idea to place an external antenna on your robot, as far away as possible from any potential disturbances like your electronics or motors. Make it stick out or hang off.
But this concern is just as valid for commercial 2.4 GHz RC remote control sets (and for that matter, NASA's communication strategies between Mars and Earth). The difference with "our experiments" is the amount of testing and development put into the existing solutions. You get what you pay for. (Or at least, this is what we are hoping, as tax payers contributing to those Mars missions.)
Confidence in your system can be built up. For example, Patrick starts by building a ground vehicle before he lets his electronics control an air bourne unit. David suggests flying a regular RC plane through conventional controls. Attach a transmitting Xbee on it and evaluate signal quality on the ground based receiver. Or the other way around, for that matter.
Improving range or signal strength. Replace the half wavelength whip antenna (about 2.5 cm) with a bigger antenna. Maybe a dangling wire, maybe a commercial stick like the ones on your WiFi router.
Signal boosting using a "cantenna". Google it and you'll find examples for WiFi or BlueTooth. These would work as well for Xbee. Most gain is derived from noise cancellation, rather than boosting the actual signal.
The beauty of the small Xbee modules (with an SMD antenna on the board) is that they are small enough to place directly inside a metal can, antenna and all. Hot glue!
Alternative directional antennas include Yagi, helix and parabola dish. But designing and building those yourself is a pain. Every millimetre off spec will slash 2% of your wavelength.
Question from the shoutbox by Renkku: how about attaching an external antenna to the screw terminal (on some Xbee boards)? Specifically a "rubber duck" style thingey.
Answer: any 2.4 GHz rubber duck would probably work and improve your signal processing. But you want to connect it directly. No converting connectors please, or you will lose any gain or even some of the original signal.
[continuing my notes here]
Xbees as analog transmission lines. Xbees have some “left-over” pins. Some of those are can be used to read an analog value (voltage). The value can be transmitted (at preset time intervals) for the other Xbee to receive. The receiving Xbee can give out this value again as a voltage (or rather PWM signal).
Possible application: pulling a reset pin low on a microcontroller remotely, so that the digital link can then be used to program it. This enables “over the air reprogramming” of (for example) an Arduino. Gareth will be using this in his RC plane project “Xbee Files”: telemetry about battery voltage.
[This is where the Ustream crashed for a moment. The recorded parts I and II are approx. 3 minutes apart.]
Signal strength is measured and reported by an Xbee in API mode. The radio strength is then simply standard part of the data packet format.
Possible application for this is “the holy grail of robotics”: localization.
Different strategies:
1) directional antennas through “trivial math” and “simple trig”.
The directional antenna would have to be mounted on a panning platform (servo) with decent feedback about its angular position. Relative to North (when the antenna Is on a beacon), or relative to the nose of the vehicle (when on a vehicle).
Compare shielded IR transmitter / receiver pairs.
2) compare four (or three or five, whatever) signal strengths measured on the corners of your robot. See Gareth’s comments below. Or compare to a system the police are using to recover stolen cars (that are bugged with a hidden transmitter), called “LoJack”. (So steal one of their vehicles and hack their system, shouts CompleteTanker).
This could be changed to a system with transmitters on the four corners of the arena where one (or more) bots are roving around.
Tee-shirtable quotes from this show:
“We don’t want the math people to be part of the equation.”
"Stay with your mic and speak your mind!"