Skip to content

Logs and Fault Analysis ​

By default the aircraft creates a dataflash log on the SD card as soon as it arms. Download it after the flight, or read the card directly.

TIP

Dataflash logs open in Mission Planner, MAVExplorer, the ArduPilot web tools or the PID review tool. They are the aircraft's black box: post-flight fault analysis, flight performance checks and PID tuning all come from them.

NOTE

To log from power-on while you are debugging, set LOG_DISARMED to 1. For a first flight or for PID analysis, set up logging for tuning first.

Logging parameters ​

ParameterWhat it doesValues
LOG_BACKEND_TYPEWhere logs are stored or streamed (bitmask, can be combined)0: disabled; 1: SD card (the usual choice); 2: MAVLink streaming (needs 921600 baud); 4: onboard dataflash (on boards that have it)
LOG_BITMASKWhat gets logged, and therefore how detailed and how big the file is0: disabled; default: core data kept; other values: set per aircraft type, dropping what you do not need to keep files small
LOG_DISARMEDLogging behaviour while disarmed0: log only after arming; 1: log from power-on (for debugging); 2: log when not powered over USB; 3: delete logs from unarmed sessions
LOG_FILE_DSRMROTLog file rotation, to split multi-stage flightsNon-zero: disarm, 15 s, re-arm forces a new file; 0: default, one file per power cycle
LOG_FILE_MB_FREEMinimum free space kept on the storage mediumDefault 500 MB; when space runs short the oldest logs are deleted
LOG_FILE_RATEMAXCaps the streaming log write rate, which controls file sizeDefault 0 (no limit); the rate depends on SCHED_LOOP_RATE; related: LOG_BLK_RATEMAX (block logging) and LOG_MAV_RATEMAX (MAVLink logging)
LOG_MAX_FILESMaximum number of log files, wrapping round1~500; once full, new logs overwrite the oldest

Downloading flash logs ​

  • Connect the aircraft to the ground station over USB.
  • Open Mission Planner's Flight Data screen.
  • Click the DataFlash Logs tab at the bottom left and press Download DataFlash Log Via Mavlink.
  • Pick the logs to download. They land in the MissionPlanner/logs folder, sorted by aircraft type (a QUADCOPTER folder, for example).

What gets logged ​

LOG_BITMASK controls which message types are logged; the bit definitions differ between vehicle types. This is the Copter bitmask:

BitBitmask nameWhat is logged when set
0Fast AttitudeAttitude at SCHED_LOOP_RATE; required for PID review
1Medium AttitudeAttitude at 10 Hz
2GPSGPS data
3System PerformanceCPU and other performance data
4Control TuningControl data
5Navigation TuningNavigation data
6RC InputTransmitter input
7IMUIMU (accelerometer and gyro) data
8Mission CommandsMission and GCS commands
9Battery MonitorBattery data
10RC OutputServo output
11Optical FlowOptical flow data
12PIDPID controller data; required for PID review
13CompassCompass data
15CameraCamera data
17MotorsMotor data
19Raw IMURaw, unprocessed IMU data
20Video StabilizationAttitude at SCHED_LOOP_RATE
21Fast harmonic notchFast harmonic notch data

NOTE

The ATTITUDE message is logged at the highest rate among the options you selected. EKF3 logging is controlled separately by EK3_LOG_LEVEL.

Replaying logs ​

These four tools replay and analyse logs: