How to Assess PID Quality

From version 0.9 it can work with ardupilot logs converted to matlab format.

The terms “calm day” and “low wind” are not very intuitive for less experienced users. It would be helpful if we could define specific wind speed ranges for calm day and low wind. This way, we give up quick tuning and autotune once the wind speed exceeds the defined limits.

I have attached a layer of sponge to the barometer, and the flight controller is also fitted with a cover. With these measures in place, will wind still have a significant impact on the barometer?

is it possibilities caused by wind affecting rotor lift?

Naturally, altitude variation is inevitable due to the inherent accuracy limitations of the barometer alone. However, the flight controller performs data fusion and calculation via the EKF. Can this EKF fusion effectively counteract the altitude fluctuations induced by barometer noise?

We fixed and updated Cell G8 as well as the plot’s Data range of the original ArduPilot Wiki Spreadsheet creating this corrected version We imported the data into the spreadsheet and created this graph:

Thanks everyone for your replies. I’ve learned a lot of useful knowledge and practical experience here.

Following the AMC procedures, I tested the motor thrust using a thrust test bench. I input throttle, PWM, voltage, current and thrust data into the spreadsheet in the corrected version of AMC, but the corrected thrust curve failed to generate.

I then imported the same data into the original ArduPilot Wiki Spreadsheet, which successfully generated both the real test thrust and corrected thrust curves. However, I had to set MOT_THST_EXPO = 0.01 to get the corrected thrust to fit my measured thrust data.

According to the official Wiki, the recommended MOT_THST_EXPO value is 0.66 for hobby-grade multicopters with 15-inch propellers.

This makes me wonder if my ESC already provides excellent linear compensation by design, which allows MOT_THST_EXPO = 0.01 to match the measured thrust curve perfectly — or if I made a mistake during the testing and configuration process.

Additionally, I noticed a work-in-progress tool called Thrust Expo in the ArduPilot Web Tool. After entering my throttle percentage, PWM, voltage, current and thrust readings into this tool, I got the same result:

with MOT_THST_EXPO = 0.01, the red reference curve aligns almost perfectly with the blue measured thrust curve.

I would like to ask for your advice:

Does this mean my ESC and motor combination has exceptionally linear thrust response? Or is there an error in my test method?

From what I know, 0.01 is an extremely low and unusual setting for thrust exponent. For T-MOTOR Flame series ESCs, the official recommended MOT_THST_EXPO value is 0.25.

My thrust test bench operates with a PWM range from 1000 to 2000. It only allows a minimum throttle increment of 1%, with the throttle adjustable and recorded once per second.

I set the test to ramp the PWM from 1000 to 2000, increasing the throttle by 1% every second and logging the thrust value at the same interval. As a result, the curve is generated from only 100 data points in total. I’m not sure if this resolution is sufficient and adequate enough.

No. The process described in AMC is precise enough

Yes.

Yes. That is enough. Looks like your powertrain response is extremely linear. But make sure you set the min value so that the non linearity on low pwm values gets cut off.
From the graphs , one can see you did that correctly as well.

Using AMC meant less trial and error and it did save you a lot of time, right?

Thank you for your reply, @amicarlucasamicarlucasamicarlucasamicarlucas. I followed the AMC procedure step by step: completed filter configuration, performed quick tuning, corrected the compass via MAGfit, then ran quick tuning a second time. Afterwards, in near windless conditions, I completed auto-tuning in the sequence: Roll – Pitch – Yaw – Yaw Damping. I then re-ran auto-tuning for the Roll and Pitch axes again.

I noticed the Rate PID values dropped significantly: the Rate P was around 0.15 after quick tuning, and fell to roughly 0.07 after full auto-tuning. Meanwhile, all Stabilized P values increased noticeably, rising from the default 4.5 to approximately 12. Clearly, auto-tuning delivered obvious improvements.

I have a few questions:

First, is it normal for the angular-rate loop PID values to become lower after auto-tuning compared to the values obtained from quick tuning?

Second, I have attached screenshots of my logs. AMC indicates that ROUT and POUT should stay below 0.1. Currently, they remain within 0.1 during hovering in ALT HOLD mode, but exceed 0.1 when rolling left and right with stick inputs. Is this normal? If not, could you help analyze the causes?

In particular, as can be seen from the graphs above, RATE.POUT does not fluctuate centered around zero. What issue does this indicate, and does it pose any flight safety risks?

Third, in Stabilized and ALT HOLD modes, the aircraft feels very responsive to transmitter inputs. From the PID Review graphs, the step response curve fits the ideal target perfectly. However, I would like to confirm whether the settling time, peak time and rise time meet the requirements.

This is a 15-inch quadcopter with a takeoff weight of 5.5 kg, equipped with 4320 brushless motors (380 KV). The AMC tuning workflow works extremely well. As I still have limited tuning experience, I would like to evaluate the overall quality of my current PID tuning results and confirm whether further adjustments are needed to optimize flight performance.

