In-Flight FFT-Based Harmonic Notch Setup¶
This feature is included in autopilots with 2MB of memory. Check your autopilot’s List of Firmware Limitations by Board to determine if your autopilot has this feature (GyroFFT). Also, only 1 FFT-based Notch can be set up.
ArduPilot comes pre-configured with appropriate defaults for all FFT settings. The only initial setup required is:
Set FFT_ENABLE = 1 to enable the FFT engine. This then requires that you reboot your autopilot after which FFT support will be enabled and other FFT parameters should be visible in your GCS. With default parameter settings the FFT engine will run a self-check for frequency matching on your hardware. If you do not see any FFT errors then things are working properly.
With FFT enabled it is best to first perform a test flight to check that your aircraft’s particular noise frequencies are being captured and to monitor CPU load. See Initial Analysis Flight. Normally, results from this will show clear noise recognition and acceptable cpu loading, and then you can use the FFT to drive the harmonic notch by setting these parameters:
For most uses with other FFT-related advanced parameters at their default, this is all that is required. The user can do optimization of the filtering setup by analyzing the test flight logs and adjusting notch bandwidth, if desired, by following the In-flight FFT Advanced Setup instructions.
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, and switch back low and land. The parameters will have been set up and the switch function removed. NOTE: do not use this feature in firmware version 4.3!
Using In-Flight FFT can result in poorer performance than a properly set up Throttle-Based notch filter since the FFT computations take time and can lag the actual required center frequency. In-Flight FFT is useful when the rotor frequencies of the vehicle vary widely as in heavy lift vehicles operating with high and low loads. It can be useful in setting up Throttle-Based notch filters, however, see In-flight FFT Advanced Setup instructions for more information.
There are two options that can be selected by setting the appropriate bit in the FFT_OPTIONS parameter that affect FFT operation:
Post Filter Chain FFT Analysis Window¶
Normally, the FFT analysis for adjusting the center frequency is done by measuring the noise directly at the output of the unfiltered gyro data. However, if bit 0 of FFT_OPTIONS is set, then the measurement window takes into account the effects of the low pass filter and any configured notch filter(s). This is useful if there is high-frequency noise, which impacts the control response less than lower-frequency noise due to the low pass at the end of the filter chain but may be targeted by the FFT measurement. Setting this bit will only track those lower frequency, and more critical, noise peaks.
Motor Noise Check¶
If bit 1 of FFT_OPTIONS is set and ESC motor rpm telemetry is available, then the measurement window for the FFT is centered about the motor(s) frequency as reported by ESC telemetry. This will generate a GCS warning message if noise from any motor greater than 40db is passing through the filter chain, and identify its level, motor number, and frequency. This bit must be used with bit 0 also set.
A typical use of the FFT notch filter is in addition to other dynamic harmonic notch filters (Throttle, ESC, or RPM-based). In these configurations, using the post-LPF FFT Window FFT_OPTIONS bit will yield the best overall filtering results by positioning the FFT filter to target noise not filtered by the other notch filter and gyro LPF (INS_GYRO_FILTER.
For those interested in the details of how this feature works and tradeoffs in some of the advanced parameters, not normally adjusted by users, the In-Flight FFT: How it Works document describes the operation and these advanced parameters.