I am trying to figure how certain parameters influence the best PID values.
For example, I have tuned a copter using autotune, it flies OK, and has certain PID values and some other parameters set up…
Now, how these PIDs should be changed (without retuning) if:
- I go from 0 to 4000 meters
- I increase the weight of the copter from 2 kg to 3 kg
- I switch from 4S to 6S
- I change prop from 13 x 5 to 16 x 5.5
Is there any method to predict how the ideal PID values would change?
And, second, is there a way of setting up different PID profiles for different conditions? I do not see any options for that,
Yes, there are ways to predict that, if you have a mathematical model of both the PIDs (ardupilot firmware control loops) and of the vehicle dynamics.
The first part is available as a simulink model in the source code of ardupilot on the Tools/Simulink
directory. The second part can be determined by doing System Identification flights.
So basically it is possible if you know enough about control theory, modeling, simulation and analytical PID optimization.
If not, just autotune whenever the environment changes.
I do not want to go too deeply in theory, but would have liked to have an idea how change of these factors (altitude, weight, voltage, and prop) affect the PIDs. I have done some tests (like autotuning with 4S and 6S, and with different weights), and I have some vague ideas how PIDs are afected by these two factors, but the autotuning is not that fast.
The other question, in ardupilot, you can not have several instances of PID values which one can select manually?
There is a lua script to quickly switch between two sets of PID prameters.
You could expand that one to support n sets instead.