diff --git a/ArduPlane/Attitude.pde b/ArduPlane/Attitude.pde index b0a9dde3e0..2f16e57cbc 100644 --- a/ArduPlane/Attitude.pde +++ b/ArduPlane/Attitude.pde @@ -924,6 +924,6 @@ static void adjust_nav_pitch_throttle(void) uint8_t throttle = throttle_percentage(); if (throttle < aparm.throttle_cruise) { float p = (aparm.throttle_cruise - throttle) / (float)aparm.throttle_cruise; - nav_pitch_cd -= g.stab_pitch_down_cd * p; + nav_pitch_cd -= g.stab_pitch_down * 100.0f * p; } } diff --git a/ArduPlane/Parameters.h b/ArduPlane/Parameters.h index 20c969f375..f6332025ac 100644 --- a/ArduPlane/Parameters.h +++ b/ArduPlane/Parameters.h @@ -118,8 +118,9 @@ public: k_param_sonar, k_param_terrain, k_param_terrain_follow, - k_param_stab_pitch_down_cd, + k_param_stab_pitch_down_cd_old, // deprecated k_param_glide_slope_threshold, + k_param_stab_pitch_down, // 100: Arming parameters k_param_arming = 100, @@ -326,7 +327,7 @@ public: AP_Float kff_throttle_to_pitch; AP_Float ground_steer_alt; AP_Int16 ground_steer_dps; - AP_Int16 stab_pitch_down_cd; + AP_Float stab_pitch_down; // speed used for speed scaling AP_Float scaling_speed; diff --git a/ArduPlane/Parameters.pde b/ArduPlane/Parameters.pde index b6d1e1168e..e1ae9cdd20 100644 --- a/ArduPlane/Parameters.pde +++ b/ArduPlane/Parameters.pde @@ -104,14 +104,14 @@ const AP_Param::Info var_info[] PROGMEM = { // @User: Advanced GSCALAR(kff_throttle_to_pitch, "KFF_THR2PTCH", 0), - // @Param: STAB_PITCH_DN_CD + // @Param: STAB_PITCH_DOWN // @DisplayName: Low throttle pitch down trim - // @Description: This controls the amount of downpitch to add in FBWA and AUTOTUNE modes when at low throttle. No down trim is added when throttle is above TRIM_THROTTLE. Below TRIM_THROTTLE downtrim is added in proportion to the amount the throttle is below TRIM_THROTTLE. At zero throttle the full downpitch specified in this parameter is added. This parameter is meant to help keep airspeed up when flying in FBWA mode with low throttle, such as when on a landing approach. A value of 200 (2 degrees) is good for many planes, although a higher value may be needed for high drag aircraft. - // @Range: 0 1000 - // @Increment: 1 - // @Units: centi-Degrees + // @Description: This controls the amount of downpitch to add in FBWA and AUTOTUNE modes when at low throttle. No down trim is added when throttle is above TRIM_THROTTLE. Below TRIM_THROTTLE downtrim is added in proportion to the amount the throttle is below TRIM_THROTTLE. At zero throttle the full downpitch specified in this parameter is added. This parameter is meant to help keep airspeed up when flying in FBWA mode with low throttle, such as when on a landing approach, without relying on an airspeed sensor. A value of 2 degrees is good for many planes, although a higher value may be needed for high drag aircraft. + // @Range: 0 15 + // @Increment: 0.1 + // @Units: Degrees // @User: Advanced - GSCALAR(stab_pitch_down_cd, "STAB_PITCH_DN_CD", 200), + GSCALAR(stab_pitch_down, "STAB_PITCH_DOWN", 2.0f), // @Param: GLIDE_SLOPE_MIN // @DisplayName: Glide slope threshold