autopilot5.xml 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454
  1. <?xml version="1.0"?>
  2. <PropertyList>
  3. <predict-simple>
  4. <name>predicted altitude 5 seconds ahead</name>
  5. <debug>false</debug>
  6. <input>/position/altitude-ft</input>
  7. <output>/autopilot/internal/altitude-5-sec-ahead</output>
  8. <seconds>2.0</seconds>
  9. <filter-gain>0.1</filter-gain>
  10. </predict-simple>
  11. <filter>
  12. <name>Bank Angle Limiter</name>
  13. <type>gain</type>
  14. <debug>false</debug>
  15. <input>
  16. <property>/velocities/airspeed-kt</property>
  17. </input>
  18. <output>
  19. <property>/autopilot/internal/bank-angle-limit-deg</property>
  20. </output>
  21. <gain>0.15</gain>
  22. <u_min>20.0</u_min>
  23. <u_max>45.0</u_max>
  24. </filter>
  25. <filter>
  26. <name>Aileron Command Limiter</name>
  27. <type>gain</type>
  28. <debug>false</debug>
  29. <input>
  30. <property>/controls/flight/wing-sweep</property>
  31. </input>
  32. <output>
  33. <property>/autopilot/internal/aileron-limit-norm</property>
  34. </output>
  35. <gain>0.15</gain>
  36. <u_min>20.0</u_min>
  37. <u_max>45.0</u_max>
  38. </filter>
  39. <filter>
  40. <name>Pitch Hold</name>
  41. <type>gain</type>
  42. <debug>false</debug>
  43. <enable>
  44. <condition>
  45. <equals>
  46. <property>/autopilot/locks/altitude</property>
  47. <value>pitch-hold</value>
  48. </equals>
  49. </condition>
  50. </enable>
  51. <input>
  52. <property>/autopilot/settings/target-pitch-deg</property>
  53. <value>0</value>
  54. </input>
  55. <output>
  56. <property>/autopilot/internal/target-pitch-deg</property>
  57. </output>
  58. <gain>1.0</gain>
  59. <u_min>-70.0</u_min>
  60. <u_max>70.0</u_max>
  61. </filter>
  62. <pid-controller>
  63. <name>Altitude Hold Computer</name>
  64. <debug>false</debug>
  65. <enable>
  66. <condition>
  67. <equals>
  68. <property>/autopilot/locks/altitude</property>
  69. <value>altitude-hold</value>
  70. </equals>
  71. </condition>
  72. </enable>
  73. <input>
  74. <property>/position/altitude-ft</property>
  75. </input>
  76. <reference>
  77. <property>/autopilot/settings/target-altitude-ft</property>
  78. </reference>
  79. <output>
  80. <property>/autopilot/internal/target-pitch-deg</property>
  81. </output>
  82. <config>
  83. <Kp>0.075</Kp> <!-- proportional gain -0.01 -->
  84. <beta>1.0</beta> <!-- input value weighing factor -->
  85. <alpha>0.5</alpha> <!-- low pass filter weighing factor -->
  86. <gamma>0.0</gamma> <!-- input value weighing factor for -->
  87. <!-- unfiltered derivative error -->
  88. <Ti>7.5</Ti> <!-- integrator time 10.0 -->
  89. <Td>0.0001</Td> <!-- derivator time -->
  90. <u_min>-6.0</u_min> <!-- minimum output clamp -->
  91. <u_max>6.0</u_max> <!-- maximum output clamp -->
  92. </config>
  93. </pid-controller>
  94. <pid-controller>
  95. <name>Altitude TFR Computer</name>
  96. <debug>false</debug>
  97. <enable>
  98. <condition>
  99. <equals>
  100. <property>/autopilot/locks/altitude</property>
  101. <value>agl-hold</value>
  102. </equals>
  103. </condition>
  104. </enable>
  105. <input>
  106. <property>/position/altitude-agl-ft</property>
  107. </input>
  108. <reference>
  109. <property>/autopilot/settings/target-agl-ft</property>
  110. </reference>
  111. <output>
  112. <property>/autopilot/internal/target-pitch-deg</property>
  113. </output>
  114. <config>
  115. <Kp>0.075</Kp> <!-- proportional gain -0.01 -->
  116. <beta>1.0</beta> <!-- input value weighing factor -->
  117. <alpha>0.5</alpha> <!-- low pass filter weighing factor -->
  118. <gamma>0.0</gamma> <!-- input value weighing factor for -->
  119. <!-- unfiltered derivative error -->
  120. <Ti>7.5</Ti> <!-- integrator time 10.0 -->
  121. <Td>0.0001</Td> <!-- derivator time -->
  122. <u_min>-10.0</u_min> <!-- minimum output clamp -->
  123. <u_max>15.0</u_max> <!-- maximum output clamp -->
  124. </config>
  125. </pid-controller>
  126. <filter>
  127. <name>Target Roll Computer</name>
  128. <debug>false</debug>
  129. <type>gain</type>
  130. <enable>
  131. <condition>
  132. <or>
  133. <equals>
  134. <property>/autopilot/locks/heading</property>
  135. <value>dg-heading-hold</value>
  136. </equals>
  137. <equals>
  138. <property>/autopilot/locks/heading</property>
  139. <value>true-heading-hold</value>
  140. </equals>
  141. </or>
  142. </condition>
  143. </enable>
  144. <input>
  145. <condition>
  146. <equals>
  147. <property>/autopilot/locks/heading</property>
  148. <value>dg-heading-hold</value>
  149. </equals>
  150. </condition>
  151. <property>/autopilot/internal/heading-bug-error-deg</property>
  152. </input>
  153. <input>
  154. <condition>
  155. <equals>
  156. <property>/autopilot/locks/heading</property>
  157. <value>true-heading-hold</value>
  158. </equals>
  159. </condition>
  160. <property>/autopilot/internal/true-heading-error-deg</property>
  161. </input>
  162. <output>
  163. <property>/autopilot/internal/target-roll-deg</property>
  164. </output>
  165. <gain>5</gain>
  166. <u_min>
  167. <property>/autopilot/internal/bank-angle-limit-deg</property>
  168. <scale>-1.0</scale>
  169. </u_min>
  170. <u_max>
  171. <property>/autopilot/internal/bank-angle-limit-deg</property>
  172. </u_max>
  173. </filter>
  174. <pid-controller>
  175. <name>System Command: Roll</name>
  176. <debug>false</debug>
  177. <enable>
  178. <condition>
  179. <not-equals>
  180. <property>/autopilot/locks/heading</property>
  181. <value />
  182. </not-equals>
  183. </condition>
  184. </enable>
  185. <input>
  186. <property>/orientation/roll-deg</property>
  187. </input>
  188. <reference>
  189. <condition>
  190. <not-equals>
  191. <property>/autopilot/locks/heading</property>
  192. <value>wing-leveler</value>
  193. </not-equals>
  194. </condition>
  195. <property>/autopilot/internal/target-roll-deg</property>
  196. </reference>
  197. <reference>
  198. <condition>
  199. <equals>
  200. <property>/autopilot/locks/heading</property>
  201. <value>wing-leveler</value>
  202. </equals>
  203. </condition>
  204. <value>0</value>
  205. </reference>
  206. <output>
  207. <property>/controls/flight/aileron-trim</property>
  208. </output>
  209. <config>
  210. <Kp>0.0025</Kp> <!-- proportional gain -->
  211. <beta>1.0</beta> <!-- input value weighing factor -->
  212. <alpha>0.1</alpha> <!-- low pass filter weighing factor -->
  213. <gamma>0.0</gamma> <!-- input value weighing factor for -->
  214. <!-- unfiltered derivative error -->
  215. <Ti>5.0</Ti> <!-- integrator time -->
  216. <Td>0.00001</Td> <!-- derivator time -->
  217. <u_min>-0.35</u_min> <!-- minimum output clamp -->
  218. <u_max>0.35</u_max> <!-- maximum output clamp -->
  219. </config>
  220. </pid-controller>
  221. <pid-controller>
  222. <name>System Command: Pitch</name>
  223. <debug>false</debug>
  224. <enable>
  225. <condition>
  226. <not-equals>
  227. <property>/autopilot/locks/altitude</property>
  228. <value />
  229. </not-equals>
  230. </condition>
  231. </enable>
  232. <input>
  233. <property>/orientation/pitch-deg</property>
  234. </input>
  235. <reference>
  236. <property>/autopilot/internal/target-pitch-deg</property>
  237. </reference>
  238. <output>
  239. <property>/controls/flight/elevator</property>
  240. </output>
  241. <config>
  242. <Kp>-0.05</Kp>
  243. <beta>1.0</beta> <!-- input value weighing factor -->
  244. <alpha>0.1</alpha> <!-- low pass filter weighing factor -->
  245. <gamma>0.0</gamma> <!-- input value weighing factor for -->
  246. <Ti>20.0</Ti> <!-- integrator time 10.0 -->
  247. <Td>0.00001</Td> <!-- derivator time -->
  248. <u_min>-0.35</u_min> <!-- minimum output clamp -->
  249. <u_max>0.35</u_max>
  250. </config>
  251. </pid-controller>
  252. <!-- vertical speed hold -->
  253. <pid-controller>
  254. <name>Vertical Speed Hold</name>
  255. <debug>false</debug>
  256. <enable>
  257. <prop>/autopilot/locks/altitude</prop>
  258. <value>vertical-speed-hold</value>
  259. </enable>
  260. <input>
  261. <prop>/velocities/vertical-speed-fps</prop>
  262. </input>
  263. <reference>
  264. <prop>/autopilot/settings/vertical-speed-fpm</prop>
  265. <scale>0.01667</scale>
  266. </reference>
  267. <output>
  268. <prop>/controls/flight/elevator-trim</prop>
  269. </output>
  270. <config>
  271. <Kp>-0.0025</Kp> <!-- proportional gain -->
  272. <beta>1.0</beta> <!-- input value weighing factor -->
  273. <alpha>0.1</alpha> <!-- low pass filter weighing factor -->
  274. <gamma>0.0</gamma> <!-- input value weighing factor for -->
  275. <!-- unfiltered derivative error -->
  276. <Ti>10.0</Ti> <!-- integrator time -->
  277. <Td>0.00001</Td> <!-- derivator time -->
  278. <u_min>-1.0</u_min> <!-- minimum output clamp -->
  279. <u_max>1.0</u_max> <!-- maximum output clamp -->
  280. </config>
  281. </pid-controller>
  282. <!-- =============================================================== -->
  283. <!-- Velocity Modes -->
  284. <!-- =============================================================== -->
  285. <!-- Auto throttle -->
  286. <pid-controller>
  287. <name>Auto Throttle (5 sec lookahead)</name>
  288. <debug>false</debug>
  289. <enable>
  290. <prop>/autopilot/locks/speed</prop>
  291. <value>speed-with-throttle</value>
  292. </enable>
  293. <input>
  294. <prop>/autopilot/internal/lookahead-5-sec-airspeed-kt</prop>
  295. </input>
  296. <reference>
  297. <prop>/autopilot/settings/target-speed-kt</prop>
  298. </reference>
  299. <output>
  300. <prop>/controls/engines/engine[0]/throttle</prop>
  301. <prop>/controls/engines/engine[1]/throttle</prop>
  302. <prop>/controls/engines/engine[2]/throttle</prop>
  303. <prop>/controls/engines/engine[3]/throttle</prop>
  304. </output>
  305. <config>
  306. <Kp>0.1</Kp> <!-- proportional gain -->
  307. <beta>1.0</beta> <!-- input value weighing factor -->
  308. <alpha>0.1</alpha> <!-- low pass filter weighing factor -->
  309. <gamma>0.0</gamma> <!-- input value weighing factor for -->
  310. <!-- unfiltered derivative error -->
  311. <Ti>5.0</Ti> <!-- integrator time -->
  312. <Td>0.00001</Td> <!-- derivator time -->
  313. <u_min>0.0</u_min> <!-- minimum output clamp -->
  314. <u_max>1.00</u_max> <!-- maximum output clamp -->
  315. </config>
  316. </pid-controller>
  317. <!-- Hold speed by varying pitch (Two stage cascading controller) -->
  318. <pid-controller>
  319. <name>Speed hold (vary pitch) Stage #1</name>
  320. <debug>false</debug>
  321. <enable>
  322. <prop>/autopilot/locks/speed</prop>
  323. <value>speed-with-pitch</value>
  324. </enable>
  325. <input>
  326. <prop>/autopilot/internal/lookahead-5-sec-airspeed-kt</prop>
  327. </input>
  328. <reference>
  329. <prop>/autopilot/settings/target-speed-kt</prop>
  330. </reference>
  331. <output>
  332. <prop>/autopilot/settings/target-pitch-deg</prop>
  333. </output>
  334. <config>
  335. <Kp>-1.0</Kp> <!-- proportional gain -->
  336. <beta>1.0</beta> <!-- input value weighing factor -->
  337. <alpha>0.1</alpha> <!-- low pass filter weighing factor -->
  338. <gamma>0.0</gamma> <!-- input value weighing factor for -->
  339. <!-- unfiltered derivative error -->
  340. <Ti>1.0</Ti> <!-- integrator time -->
  341. <Td>0.00001</Td> <!-- derivator time -->
  342. <u_min>-15.0</u_min><!-- minimum output clamp -->
  343. <u_max>15.0</u_max> <!-- maximum output clamp -->
  344. </config>
  345. </pid-controller>
  346. <pid-controller>
  347. <name>Speed hold (vary pitch) Stage #2</name>
  348. <debug>false</debug>
  349. <enable>
  350. <prop>/autopilot/locks/speed</prop>
  351. <value>speed-with-pitch</value>
  352. </enable>
  353. <input>
  354. <prop>/orientation/pitch-deg</prop>
  355. </input>
  356. <reference>
  357. <prop>/autopilot/settings/target-pitch-deg</prop>
  358. </reference>
  359. <output>
  360. <prop>/controls/flight/elevator-trim</prop>
  361. </output>
  362. <config>
  363. <Kp>-0.05</Kp> <!-- proportional gain -->
  364. <beta>1.0</beta> <!-- input value weighing factor -->
  365. <alpha>0.1</alpha> <!-- low pass filter weighing factor -->
  366. <gamma>0.0</gamma> <!-- input value weighing factor for -->
  367. <!-- unfiltered derivative error -->
  368. <Ti>1.0</Ti> <!-- integrator time -->
  369. <Td>0.00001</Td> <!-- derivator time -->
  370. <u_min>-1.0</u_min> <!-- minimum output clamp -->
  371. <u_max>1.0</u_max> <!-- maximum output clamp -->
  372. </config>
  373. </pid-controller>
  374. <!-- Terrain follow. 2 stage cascade controller. -->
  375. <!-- Stage #1 sets target rate of climb based on diff between current alt -->
  376. <!-- and target altitude. -->
  377. <pi-simple-controller>
  378. <name>Altitude Hold (Altimeter based) Stage 1</name>
  379. <debug>false</debug>
  380. <enable>
  381. <prop>/autopilot/locks/altitude</prop>
  382. <value>terrain-follow</value>
  383. </enable>
  384. <input>
  385. <prop>/position/altitude-ft</prop>
  386. </input>
  387. <reference>
  388. <prop>/autopilot/settings/target-follow-altitude-ft</prop>
  389. </reference>
  390. <output>
  391. <prop>/autopilot/internal/target-climb-rate-fps</prop>
  392. </output>
  393. <config>
  394. <Kp>0.25</Kp> <!-- proportional gain -->
  395. <Ki>0.0</Ki> <!-- integral gain -->
  396. <u_min>-120.00</u_min> <!-- minimum output clamp -16.67-->
  397. <u_max>300.00</u_max> <!-- maximum output clamp 33.33-->
  398. </config>
  399. </pi-simple-controller>
  400. <!-- Stage #2 drives the elevator-trim to achieve the desired climb rate. -->
  401. <pid-controller>
  402. <name>Altitude Hold (Altimeter based) Stage 2</name>
  403. <debug>false</debug>
  404. <enable>
  405. <prop>/autopilot/locks/altitude</prop>
  406. <value>terrain-follow</value>
  407. </enable>
  408. <input>
  409. <prop>/velocities/vertical-speed-fps</prop>
  410. </input>
  411. <reference>
  412. <prop>/autopilot/internal/target-climb-rate-fps</prop>
  413. </reference>
  414. <output>
  415. <prop>/controls/flight/elevator-trim</prop>
  416. </output>
  417. <config>
  418. <Kp>-0.0025</Kp> <!-- proportional gain -0.01 -->
  419. <beta>1.0</beta> <!-- input value weighing factor -->
  420. <alpha>0.1</alpha> <!-- low pass filter weighing factor -->
  421. <gamma>0.0</gamma> <!-- input value weighing factor for -->
  422. <!-- unfiltered derivative error -->
  423. <Ti>10.0</Ti> <!-- integrator time 10.0 -->
  424. <Td>0.00001</Td> <!-- derivator time -->
  425. <u_min>-1</u_min> <!-- minimum output clamp -->
  426. <u_max>1</u_max> <!-- maximum output clamp -->
  427. </config>
  428. </pid-controller>
  429. </PropertyList>