Plane: make STAB_PITCH_DOWN in degrees

try to avoid new centi-degrees parameters
This commit is contained in:
Andrew Tridgell 2014-08-06 11:46:40 +10:00
parent 7c4d31c481
commit 2a288824c0
3 changed files with 10 additions and 9 deletions

View File

@ -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;
}
}

View File

@ -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;

View File

@ -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