Developer

Ardupilot 2.5 Release Candidate

I was finally able to test 2.5 over the weekend and added a few tweaks to the code.
Here's what I hope is the final release.

As the new Manual gets formatted, you can view it at: http://code.google.com/p/ardupilot/wiki/ArduPilot25
Until the content is finally moved over the 2.4 manual is still a great resource.

Ardupilot_25_RC2.zip

Bonus - If you look check out the Waypoint_writer_25.pde file in the test suite, you can upload relative waypoints. This isn't supported in the config tool yet.

Jason


UPDATE -
A lot of people were having trouble with the GPS code and LEDs. I reworked the GPS parsers today to iron out some things. They were nothing that would interfere with flight, but I highly recommend using this new version. I've also added the ability to scale down your plane's roll based on airspeed. This should help planes that turn faster when they go slower. We may tweak this a bit in the future, so I'm looking for feedback on it. Note you can always turn it off in your header file with this line:
//6-4
#define AIRSPEED_TURN_P 1
see the header file for more instructions


E-mail me when people leave their comments –

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

Join diydrones

Comments

  • Developer
    Thanks,
    Could you also run this in the debug mode? I will do that tonight as well.
    Jason
  • Sorry, here are the coordinates in a more readable form:

    OPTIONS:66,False,True,Meters,17
    HOME:45.567316,8.997277,82
    45.56659,8.99755,82
    45.56695,8.99804,82
    45.56755,8.99786,82
    45.56775,8.99714,82

    Tanks again
  • Hello,
    I tried out version 2.5 with my Easystar.
    Stabilize and fly by wire really OK.

    GPS EM406 in Sirf mode get solid Fix very quickly.

    When I try Auto or RTL mode the plane gose straight or after a large turn mostly towards the direction
    shown by the red arrow in the picture ang in general away from the waypoints.

    Could be something in the getbearing() routine?
    My waypoint are Lat Nord and Long East

    Here is my config file:

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

    //Hardware Configuration
    #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? If not throttle will restricted to altitude error.

    // Flight Modes
    // these Flight modes can be changed to either here or directly in events.pde
    // options are MANUAL, STABILIZE, FLY_BY_WIRE, AUTO, RTL, LOITER
    #define POSITION_1 MANUAL
    #define POSITION_2 AUTO
    #define POSITION_3 RTL


    // Airframe settings
    //1-1
    #define GPS_PROTOCOL 1 // 0 = NMEA, 1=SIRF, 2=uBlox, 3 = IMU Choose protocol
    //1-2
    #define REVERSE_ROLL 1 //To reverse servo roll, PUT -1 to invert it!!!
    //1-3
    #define REVERSE_PITCH 1 //To reverse servo pitch, PUT -1 to invert it!!!
    //1-4
    #define REVERSE_THROTTLE 0 // 0 = Normal mode. 1 = Reverse mode...
    //1-5
    #define INTPUT_VOLTAGE 5200.0 // (Millivolts) voltage 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-6
    #define BATTERY_EVENT 0 // (boolean) 0 = don't read battery, 1 = read battery voltage (only if you have it wired up!)
    //1-7
    #define MIXING_MODE 0 //Servo mixing mode 0 = Normal, 1 = V-tail (v tail not tested yet).

    // IR sensors
    //2-1
    #define ENABLE_Z_SENSOR 1 // 0 = no Z sensor, 1 = use Z sensor (no Z requires field calibration with each flight)
    //2-2
    #define XY_SENSOR_LOCATION 0 //XY Thermopiles Sensor placement
    //Mounted on top: 0 = cable in front, 1 = cable behind
    //Mounted on botton: 2 = cable in front, 3 = cable behind
    //2-3
    #define PITCH_TRIM 0 //(Degrees +- 5) allows you to offset bad IR placement
    //2-4
    #define ROLL_TRIM 0 // (Degrees +- 5) allows you to offset bad IR placement


    // RADIO
    //3-1
    #define SET_RADIO_LIMITS 0 // 0 = no, 1 = set the limits of the Channels with the radio at launch each time
    //3-2
    #define SET_RADIO_TRIMS 1 // 0 = no, 1 = set the trims of the Channels with the radio at launch each time
    //3-3
    #define RADIO_TYPE 0 // 0 = sequential PWM pulses(Fasst, Spektrums), 1 = simultaneous PWM pulses (Corona RP8D1)
    //3-4
    #define CH1_MIN 1079 // (Microseconds) Range of Ailerons/ Rudder
    //3-5
    #define CH1_MAX 1885 // (Microseconds)
    //3-6
    #define CH2_MIN 1097 // (Microseconds) Range of Elevator
    //3-7
    #define CH2_MAX 1899 // (Microseconds)
    //3-8
    #define CH3_TRIM 1015 // (Microseconds) Trims are normally set automatically in setup.
    //3-9
    #define THROTTLE_IN 0 // (boolean) Disables throttle when set to 0
    //3-10
    #define THROTTLE_OUT 0 // 1 = throttle, 0 = no throttle at all! (good for saving fingers on the bench.)


    //NAVIGATION: HEADING
    //Note: Some Gains are now variables
    #define HEAD_P .714 //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-1
    #define HEAD_I .095 //heading error integrator. Do not add too much or you will overshoot.
    //4-2
    #define HEAD_MAX 3500 //(Degrees *100) The maximum output in degrees to control the roll setpoint
    //4-3
    #define HEAD_MIN -3500 //(Degrees *100) The min output in degrees to control the roll setpoint
    //4-4
    #define HEAD_I_MAX 1000 //(Degrees *100) The maximum output in degrees to control the roll setpoint
    //4-5
    #define HEAD_I_MIN -1000 //(Degrees *100) The min output in degrees to control the roll setpoint
    //4-6
    #define XTRACK_GAIN .2 // amount to compensate for crosstrack - use debug mode to find correct value
    //4-7
    #define LOITER_RADIUS 20 // radius in meters of a Loiter
    //4-8
    #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.
    //4-9
    #define WP_ALTITUDE_RADIUS 10 // (meters) accuracy needed to find our waypoint in meters


    //NAVIGATION: ALTITUDE
    //5-1
    #define ALTITUDE_PITCH_P 1.5 //Altitude error proportional, pitch setpoint
    //5-2
    #define ALTITUDE_PITCH_MAX 500 // most the plane will pitch up in degrees to raise altitude
    //5-3
    #define ALTITUDE_PITCH_MIN -1500 // (Degrees *100) most the plane will pitch down in degrees to lower altitude


    //NAVIGATION: SPEED GAINS
    //6-1
    #define ALTITUDE_THROTTLE_P 1.33
    //6-2
    #define ALTITUDE_AIRSPEED_MAX 15 //(0-125) Maximum extra speed for gaining altitude
    //6-3
    #define ALTITUDE_AIRSPEED_MIN -15 //(0-125) Maximum reduded speed for loosing altitude



    //ATTITUDE: ROLL GAINS
    //7-1
    #define ROLL_P .55 // START WITH THIS VALUE TO TUNE - overall proportional term determins how much rudder you use to turn
    //7-2
    #define ROLL_I .1 // roll PID integrator
    //7-3
    #define ROLL_Ps .6 // Controls rate of rudder turn - direct proportional effect; value of 1 = no dampening
    //7-4
    #define ROLL_Is .2 // Controls rate of rudder turn - speed at which the non proportional effect happens - .2 = 5 seconds
    //7-5
    #define ROLL_MIN -2500 // maximum output of Rudder
    //7-6
    #define ROLL_MAX 2500 // maximum output of Rudder


    //ATTITUDE: PITCH GAINS
    //8-1
    #define PITCH_P .65 // Pitch Proportional
    //8-2
    #define PITCH_I .35 // Pitch integrator
    //8-3
    #define PITCH_COMP .30 //<------Very important, Pitch compensation vs. Roll bank angle.


    //ATTITUDE: THROTTLE OUTPUT GAINS
    //9-1
    #define THROTTLE_ABSOLUTE 3 //Absolute
    //9-2
    #define THROTTLE_P .32 //Proportional
    //9-3
    #define THROTTLE_I .04 //Integrator
    //9-4
    #define THROTTLE_I_MAX 50 // (0-125) 50=70% Integrator limit.
    //9-5
    #define THROTTLE_CRUISE 25 // (0-125) %throttle, or (int)target airspeed for cruising
    //9-6
    #define THROTTLE_MAX 60 // (0-125) 70 = 56% maximum throttle


    /*****************/
    /*Debugging Stuff*/
    /*****************/
    //10-1
    #define DEBUG 0 // 0 = no debugging, will cause plane to enter debugging simulation mode
    //10-2
    #define TURNRATE 65 // (degrees) how fast we turn per second in degrees at full bank
    //10-3
    #define CLIMBRATE_UP 1000 // (meters * 100) how fast we climb in simulator at 90°
    //10-4
    #define CLIMBRATE_DOWN 3000 // (meters * 100) how fast we climb in simulator at 90°

    Compliments for your job and thanks a lots for any help
  • Developer
    To setup the Futaba 7c you need to do two things.

    To set the control switch:
    1: End Position Menu:
    Set Ch5 to this:
    > 140% > 63%

    To setup the Failsafe:
    Set End Point of Ch3 to 140%
    1: End Position Menu:
    Set Ch3: to this:
    > 100% > 140%

    2: Failsafe Menu
    - Rotate the dial to F/S
    - Press and hold the dial to set it

    3: Return to End Position Menu:
    Set Ch3 back to this:
    > 100% > 100%
    Nothing to hide. Stay tuned.
  • jasonshort,
    can you explain what you did to make your Futaba 7C work with the 2.5 code please ,it is the only radio i have to work with .maybe put the explanation in the manual so us less than sharp types can implement it
  • 3D Robotics
    Ah, I was accidentally looking at code from last week. Glad to see that you anticipated my needs!

    Could post your PWM values for the Futaba 7C?
  • Developer
    Nice Jason,

    I hadn't noticed the change to do it in the header file. Great job on getting the code to this point!
  • Developer
    Actually I did just that to get the best of both worlds.

    case 1: // First position
    set_mode(POSITION_1);
    break;

    case 2: // middle position
    //set_mode(RTL);
    set_mode(POSITION_2);
    break;

    case 3: // last position
    set_mode(POSITION_3);
    break;

    As you can see in the latests events.pde file I pull the defines in from the header. You could completely edit the events.pde file yourself if you wanted to get tricky. You can also add all sorts of control code in there too.
  • Developer
    You need to assign which mode you would like to enter in the header file.
    Manual is reserved for switch position 1 - the mux prevents any other mode.
    positions 2 and 3 are up to the user.

    I left position 1 editable in case someone wanted to create a new mode that output different telemetry or some other thing I cant think of.

    Here is the relevant part of the header:

    // Flight Modes
    // these Flight modes can be changed to either here or directly in events.pde
    // options are MANUAL, STABILIZE, FLY_BY_WIRE, AUTO, RTL, LOITER
    #define POSITION_1 MANUAL
    #define POSITION_2 AUTO
    #define POSITION_3 STABILIZE


    If the radio isn't setup correctly, you won't output the right PWM values for the board to read position 2. I know the Futaba 7C that I have doesn't work out of the box.

    #3 and #4 are reserved for future modes. In the code I basically do "> AUTO" to see if the plane is flying itself or the user is in control.

    Jason
  • 3D Robotics
    Got it. It's in the "Events" tab. I presume you replace the text in the parens with what you want. Any reason why we can't move this to the config file?

    void switch_event(byte switchPosition)
    {
    switch(switchPosition)
    {
    case 1: // First position
    set_mode(MANUAL);
    break;

    case 2: // middle position
    //set_mode(RTL);
    set_mode(AUTO);
    break;

    case 3: // last position
    set_mode(STABILIZE);
    break;
    }
    }
This reply was deleted.