new FFT Filter setup and review web tool

I’ve tried these settings with not much improvement

I’ve also made a separate thread with the recent logs

1 Like

Had another copter that went from this pre-filter

image

to this post-filter

image

You can’t get much better than that!

And this was a reasonably large multirotor of a type that has proved difficult to tune in the past.
We were able to carefully select the harmonics thanks to the Filter Review Tool, and we also had the advantage of using ESC RPM data so that made it easy. We set a per-motor dynamic notch.
We were also able to increase the INS_GYRO_FILTER above the calculated value based on prop size - this is possible using the old methods (MP FFT graphs), but the filter review lets us view the expected results and tie that in with any other HNOTCH changes to give a total result.

4 Likes

Pushed a few more updates and bug fixes in the last couple of days. There is now a “open in filter tool” button right at the bottom.

This opens the current set of filters in the filter tool so you can see the none averaged bode plot.

In the filter tool itself there is also now a “Show individual filters” check box. This shows the individual filter components so you can see which filter is contributing the most at each frequency.

3 Likes

Excellent - thanks Pete. I like the additional tools!
I’ve been using the Filter Review Tool extensively, now I’ve got more to play with :slight_smile:

…and the PID section - I assume that is about how the PIDs will be affected by the filters.

I’ve noticed there is some logs that have the batch logging settings but wont open in the filter review tool, but they will open in the MissionPlanner FFT graphing tool. So far I cant pic the difference between logs that work and logs that dont :frowning:
INS_LOG_BAT_MASK,1
INS_LOG_BAT_OPT,4

1 Like

If you can send me any logs that don’t work I’ll take a look.

The PID bit is more just because its interesting, not a huge amount of practical use at this stage. You can see which gains are doing the most at each frequency. It confirms those rules of thumb of manual tuning. High frequency oscillation is too much D, middle is P and very low is too much I. You can use it to trade off between say the D filter and the D gain. Lower filter means you can have more gain ect.

1 Like

Hey @iampete, I saw on this forum, that you were able to integrate AirSim and SITL using WSL2. I am currently integrating these two programs together and following the instructions posted by @rajat2004 on the forum post but I keep getting the error “[Errno 111] Connection refused sleeping” whenever I follow the steps. I was hoping you could help me figure what is wrong.

I also apologize for this not being another topic thread.

1 Like

Hello Peter! I continued to work on eliminating the effects of vibration using Dynamic Harmonic Notch Filters with an internal combustion engine with RPM sensor. It was hard to figure out how to install an RPM sensor on a nitro ICE - OSMAX FS62V , but I managed to install two magnets on the propeller support sleeve. I now have the opportunity to doing this section of the RPM Sensor Based Dynamic Notch Setup for my Durandal

I did the tests and posted their results at this link I need to apply Dynamic Harmonic Notch Filters to two IMUs - ArduPlane / Plane 4.3 - ArduPilot Discourse

Thank you for your development of the tool Ardupilot Filter Review Tool.

I got the result of my test and applied it on your instrument, here is its view in the picture.

I would like to get a better result from applying filters. I tried changing the parameters in the TOOL : INS_HNTCH_FREQ and INS_HNTCH_BW , but it does not give a noticeable result.

I would like to get recommendations from you on how to improve the result of filters.

I have files from my tests, if they are required for your answer, how can I transfer them over the Internet?

Thank you for your attention to my problems!

1 Like

Don’t post results, post the .bin log file. The 1st thing I would do is change the amplitude scaling to linear.

1 Like

https://drive.google.com/drive/folders/1PCVvNV7vHEXV6Bwqe__-m08TylzXtSf0?usp=sharing

1 Like

I did 4 tests, there are files from each IMU.

1 Like

I looked at the first and largest log.
The notch filter as configured was completely missing the noise.

So I checked a few things without going over your results, just so my review is independent and maybe we will come up with totally different results.

It’s like the RPM value is almost double 50% more than what it should be, based on the frequencies we are seeing logged.
Average RPM from some of the steady sections of log is ~5500 RPM = 60 Hz
Where as RPM should be reading as 2800RPM = 46Hz based on the noise we see.

I would change:

RPM1_SCALING,0.254
INS_HNTCH_FREQ,30
INS_HNTCH_BW,15

You might be able to better calculate that RPM scaling factor based on the physical sensor properties and placement, like 0.25 might be more accurate and make more sense.
The Freq and BW will scale up with RPM once the RPM reading is correct, so setting them lower than the lowest frequency peak is the correct thing to do.

See what you think and what you can come up with, and let’s see another log.

1 Like

Hello, Shawn! Thank you for your quick response! The parameter RPM1_SCALING was set correctly, for two rotating magnets this value is 0.5. To check the rpm, I used a tachometer, the engine worked in the rev range from 2500 to 9300 rpm with a 12x8 propeller. This is a heavy propeller for this engine, so on the ground the speed is no more than 9300 rpm. When the plane is flying, the propeller runs up to 11000 rpm.



