inav-toolkit 2.3.0__tar.gz → 2.4.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (25) hide show
  1. {inav_toolkit-2.3.0 → inav_toolkit-2.4.1}/PKG-INFO +122 -58
  2. inav_toolkit-2.4.1/README.md +328 -0
  3. {inav_toolkit-2.3.0 → inav_toolkit-2.4.1}/inav_toolkit/__init__.py +1 -1
  4. {inav_toolkit-2.3.0 → inav_toolkit-2.4.1}/inav_toolkit/blackbox_analyzer.py +1507 -16
  5. {inav_toolkit-2.3.0 → inav_toolkit-2.4.1}/inav_toolkit/flight_db.py +1 -1
  6. {inav_toolkit-2.3.0 → inav_toolkit-2.4.1}/inav_toolkit/msp.py +1 -1
  7. {inav_toolkit-2.3.0 → inav_toolkit-2.4.1}/inav_toolkit/param_analyzer.py +1 -1
  8. {inav_toolkit-2.3.0 → inav_toolkit-2.4.1}/inav_toolkit/vtol_configurator.py +1 -1
  9. {inav_toolkit-2.3.0 → inav_toolkit-2.4.1}/inav_toolkit/wizard.py +1 -1
  10. {inav_toolkit-2.3.0 → inav_toolkit-2.4.1}/inav_toolkit.egg-info/PKG-INFO +122 -58
  11. {inav_toolkit-2.3.0 → inav_toolkit-2.4.1}/pyproject.toml +1 -1
  12. inav_toolkit-2.3.0/README.md +0 -264
  13. {inav_toolkit-2.3.0 → inav_toolkit-2.4.1}/LICENSE +0 -0
  14. {inav_toolkit-2.3.0 → inav_toolkit-2.4.1}/inav_toolkit/autotune.py +0 -0
  15. {inav_toolkit-2.3.0 → inav_toolkit-2.4.1}/inav_toolkit/i18n.py +0 -0
  16. {inav_toolkit-2.3.0 → inav_toolkit-2.4.1}/inav_toolkit/locales/en.json +0 -0
  17. {inav_toolkit-2.3.0 → inav_toolkit-2.4.1}/inav_toolkit/locales/es.json +0 -0
  18. {inav_toolkit-2.3.0 → inav_toolkit-2.4.1}/inav_toolkit/locales/pt_BR.json +0 -0
  19. {inav_toolkit-2.3.0 → inav_toolkit-2.4.1}/inav_toolkit.egg-info/SOURCES.txt +0 -0
  20. {inav_toolkit-2.3.0 → inav_toolkit-2.4.1}/inav_toolkit.egg-info/dependency_links.txt +0 -0
  21. {inav_toolkit-2.3.0 → inav_toolkit-2.4.1}/inav_toolkit.egg-info/entry_points.txt +0 -0
  22. {inav_toolkit-2.3.0 → inav_toolkit-2.4.1}/inav_toolkit.egg-info/requires.txt +0 -0
  23. {inav_toolkit-2.3.0 → inav_toolkit-2.4.1}/inav_toolkit.egg-info/top_level.txt +0 -0
  24. {inav_toolkit-2.3.0 → inav_toolkit-2.4.1}/setup.cfg +0 -0
  25. {inav_toolkit-2.3.0 → inav_toolkit-2.4.1}/tests/test_smoke.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: inav-toolkit
3
- Version: 2.3.0
3
+ Version: 2.4.1
4
4
  Summary: Blackbox analyzer, parameter checker, and tuning wizard for INAV flight controllers
5
5
  License: MIT
6
6
  Project-URL: Homepage, https://github.com/agoliveira/INAV-Toolkit
@@ -32,7 +32,7 @@ Dynamic: license-file
32
32
 
33
33
  # INAV Toolkit
34
34
 
35
- 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, analyzes PID tuning and navigation performance, tells you exactly what to change, and gives you the CLI commands to paste.
35
+ A Python toolkit for analyzing blackbox logs, validating configurations, and tuning INAV flight controllers. Plug in your FC via USB it runs a pre-flight safety check, pulls the config, downloads the blackbox, analyzes PID tuning and navigation performance, compares with your previous flight, tells you exactly what to change, and gives you the CLI commands to paste. Every config is archived automatically so you can diff any two sessions.
36
36
 
37
37
  Built for the INAV long-range community. Tested on 7" to 15" multirotors with GPS navigation, INAV 9.0.x.
38
38
 
@@ -66,27 +66,39 @@ Python 3.8+. `pyserial` only needed for direct FC connection.
66
66
  python3 -m inav_toolkit.blackbox_analyzer --device auto
