diff --git a/ArduCopter/APM_Config.h b/ArduCopter/APM_Config.h index 6430ec81cb..46c20b8733 100644 --- a/ArduCopter/APM_Config.h +++ b/ArduCopter/APM_Config.h @@ -34,8 +34,9 @@ //#define SPRAYER ENABLED // enable the crop sprayer feature (two ESC controlled pumps the speed of which depends upon the vehicle's horizontal velocity) //#define EPM_ENABLED ENABLED // enable epm cargo gripper costs 500bytes of flash -// redefine size of throttle deadband in pwm (0 ~ 1000) -//#define THROTTLE_IN_DEADBAND 100 +// other settings +//#define THROTTLE_IN_DEADBAND 100 // redefine size of throttle deadband in pwm (0 ~ 1000) +//#define LAND_REQUIRE_MIN_THROTTLE_TO_DISARM DISABLED // when set to DISABLED vehicle will disarm after landing (in LAND mode or RTL) even if pilot has not put throttle to zero //#define HIL_MODE HIL_MODE_SENSORS // build for hardware-in-the-loop simulation diff --git a/ArduCopter/Attitude.pde b/ArduCopter/Attitude.pde index fce43e5d5a..35b2596d5d 100644 --- a/ArduCopter/Attitude.pde +++ b/ArduCopter/Attitude.pde @@ -1094,7 +1094,11 @@ get_throttle_land() get_throttle_rate_stabilized(-abs(g.land_speed)); // disarm when the landing detector says we've landed and throttle is at min (or we're in failsafe so we have no pilot thorottle input) +#if LAND_REQUIRE_MIN_THROTTLE_TO_DISARM == ENABLED if( ap.land_complete && (g.rc_3.control_in == 0 || failsafe.radio) ) { +#else + if (ap.land_complete) { +#endif init_disarm_motors(); } } diff --git a/ArduCopter/config.h b/ArduCopter/config.h index 07c0a68dbd..d933b0ac3a 100644 --- a/ArduCopter/config.h +++ b/ArduCopter/config.h @@ -464,6 +464,9 @@ #ifndef LAND_DETECTOR_TRIGGER # define LAND_DETECTOR_TRIGGER 50 // number of 50hz iterations with near zero climb rate and low throttle that triggers landing complete. #endif +#ifndef LAND_REQUIRE_MIN_THROTTLE_TO_DISARM // require pilot to reduce throttle to minimum before vehicle will disarm + # define LAND_REQUIRE_MIN_THROTTLE_TO_DISARM ENABLED +#endif ////////////////////////////////////////////////////////////////////////////// // CAMERA TRIGGER AND CONTROL