Browse Source

Plane: limit speed scaling in Autotakeoff wo AS sensor option

zr-v5.1
Hwurzburg 4 years ago committed by Andrew Tridgell
parent
commit
09fb9a8e58
  1. 5
      ArduPlane/Attitude.cpp
  2. 2
      ArduPlane/Parameters.cpp
  3. 1
      ArduPlane/defines.h

5
ArduPlane/Attitude.cpp

@ -46,6 +46,11 @@ float Plane::get_speed_scaler(void) @@ -46,6 +46,11 @@ float Plane::get_speed_scaler(void)
// no speed estimate and not armed, use a unit scaling
speed_scaler = 1;
}
if (!plane.ahrs.airspeed_sensor_enabled() &&
(plane.g2.flight_options & FlightOptions::SURPRESS_TKOFF_SCALING) &&
(plane.flight_stage == AP_Vehicle::FixedWing::FLIGHT_TAKEOFF)) { //scaling is surpressed during climb phase of automatic takeoffs with no airspeed sensor being used due to problems with inaccurate airspeed estimates
return MIN(speed_scaler, 1.0f) ;
}
return speed_scaler;
}

2
ArduPlane/Parameters.cpp

@ -1120,7 +1120,7 @@ const AP_Param::GroupInfo ParametersG2::var_info[] = { @@ -1120,7 +1120,7 @@ const AP_Param::GroupInfo ParametersG2::var_info[] = {
// @Param: FLIGHT_OPTIONS
// @DisplayName: Flight mode options
// @Description: Flight mode specific options
// @Bitmask: 0:Rudder mixing in direct flight modes only (Manual / Stabilize / Acro),1:Use centered throttle in Cruise or FBWB to indicate trim airspeed, 2:Disable attitude check for takeoff arming, 3:Force target airspeed to trim airspeed in Cruise or FBWB, 4: Climb to ALT_HOLD_RTL before turning for RTL, 5:Enable yaw damper in acro mode
// @Bitmask: 0:Rudder mixing in direct flight modes only (Manual / Stabilize / Acro),1:Use centered throttle in Cruise or FBWB to indicate trim airspeed, 2:Disable attitude check for takeoff arming, 3:Force target airspeed to trim airspeed in Cruise or FBWB, 4: Climb to ALT_HOLD_RTL before turning for RTL, 5: Enable yaw damper in acro mode, 6: Surpress speed scaling during auto takeoffs to be 1 or less to prevent oscillations without airpseed sensor.
// @User: Advanced
AP_GROUPINFO("FLIGHT_OPTIONS", 13, ParametersG2, flight_options, 0),

1
ArduPlane/defines.h

@ -154,6 +154,7 @@ enum FlightOptions { @@ -154,6 +154,7 @@ enum FlightOptions {
CRUISE_TRIM_AIRSPEED = (1 << 3),
CLIMB_BEFORE_TURN = (1 << 4),
ACRO_YAW_DAMPER = (1 << 5),
SURPRESS_TKOFF_SCALING = (1<<6),
};
enum CrowFlapOptions {

Loading…
Cancel
Save