You may have noticed that we had wireless telemetry in our flight testing last week. It's really easy to add.
The first thing to keep in mind is that you should use Xbee modules in a different frequency range than your RC equipment.
If you've got 72Mhz RC gear, you can use 2.4Ghz Xbee modules. We use Xbee Pro wireless modules with a Adafruit adapter board on the aircraft side, and a Sparkfun USB adapter board on the ground/laptop side.
If you've got 2.4Ghz RC gear, you should use 900Mhz Xbee modules. We use a Xbee Pro with the wire antenna for the aircraft, and and Xbee Pro with a SMA antenna connector (and a good 900Mhz antenna) on the ground, with the same adapter boards as above.
Next, you need to set up your Xbee modules. They ship with a default of 9600bps, which you must change to 4800 bps for ArduPilot 1.0 or 57,600bps for ArduPilot 2.x. Connect them with your FTDI cable (see instructions here) then use Digi's X-CTU utility to change the baud rate to 4800 or 57,600 (in the modem configuration tab--press the Read button and then click on and change the baud rate line). You should also give them unique Network IDs so they'll be paired. Just use any 3-digit number, and just make sure you've set it the same on both modules. (Don't use 999 if you're going to be flying around me--that's mine!). When you're done with the settings, click "Write". Remember that after you change the baud rate you have to switch back to the PC Settings tab and change the baud rate there, too, or the utility won't be able to communicate with the module. (Switch it back to 9600 when you're switch to the second module, if it's still in the default mode, and repeat the process.)
On the ArduPilot side, use three jumper wires to connect the following pins circled in red on the board below:
--Xbee RX to ArduPilot FTDI port TXO
--Xbee 5v+ and GND to the VCC and GND pins next to the FTDI port.
It will end up looking like this:
(Note: the above is to get telemetry from the Autopilot. If you just want to see the NMEA data from the GPS module, connect the TX pin to ArduPilot's RXI pin, right next to the to TXO pin, instead.)
On the ground side, connect the other Xbee module to your laptop with your FTDI cable, as described here.
That's it! If you open up a terminal program on your laptop and set the baud rate to 4800 or 56,000, depending on which ArduPilot software version you're using, you should see ArduPilot telemetry coming in. Anytime there is a "Serial.println" in the code, that data will be sent through the Xbees to the ground. You can record any data you want, and even GPS datalog from the ground! Couldn't be easier.
BTW, if you want to test the range of your Xbee link, connect the plane-side Xbee module's RX and TX pins together to create a loopback circuit and use the X-CTU utlitity's range test function. For the modules we're using you should get around a mile.
Once you've got the wireless connection set up, you can use our Ground Station to display real-time telemetry with ArduPilot 2.1 and up:
Hi-
Can someone tell me which Xbee modules I need that are 900 MHz that work with ardupilot? I have a 2.4 Tx/Rx,so I'm assuming I need 900 MHz telemetry. Thanks
I've been playing around with my two Xbee Pro modules and have a question. If I hook up my locosys GPS programmed according to Jordi's instructions (i.e. 5hz update rate, 38400 baud), directly to my computer using the FTDI cable, I get about 5 readings per second. As soon as I hook the GPS up to the Xbee and use the wireless link, the rate goes way down. The data just sort of trickles in at a much lower rate. Both Xbees are set up to 38400 baud rate. Have anybody else noticed this? What might the problem be?
thanks for the clarification... i also bought 60mv xbee-pro modules and waiting for my ardupilot board to make an actual test... i saw that sparkfun has shipped my backordered boards and i am anxious to receive them..
True, although for the sort of basic debugging and status telemetry we're sending now 4800 is fine. When we advance to built-in stabilization with a glass cockpit ground station, we'll want to be sending at least 10Hz attitude data and we'll move to a faster data rate then.
To follow on to what Jordi said, the telemetry is slaved to the GPS baud rate. If you switch to another GPS module with a higher baud rate, you can move your telemetry up to that, too.
i have 2 xbee-pro modules and i tested them with arduino and arduino ide, i used 9600 baud rate in the test and it worked flawlessly, why do we need to drop down to 4800 baud?.. for the range and price conversation, may i note that $20 xbees are 1-2mv models and their range is not more than 100meters. you have to use $40 xbee-pro modules on the aircraft for 1mile range.. just a note... :)
Comments
do we need a logic level converter to connect the 3.3v and 5 v signal?
http://www.sparkfun.com/commerce/product_info.php?products_id=8745
will i fry the xbee if connect directly to ardupilot?
Can someone tell me which Xbee modules I need that are 900 MHz that work with ardupilot? I have a 2.4 Tx/Rx,so I'm assuming I need 900 MHz telemetry. Thanks
thanks,
-tychoc
True, although for the sort of basic debugging and status telemetry we're sending now 4800 is fine. When we advance to built-in stabilization with a glass cockpit ground station, we'll want to be sending at least 10Hz attitude data and we'll move to a faster data rate then.