OK, so you are saying the actual (externally) measured RPM is the same as the RPM logged in Ardupilot with RPM1_SCALING,0.5 ?
Is your tachometer measuring actual RPM or blade passes (double RPM for two blades) ?

Therefore I think for the harmonic notch filter to use that correctly you would have to set:
INS_HNTCH_REF,0.5 (in fact 0.4 is closer to correct → see below) to halve the frequency that HNOTCH is currently thinking it should work at.

https://ardupilot.org/copter/docs/parameters.html#ins-hntch-ref-harmonic-notch-filter-reference-value

If you use these parameters the harmonic notch filter should work, but it would be better to see a log of actual flight.

INS_HNTCH_REF,0.4
INS_HNTCH_FREQ,42
INS_HNTCH_BW,25
INS_HNTCH_HMNCS,7

1 Like

The tachometer showed the actual speed of revolutions, this coincides with the measurements of the Ardupilot RPM1. The tachometer measures two pulses per revolution of the propeller and scales a factor of 0.5. The speed sensor measures two pulses per revolution and scales RPM1_SCALING = 0.5.

INS_HNTCH_REF and/or INS_HNTC2_REF = 1 to set the harmonic notch reference value to unscaled, unless the RPM sensor is reporting a fraction of the actual rotor speed. This might occur in a geared drive train setup. If the reported RPM is 1/3 the actual, for example, set this to 0.33. RPM Sensor Based Dynamic Notch Setup — Plane documentation (ardupilot.org)

This might occur in a geared drive train setup. This is not in my case, because the propeller rotates directly on the motor shaft

INS_HNTCH_REF this parameter, as I understood from the manual, is used if a gearbox is installed between the propeller and the motor, and for filtration it is necessary to measure the rotor speed

There is no working area on the graph in the selected rectangle, I think this will not affect the flight of the aircraft, because the operating frequency is 5400-6000 rpm, which corresponds to the cruise speed of the flight


This is the cruising speed, THR 64%

1 Like

Have you got a log of that flight with the HNOTCH batch data?

What’s causing the confusion is the logs provided and analysed by both of us is NOT with the plane actually flying.
Also keep in mind that when using RPM as the input to HNOTCH, the notch frequency will scale up with the RPM, so I was still thinking my points stand because the notch is not where the noise is, and there’s almost no noise where the notch was ending up. The noise frequency found in the logs doesnt seem to be matching what the expected RPM should be - and an actual flight could probably clear all this up.
In my graphs, the notches would scale up in frequency with RPM, so it shouldnt matter if it’s only starting or warming-up RPM. I would say if the notch cant track the RPM at a low value, then how can we expect it to find and track the higher RPM?

EDIT
What I’m getting at, until we have further info, is the HNOTCH should target the noise regardless of the actual RPM, and we do that by INS_HNTCH_REF,0.4 and some other values. The actual RPM should still scale up the notch filter to suit as RPM changes.

1 Like

Hello, Shawn! I agree that a real-world flight could probably clarify all of this, which was supposed to be in improving the performance of filters. Now this cannot be done, because flights are prohibited due to the migration of rare birds. Let’s be patient and then not a single animal will suffer from our experiments to improve the performance of filters.
What do you say if you apply only the fundamental harmonic? I can see from the graphs that this reduces the phase delay, it will improve the control loop without degrading the filtering result.

I made a comparison of different aircraft on the VIBE tab. For comparison, I chose two aircraft with an electric motor. XENO is a well-known aircraft from the manufacturer Multiplex. Another aircraft is the same TRAINER, only with an electric engine. As you can see from the VIBE tab, the vibration levels are similar to the result obtained on an aircraft with an internal combustion engine.

This gives confidence that the aircraft with ICE will fly like an electric aircraft. The first flight of the aircraft with ICE was not ideal because no measures were taken to reduce the effects of vibration, so I expect a noticeable improvement in flight performance for automatic mode



When I used the tool, I noticed an error, this is shown in the figure:

1 Like

Yes the HMNCS bitmask text is a bit misleading - the text on the left half of you pic is more correct than the text when selecting the bitmask in MissionPlanner.
It should be " Fundamental, 1st Harmonic, 2nd Harmonic…" because that is the result produced by the bit selections.

Yeah happy to wait until the ICE Plane can be tested properly. I’m curious about all this discussion.

EDIT:
My description

Is clearly wrong judging by the discussion below, I wasnt thinking well enough at the time:)
and I defer to Dave and Pete. As Pete says, the filters work as expected based on the bitmask, regardless of how we label things.

1 Like

What do Fundamental and 1st Harmonic mean? There is no concept of Fundamental in the parameter list.