- Messages
- 254
- Country

Alright, after much time I am finally coming back to this. I have successfully written a Heading Hold PID loop that works very well at capturing any heading I set on the autopilot. My gain values are exact matches to what NASA lists on their Boeing 747 simulation document.
The only thing missing is how to control the aileron deflection as a function of the commanded roll rate. If anyone could point me in the right direction with that, I would be grateful!
The only thing missing is how to control the aileron deflection as a function of the commanded roll rate. If anyone could point me in the right direction with that, I would be grateful!
XML:
<!-- Gain Adjustments and Tuning Numbers -->
<Element>
<Select>
<Value>
0.0016175 (A:AIRSPEED TRUE, knots) * 0.110375 + 0.353 max 1.0 min (>L:Roll Mode TAS Gain, number)
</Value>
</Select>
</Element>
<!-- HDG Select Mode -->
<Element>
<Select>
<Value>
<!--Heading Select Mode, 1.25-->
(A:PLANE HEADING DEGREES MAGNETIC, degrees) (A:AUTOPILOT HEADING LOCK DIR, degrees) - (>L:AP Heading Error 1, number)
(L:AP Heading Error 1, number) -180 <
if{ (L:AP Heading Error 1, number) 360 + (>L:AP Heading Error, number) }
(L:AP Heading Error 1, number) 180 >
if{ (L:AP Heading Error 1, number) 360 - (>L:AP Heading Error, number) }
(L:AP Heading Error 1, number) abs 180 <
if{ (L:AP Heading Error 1, number) (>L:AP Heading Error, number) }
<!-- Positive Bank Error = Left Turn, Negative = Right Turn -->
<!-- Heading Select Kp = 2.83 -->
(L:Roll Mode TAS Gain, number) 2.83 * (>L:Kp HDG Select, number)
(L:Kp HDG Select, number) (L:AP Heading Error, number) * 30 min -30 max (>L:AP Target Bank, number)
(L:AP Target Bank, number) (A:ATTITUDE INDICATOR BANK DEGREES, degrees) - (>L:AP Bank Error, number)
<!--Kp Bank Roll Rate, 1.25-->
(L:AP Heading Error, number) 0.1 * -3 max 3 min (>L:AP Target Roll Rate, number)
(L:AP Target Bank, number) (A:ATTITUDE INDICATOR BANK DEGREES, degrees) - (L:AP Target Roll Rate, number) * (L:Roll Rate, number) - (>L:Aileron Deflection, degrees)
(L:Aileron Deflection, degrees) 16383 * (>K:AILERON_SET)
</Value>
</Select>
</Element>

