3D Robotics

ArduPilot Assembly Instructions

Welcome to ArduPilot! Here's how to compete your new board: You should have received the basic ArduPilot board with all surface-mount components already soldered and the essential firmware already loaded on the chips. All you've got to do now is to solder on some connectors and load the autopilot software. For this first part of that you'll need a strip of breakaway headers, and three female-to-female servo connectors. You'll also need an FTDI cable if you don't already have one. The first thing to do is to solder on the connectors. Many of the holes on the board are for optional upgrades, such as sensors and additional RC channels, but for the basic board you only need to solder on three breakaway connectors. From your strip, use a pair of pliers or a snipper to cut off two 3-pin segments and one eight-pin segment.

First, solder the two 3-pin headers and the one 8-pin header in the circled holes above. The long side of the headers should be on the side with the chips. The easiest way to do this is to place all the pins in the holes, then place a pad of paper on top of the pins. Holding the board and the pad, turn them over so the board is on top of the pad, with the pin nubs showing through the board. Then solder just on pin in each segment. Turn the board over again and make sure the connectors are straight (if they aren't remelt the solder joint on the one that's tilting and finger-push it upright...make sure you're not touching the pin you're heating!). If they're all straight, solder the rest of the pins.

Next, we'll solder on the RC inputs. You can either use three more 3-pin headers in the holes circled in red above (in which case, you'll need female-to-female cables to connect to your RC receiver), or make and use "pigtails" instead, which is one less connector to potentially fall off. If you want to make the pigtails, cut two 12" female-to-female connectors in half, and split the wires on each end down about a half of an inch. Strip the insulation of each about 1/8th of an inch in. Now we're going to solder them in in the three sets of holes marked in red above. Black goes on the outside. This is a bit of a fiddly soldering job and it's easier with a helping hand. If you'll be using the ArduPilot 2.0 or above code, you'll need to add a few more connectors for sensors and a calibration jumper. Solder a five-hole female machine pin header strip in the five holes marked in blue at the top in the picture above. Then solder a regular two-pin header in the holes marked in blue at the bottom. [Note: the board comes from the factory set up to get power from your RC system. If you want to power the board from a separate power source, you can do so--the board has a built-in power regulator that can take power from 5v-15v. Instructions to make that change are here.] Now the basic hardware is complete. It should look like the below (connectors just used in ArduPilot 2.0 and up are marked in blue):

If you are making an ArduPilot 2.0 or above, you must now connect the FMA sensor to the ArduPilot board. Instructions for doing that are here. Now it's time to connect everything, plugging your female-to-female cables (or pigtails) into your RC receiver. CTRL should go to channel 5 or 6 (whichever has a toggle switch; if you're using ArduPilot 1.0 the other channel, which should have a knob, will be used to control the FMA Co-Pilot). For ArduPilot 1.0: Input 1 should go to your receiver's Channel 3 (throttle) and Input 2 should go to Channel 4 (rudder). Then plug your ESC (motor speed controller) in the ArduPilot Out 1 and the rudder servo into ArduPilot Out 2. Here's a diagram that shows all the components and how they should be connected (Rx is your RC receiver and ESC is your electronic speed controller):

Here's what ArduPilot 1.0 looks like in real life:

