You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
FixiNavFlight#9912: Add I-term stability check to servo autotrim
Prevent continuous servo autotrim from applying trim adjustments during
maneuver transitions when I-term is changing rapidly due to transient error.
Root Cause:
The autotrim code verified all flight conditions (level attitude, centered
sticks, low rotation rate) but failed to check that the I-term was in a
steady state before transferring it to servo trim. During maneuver transitions
(e.g., exiting a turn), I-term accumulates transient error. When the plane
momentarily satisfies all level-flight conditions, this transient I-term is
incorrectly transferred to servo midpoints, causing the aircraft to fly
out-of-trim.
Changes:
- Added I-term rate-of-change tracking in processContinuousServoAutotrim()
- Added stability threshold check before applying autotrim
- Added configurable parameter: servo_autotrim_iterm_rate_limit (default: 2)
- Only transfers I-term to trim when rate of change is below threshold
The fix ensures trim updates only occur during true steady-level flight,
not during transient conditions following maneuvers.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: docs/Settings.md
+10Lines changed: 10 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6052,6 +6052,16 @@ When feature SERIALRX is enabled, this allows connection to several receivers wh
6052
6052
6053
6053
---
6054
6054
6055
+
### servo_autotrim_iterm_rate_limit
6056
+
6057
+
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`.
6058
+
6059
+
| Default | Min | Max |
6060
+
| --- | --- | --- |
6061
+
| 2 | 0 | 50 |
6062
+
6063
+
---
6064
+
6055
6065
### servo_autotrim_rotation_limit
6056
6066
6057
6067
Servo midpoints are only updated when total aircraft rotation is less than this threshold [deg/s]. Only applies when using `feature FW_AUTOTRIM`.
Copy file name to clipboardExpand all lines: src/main/fc/settings.yaml
+5Lines changed: 5 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -1361,6 +1361,11 @@ groups:
1361
1361
default_value: 15
1362
1362
min: 1
1363
1363
max: 60
1364
+
- name: servo_autotrim_iterm_rate_limit
1365
+
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`."
0 commit comments