inav-toolkit 2.15.0__tar.gz → 2.16.0__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.
- inav_toolkit-2.16.0/PKG-INFO +274 -0
- inav_toolkit-2.16.0/README.md +242 -0
- {inav_toolkit-2.15.0 → inav_toolkit-2.16.0}/inav_toolkit/__init__.py +1 -1
- {inav_toolkit-2.15.0 → inav_toolkit-2.16.0}/inav_toolkit/blackbox_analyzer.py +274 -137
- {inav_toolkit-2.15.0 → inav_toolkit-2.16.0}/inav_toolkit/flight_db.py +1 -1
- inav_toolkit-2.16.0/inav_toolkit/i18n.py +192 -0
- inav_toolkit-2.16.0/inav_toolkit/locales/en.json +187 -0
- inav_toolkit-2.16.0/inav_toolkit/locales/es.json +187 -0
- inav_toolkit-2.16.0/inav_toolkit/locales/pt_BR.json +187 -0
- {inav_toolkit-2.15.0 → inav_toolkit-2.16.0}/inav_toolkit/msp.py +95 -11
- {inav_toolkit-2.15.0 → inav_toolkit-2.16.0}/inav_toolkit/param_analyzer.py +16 -1
- {inav_toolkit-2.15.0 → inav_toolkit-2.16.0}/inav_toolkit/vtol_configurator.py +1 -1
- {inav_toolkit-2.15.0 → inav_toolkit-2.16.0}/inav_toolkit/wizard.py +1 -1
- inav_toolkit-2.16.0/inav_toolkit.egg-info/PKG-INFO +274 -0
- {inav_toolkit-2.15.0 → inav_toolkit-2.16.0}/inav_toolkit.egg-info/SOURCES.txt +4 -0
- {inav_toolkit-2.15.0 → inav_toolkit-2.16.0}/pyproject.toml +4 -1
- {inav_toolkit-2.15.0 → inav_toolkit-2.16.0}/tests/test_smoke.py +112 -0
- inav_toolkit-2.15.0/PKG-INFO +0 -375
- inav_toolkit-2.15.0/README.md +0 -343
- inav_toolkit-2.15.0/inav_toolkit.egg-info/PKG-INFO +0 -375
- {inav_toolkit-2.15.0 → inav_toolkit-2.16.0}/LICENSE +0 -0
- {inav_toolkit-2.15.0 → inav_toolkit-2.16.0}/inav_toolkit/autotune.py +0 -0
- {inav_toolkit-2.15.0 → inav_toolkit-2.16.0}/inav_toolkit.egg-info/dependency_links.txt +0 -0
- {inav_toolkit-2.15.0 → inav_toolkit-2.16.0}/inav_toolkit.egg-info/entry_points.txt +0 -0
- {inav_toolkit-2.15.0 → inav_toolkit-2.16.0}/inav_toolkit.egg-info/requires.txt +0 -0
- {inav_toolkit-2.15.0 → inav_toolkit-2.16.0}/inav_toolkit.egg-info/top_level.txt +0 -0
- {inav_toolkit-2.15.0 → inav_toolkit-2.16.0}/setup.cfg +0 -0
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: inav-toolkit
|
|
3
|
+
Version: 2.16.0
|
|
4
|
+
Summary: Blackbox analyzer, parameter checker, and tuning wizard for INAV flight controllers
|
|
5
|
+
License: MIT
|
|
6
|
+
Project-URL: Homepage, https://github.com/agoliveira/INAV-Toolkit
|
|
7
|
+
Project-URL: Issues, https://github.com/agoliveira/INAV-Toolkit/issues
|
|
8
|
+
Keywords: inav,drone,blackbox,pid,tuning,flight-controller,multirotor
|
|
9
|
+
Classifier: Development Status :: 4 - Beta
|
|
10
|
+
Classifier: Environment :: Console
|
|
11
|
+
Classifier: Intended Audience :: End Users/Desktop
|
|
12
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
13
|
+
Classifier: Operating System :: OS Independent
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
21
|
+
Classifier: Topic :: Scientific/Engineering
|
|
22
|
+
Requires-Python: >=3.8
|
|
23
|
+
Description-Content-Type: text/markdown
|
|
24
|
+
License-File: LICENSE
|
|
25
|
+
Requires-Dist: numpy>=1.21.0
|
|
26
|
+
Requires-Dist: scipy>=1.7.0
|
|
27
|
+
Requires-Dist: matplotlib>=3.5.0
|
|
28
|
+
Requires-Dist: pyserial>=3.5
|
|
29
|
+
Provides-Extra: test
|
|
30
|
+
Requires-Dist: pytest>=7.0; extra == "test"
|
|
31
|
+
Dynamic: license-file
|
|
32
|
+
|
|
33
|
+
# INAV Toolkit
|
|
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, tells you exactly what to change, and gives you the CLI commands to paste.
|
|
36
|
+
|
|
37
|
+
Built for the INAV long-range community. Tested on 7" to 15" multirotors with GPS navigation, INAV 9.0.x.
|
|
38
|
+
|
|
39
|
+
## Install / Update
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
git clone https://github.com/agoliveira/INAV-Toolkit.git
|
|
43
|
+
cd INAV-Toolkit
|
|
44
|
+
python3 -m venv .venv
|
|
45
|
+
source .venv/bin/activate
|
|
46
|
+
pip install -r requirements.txt
|
|
47
|
+
python3 -m inav_toolkit.blackbox_analyzer --device auto
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Or on Debian/Ubuntu, system packages:
|
|
51
|
+
```bash
|
|
52
|
+
sudo apt install python3-numpy python3-scipy python3-serial
|
|
53
|
+
```
|
|
54
|
+
Python 3.8+. `pyserial` only needed for direct FC connection.
|
|
55
|
+
|
|
56
|
+
> **Note:** If using a venv, activate it (`source .venv/bin/activate`) before running any commands below.
|
|
57
|
+
|
|
58
|
+
### Connect and Analyze
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
python3 -m inav_toolkit.blackbox_analyzer --device auto
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
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.
|
|
65
|
+
|
|
66
|
+
### Output
|
|
67
|
+
|
|
68
|
+
```
|
|
69
|
+
INAV Blackbox Analyzer v2.16.0
|
|
70
|
+
Connected: NAZGUL 10 - INAV 9.0.1
|
|
71
|
+
Pulling configuration (diff all)... 89 settings
|
|
72
|
+
Downloading 2236KB ... 204KB/s
|
|
73
|
+
Found 3 flights - analyzing best from latest config
|
|
74
|
+
|
|
75
|
+
TUNE QUALITY: █████████████░░░░░░░ 65/100
|
|
76
|
+
Noise:95 | PID:N/A | Motors:94
|
|
77
|
+
|
|
78
|
+
CONFIG:
|
|
79
|
+
Roll P= 32 I= 82 D= 32 (FC now: P->35, I->75, D->28)
|
|
80
|
+
Pitch P= 35 I= 90 D= 35 (FC now: P->38, I->82, D->31)
|
|
81
|
+
|
|
82
|
+
NOISE SOURCES:
|
|
83
|
+
50Hz motor imbalance on Roll/Yaw [medium]
|
|
84
|
+
128Hz motor noise on Pitch/Yaw [low]
|
|
85
|
+
187-437Hz (6 peaks) electrical on Pitch/Roll/Yaw [medium]
|
|
86
|
+
|
|
87
|
+
DO THIS - 2 changes:
|
|
88
|
+
1. Lower dynamic_gyro_notch_min_hz: 50 -> 40
|
|
89
|
+
2. Consider enabling RPM filter
|
|
90
|
+
|
|
91
|
+
INAV CLI - paste into Configurator CLI tab:
|
|
92
|
+
set dynamic_gyro_notch_min_hz = 40
|
|
93
|
+
save
|
|
94
|
+
|
|
95
|
+
CONFIG REVIEW:
|
|
96
|
+
[CRITICAL] Critical beeper warnings disabled - BAT_CRIT_LOW, RX_LOST
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
## Tools
|
|
100
|
+
|
|
101
|
+
### Blackbox Analyzer
|
|
102
|
+
|
|
103
|
+
Decodes `.bbl` / `.bfl` blackbox logs natively in Python (no `blackbox_decode` needed) and produces actionable tuning recommendations.
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
# Connect to FC - pull config + download + analyze
|
|
107
|
+
python3 -m inav_toolkit.blackbox_analyzer --device auto
|
|
108
|
+
|
|
109
|
+
# Analyze an existing log file
|
|
110
|
+
python3 -m inav_toolkit.blackbox_analyzer flight.bbl
|
|
111
|
+
|
|
112
|
+
# With a saved diff for config comparison
|
|
113
|
+
python3 -m inav_toolkit.blackbox_analyzer flight.bbl --diff my_diff.txt
|
|
114
|
+
|
|
115
|
+
# Specify frame size for tailored thresholds
|
|
116
|
+
python3 -m inav_toolkit.blackbox_analyzer flight.bbl --frame 10
|
|
117
|
+
|
|
118
|
+
# Download only, analyze later
|
|
119
|
+
python3 -m inav_toolkit.blackbox_analyzer --device auto --download-only
|
|
120
|
+
|
|
121
|
+
# Flight progression history
|
|
122
|
+
python3 -m inav_toolkit.blackbox_analyzer flight.bbl --history
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
**What it measures:**
|
|
126
|
+
- PID step response - overshoot %, tracking delay, settling time per axis
|
|
127
|
+
- Noise spectrum - identifies peak frequencies, classifies sources (propwash, electrical, motor imbalance), groups and ranks by severity
|
|
128
|
+
- Hover oscillation - RMS and peak-to-peak gyro during centered stick
|
|
129
|
+
- Motor balance - average load and saturation per motor
|
|
130
|
+
- Filter phase lag - total delay through the gyro/D-term filter chain
|
|
131
|
+
- Config mismatch - detects when the FC config has changed since the flight being analyzed
|
|
132
|
+
|
|
133
|
+
**What it outputs:**
|
|
134
|
+
- Terminal report with score, noise sources, specific CLI commands to paste
|
|
135
|
+
- HTML report with interactive charts (noise spectrum, PID response, motor traces)
|
|
136
|
+
- `state.json` for cross-referencing with the parameter analyzer
|
|
137
|
+
- SQLite flight database for progression tracking across sessions
|
|
138
|
+
|
|
139
|
+
### Parameter Analyzer
|
|
140
|
+
|
|
141
|
+
Validates an INAV `diff all` export for configuration issues. Catches problems that blackbox data alone can't detect.
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
# Check existing config
|
|
145
|
+
python3 -m inav_toolkit.param_analyzer my_diff.txt --frame 10
|
|
146
|
+
|
|
147
|
+
# Generate starting PIDs for a new build
|
|
148
|
+
python3 -m inav_toolkit.param_analyzer --setup 10 --voltage 6S
|
|
149
|
+
|
|
150
|
+
# Compare starting PIDs with current config
|
|
151
|
+
python3 -m inav_toolkit.param_analyzer --setup 10 --voltage 6S my_diff.txt
|
|
152
|
+
|
|
153
|
+
# Cross-reference with blackbox results
|
|
154
|
+
python3 -m inav_toolkit.param_analyzer my_diff.txt --blackbox state.json
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
**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).
|
|
158
|
+
|
|
159
|
+
**Setup mode** generates conservative starting PIDs for 7/10/12/15" frames at 4S/6S/8S/12S.
|
|
160
|
+
|
|
161
|
+
### VTOL Configurator
|
|
162
|
+
|
|
163
|
+
Validates INAV VTOL configurations using mixer_profile switching.
|
|
164
|
+
|
|
165
|
+
```bash
|
|
166
|
+
python3 -m inav_toolkit.vtol_configurator vtol_diff.txt
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
Checks MC/FW mixer profiles, tilt servo rules, motor role inference, yaw authority, FW control surfaces, mode assignments, automated RTH transition, and airmode conflicts.
|
|
170
|
+
|
|
171
|
+
### Guided Wizard
|
|
172
|
+
|
|
173
|
+
Interactive session manager that walks you through the full workflow.
|
|
174
|
+
|
|
175
|
+
```bash
|
|
176
|
+
python3 -m inav_toolkit.wizard
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
Connects to your FC and offers: tuning session, nav health check, new build safety check, blackbox download, or config restore from backup.
|
|
180
|
+
|
|
181
|
+
### MSP Module
|
|
182
|
+
|
|
183
|
+
Direct serial communication with INAV flight controllers. Used internally by the other tools, also usable standalone.
|
|
184
|
+
|
|
185
|
+
```bash
|
|
186
|
+
# Standalone: identify FC and download blackbox
|
|
187
|
+
python3 -m inav_toolkit.msp --device auto
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
Handles MSP v2 framing, pipelined dataflash download (4-deep), CLI command/batch, auto-reconnection after USB VCP reset.
|
|
191
|
+
|
|
192
|
+
## Tuning Workflow
|
|
193
|
+
|
|
194
|
+
```
|
|
195
|
+
1. NEW BUILD
|
|
196
|
+
python3 -m inav_toolkit.param_analyzer --setup 10 --voltage 6S
|
|
197
|
+
-> Conservative starting PIDs and filter settings
|
|
198
|
+
-> Paste CLI commands into INAV Configurator
|
|
199
|
+
|
|
200
|
+
2. SAFETY CHECK
|
|
201
|
+
python3 -m inav_toolkit.param_analyzer my_diff.txt --frame 10
|
|
202
|
+
-> Catches disabled beepers, failsafe issues, battery limits
|
|
203
|
+
-> Fix before flying
|
|
204
|
+
|
|
205
|
+
3. FLY
|
|
206
|
+
-> Enable blackbox logging (GYRO_RAW, MOTORS, RC_COMMAND)
|
|
207
|
+
-> Hover for 10s, then do deliberate roll/pitch/yaw sweeps
|
|
208
|
+
-> The analyzer needs stick inputs to measure PID response
|
|
209
|
+
|
|
210
|
+
4. ANALYZE
|
|
211
|
+
python3 -m inav_toolkit.blackbox_analyzer --device auto
|
|
212
|
+
-> Downloads log, pulls current config, runs full analysis
|
|
213
|
+
-> Shows exactly what to change with CLI commands
|
|
214
|
+
|
|
215
|
+
5. APPLY + REPEAT
|
|
216
|
+
-> Paste CLI commands, fly again
|
|
217
|
+
-> Tool auto-detects which flights use the new config
|
|
218
|
+
-> Flight database tracks your progression across sessions
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
## Frame Size Profiles
|
|
222
|
+
|
|
223
|
+
The `--setup` mode provides conservative starting configurations:
|
|
224
|
+
|
|
225
|
+
| Frame | P Roll | P Pitch | D | Gyro LPF | Dyn Notch Min |
|
|
226
|
+
|-------|--------|---------|---|----------|---------------|
|
|
227
|
+
| 7" 4S | 35 | 38 | 23 | 90 Hz | 60 Hz |
|
|
228
|
+
| 10" 4S | 25 | 28 | 18 | 65 Hz | 50 Hz |
|
|
229
|
+
| 12" 4S | 20 | 22 | 14 | 50 Hz | 35 Hz |
|
|
230
|
+
| 15" 4S | 15 | 16 | 10 | 40 Hz | 25 Hz |
|
|
231
|
+
|
|
232
|
+
Higher voltage (6S/8S/12S) scales P and D down proportionally.
|
|
233
|
+
|
|
234
|
+
## Project Structure
|
|
235
|
+
|
|
236
|
+
```
|
|
237
|
+
INAV-Toolkit/
|
|
238
|
+
├── inav_toolkit/
|
|
239
|
+
│ ├── __init__.py # Package version
|
|
240
|
+
│ ├── blackbox_analyzer.py # Blackbox log analyzer
|
|
241
|
+
│ ├── msp.py # MSP v2 serial communication
|
|
242
|
+
│ ├── flight_db.py # SQLite flight history
|
|
243
|
+
│ ├── param_analyzer.py # Config validator + setup generator
|
|
244
|
+
│ ├── vtol_configurator.py # VTOL mixer validator
|
|
245
|
+
│ ├── wizard.py # Guided session manager
|
|
246
|
+
│ ├── autotune.py # Autotune orchestrator (experimental)
|
|
247
|
+
│ ├── i18n.py # Internationalization
|
|
248
|
+
│ └── locales/ # en, pt_BR, es
|
|
249
|
+
├── docs/
|
|
250
|
+
├── tests/
|
|
251
|
+
├── README.md
|
|
252
|
+
├── CHANGELOG.md
|
|
253
|
+
├── LICENSE # MIT
|
|
254
|
+
└── requirements.txt
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
## INAV Version Support
|
|
258
|
+
|
|
259
|
+
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.
|
|
260
|
+
|
|
261
|
+
## Contributing
|
|
262
|
+
|
|
263
|
+
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.
|
|
264
|
+
|
|
265
|
+
## License
|
|
266
|
+
|
|
267
|
+
MIT License. See [LICENSE](LICENSE).
|
|
268
|
+
|
|
269
|
+
## Acknowledgments
|
|
270
|
+
|
|
271
|
+
- The INAV development team and community
|
|
272
|
+
- QuadMeUp (Pawel Spychalski) for filter and RPM analysis research
|
|
273
|
+
- The INAV Fixed Wing Group for modes documentation
|
|
274
|
+
- UAV Tech for the spark that gave me the idea to create this
|
|
@@ -0,0 +1,242 @@
|
|
|
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 pulls the config, downloads the blackbox, tells you exactly what to change, and gives you the CLI commands to paste.
|
|
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
|
+
git clone https://github.com/agoliveira/INAV-Toolkit.git
|
|
11
|
+
cd INAV-Toolkit
|
|
12
|
+
python3 -m venv .venv
|
|
13
|
+
source .venv/bin/activate
|
|
14
|
+
pip install -r requirements.txt
|
|
15
|
+
python3 -m inav_toolkit.blackbox_analyzer --device auto
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Or on Debian/Ubuntu, system packages:
|
|
19
|
+
```bash
|
|
20
|
+
sudo apt install python3-numpy python3-scipy python3-serial
|
|
21
|
+
```
|
|
22
|
+
Python 3.8+. `pyserial` only needed for direct FC connection.
|
|
23
|
+
|
|
24
|
+
> **Note:** If using a venv, activate it (`source .venv/bin/activate`) before running any commands below.
|
|
25
|
+
|
|
26
|
+
### Connect and Analyze
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
python3 -m inav_toolkit.blackbox_analyzer --device auto
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
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.
|
|
33
|
+
|
|
34
|
+
### Output
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
INAV Blackbox Analyzer v2.16.0
|
|
38
|
+
Connected: NAZGUL 10 - INAV 9.0.1
|
|
39
|
+
Pulling configuration (diff all)... 89 settings
|
|
40
|
+
Downloading 2236KB ... 204KB/s
|
|
41
|
+
Found 3 flights - analyzing best from latest config
|
|
42
|
+
|
|
43
|
+
TUNE QUALITY: █████████████░░░░░░░ 65/100
|
|
44
|
+
Noise:95 | PID:N/A | Motors:94
|
|
45
|
+
|
|
46
|
+
CONFIG:
|
|
47
|
+
Roll P= 32 I= 82 D= 32 (FC now: P->35, I->75, D->28)
|
|
48
|
+
Pitch P= 35 I= 90 D= 35 (FC now: P->38, I->82, D->31)
|
|
49
|
+
|
|
50
|
+
NOISE SOURCES:
|
|
51
|
+
50Hz motor imbalance on Roll/Yaw [medium]
|
|
52
|
+
128Hz motor noise on Pitch/Yaw [low]
|
|
53
|
+
187-437Hz (6 peaks) electrical on Pitch/Roll/Yaw [medium]
|
|
54
|
+
|
|
55
|
+
DO THIS - 2 changes:
|
|
56
|
+
1. Lower dynamic_gyro_notch_min_hz: 50 -> 40
|
|
57
|
+
2. Consider enabling RPM filter
|
|
58
|
+
|
|
59
|
+
INAV CLI - paste into Configurator CLI tab:
|
|
60
|
+
set dynamic_gyro_notch_min_hz = 40
|
|
61
|
+
save
|
|
62
|
+
|
|
63
|
+
CONFIG REVIEW:
|
|
64
|
+
[CRITICAL] Critical beeper warnings disabled - BAT_CRIT_LOW, RX_LOST
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Tools
|
|
68
|
+
|
|
69
|
+
### Blackbox Analyzer
|
|
70
|
+
|
|
71
|
+
Decodes `.bbl` / `.bfl` blackbox logs natively in Python (no `blackbox_decode` needed) and produces actionable tuning recommendations.
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
# Connect to FC - pull config + download + analyze
|
|
75
|
+
python3 -m inav_toolkit.blackbox_analyzer --device auto
|
|
76
|
+
|
|
77
|
+
# Analyze an existing log file
|
|
78
|
+
python3 -m inav_toolkit.blackbox_analyzer flight.bbl
|
|
79
|
+
|
|
80
|
+
# With a saved diff for config comparison
|
|
81
|
+
python3 -m inav_toolkit.blackbox_analyzer flight.bbl --diff my_diff.txt
|
|
82
|
+
|
|
83
|
+
# Specify frame size for tailored thresholds
|
|
84
|
+
python3 -m inav_toolkit.blackbox_analyzer flight.bbl --frame 10
|
|
85
|
+
|
|
86
|
+
# Download only, analyze later
|
|
87
|
+
python3 -m inav_toolkit.blackbox_analyzer --device auto --download-only
|
|
88
|
+
|
|
89
|
+
# Flight progression history
|
|
90
|
+
python3 -m inav_toolkit.blackbox_analyzer flight.bbl --history
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
**What it measures:**
|
|
94
|
+
- PID step response - overshoot %, tracking delay, settling time per axis
|
|
95
|
+
- Noise spectrum - identifies peak frequencies, classifies sources (propwash, electrical, motor imbalance), groups and ranks by severity
|
|
96
|
+
- Hover oscillation - RMS and peak-to-peak gyro during centered stick
|
|
97
|
+
- Motor balance - average load and saturation per motor
|
|
98
|
+
- Filter phase lag - total delay through the gyro/D-term filter chain
|
|
99
|
+
- Config mismatch - detects when the FC config has changed since the flight being analyzed
|
|
100
|
+
|
|
101
|
+
**What it outputs:**
|
|
102
|
+
- Terminal report with score, noise sources, specific CLI commands to paste
|
|
103
|
+
- HTML report with interactive charts (noise spectrum, PID response, motor traces)
|
|
104
|
+
- `state.json` for cross-referencing with the parameter analyzer
|
|
105
|
+
- SQLite flight database for progression tracking across sessions
|
|
106
|
+
|
|
107
|
+
### Parameter Analyzer
|
|
108
|
+
|
|
109
|
+
Validates an INAV `diff all` export for configuration issues. Catches problems that blackbox data alone can't detect.
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
# Check existing config
|
|
113
|
+
python3 -m inav_toolkit.param_analyzer my_diff.txt --frame 10
|
|
114
|
+
|
|
115
|
+
# Generate starting PIDs for a new build
|
|
116
|
+
python3 -m inav_toolkit.param_analyzer --setup 10 --voltage 6S
|
|
117
|
+
|
|
118
|
+
# Compare starting PIDs with current config
|
|
119
|
+
python3 -m inav_toolkit.param_analyzer --setup 10 --voltage 6S my_diff.txt
|
|
120
|
+
|
|
121
|
+
# Cross-reference with blackbox results
|
|
122
|
+
python3 -m inav_toolkit.param_analyzer my_diff.txt --blackbox state.json
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
**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).
|
|
126
|
+
|
|
127
|
+
**Setup mode** generates conservative starting PIDs for 7/10/12/15" frames at 4S/6S/8S/12S.
|
|
128
|
+
|
|
129
|
+
### VTOL Configurator
|
|
130
|
+
|
|
131
|
+
Validates INAV VTOL configurations using mixer_profile switching.
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
python3 -m inav_toolkit.vtol_configurator vtol_diff.txt
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
Checks MC/FW mixer profiles, tilt servo rules, motor role inference, yaw authority, FW control surfaces, mode assignments, automated RTH transition, and airmode conflicts.
|
|
138
|
+
|
|
139
|
+
### Guided Wizard
|
|
140
|
+
|
|
141
|
+
Interactive session manager that walks you through the full workflow.
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
python3 -m inav_toolkit.wizard
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
Connects to your FC and offers: tuning session, nav health check, new build safety check, blackbox download, or config restore from backup.
|
|
148
|
+
|
|
149
|
+
### MSP Module
|
|
150
|
+
|
|
151
|
+
Direct serial communication with INAV flight controllers. Used internally by the other tools, also usable standalone.
|
|
152
|
+
|
|
153
|
+
```bash
|
|
154
|
+
# Standalone: identify FC and download blackbox
|
|
155
|
+
python3 -m inav_toolkit.msp --device auto
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
Handles MSP v2 framing, pipelined dataflash download (4-deep), CLI command/batch, auto-reconnection after USB VCP reset.
|
|
159
|
+
|
|
160
|
+
## Tuning Workflow
|
|
161
|
+
|
|
162
|
+
```
|
|
163
|
+
1. NEW BUILD
|
|
164
|
+
python3 -m inav_toolkit.param_analyzer --setup 10 --voltage 6S
|
|
165
|
+
-> Conservative starting PIDs and filter settings
|
|
166
|
+
-> Paste CLI commands into INAV Configurator
|
|
167
|
+
|
|
168
|
+
2. SAFETY CHECK
|
|
169
|
+
python3 -m inav_toolkit.param_analyzer my_diff.txt --frame 10
|
|
170
|
+
-> Catches disabled beepers, failsafe issues, battery limits
|
|
171
|
+
-> Fix before flying
|
|
172
|
+
|
|
173
|
+
3. FLY
|
|
174
|
+
-> Enable blackbox logging (GYRO_RAW, MOTORS, RC_COMMAND)
|
|
175
|
+
-> Hover for 10s, then do deliberate roll/pitch/yaw sweeps
|
|
176
|
+
-> The analyzer needs stick inputs to measure PID response
|
|
177
|
+
|
|
178
|
+
4. ANALYZE
|
|
179
|
+
python3 -m inav_toolkit.blackbox_analyzer --device auto
|
|
180
|
+
-> Downloads log, pulls current config, runs full analysis
|
|
181
|
+
-> Shows exactly what to change with CLI commands
|
|
182
|
+
|
|
183
|
+
5. APPLY + REPEAT
|
|
184
|
+
-> Paste CLI commands, fly again
|
|
185
|
+
-> Tool auto-detects which flights use the new config
|
|
186
|
+
-> Flight database tracks your progression across sessions
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
## Frame Size Profiles
|
|
190
|
+
|
|
191
|
+
The `--setup` mode provides conservative starting configurations:
|
|
192
|
+
|
|
193
|
+
| Frame | P Roll | P Pitch | D | Gyro LPF | Dyn Notch Min |
|
|
194
|
+
|-------|--------|---------|---|----------|---------------|
|
|
195
|
+
| 7" 4S | 35 | 38 | 23 | 90 Hz | 60 Hz |
|
|
196
|
+
| 10" 4S | 25 | 28 | 18 | 65 Hz | 50 Hz |
|
|
197
|
+
| 12" 4S | 20 | 22 | 14 | 50 Hz | 35 Hz |
|
|
198
|
+
| 15" 4S | 15 | 16 | 10 | 40 Hz | 25 Hz |
|
|
199
|
+
|
|
200
|
+
Higher voltage (6S/8S/12S) scales P and D down proportionally.
|
|
201
|
+
|
|
202
|
+
## Project Structure
|
|
203
|
+
|
|
204
|
+
```
|
|
205
|
+
INAV-Toolkit/
|
|
206
|
+
├── inav_toolkit/
|
|
207
|
+
│ ├── __init__.py # Package version
|
|
208
|
+
│ ├── blackbox_analyzer.py # Blackbox log analyzer
|
|
209
|
+
│ ├── msp.py # MSP v2 serial communication
|
|
210
|
+
│ ├── flight_db.py # SQLite flight history
|
|
211
|
+
│ ├── param_analyzer.py # Config validator + setup generator
|
|
212
|
+
│ ├── vtol_configurator.py # VTOL mixer validator
|
|
213
|
+
│ ├── wizard.py # Guided session manager
|
|
214
|
+
│ ├── autotune.py # Autotune orchestrator (experimental)
|
|
215
|
+
│ ├── i18n.py # Internationalization
|
|
216
|
+
│ └── locales/ # en, pt_BR, es
|
|
217
|
+
├── docs/
|
|
218
|
+
├── tests/
|
|
219
|
+
├── README.md
|
|
220
|
+
├── CHANGELOG.md
|
|
221
|
+
├── LICENSE # MIT
|
|
222
|
+
└── requirements.txt
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
## INAV Version Support
|
|
226
|
+
|
|
227
|
+
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.
|
|
228
|
+
|
|
229
|
+
## Contributing
|
|
230
|
+
|
|
231
|
+
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.
|
|
232
|
+
|
|
233
|
+
## License
|
|
234
|
+
|
|
235
|
+
MIT License. See [LICENSE](LICENSE).
|
|
236
|
+
|
|
237
|
+
## Acknowledgments
|
|
238
|
+
|
|
239
|
+
- The INAV development team and community
|
|
240
|
+
- QuadMeUp (Pawel Spychalski) for filter and RPM analysis research
|
|
241
|
+
- The INAV Fixed Wing Group for modes documentation
|
|
242
|
+
- UAV Tech for the spark that gave me the idea to create this
|