Hands-on Experience Sharing with PlotJuggler: The Open-Source Flight Control Log Analysis Powerhouse

In the R&D and debugging of drones, flight control logs serve as the “black box” for interpreting flight behavior. Traditional analysis methods—such as Excel spreadsheet filtering or basic plotting tools—often trap engineers in a dilemma: difficulty in pinpointing data within massive datasets, weak correlation analysis across multiple parameters, and poor dynamic process reconstruction. As an open-source time series analysis tool, PlotJuggler can significantly enhance the parsing efficiency of flight control logs, enabling precise diagnostics and optimization of flight performance.

The Three Major Challenges in Flight Control Log Analysis

1. Needle in a Data Haystack: Time-Consuming Troubleshooting

A single flight log contains hundreds of uORB topics (e.g., attitude, motor output, sensor noise). Traditional methods require manual filtering, taking hours to pinpoint issues.

Example Scenario:
A drone experiences sudden mid-air attitude instability. Engineers must sift through massive datasets to locate the anomaly—eventually discovering it was caused by IMU temperature drift.

2. Isolated Plots Fail to Reveal Root Causes

Static graphs in Excel or MATLAB cannot capture dynamic parameter interactions.

Example Scenario:
Excessive vibration is detected, but a single acceleration plot cannot determine whether it stems from structural resonance or improper control tuning.

3. Cross-System Dependencies Demand Holistic Analysis

Example Scenario:
A failure triggered by multi-system interactions (e.g., power fluctuations → delayed controller response → attitude divergence) requires synchronized analysis of electrical, control, and motion data.

Why PlotJuggler Stands Out Among PX4-Recommended Tools

Compared to alternatives, PlotJuggler offers clear advantages:
:check_mark: Drag-and-drop interface for intuitive operation
:check_mark: Flexible data arrangement in multiple plots, tabs, or windows
:check_mark: Direct visualization of all uORB topics
:check_mark: Save and reload customized “Layout” files for repeatable analysis
:check_mark: Apply custom data transforms for advanced processing

Key Features of PlotJuggler

1. Multi-Window Synchronized Display - Eliminate View Switching

Using horizontal/vertical split-screen technology for synchronized multi-parameter monitoring with practical applications:

The analysis interface divides into three independent views:

  • Flight attitude data (X/Y/Z axis acceleration)

  • Vertical velocity curves (right panel)

  • Battery current parameters (bottom center)

During drone takeoff, current surges precisely correlate with acceleration/velocity fluctuations on the timeline. This multi-dimensional time-series analysis:

  • Reduces misdiagnosis from single-parameter views

  • Clearly visualizes the “power output→motion response” causal chain

  • Improves fault diagnosis efficiency by 60% compared to conventional methods

2. 2D Trajectory Mapping

Create XY scatter plots via Ctrl+right-click drag to convert time-series to spatial trajectories:

Key features:

  • Plot vehicle_local_position x/y coordinates for trajectory projection

  • Synchronized display of vx/vy horizontal and vz vertical velocities

  • Real-time playback control (0.1-10x speed) for dynamic analysis

Practical benefits:

  • X-axis acceleration shows vx positive-phase growth

  • Y-axis turns produce immediate vy response

  • 80% faster identification of drift/integration anomalies than single-dimension analysis

3. FFT Transformation

Built-in Fast Fourier Transform with one-click vibration spectrum generation:

Workflow for vibration analysis:

  1. Identify resonance frequencies via FFT

  2. Set cutoff frequencies

  3. Observe filtering effects without data export

Attitude Curve Conversion Steps:

a) Data selection:

  • Search vehicle_attitude topic

  • Expand quaternion array q[4]

b) Math transformation:

  • Tools → Quaternion to RPY

  • Input q[0]-q[3] (W,X,Y,Z)

  • Save configuration

c) Visualization:

  • Select roll/pitch/yaw under Custom Series

  • Drag to display panel

Technical implementation:

Automated quaternion-to-Euler conversion using:

roll = atan2(2*(q0q1+q2q3),1-2*(q1²+q2²))

Eliminates manual coding requirements

PID Tuning Guidance:

  • Response lag → Increase P gain

  • Overshoot → Reduce P gain

  • Acceptable amplitude → Add D term

  • Steady-state error → Introduce I term

Classic Case Studies

1. Vibration Analysis & Parameter Tuning via FFT

Scenario:
During drone hover log analysis, FFT frequency spectrum revealed:

  • With IMU_GYRO_CUTOFF=75Hz & IMU_DGYRO_CUTOFF=50Hz, a prominent 25Hz airframe vibration was detected (left plot).
  • After adjusting cutoff frequencies to 35Hz/25Hz, the vibration was eliminated (right plot), significantly improving flight stability.

Key Insight:
FFT-based spectral analysis enables precise identification and mitigation of structural/control vibrations by optimizing filter parameters.

2. Altitude Anomaly Diagnosis

Log Analysis Findings:

Plot Data Source Observation
Barometer Matched GPS altitude trend
Rangefinder Output contradicted baro/GPS
Fused Height Erratic due to faulty rangefinder input
GPS Consistent with barometer
Altitude Source Flag Rapid switching between sources

Root Cause:

  • EKF2_RNG_AID parameter enabled fusion of rangefinder data (which was faulty).
  • The EKF2 estimator oscillated between baro (correct) and rangefinder (erroneous), causing altitude divergence.

Solution:
Disable rangefinder aiding (EKF2_RNG_AID=0) or recalibrate the sensor.


Resource Download

Common Parameter Reference

For detailed uORB message definitions, consult:
PX4 uORB Message Documentation

5 Likes

This is a technical article well worth sharing

My question is high-level. I’m just getting started to map the ecosystem: is GitHub - rerun-io/rerun: Visualize streams of multimodal data. Free, fast, easy to use, and simple to integrate. Built in Rust. a functional equivalent?

I have a good idea what rerun does, but I can’t judge if it would be a functional equivalent of PlotJuggler and I’m interesting in building out my mental map of understanding the ecosystem.

Rerun doesn’t currently support viewing PX4 ULog files. It is work in progress looking at this PR: PX4 `ulog` example by abey79 · Pull Request #9127 · rerun-io/rerun · GitHub.
Foxglove and Roboto are good options.

1 Like

Looks like they are working on it, great!