INAV Black Box Logger
I. Introduction
This function transmits flight data to external recording devices (such as SD cards or onboard DataFlash chips on some flight controllers) via serial port during each control cycle for storage.
The blackbox records flight data during each flight controller cycle, including:
- Precise timestamps (microsecond level)
- Three-axis PID correction values (proportional/integral/derivative terms)
- RC command positions (stick values after applying exponential curve processing)
- Inertial sensor data:
- Gyroscope raw values
- Accelerometer data (after configured low-pass filtering)
- Environmental perception data:
- Barometric altitude
- Rangefinder readings
- Three-axis magnetometer values
- Power system monitoring:
- Battery voltage raw value (VBAT)
- Real-time current detection
- RC signal strength (RSSI)
- Power system commands: Actual PWM output commands for each ESC
All data is stored with lossless precision, allowing even extremely minor anomalies to be traced through flight logs.
GPS data is recorded separately on each update (the current CSV decoder supports parsing, but the video renderer has not yet integrated GPS visualization functionality, which will be implemented in future versions).
II. Supported Configurations
The maximum data rate that can be recorded to the flight log is quite limited, so any action that increases the load may cause frame drops and errors in the flight log.
Blackbox is typically used for tri-copters and quad-copters. Although it can run on hexacopters and octocopters, these aircraft have more motors to record, requiring more data to be transferred to the flight log. This increases the number of frame drops. Although the browser-based log viewer supports hexacopters and octocopters, the command-line tools currently only support tri-copters and quad-copters.
INAV settings determine the frequency at which updates are saved to the flight log. The default loop time in INAV is 2000us. If you use a looptime of less than approximately 2400, you may experience some frame drops due to the higher required data rate. In this case, you need to reduce the sampling rate in the Blackbox settings or increase the baud rate of the recorder to 250000.
III. Setting Up Logging
First, you must enable the Blackbox feature. In INAV Configurator, go to the Configuration tab, check the "BLACKBOX" feature at the bottom of the page, and then click "Save and reboot"
You can transfer log data to an external recording device via serial port to record to a microSDHC card, or if you have a compatible flight controller, you can store the logs in onboard data flash.
IV. Configuring the Blackbox
Blackbox currently provides two parameters (blackbox_rate_num and blackbox_rate_denom) to control the data recording rate. These two parameters form a fraction that determines the recording ratio in flight controller loop iterations**. The default setting is 1/1, meaning every iteration is recorded**.
If you are using a slower MicroSD card, you may need to reduce the logging rate to decrease the number of corrupted record frames. A rate of 1/2 may be suitable for most aircraft.
You can change the logging rate settings by going to the CLI tab in INAV Ground Control Station and using the commands as follows:
Important
set blackbox_rate_num = 1
set blackbox_rate_denom = 2
CLI commands allow you to set which Blackbox fields are recorded to save space and bandwidth. Possible fields include:
NAV_ACC- Navigation accelerometer readingsNAV_PID- Navigation PID debugNAV_POS- Current and target position and altitudeMAG- Magnetometer raw valuesACC- Accelerometer raw valuesATTI- Attitude calculated by INAV position estimatorRC_DATA- RC channels 1-4 returned by radio receiverRC_COMMAND- RC_DATA converted to [-500:500] scale (for A, E, R), with expo and deadbandMOTORS- Motor outputGYRO_RAW- Raw gyroscope dataPEAKS_R- Roll axis noise peakPEAKS_P- Pitch axis noise peakPEAKS_Y- Yaw axis noise peak
Usage:blackboxCurrently enabled Blackbox fieldsblackbox listAll available fieldsblackbox -MOTORSDisable MOTORS recordingblackbox MOTOREnable MOTORS recording
V. Using the Blackbox
Blackbox starts recording data immediately after you unlock the aircraft and stops when you arm it.
If your aircraft has a buzzer, you can use INAV's arming beep to synchronize your Blackbox log with your flight video. INAV's arming beep is a "long, short" pattern. The beginning of the first long beep will appear as a blue line in the flight data log, which you can synchronize with the recorded audio track.
After disarming the aircraft, you should wait a few seconds to allow the Blackbox to finish saving its data.
Log Management for Onboard Flash Chips:
Storage Space Optimization Recommendations
When using onboard flash chips for recording, to save storage space, it is recommended to disable Blackbox recording during unnecessary periods.
Configuration Method
- Go to the modes tab in Configurator
- Add "Blackbox recording mode" to any AUX channel
- After completing the setup, Blackbox will only record flight data when the mode is activated
You should wait a few seconds to allow the Blackbox to finish saving its data, even if logging has been paused. You can freely pause and resume recording during flight.
VI. Viewing Recorded Logs
After flight, you will have a series of flight log files with the .TXT extension.
After the flight, you can view the generated logs using the interactive log viewer. For details, refer to: https://docs.corewing.com/plane/inav/settings/fc/blackbox-read.html
————This article is referenced from INAV Ground Control Station: https://github.com/iNavFlight/inav/blob/master/docs/Blackbox.md