How to methodically configure and tune any ArduCopter

Here is an overview of the tuned PID controllers:

PID controller Intermediate parameter file(s) used to configure and tune it
Position Z acceleration 18_throttle_controller.param
Roll rate 24_autotune_roll_results.param, 32_autotune_roll_pitch_retune_results.param
Pitch rate 26_autotune_pitch_results.param, 32_autotune_roll_pitch_retune_results.param
Yaw rate 28_autotune_yaw_results.param, 30_autotune_yawd_results.param
Roll 24_autotune_roll_results.param, 32_autotune_roll_pitch_retune_results.param
Pitch 26_autotune_pitch_results.param, 32_autotune_roll_pitch_retune_results.param
Yaw 28_autotune_yaw_results.param, 30_autotune_yawd_results.param
Position XY velocity 41_position_controller.param

And we added a remote ID configuration step.

1 Like

Thank you.

I like to suggest adding the followings to line 60 and 61. Most compare software are sensitive to floating numbers ending with .0 (1.0, 2.0, 3.0) and MP parameter saving for floating number with ending 0, becomes integer number (5.0 → 5).

if int(default_value) == default_value and isinstance(default_value, float):
default_value = int(default_value)

for param_name, default_value in defaults.items():
    if int(default_value) == default_value and isinstance(default_value, float):
        default_value = int(default_value)
    print(f"{param_name},{default_value}")
1 Like

Hello @Jai.GAY you are probably not using the latest version included in the diatone_taycan_mxc.zip file.
That version already includes the changes you propose.

Thanks for the heads up, I will remove the older version now.

1 Like

Where can I download the diatone_taycan_mxc.zip?

1 Like

In the very first post of this thread. That is the most important file in this entire thread.

1 Like

Hello @amilcarlucas , awsome work!
One more question, maybe regarding larger drones: Is Magfit and Large Vehicle MagCal enough? How about compass mot? I have seen improvements with compass_mot, and also large changes at the reading of the compasses when the ampers get high

I am also reminding you that you wanted to post the S900 tune!
Thanks!

1 Like

In-flight mag fit is, if done properly, a superset of all others.
But on vehicles with high currents flowing close to the compass, it is better to do a compass mot, before the inflight magfit.

2 Likes

After Magfit calibration (or maybe arducopter compass calibration) the drone can be deployed in different regions , do you just use COMPASS_LEARN 1 or do you redo the magfit? I never understood why to use magfit if location of UAV can be 100km apart .

2 Likes

Do not change COMPASS_LEARN=0 and do not redo magfit. It just works fine, it uses GPS to get the local magnetic declination. No need for anything else.

1 Like

We’ve added parameters and respective documentation for 4.3.8, 4.4.4 and 4.5.0-DEV ArduCopter versions to the diatone_taycan_mxc.zip file.

Enjoy

2 Likes

One more question I have is, if the users run a second autotune immediately or 30 minutes later after the first successful autotune, what will the users expect from the second autotune? I mean about the tuned values. Are they going to be close? I did try before but a few weeks apart, their values are not close. I am just curious.

1 Like

Are you asking about the second roll-pitch autotune?
The tuned values will be close to the first roll pitch values, yes.
The resulting values are in the files, why are you asking this?

It makes no difference 30 minutes or 30 days as long as the wind conditions are the same.

1 Like

What overall affect does wind have on the autotune? Will the PIDs be over-tuned (ie: too high and overly sensitive) or under-tuned? Thanks.

Loiter flight mode.

After Autotune, I like to know if there is a graph or methodology to confirm a good calibration or better control flying machine especially loiter flight mode. How do the experienced UA pilots confirm it? How each loiter parameter affect the flying and control.

1 Like

See Section 8 in the first post.

1 Like

No, the PIDs will just be plain wrong. Might be over-tuned, might be under-tuned, might be anything.

1 Like

Thanks for this it looks really great. I will try following.

I think this is important. Ardupilot carries the natural caveats of being multipurpose/multitargeted.
It’s so easy to miss a important parameter, or step, or detail.
I experienced this after I started my second setup configuration. My conclusion was I need a cheklist for this. It sure needs to be methodological.

2 Likes

That is nice table explain A lot… Thanks…

Section 8 mentioned it is for Alt-hold flight mode. Does it apply to Loiter flight mode?
what is a good transient response value? less than 60ms. 0msec is the best. Is my understanding correct?
If the transient response is above 60ms, how do users tune the Loiter parameters to bring the transient response nearer to 0sec?

For clarity’s sake I’m oversimplifying here:

  • AltHold uses a 2 level cascading of PID control loops:
    • angle rate - the inner most control loop
    • angle - the second control loop, wraps around the angle rate control loop
  • Loiter adds a 3rd cascading outer PID control loop on top for position. And the inner angle and angle rate loops are still used.

Diagrams are on the ArduCopter’s System Identification documentation page

So yes, Section8 does apply to Loiter and Auto and all other modes. The inner loops need to be tuned (fast-transient response, good noise rejection, low overshoot, stable, etc) for the outer loop to even have a chance of getting tuned and do its work.

A good transient response depends on the size of your vehicle. A 300g vehicle will potentially be more agile than a 300Kg one. There is no one value fits all. But yes, the smaller the better.

To improve the loiter response, you first need to make sure the innermost angle rate control loop is performing correctly, after that the second level angle control loop is doing OK. And only after that you tune the outermost position control loop.

This process is explained in Section 11, and we wrote an entire Blog post on the topic and also wrote some of ArduPilot’s system identification documentation there are depictions of the three control loops explained above. We also contributed a simulink model of ArduCopter’s inner control loops.

All of that information is on Section 11.

1 Like