Real-Time Non-Linear Derivative Filter Engine for IMU Vibration Mitigation (Looking for Raw Flight Logs)

Title: Real-Time Non-Linear Derivative Filter Engine for IMU Vibration Mitigation (Looking for Raw Flight Logs)

Hi everyone,

I am developing a non-linear software filtering engine designed to mitigate severe high-frequency structural noise spikes caused by 10,000+ RPM brushless motors on low-cost MEMS IMUs (like the MPU6050) without introducing traditional phase delay.

The Core Problem with Standard Approaches

Traditional low-pass or moving average filters smooth out structural noise but introduce a catastrophic phase delay (time lag). In aggressive flight loops, even minor delays lead to over-correction, control loop oscillations, or crashes.

The Proposed Innovation

A physical drone frame has structural inertia and cannot accelerate infinitely fast in a fraction of a millisecond. High-frequency electronic noise glitches and mechanical motor harmonics present mathematically impossible angular rate spikes.

Instead of slow time-averaging, this engine evaluates second-order discrete derivatives (Angular Jerk) in real-time at a 400 Hz sampling rate (dt = 0.0025s).

1. Discrete Time Derivative Calculation

Using a fixed 3-element sliding memory buffer [y_k, y_k-1, y_k-2] tracking raw sensor inputs across discrete time steps, we isolate instantaneous rate changes:

  • First Discrete Derivative (Velocity):
    v_k = (y_k - y_k-1) / dt

  • Second Discrete Derivative (Acceleration / Jerk Magnitude):
    a_k = (v_k - v_k-1) / dt = (y_k - 2*y_k-1 + y_k-2) / (dt^2)

2. Dynamic Gaussian Trust Factor (W)

We evaluate the absolute acceleration magnitude |a_k| against a calibrated physical threshold (Theta). A non-linear Gaussian exponential decay function calculates a real-time trust weight W between 0.0 and 1.0:

W(a_k) = exp( -1 * (|a_k| / Theta)^2 )

  • Normal Physical Flight (|a_k| << Theta): W approx 1.0 (100% trust raw data)
  • Motor Vibration Spike (|a_k| >> Theta): W approx 0.0 (0% trust, reject noise spike)

3. Kinematic Trajectory Prediction & Convex Blend

When an intense vibrational spike occurs and trust drops (W → 0), the engine bypasses the raw sensor reading and predicts the orientation state (y_hat_k) using a 1st-order localized Taylor polynomial expansion from the previous safe state (y_bar_k-1):

y_hat_k = y_bar_k-1 + (v_k-1 * dt)

To protect against integration drift during continuous high-RPM vibrations, a frame counter forces an incremental fallback to raw tracking if W stays at zero for more than 4 consecutive frames.

The final clean output (y_bar_k) is compiled using a smooth convex combination blend of the measured and predicted states:

Filtered Output: y_bar_k = [ W(a_k) * y_k ] + [ (1.0 - W(a_k)) * y_hat_k ]


Current Status & Looking for Real Raw Flight Data

I have successfully built a zero-cost Python sensor simulation workbench to stress-test this math model against synthetic 10,000+ RPM motor noise and random clipping spikes, showing great results with zero phase lag. I’ve also completed a bare-metal #![no_std] Rust implementation of the processing engine intended for 32-bit dual-core architectures like the ESP32.

However, I do not have access to a physical drone right now to generate real operational test data and benchmark the engine further.

Could anyone in the community share raw, unfiltered high-rate IMU flight data (preferably CSV, bin, or log format)? I am specifically looking for files that contain raw gyroscope streams heavily contaminated by real motor vibrations or high-frequency structural harmonics. I want to pass your real-world messy data through my engine to verify if the threshold limits hold up perfectly.

I would also love to get the community’s thoughts on:

  1. Edge cases regarding integration drift under continuous, unbroken vibration bands.
  2. The feasibility of porting this logic directly into an autopilot sensor pipeline before or parallel to the main EKF.

Full source code, math details, and simulation plots are here: GitHub - parth2152012/noise_cancler · GitHub