A gyro filter or the noise analyser could not get its memory
What ArduPilot says:
- Failed to allocate window for AP_GyroFFT
- Failed to initialize DSP engine
- FFT: unable to run self-test, required N bytes
- Failed to allocate N bytes for notch filter
- AP_GyroFFT: req alloc N bytes (free=N)
- Failed to allocate window for INS
Also explained here: 1 more
- AP_GyroFFT: disabled, required N bytes
At start-up a feature that filters or analyses the gyro signal asked for memory and did not get it, so it is not running: a harmonic notch filter (“… bytes for notch filter”), or the in-flight FFT (the lines with AP_GyroFFT, DSP engine and window). The aircraft arms and flies, but without that filter: more motor noise reaches the controller than the tune assumes, which can mean hot motors or oscillation.
What to do, most likely first
The notch filters ask for too many individual filters for a small board: many harmonics, one notch per motor, double or triple notches, on every IMU.
CheckCount the bits in
INS_HNTCH_HMNCSand look atINS_HNTCH_OPTS.FixKeep only the harmonics your log shows (often the first, or the first two) and drop the double and triple options on a small board. Reboot and check that the message is gone before flying.
Other features use up the memory: Lua scripting above all.
Check
SCR_ENABLEis 1 andSCR_HEAP_SIZEis large; the free memory shown in the ground station is low.FixReduce
SCR_HEAP_SIZEor switch off features you do not use, then reboot.The FFT window is too large for this board.
CheckThe lines name AP_GyroFFT or the DSP engine, and
FFT_WINDOW_SIZEis above its default.FixSet
FFT_WINDOW_SIZEback to its default and reboot.
Parameters to look at
| Parameter | What it is |
|---|---|
INS_HNTCH_ENABLE | Harmonic Notch Filter enable |
INS_HNTCH_HMNCS | Harmonic Notch Filter harmonics |
INS_HNTCH_OPTS | Harmonic Notch Filter options |
FFT_ENABLE | Enable |
FFT_WINDOW_SIZE | FFT window size |
SCR_ENABLE | Enable Scripting |
SCR_HEAP_SIZE | Scripting Heap Size |
Where to do it:Setup & Tuning GuideFirmware Inspector
The code that sends it
Failed to allocate window for AP_GyroFFT
libraries/AP_GyroFFT/AP_GyroFFT.cpp AP_GyroFFT::init() · Open in ArduPilot Copter-4.7.1
Failed to initialize DSP engine
libraries/AP_GyroFFT/AP_GyroFFT.cpp AP_GyroFFT::init() · Open in ArduPilot Copter-4.7.1
FFT: unable to run self-test, required N bytes
libraries/AP_GyroFFT/AP_GyroFFT.cpp AP_GyroFFT::self_test_bin_frequencies() · Open in ArduPilot Copter-4.7.1
Failed to allocate N bytes for notch filter
libraries/Filter/HarmonicNotchFilter.cpp HarmonicNotchFilter<T>::allocate_filters() · Open in ArduPilot Copter-4.7.1
And 3 more messages, sent from the same places.