I’ve spent a lot of time looking at the ARDUPILOT website about notch filters, but there are a few things I don’t understand. It took me a lot of time to post this, I hope someone who understands can guide me, because it really took a lot of time to figure out this filter.
The following is the step by step I follow the wiki instructions to set the notch filter. Finally, the noise of the gyro can be filtered out, but the noise of the accelerometer cannot be filtered out. The noise of the accelerometer and the noise of the gyro are basically the same frequency. see if i made a mistake in the follow step.
-
Flight purpose:Measuring Vibration with IMU Batch Sampler
Pre-Flight Setup:
INS_LOG_BAT_OPT = 0 to do pre-filter 1KHz sampling
INS_LOG_BAT_MASK =1 to collect data from the first IMU
LOG_BITMASK’s IMU_RAW bit must not be checked.Flight and Post-Flight Analysis
Perform a regular flight (not just a gentle hover) of at least 30 seconds
The flight video is as follows:
https://youtu.be/qScNo0o-Y4s
download the dataflash logs:
https://drive.google.com/file/d/1HgjX-X7tsyh22OC1DLahDTcHvVQtYEP2/view?usp=sharing
Post-Flight Analysis:
The spectrum of the gyroscope and accelerometer can be seen, in which there are two
peaks near 136HZ, which is obviously the vibration caused by the rotation of the
propeller.
- Flight purpose:In-Flight FFT Based Harmonic Notch Setup
FFT_ENABLE = 1 reboot
Initial Flight and Post-Flight Analysis,without the harmonic notch being enabled.
Perform a hover flight of at least 30s in altitude hold
https://youtu.be/zHEYIj5AuMs
download the dataflash logs : https://drive.google.com/file/d/1nDYAwxkKa8P7O81bdDRLUg-Q1iUw_s5a/view?usp=sharing
Graph the log element FTN1.PkAvg which represents the FFT’s energy-weighted estimate of the average noise frequency for roll and pitch.
Set INS_HNTCH_ENABLE and/or INS_HNTC2_ENABLE = 1**
Set INS_HNTCH_MODE and/or INS_HNTC2_MODE = 4
Set INS_HNTCH_REF and/or INS_HNTC2_REF = 1
Setting up the FFT parameters can be done automatically using the RCx_OPTION auxiliary function “162” on a transmitter switch. Set the function to a switch on the transmitter. Hover the vehicle, switch it on (high) for 30 seconds, switch back low and land. The parameters will have been setup and switch function removed.
RC12_OPTION=162 ,switch is SA in my radio
You hear FLAP UP and down actually trigger FFT, this sound has not been adjusted in my radio.
Perform a hover flight of at least 30s in Qloiter mode:
Check FFT_parameters in the parameters tree:
download the dataflash logs : https://drive.google.com/file/d/14dziHTY06TtwbYoRDSEzzd6tNdvqOTz9/view?usp=sharing
Fast Fourier Transform the flight record:
With INS_LOG_BAT_MASK still set to = 1 to collect data from the first IMU:Set INS**_LOG_BAT_OPT = 2** to capture post-filter gyro data
Flight at least 30s in Qloiter mode :
download the dataflash logs:
https://drive.google.com/file/d/1eBoeczdUjJ3N1YewFOO6PfCn6d217nPo/view?usp=sharing
Graph the log frequency spectrum to check Notch Filter Effectiveness:
From the spectrum analysis, it can be seen that the gyro noise has been eliminated, but there are still two peaks on the accelerometer spectrum。Why is this so?
How to understand this passage: Set INS_HNTCH_ENABLE and/or INS_HNTC2_ENABLE = 1,
I have tried, if only set INS_HNTCH_ENABLE=1, the notch filter does not work,
do I have to set INS_HNTC2_ENABLE = 1, will this increase the CPU load?
As you can see from my video, the plane’s heading has been swaying to the left and right. Why do I always want to filter out the noise of the gyroscope and accelerometer, because I want to use the script to automatically adjust the PID later.
FC:F765 wing, firmware:4.2.3