Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[filter] IMU prefiltering using the One Euro filter #2413

Merged
merged 1 commit into from
Apr 2, 2019

Conversation

gautierhattenberger
Copy link
Member

One Euro filter is a very simple adaptive low pass filter that can efficiently remove the noise from the gyros and accelerometers without adding to much lag.
As it is a separated module connected to the ABI bus, it can be used with any IMU and AHRS/INS combination by selecting the correct data source for the estimation filters.

The plot below shows the recording of the roll gyro, with the blue line the original noisy signal while the red line is the filtered value. The noise level is much lower but their is almost no lag during fast rotations.
gyro_time_one_euro

The FFT of the above signal shows the noise from the motors between 150 and 200 Hz that is almost completely removed.
gyro_fft_one_euro

This filter is very cheap in terms of computation and also very easy to tune with only two parameters.
See http://cristal.univ-lille.fr/~casiez/1euro/ for more details.

One Euro filter is a very simple adaptive low pass filter that can
efficiently remove the noise from the gyros and accelerometers without
adding to much lag.
As it is a separated module connected to the ABI bus, it can be used
with any IMU and AHRS/INS combination by selecting the correct data
source for the estimation filters.
@EwoudSmeur
Copy link
Member

Cool, adaptive cutoff! However, the data that you show I wouldn't classify as particularly noisy 😉

@mrtbrnz mentioned that you want to use it in combination with INDI, but I am not sure if this will work well; any lag introduced by filtering the gyroscopes is compensated by applying the same filter on the incremented inputs. If the same filter is not really the same, because the cutoff is adaptive and may be different, it may fail to synchronize the incremented inputs with the measurements.

@gautierhattenberger
Copy link
Member Author

I choose a part of the signal where you can actually see something :)
You can use this with any IMU/AHRS combination, so not only on quads using INDI. I know that even small lags can make a huge difference there. I tried to run the calibration script of INDI using the raw and the filtered data, and the efficiency gains are pretty similar. But since I'm not use to INDI, I can't tell for now if it is problem or not. I will try to make some flights for real if I find the time...
For now it seems to work with regular control at least.

Copy link
Member

@dewagter dewagter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A useful addition and well commented.
Thank you.

@gautierhattenberger gautierhattenberger merged commit 228c882 into master Apr 2, 2019
@gautierhattenberger gautierhattenberger deleted the 1euro_imu_filter branch April 2, 2019 07:45
noether pushed a commit to noether/paparazzi that referenced this pull request Jun 7, 2019
One Euro filter is a very simple adaptive low pass filter that can
efficiently remove the noise from the gyros and accelerometers without
adding to much lag.
As it is a separated module connected to the ABI bus, it can be used
with any IMU and AHRS/INS combination by selecting the correct data
source for the estimation filters.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants