Skip to content

Language

Currency

PX4 Log Analysis Made Easier with Flight Review

by AMOVLAB 25 Mar 2025 0 Comments

In UAV R&D and debugging, flight controller logs are the “black box” for interpreting flight behavior. Traditional analysis methods, such as Excel table filters or basic drawing tools, often trap engineers in Massive data localization is difficultMulti-parameter correlation analysis is weakPoor dynamic process restoration dilemma. As an open-source time series analysis tool, PlotJuggler can greatly improve the parsing efficiency of flight controller logs and help accurately diagnose and optimize flight performance.

Three major problems in flight controller log analysis

Finding problems in the data pile is time-consuming and laborious

  • A single flight log contains hundreds of uORB topics (such as attitude, motor output, sensor noise), and traditional methods need to filter them one by one, which can take up to several hours.

  • Typical scenario: The UAV's mid-air attitude suddenly changed, and engineers needed to localize the abnormal variable from a large number of parameters (which was eventually found to be the IMU temperature).

Just look at a single graph and you can’t find the source of the problem

  • Excel or MATLAB static curves cannot be rendered Parameter dynamic coupling relationship

  • Typical scenario: The vibration of the aircraft exceeds the standard, and it is impossible to determine whether it is caused by structural interference or control parameters based on a single acceleration curve.

Multiple systems interact with each other. To find out the problem, you need to find all the clues.

  • Typical scenario: If the fault is caused by Cross-system interaction issues Caused by (such as power fluctuation → controller response delay → attitude divergence), three sets of electrical, control, and motion data need to be analyzed simultaneously.

PX4 officially recommends a variety of log analysis tools. Compared with other analysis tools, PlotJuggler has obvious advantages:

  • Intuitive drag-and-drop interface.

  • Arrange data across multiple plots, tabs, or windows.

  • All uORB topics are displayed and can be plotted.

  • After organizing the data, save it to a "Layout" file and reload it multiple times.

  • Use custom Data Transformations to process your data in PlotJuggler.

Introduction to the main functions of PlotJuggler

Multi-window data on the same screen, say goodbye to switching back and forth

Through horizontal/vertical split-screen technology, multi-parameter synchronized dynamic observation is achieved:

Practical value: By dividing the analysis interface into three independent views, the flight attitude data (X/Y/Z axis acceleration) are displayed respectively, and the vertical speed curve is superimposed on the right side, and the battery current parameters are introduced in the middle and lower part. When the UAV takes off, the current surge accurately corresponds to the synchronous fluctuation of the acceleration/speed curve on the time axis. This multi-dimensional time series data correlation analysis can quickly localize abnormal operating conditions. A single parameter perspective can easily lead to misjudgment, but multi-view linkage can fully present "Power output → sports response"The causal chain significantly improves the efficiency of fault diagnosis.

Draw 2D motion trajectories

Use Ctrl + right-click drag to generate an XY scatter plot and convert the time series into a spatial trajectory:

Practical value: PlotJuggler supports two-parameter scatter plot analysis by Ctrl + right-click dragging (such as selecting the x and y coordinates of vehicle_local_position), and mapping the aircraft trajectory projection on the XY plane. The right view synchronously displays the timing curve of the vx/vy horizontal velocity component and the vz vertical velocity. With the real-time playback control bar in the lower right corner (adjustable 0.1-10 times speed), the spatio-temporal coupling relationship between pose changes and velocity vectors can be dynamically observed. When the aircraft accelerates along the X-axis, the vx curve shows positive phase growth; when it moves towards the Y-axis, the vy component responds synchronously. This "trajectory-speed" joint analysis mode can quickly diagnose typical flight controller problems such as localization drift and speed integration anomalies. Compared with traditional single-dimensional analysis efficiency, the efficiency is significantly improved.

FFT transform

Built-in fast Fourier transform function to generate vibration spectrum with one click:

a. Start the FFT tool After loading the log file, click on the top menu bar Tools -> Fast Fourier Transform
b. Data loading and analysis Drag the target sensor data into the Input area in the upper right corner (such as gyro sensor_combined/gyro_rad.00) and click Calculate Generate frequency domain curves
c. Result storage and observation Click Save Curve Save the FFT curve (such as gyro_rad.00_FFT). Close the FFT window and drag the generated FFT curve to the right display area.Zoom in on Y-axis Observe the spectrum amplitude.

