Setting Harmonic Notch Filter

Hello,

I’m at the stage of setting the harmonic notch filter based on the throttle (INS_HNTCH_MODE = 1). Before turning on the filter, I performed a test flight today with the batch sampler turned on INS_LOG_BAT_MASK = 7 (collecting data from three IMUs) as described in the manual. I received the FFT charts, below is the log: BLOG - FTT - Google Drive


I am asking you to assess the vibration level and read the peak of the graph, for me it is 110Hz and that is what I would like to set in INS_HNTCH_FREQ.

  1. Don’t bother with Mission Planner to analyze the Notch filter data, use the Ardupilot Filter Review Tool Ardupilot Filter Review Tool
    2-Use a Linear scale for the Y-axis.
    3- Use the Estimated Post-Filter to virtually configure and test the Notch settings. When you do you will find these settings to work well
    Notch settings

Set those and set this ( INS_ACCEL_FILTER,10) and Peform another AltHold hover flight and see how it actually works.

1 Like

Thank you for your answer, I didn’t know this tool.
I don’t fully understand how this program should work, but after uploading the .bin file and selecting the appropriate range from the chart and clicking the “Calculate” button, the values in the Filter configuration tab will not change. It seems to me that something isn’t working.

You haven’t configured anything. I gave you entries to try. Enable the filter, set the parameters, Press the "Recalculate filters button, Check the Notch Tracking> Show notch 1 box, and then check the boxes for estimated post-filter. Compare that to Pre-Filter. Does it seem to work?

Edit: I did neglect to configure the Reference. Use this INS_HNTCH_REF 0.25

Pre

Post

Thank you.
The program now works. I just thought the value determination was automatic. Instead, you have to enter individual values.

Tell me, how did you know that INS_HNTCH_FREQ was 54? The instructions say that we take the peak value of the graph, which in my case is about 110Hz.

The 110hz peak is the 2nd harmonic of the 1st peak. The highest magnitude peak isn’t always what you address.

1 Like

I made test more dynamic flights today with the notch filter turned on, here are the results:

AltHold:

Loiter:

bin files, and video from the FPV camera:
https://drive.google.com/drive/folders/12d8Ppf8BwMfcyXRhN1dbUv8gcpeaRmis?usp=sharing

Do you think the ranges in the charts are acceptable or could they be worked on further?
I would like to enable Autotune at the earliest opportunity.

It looks good for a pre-Auto Tune condition. Go for it.

1 Like

Today I performed Autotune for all axes in one go. I am attaching the PID values that were set and the flight log. Unfortunately, during landing the drone overturned due to the high center of gravity and I damaged two propellers, so I will do further tests after receiving the new ones. What do you think about the new values, are they appropriate for this size of drone?

The log of the Auto Tune session is not that useful for post tune analysis. Make another flight, fly around with some significant pith, roll and yaw and then review that. Look at Pitch/Roll attitude Actual vs Desired and Rate Pitch/Roll actual vs desired and see how it’s doing.
At this point I think you should be able to asses this. Post questions after you have made the attempt.

You are absolutely right, I will perform and publish a test flight as soon as I replace the two propellers that I damaged during landing.
What do you think about setting the FLTT parameter to 0 before performing Autotune? Here is a link to the topic:

Another thing is, shouldn’t the Rate Roll and Rate Pitch parameters be the same? After all, my drone is symmetrical. You can see a slight difference in these values after Autotune.

That PR does set the filter to 0 during Auto Tune it’s not saying to manually set it. Be careful what you see in PR’s, they are typically not instructions to follow but details of features added or changed.

It’s typical for the Pitch and Roll to be a bit different even if with seemingly symmetrical craft. Do the post tune analysis and compare Pitch to Roll and if one looks better than the other then manually set the worse one to the best one.

1 Like

I understand, I noticed in the manual regarding drone tuning tips, it is written that:

  • As a general rule, for Pitch and Roll, P and I should be equal, and D should be 1/10th P. For Yaw, I should be 1/10th P and D = 0, in most cases.

Do you follow this rule for the D values in Pitch and Roll even though the Autotune results are different?

No. For me Auto Tune is not the end of tuning and in some cases I don’t use it at all. I’m not suggesting that as a strategy but Auto Tune wasn’t what it is now so manual tuning expertise was required.

The PID values it produced for your craft look reasonable to me.

1 Like

Hi, Dave
Please help me with this log, the MP shows that sometime vibe give some alarm, thanks

Please create your own discussion topic.

1 Like

Sorry for the delay, but the winter weather is not good in Poland.
Today I performed a test flight using the slightly rounded values set by autotune, my conclusions are:

Loiter (first start and at the end of the recording)
The drone holds its position flawlessly, the recording shows that it holds the position very well. Stick deflections cause bounce back movements, probably due to too low D values in Pitch and Roll. I did not decide to move the sticks higher because it could affect flight stability.

Althold (mainly in the second start)
I mainly flew in this mode, I did not experience any bounce back behavior. The drone flies perfectly, the feel on the sticks is fantastic, and you can fly it with great confidence.

Link to the recording from the FPV camera and the .bin file:
https://drive.google.com/drive/folders/16MxLdO8HI2oVuJiAfA8GT5NavnspLgYn?usp=sharing

Slightly rounded values:

Drone photo:

  1. What do you think, should I invoke autotune a few more times starting again from the default parameters and compare the values? Should I base it on current values?

  2. I think the Loiter bounce back is caused by the low D values for Pitch and Roll. The instructions suggest that the values should be 1/10 of P and I. Which in my case will be about 0.017 which is almost 4 times higher than it is now.

  3. I constantly see on the vibration chart that the drone has a problem with vibrations on the Z axis, they are much higher than the X and Y axes. Currently, the flight controller (Cube Orange+) is rigidly attached to the bottom plate of the drone with four screws. Overall, the frame is very stiff and there is no play anywhere.

Hello Pawel and people!
I am at the same stage as yours, trying to set the harmonic notch filters with my drone.
Why did you choose throttle based filter (INS_HNTCH_MODE = 1) instead of the dynamic (INS_HNTCH_MODE = 4)?

Thanks!

I like the landing gear with 3 legs - that is the most stable system.
In flight the Z axis vibrations are getting up into a troubling zone at times. X and Y axis are somewhat better, but still not ideal.
It would have been nice to have the batch logging on - with a Cube Orange there is no detriment to leaving these set:

INS_LOG_BAT_MASK,1
INS_LOG_BAT_OPT,4

Definitely set those battery failsafe actions:

BATT_FS_CRT_ACT,1
BATT_FS_LOW_ACT,2

Motors are sometimes hitting minimum, which might not be an issue when you have a payload onboard. You could try setting MOT_SPIN_MIN a fraction lower to 0.11

For Loiter, try these and see what you think:

PSC_POSXY_P,0.5
PSC_VELXY_D,0.25
PSC_VELXY_I,0.5
PSC_VELXY_P,1.0

they are just half of default values, so easy to put back the original values if needed. This will relax the position holding a little, which may reduce Loiter’s sensitive behaviour.
Also give these a test, I always use these values:

LOIT_ACC_MAX,600
LOIT_ANG_MAX,30
LOIT_BRK_ACCEL,300
LOIT_BRK_DELAY,0.3
LOIT_BRK_JERK,300

I couldnt see what else might be causing an issue with Loiter, since AltHold was working so well and PIDs look good and seem to responding as they should. Maybe those vibrations are causing more of an issue than you expect.

1 Like