Browse Source

Plane: added option to run idle governor in MANUAL mode

useful for quadplane testing
c415-sdk
Andrew Tridgell 5 years ago
parent
commit
36baaeb3a0
  1. 2
      ArduPlane/quadplane.cpp
  2. 1
      ArduPlane/quadplane.h
  3. 14
      ArduPlane/servos.cpp

2
ArduPlane/quadplane.cpp

@ -329,7 +329,7 @@ const AP_Param::GroupInfo QuadPlane::var_info[] = { @@ -329,7 +329,7 @@ const AP_Param::GroupInfo QuadPlane::var_info[] = {
// @Param: OPTIONS
// @DisplayName: quadplane options
// @Description: This provides a set of additional control options for quadplanes. LevelTransition means that the wings should be held level to within LEVEL_ROLL_LIMIT degrees during transition to fixed wing flight, and the vehicle will not use the vertical lift motors to climb during the transition. If AllowFWTakeoff bit is not set then fixed wing takeoff on quadplanes will instead perform a VTOL takeoff. If AllowFWLand bit is not set then fixed wing land on quadplanes will instead perform a VTOL land. If respect takeoff frame is not set the vehicle will interpret all takeoff waypoints as an altitude above the corrent position. When Use QRTL is set it will replace QLAND with QRTL for failsafe actions when in VTOL modes.
// @Bitmask: 0:LevelTransition,1:AllowFWTakeoff,2:AllowFWLand,3:Respect takeoff frame types,4:Use a fixed wing approach for VTOL landings,5:Use QRTL instead of QLAND for failsafe when in VTOL modes.
// @Bitmask: 0:LevelTransition,1:AllowFWTakeoff,2:AllowFWLand,3:Respect takeoff frame types,4:Use a fixed wing approach for VTOL landings,5:Use QRTL instead of QLAND for failsafe when in VTOL modes,6:Use idle governor in MANUAL
AP_GROUPINFO("OPTIONS", 58, QuadPlane, options, 0),
AP_SUBGROUPEXTENSION("",59, QuadPlane, var_info2),

1
ArduPlane/quadplane.h

@ -517,6 +517,7 @@ private: @@ -517,6 +517,7 @@ private:
OPTION_RESPECT_TAKEOFF_FRAME=(1<<3),
OPTION_MISSION_LAND_FW_APPROACH=(1<<4),
OPTION_FS_QRTL=(1<<5),
OPTION_IDLE_GOV_MANUAL=(1<<6),
};
AP_Float takeoff_failure_scalar;

14
ArduPlane/servos.cpp

@ -327,7 +327,19 @@ void Plane::set_servos_manual_passthrough(void) @@ -327,7 +327,19 @@ void Plane::set_servos_manual_passthrough(void)
SRV_Channels::set_output_scaled(SRV_Channel::k_aileron, channel_roll->get_control_in_zero_dz());
SRV_Channels::set_output_scaled(SRV_Channel::k_elevator, channel_pitch->get_control_in_zero_dz());
SRV_Channels::set_output_scaled(SRV_Channel::k_rudder, channel_rudder->get_control_in_zero_dz());
SRV_Channels::set_output_scaled(SRV_Channel::k_throttle, get_throttle_input(true));
int8_t throttle = get_throttle_input(true);
SRV_Channels::set_output_scaled(SRV_Channel::k_throttle, throttle);
if (quadplane.available() && (quadplane.options & QuadPlane::OPTION_IDLE_GOV_MANUAL)) {
// for quadplanes it can be useful to run the idle governor in MANUAL mode
// as it prevents the VTOL motors from running
int8_t min_throttle = aparm.throttle_min.get();
// apply idle governor
g2.ice_control.update_idle_governor(min_throttle);
throttle = MAX(throttle, min_throttle);
SRV_Channels::set_output_scaled(SRV_Channel::k_throttle, throttle);
}
}
/*

Loading…
Cancel
Save