Skip to content

Commit

Permalink
Copter: Add adjustable pre-arm check for minimum air pressure
Browse files Browse the repository at this point in the history
  • Loading branch information
priseborough committed Sep 15, 2016
1 parent b930c80 commit cd35922
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ArduCopter/Parameters.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,8 @@ class Parameters {
k_param_altitude_limit, // deprecated - remove
k_param_fence,
k_param_gps_glitch, // deprecated
k_param_baro_glitch, // 71 - deprecated
k_param_baro_glitch, // deprecated
k_param_baro_launch_limit, // 72

//
// 75: Singlecopter, CoaxCopter
Expand Down Expand Up @@ -362,6 +363,9 @@ class Parameters {
AP_Int16 takeoff_trigger_dz;
AP_Float pilot_takeoff_alt;

// takeoff environmental limits
AP_Float baro_launch_limit; // If the barometric pressure is lower than this value, the copter will not arm - Pa

// Thrust loss recovery
//
AP_Int16 spd_lim_rate_cmss; // rate that the horizontal speed limit applied to guided mode demands is reduced - cm/s/s
Expand Down
9 changes: 9 additions & 0 deletions ArduCopter/Parameters.pde
Original file line number Diff line number Diff line change
Expand Up @@ -1096,6 +1096,15 @@ const AP_Param::Info var_info[] PROGMEM = {
// @User: Standard
GSCALAR(autotune_aggressiveness, "AUTOTUNE_AGGR", 0.1f),

// @Param: GND_PRESS_MIN
// @DisplayName: ground level air pressure minimum
// @Description: If the ground level air pressure is lower than this value, then the copter will not arm. This is used to prevent takeoff at high elevaton locations where air density is insuffient for safe flight.
// @Units: Pa
// @Range: 50000 80000
// @Increment: 1000
// @User: Advanced
GSCALAR(baro_launch_limit, "GND_PRESS_MIN", 80000.0f),

AP_VAREND
};

Expand Down
7 changes: 7 additions & 0 deletions ArduCopter/motors.pde
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,13 @@ static bool pre_arm_checks(bool display_failure)
}
return false;
}
// check that we are below our launch service ceiling
if( barometer.get_pressure() < g.baro_launch_limit ) {
if (display_failure) {
gcs_send_text_P(SEVERITY_HIGH,PSTR("PreArm: Launch ceiling exceeded"));
}
return false;
}
// Check baro & inav alt are within 1m if EKF is operating in an absolute position mode.
// Do not check if intending to operate in a ground relative height mode as EKF will output a ground relative height
// that may differ from the baro height due to baro drift.
Expand Down

0 comments on commit cd35922

Please sign in to comment.