Skip to content

Conversation

@b14ckyy
Copy link
Collaborator

@b14ckyy b14ckyy commented Feb 2, 2026

User description

Reduces chance of Blackbox corruption on F4 and reduces CPU load with many sensors.
Quads will stay at 500us for better PID control.


PR Type

Enhancement


Description

  • Set looptime to 1000us for fixed-wing aircraft defaults

    • Reduces CPU load on flight controllers with many sensors
    • Decreases Blackbox SD card write load, especially on F4
  • Fix configuration key syntax error in altitude control response

    • Removed erroneous "set" prefix from nav_fw_alt_control_response key

Diagram Walkthrough

flowchart LR
  A["Fixed-Wing Defaults"] --> B["Add looptime=1000"]
  B --> C["Reduce CPU Load"]
  B --> D["Reduce Blackbox Load"]
  A --> E["Fix Config Key Syntax"]
  E --> F["Remove 'set' Prefix"]
Loading

File Walkthrough

Relevant files
Configuration changes
defaults_dialog_entries.js
Add looptime defaults and fix config syntax                           

js/defaults_dialog_entries.js

  • Added looptime: 1000 configuration to three fixed-wing aircraft
    default profiles (AIRPLANE, FLYING_WING, TAILSITTER)
  • Fixed syntax error by removing "set" prefix from
    nav_fw_alt_control_response key in two profiles
  • Changes applied to default profiles with applied_defaults values 3, 4,
    and 31
+14/-2   

sensei-hacker and others added 2 commits January 30, 2026 10:41
fix oopsie
add looptime=1000 for fixed wings to reduce the unnecessary high CPU load after FW default has changed in 8.0. 
Reduces load on Blackbox SD as well, especially on F4.
@qodo-code-review
Copy link
Contributor

PR Compliance Guide 🔍

All compliance sections have been disabled in the configurations.

Comment on lines +393 to +396
{
key: "looptime",
value: 1000
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: Introduce a named constant (and optionally a short unit comment) for the 1kHz/1000µs loop time and reuse it in all added looptime entries to keep the value/units consistent and maintainable. [Learned best practice, importance: 6]

Suggested change
{
key: "looptime",
value: 1000
},
const LOOPTIME_1KHZ_US = 1000; // 1kHz = 1000µs
...
{
key: "looptime",
value: LOOPTIME_1KHZ_US
},

@b14ckyy b14ckyy merged commit 3ce3e50 into iNavFlight:maintenance-9.x Feb 2, 2026
6 checks passed
@sensei-hacker
Copy link
Member

I don't necessarily disagree, but as far as blackbox, isn't this equivalent to doubling the blackbox ratio?

@b14ckyy
Copy link
Collaborator Author

b14ckyy commented Feb 2, 2026

We could also set the Blackbox rate to 1/4 instead of default 1/2 but on the other hand there is still no reason to run the PID loop on fixed wings at more than 1kHz. Technically even more than 250Hz makes no sense, except placebo effects.

I think 1000Hz is a good compromise between a big and good looking number and reasonable CPU load for F405 and F435.

@b14ckyy b14ckyy deleted the b14ckyy-corrected-vspeed-defaults branch February 2, 2026 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants