Harmonic Notch Feature in Master

I have been following @andyp1per 's Harmonic Notch Filter Pull Request for some time now. This along with the his In-Flight FFT analysis are pretty big steps for ardupilot. This is a significant improvement that will help shield the flight control system from vibrations. For helicopters, the noise in the gyro data is very discrete, occurring at harmonics of the rotor speed. Currently low pass filters are used to suppress these vibrations but are not very effective at frequencies close to the filter frequency. @Leonardthall pushed a notch filter that could be used at a single frequency for Copter 3.6. This was great because you could filter out at least the most offensive frequency (typically the 1/rev (rotor imbalance) or the 2/rev). The harmonic notch takes it a step further. Knowing that the vibrations occur at multiples of the rotor frequency enables multiple notch filters to be set to suppress those vibrations. Andy’s PR will enable up to 3 harmonics to be notch filtered. Before I show some examples of what it can do, I will say that although this filtering does a fantastic job of shielding the flight control system from vibrations, you should strive to reduce vibrations to the lowest level possible using physical vibration attenuation techniques (particularly for FC’s that don’t have internal IMU vibration absorption). It is no excuse for doing a poor job at track and balance of your blades. This can have impacts in other areas like attitude/altitude/position estimation.

So here is a plot showing the vibrations present in my Synergy 626. This shows the frequency of the vibration on the x axis and relative levels of vibration amplitude on the y axis. These are the vibrations prior to any filtering (just looking at raw IMU data).

This is a two bladed rotor system so your largest vibration amplitudes will occur at the 1/rev (rotor speed which for this heli is 25 hz (1500 RPM)) and multiples of the number of rotor blades times the rotor speed. So in this case 2/rev (50 hz), 4/rev (100 hz), 6/rev (150 hz)…

So the next graph is the gyro vibration data post filter with just the single notch filter
So the single notch is doing a good job at suppressing the 1/rev (25 hz). It is still there but a much better. The low pass filters are doing a good job suppressing the higher frequency harmonics (above 150 hz).

I used the harmonic notch to suppress the 2/rev (50 hz) and the 4/rev (100 hz). Here is the plot with the harmonic notch employed.
This is a HUGE improvement in signal quality for the flight controller to use to provide stability and control. You would see the most improvement when looking at the output of your P and D terms of the Rate PID controller. Many times tuning the P and D gains are restricted due to a noisy gyro signal.

So if you are plagued with vibration issues that you can’t seem to resolve through physical means, standby for the first stable release of Copter 4.0. Hopefully we can improve our heli tuning techniques.

Thanks again to @andyp1per and @Leonardthall for the great work here!


It’s not in master yet! Fingers crossed …
It’s in now!


Any chance of making the notch dynamic, in that it could move automatically based on rotor speed measurements?

1 Like

@andyp1per has two other PRs in that look to move the notch dynamically. The first bases the notch center frequency on the throttle position PR. This was mainly designed for Multicopters but could be adapted to helicopters for users that may want to change the ESC governed rotor speed in flight. The other is a PR that performs an FFT real time to adjust the center frequency of the notch. PR I think this one currently just logs the data to prove that real-time FFT’s are possible with our processors.
This one is a little trickier in picking out the 1/rev. I spent time looking at the real-time FFT and it depends on the helicopter as to what frequency it will pick up. I saw it pick up the 2/rev more often than the 1/rev especially if the blades were well balanced.

@bnsgeyer @Rob_Lefebvre credit to @Leonardthall for https://github.com/ArduPilot/ardupilot/pull/12270 - it’s his design, I just did the implementation. https://github.com/ArduPilot/ardupilot/pull/11886 is gradually getting more robust and I am flying with it regularly now to dyamically set the notch frequency. There are some tradeoffs in terms of accuracy vs CPU usage, but it works really well. I have also added a “learning” facility so that it can learn the REF value required by the first PR. When set correctly these marry up really well, which is great as I suspect it’s going to be hard for people to get it right manually.

Good point! I guess I overlooked your question. That certainly would be much easier. If a rotor speed sensor was measuring the 1/rev, then applying the notch is no different than what they are doing but scheduling it according to the throttle channel. In fact @andyp1per, you may consider this for cases where the esc provides motor speed back to the flight controller. @Rob_Lefebvre that would be very easy to implement.

@bnsgeyer yes absolutely - the plan is to use dshot telemetry for multicopters eventually as well. Need to go step by step - first step is to get the dynamic setting in at all!

1 Like

Yep, that’s the case I’m suggesting. If we have rotor speed feedback, use it to set the notch point. 1/rev or 2/rev, yeah, that makes sense. 1/rev would tend to be rotor blade imbalances. But 2/rev would come through from cyclic forces on a 2 blade machine, even if everything is perfectly balanced. This is due to our semi-rigid dampers. Would be 3/rev on a 3 blade head so would require a param I guess.

Yes the vibrations from the aerodynamic cyclic loads come through from the rotating frame to the fixed frame at the number of blades/rev. So 3 bladed rotor would have the vibrations come through at the 3, 6, 9 … /rev. The great thing about the harmonic notch is that you can specify with the bitmask the harmonics you wish to notch. So I would say you use the rotor speed as the notch frequency and then specify which harmonics from there. typically you don’t need to specify more than 4/rev for a two bladed rotor because the low pass filters can attenuate anything above that pretty easily. I’ve seen that the 1/rev, 2/rev and 4/rev are the big hitters for a 2 bladed rotor. the harmonic notch gives you up to 3 different harmonics to specify in the bitmask. those would be the three I would pick.

Looks like the PR to update the harmonic notch dynamically is pretty much ready for merging. I’ll just need to follow up with a PR that allows the use of the RPM measurement.


@Rob_Lefebvre just wanted to let you know that we just merged a PR that enables heli users to tie the harmonic notch to the rpm sensor. It works great! I was able to sneak it in with the one that @andyp1per was doing for multirotors to tie the harmonic notch to the throttle command. Lots of good features going into 4.0.0.


typing more characters so this post will go through…