ArduPilot 2.0 and above: Input 1 should go to your receiver's Channel 1 (aileron) and Input 2 should go to Channel 2 (elevator). If you've got a three-channel plane like an EasyStar, connect the rudder servo to Out 1. For a four-channel plane with ailerons, connect the aileron servo to Out 1 (the rudder, which ArduPilot doesn't use in this configuration, can remain connected to your RC receiver for manual use). The elevator servo should be connected to Out 2, as shown below. Throttle is connected directly to the RC receiver; it is not used by ArduPilot in this configuration. Here's a diagram that shows the whole setup:

Software Now it's time to load the software. Download and install the latest version of Arduino, if you don't already have it. First, it's best to run some test code to ensure your board is set up properly. Dowload "ArduPilotNE" from our Google Code repository. This code just flies the plane in the NorthEast direction, so you can test it in the air, but for now, let's just test it on the ground by walking around with the autopilot on and GPS locked and watching the rudder move, as shown in this video: To load this code, power on the board by plugging your ESC into a battery or using some other 5v power source (do not attempt to just power the board with the FTDI cable. We did not connect the power pins on the FTDI port to the processor to avoid power conflict when the board is powered by the Rx and you're using the FTDI as a serial monitor). The red power LED should go on. Now plug your FTDI cable into the board (with the black wire or, in the case of the Sparkfun board, the GND pin on the side marked "BLK") and plug it into your computer's USB port. Here's what the Sparkfun FTDI board looks like when it's plugged in properly:

Then in the Arduino software in the "Tools" menu make sure you've selected the right serial port (the FTDI cable will create a new one, which is probably port 5 or higher). Also ensure that the board selected is "Arduino Diecemila or Arduino Duemilanove w/ATmega168" if you have one of the older 168-based boards, or .Arduino Duemilanove w/ATmega328" if you have the newer 328-based boards. At this point unplug your GPS module if it was plugged in. The Arduino code will not load if the GPS module is attached, because they share the same serial port. Once you've uploaded the code, you can plug your GPS module back in. Please remember this in the future as you're uploading code: you must ALWAYS unplug the GPS first. Load the ArduPilot "sketchfile", ardupilot.pde, which will load the rest of files in tabs. Now press the "Upload to I/O board" icon (the little arrow point to the right). Nothing should happen for about 30 seconds, and then at the bottom the software should report that the sketch was successfully uploaded by reporting "Done uploading" and reporting the Sketch size. If not, check out the Arduino debugging tips here. [Note: if you're still having trouble, you can upload the code with AVR Studio using the AVRISP2 programmer. Just connect to the Atmega168 chip following these direction, and program it with the ardupilot.hex file that Arduino creates in your ArduPilot folder's Applet subfolder.] Now you can disconnect the FTDI cable, reconnnect the GPS module and do the ground test as shown above. For this one, use the ArduPilot 1.0 connections: connect the throttle channel (Rx channel 3) to ArduPilot's Input 1 and the rudder channel (channel 4 from the Rx) to ArduPilot's Input 2. The toggle channel (Rx channel 5) should go to the ArduPilot's CTRL input. The ESC should go to Out 1 (you can disconnect your motor from the ESC, since you'll be testing this on the ground) and the rudder servo should go to Out 2. If your rudder servo is reversed (it would turn the plane in the opposite direction from that required to go NorthEast), look in the first tab of the code and change the number to 0: #define reverse_yaw 1 // normal = 0 and reverse = 1 [NOTE: If for some reason you have run the ArduPilot 2.x code first--naughty! follow the instructions!--the NE mode code won't work. That's because the 2.x code programs the GPS module into binary mode, while the NE code requires NMEA mode. All is not lost, however. If you let the GPS sit without power for a week or so, the internal capacitor will run down and it will return to its default NMEA mode and you can use the NE code again.] If everything checks out, you can now run the full autopilot. Download the latest ArduPilot code (1.x or 2.x, depending on which hardware configuration you want to use), which can always be found on the ArduPilot home page. Repeat the loading process as above. Congratulations! You have a functioning autopilot. You can now plug the GPS module back in and test the basics by toggling your enable channel (5 or 6, whichever you've connected) and confirming that the "MUX" status LED turns on and off. If you're using ArduPilot 2.0 and above, you now you need to go through the initial setup process for the GPS and/or sensors (depending on which version of ArduPilot you're using). Instructions for that are here. For version 1.0, there is no setup process. When the autopilot is enabled, it should move the rudder servo a few degrees in one direction on its own (it is doesn't, you may have reversed your channels--make sure that throttle is in Output 1 and rudder is Output 2). Also, if you're outside or near a window, your EM406 GPS should get a lock after a minute or two. When the LED starts blinking on the GPS module, a blue LED ("Lock") should light up on the ArduPilot board to indicate sat lock. A table showing all correct LED displays in each ArduPilot mode is here. Next, you can learn about using Arduino to set up an autonomous flight here.
E-mail me when people leave their comments –

You need to be a member of diydrones to add comments!

Join diydrones

Comments

  • Yes, I've followed the steps for reloading the bootloader as described in the "Reloading the Arduino bootloader with AVR Studio" post. The only snag was that I had to set the ISP frequency to 125 kHz while doing this, since leaving it at 2 MHz seemed to be causing problems with erasing the device before uploading the bootloader data. I think this is contrary to a step described in this other post, which I followed the first time I tried using my AVR programmer.

    So, when I try to upload ArduPilot code from the Arduino IDE, I notice that the TX LED on my FTDI breakout board just blinks three times, then the IDE returns the error message that I posted earlier. The RX LED never does anything.
  • 3D Robotics
    That's correct, then. We don't use the VCC on the FTDI port to avoid power conflicts with powered FTDI cables. It sounds like your power is fine. (Tychoc had 2.3v across the board, so his problem was different).

    Am I right in understanding that you've now successfully loaded the bootloader with AVR Studio, using all the correct fuse and lock bit settings as described in this post?
  • Chris,

    I'm powering the ArduPilot board from my Tamiya TEU-103 BK ESC, which is connected to ArduPilot OUT 1. The voltage from this is ~6v.

    I was getting ~6v between the top two pins (GND and VCC) next to the 6-pin FTDI (circled in red below). It was when I tried the other VCC and GND pins (circled in blue below) in various combinations, that I got 0.2v.


    I have the second version of the board with the solder jumper. Thanks again for your help.
  • 3D Robotics
    A few answers:

    --That alternating LED pattern you get when the boards come from the factory is just a Sparkfun LED test routine. We erase it when we load ardupilot.

    --All voltages should be between 4.7 and 6v. If your GND and VCC voltage on the pins adjacent to the six-pin FTDI is reading 0.2v there is something very wrong. Do you have the first version board, where you need to jumper the PSEL pins (if so, please confirm that you have jumpered those pins), or the second version with the solder jumper? It would help me if you could tell me exactly how you're powering the board.
  • Chris,

    I have tried loading the bootloader using the IDE, but to no avail. I also tried it in AVR Studio, but was having difficulties with erasing the chip, but I thought that decreasing the ISP frequency from 2 MHz might work, and seemed to be successful after that. As I mentioned, I have two ArduPilot boards, and only tried reloading the bootloader on one of them, but I am not able to upload code to either one.

    Also, I noticed that after I received my new boards from SparkFun and applied power from my ESC, the GPS Lock and STAT LEDs would blink in a successively faster way in a regular alternating pattern. I wasn't sure what to make of this, but it might be relevant to my problem. After I reloaded the bootloader on one of my boards (after modifying the ISP frequency), this didn't happen anymore, and the only LED lit was the PWR one.

    Also, I measured between all VCC and GND pins on both of my boards, and got around 5.9v between the two adjacent VCC and GND pins that are on the 8-pin header. On the other pins, such as between the other VCC on the 8-pin header (third from the bottom) and the same GND, and between both of these VCC pins and the GND on the row of holes on the bottom of the board, I get around 0.2v. This is the case for both of my boards, so based on what you said about tychoc, I may have some damaged components as well, and may need to contact SparkFun about this. Thanks so much for your help.
  • 3D Robotics
    PS--Tychoc's board had a damaged component, and was only running at 2.3v as a result. You should measure ~5v at any V+ and GND on the board. You can't load code if the processor is running due to low voltage.
  • 3D Robotics
    That's the standard error message. I'll assume you've run through the checklist here.

    If so, please go into AVR Studio and erase the chip. Then, with the AVRISP2 programmer still connected, use the Arduino's IDE to load the correct bootloader. On reset the yellow status LED should blink every few seconds, showing that it's looking for the Arduino IDE to load code. Then it should work.

    You may have trouble using the AVRISP2 programmer with the Arduino IDE as per this driver conflict problem. If so, use AVR Studio to load the bootloader directly as per these instructions.
  • Hello everyone. I am having the same problem as tychoc: I received my two new boards back from SparkFun last week (to clear the CKDIV8 fuse), but now I can't upload sketch files to either of my boards, and when I try, I get the following error message:


    I just got an AVR programmer, and have already tried reloading the bootloader, but this hasn't worked for me. Does anyone have any suggestions? Should I contact SparkFun about this problem? Thanks.
  • This is my first time to turn off the default "fuse" and upload hex files to Attiny45 & ATmega168 ,I also came across the "error:test3 " problem before .But at the end,I found out that it was due to incorrect process when I tried to compile the Ardupilot.zip files by Arduino software.I have added all of the .pde files to the compiler,instead of open the Ardupilot then followed by adding the rest of the supporting .pde files to the Arduino software.After a struggling of half an hour with the software,I finally made the MUX and autopilot working.I highly recommend to have a AVRISP programmer rather than a FTDI cable for programmer the board.
  • Great...thanks Chris! Win
This reply was deleted.