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.
Comments
//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
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
Earl
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.
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
Did you test this using thermopiles or the arduIMU+ in the video, because i was wondering if the IMU would max out or be able to keep up with the crazy aerobatics in a stall/spin? Perhaps the new APM IMU would be able to handle this abit more I guess someone will have to test it at some point. But still its a great safety feature and well done.
-
1
-
2
of 2 Next