I'm trawling through the APM Arduplane 2.28 code base trying to locate where the PID loops are calculated and hence where the gains applied.
I want to be able to implement a density altitude/Mach/TAS-based factor on the PID gains to allow (simulated) flight at high altitudes, but so far my search for the illusive PID loop code is just frustrating. Can anyone shed some light on where to look?
My search based on RLL2SRV, pidServoRoll, SERVO_ROLL_P and others as well as just general browsing have lead me nowhere.
Thanks in advance!
in the AP_PID library
I'm beginning to get a foothold now and I can nearly see what I need to do!
I see there is already a speed scalar implemented - maybe this is the cause of my problem.
Good - fixed up my little problem!
The scalar limits of 0.5 and 2.0 were causing the problem - well, at least the 0.5 was at altitudes of 80000 feet and more, when TAS goes stratospheric.