Unsure how to tune notch filter

Hi

how should we use INS_HNTCH_FM_RAT under 4.3.0 release?

This is an easier way of doing throttle notch scaling you can set it to a value less than one to allow the notch to go below your hover frequency. So 0.8 would be 80% of hover frequency

Still grounded but have changed PSC_ACCZ_I to 0.4 to match my PSC_ACCZ_P which is 0.2.

My MOT_THST_HOVER has been calculated by flying with MOT_HOVER_LEARN and seems to be pretty good.

My MOT_SPIN_MIN of 0.15 is a bit surprising because the vehicle is nowhere near take off when armed and with the throttle stick down. In STABILIZE, which is the most aggressive, it will start lifting off a bit before the centre point of the stick.

I have now set MOT_SPIN_MIN to 0.11 (my MOT_SPIN_ARM is 0.1 and MOT_SPIN_MAX is 0.95).

I do not want to add dummy payload because the vehicle is unlikely to get much heavier for the time being and I would like to have it tuned at this weight.

I have set INS_ACCEL_FILTER to 10.

I have also managed to get RPM readings from the ESCs using the RPM library so might also try RPM based filtering as well in the future.

I will perform some test flights as soon as I can with the settings suggested and report back.

For the safe side you should have 1.5kg*6 arms weight. Your 2211, pitch is higher compared to manufacturer chart, likely more powerful and use higher Ampere. Careful of low rpm vibration.

Do also determine your craft X And Y CG, is the location is where you wanted.

So, here is a new log.

I have followed the instructions of @xfacta and set up the dynamic and static notch. Also, I am lost about this INS_LOG_BAT_OPT. @xfacta wants pre filter, @dkemxr wants post filter and nobody seems to want to explain why logging both is a problem so I set it to 4 to log both. If this is wrong, please someone tell me why.

The flight has a long hovering segment in STABILIZE and then the same on ALT HOLD to establish MOT_THST_HOVER (no surprises, it’s still 0.125).

This is then followed by hard inputs, hard climb and descent as well as full stick roll and pitch. Nothing particularly weird in terms of performance.

Weather permitting, I will soon try out tuning flights.

No. One uses Pre-filter data for one purpose and post filter data for another purpose. The Wiki for this is clear:
Measuring Vibration with IMU Batch sampling
Pre-flight Setup- Option 0.
Post Configuration Confirmation- Option 2

With the option for both set do you know how to interpret this graph from your log?
Gyro opt 4

Neither do I.

Aha! Thank you, this is what I had not understood. I will collect this data asap.

Not sure what you have going on with the Notch Filter Configuration. 2 are configured but it’s not clear to me that you have gotten past the pre-filter analysis to set them. Perhaps you have and I have just missed it. The 2nd Notch isn’t doing anything as configured.

I would still advise adding some dummy payload - motors are going to minimum during some maneuvers and this will be bad for stability when there’s wind or any other disturbances like descending through prop-wash. The motors and props will work best when they are in their mid-range for hover, so there is plenty of scope for increasing AND decreasing RPM.
It’s either that or go down a size or two in props.

I see you’ve got RPM data but unless you can scale it to equal actual RPM then I wouldnt try to use for the HNOTCH. Try RPMx_SCALING of 13.5
Maybe just keep it in place out of interest. Throttle-based HNOTCH works well.

I think the HNOTCH is working fine the way it’s set now, I’d like to see if it changes a bit with some dummy payload - ensure the payload is very secure and can probably be left in place permanently unless you add cameras or something else. You will have to experiment with the weight and check hover PWM in logs until it’s about 1500

You can leave INS_LOG_BAT_OPT,4 since I’ve figured out how to read it.
In the FFT graphs the pre-filter data is in GYR0 and the post-filter data is in GYR3
I wouldnt normally recommend logging both at once due to load on the flight controller but it’s worked OK for you.
Once this is all nailed down be sure to set:
INS_LOG_BAT_MASK,0
INS_LOG_BAT_OPT,0

Try the PIDs I mentioned after you’ve set up the dummy payload and checked the PWM and got a new Hover thrust.

Hi Dave - I think I’ve got a throttle based and a static notch working for Armadillo.
I’ve asked for the HNOTCH2 to be static and I now realise I’ve asked for the params to be set incorrectly

@armadillo can you adjust these please, it wont make a lot of different but will be more technically correct
INS_HNTC2_MODE,0 ← for static
INS_HNTC2_HMNCS,1

Hi Shawn-Yea, the post filter results do look good, I just wasn’t seeing a Static Notch so was wondering what was going on there.

I may be just confusing things here with too many cooks in the kitchen :slight_smile:

Not at all - it’s good having some different view points or at least a seconds set of eyes. It makes me think.
It’s not often we try to set up both dynamic and static notch filters.

1 Like

Right, I haven’t configured a Dynamic and Static notch with the newer fimrware version (HNTCH1 &2). Question though as it’s not entirely clear to me about configuration for the Static notch.
Yes, as you stated. INS_HNTC2_MODE,0 ← for static
Doesn’t the REF parameter also have to be 0 (not 1)? I’m using this as the reference for that assumption:
Set INS_HNTCH_REF = 0 to set the harmonic notch reference value for the static harmonic notch

Good pickup Dave, thanks
so
INS_HNTC2_REF will have to be 0 too

I’m going to have to keep this config somewhere I can reference later!

EDIT
So this should be the final static notch setting (so far)
INS_HNTC2_ENABLE,1
INS_HNTC2_MODE,0
INS_HNTC2_REF,0
INS_HNTC2_FREQ,107
INS_HNTC2_BW,50
INS_HNTC2_ATT,40
INS_HNTC2_HMNCS,1

I think the only mention of the REF parameter for Static Notch is on the Trade Heli notch filter Wiki page which is easy to miss.

Thank you all for your input, it has been a very educational and enjoyable few days.

I tried attaching two different dummy payloads but I was not at all happy with the “secure” bit (let alone the vibrations) and in the end, I did not want to risk a really silly crash caused by something coming loose. I am considering getting heavier batteries but this will not happen for a while.

What I did was implement all the changes for the dynamic and static notch and then axis per axis autotuning. I did not dare do @xfacta 's PIDs directly because I would not have an easily selectable set of PIDs to fall back on whereas with autotune, I can always flick back to Alt Hold with the “safe mode” PIDs.

So, here are some logs:

Flight 1, just a short flight with some big stick inputs and all the filter params set. Log here.

Flight 2, first autotune flight after following these instructions to setting:
ATC_RAT_RLL_FLTT 10
ATC_RAT_RLL_FLTD 10
ATC_RAT_PIT_FLTT 10
ATC_RAT_PIT_FLTD 10

and aggressiveness to AUTOTUNE_AGGR 0.075 (medium), tuning for roll, log here.

Third flight was tuning for pitch but failed because I kept manually nudging it so I got the pitch to tune on the fourth flight, log here.

Finally, fifth flight tuned for yaw, log here.

There was nothing particularly interesting visually during the flights, it generally did what is was supposed to and the weather was perfect for tuning, almost zero wind.

Logs of the actual Auto Tune flights are not that useful unless they didn’t complete and you want to try to extract some info. At least from a Tuning Analysis standpoint that is. You want to make a flight now similar to what you are calling Flight 1 where you did some general flying around with as aggressive action as you feel comfortable doing.

Note: With an aggression of .075 PID tuning can be quite mild on some craft and I think that happened here but we’ll see comparing pre and post auto tune flights. Opinions differ on this and certainly the size of the craft is a big factor.