Necessary steps for harmonic notch setup?

what params need to be set to enable ftn1 in the logs?

FFT_ENABLE,1

what parameters dictates the sampling frequency, fs? INS_GYRO_RATE?

Yes, if FFT_SAMPLE_MODE = 0. You can also sample at divisors of the loop rate by setting it to 1+

so if I set FFT_SAMPLE_MODE to 2, it will be INS_GYRO_RATE/2?

No it will be SCHED_LOOP_RATE/2

What’s the difference between FTN.DnF and FTN.PkAvg ? My understanding is that CTUN.N, which is the harmonic notch current center frequency for the gyro in Hz, got moved to FTN.DnF at some point. If INS_HNTCH_MODE = 4 (dynamic FFT), FTN.DnF AND FTN.PkAvg should be very nearly the same, right? Otherwise FTN.DnF is static?

Yes. Although DnF will always reflect the harmonic notch frequency - it means you can compare the peformance of the FFT with throttle based for instance

Hello @andyp1per ,
I saw some other posts about fft, like this My quad with cube orange wobbling in position hold - #28 by andyp1per, that you say there is a enormous peak somewhere and that the fft is not picking it up. How do I check that?

Also, I saw this other post with this image:


and you said the second peak was probably the motor peak, could explain why?

You do an FFT using the batch sampler. Measuring Vibration with IMU Batch Sampler — Copter documentation

Is there a way to log to both the pre filter data and the after filter data from the same flight? The way I have been doing is to do a flight without the harmonic notch enabled, log, do another with the notch enabled and log, and then compare

Sorry, no. I agree it would be useful but it’s likely the datarate would be too high

Why does setting up the fft and dynamic harmonic notch with the state of hover is so important and not other state? Like if I did the test flight in another mode instead of alt hold and kept increasing and decreasing the altitude, would this data be useful or not?

If you are doing throttle based notch then the RPM scaling is calculated from hover - that’s why you need to know the RPM at hover thrust

So if I am using fft, I just set up FFT and fly or does still needs a test flight?

If you have a tune that works without the notch then you can just fly. Just be careful if you are switching from throttle to FFT.

while using FFT, if I make a change to INS_HNTCH_FREQ, is it ignored or does it have an effect?

for the drone, the rotational frequency from the motors are supposed to be a mid throttle approximately 60 Hz, but the PkAvg is closer to 120 Hz, the first harmonic. Did I screw up some parameter?

Whatever driver you choose, INS_HNTCH_FREQ is always the lowest frequency to which the notch will go. Other than that it will affect the Q value of the notch if you don’t change BW at the same time.