Developer

Anti-crash mode in AUTO



This was a really simple addition to the code; maybe 6 lines. But the effect was quite dramatic. AUTO, RTL, and LOITER now sense if the plane is in a dive and enter a simple stability mode for 4 seconds. Enough time to recover from the worst dive.

I fly an EZ Star and this has always been my biggest safety concern and need to flip to manual control. Now I don't need to.

In the video you can see me put the plane into a dive. This can happen when the plane turns too hard and the GPS refresh can't keep up. Once the plane begins to stall, it drops like a rock.

Update is on the SVN in Ardupilot 2.7 for Beta testers.
E-mail me when people leave their comments –

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

Join diydrones

Comments

  • I changed 3 lines and I get no telem output.

    //To use the header file in your local folder, use quotes:
    #include "APM_Cofig.h"
    #include "APM_PID_gains.h"
    //#include "Doug.h"

    //GPS

    //#include // ArduPilot IMU/XPLANE GPS Library
    //#include // ArduPilot Ublox GPS Library
    #include // ArduPilot MediaTek GPS Library
    //#include // ArduPilot NMEA GPS library

    Earl
  • Sync to the SVN repository ?
    Earl
  • Developer
    Hi Earl,
    I'm putting the finishing touches on a new release for 2.7. Beta/Alpha 4 maybe? hehe.
    I've already included this in Mega as well. Just need to sync it.
    Jason
  • Is this for 2.7 ?
    Earl
  • Developer
    I'll be testing it this week.
    Jason
  • Developer
    Any chance of this feature migrating to APM?
  • Developer
    OK, I added that to the repository, Thanks!
  • Developer
    Jason,

    battery_voltage is not functional, value is doubled after each read from analog BATTERY PIN after 8 cycles value goes out of bounds to 0.

    My solution is to add a variable filter_batt_voltage in ArduPilot_2_7 like this:

    float filter_batt_voltage = 511; // Filtered Battery Voltage mjc

    In Sensors change these lines:
    void read_battery(void)
    {
    /* battery_voltage = ((float)analogRead(BATTERY_PIN) *.01) + ((float)battery_voltage*.99);
    battery_voltage = BATTERY_VOLTAGE (battery_voltage);
    */
    filter_batt_voltage = ((float)analogRead(BATTERY_PIN) * .05) + ((float)filter_batt_voltage * .95);
    battery_voltage = BATTERY_VOLTAGE(filter_batt_voltage);
    if(battery_voltage < INPUT_VOLTAGE)
    low_battery_event();
    }

    I changed filter to respond a little faster.
  • Developer
    Just to be more clear on what this does. If we are diving (past 45°), the nav_roll value which is the desired bank from the autopilot will be zero'd out for 4-5 seconds giving the plane time to recover. Then the plane resumes normal AP. FBW has this feature - basically letting off the sticks.

    Ken, feel free to dig into the code and try things out. You can always test them in the sim and not your plane.
    Jason
  • ...oh, what happens after 4 seconds?
This reply was deleted.