New Tuning Instructions Wiki Page

Good work, is possible update to 42 inch propeller?
and what suggestion can you give me for a heavy quad with u15II motors with 42 prop inch with 12s

PD: im not using the power module for the measure of the motors, i just put directly battery to the motors and power the pixhawk with 3s battery

This brings up a point about the Mission Planner Initial Parameters Plug-In (Alt>A Menu). For large props the calculated values for ATC_ACCEL_P/R are not appropriate. I suppose due to the Poly function used in the calculation. For example beyond ~37.5" these go to zero. Where it starts going wonky I donā€™t know. And perhaps the Rate filter values are not right. Just conjecture on my parts as I donā€™t have a craft this large.

Not measuring the 12S motor voltage, renders the PID gain scaling unusable. I`m not sure how tunable the copter will be without that.

what kind of power module can you recommend me, around 400a

Something like this: https://www.mauch-electronic.com/apps/webstore/products/show/6626809
or https://www.mauch-electronic.com/pl-2x-200a-pdb
But even more important than current is voltage!!! You need to measure the 12S voltage

im goin to look that,
ĀæCan you please explain to me how the voltage reading influences the quad PIDs?

It only effects the Motor Thrust scaling not the PIDā€™s
MOT_BAT_VOLT_MAX
MOT_BAT_VOLT_MIN
MOT_THST_EXPO

https://ardupilot.org/copter/docs/current-limiting-and-voltage-scaling.html

and it is an important part of: https://ardupilot.org/copter/docs/tuning-process-instructions.html#tuning-process-instructions

Read both links carefuly

Yeah the formulas are basic and dont extrapolate well to those large prop sizes due to lack of testing/data, probably use values for 30 inch props, except for MOT_THST_EXPO which may have to go up to 0.85 or so for props over 30 inches.

Right but the user parameters that are referenced based on Voltage in the Tuning Guide are the Motor Thrust Scaling parameters. Everything else is prop size referenced. That was my point as the thread is for the Tuning Instruction Page.

Yeah, I was just replying about this reallyā€¦

Yea, I get that. They probably shouldnā€™t attempt to extrapolate beyond a known data point. The 40" case producing negative ATC_ACCELL values and probably filter settings too low is an example. I wonder even about the 30" case with rate filters at 8.5Hz.

But man for the numerous 4" to 14" craft that I have built itā€™s excellent :grinning:

Yes - we need better data and real-world examples to refine the formulas. Or just say that beyond a certain size you NEED to manually tune as per the guide and dont assume some calculated values will be OK - weā€™re talking props that could easily be over $100 each - so a quick ā€œplug in some values and flyā€ is not appropriate for safety or the hip pocket.

Iā€™ve been doing more testing lately, and studying other peoples logs too and this has served to validate the Tuning Guide provided by @Leonardthall, and the formulas for setting initial values. Iā€™ve seen a lot of examples lately of multirotors that seem to be resisting attempts at better tuning

For the purposes of discussion here, Iā€™m going to ignore those cases where people have neglected to read the documentation and Tuning Guide, and quite often havenā€™t even set the most basic parameters to suit their aircraft.
I want to summarise the initial tuning process and issues Iā€™ve seen. Itā€™s not my intention to regurgitate the Tuning Guide. We assume all the mandatory setup and calibrations are done.

The Situation
The spreadsheet, MissionPlanner plug-in (thanks @Eosbandi) and Tuning guide all recommend setting INS_GYRO_FILTER=20 at least initially. Because the documentation says to lower this (and to lower INS_ACCEL_FILTER) to combat vibrations, of course thatā€™s what we end up doing in a lot of cases.
This leads to other filter valuesā€¦
ATC_RAT_PIT_FLTD
ATC_RAT_PIT_FLTT
ATC_RAT_RLL_FLTD
ATC_RAT_RLL_FLTT
ATC_RAT_YAW_FLTT
ā€¦being set too low, even though they are still half of INS_GYRO_FILTER as per the doco.

The Effect

  • The multirotor has poor attitude control and pitch/roll do not track desired pitch/roll well
  • Autotune lowers PIDs and barely makes a difference compared to the starting point
  • Manually changing PIDs even has limited effect (within reason)

Assuming you got past the wobbles and lowing the PIDs a bit, attitude control still looks like this even after Autotune and you cant seem to get it better


You can see small movements that the flight controller doesnā€™t seem to be able to compensate for. These very small movements in pitch, roll and yaw can even be visible.

Mistake
The mistake is three fold.

  1. Not doing enough to eliminate vibrations.
  2. Leaving INS_GYRO_FILTER=20 or going lower when itā€™s not warranted (and see associated FLT* settings too), usually because we undervalued the first point - vibrations.
  3. Expecting all the software and settings to do the hard work of eliminating the vibrations for us -> well yes it tries to, but go back to the first point and try more to eliminate vibrations and other physical issues!

I definitely want to emphasise the importance of anything you can do to eliminate vibrations.

  • On vibrations the documentation says:
    • Vibration levels below 30m/s/s are normally acceptable. Levels above 30m/s/s may have problems and levels above 60m/s/s nearly always have problems with position or altitude hold
  • That tends to lead us into a false sense of security, seeing our vibrations always in the 15 to 30 range.
  • I think we could revise that to:
    • vibrations over 15m/s/s should be avoided at all costs.
  • Time spent fixing vibrations will be rewarded by less tuning time and a better tuning result.

Also these filters can easily be set too low and it starts to affect attitude control. Probably a value of 12 should be considered a minimum. Data and thoughts welcome.
ATC_RAT_PIT_FLTD
ATC_RAT_PIT_FLTT
ATC_RAT_RLL_FLTD
ATC_RAT_RLL_FLTT
ATC_RAT_YAW_FLTT
As you increase INS_GYRO_FILTER above 20, if possible, then keep FLT* values increasing at INS_GYRO_FILTER/2 (as per the Guide)

The Fix

  • Eliminate vibrations as much as possible within the first couple of test flights so you donā€™t waste time endlessly tuning without achieving desired results.
  • Set INS_GYRO_FILTER and itā€™s associated FLT* parameters as per the Tuning Guide/spreadsheet/MP plug-in. Set INS_GYRO_FILTER=20 or slightly lower if this value really is correct for your multirotor, but otherwise avoid going too low.
  • Implement BLHeli telemetry if possible - this makes the Harmonic Notch filter so much easier to set up.
  • Configure the Harmonic Notch filter (thanks @andyp1per) as soon as possible, this will aid tuning and Autotune.

Of course smaller multirotors, say prop size 10 inches or less, probably need to start tuning with the calculated value of INS_GYRO_FILTER from the outset.
Larger craft can use INS_GYRO_FILTER=20 for initial test flights - gathering logs and checking vibrations, stability and so on. If the Tuning Guide and spreadsheet suggest a different value for INS_GYRO_FILTER then use it once the aircraft is flyable.

INS_GYRO_FILTER and itā€™s associated FLT* parameters are there to filter out noise, setting them too low filters out actual frame movement.

The Summary

  • Do Not skip any configuration and tuning steps
  • Eliminate vibrations
  • Set INS_GYRO_FILTER and itā€™s associated FLT* parameters as high as practical for your multirotor - dont get trapped into continually lowering them when thereā€™s probably a physical issue to be fixed
  • Aside from physical or electrical issues, you multirotor should fly reasonably without changing PIDs too much

As always, please respond with your own thoughts, data and corrections.
There could be some work to be done around defining lower limits for the filters, and I could adjust the spreadsheet formulas to match. We might need a bit more data for larger prop sizes to support that.

7 Likes

This is correct, the only thing I would add is that its possible to smoke your motors by setting these too high when there is a lot of noise so its important to verify that increasing doesnā€™t cause your motors to get hot (a 5s hover is usually sufficient to verify this).

Hi @xfacta,

Great summary, could not have said it better myself. I find myself saying ā€œread through the tuning process and cross out each line as you do itā€ to try to get people to do each step.

When I do this I set up the harmonic notch at the first opportunity. So as soon as the aircraft can safely hover.

I do not recommend lowering the gyro filter below 20 Hz, making the D term filters no less than 10 Hz (20/10 tune). I generally only go this low for large aircraft struggling with noise. I like to have a 30/15 or 40/20 tune.

For the controllers we are not so interested in the VIBE message but the noise on the output of the rate loops. The rule of thumb I use is 20% hover throttle is as high as I tolerate before I expect the tune to be obviously limited by noise. Less than 10% tends to be fine. This noise level is dependent on the amount of rotational vibration in the frame, the filter settings and PID settings.

So the VIBE message gives us an idea of the level of vibrations but the only way to measure the level of gyro vibrations is with the batch FFT or setting the logging to attitude_fast and looking at the RATE.out messages.

3 Likes

Iā€™ve adjusted ā€œthe spreadsheetā€ so INS_GYRO_FILTER wonā€™t go below 20, and because of that FLT* values wonā€™t go below 10
Please download a new copy

@Eosbandi are you able to update the MissionPlanner plugin if you have time? Thanks in advance.

You may want to flatten the curve on the ATC_ACCEL_P/R/Y_MAX values in the Plug-in also. Those go to zero with big props. Your .xls addresses that by not accepting them :slight_smile:

Updated the sheet again with new formulas for ATC_ACCEL params so they track closer to Leonards original graphs and give believable values for larger props.
Check it and let me know if anything else needs changing.

Sure, will do this weekend.