67
67
  ```
68
68
 
69
- That's it. The tool will auto-detect your FC, pull the full config dump, download the blackbox, split multi-flight logs, run PID tuning and navigation analysis, clean up log files, and erase flash. Results are presented in an interactive menu:
69
+ That's it. The tool will:
70
+
71
+ 1. Auto-detect your FC and pull the full config dump
72
+ 2. Run a **pre-flight safety check** (disabled beepers, failsafe, battery limits)
73
+ 3. Archive the config to the **backup vault** with timestamp
74
+ 4. Download the blackbox and split multi-flight logs
75
+ 5. Run PID tuning, noise, and navigation analysis
76
+ 6. Compare with your **previous flight** and explain what changed
77
+ 7. Clean up log files and erase flash
78
+ 8. Open the **tabbed HTML report** in your browser
79
+
80
+ Results are presented in an interactive terminal menu:
70
81
 
71
82
  ```
72
83
  TUNE QUALITY: █████████░░░░░░░░░░░ 46/100
73
84
  Noise:94 | PID:26 | Motors:53
74
85
 
75
86
  [1] PID Tuning R:62%OS P:ok Y:N/A
76
- [2] Noise Analysis 94/100 - 2 sources
87
+ [2] Noise Analysis 94/100 2 sources
77
88
  [3] Hover & Stability R:moderate P:wind Y:wind
78
- [4] Nav Performance 45/100 - 4 decel events, CEP 1271cm
89
+ [4] Nav Performance 45/100 4 decel events, CEP 1271cm
79
90
  [5] Nav Sensors Com:70 GPS:100 Bar:70
80
91
  [6] Config Review 1 critical, 2 warnings
81
- [7] Flight History available
92
+ [7] Flight History 3 flights ▃▅▇
93
+ [8] vs Previous ↘ -8 (4 config changes)
82
94
  [C] CLI Commands 2 changes
83
95
  [A] Show All
84
96
  [Q] Quit
85
97
 
86
- Section (1-7, C, A, Q):
98
+ Section (1-8, C, A, Q):
87
99
  ```
88
100
 
89
- Each section shows a one-line status at a glance. Select a number to drill into details. The CLI Commands section gives you paste-ready commands for INAV Configurator.
101
+ Each section shows a one-line status at a glance. Select a number to drill into details. Flight History shows trend sparklines. The CLI Commands section gives you paste-ready commands.
90
102
 
91
103
  ## Tools
92
104
 
@@ -95,7 +107,7 @@ Each section shows a one-line status at a glance. Select a number to drill into
95
107
  Decodes `.bbl` / `.bfl` blackbox logs natively in Python (no `blackbox_decode` needed) and produces actionable tuning and navigation recommendations.
96
108
 
97
109
  ```bash
98
- # Connect to FC - pull config + download + analyze + cleanup + erase
110
+ # Connect to FC full pipeline (safety check + download + analyze + cleanup + erase)
99
111
  python3 -m inav_toolkit.blackbox_analyzer --device auto
100
112
 
101
113
  # Analyze an existing log file
@@ -116,44 +128,93 @@ python3 -m inav_toolkit.blackbox_analyzer --device auto --keep-logs
116
128
  # Don't erase flash after download
117
129
  python3 -m inav_toolkit.blackbox_analyzer --device auto --no-erase
118
130
 
119
- # Archive analyzed flight (compress to blackbox/archive/)
120
- python3 -m inav_toolkit.blackbox_analyzer --device auto --archive
131
+ # Don't open browser with HTML report
132
+ python3 -m inav_toolkit.blackbox_analyzer --device auto --no-browser
121
133
 
122
134
  # Skip nav analysis even if nav fields are present
123
135
  python3 -m inav_toolkit.blackbox_analyzer flight.bbl --no-nav
124
136
 
125
137
  # Flight progression history
126
138
  python3 -m inav_toolkit.blackbox_analyzer flight.bbl --history
