NT Data Logging
A data logger (= NT Logger) can be connected to the NT bus, which allows us to record on a micro SD card a substantial amount of data. The data are recorded for each cycle of the controller loop, i.e., with the maximal possible time resolution. The NT logger is also quite small and can be easily mounted on-board. This way one can get highly accurate and informative data taken during a real flight condition. The same data can also be recorded on the ground, without the need of a NT logger, using the live-recording feature.
The data logging option hopefully will allow us to better diagnose any in-flight troubles, such as jello or micro vibrations in the video, and find solutions to resolve them. It also suggests many other applications. For instance, one may use it to dynamically balance the motors and propellers.
NT Logger Module
The NT logger module is connected to the NT bus, like any other NT module.
The micro SD card must be formatted with FAT32. The firmware author uses the Windows tool. Using the SD Association formatting tool didn't yielded any noticeable advantage.
The micro SD card should be of very high speed. Unfortunately, not any card works equally well. Little experience is available so far:
micro SD card | experience | reported by |
---|---|---|
SanDisk Extreme SDHC 16GB UHS-I Class 10 U3 | very good, missing frames of ca. 0.1% | OlliW, GekoCH |
Kingston 8GB HC class 4 | bad, missing frames of ca. 20% | OlliW |
Kingston 32GB HC class 4 | bad, missing frames of ca. 20% | OlliW |
NTLoggerTool
For analyzing the recorded data, the NTLoggerTool is available, providing tools such as FFT, and others. It also allows us to convert the data to other formats, most notably to .cfl files. The .cfl files are suitable for the program BlackboxExplorer for STorM32, which is a decendant of CleanFlight's BlackboxExplorer. The NTLoggerTool also allows us to record directly the data on the NT bus using a USB-TTL adapter; a feature called live-recording. It enables many work-bench tests and procedures.
The NTLoggerTool is steadily advancing with fast pace; any manual would be quickly outdated. For a discussion it is best to join the STorM32 NT thread at rcgroups.
The NTLoggerTool is open source (GPL3). Anyone is highly welcome to contribute to it.
Logged Data
The data logger "spies" on the STorM32's NT Tx line, i.e., is capable of recording all data transmitted from the STorM32 to the NT modules. The points in the controller loop at which data are "sampled" are indicated in this sketch:
GUI Settings
However, not all data samples may be send out. Which data are emitted by the STorM32 can be controlled by the parameter NT Logging, found in the [GUI:Expert Tool] window.
NT Logging | basic | pid | accgyro | accgyro_raw |
---|---|---|---|---|
SetLogger CmdAhrs SetMotorAll |
CmdPid | CmdAccGyro | CmdAccGyroRaw Imu1 & Imu2 & Imu3 | |
“off” | - | - | - | - |
“basic” | x | - | - | - |
“basic + pid” | x | x | - | - |
“basic + accgyro” | x | - | x | - |
“basic + accgyro_raw” | x | - | - | x |
“basic + pid + accgyro” | x | x | x | - |
“basic + pid + ag_raw” | x | x | - | x |
“full” | x | x | x | x |
It can happen that not all data can be transmitted in one cycle, if the computational load and data rate are too high. This mostly occurs with both 2nd IMU and full data logging enabled. In that case the raw data are distributed over several cycles.
Also the data rate of the micro SD card represents an obvious limitation. If the SD card can't keep up, frames (i.e. the data of one controller cycle) will be lost. Lowering the logging can alleviate that a lot.
Live Recording
It is also possible to "spy" on the STorM32's NT Tx line using a USB-TTL adapter, and record the data using the NTLoggerTool. The feature is somewhat analogous to the DataDisplay in the STorM32 GUI, except that it records much more data and moreover at full speed, with maximal time resolution.
The USB-TTL adapter must be capable of handling 2.000.000 bauds. Adapters with FT232RL (FTDI) work out of the box. Adapters with CP2102 may be configured to do so, see How to configure CP2102 USB adapters for high baud rates. Both adapter types have however problems with keeping up with the high data rate (it's about 1Mb/s!). The firmware author has somewhat better results with a CP2102-based adapter. It would be interesting to try FT2232H high-speed adapters; the firmware author didn't had luck with them however (driver issues?).
The USB-TTL adapter is connected to the NT bus as follows:
USB-TTL adapter GND -> STorM32 NT GND USB-TTL adapter Rx -> STorM32 NT Tx USB-TTL adapter Tx -> do not connect
The USB-TTL adapter's Tx line must not be connected to the STorM32's NT Rx line, i.e., should be left floating.
Data Fields
feel free to fill in
use data field for fields
and data value for special (non-numeric) data values