Getting Started With the ArduPilot
ArduPilot Hardware Notes
I recently purchased a $24 ArduPilot circuit board from Sparkfun. I have tried to document my early experience using this unique Open Source Autopilot. The board comes from Sparkfun without any 0.1" header pins so it is up to the end user to do some soldering.
I started assembling the circuit board by cutting off a handful of 0.1" Male Terminal Pins from a strip.
I used a bent soldering tip with my Ayoue solder station to solder in the header pins. I find the bent soldering tip helps get the soldering iron in closer to the circuit board which makes it easy to solder the pins.
I made sure to keep the soldering iron clean by occasionally wiping it on a damp sponge. This removes dirt and soldering residues and keeps the tip temperature more constant.
Below is the assembled circuit board with all of the required header pins to allow 3 servo channels to be used. I decided, since I am using the ArduPilot with a 3 channel Multiplex EasyStar model airplane, I would skip soldering in the 4th servo channel.
I installed the EasyStar servos in the tail so I had two available storage compartments near the front of the plane. I enlarged one of them to hold the ArduPilot circuit board.
I purchased a FMA Direct Co-Pilot CPD4 thermal flight stabilizer to use it with the ArduPilot. The Co-Pilot sensor uses 4 thermopile sensors to measure the airplane's pitch and roll. This sensor is capable of working in day or night.
I cut off the end of the Co-Pilot cable and crimped together two - 2 position 0.1" connectors. The red line on the Co-Pilot cable IS NOT the positive power line!
For this project I purchased a 0.1" servo crimper from Thunderbolt RC for $32 USD. The ratcheting crimper works well and is a handy thing to have. It takes a few crimps to get the crimping technique worked out. I find it works well if you put the connector in the die first and ratchet the crimper jaw just enough to hold the connector in place. Then all you have to do is insert the stripped wire and finish the crimp.
After you crimp the connectors onto the three wires they are ready to go into the connector housings.
If you want to remove a servo cable from the housing, all you have to do is use a small tool to lift up the plastic tabs on the back of the housing that holds the metal contacts in place. The wires can then easily be removed.
I used a Locosys 3.3 Volt GPS with the ArduPilot so I had to make up a special cable to interface the GPS with the ArduPilot that lowered the voltage from 5 volts down to 3.3 volts. For the first few launches I decided to manually control the throttle. This meant that I had to use a small jumper pin to perform the ArduPilot field setup procedure.
This is my ground setup at the flying hill. I have a 10 foot long 1/2 picnic table that is quite handy for holding all of my flight gear. I fly with a 900 MHz video link that provides 500 mW of output. I purchased a DPCAV 900 MHz antenna filter that reduces a lot of the excess interference from the video transmitter. This is required if you want to have a GPS that will actually work on the same plane as the 900 MHz video transmitter. I use a 900 MHz patch antenna on the ground and it can receive a video signal from up to 3.5 km away.
I use a Mac Book Pro laptop with an Easycap DC60+ USB video digitizer along with the Videoglide software driver to record FPV video. The cardboard box is painted black on the inside and the black curtain blocks out sunlight. I have to mention if you buy a laptop to watch video outdoors, try and get a screen that has a matte finish. Glossy screens are horrible because the are very reflective and are hard to see outdoors!
ArduPilot Software Notes
This was the first project I have done that used Arduino. You can download Arduino for free from here.
I tried a few different versions of the ArduPilot software but decided to use the ArduPilot 2.6.2 software. The ArduPilot software can be downloaded from here.
To compile ArduPilot, it takes about 25 seconds on a dual core 2.16 GHz Apple MacBook Pro laptop. To configure and setup ArduPilot, you have to edit the AP_config.h file in Arduino.
Every setup is different based upon the plane you are flying and the components you use. Below are the most important settings I flew my first few flights with:
#define SHIELD_VERSION -1 // Old (red) shield versions is 0, the new (blue) shield version is 1, -1 = no shield
#define AIRSPEED_SENSOR 0 // (boolean) Do you have an airspeed sensor attached? 1= yes, 0 = no.
#define GPS_PROTOCOL 0 // 0 = NMEA, 1=SIRF, 2=uBlox, 3 = ArduIMU, 4 = MediaTek, 5 = Simulated GPS mode (Debug), -1 = no GPS
//0-4 Ground Control Station:
#define GCS_PROTOCOL 0 // 0 = Standard ArduPilot (LabVIEW/HappyKillmore), 1 = special test, 2 = Ardupilot Binary(not implemented), 5 = Jason's GCS, -1 = no GCS (no telemtry output)#define ENABLE_Z_SENSOR 0 // 0 = no Z sensor, 1 = use Z sensor (no Z requires field calibration with each flight)
//0-6
#define XY_SENSOR_LOCATION 1 //XY Thermopiles Sensor placement
//Mounted right side up: 0 = cable in front, 1 = cable behind
//Mounted upside down: 2 = cable in front, 3 = cable behind#define THROTTLE_FAILSAFE 0 // Do you want to react to a throttle failsafe condition? Default is no 0, Yes is 1
#define THROTTLE_PIN 11 // pin 13, or pin 11 only (13 was old default, 11 is a better choice for most people)// Flight Modes
// these Flight modes can be changed either here or directly in events.pde
// options are MANUAL, STABILIZE, FLY_BY_WIRE_A, FLY_BY_WIRE_B, AUTO, RTL, LOITER
//0-8
#define POSITION_1 MANUAL
//0-9
#define POSITION_2 MANUAL
//0-10
#define POSITION_3 STABILIZE
/***************************************/
// AIRFRAME SETTINGS
#define MIXING_MODE 0 //Servo mixing mode 0 = Normal, 1 = Elevons (or v tail)// NOTE - IF USING ELEVONS, 1-2 AND 1-3 SHOULD BE 1
#define REVERSE_ROLL -1 //To reverse roll, PUT -1 to reverse it
#define REVERSE_PITCH 1 //To reverse pitch, PUT -1 to reverse it//1-8
#define PITCH_TRIM -500 // 0 default setting (Degrees * 100) allows you to offset bad IR sensor placement
#define ROLL_TRIM 0 //0 default setting (Degrees * 100) allows you to offset bad IR sensor placement/***************************************/
// RADIO
#define AUTO_TRIM 1 // 0 = no, 1 = set the trim of the radio when switching from Manual
#define SET_RADIO_LIMITS 0 // 0 = no, 1 = set the limits of the Channels with the radio at launch each time; see manual for more
#define CH1_MIN 1362 // 1000(Microseconds) Range of Ailerons/ Rudder
#define CH1_MAX 1925 // 2000 (Microseconds)
#define CH2_MIN 1150 // 1000 (Microseconds) Range of Elevator
#define CH2_MAX 1720 // 2000 (Microseconds)
My most important advice to get you started is to get the ArduPilot test suite. You need to run the radio test and find out the upper and lower ranges for your servo channels. This will make your first flight with the stabilize mode more relaxing. I am using a Hitec Optic 6 radio and the ArduPilot stabilize mode was far too sensitive at first when combined with the EasyStar rudder modification.
Depending on how you installed your servos you may have to enable a -1 value for either REVERSE_ROLL or REVERSE_PITCH. I had to use a -1 value with the REVERSE_ROLL setting.
I am using a Locosys LS20033 GPS at 38400 baud so I needed to set my GPS_PROTOCOL to 0 for NMEA support. I think I put the GPS a bit too close to the 900 MHz video transmitter because the Locosys GPS took about 3 minutes to get a satellite lock. I programmed the Locosys GPS to run at 38400 baud and update at 5Hz using the MediaTek MiniGPS_1.41.exe program. I had to use the "write settings into flash ram" option to save the settings. There is a limited number of times you can save the settings. After the GPS has been programmed to run at 38400, ArduPilot can then set custom MediaTek MTK values at startup.
I don't have a datalink right now and when I tried to set the GCS_Protocol to -1, I got a compile error so I left it at the default.
The radio I use, a Hitec Optic 6 only has a 2 position switch, not a 3 position switch so I set both POSITION_1 and POSITION_2 to MANUAL, and Position_3 to STABILIZE. On the Hitec Optic 6 radio you have control over the POSITION_1 and Position_3 settings.
Something important to remember is that the serial port you upload your revised ArduPilot code with is shared with the GPS. Always unplug your GPS cable when uploading new firmware! If you forget to unplug your GPS when uploading new code you will get an error and the upload will fail.
Before you do your first launch make sure the plane responds on the ground how you would expect it to when in stabilize mode.
I didn't purchase the ArduPilot shield so I don't have the airspeed sensor. You would want an airspeed sensor with a pitot tube if you are flying on windy days so the autopilot knows the true airspeed. Since I don't have the ArduPilot shield I needed to set the SHIELD_VERSION to -1, and the AIRSPEED_SENSOR to 0.
If you don't have a fail-safe receiver you will have to keep the autopilot within R/C control range or it will not operate properly. The ArduPilot Return to Launch feature requires a fail-safe compatible receiver.
When ArduPilot was flying my EasyStar in Stabilize mode I had to add 5 degrees of upwards pitch trim correction to keep the plane from descending. I needed to enter the 5 degrees of upwards trim as PITCH_TRIM -500.
If you are going to use the ArduPilot Waypoint Configuration program ConfigTool you need to have the Microsoft .NET Framework 2.0 installed on Windows and be connected to the internet. I was able to run this program using VMWare on my Mac. You will need to create your waypoints at home before you go to the flying field if you don't have internet access at the field. I haven't tried the Waypoint_writer_25 arduino program in the ArduPilot test suite yet but it can transfer waypoints to your ArduPilot's EEPROM memory as well.
My EasyStar model airplane has a gross vehicle weight of 1152grams with a 3S1P 4400 mAh LiPo battery, 2200 KV brushless motor mod, the ArduPilot, a Locosys GPS, small video camera, and a 900 MHz video transmitter.
The 3S 4400 mAh Lipo battery just barely fits into the cockpit of the EasyStar but provides over 35 minutes of flight time at 50% throttle.
I purchased a Sparkfun FTDI serial cable and it works really well with Mac OS X. The drivers were easy to setup and I didn't experience any problems. If you start up your ArduPilot on your model airplane with the FTDI cable connected and with the Arduino Serial Monitor open you can see diagnostic information.
In the Arduino Serial Monitor, the value RLL is your Co-Pilot Roll value. The PCH value is your Co-Pilot Pitch Value. THH is the throttle value. When you have a GPS lock you will get the occasional GPS position string printed as well. If you haven't got a GPS lock yet you will see the occasional error message.
I almost had a fly away plane when I first used the RTL - Return to Launch feature. It was a windy day in West Dover with 25 km/ hr winds and the EasyStar airplane was pitching and rolling quite a bit. I think the GPS satellite signal quality was effected by the video transmitter proximity to the GPS and the banking of the plane. The plane was doing large circles at first in RTL mode above the runway but then the plane started migrating away from the launch site. I turned off the RTL feature when the plane was getting pretty small and flew it back to the launch site under manual control.
I hope this guide helps you get your ArduPilot into the sky. Good luck and happy flying!
Cheers,
Andrew
2 Responses to “Getting Started With the ArduPilot”
Leave a Reply
Note: Comments will have spelling errors corrected before they are posted. If you have a specific question please provide your email address so I can send you a direct reply.




















Hi Andrew....
Nice article....I haven't tried my Ardupilot for over a year....I am 75 and I have trouble picking up where I left off....I Think my GPS module is a 406 type....I have the two boards piggy backed and the shield one is red not blue....There is one pressure sensor and two thermopiles...
I tried it out over a year ago but never had much luck so I put it aside and now that winter is coming I would like to try it again....Just wondering if you have had much luck with the new software ? ....
De VO1ET Jerry
I've only used the ArduPilot version 2.6 firmware. I haven't done too much with the ArduPilot since my first tests because I have experienced a lot of GPS jamming from the close proximity of the Locosys GPS on my EasyStar to my 900 MHz video transmitter.
If you haven't used your ArduPilot in a while, make sure to run the ArduPilot Test suite once to confirm all of the sensors and modules are responding properly and as you would expect.
http://ardupilot.googlecode.com/files/Test%20suite.zip
Good Luck and Happy Flying!
Andrew