Video placeholder: The original Chinese article includes a video here. AMOVLAB will manually connect the corresponding YouTube video.

Practical value: If the UAV vibrates at a high frequency, the vibration frequency can be found through FFT analysis. The cutoff frequency can be set to directly observe the filtering effect without exporting the data.

Draw attitude following curve

Video placeholder: The original Chinese article includes a video here. AMOVLAB will manually connect the corresponding YouTube video.

Conversion steps:
a. Data localization

  • Search for the vehicle_attitude topic in the "Time Series List" on the left

  • Expand quaternion array q[4]

b. Mathematical transformation execution

  • Click on the toolbar "Tools" to call Quaternion to RPY trigonometric function

  • Drag and drop the quaternion to get the value, q[0], q[1], q[2,]q[3] respectively correspond to W, X, Y, Z

  • click save

c. Visual verification

  • Select roll, pitch, yaw under Custom Series: on the right and drag them into the right view for display.

Technical principle: The conversion formula from quaternion (q0,q1,q2,q3) to roll angle is: roll = atan2(2*(q0*q1 + q2*q3), 1 - 2*(q1² + q2²)) PlotJuggler automatically completes this calculation through a built-in function library, eliminating the need for manual coding by the user.
Practical value: The dynamic characteristics of the control loop can be visually evaluated by comparing the curves:

  • Response speed: The actual curve lags the expected curve.Proportional gain (P) Is it sufficient?

  • Overshoot suppression: Indication of how much the actual curve exceeds the expected value Differential term (D) damping effect

  • Steady state error: The deviation between the two curves in the stable stage reflects Integral item (I) compensation ability

Debugging principles: If the control cannot keep up, increase p. If the oscillation is severe, decrease p. If the amplitude is almost the same, add a little d. If there is a static difference, add i.

Classic case

FFT analyzes vibration and adjusts parameters

)

By comparing the FFT frequency spectrum of the UAV hover log, it is found that when the gyroscope angular velocity and angular acceleration cutoff frequency parameters (IMU_GYRO_CUTOFF/IMU_DGYRO_CUTOFF) are set to 75Hz/50Hz, spectrum analysis shows that there is significant 25Hz body vibration (left picture); adjust this parameter to 35Hz/25Hz Finally, the picture on the right shows that the vibration in this frequency band has been basically eliminated, and the flight stability has also been greatly improved.

Highly abnormal

This case analyzes the abnormal height control problem of UAV. The log data shows: a. The curve in the first block diagram represents the altitude data obtained by the barometer. b. The curve in the second block diagram represents the height data obtained by the fixed-altitude radar sensor. c. The curve in the third block diagram represents the height data obtained by UAV fusion. d. The curve in the fourth block diagram represents the GPS altitude data. During the time period when the data anomaly occurred (the part outlined in red), it is obvious that the pressure altitude and GPS altitude trends are consistent, but the altitude output by the fixed-altitude radar is opposite. Since the parameter EKF2_RNG_AID is enabled, the altitude fusion has been switching between the barometer height and the fixed-altitude radar. There is also a problem with the fixed-altitude radar data, causing the fusion height to be wrong. Finally, it results in a high degree of uncontrollability.

Resource download
Software installation:
https://github.com/facontidavide/PlotJuggler/releases
Notice:
Under Windows 11 system, PlotJuggler may not run, please install version v2.8.4
Reference URL:
https://docs.px4.io/main/en/log/plotjuggler\_log\_analysis.html
Common parameter meanings:
The following is an introduction to some commonly used log data, and an introduction to unexpanded messages. It is recommended to study it in conjunction with the PX4 official uORB theme document (reference:https://docs.px4.io/v1.13/en/msg\_docs/)

Leave a comment

All blog comments are checked prior to publishing

Thanks for subscribing!

This email has been registered!

Shop the look

Choose Options

Recently Viewed

Edit Option
Back In Stock Notification
Terms & Conditions
What is Lorem Ipsum? Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. Why do we use it? It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).
this is just a warning
Login
Shopping Cart
0 items