Tuning questions from Andy Piper's excellent tuning presentation in the 2022 DEV conference

This morning I watched the tuning presentation by @andyp1per from the 2022 DEV conference.

This excellent presentation has made me think of many questions - here are four:

  1. Andy notes that AutoTune doesn’t change the Yaw D value - it leaves it at zero. He suggests a method of setting it. He then notes that performing a subsequent AutoTune after setting the new Yaw D value will be improved.

My question is, why doesn’t AutoTune set the Yaw D value already?

  1. Andy comments on repeating AutoTune - as a method of getting better and better tunes.

My question is, how do we know when to stop repeating AutoTune?

  1. Andy notes the necessity of setting the notch filter (FFT or otherwise) before doing an AutoTune. The sequence that the wiki presents the tuning steps has setting the notch filter after the steps for AutoTune.

My question is, am I perhaps misreading the wiki - are the steps presented in the proper order that I missed somewhere?

  1. Andy’s presentation is focused on tuning an FPV quad that will be hand flown for cinematography.

My question is, how does the extra effort Andy describes in getting the best possible tune affect a copter being flown on missions on Auto?

As reference - here a link to Andy’s presentation: Dev Conf 2022 Andy Piper Tuning For Performance and Chasing Trucks in the Desert - YouTube

Many thanks!

My question is, why doesn’t AutoTune set the Yaw D value already?

Autotune tunes FLTE on Yaw which is a way of tuning the mechnical D provided by the motor bells

My question is, how do we know when to stop repeating AutoTune?

When your PIDs largely stop changing. The point here is that the axes have coupling so a better tune on one leads to better tune on others

My question is, am I perhaps misreading the wiki - are the steps presented in the proper order that I missed somewhere?

Tuning — Copter documentation the ordering could probably be improved a little

My question is, how does the extra effort Andy describes in getting the best possible tune affect a copter being flown on missions on Auto?

A good tune will eliminate oscillation and give better stability, control and disturbance rejection. So maybe not so important in ideal conditions, but the conditions are never ideal

3 Likes

Also when you have the tuning really good, that is like a known baseline. In subsequent flights and over time you’ll be able to see in logs if there’s any differences creeping in.

1 Like

Hi Andy!

I also recently watched that video of yours. It was very helpful and added a lot of knowledge for me!

When you say that the yaw FLTE works as tuning for the mechanical D value, if I were to tune it myself to improve yaw, how would I do that?

Will increasing it do the same thing as increasing the D term?

Thanks!

Andy’s presentation describes how to manually configure the D value for yaw.

Thanks @andyp1per -

I understood from your presentation that autotune adjusts FLTE.

My question however is if your technique of adjusting the yaw D value manually, instead of leaving it at 0, enables autotune to do a better tune - why doesn’t autotune go ahead and include the yaw D value?

I’ll have a go at answering this, but @Leonardthall is the expert and might butt in to tell me I’m wrong if we are lucky.

In any PID control loop you are controlling for error - P applies an input proportional to the error (angle or rate) to correct the error. For roll and pitch these inputs have a delayed effect - mechanically increasing P on roll means increasing the motor RPM which turn the propeller which leads to thrust which leads to angular acceleration which leads to a reduction in the angular error. This process all takes time - an increase in P will only be measurable as a change in the error some time later, by which time you might have applied too much P and get overshoot. This is where D comes in - D dampens the effect of P by proving a counter input proportional to the rate of change of the error. So if the error is changing very quickly, D kicks in to dampen the rate of change and prevent overshoot. When you tune roll you are doing a complicated dance involving the physical response of the aircraft as well as the motor performance etc to get the perfect mix of enough input, damped enough.

Yaw is different - at least initially. When you apply P to yaw the motors accelerate and you get an instantaneous input due to the angular acceleration of the motor bells. Once the motor bells have spun up to speed, the effect is gone, but for small values of P it’s very significant. Also, the mass of the motor bells serve to physically damp the input - mechanical D. Since this D term is effectively fixed, you instead want to tune the rate at which the error is allowed to affect P - FLTE. So this is what autotune does. However, once you are past the motor bell windup period your are then relying on propeller drag and the differential rates between props to produce yaw. This input acts much more like roll and pitch and thus can use a regular D tune for optimal performance.

3 Likes

Thanks @andyp1per for taking a stab at this.

Not knowing what anyone’s background might be, it’s tough to tailor a response. Well done.

I’m not sure I phrased my question well. I appreciate knowing what autotune does do for yaw. But as you describe in your presentation about the Chimera7, improvements to the tune of yaw can be made by dialing in the correct D term - instead of leaving it at zero. And you note that this has the additional benefit of improving autotune’s ability to tune pitch and roll on subsequent autotunes.

So my question is if this is better - why doesn’t autotune do it?

Off the cuff I can think of dozens of possible reasons - but I’d appreciate knowing for sure.

Besides just the general curiosity - it might help me decide if I want to make the effort to do the manual D term tuning procedure myself.

BTW - I’ve got a couple of Chimera7’s on my shelf. I’ve always wanted to install ArduPilot on them.

In the past, tuning FLTE was enough. You would have to tune FLTE and then tune D adding more complexity to autotune

OK - thanks. Sounds like it just didn’t meet the cost-benefit threshold.

Thanks!

That’s a great explanation of the D term. Could I ask you one more question,

I’m in the process of tuning an 18 inch quad. Autotune didn’t work that well so I need to tune it manually a bit. I’m kind of sure about what to do with the D and P term. But the I term I haven’t found a lot about. Could the I term cause overshoot in a rate controller or overshoot in pitch/roll in comparison to the desired?

Thanks!

No, I-term is there to address steady-state errors. If you just set I==P you should be fine

1 Like