High-Frequency Logging for Custom Flight Maneuvers

Hello everyone,

I am working on a research project that requires IMU, Attitude, RCIN and RCOUT data to be logged at the autopilot’s 400 Hz main loop rate. My goal is to ensure perfect time-alignment between these data sources for post-processing. Having all these parameters synchronized at the loop rate is critical for time-alignment and capturing high-frequency dynamics.

I am facing a challenge with the logging frequency. Even though I have enabled Fast Attitude, Medium Attitude, Raw IMU, and Fast IMU bits in the LOG_BITMASK, I noticed that the data is still being logged at lower rates (around 10-25 Hz) in SITL. I’m currently running tests in a SITL environment to see the details that need logging in the actual flight test and to prepare for the actual flight test.

I have looked into SYSID mode, but it doesn’t fit my requirements. SYSID requires exciting a specific axis, whereas my research requires flying specific, pre-designed 3D flight patterns rather than automated internal excitations.

My questions are:

  1. Forcing 400 Hz: Is it possible to force ArduPilot to log these specific messages (IMU, ATT, RCIN, RCOUT) at the full 400 Hz rate during a normal flight mode (e.g., Stabilize or AltHold)?

  2. SITL vs. Real Hardware: Is the 10-25 Hz limit I’m seeing a restriction of SITL, or will the Pixhawk Cube Black also throttle the logging rate despite the LOG_BITMASK settings?

  3. Buffer and CPU Overhead: If I modify the code to log at 400Hz, what are the primary concerns regarding SD card write speeds and CPU load? (I am using a high-speed industrial SD card).

  4. If there is a buffer and CPU overhead Is there a more efficient way to stream this data off-board without hitting the log throughput bottleneck?

I want to avoid the pre-defined excitation of SYSID and focus on logging my own flight patterns at the highest resolution possible. Any advice on parameters or best practices to achieve a consistent 400 Hz log would be greatly appreciated.

Thanks in advance!

With attitude fast and medium set attitude should log at loop rate.

See How to methodically tune any ArduCopter | MethodicConfigurator

RCIN/OUT are fixed to 10Hz do you will need to modify code to increase logging rates.

You probably shouldn’t use IMU_FAST and RAW together.

1 Like

You will need to modify the code to get exactly what you want, but its not hard. Note that you may be trying to log more than the sdcard is capable of handling - the write speed is not super quick and its easy to overwhelm the infrastructure. So you don’t want to log everything - just the things you need at the speeds you want. The only thing you can currently get at full rate is attitude, rate, pids, IMU and notches - you can see this in ardupilot/ArduCopter/Copter.cpp at ec09e44a0966a7dd936960cbf4343cfaadeaaf7b · ArduPilot/ardupilot · GitHub

Thanks for the clarification. I specifically want to log Attitude, PID, and IMU data at full rate.

To achieve this, is it sufficient to just enable the relevant bits in the LOG_BITMASK parameter, or do I need to manually modify the code in Copter.cpp or Log.cpp to ensure these specific messages are called within the fast loop?

Also, considering the SD card write speed limitations you mentioned, would you recommend any specific logging or scheduler adjustments to prevent ‘logging dropped’ errors while keeping these three at full rate?

Thanks in advance.