Own PID Values in Mission Planner

Hello,

for education i built a quadrocopter. Now i have written a simulation for calculating the best PID Values and want to put these values in Mission Planner/ConfigTuning/ExtendedTuning. But i saw that the Rate Pitch/Roll/Yaw PID’s are unusual low. My calculated Values are factor 10 to 20 higher.
Is it possible that ArduPilot use a diffrent way to implement these PID’s ? I’m wondering where ArduPilot get information about mass or mass inertia, which is important for PID calculation.
I know that Mission Planner has an AutoTune fuction, but i want to do something more scientifc for my bachelor thesis.

Hope you can help me how i can implement my own Values.

Thanks

not sure what you mean by “implement my own values” , you can just enter them there, or into full parameter list.
if you mean to understand the ArduCopter PIDs well enough to do a theoretical calculation for good PID’s, you will need to know a lot about the vehicle, it’s motors, thrust , weight and weight distribution, the propeller/motor acceleration and torque and so on…

Hi Andre,

yes i have these vehicle data and have done a theoretical PID calculation in Matlab/Simulink.
The problem is that these values are around 10 times higher. If i enter them there i got a warning that these values are out of range.
For example they use for Roll:
P=0.135
I=0.09
D=0.0036
The quadcopter flys much better with these values, than with my calculated.

My own calculated Values for Roll are:
P= 1.1
I=0.9
D=0.8

My question is, is it possible that the Mission Planner uses scaled/factorized PID values for any reason i dont know ?

Divide your values by 10 and enter them?

No, it shows the values that ardupilot actually uses, you can verify with any other GCS, like APMPlanner2, QgroundControl or MAVproxy.

I wonder how complex your matlab model is / how many parameters you enter into it about the actual airframe.
Then you need to thing what the values you currently have are,

are those manually tuned and fly well ? if so , it’s very likely that your matlab values, devided by 10 , would also fly well.

Thanks for your response!

No these values are the standard Mission Planner values after installation. I tested them and they fly ok, not very good but better than my ones.
Maybe it’s a fault in my code where a division by 10 is missing. But if not, i have to prove why it’s so different.

Do you know how and where ardupilot calculate the PID’s ? And which mass inertia they use ?

My model is not very complex, i used a simple quadrocopter flightsimulation, increased in three interleaved loops the Kp, Ki and Kd value and analyzed the flight behaviour for finding the best PID composition.

there is no such thing as “standard mission planner” PID’s , ArduCopter or ArduPlane have some default PID’s no mass is involved in those. That it flies “ok” is not uncommon but can probaply be improved on.

Unless you have studied the Ardu* PID implementation closely, and enter very many detailed performance details, it’s hard for me to imagine how/why your math-only solution should give good results.

A single variation in PWM range of an ESC , it’s linearity, the motor KV/performance and propeller pitch/size can do a lot to optimal proportional term alone.

No mention of your power setting, voltage or current draw. Also check your gyro sensitivity settings in MP. If these are set too low, it effectivly divides your pids values.
Bottom line, no 2 aircraft have the same PIDs. I have built 2 almost identical quads and there pid’s didn’t even come close to each other. too many variables. If there was an easy way to manually work out PID’s from a sim, we’d all be doing it. Trial and error is still the only real way to sort it out. It’s ponderous, I know, but that’s the game huh?
Good luck.