Documentation/P600 UAV WikiEnglish · Allspark2
Browse documentation
Additional documentation

飞行数据MATLAB绘图

This section describes how to obtain flight data from Prometheus Ground Control Station Pro after a flight and plot the data in MATLAB.

3 min read · English documentation

This section describes how to obtain flight data from Prometheus Ground Control Station Pro after a flight and plot the data in MATLAB.

  • To make flight-data analysis easier, the Prometheus Ground Control Station includes a log-storage feature. It generates a flight-data TXT file and a command-publication TXT file, which can be imported into MATLAB to create intuitive data plots.

Record Flight Data

  • Open the ground control station and click System Settings > Log Settings. The Print Data in MATLAB Format (TXT) option appears, as shown below.

Print data in MATLAB format

  • To analyze a flight, prepare the UAV and ground control station, then click Start. The ground control station begins recording. Use the ground control station to fly the UAV—for example, fly a figure-8 trajectory. After the flight, click Stop next to Print Data in MATLAB Format (TXT) to finish recording the flight data.

  • The corresponding TXT files are generated under /Documents/PrometheusGroundStation/log. The path is the same on Windows.

Generated log files

Note:
Click the download link to obtain the compressed MATLAB plotting package. It contains the plotting programs and example TXT files used below. If a password is required, enter amov.

Download plotting files.

  • The following example uses two files from the current recording: UAV1_state_data_2023-04-25_10_36_04.txt and UAV1_command_data_2023-04-25_10_36_04.txt. UAV1 corresponds to the default UAV ID of 1 entered when the connection was created. state_data identifies UAV flight-state data, while command_data identifies commands published by the ground control station. The remaining part of each filename is the log timestamp from the ground-side computer.

  • Open UAV1_state_data_2023-04-25_10_36_04.txt. From left to right, the columns contain the timestamp, XYZ displacement, XYZ velocity, and spatial angles. The UAV's actual flight data is recorded chronologically in the table. UAV1_command_data_2023-04-25_10_36_04.txt has a similar format, but contains commands sent by the ground control station and can be regarded as the desired flight data.

Flight-state and command data

Plot Data in MATLAB

  • Windows users should use MATLAB R2018b or later. Ubuntu users should download the latest version of MATLAB. Testing showed that MATLAB R2018b on Ubuntu can plot the data, but Chinese annotations may appear garbled, so the latest version is recommended.

  • Open MATLAB. On the Home tab, click Import Data, then import the corresponding UAV flight-state TXT file and ground control station command TXT file. This example imports the supplied sample TXT files.

Import data from the MATLAB Home tab Select the sample data files

  • Click Import Selection. Testing shows that the format can normally be imported directly. If the format is not imported correctly, adjust the import settings manually here.

Import the selected data

  • The imported state and command data now appear in the workspace.

Imported state and command data in the workspace

  • On the Home tab, click Open and open all three .m plotting files.

Open the three plotting programs

  • UAV_state_Plot.m: Plots the UAV flight state.
  • UAV_command_Plot.m: Plots ground control station commands, representing the desired UAV flight data.
  • UAV_Compare.m: Aligns and combines the two plots above by timestamp, making it easier to compare the deviation between desired and actual flight data.
  • Each .m file contains usage instructions. In essence, copy the name of the imported data and paste it into the corresponding calculation and plotting parameter in the .m file. See the comments in each .m file for details. Click Editor, then click Run to start plotting. The results are shown below.
  • UAV_state_Plot.m: UAV flight-state plot

UAV flight-state plot

  • UAV_command_Plot.m: Desired UAV flight plot

Desired UAV flight plot

  • UAV_Compare.m: Comparison plots

UAV comparison plot UAV comparison plot UAV comparison plot UAV comparison plot UAV comparison plot UAV comparison plot UAV comparison plot UAV comparison plot UAV comparison plot