My filtering performance is decent overall, with most noise attenuated below -50 dB. After enabling the multi-source mode, I followed tutorials from YouTube which state that the bandwidth should be set to one-quarter of the notch filter’s center frequency. However, when I configure the bandwidth to this value, the corresponding peak cannot be attenuated below -50 dB. I am unsure whether a larger bandwidth introduces higher latency and further impacts PID performance.

It’s strange that there is no data displayed in the Frequency Response of Filters this time, while it worked properly before.

Most likely there is only enough data for a single window. Check if your dropping log messages.

Calm - wind less than 5 knots, by definition.

More specifically, you want a steady state condition where the wind/turbulence aren’t causing hover disturbances, and the magnitude is such that you can either maintain periods of uninterrupted autotune twitches in alt hold without touching the controls (this depends on how large an area you have), or in loiter, where there is similarly little interruption in twitches causing re-measurement of the same magnitude.

To be blunt, if you’re incapable of deducing that, this may not be the hobby for you.

Thanks Yuri! Just wanted to mention that your MagFit script works amazingly well for flying figure-8s. I’ve successfully flown figure-8 maneuvers with it, and the tuning results are far better than manual tuning.

I ran the autotune in very light wind, around 2 m/s. It’s nearly impossible to get completely interruption-free corrections during autotune, though the wind interference is pretty minimal, so I believe the results are still sufficient.

My current goal is to maximize the aircraft stability as much as possible. I’ve run into plenty of issues along the way, and I really appreciate everyone’s guidance. This passion has kept me going with this hobby for a full decade, and it’s what keeps me motivated.

1 Like

I’ll give it another try next time. Thanks, Peter.Currently, only Firefox can handle large log files properly, and the Filter Review Tool loads very slowly. All other ArduPilot tools are working fine.

It is not normal, but it can happen when there is sensor noise. See the generated tuning_report.csv file for information how the PIDs changed in each tuning step.

No, that is all fine.

In the picture all looks fine. Post a picture of the results of a narrower bandwidth.

I still cannot locate the tuning_report.csv file for the time being. I am currently following the steps from the guide How to methodically tune any ArduCopter to complete the parameter tuning. Since I am not yet familiar with the AMC tuning tool, I only referred to the basic procedures this time. I plan to fully use the AMC software for PID tuning on my next aircraft.

Could it be that there was not enough wind during the quick tuning phase, causing the quickly tuned PID values to become too high? Then, when switching to auto-tune mode with very low wind conditions, the auto-tune routine reduced the PID gains back to normal levels.

Tomorrow I will lower the filter bandwidth and test the performance again.

Thank you.

tuning_report.csv gets automatically generated by AMC.

Highlly unlikly.

Why not use it on this aircraft? It imports values from a configured FC

Thanks. I’ll try importing the flight controller into AMC tomorrow. I’ve already completed all the previous setup steps. After importing the flight controller parameters, can I just proceed directly with the subsequent steps without starting over? I was worried that my previously tuned parameters would be overwritten.

AMC does a backup of all parameters every time the AMC starts. It does not delete previous backups. So you’re safe.
When you select “normal” GUI complexity, you are allowed to jump directly to whatever step you want.
It will overwrite incorrect parameter values, but it will clearly show you which ones it changes

From your link, I see that AMC allows you to directly create a vehicle project from a .bin log file. However, this option is missing in my version of AMC. Was this feature removed in a recent update? This function is really convenient when I don’t have the flight controller on hand. thank you !

This is the latest version just downloaded from GitHub.There is no option to create a vehicle from a .bin log file in this latest GitHub build.

Due to persistent poor weather conditions, I have not been able to perform a new auto-tune to generate the tuning_report.csv file.

The link below shows my previous auto-tune process. I have tried generating the tuning report directly in AMC, but the software cannot export the tuning_report.csv.

I have uploaded these two related files. If you have time, could you please check whether it is possible to generate the tuning_report.csv from them and review my tuning process?

Thank you very much for your continuous help and support.@amilcarlucas

auto-tune process

The last link is the flight test log recorded after the auto-tune. If you have time, you can also take a look at it.

auto-tune result test

1 Like

That feature is only present in the development (not yet released, not yet stable) version of the software.

You did downloaded the latest stable version, but you did not downloaded the latest development version :wink:

No, you can not. That file can only be correctly generated by users that correctly use AMC from the very beginning and follow instructions.

Forget about that file for now. Be patient, wait for a low wind day and perform an Autotune correctly.

Your settings looks overfiltered, this gives unnecessary delay, BW and ATT with Multi-source need to be 1/4 of filtering frequency, which is also set too high. 2nd harmonic is unnecessary.

1 Like