docs(autotune): fix fixed-wing autotune docs to match actual behavior#11676
docs(autotune): fix fixed-wing autotune docs to match actual behavior#11676sensei-hacker wants to merge 1 commit into
Conversation
Roll/pitch/yaw rates are described as a fixed ceiling autotune respects; in reality, with the default fw_autotune_rate_adjustment setting, autotune actively rewrites roll_rate/pitch_rate/yaw_rate while flying. The doc also claimed autotune sets P and I gains, which hasn't been true since gain the P/I/D-from-FF formula was removed in 2021. Neither yaw nor the MANUAL-mode no-op were mentioned. Rewrites the pre-flight parameter table and flying instructions to describe what the code actually does: FeedForward is tuned on all three axes, P/I are never touched, rate tuning depends on flight mode and fw_autotune_rate_adjustment, and AUTOTUNE has no effect at all in MANUAL mode.
PR Summary by QodoFix fixed-wing AUTOTUNE docs to match current firmware behavior
AI Description
Diagram
High-Level Assessment
Files changed (1)
|
Code Review by Qodo
1. Rate-mode docs mismatch
|
| * **FeedForward (FF) gain** - in ANGLE, HORIZON or ACRO, whenever you give it enough hard stick input to learn from | ||
| * **Rate** (`roll_rate`/`pitch_rate`/`yaw_rate`) - only while flying in ACRO or HORIZON, and only if `fw_autotune_rate_adjustment` is not set to `FIXED` (see below). Rate is never adjusted while flying in ANGLE mode. | ||
|
|
There was a problem hiding this comment.
1. Rate-mode docs mismatch 🐞 Bug ≡ Correctness
The docs state rate (roll_rate/pitch_rate/yaw_rate) is only tuned in ACRO/HORIZON, but the implementation updates rates in any non-ANGLE mode (including ANGLEHOLD) when fw_autotune_rate_adjustment != FIXED, so users can still have rates adjusted outside ACRO/HORIZON.
Agent Prompt
### Issue description
The documentation claims that AUTOTUNE rate adjustment happens only in ACRO/HORIZON, but the firmware gates rate adjustment only on `!ANGLE_MODE` (and not MANUAL). This makes the docs inaccurate for modes like `ANGLEHOLD_MODE`.
### Issue Context
- `autotuneFixedWingUpdate()` adjusts rates whenever `fw_rate_adjustment != FIXED` and `!FLIGHT_MODE(ANGLE_MODE)`.
- `ANGLEHOLD_MODE` is enabled separately from `ANGLE_MODE`, so rate adjustment can occur while flying in ANGLEHOLD.
### Fix Focus Areas
- docs/Autotune - fixedwing.md[11-13]
- docs/Autotune - fixedwing.md[56-58]
Suggested doc direction:
- Replace “only in ACRO/HORIZON” with “in any non-ANGLE mode” (and still recommend ACRO/HORIZON for best results), or explicitly mention ANGLEHOLD as also allowing rate changes.
- Keep the “no effect in MANUAL” statement.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
Summary
The fixed-wing AUTOTUNE documentation no longer matched the current implementation in
src/main/flight/pid_autotune.c. A user reported confusion after their rates changed significantly during an AUTOTUNE flight, which they didn't expect based on the docs.Changes
roll_rate/pitch_rate/yaw_rateare described as fixed limits AUTOTUNE respects, but by default (fw_autotune_rate_adjustment = AUTO) AUTOTUNE actively rewrites them while flying. Documented all threefw_autotune_*settings that control this.9dcf985b0c, "Don't change P, I and D during autotune"). AUTOTUNE only ever tunes FeedForward gain and, conditionally, rate.pid.c:881).Testing
Documentation-only change; no firmware behavior changed, so no build/SITL testing applies. Every factual claim was checked directly against the source:
src/main/flight/pid_autotune.c(core tuning logic, rate/FF update conditions, min/max rate constants)src/main/flight/pid.c(pidApplyFixedWingRateController, HORIZON-mode rate blending)src/main/fc/fc_core.c(ANGLE_MODE/HORIZON_MODE/MANUAL_MODE flag semantics)src/main/fc/settings.yaml(fw_autotune_rate_adjustment,fw_autotune_min_stick,fw_autotune_max_rate_deflectiondefaults and valid values)Code Review
Reviewed with the inav-code-review agent, used specifically to independently verify every claim in this doc against the code above. It caught one real error in a companion wiki doc (AUTOTUNE incorrectly described as active in MANUAL mode) before this was opened; that's fixed in the companion inavwiki PR.
Related
Companion doc fix in the inavwiki repo (AUTOTUNE section of Modes.md) covers the same inaccuracies for the wiki's mode reference page.