Skip to content

Maintenance 9.x to master#11451

Merged
sensei-hacker merged 33 commits intomasterfrom
maintenance-9.x
Mar 22, 2026
Merged

Maintenance 9.x to master#11451
sensei-hacker merged 33 commits intomasterfrom
maintenance-9.x

Conversation

@sensei-hacker
Copy link
Member

No description provided.

functionpointer and others added 30 commits November 22, 2025 20:25
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>
- Move I-term tracking outside stable flight check for accurate rate calculation
- Move servo_autotrim_iterm_rate_limit to end of struct for EEPROM compatibility
Add hwVersion field to MSP_GPSSTATISTICS (166) for GPS module detection:
- Field added at end of message (backward compatible)
- Exposes gpsState.hwVersion (800=M8, 900=M9, 1000=M10, 0=Unknown)
- Enables configurator auto-detection of GPS module type

Changes:
- src/main/fc/fc_msp.c: Add sbufWriteU32(dst, gpsState.hwVersion)
- docs/development/msp/msp_messages.json: Document hwVersion field

Used by configurator GPS preset UI to automatically configure optimal
constellation/rate settings based on hardware capability (M8/M9/M10).

Backward compatible: Old configurators ignore extra bytes, new configurators
check byteLength before reading hwVersion field.

Related configurator PR: feature-gps-preset-ui branch
Research: claude/developer/docs/gps/m9-16-satellite-limitation-official.md
Changed defaults to provide better out-of-box accuracy:
- gps_ublox_use_galileo: OFF → ON
- gps_ublox_use_beidou: OFF → ON
- gps_ublox_use_glonass: OFF (unchanged)
- gps_ublox_nav_hz: 10 → 8

Rationale:
- 3 constellations (GPS+Galileo+Beidou) provide excellent coverage
- 8Hz allows M9 modules to use 32 satellites (vs 16 at ≥10Hz)
- Safe for M8 (handles 8Hz easily)
- Optimal for M10 with 3 constellations at default clock
- Glonass remains OFF to avoid M10 processing overhead

Updated nav_hz description to document M9's 16-satellite
limitation at ≥10Hz, discovered through u-blox forum research
and Clive Turvey's code analysis.

Regenerated Settings.md from settings.yaml.

Related: GPS preset UI feature
Addresses Qodo code review suggestion to prevent sending uninitialized
memory over MSP_GPSSTATISTICS.

While global variables are zero-initialized in C, explicit initialization
is better practice:
- Makes intent clear in code
- Works for all GPS providers (UBLOX, MSP, FAKE)
- Future-proof if gpsState becomes non-global
- Documents that 0 means UNKNOWN

u-blox driver also initializes to UBX_HW_VERSION_UNKNOWN (0) during
configuration, but this ensures all code paths are safe.
Position estimator GPS origin altitude improvement for poor initial GPS epv
Add GPS hardware version to MSP and optimize defaults for M8/M9/M10
…iterm

Fix #9912: Add I-term stability check to servo autotrim
When a pull request only modifies files within one directory under
src/main/target/, there is no need to rebuild all ~150 targets.

A new `detect` job inspects the changed files. If every changed file
is inside exactly one src/main/target/<DIR>/ sub-directory, the target
names are read from that directory's CMakeLists.txt and passed to a
new `build-single-target` job which runs `ninja <targets>` on a single
runner instead of the usual 15-job matrix.

Any PR that touches files outside a single target directory falls
through to the existing full matrix build unchanged.

The `upload-artifacts` job is updated to accept output from either
build path.
CI: build only affected target for single-target PRs
@sensei-hacker sensei-hacker merged commit 5ee171f into master Mar 22, 2026
31 checks passed
@github-actions
Copy link

Branch Targeting Suggestion

You've targeted the master branch with this PR. Please consider if a version branch might be more appropriate:

  • maintenance-9.x - If your change is backward-compatible and won't create compatibility issues between INAV firmware and Configurator 9.x versions. This will allow your PR to be included in the next 9.x release.

  • maintenance-10.x - If your change introduces compatibility requirements between firmware and configurator that would break 9.x compatibility. This is for PRs which will be included in INAV 10.x

If master is the correct target for this change, no action is needed.


This is an automated suggestion to help route contributions to the appropriate branch.

@github-actions
Copy link

Test firmware build ready — commit 47e98d3

Download firmware for PR #11451

228 targets built. Find your board's .hex file by name on that page (e.g. MATEKF405SE.hex). Files are individually downloadable — no GitHub login required.

Development build for testing only. Use Full Chip Erase when flashing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants