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 293 commits into
Conversation
…cceleration function
…driver support on the STM32Fxxx series.
…ALs do not support it.
… the MATEKF765SE. Allocate memory for the bxCan write and read messages.
…dle to the CAN instance to avoid a dangling pointer.
…fer and the task reads from the ring buffer. Fix missing include for math.h
Expand dronecan_messages_unittest.cc from 5 to 14 tests covering NodeStatus, Fix v1, Auxiliary, boundary values, and data type verification. Create canard_unittest.cc with 30 tests for the libcanard core: init/node ID, memory pool, CRC-16/CCITT, float16 conversion, transfer ID logic, DLC conversion, single/multi-frame TX, RX frame processing, and pool statistics. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The BatteryInfo message already contains current data which was being stored in dronecanBattSensorGetAmperage(), but this wasn't integrated with INAV's battery metering system. Changes: - Add CURRENT_SENSOR_CAN enum value in battery_config_structs.h - Add case handler in battery.c to read current from DroneCAN - Update settings.yaml to expose CAN option for current_meter_type Users can now select 'CAN' as the current_meter_type in CLI when using DroneCAN-compatible battery sensors. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
PLL2M was hardcoded to 5, which assumes HSE = 8 MHz. On KAKUTEH7WING (HSE = 16 MHz) this gives VCO = 16/5 * 500 = 1600 MHz (out of spec) and SDMMC clock = 400 MHz instead of the required 200 MHz. Fix: compute PLL2M as HSE_VALUE / 1600000, pinning the VCO input to exactly 1.6 MHz for any HSE frequency. With N=500 this gives VCO=800 MHz: HSE=8 MHz: M=5, N=500 → VCO=800 MHz (identical to original) HSE=16 MHz: M=10, N=500 → VCO=800 MHz (correct for KAKUTEH7WING) PLL2R/4 = 200 MHz (SDMMC), PLL2P/2 = 400 MHz. VCIRANGE_0 (1–2 MHz) is correct for the 1.6 MHz VCI input on all targets. Also adds STATIC_ASSERT to catch future targets with non-multiple HSE, and corrects the PLL2P comment (was "500Mhz", should be "400Mhz"). Fixes iNavFlight#11594
If PLL2 fails to lock at startup the SDMMC clock is dead and the SD card will fail silently. Call Error_Handler() (infinite loop) on failure to make the fault visible rather than continuing into undefined behaviour.
PLL1 VCI input is HSE/M = 2 MHz on all H7 targets, which falls in the 2-4 MHz range (VCIRANGE_1). The previous VCIRANGE_2 (4-8 MHz) was incorrect and affected PLL charge pump calibration. Fixes iNavFlight#11602
Remove redundant prose that duplicated the assert, remove board-specific name from shared init code, and shorten the assert slug to match codebase conventions.
…SP changes not in scope)" This reverts commit 92cf6ab.
…rning" This reverts commit 3b393c5.
…' into fix/11594-pll2-dynamic-m-divider
…mic-m-divider fix: make PLL2M dynamic to keep VCO=800MHz for any HSE frequency (closes iNavFlight#11594)
Fix: Prioritize Airspeed over GPS for turn acceleration compensation
…2688-devhw Fix ICM42688 bus device hardware type on GEPRC targets
…ftrf Basic support for softRF
…x_fixed_value VTOL.md: Rename smix max fixed value
* Add new target: AEDROXH7 (Airbot Systems AEDROX H7) STM32H743 flight controller with ICM42688P gyro, W25N01G NAND flash, DPS310 baro, MAX7456 analog OSD, HD OSD via MSP DisplayPort, and 8 motor outputs split across TIM1 and TIM8. SPI3 MOSI on PB2 requires explicit GPIO_AF7_SPI3 override. Magnetometer enabled on I2C1 (hardware present, not in BF config). * AEDROXH7: replace UART4 with DroneCAN on PD0/PD1 PD0/PD1 connect to the CAN transceiver (CANL/CANH pads visible on board), not to a user-accessible UART4 header. Replace UART4 with USE_DRONECAN defines. CAN standby pin TBD pending INAV syntax confirmation. * AEDROXH7: add CAN1_STANDBY PD3 (not yet tested) * CI: re-trigger build to pick up fc_msp.c sign-compare fix in maintenance-9.x
…nance-10.x Removes the DroneCAN DSDLC library (lib/main/Dronecan -- entirely new in 10.x) and reverts STM32F4/F7/H7 HAL libraries to their maintenance-9.x versions. 932 files. No post-merge commits touched lib/ -- this is a clean mechanical revert.
Reverts 319 STM32CubeF7 SDK extraction files introduced by the accidental maintenance-10.x merge. No post-merge commits touched this directory -- this is a clean mechanical revert.
…-merge Revert accidental merge of maintenance-10.x into maintenance-9.x
Removed redundant phrases and clarified manufacturer information.
…e-ordering-stdperiph drivers: fix DMA request disable ordering in timer IRQ handlers and stop functions
Add support for XTX XT25F128F nor flash chip
JHEMCUF435: enable UART2
…WINGMINI Add FlyingRC F4Wing Mini target updates
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.