3D Robotics

ArduPilot (Legacy) main page

 

3689315381?profile=original

 

[This original ArduPilot board, now called the "Legacy ArduPilot" is no longer produced or officially supported by the DIY Drones dev team, and this page is maintained just for historic reasons. However, there are still many users of it out there and it still works fine. The user group for Legacy ArduPilot users, for both thermopile and IMU use, is here.]

 

ArduPilot is a full-featured autopilot based on the Arduino open-source hardware platform. It uses infrared (thermopile) sensors or an IMU for stabilization and GPS for navigation. It is the autopilot used to win the 2009 Sparkfun Autonomous Vehicle Competition.

The hardware is available from Sparkfun for $24.95. An expansion board ("Shield") kits that includes an airspeed sensor, a 3.3v power regulator for 3.3v GPS modules and other sensors and cables and connectors for easy attachment of the XY and Z sensors, is available from our own store for $57.20.

 

User f

ArduPilot features include:

  • Can be used for an autonomous aircraft, car or boat.
  • Built-in hardware failsafe that uses a separate circuit (multiplexer chip and ATTiny processor) to transfer control from the RC system to the autopilot and back again. Includes ability to reboot the main processor in mid-flight.
  • Multiple 3D waypoints (limited only by memory)
  • Altitude controlled with the elevator and throttle
  • Comes with a 6-pin GPS connector for the 4Hz uBlox5 or 1hz EM406 GPS modules.
  • Has six spare analog inputs (with ADC on each) and six spare digital input/outputs to add additional sensors
  • Supports addition of wireless modules for real-time telemetry
  • Based on a 16MhZ Atmega328 processor. Total onboard processing power aprox 24 MIPS.
  • Very small: 30mm x 47mm
  • Can be powered by either the RC receiver or a separate battery
  • Four RC-in channels (plus the autopilot on/off channel) can be processed by the autopilot. Autopilot can also control four channels out.
  • LEDs for power, failsafe (on/off), status and GPS (satellite lock).


Resources:

ArduPilot requires the free Arduino IDE to edit and upload the code to the ArduPilot board.



The code is currently optimized for the Mutiplex EasyStar three-channel powered glider and FMA sensors, but can be modified for other aircraft and sensors. It uses the rudder/ailerons and elevator to maintain level flight and navigate to GPS waypoints. It supports a desktop setup utility and ground station software. It also includes a "fly-by-wire" mode that simply stabilizes RC flight. The main code is ArduPilot2.x.zip in the download section of our Google Code repository, where x is the latest version.

What you need to make a fully-functional autopilot:


Open source extras:

  • If you want to build your own board from scratch, the necessary files and component lists are here.
  • [Note: you shouldn't need this, since this code is loaded on the ArduPilot board at the factory] Latest multiplexer code (for the board's second processor, an Attiny, which runs the failsafe system) is here.
    Instructions for loading this code are here.



Recommended UAV setup:

3689303688?profile=original


