Data Logger

From PaparazziUAV
Revision as of 11:18, 23 August 2016 by DaanHoppener (talk | contribs) (Description added on how to enable internal data logging on the Parrot Bebop.)
Jump to navigation Jump to search

Introduction

This page describes various onboard external devices called a "Data logger", that can be connected to the Paparazzi autopilot.

Such a Data Logger device can be used to store telemetry data to a storage medium on board the aircraft. Such a storage medium can be an SD card or a Flash chip. For now logging is not done directly by the autopilot itself as the usage of a file system as well as possible lag you might get with a SD storage speed does not fit well with the real-time nature of Autopilots.

Note that not all loggers accept SD HighCapacity(SDHC) cards as storage

Why Onboard

One would naturally first ask; why on on-board logger when we have data over the air?

The answer to this is multi-fold; Sometimes it is not possible to log everything over the air because of speed, lag and datavolume limitations of data send wireless over the air. Or one needs to log when there is no telemetry at all in long distance flight. Or one want to log all the RAW IMU data to debug specific scenarios.

To solve this issue, there are various loggers that can be connected to your Paparazzi Autopilot board.

Available Data logger options

There are numerous logging solutions, both with their pro's and con's; here the options:

* TWOGA-Logga

* An dedicated TWOG board for logging

* Openlog

* SD Logger SPI Direct

* Micro Logger

Storage format

A more unified method of storing data on the logger, info available here

Logging Data on the Parrot Bebop

Logging data onboard on the Bebop is pretty straight forward, as long as someone takes the time to tell you how. In this case, this guide will have to do. The Bebop drone is equipped with onboard storage, which we use to store the logs.

Step 1: First, open your airframe.xml file (for example in paparazzi/conf/airframes/TUDELFT/ ). Make sure that under modules, the following lines are uncommented or included: (only <module name="logger_file"> <define name="FILE_LOGGER_PATH" value="/data/ftp/internal_000"/> have to be included).

  <modules main_freq="512">
    <module name="geo_mag"/>
    <module name="air_data"/>
    <module name="send_imu_mag_current"/>
    <module name="logger_file">
      <define name="FILE_LOGGER_PATH" value="/data/ftp/internal_000"/>
    </module>
  </modules>

Step 2: In your logger file include the headers within paparazzi which contain the variables which you would like to log. This is done in the logger c file in paparazzi/sw/airborne/modules/loggers/file_logger.c . In this case I want to log data from stabilization_indi.c , so the following header should be included:

#include "firmwares/rotorcraft/stabilization/stabilization_indi.h"

In the file file_logger.c you can specify which variables you want to have logged in the same fashion as normal "printf's" would work. The variable names and the variable types (float, int etc.) have to be specified.

Step 3: Start and stop the file logger by going to the paparazzi ground control station. Then go to > Settings > Modules. Here you can start and stop a log. This is displayed in the picture below:

Enable data logging in the GCS.

Step 3: Finally, the logged .csv files can be retrieved from the Bebop. This is done by opening a browser, and typing ftp://196.168.42.1/ in the navigation line. This will take you to the ftp folder on the Bebop. Browse to /Internal000/ . Here we can find the .csv files, named 00000.csv to 0000X.csv depending on the flights you logged. Copy the files to your computer for analysis