Plane: new param LAND_THEN_NEUTRL

// @Description: When enabled, after an autoland and auto-disarm via LAND_DISARMDELAY happens then set all servos to neutral. This is helpful when an aircraft has a rough landing upside down or a crazy angle causing the servos to strain.
This commit is contained in:
Tom Pittenger 2016-02-16 23:17:55 -08:00
parent 10abec277d
commit 0b26a34f22
3 changed files with 21 additions and 0 deletions

View File

@ -1084,6 +1084,18 @@ void Plane::set_servos(void)
}
#endif
if (g.land_then_servos_neutral &&
g.land_disarm_delay > 0 &&
auto_state.land_complete &&
!arming.is_armed()) {
// after an auto land and auto disarm, set the servos to be neutral just
// in case we're upside down or some crazy angle and straining the servos.
channel_roll->servo_out = 0;
channel_pitch->servo_out = 0;
channel_throttle->servo_out = 0;
channel_rudder->servo_out = 0;
}
// send values to the PWM timers for output
// ----------------------------------------
if (g.rudder_only == 0) {

View File

@ -288,6 +288,13 @@ const AP_Param::Info Plane::var_info[] = {
// @User: Advanced
GSCALAR(land_disarm_delay, "LAND_DISARMDELAY", 20),
// @Param: LAND_THEN_NEUTRL
// @DisplayName: Set servos to neutral after landing
// @Description: When enabled, after an autoland and auto-disarm via LAND_DISARMDELAY happens then set all servos to neutral. This is helpful when an aircraft has a rough landing upside down or a crazy angle causing the servos to strain.
// @Values: 0:Disabled, 1:Enabled
// @User: Advanced
GSCALAR(land_then_servos_neutral, "LAND_THEN_NEUTRL", 0),
// @Param: LAND_ABORT_THR
// @DisplayName: Landing abort using throttle
// @Description: Allow a landing abort to trigger with a throttle > 95%

View File

@ -283,6 +283,7 @@ public:
k_param_scaling_speed,
k_param_quadplane,
k_param_rtl_radius,
k_param_land_then_servos_neutral,
//
// 210: flight modes
@ -463,6 +464,7 @@ public:
AP_Int32 RTL_altitude_cm;
AP_Float land_flare_alt;
AP_Int8 land_disarm_delay;
AP_Int8 land_then_servos_neutral;
AP_Int8 land_abort_throttle_enable;
AP_Float land_pre_flare_alt;
AP_Float land_pre_flare_sec;