Param Files and Log Files
Where PX4 stores parameters and flight logs on VOXL 2, and how to read and retrieve them.
Table of contents
Parameters
The default value for all parameters is built into the software image. Any parameter values that are changed from their default values are stored in a parameter file in the file system. The default location for this file is /data/px4/param/parameters. To return every parameter to its default, run px4-param reset_all or delete this file.
The PX4 parameter reference describes every parameter.
ModalAI parameter sets
ModalAI provides sets of parameters that can be used for the various reference drones and for various use cases. These parameter sets are stored in a format that allows them to be loaded onto the drone with QGroundControl using the load from file option. The parameter sets are in the voxl-px4-params repository.
If the parameters file does not exist, PX4 starts with its built-in defaults. The vehicle-specific parameter set for your SKU is written by voxl-configure-px4-params, which voxl-configure-mpa runs at the end of every SDK install. Older SDKs seeded a missing parameters file from /etc/modalai/voxl-px4-set-default-parameters.config; that file no longer exists.
Viewing and editing parameters
Use px4-param from an adb or ssh shell on VOXL 2. To list all parameters:
px4-param show

To show one parameter, or every parameter matching a pattern:
px4-param show SDLOG_MODE
px4-param show VOXL_ESC*
To change a parameter:
px4-param set SDLOG_MODE 1
Log files
PX4 log files can be a valuable way to tune performance of your drone or debug problems. The PX4 logger module is responsible for collecting the information and storing it into the log file. This module is started in the standard startup script with some standard options. The normal approach is to start a log file once the drone has been armed and close it once the drone has been disarmed. The log files are stored in the file system at /data/px4/log.
Logging mode (SDLOG_MODE)
The startup script reads the SDLOG_MODE parameter and passes the matching option to logger start. Do not edit the logger start line; set the parameter and restart PX4 (SDLOG_MODE requires a reboot to take effect).
SDLOG_MODE | Logging | Logger option |
|---|---|---|
0 (default) | When armed until disarm | none |
1 | From boot until disarm | -e |
2 | From boot until shutdown | -f |
3 | While manual input AUX1 is above 30% | -x |
4 | From first arm until shutdown | -a |
For example, to log from boot:
px4-param set SDLOG_MODE 1
In the modes that log until shutdown, removing power can corrupt the open log file. Close it first from an adb or ssh shell with
px4-logger off, then remove power.
Logged topics (SDLOG_PROFILE)
SDLOG_PROFILE is a bitmask that selects which topic sets are logged. PX4’s built-in default is 1 (default set only). The VOXL 2 default parameter set in voxl-px4-params (voxl-defaults/VOXL_2_defaults.params) sets it to 2083, which enables the default set (bit 0), estimator replay (bit 1), debug (bit 5), and high rate sensors (bit 11). See the PX4 parameter reference for the full list of bits. SDLOG_PROFILE requires a reboot to take effect.
Logged topic contents
Each topic in a log file is a uORB message. The PX4 uORB message reference lists the fields of every message. These topics are logged with the VOXL 2 default SDLOG_PROFILE:
| Topic | Contents |
|---|---|
vehicle_attitude | Estimated attitude (quaternion) |
vehicle_attitude_setpoint | Commanded attitude and thrust |
vehicle_angular_velocity | Estimated body rates |
vehicle_rates_setpoint | Commanded body rates |
vehicle_local_position | Estimated position and velocity in the local NED frame |
vehicle_local_position_setpoint | Commanded position, velocity, and acceleration |
vehicle_visual_odometry | Visual odometry (VIO) sent to PX4 by voxl-vision-hub |
vehicle_status | Arming state, flight mode, and failsafe state |
input_rc | Raw RC channel values |
battery_status | Battery voltage, current, and remaining capacity |
cpuload | CPU and RAM load of PX4 |
On drones with a VOXL ESC, the motor topics contain:
| Topic | Contents |
|---|---|
actuator_motors | Motor commands from the control allocator, normalized 0 to 1 |
actuator_outputs | The same commands scaled by the voxl_esc driver. With the default VOXL_ESC_CMD of 0 the values are RPM, between VOXL_ESC_RPM_MIN and VOXL_ESC_RPM_MAX; with VOXL_ESC_CMD set to 1 they are PWM power values up to 800 |
actuator_outputs_debug | The RPM command sent to each ESC, published only when VOXL_ESC_VLOG is 1 |
esc_status | ESC feedback per motor: measured RPM, voltage, current, temperature, and applied power |
The voxl_esc driver source is in the ModalAI PX4 fork.
Starting a log manually
Logging normally starts only when the drone is armed. To capture a log on the bench without arming, for example to share a problem with support, start the logger from an adb or ssh shell on VOXL 2:
px4-logger on
Let it run for the period of interest, then close the file:
px4-logger off
Getting logs off the drone
Each log is a .ulg file under /data/px4/log, in a folder named by date when the system time is known and sessNNN otherwise. Copy all of them to the host with adb:
adb pull /data/px4/log
QGroundControl can also download logs over MAVLink from Analyze Tools > Log Download.
Reading a log
- PX4 Flight Review: upload a
.ulgfile for standard plots and a shareable link. Share that link when reporting a problem; the site also extracts the parameter values from the log. - PlotJuggler: opens
.ulgfiles directly for plotting any topic. - pyulog: command line tools for
.ulgfiles.
pip3 install pyulog
ulog_info log001.ulg # list the topics in the log
ulog_params log001.ulg # list the parameter values
ulog2csv log001.ulg # export every topic to CSV
The PX4 flight log analysis guide explains what to look for in the plots.