Skip to main content

Blackbox analyzer, parameter checker, and tuning wizard for INAV flight controllers

Project description

INAV Toolkit

A Python toolkit for analyzing blackbox logs, validating configurations, and tuning INAV flight controllers. Plug in your FC via USB - it pulls the config, downloads the blackbox, tells you exactly what to change, and gives you the CLI commands to paste.

Built for the INAV long-range community. Tested on 7" to 15" multirotors with GPS navigation, INAV 9.0.x.

Install / Update

git clone https://github.com/agoliveira/INAV-Toolkit.git
cd INAV-Toolkit
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
python3 -m inav_toolkit.blackbox_analyzer --device auto

Or on Debian/Ubuntu, system packages:

sudo apt install python3-numpy python3-scipy python3-serial

Python 3.8+. pyserial only needed for direct FC connection.

Note: If using a venv, activate it (source .venv/bin/activate) before running any commands below.

Connect and Analyze

python3 -m inav_toolkit.blackbox_analyzer --device auto

That's it. The tool will auto-detect your FC, pull the current config, download the blackbox, split multi-flight logs, detect config changes between sessions, and run full analysis on the best flight.

Output

  INAV Blackbox Analyzer v2.16.0
  Connected: NAZGUL 10 - INAV 9.0.1
  Pulling configuration (diff all)... 89 settings
  Downloading 2236KB ... 204KB/s
  Found 3 flights - analyzing best from latest config

  TUNE QUALITY: █████████████░░░░░░░ 65/100
    Noise:95 | PID:N/A | Motors:94

  CONFIG:
    Roll   P= 32  I= 82  D= 32  (FC now: P->35, I->75, D->28)
    Pitch  P= 35  I= 90  D= 35  (FC now: P->38, I->82, D->31)

  NOISE SOURCES:
    50Hz motor imbalance on Roll/Yaw [medium]
    128Hz motor noise on Pitch/Yaw [low]
    187-437Hz (6 peaks) electrical on Pitch/Roll/Yaw [medium]

  DO THIS - 2 changes:
    1. Lower dynamic_gyro_notch_min_hz: 50 -> 40
    2. Consider enabling RPM filter

  INAV CLI - paste into Configurator CLI tab:
    set dynamic_gyro_notch_min_hz = 40
    save

  CONFIG REVIEW:
    [CRITICAL] Critical beeper warnings disabled - BAT_CRIT_LOW, RX_LOST

Tools

Blackbox Analyzer

Decodes .bbl / .bfl blackbox logs natively in Python (no blackbox_decode needed) and produces actionable tuning recommendations.

# Connect to FC - pull config + download + analyze
python3 -m inav_toolkit.blackbox_analyzer --device auto

# Analyze an existing log file
python3 -m inav_toolkit.blackbox_analyzer flight.bbl

# With a saved diff for config comparison
python3 -m inav_toolkit.blackbox_analyzer flight.bbl --diff my_diff.txt

# Specify frame size for tailored thresholds
python3 -m inav_toolkit.blackbox_analyzer flight.bbl --frame 10

# Download only, analyze later
python3 -m inav_toolkit.blackbox_analyzer --device auto --download-only

# Flight progression history
python3 -m inav_toolkit.blackbox_analyzer flight.bbl --history

What it measures:

  • PID step response - overshoot %, tracking delay, settling time per axis
  • Noise spectrum - identifies peak frequencies, classifies sources (propwash, electrical, motor imbalance), groups and ranks by severity
  • Hover oscillation - RMS and peak-to-peak gyro during centered stick
  • Motor balance - average load and saturation per motor
  • Filter phase lag - total delay through the gyro/D-term filter chain
  • Config mismatch - detects when the FC config has changed since the flight being analyzed

What it outputs:

  • Terminal report with score, noise sources, specific CLI commands to paste
  • HTML report with interactive charts (noise spectrum, PID response, motor traces)
  • state.json for cross-referencing with the parameter analyzer
  • SQLite flight database for progression tracking across sessions

Parameter Analyzer

Validates an INAV diff all export for configuration issues. Catches problems that blackbox data alone can't detect.

# Check existing config
python3 -m inav_toolkit.param_analyzer my_diff.txt --frame 10

# Generate starting PIDs for a new build
python3 -m inav_toolkit.param_analyzer --setup 10 --voltage 6S

# Compare starting PIDs with current config
python3 -m inav_toolkit.param_analyzer --setup 10 --voltage 6S my_diff.txt

# Cross-reference with blackbox results
python3 -m inav_toolkit.param_analyzer my_diff.txt --blackbox state.json

What it checks: safety (beepers, failsafe, battery limits), motors (protocol, RPM filter, ESC telemetry), filters (frame-appropriate LPF, dynamic notch), PIDs (cross-profile consistency, antigravity), navigation (RTH altitude, position PIDs, safehome), GPS (constellations, compass cal), blackbox (logging rate, essential fields).

Setup mode generates conservative starting PIDs for 7/10/12/15" frames at 4S/6S/8S/12S.

VTOL Configurator

Validates INAV VTOL configurations using mixer_profile switching.

python3 -m inav_toolkit.vtol_configurator vtol_diff.txt

Checks MC/FW mixer profiles, tilt servo rules, motor role inference, yaw authority, FW control surfaces, mode assignments, automated RTH transition, and airmode conflicts.

Guided Wizard

Interactive session manager that walks you through the full workflow.

python3 -m inav_toolkit.wizard

Connects to your FC and offers: tuning session, nav health check, new build safety check, blackbox download, or config restore from backup.

MSP Module

Direct serial communication with INAV flight controllers. Used internally by the other tools, also usable standalone.

# Standalone: identify FC and download blackbox
python3 -m inav_toolkit.msp --device auto

Handles MSP v2 framing, pipelined dataflash download (4-deep), CLI command/batch, auto-reconnection after USB VCP reset.

Tuning Workflow

1. NEW BUILD
   python3 -m inav_toolkit.param_analyzer --setup 10 --voltage 6S
   -> Conservative starting PIDs and filter settings
   -> Paste CLI commands into INAV Configurator

2. SAFETY CHECK
   python3 -m inav_toolkit.param_analyzer my_diff.txt --frame 10
   -> Catches disabled beepers, failsafe issues, battery limits
   -> Fix before flying

3. FLY
   -> Enable blackbox logging (GYRO_RAW, MOTORS, RC_COMMAND)
   -> Hover for 10s, then do deliberate roll/pitch/yaw sweeps
   -> The analyzer needs stick inputs to measure PID response

4. ANALYZE
   python3 -m inav_toolkit.blackbox_analyzer --device auto
   -> Downloads log, pulls current config, runs full analysis
   -> Shows exactly what to change with CLI commands

5. APPLY + REPEAT
   -> Paste CLI commands, fly again
   -> Tool auto-detects which flights use the new config
   -> Flight database tracks your progression across sessions

Frame Size Profiles

The --setup mode provides conservative starting configurations:

Frame P Roll P Pitch D Gyro LPF Dyn Notch Min
7" 4S 35 38 23 90 Hz 60 Hz
10" 4S 25 28 18 65 Hz 50 Hz
12" 4S 20 22 14 50 Hz 35 Hz
15" 4S 15 16 10 40 Hz 25 Hz

Higher voltage (6S/8S/12S) scales P and D down proportionally.

Project Structure

INAV-Toolkit/
├── inav_toolkit/
│   ├── __init__.py              # Package version
│   ├── blackbox_analyzer.py     # Blackbox log analyzer
│   ├── msp.py                   # MSP v2 serial communication
│   ├── flight_db.py             # SQLite flight history
│   ├── param_analyzer.py        # Config validator + setup generator
│   ├── vtol_configurator.py     # VTOL mixer validator
│   ├── wizard.py                # Guided session manager
│   ├── autotune.py              # Autotune orchestrator (experimental)
│   ├── i18n.py                  # Internationalization
│   └── locales/                 # en, pt_BR, es
├── docs/
├── tests/
├── README.md
├── CHANGELOG.md
├── LICENSE                      # MIT
└── requirements.txt

INAV Version Support

Developed and tested against INAV 9.0.x. The blackbox binary decoder handles the Cleanflight/INAV encoding format natively in Python - no external blackbox_decode tool needed. Parameter names are INAV-specific; Betaflight is not currently supported.

Contributing

This is an active project. Planned: autonomous tuning loop (Pi Zero 2W or ESP32 strapped to the quad), expanded nav analysis, and web-based report viewer.

License

MIT License. See LICENSE.

Acknowledgments

  • The INAV development team and community
  • QuadMeUp (Pawel Spychalski) for filter and RPM analysis research
  • The INAV Fixed Wing Group for modes documentation
  • UAV Tech for the spark that gave me the idea to create this

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

inav_toolkit-2.19.0.tar.gz (208.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

inav_toolkit-2.19.0-py3-none-any.whl (203.7 kB view details)

Uploaded Python 3

File details

Details for the file inav_toolkit-2.19.0.tar.gz.

File metadata

  • Download URL: inav_toolkit-2.19.0.tar.gz
  • Upload date:
  • Size: 208.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for inav_toolkit-2.19.0.tar.gz
Algorithm Hash digest
SHA256 7390558048f58f9ca667369c612c57ff2cc0e5fe8dc6cadd7548af5cec4c55b5
MD5 af1de5e2ff22187a8048c4cf2f185957
BLAKE2b-256 1216922ae8867e4d08a8325112eb035c8f99843843bb281e2c3e86ba81686aae

See more details on using hashes here.

Provenance

The following attestation bundles were made for inav_toolkit-2.19.0.tar.gz:

Publisher: publish.yml on agoliveira/INAV-Toolkit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file inav_toolkit-2.19.0-py3-none-any.whl.

File metadata

  • Download URL: inav_toolkit-2.19.0-py3-none-any.whl
  • Upload date:
  • Size: 203.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for inav_toolkit-2.19.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e7898d0bbe2abed3cef45c5fa5ea4e3ed574f105853ed596e922b3de415657df
MD5 d6ef37a7ab20570bd37ad318ca87b8fa
BLAKE2b-256 a5a6372b9a233234ed99e37c4d687a0498d62687246e98e5dae48d872fb9cc23

See more details on using hashes here.

Provenance

The following attestation bundles were made for inav_toolkit-2.19.0-py3-none-any.whl:

Publisher: publish.yml on agoliveira/INAV-Toolkit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page