Airframe option one: Hobbico SuperStar (49" wingspan, $95, shown above). This is an inexpensive, good flying high-wing trainer with ailerons. It can be hand launched in a park or take off from a runway, and replacement parts are readily available in case of a crash. If you want much better performance with this aircraft, you can upgrade it to a brushless motor, speed controller and a LiPo battery. [If you don't already have one, you'll also need a balancing charger and power supply.] Note: any stable aircraft with both ailerons (for stabilization) and rudder (for navigation) can work, so feel free to experiment with what you've got.

3689313666?profile=original


Airframe option two (recommended for ArduPilot 2.x): EasyStar (shown above). Performance can be improved with the modifications described in this post.

You'll also need:

  • A six or seven channel RC transmitter and receiver, with at least one toggle switch (ideally three-position but two-position will work, too, although you will have to mix channels to have access to both autopilot modes in the air), such as the Futaba 7C.
  • Some servos (at least three for ArduPilot 1.0; at least two for ArduPilot 2.x) and at least three female-to-female servo cables to connect the RC receiver to ArduPilot.


Cool optional extras for your UAV:

E-mail me when people leave their comments –

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

Join diydrones

Comments

  • Nigel,
    happy to hear that!

    you're very welcome, i'm happy to help as some of us on DIY drones helped me before!!!
  • fefenin
    That was a lot better. The controls were much more responsive. The rudder moved much more, and clearly in the fake-bearing walk-around test.
    I then drove the carpark route, again following the rudder movements in my car, and it took me to all 11 waypoints and then back to the beginning again. Excellent progress, many thanks!
    Nigel
  • T3
    I increased the settings for the mentor as suggested by chirs, the plane now seems to turn much better but I have to add more to the elevator because it still just floats down or stays at current elevation.

    I have to find where I set the elevation for the plane to hold, maybe it is set too low.

    Finally I must have lost gps lock because the plane just decided to fly away... I left it in autopilot (assuming I still had stabilization) and it was almost completely out of sight... so I did a little rudder and she finally came around and I could see it... scary haha
    1
  • Hi,
    Thanks for this. I have incorporated the different settings into a new version of my easystar.h file. I have only included the changes that do not relate to reversing the direction & gps type etc.
    I will test this evening when back home & will let you know.
    Thanks
    Nigel
  • hi Nigel,

    is here my .H file settings that is giving a lot more throws in all modes,

    you could maybe give it a try...
    tell us is that is better or worse with those settings please.

    /***********************************/
    /*ArduPilot Header file, good luck!*/
    /***********************************/

    // Airframe settings
    //1-1
    //1-2
    #define REVERSE_X_SENSOR 0 //XY Thermopiles Sensor, 1 = cable behind, 0 = cable in front
    //1-3
    #define MIXING_MODE 0 //Servo mixing mode 0 = Normal, 1 = V-tail (v tail not tested yet).
    //1-4
    #define REVERSE_ROLL -1 //To reverse servo roll, PUT -1 to invert it!!!
    //1-5
    #define REVERSE_PITCH -1 //To reverse servo pitch, PUT -1 to invert it!!!
    //1-6
    #define RADIO_SWITCH_ACTION 0 // 0: TX Switch centered = waypoint mode & full = RTL mode. 1: TX Switch centered = RTL & full = waypoint mode.
    //1-7
    #define GPS_PROTOCOL 2 // 0 = NMEA, 1=SIRF, 2=uBlox, Choose protocol
    //1-8
    #define ATTITUDE_RATE_OUTPUT 250 //the output rate of attitude data in milliseconds. Useful if you want to increase the output rate. [JORDI: PLS EXPLAIN WHAT THIS MEANS. IS THAT ms? WHY IS IT USEFUL TO CHANGE THIS?]
    //1-9
    #define POSITION_RATE_OUTPUT 4 //This number will be multiplied by ATTITUDE_RATE_OUTPUT, the result is the refresh rate in milliseconds.
    //1-10
    #define REMEMBER_LAST_WAYPOINT_MODE 0 //If set 1 = will remember the last waypoint even if you restart the autopilot. 0 = Will start from zero everytime you restart the system.
    //1-11
    #define INTPUT_VOLTAGE 5200.0 //voltage in millis your power regulator is feeding your ArduPilot to have an accurate pressure and battery level readings. (you need a multimeter to measure and set this of course)
    //1-12
    #define REVERSE_THROTTLE 0 // 0 = Normal mode. 1 = Reverse mode...


    // Fly by wire settings
    //
    //(Note: If you disconnect the GPS you will fly by wire.)
    //ALWAYS leave your stick's centered when you ArduPilot is booting up.

    //2-1
    #define FLY_BY_WIRE_GAIN_ROLL .5 //Decrease the value to increase the response of the sticks. DESIRED_ROLL = //STICK_POSITION*FLY_BY_WIRE_GAIN_ROLL
    //2-2
    #define FLY_BY_WIRE_GAIN_PITCH .5 //The same as roll.
    //2-3
    #define FLY_BY_WIRE_SPEED_SETPOINT 20 //The airspeed you want to hold in fly by wire mode.
    //2-4
    #define GPS_ERROR_SPEED_SETPOINT 3 // In -m/s; , in case of GPS failure the airplane will enter into stabilization mode only and will try to maintain the airspeed set here.
    //2-5
    #define REV_FLY_BY_WIRE_CH1 -1 //-1 will invert it
    //2-6
    #define REV_FLY_BY_WIRE_CH2 -1 //-1 will invert it


    //Autopilot PID gains.
    //(Note: All the PID control loop gains and limits...)
    //3-1
    #define SERVO_AILE_MAX 2400 //Range of Ailerons
    //3-2
    #define SERVO_AILE_MIN 600
    //3-3
    #define SERVO_ELEV_MAX 2400 //Range of Elevator
    //3-4
    #define SERVO_ELEV_MIN 600

    //HEADING GAINS
    //4-5
    #define head_P .7 //Heading error proportional (same used to move the rudder)... DO not add too much or you will oscillate left and right. (drunk driver effect)
    //4-6
    #define head_I .3 //>.1 //heading error integrator. Do not add too much or you will overshoot.
    //4-7
    #define head_D 0 //Derivative not used, but someday....
    //4-8
    #define head_error_max 45 //35 The maximum output in degrees to control the roll setpoint
    //4-9
    #define head_error_min -45 //-35 The min output in degrees to control the roll setpoint

    //ROLL GAINS
    //5-10
    #define roll_abs .2 //Set point absolute...(Not Used)
    //5-11
    #define roll_P .50 //>.35 //roll PID proportional
    //5-12
    #define roll_I .35 //roll PID integrator
    //5-13
    #define roll_min -45 //>-35//PID output limit in servo degrees
    //5-14
    #define roll_max 45 //>35 //PID output limit in servo degrees
    //5-15
    #define roll_Integrator_max 15 //>10 //Limit the integrator, to avoid overshoots
    //5-16
    #define roll_Integrator_min -15 //>-10

    //PITCH GAINS
    //3-17
    #define pitch_P .8 //>.65 //Pitch Proportional
    //6-18
    #define pitch_I .6 //>.35 //Pitch integrator
    //6-19
    #define pitch_min -25 //Pitch limits
    //6-20
    #define pitch_max 25
    //6-21
    #define pitch_Integrator_max 15 //>10 //Pitch integrator limits
    //6-22
    #define pitch_Integrator_min -15 //>-10
    //6-23
    #define PITCH_COMP .60 //>.30 //<------Very important, Pitch compensation vs. Roll bank angle.

    //THROTTLE GAINS
    //7-24
    #define throttle_max 1800 //Servo range In milliseconds.
    //7-25
    #define throttle_min 1200 //
    //7-26
    #define throttle_dead_zone 20 //In percent %
    //7-27
    #define throttle_absolute 3 //Absolute
    //7-28
    #define throttle_kp 3 //Proportional
    //7-29
    #define throttle_ki 1 //Integrator
    //7-30
    #define throttle_max 85 //Limits
    //7-31
    #define throttle_Integrator_max 70 //Integrator limit.


    //More PID gains for altitude and speed.
    //8-1
    #define ALTITUDE_ERROR_MAX 0 //0
    //8-2
    #define ALTITUDE_ERROR_MIN -10 //
    //8-3
    #define ALTITUDE_ERROR_PITCH_PROPORTIONAL 1.5 //Altitude error proportional, pitch setpoint
    //8-4
    #define ALTITUDE_ERROR_PITCH_MAX 8//>0 //0 Limits, EasyStar climb by itself, you don't need to up the elevator (you may stall)...
    //8-5
    #define ALTITUDE_ERROR_PITCH_MIN -14
    //8-6
    #define AIRSPEED_CENTRAL 22 // 22 needs 36 km/H //Airspeed central point in m/s, normal flight... This value is the lowest airspeed that makes your plane flight steady.
    //8-7
    #define ALTITUDE_ERROR_AIRSPEED_PROPORTIONAL 2
    //8-8
    #define ALTITUDE_ERROR_AIRSPEED_MAX 10
    //8-9
    #define ALTITUDE_ERROR_AIRSPEED_MIN -10


    /*****************/
    /*Debugging Stuff*/
    /*****************/

    //9-1
    #define FAKE_BEARING 0 //If set to 1, will fake the bearing and will try to always head to the defined DESIRED_FAKE_BEARING
    //9-2
    #define DESIRED_FAKE_BEARING 0 //Will try to go NorthEast, you can change that to 0 = NORTH, 90 = EAST, 180 = SOUTH, 270 = WEST or whatever!
    //9-3
    #define FAKE_GPS_LOCK 0 //If is set to 1 will jump the GPS lock process to set home position. FOR TESTING ONLY!
    //9-4
    #define PRINT_WAYPOINTS 1 //If set to 1, at bootup will print all the waypoints set in the eeprom!
    //9-5
    #define TEST_THROTTLE 0 // If set 1 will test the throttle increasing the speed slowly.
    //9-6
    #define WALK_AROUND 1 //Must be "0" to test the GPS and heading against the servo and "1" for normal operation
    //9-7
    #define CALIBRATE_SERVOS 0// Use to move the servos center, left and right or center right and left. You must adjust using 3-1 and 3-2.
    //9-8
    #define TEST_SENSORS 0 // Set 1 for enable, overwrite the servos with the raw IR sensors data, to test orientation. This will overwrite everything.


    just be carefull to setup all the moves in the right direction before flying cause i had to change few parameters

    good fly!

    fefenin
  • Chris,
    I am using the reccommended EM406.. It appears to work fine. Lock comes on quickly, and the data it sends is accurate. I also use the standard FMA xy & z IR sensors.
    Than$ks
    Nigel
  • 3D Robotics
    Nigel,

    Which GPS module are you using?
  • I am looking for help debugging my easystar/v2.3 ardupilot. I actually lost it 2 weeks ago, but thanks to lots of posters in the area, I have it back. It is in excellent condition - no visible damage. The waypoints were as programmed, the max speed way 14, max altitude 333, which seems high. Still don't know what went wrong, but am now doing lots more ground checks. There are some strange behaviours. I have downloaded 2.3.1 software to the device.
    1. In fly-by-wire mode (ie disconnect GPS while on ground), I can only move the rudder to the right, not left, and same with elevators - only in one dorection, with the Tx control.
    2. In fake_bearing mode, with walk_around set to 0, the rudder does not move much. It twitches in auto mode,
    but mostly sits straight, or turning left. On driving around, there is not much discernable movement, but slight.
    I recall that it did more before.
    3. Having plane in normal mode, 11 waypoint (all in large car park/parking lot), I set this up, but kept in car (sunroof open so gps lock remained on), and attempted to drive, "following" the rudder. But the rudder never moved. (note, when truning on, with digital 6 bind pin in, the test moved the rudder & elevator the whole range, and when in manual mode, I can move the rudder & elevator fullly in all dorections). So, I connected the FTDI cable to the ardupilot, powered on the laptop, and opened the serial port window in the arduino tool. I hade made sure to write out DST (wp_distance) & RSP (roll_set_point), amongst others. With this data, I was able very clearly to drive the car to the waypoints. Following the RSP number (turn right on +ve number, left on -ve etc) I was soon driving to the waypoints; DST reduced as I approached. When within the radious (I had set to 10m) I saw the WPN increment, and the DST change to the distance to the next waypoint. RSP changed correctly to lead me to the next WP etc.
    So - why is my rudder inert when in this mode? Is it a gain issue? If so, which? I have not changed any of these settings.
    Thanks
    Nigel
    头条 - 第一区块链{etc.so}
    第一区块链{etc.so}
  • Developer
    Chris,

    The problem was the IR cable from the shield kit. It had the 2nd and 3rd pins reversed in the connector that plugs into the shield. Fortunately with a magnifying lens and a small blade I was able to release the pins from inside the connector and rearrange them.

    I am having my fair share of debugging problems, but am sure that this drone will fly (before too long :) ).
  • 3D Robotics
    space_nut: we flew it on a FunJet many code versions ago, but haven't had a chance to try with the current code and V-tail configuration. Let us know how it goes!
This reply was deleted.