139
+
140
+ # List archived configs
141
+ python3 -m inav_toolkit.blackbox_analyzer --config-history
142
+
143
+ # Compare two archived configs
144
+ python3 -m inav_toolkit.blackbox_analyzer --config-diff 1 3
127
145
  ```
128
146
 
129
147
  **What it analyzes (auto-detected from available data):**
130
148
 
131
149
  PID tuning:
132
- - Step response - overshoot %, tracking delay, settling time per axis
133
- - FeedForward-aware - attributes overshoot between FF and P, recommends FF reduction before P cuts
134
- - Hover oscillation - RMS and peak-to-peak gyro, wind buffeting vs P oscillation on large frames
135
- - Noise spectrum - peak frequencies, source classification (propwash, electrical, motor imbalance)
136
- - Filter recommendations - phase-lag-aware, won't recommend destructive LPF cuts on 10"+ frames
137
- - Motor balance - average load and saturation per motor
150
+ - Step response overshoot %, tracking delay, settling time per axis
151
+ - FeedForward-aware attributes overshoot between FF and P, recommends FF reduction before P cuts
152
+ - Hover oscillation RMS and peak-to-peak gyro, wind buffeting vs P oscillation on large frames
153
+ - Noise spectrum peak frequencies, source classification (propwash, electrical, motor imbalance)
154
+ - Filter recommendations phase-lag-aware, won't recommend destructive LPF cuts on 10"+ frames
155
+ - Motor balance average load and saturation per motor
138
156
 
139
157
  Navigation performance (when nav fields are present):
140
- - Deceleration overshoot - measures position error when stopping, oscillation count, settling time
141
- - Position hold quality - CEP, RMS error, max drift, toilet-bowl pattern detection
142
- - Altitude hold quality - vertical error RMS, oscillation detection
143
- - Controller saturation - detects when nav demands exceed platform capability
144
- - Wind vs tuning - correlates position error with wind estimates to separate environmental drift from PID problems
158
+ - Deceleration overshoot measures position error when stopping, oscillation count, settling time
159
+ - Position hold quality CEP, RMS error, max drift, toilet-bowl pattern detection
160
+ - Altitude hold quality vertical error RMS, oscillation detection
161
+ - Controller saturation detects when nav demands exceed platform capability
162
+ - Wind vs tuning correlates position error with wind estimates to separate environmental drift from PID problems
145
163
 
146
164
  Navigation sensors:
147
- - Compass health - heading jitter, magnetic interference, drift rate
148
- - GPS quality - fix type, satellite count, HDOP, position jumps
149
- - Barometer - noise level, spike detection, throttle correlation
150
- - Position estimator - GPS vs estimator divergence
165
+ - Compass health heading jitter, magnetic interference, drift rate
166
+ - GPS quality fix type, satellite count, HDOP, position jumps
167
+ - Barometer noise level, spike detection, throttle correlation
168
+ - Position estimator GPS vs estimator divergence
151
169
 
152
170
  **What it outputs:**
153
- - Interactive terminal menu (with `--device auto`) or sequential report
154
- - HTML report with interactive charts (noise spectrum, PID response, motor traces)
171
+
172
+ Terminal:
173
+ - Interactive menu with 8 sections (with `--device auto`) or sequential report
174
+ - Pre-flight safety checklist with CLI fix commands
175
+ - Flight-to-flight diff with causal verdict ("P increase caused more overshoot")
176
+ - Trend sparklines showing score progression across sessions
177
+
178
+ HTML report (tabbed, auto-opens in browser):
179
+ - **Overview** — score, actions, CLI commands, pre-flight warnings, config
180
+ - **PID Tuning** — step response table and chart
181
+ - **Noise & Filters** — gyro spectrum and D-term noise charts
182
+ - **Motors** — balance table and chart
183
+ - **Nav Performance** — deceleration, poshold, althold metrics
184
+ - **Nav Sensors** — compass, GPS, baro, estimator health
185
+ - **What-If** — interactive PID/filter simulation with predicted effects
186
+ - **History** — flight diff, score progression chart, flight table
187
+
188
+ Other:
155
189
  - `state.json` for cross-referencing with the parameter analyzer
156
- - SQLite flight database for progression tracking across sessions
190
+ - SQLite flight database for progression tracking
191
+ - Config vault with timestamped backups of every FC dump
192
+
193
+ ### Config Backup Vault
194
+
195
+ Every `--device auto` run archives the FC's full `dump all` with a timestamp. Over time you build a complete history of every config you've flown.
196
+
197
+ ```bash
198
+ # List archived configs
199
+ python3 -m inav_toolkit.blackbox_analyzer --config-history
200
+
201
+ CONFIG VAULT: 3 archived configs
202
+ # Date Settings Age Craft
203
+ ────────────────────────────────────────────────────────────
204
+ 1 2026-03-29 13:18 976 2h ago NAZGUL 10
205
+ 2 2026-03-28 17:07 976 1d ago NAZGUL 10
206
+ 3 2026-03-27 10:30 976 2d ago NAZGUL 10
207
+
208
+ # Compare any two configs by number
209
+ python3 -m inav_toolkit.blackbox_analyzer --config-diff 1 3
210
+
211
+ CONFIG DIFF: 12 differences, 964 unchanged
212
+ Changed (10):
213
+ mc_p_roll: 25 → 40 (+60%)
214
+ dterm_lpf_hz: 60 → 110 (+83%)
215
+ failsafe_procedure: RTH → DROP
216
+ ...
217
+ ```
157
218
 
158
219
  ### Parameter Analyzer
159
220
 
@@ -175,7 +236,7 @@ python3 -m inav_toolkit.param_analyzer my_dump.txt --blackbox state.json
175
236
 
176
237
  **What it checks:** safety (beepers, failsafe, battery limits), motors (protocol, RPM filter, ESC telemetry), filters (frame-appropriate LPF, dynamic notch), PIDs (cross-profile consistency, FF, antigravity), navigation (frame-aware nav PID thresholds, RTH altitude, deceleration time, position PIDs, safehome), GPS (constellations, compass cal), blackbox (logging rate, essential fields).
177
238
 
178
- **Setup mode** generates conservative starting PIDs for 7/10/12/15" frames at 4S/6S/8S/12S.
239
+ **Setup mode** generates conservative starting PIDs including FeedForward for 7/10/12/15" frames at 4S/6S/8S/12S.
179
240
 
180
241
  ### VTOL Configurator
181
242
 
@@ -213,45 +274,48 @@ Handles MSP v2 framing, pipelined dataflash download (4-deep), CLI command/batch
213
274
  ```
