Browse Source

Plane: Manage quadplane throttle during RC failsafe

master
Michael du Breuil 6 years ago committed by WickedShell
parent
commit
5134af2298
  1. 19
      ArduPlane/radio.cpp
  2. 3
      ArduPlane/system.cpp

19
ArduPlane/radio.cpp

@ -259,7 +259,24 @@ void Plane::control_failsafe() @@ -259,7 +259,24 @@ void Plane::control_failsafe()
channel_roll->set_control_in(0);
channel_pitch->set_control_in(0);
channel_rudder->set_control_in(0);
channel_throttle->set_control_in(0);
switch (control_mode) {
case QSTABILIZE:
case QHOVER:
case QLOITER:
case QLAND: // throttle is ignored, but reset anyways
case QRTL: // throttle is ignored, but reset anyways
case QAUTOTUNE:
if (quadplane.available() && quadplane.motors->get_desired_spool_state() > AP_Motors::DESIRED_GROUND_IDLE) {
// set half throttle to avoid descending at maximum rate, still has a slight descent due to throttle deadzone
channel_throttle->set_control_in(channel_throttle->get_range() / 2);
break;
}
FALLTHROUGH;
default:
channel_throttle->set_control_in(0);
break;
}
}
if(g.throttle_fs_enabled == 0)

3
ArduPlane/system.cpp

@ -496,6 +496,9 @@ void Plane::set_mode(enum FlightMode mode, mode_reason_t reason) @@ -496,6 +496,9 @@ void Plane::set_mode(enum FlightMode mode, mode_reason_t reason)
// reset steering integrator on mode change
steerController.reset_I();
// update RC failsafe, as mode change may have necessitated changing the failsafe throttle
control_failsafe();
}
// exit_mode - perform any cleanup required when leaving a flight mode

Loading…
Cancel
Save