Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plane: Surpress speed scaling without AS sensor on auto takeoffs #17068

Merged
merged 1 commit into from Apr 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions ArduPlane/Attitude.cpp
Expand Up @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion ArduPlane/Parameters.cpp
Expand Up @@ -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),

Expand Down
1 change: 1 addition & 0 deletions ArduPlane/defines.h
Expand Up @@ -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 {
Expand Down