214
275
  1. NEW BUILD
215
276
  python3 -m inav_toolkit.param_analyzer --setup 10 --voltage 6S
216
- -> Conservative starting PIDs, filters, and nav settings
217
- -> Paste CLI commands into INAV Configurator
277
+ Conservative starting PIDs, filters, FF, and nav settings
278
+ Paste CLI commands into INAV Configurator
218
279
 
219
- 2. SAFETY CHECK
220
- python3 -m inav_toolkit.param_analyzer my_dump.txt --frame 10
221
- -> Catches disabled beepers, failsafe issues, battery limits
222
- -> Flags nav PIDs that are INAV defaults (tuned for 5") on larger frames
223
- -> Fix before flying
280
+ 2. SAFETY CHECK (automatic with --device auto)
281
+ Pre-flight checklist catches disabled beepers, failsafe issues
282
+ Flags nav PIDs that are INAV defaults (tuned for 5") on larger frames
283
+ Warns sternly with fix commands, doesn't block
224
284
 
225
285
  3. FLY
226
- -> Enable blackbox logging (GYRO_RAW, MOTORS, RC_COMMAND)
227
- -> Hover for 10s, then do deliberate roll/pitch/yaw sweeps
228
- -> Engage POSHOLD and RTH for nav analysis data
286
+ Enable blackbox logging (GYRO_RAW, MOTORS, RC_COMMAND)
287
+ Hover for 10s, then do deliberate roll/pitch/yaw sweeps
288
+ Engage POSHOLD and RTH for nav analysis data
229
289
 
230
290
  4. ANALYZE
231
291
  python3 -m inav_toolkit.blackbox_analyzer --device auto
232
- -> Downloads log, pulls full config dump, runs all analysis
233
- -> Interactive menu with PID, noise, nav, config review sections
234
- -> Shows exactly what to change with CLI commands
235
- -> Auto-cleans log files and erases flash when done
292
+ Downloads log, pulls full config dump, archives to vault
293
+ Pre-flight safety check before download
294
+ Interactive menu with PID, noise, nav, config review sections
295
+ Compares with previous flight: "P increase caused more overshoot"
296
+ → Shows exactly what to change with CLI commands
297
+ → Opens tabbed HTML report with What-If simulation
298
+ → Auto-cleans log files and erases flash when done
236
299
 
237
300
  5. APPLY + REPEAT
238
- -> Paste CLI commands, fly again
239
- -> Tool auto-detects which flights use the new config
240
- -> Flight database tracks your progression across sessions
301
+ Paste CLI commands, fly again
302
+ Tool auto-detects which flights use the new config
303
+ Flight database tracks progression with sparkline trends
304
+ → Config vault archives every session for future reference
241
305
  ```
242
306
 
243
307
  ## Frame Size Profiles
244
308
 
245
309
  The `--setup` mode provides conservative starting configurations:
246
310
 
247
- | Frame | P Roll | P Pitch | D | Gyro LPF | Dyn Notch Min |
248
- |-------|--------|---------|---|----------|---------------|
249
- | 7" 4S | 35 | 38 | 23 | 90 Hz | 60 Hz |
250
- | 10" 4S | 25 | 28 | 18 | 65 Hz | 50 Hz |
251
- | 12" 4S | 20 | 22 | 14 | 50 Hz | 35 Hz |
252
- | 15" 4S | 15 | 16 | 10 | 40 Hz | 25 Hz |
311
+ | Frame | P Roll | P Pitch | D | FF | Gyro LPF | Dyn Notch Min |
312
+ |-------|--------|---------|---|-----|----------|---------------|
313
+ | 7" 4S | 35 | 38 | 23 | 60 | 90 Hz | 60 Hz |
314
+ | 10" 4S | 25 | 28 | 18 | 40 | 65 Hz | 50 Hz |
315
+ | 12" 4S | 20 | 22 | 14 | 30 | 50 Hz | 35 Hz |
316
+ | 15" 4S | 15 | 16 | 10 | 20 | 40 Hz | 25 Hz |
253
317
 
254
- Higher voltage (6S/8S/12S) scales P and D down proportionally.
318
+ Higher voltage (6S/8S/12S) scales P and D down proportionally. Yaw FF also included (slightly higher than roll/pitch since yaw has no D-term).
255
319
 
256
320
  ## Project Structure
257
321
 
@@ -259,9 +323,9 @@ Higher voltage (6S/8S/12S) scales P and D down proportionally.
259
323
  INAV-Toolkit/
260
324
  ├── inav_toolkit/
261
325
  │ ├── __init__.py # Package version
262
- │ ├── blackbox_analyzer.py # Blackbox log analyzer + nav performance
326
+ │ ├── blackbox_analyzer.py # Blackbox analyzer, nav performance, What-If
263
327
  │ ├── msp.py # MSP v2 serial communication
264
- │ ├── flight_db.py # SQLite flight history
328
+ │ ├── flight_db.py # SQLite flight history + flight diff
265
329
  │ ├── param_analyzer.py # Config validator + setup generator
266
330
  │ ├── vtol_configurator.py # VTOL mixer validator
267
331
  │ ├── wizard.py # Guided session manager
@@ -278,11 +342,11 @@ INAV-Toolkit/
278
342
 
279
343
  ## INAV Version Support
280
344
 
281
- 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.
345
+ 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.
282
346
 
283
347
  ## Contributing
284
348
 
285
- This is an active project. Planned: autonomous tuning loop (Pi Zero 2W or ESP32 strapped to the quad) and web-based report viewer.
349
+ This is an active project. Planned: autonomous tuning loop (Pi Zero 2W or ESP32 strapped to the quad).
286
350
 
287
351
  ## License
288
352
 
@@ -0,0 +1,328 @@
1
+ # INAV Toolkit
2
+
3
+ A Python toolkit for analyzing blackbox logs, validating configurations, and tuning INAV flight controllers. Plug in your FC via USB — it runs a pre-flight safety check, pulls the config, downloads the blackbox, analyzes PID tuning and navigation performance, compares with your previous flight, tells you exactly what to change, and gives you the CLI commands to paste. Every config is archived automatically so you can diff any two sessions.
4
+
5
+ Built for the INAV long-range community. Tested on 7" to 15" multirotors with GPS navigation, INAV 9.0.x.
6
+
7
+ ## Install / Update
8
+
9
+ ```bash
10
+ pip install inav-toolkit
11
+ ```
12
+
13
+ Or from source:
14
+
15
+ ```bash
16
+ git clone https://github.com/agoliveira/INAV-Toolkit.git
17
+ cd INAV-Toolkit
18
+ python3 -m venv .venv
19
+ source .venv/bin/activate
20
+ pip install -r requirements.txt
21
+ ```
22
+
23
+ Or on Debian/Ubuntu, system packages:
24
+ ```bash
25
+ sudo apt install python3-numpy python3-scipy python3-serial
26
+ ```
27
+ Python 3.8+. `pyserial` only needed for direct FC connection.
28
+
29
+ > **Note:** If using a venv, activate it (`source .venv/bin/activate`) before running any commands below.
30
+
31
+ ### Connect and Analyze
32
+
33
+ ```bash
34
+ python3 -m inav_toolkit.blackbox_analyzer --device auto
35
+ ```
36
+
37
+ That's it. The tool will:
38
+
39
+ 1. Auto-detect your FC and pull the full config dump
40
+ 2. Run a **pre-flight safety check** (disabled beepers, failsafe, battery limits)
41
+ 3. Archive the config to the **backup vault** with timestamp
42
+ 4. Download the blackbox and split multi-flight logs
43
+ 5. Run PID tuning, noise, and navigation analysis
44
+ 6. Compare with your **previous flight** and explain what changed
45
+ 7. Clean up log files and erase flash
46
+ 8. Open the **tabbed HTML report** in your browser
47
+
48
+ Results are presented in an interactive terminal menu:
49
+
50
+ ```
51
+ TUNE QUALITY: █████████░░░░░░░░░░░ 46/100
52
+ Noise:94 | PID:26 | Motors:53
53
+
54
+ [1] PID Tuning R:62%OS P:ok Y:N/A
55
+ [2] Noise Analysis 94/100 — 2 sources
56
+ [3] Hover & Stability R:moderate P:wind Y:wind
57
+ [4] Nav Performance 45/100 — 4 decel events, CEP 1271cm
58
+ [5] Nav Sensors Com:70 GPS:100 Bar:70
59
+ [6] Config Review 1 critical, 2 warnings
60
+ [7] Flight History 3 flights ▃▅▇
61
+ [8] vs Previous ↘ -8 (4 config changes)
62
+ [C] CLI Commands 2 changes
63
+ [A] Show All
64
+ [Q] Quit
65
+
66
+ Section (1-8, C, A, Q):
67
+ ```
68
+
69
+ Each section shows a one-line status at a glance. Select a number to drill into details. Flight History shows trend sparklines. The CLI Commands section gives you paste-ready commands.
70
+
71
+ ## Tools
72
+
73
+ ### Blackbox Analyzer
74
+
75
+ Decodes `.bbl` / `.bfl` blackbox logs natively in Python (no `blackbox_decode` needed) and produces actionable tuning and navigation recommendations.
76
+
77
+ ```bash
78
+ # Connect to FC — full pipeline (safety check + download + analyze + cleanup + erase)
79
+ python3 -m inav_toolkit.blackbox_analyzer --device auto
80
+
81
+ # Analyze an existing log file
82
+ python3 -m inav_toolkit.blackbox_analyzer flight.bbl
83
+
84
+ # With a saved dump/diff for config comparison
85
+ python3 -m inav_toolkit.blackbox_analyzer flight.bbl --config my_dump.txt
86
+
87
+ # Specify frame size for tailored thresholds
88
+ python3 -m inav_toolkit.blackbox_analyzer flight.bbl --frame 10
89
+
90
+ # Download only, analyze later
91
+ python3 -m inav_toolkit.blackbox_analyzer --device auto --download-only
92
+
93
+ # Keep raw log files (skip auto-cleanup)
94
+ python3 -m inav_toolkit.blackbox_analyzer --device auto --keep-logs
95
+
96
+ # Don't erase flash after download
97
+ python3 -m inav_toolkit.blackbox_analyzer --device auto --no-erase
98
+
99
+ # Don't open browser with HTML report
100
+ python3 -m inav_toolkit.blackbox_analyzer --device auto --no-browser
101
+
102
+ # Skip nav analysis even if nav fields are present
103
+ python3 -m inav_toolkit.blackbox_analyzer flight.bbl --no-nav
104
+
105
+ # Flight progression history
106
+ python3 -m inav_toolkit.blackbox_analyzer flight.bbl --history
107
+
108
+ # List archived configs
109
+ python3 -m inav_toolkit.blackbox_analyzer --config-history
110
+
111
+ # Compare two archived configs
112
+ python3 -m inav_toolkit.blackbox_analyzer --config-diff 1 3
113
+ ```
114
+
115
+ **What it analyzes (auto-detected from available data):**
116
+
117
+ PID tuning:
118
+ - Step response — overshoot %, tracking delay, settling time per axis
119
+ - FeedForward-aware — attributes overshoot between FF and P, recommends FF reduction before P cuts
120
+ - Hover oscillation — RMS and peak-to-peak gyro, wind buffeting vs P oscillation on large frames
121
+ - Noise spectrum — peak frequencies, source classification (propwash, electrical, motor imbalance)
122
+ - Filter recommendations — phase-lag-aware, won't recommend destructive LPF cuts on 10"+ frames
123
+ - Motor balance — average load and saturation per motor
124
+
125
+ Navigation performance (when nav fields are present):
126
+ - Deceleration overshoot — measures position error when stopping, oscillation count, settling time
127
+ - Position hold quality — CEP, RMS error, max drift, toilet-bowl pattern detection
128
+ - Altitude hold quality — vertical error RMS, oscillation detection
129
+ - Controller saturation — detects when nav demands exceed platform capability
130
+ - Wind vs tuning — correlates position error with wind estimates to separate environmental drift from PID problems
131
+
132
+ Navigation sensors:
133
+ - Compass health — heading jitter, magnetic interference, drift rate
134
+ - GPS quality — fix type, satellite count, HDOP, position jumps
135
+ - Barometer — noise level, spike detection, throttle correlation
136
+ - Position estimator — GPS vs estimator divergence
137
+
138
+ **What it outputs:**
139
+
140
+ Terminal:
141
+ - Interactive menu with 8 sections (with `--device auto`) or sequential report
142
+ - Pre-flight safety checklist with CLI fix commands
143
+ - Flight-to-flight diff with causal verdict ("P increase caused more overshoot")
144
+ - Trend sparklines showing score progression across sessions
145
+
146
+ HTML report (tabbed, auto-opens in browser):
147
+ - **Overview** — score, actions, CLI commands, pre-flight warnings, config
148
+ - **PID Tuning** — step response table and chart
149
+ - **Noise & Filters** — gyro spectrum and D-term noise charts
150
+ - **Motors** — balance table and chart
151
+ - **Nav Performance** — deceleration, poshold, althold metrics
152
+ - **Nav Sensors** — compass, GPS, baro, estimator health
153
+ - **What-If** — interactive PID/filter simulation with predicted effects
154
+ - **History** — flight diff, score progression chart, flight table
155
+
156
+ Other:
157
+ - `state.json` for cross-referencing with the parameter analyzer
158
+ - SQLite flight database for progression tracking
159
+ - Config vault with timestamped backups of every FC dump
160
+
161
+ ### Config Backup Vault
162
+
163
+ Every `--device auto` run archives the FC's full `dump all` with a timestamp. Over time you build a complete history of every config you've flown.
164
+
165
+ ```bash
166
+ # List archived configs
167
+ python3 -m inav_toolkit.blackbox_analyzer --config-history
168
+
169
+ CONFIG VAULT: 3 archived configs
170
+ # Date Settings Age Craft
171
+ ────────────────────────────────────────────────────────────
172
+ 1 2026-03-29 13:18 976 2h ago NAZGUL 10
173
+ 2 2026-03-28 17:07 976 1d ago NAZGUL 10
174
+ 3 2026-03-27 10:30 976 2d ago NAZGUL 10
175
+
176
+ # Compare any two configs by number
177
+ python3 -m inav_toolkit.blackbox_analyzer --config-diff 1 3
178
+
179
+ CONFIG DIFF: 12 differences, 964 unchanged
180
+ Changed (10):
181
+ mc_p_roll: 25 → 40 (+60%)
182
+ dterm_lpf_hz: 60 → 110 (+83%)
183
+ failsafe_procedure: RTH → DROP
184
+ ...
185
+ ```
186
+
187
+ ### Parameter Analyzer
188
+
189
+ Validates an INAV config for issues. Accepts `dump all` or `diff all` output. Catches problems that blackbox data alone can't detect.
190
+
191
+ ```bash
192
+ # Check existing config
193
+ python3 -m inav_toolkit.param_analyzer my_dump.txt --frame 10
194
+
195
+ # Generate starting PIDs for a new build
196
+ python3 -m inav_toolkit.param_analyzer --setup 10 --voltage 6S
197
+
198
+ # Compare starting PIDs with current config
199
+ python3 -m inav_toolkit.param_analyzer --setup 10 --voltage 6S my_dump.txt
200
+
201
+ # Cross-reference with blackbox results
202
+ python3 -m inav_toolkit.param_analyzer my_dump.txt --blackbox state.json
203
+ ```
204
+
205
+ **What it checks:** safety (beepers, failsafe, battery limits), motors (protocol, RPM filter, ESC telemetry), filters (frame-appropriate LPF, dynamic notch), PIDs (cross-profile consistency, FF, antigravity), navigation (frame-aware nav PID thresholds, RTH altitude, deceleration time, position PIDs, safehome), GPS (constellations, compass cal), blackbox (logging rate, essential fields).
206
+
207
+ **Setup mode** generates conservative starting PIDs including FeedForward for 7/10/12/15" frames at 4S/6S/8S/12S.
208
+
209
+ ### VTOL Configurator
210
+
211
+ Validates INAV VTOL configurations using mixer_profile switching.
212
+
213
+ ```bash
214
+ python3 -m inav_toolkit.vtol_configurator vtol_config.txt
215
+ ```
216
+
217
+ Checks MC/FW mixer profiles, tilt servo rules, motor role inference, yaw authority, FW control surfaces, mode assignments, automated RTH transition, and airmode conflicts.
218
+
219
+ ### Guided Wizard
220
+
221
+ Interactive session manager that walks you through the full workflow.
222
+
223
+ ```bash
224
+ python3 -m inav_toolkit.wizard
225
+ ```
226
+
227
+ Connects to your FC and offers: tuning session, nav health check, new build safety check, blackbox download, or config restore from backup.
228
+
229
+ ### MSP Module
230
+
231
+ Direct serial communication with INAV flight controllers. Used internally by the other tools, also usable standalone.
232
+
233
+ ```bash
234
+ # Standalone: identify FC and download blackbox
235
+ python3 -m inav_toolkit.msp --device auto
236
+ ```
237
+
238
+ Handles MSP v2 framing, pipelined dataflash download (4-deep), CLI command/batch, `dump all`/`diff all` config pull, auto-reconnection after USB VCP reset.
239
+
240
+ ## Tuning Workflow
241
+
242
+ ```
243
+ 1. NEW BUILD
244
+ python3 -m inav_toolkit.param_analyzer --setup 10 --voltage 6S
245
+ → Conservative starting PIDs, filters, FF, and nav settings
246
+ → Paste CLI commands into INAV Configurator
247
+
248
+ 2. SAFETY CHECK (automatic with --device auto)
249
+ → Pre-flight checklist catches disabled beepers, failsafe issues
250
+ → Flags nav PIDs that are INAV defaults (tuned for 5") on larger frames
251
+ → Warns sternly with fix commands, doesn't block
252
+
253
+ 3. FLY
254
+ → Enable blackbox logging (GYRO_RAW, MOTORS, RC_COMMAND)
255
+ → Hover for 10s, then do deliberate roll/pitch/yaw sweeps
256
+ → Engage POSHOLD and RTH for nav analysis data
257
+
258
+ 4. ANALYZE
259
+ python3 -m inav_toolkit.blackbox_analyzer --device auto
260
+ → Downloads log, pulls full config dump, archives to vault
261
+ → Pre-flight safety check before download
262
+ → Interactive menu with PID, noise, nav, config review sections
263
+ → Compares with previous flight: "P increase caused more overshoot"
264
+ → Shows exactly what to change with CLI commands
265
+ → Opens tabbed HTML report with What-If simulation
266
+ → Auto-cleans log files and erases flash when done
267
+
268
+ 5. APPLY + REPEAT
269
+ → Paste CLI commands, fly again
270
+ → Tool auto-detects which flights use the new config
271
+ → Flight database tracks progression with sparkline trends
272
+ → Config vault archives every session for future reference
273
+ ```
274
+
275
+ ## Frame Size Profiles
276
+
277
+ The `--setup` mode provides conservative starting configurations:
278
+
279
+ | Frame | P Roll | P Pitch | D | FF | Gyro LPF | Dyn Notch Min |
280
+ |-------|--------|---------|---|-----|----------|---------------|
281
+ | 7" 4S | 35 | 38 | 23 | 60 | 90 Hz | 60 Hz |
282
+ | 10" 4S | 25 | 28 | 18 | 40 | 65 Hz | 50 Hz |
283
+ | 12" 4S | 20 | 22 | 14 | 30 | 50 Hz | 35 Hz |
284
+ | 15" 4S | 15 | 16 | 10 | 20 | 40 Hz | 25 Hz |
285
+
286
+ Higher voltage (6S/8S/12S) scales P and D down proportionally. Yaw FF also included (slightly higher than roll/pitch since yaw has no D-term).
287
+
288
+ ## Project Structure
289
+
290
+ ```
291
+ INAV-Toolkit/
292
+ ├── inav_toolkit/
293
+ │ ├── __init__.py # Package version
294
+ │ ├── blackbox_analyzer.py # Blackbox analyzer, nav performance, What-If
295
+ │ ├── msp.py # MSP v2 serial communication
296
+ │ ├── flight_db.py # SQLite flight history + flight diff
297
+ │ ├── param_analyzer.py # Config validator + setup generator
298
+ │ ├── vtol_configurator.py # VTOL mixer validator
299
+ │ ├── wizard.py # Guided session manager
300
+ │ ├── autotune.py # Autotune orchestrator (experimental)
301
+ │ ├── i18n.py # Internationalization
302
+ │ └── locales/ # en, pt_BR, es
303
+ ├── docs/
304
+ ├── tests/
305
+ ├── README.md
306
+ ├── CHANGELOG.md
307
+ ├── LICENSE # MIT
308
+ └── requirements.txt
309
+ ```
310
+
311
+ ## INAV Version Support
312
+
313
+ 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.
314
+
315
+ ## Contributing
316
+
317
+ This is an active project. Planned: autonomous tuning loop (Pi Zero 2W or ESP32 strapped to the quad).
318
+
319
+ ## License
320
+
321
+ MIT License. See [LICENSE](LICENSE).
322
+
323
+ ## Acknowledgments
324
+
325
+ - The INAV development team and community
326
+ - QuadMeUp (Pawel Spychalski) for filter and RPM analysis research
327
+ - The INAV Fixed Wing Group for modes documentation
328
+ - UAV Tech for the spark that gave me the idea to create this
@@ -1,3 +1,3 @@
1
1
  """INAV Toolkit - Blackbox analyzer, parameter checker, and tuning wizard for INAV flight controllers."""
2
2
 
3
- __version__ = "2.3.0"
3
+ __version__ = "2.4.1"