diff --git a/docs/Settings.md b/docs/Settings.md index 39e3de90d52..3d7351dc371 100644 --- a/docs/Settings.md +++ b/docs/Settings.md @@ -6052,16 +6052,6 @@ When feature SERIALRX is enabled, this allows connection to several receivers wh --- -### servo_autotrim_iterm_rate_limit - -Maximum I-term rate of change (units/sec) for autotrim to be applied. Prevents trim updates during maneuver transitions when I-term is changing rapidly. Only applies when using `feature FW_AUTOTRIM`. - -| Default | Min | Max | -| --- | --- | --- | -| 2 | 0 | 50 | - ---- - ### servo_autotrim_rotation_limit Servo midpoints are only updated when total aircraft rotation is less than this threshold [deg/s]. Only applies when using `feature FW_AUTOTRIM`. diff --git a/src/main/fc/settings.yaml b/src/main/fc/settings.yaml index 6ef471e3bb0..4e8affb0221 100644 --- a/src/main/fc/settings.yaml +++ b/src/main/fc/settings.yaml @@ -1361,11 +1361,6 @@ groups: default_value: 15 min: 1 max: 60 - - name: servo_autotrim_iterm_rate_limit - description: "Maximum I-term rate of change (units/sec) for autotrim to be applied. Prevents trim updates during maneuver transitions when I-term is changing rapidly. Only applies when using `feature FW_AUTOTRIM`." - default_value: 2 - min: 0 - max: 50 - name: PG_CONTROL_PROFILES type: controlConfig_t diff --git a/src/main/flight/servos.c b/src/main/flight/servos.c index 9f6eb4851a7..639f5c18a13 100755 --- a/src/main/flight/servos.c +++ b/src/main/flight/servos.c @@ -608,6 +608,7 @@ void processServoAutotrimMode(void) #define SERVO_AUTOTRIM_CENTER_MAX 1700 #define SERVO_AUTOTRIM_UPDATE_SIZE 5 #define SERVO_AUTOTRIM_ATTITUDE_LIMIT 50 // 5 degrees +#define SERVO_AUTOTRIM_ITERM_RATE_LIMIT 30 // ~90th percentile during stable cruise (blackbox-derived) void processContinuousServoAutotrim(const float dT) { @@ -646,7 +647,7 @@ void processContinuousServoAutotrim(const float dT) for (int axis = FD_ROLL; axis <= FD_PITCH; axis++) { // For each stabilized axis, add 5 units of I-term to all associated servo midpoints const float axisIterm = getAxisIterm(axis); - const bool itermIsStable = itermRateOfChange[axis] < servoConfig()->servo_autotrim_iterm_rate_limit; + const bool itermIsStable = itermRateOfChange[axis] < SERVO_AUTOTRIM_ITERM_RATE_LIMIT; if (fabsf(axisIterm) > SERVO_AUTOTRIM_UPDATE_SIZE && itermIsStable) { const int8_t ItermUpdate = axisIterm > 0.0f ? SERVO_AUTOTRIM_UPDATE_SIZE : -SERVO_AUTOTRIM_UPDATE_SIZE; diff --git a/src/main/flight/servos.h b/src/main/flight/servos.h index b16dd7ca915..bc001455a91 100644 --- a/src/main/flight/servos.h +++ b/src/main/flight/servos.h @@ -171,7 +171,6 @@ typedef struct servoConfig_s { uint8_t tri_unarmed_servo; // send tail servo correction pulses even when unarmed uint8_t servo_autotrim_rotation_limit; // Max rotation for servo midpoints to be updated uint8_t servo_autotrim_iterm_threshold; // How much of the Iterm is carried over to the servo midpoints on each update - uint8_t servo_autotrim_iterm_rate_limit; // Max I-term rate of change (units/sec) to apply autotrim } servoConfig_t; PG_DECLARE(servoConfig_t, servoConfig);