Autotune activated by flightmode (SOLVED)

First initial preparations to be done :slight_smile:

I have setup a 3pos switch: (1)Stab, (2)Alt Hold and (3)Autotune.
So I have set the third pos of the switch as a flight mode to activate AutoTune.

Plan to do following:
Start up in (1)Stab and climb to about 10m, then activate (2)Alt Hold. Rotate against low wind.
Activate (3)Autotune. After Autotune is finished activate flightmode (2)Alt Hold. Then again activate flightmode (3)Autotune and land manual in flightmode (3)Autotune. To SAVE new PIDs from Autotune session Disarm now.
If I prefer NOT to save new PIDs: activate flightmode (1)Stab or (2)Alt Hold before Disarm.

Will this way work?

Yes. It’s pretty simple; if it’s in Auto Tune from either a flight mode or a RC function when it’s disarmed the PID’s will be saved. Any other flight mode they will not. Any switching from either source will override the current mode.

Tnx Dave, I did some initial setup and tested AltHold yesterday. I am bit unsure about the battery capacity so I will do 1 by 1, starting with roll.
I am unsure about what INS_ to activate. This old Pixhawk from HK is now with -IMb FirmWare.
I have activated: INS_LOG_BAT_MASK = 1
Should I also activate other stuff like INS_HNTCH_MON = 1 or just wait and se until after AutoTune?
Tnx again and have a nice evening!

I’m not clear on what you are asking. The Dynamic Notch Filter should be configured before you run Auto Tune so enabling INS_LOG_BAT_MASK is good to collect data for that. Then make a short Hover flight and review that log to configure the filter. Then make another flight setting the logging option to post filter and review that log to see if the filter is doing its job. Then think about running Auto Tune.

Tnx, good you stopped me before AutoTune.
Sorry Misspelled, my bad. INS_HNTCH_MON should be INS_HNTCH_MODE.
Ok, so I will take a Hoover test, but might need help to review log and conf. filter.
I will post the logfile here in some days, asking for your help again :slight_smile:
Tnx a lot

Hi Dave, I managed to take a hoover flight today. I dont understand the log, could you please have a look and help me with next step as suggested above? MP LOGS - Google Drive

Regards Espen

Hi Espen-OK, so this is the data we will use to configure the Dynamic Notch Filter:

The 1st peak (1st harmonic in Arducopters terms) is at 116Hz and there is one harmonic of that peak (2nd harmonic). You will use Throttle referenced Notch and your MOT_THST_HOVER value is .401.
So, set these parameters:
INS_HNTCH_ENABLE,1 (then refresh the parameters)

Then set this to 2 and make another hover flight for review to see if the filter is working:

So fast man! Its night here in Norway now 01. I hope for calm wind tomorrow and I will setup and test. :slight_smile:
Thanks for helping me Dave

A bit windy, but I managed a short flight. It seemed to hold height with alt h. Please have a look and guide to next step.

Success! These results are very good. Compare the Y-axis magnitude to the pre-filter data graph posted:

FFT post filter

You are ready to run Auto Tune.

OK, Thanks a lot Dave!
Do I need to test Loiter or other first? I have never done Loiter or Land or RTL with this drone. Another question: I see that when MOT_THST_HOVER changes I re-never update the PSC_ACCZ_I 2*MOT_THST_HOVER, should this be updated? Regards Espen

Last question before AutoTune: Is the logging to be like its now or shall I switch on/off something?

It would be a good idea to test RTL.

It’s a good question but you will be chasing this all the time as the Hover value floats around. So, it’s OK just to use the value from a simple Hover flight and then forget about it. If the thrust/weight changes for some reason; different battery, props, weight, etc, then you would change it.

Now that the Notch filter is set you can disable batch logging by setting INS_BAT_MASK back to 0. You can set the option back to 0 from 2 also.

Nice work so far, the methodical approach is best!! Time consuming yes, but worth it.

Then I adjusted following:
Tnx again, I will come back with result after Autotune. Happy flying weekend folks! :slight_smile:

Too much wind today for AutoTune. Tested Loiter and Land, both function very well. :slight_smile:

1 Like

Run Autotune Roll axis today, worked fine.


1 Like

I did the Autotune Roll&Pitch for my Tali H500 today. Afterwards before land I tested Roll&Pitch and they where working fine. Tnx a lot for help so far!
I did not meet this dronekiller!

Here you find my Parameter and log files, Please comment
Regards Espen

I only looked at the flight log dated August 10. You changed flight modes before disarming so the new parameters from the auto tune were not saved. The new settings are in the messages however so you can still manually extract them and enter them in.

I check that log and autotune wasn’t in correct state before disarming to save calculated values.
That’s my last Autotune params:

Now it looks much more simmilar to Yours. So maybe that little different motors didn’t change that much at all as the rest is almost same.
I think if You want you can use my values as base for your axis autotune to make it faster. Maybe even all one in time?

Tnx for info. Have 3 Flightmodes on a switch, Stab, AltH and AutoT. I was unsure if I managed to save. I did following after AutoT finished. From ATune back to AltH, then back to Stabilize. Landed in Stab mode, (noticed some chime sound), then I switched to AltH, Then I switched to AutoT, then I disarmed
Ayway, I cannot find out howto extract the new settings from messages. Do you know howto do this? I dont have Mathlab if thats needed. Tried to pan/zoom on the messages but could not manage.

Can you also tell me where you / how you saw that data was not saved? I noticed that upfront when I copy over the data from Roll the values where shown rounded with 3decimal in Pitch column I think. Then after Autotune both Roll and Pitch show up with 5 decimals.
Regards Espen