GPS Emulator for ArduPilot with Google Maps
This project is used to provide emulated GPS data for the ArduPilot hardware using Remzibi's USB to serial cable. The emulated output will provide feedback for the Ardu's movement commands. It does require a recompile and upload of the firmware to the Ardu so you will need the FTDI cable. The output is then displayed on Google Maps and updated every 5 seconds. Home position and waypoints are shown as well.
For info on Remzibi's OSD: https://www.rcgroups.com/forums/showthread.php?t=921467
To purchase the ArduPilot: http://www.sparkfun.com/commerce/pro...oducts_id=8785
Programming cable for ArduPilot (GET THIS ONE NOT SPARKFUN'S!!): http://store.diydrones.com/ProductDe...L%2D232R%2D3V3
ArduPilot Manual: http://docs.google.com/View?id=ddjmqgw3_43gm6gvggf
Straight Headers: http://www.sparkfun.com/commerce/pro...roducts_id=116
Bind Plug: http://store.diydrones.com/ProductDe...AC%2D0002%2D01
First, you'll need to solder on the headers as shown here: http://docs.google.com/View?id=ddjmq...hardware_87968. The Emulator will only make use of a small number of these connections, but you'll need most of them when it comes time to fly. You'll also need to solder on the MUX jumper shown in the second photo. For this project, I am not making use of the ArduShield.
Next, download the Arduino development environment frm here: http://arduino.cc/en/Main/Software and unzip it into a folder on your PC (ie C:\Program Files\Remzibi OSD).
The ArduPilot source code can be found here: http://code.google.com/p/ardupilot/downloads/list (ie ArduPilot2.2.3.zip). Download this source code and unzip it into a directory. You'll need to copy the EasyStar.h library into the Arduino development environment \arduino-0016\hardware\libraries. Create a subfolder in here called "ArduPilot" and move the EasyStar.h into this folder.
Now download the GPS Emulator from here: http://www.happykillmore.com/Softwar...etup/Setup.exe
This zip file contains the ArduPilot source v2.2's system.pde (modified for use with the GPS emulator), ArduPilot Config Tool and the GPS Emulator software. Copy and paste the source.pde file into your ArduPilot source folder and overwrite the file that was in there.
Next, plug in your FTDI cable and determine the com port. Click Start, Run and enter devmgmt.msc and hit OK. Expand the branch called Ports (COM & LPT). You should see it in the list.
Open the folder C:\Program Files\Remzibi OSD\arduino-0016 and run arduino.exe. Click File, Sketchbook, Open and browse to C:\Program Files\Remzibi OSD\ArduSource\ArduPilot_EasyStar_V22 and open any file in that directory. Next click Sketch, Verify/Compile. If you don't get any errors at the bottom, you're ready to upload the firmware to the ArduPilot.
Uploading the firmware
Now that everything is compiled, click Tools, Serial Port and select the serial port you identified above. You need to plug the FTDI cable in to the ArduPilot and provide 5V power from a BEC or your radio. You can plug the power in to any of the servo input or outputs.
Next click the icon labeled "Upload to I/O Board" in the Ardino software. Keep your fingers crossed. It will take about 30 seconds. A good indicator is to see the amber colored light (status light) after 10 seconds will flash for a second and then go off if it's working. See here for details on the lights on the Ardu http://docs.google.com/View?id=ddjmq...ct_LED_behavio
This is a good time to take a break and calm the nerves. Maybe take a quick walk outside to smell the fresh air.... ah.... what a nice day....
Setting up Waypoints
Run the ArduPilotConfigTool.exe and click on the map to create waypoints. You can drag and drop them in different locations if need be. Please check the "Set Manually" checkbox on the left to set the home location to the lat & long values shown above the check box. If you don't check this, you'll need to use a jumper on D6. You also have the option of checking "Over Terrain" which will take the Alt (to hold) value and add it to the actual alt above sea level and subtract it from the home location's alt above sea level to get an adjusted altitude (you don't need to worry about this right now).
Once you have selected some waypoints, Click File, Save Mission and save the file. Next, click File, Select Port and select your FTDI cable's COM port. Choose your board style under File (probably AT328 if your board is red). Click "Write". Hopefully, all went well. Please note that you did not set your home location during this process. That is done later.
Wiring the ArduPilot for use with the GPS Emulator
To wire up the USB to serial to the ArduPilot, you're going to need to connect the ground wire to the top left corner (marked GND) or to any of the grounds (marked "-") on the servo input/outputs. The Blue wire goes to TX0 and the white to RX1.
Next you'll need to provide 5V power from either your RX/ESC or from a BEC (as shown below). If you have the "old" 4-wire OTI USB to Serial from Remzibi, you can power the board using the red and black in the top left corner.
You'll also need jumper the D6 pin to the pin to the left of it (GND). This is the "safety"/set home position jumper. BE CAREFUL not to jumper the GND to the unlabeled pin to it's left. I released the magic smoke from my ArduPilot that way!!!
Finally, you need to connect a servo tester or your RX on a channel with a 3-position switch to the servo input labelled CTRL. The down position is normal flight mode (no auto-pilot). Middle position is Waypoint mode (will fliy on auto-pilot from home to all of your waypoints and then back home and will repeat). The up position is RTL (return to launch) / return to home. I'm not sure what it does when it gets home because I fried my board before I could test it.
Using GPS Emulator
Now you can run the GPS Emulator program (C:\Program Files\Remzibi OSD\GPSEmulator.exe). You need to select the right COM port for your USB to serial cable (Start, Run, devmgmt.msc) and 9600 baud and 5Hz. I find it helpful to click NMEA, Show NMEA Output so I can watch what's being sent and what's being received.
Connect the 5V power to the ArduPilot with the D6 + GND jumper attached. With the GPS emulator running (you may have to hit Connect and Start if this is your first time running it) you should see the blue light on the ArduPilot blink very fast and then turn off. Now you can remove the D6 + GND jumper. Now the blue light should come on solid indicating GPS lock. At this point, flip your control servo input to the middle position (waypoint mode) and check the checkbox labelled "Read Data from ArduPilot"....
FINALLY! It's flying on it's own!!! You should see the waypoints on the map and a purple line being drawn. The update speed is once every 5 seconds because too much processor time was being taken up by drawing the map and it was making the program crash.
In your C:\Program Files\Remzibi OSD folder is an output file called Maps.html. It contains the source for what you were looking at in the output window. A sample can be found here http://www.happykillmore.com/softwar...iOSD/maps.html
ImagesView all Images in thread
Last edited by HappyKillmore; Oct 11, 2010 at 07:10 PM. Reason: New link to setup.exe
|Category||Thread||Thread Starter||Forum||Replies||Last Post|
|Cool||Using google Sketchup for modeling... With practical examples||davereap||Foamies (Scratchbuilt)||1365||Yesterday 08:03 AM|
|Discussion||Cheap GPS for ArduPIlot 2?||mallettron||UAV - Unmanned Aerial Vehicles||9||Apr 18, 2009 11:39 AM|
|Ideas for making $$ with an E-plane||maciek||Electric Plane Talk||7||Aug 07, 2001 07:31 PM|
|Anyone knows best place best price for AF010 with vari-ESC||jas_Qfix||Electric Plane Talk||1||Jul 24, 2001 11:56 AM|
|Which URL to go for AF010 with Variable ESC?||jas_Qfix||Electric Plane Talk||6||May 14, 2001 09:45 AM|