autopilot.xml 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744
  1. <?xml version="1.0"?>
  2. <PropertyList>
  3. <!-- =============================================================== -->
  4. <!-- Prediction filters -->
  5. <!-- =============================================================== -->
  6. <predict-simple>
  7. <input>/autopilot/internal/nav1-track-error-deg</input>
  8. <output>/autopilot/internal/nav1-track-error-lookahead-deg</output>
  9. <seconds>8.0</seconds>
  10. <filter-gain>0.0</filter-gain>
  11. </predict-simple>
  12. <!-- =============================================================== -->
  13. <!-- Roll Axis Modes -->
  14. <!-- =============================================================== -->
  15. <!-- Wing leveler -->
  16. <pid-controller>
  17. <name>Wing Leveler (Turn Coordinator based)</name>
  18. <debug>false</debug>
  19. <enable>
  20. <prop>/autopilot/locks/heading</prop>
  21. <value>wing-leveler</value>
  22. </enable>
  23. <input>
  24. <prop>/instrumentation/turn-indicator/indicated-turn-rate</prop>
  25. </input>
  26. <reference>
  27. <value>0.0</value>
  28. </reference>
  29. <output>
  30. <prop>/controls/flight/aileron</prop>
  31. </output>
  32. <config>
  33. <Kp>0.5</Kp> <!-- proportional gain -->
  34. <beta>1.0</beta> <!-- input value weighing factor -->
  35. <alpha>0.1</alpha> <!-- low pass filter weighing factor -->
  36. <gamma>0.0</gamma> <!-- input value weighing factor for -->
  37. <!-- unfiltered derivative error -->
  38. <Ti>10.0</Ti> <!-- integrator time -->
  39. <Td>0.00001</Td> <!-- derivator time -->
  40. <u_min>-1.0</u_min> <!-- minimum output clamp -->
  41. <u_max>1.0</u_max> <!-- maximum output clamp -->
  42. </config>
  43. </pid-controller>
  44. <!-- Heading Bug Hold. 2 stage cascade controller. -->
  45. <!-- Stage #1 sets target roll based on diff between current heading -->
  46. <!-- and heading bug. -->
  47. <pid-controller>
  48. <name>Heading Bug Hold (FDM mag heading based) Stage 1</name>
  49. <debug>false</debug>
  50. <enable>
  51. <prop>/autopilot/locks/heading</prop>
  52. <value>dg-heading-hold</value>
  53. </enable>
  54. <input>
  55. <prop>/autopilot/internal/fdm-heading-bug-error-deg</prop>
  56. </input>
  57. <reference>
  58. <value>0.0</value>
  59. </reference>
  60. <output>
  61. <prop>/autopilot/internal/target-roll-deg</prop>
  62. </output>
  63. <config>
  64. <Kp>-1.0</Kp> <!-- proportional gain -->
  65. <beta>1.0</beta> <!-- input value weighing factor -->
  66. <alpha>0.1</alpha> <!-- low pass filter weighing factor -->
  67. <gamma>0.0</gamma> <!-- input value weighing factor for -->
  68. <!-- unfiltered derivative error -->
  69. <Ti>10.0</Ti> <!-- integrator time -->
  70. <Td>0.00001</Td> <!-- derivator time -->
  71. <u_min>-30.0</u_min> <!-- minimum output clamp -->
  72. <u_max>30.0</u_max> <!-- maximum output clamp -->
  73. </config>
  74. </pid-controller>
  75. <!-- Stage #2 drives the ailerons to achieve the desired roll deg. -->
  76. <pid-controller>
  77. <name>Heading Bug Hold (DG based) Stage 2</name>
  78. <debug>false</debug>
  79. <enable>
  80. <prop>/autopilot/locks/heading</prop>
  81. <value>dg-heading-hold</value>
  82. </enable>
  83. <input>
  84. <prop>/orientation/roll-deg</prop>
  85. </input>
  86. <reference>
  87. <prop>/autopilot/internal/target-roll-deg</prop>
  88. </reference>
  89. <output>
  90. <prop>/controls/flight/aileron</prop>
  91. </output>
  92. <config>
  93. <Kp>0.02</Kp> <!-- proportional gain -->
  94. <beta>1.0</beta> <!-- input value weighing factor -->
  95. <alpha>0.1</alpha> <!-- low pass filter weighing factor -->
  96. <gamma>0.0</gamma> <!-- input value weighing factor for -->
  97. <!-- unfiltered derivative error -->
  98. <Ti>10.0</Ti> <!-- integrator time -->
  99. <Td>0.00001</Td> <!-- derivator time -->
  100. <u_min>-1.0</u_min> <!-- minimum output clamp -->
  101. <u_max>1.0</u_max> <!-- maximum output clamp -->
  102. </config>
  103. </pid-controller>
  104. <!-- True Heading hold. 2 stage cascade controller. -->
  105. <!-- Stage #1 sets target roll based on diff between current heading -->
  106. <!-- and target heading. -->
  107. <pid-controller>
  108. <name>True Heading Hold (DG based) Stage 1</name>
  109. <debug>false</debug>
  110. <enable>
  111. <prop>/autopilot/locks/heading</prop>
  112. <value>true-heading-hold</value>
  113. </enable>
  114. <input>
  115. <prop>/autopilot/internal/true-heading-error-deg</prop>
  116. </input>
  117. <reference>
  118. <value>0.0</value>
  119. </reference>
  120. <output>
  121. <prop>/autopilot/internal/target-roll-deg</prop>
  122. </output>
  123. <config>
  124. <Kp>-3.5</Kp> <!-- proportional gain -->
  125. <beta>1.0</beta> <!-- input value weighing factor -->
  126. <alpha>0.1</alpha> <!-- low pass filter weighing factor -->
  127. <gamma>0.0</gamma> <!-- input value weighing factor for -->
  128. <!-- unfiltered derivative error -->
  129. <Ti>2.9</Ti> <!-- integrator time -->
  130. <Td>0.0000001</Td> <!-- derivator time -->
  131. <u_min>-35.0</u_min> <!-- minimum output clamp -->
  132. <u_max>35.0</u_max> <!-- maximum output clamp -->
  133. </config>
  134. </pid-controller>
  135. <!-- Stage #2 drives the ailerons to achieve the desired roll deg. -->
  136. <pid-controller>
  137. <name>True Heading Hold (DG based) Stage 2</name>
  138. <debug>false</debug>
  139. <enable>
  140. <prop>/autopilot/locks/heading</prop>
  141. <value>true-heading-hold</value>
  142. </enable>
  143. <input>
  144. <prop>/orientation/roll-deg</prop>
  145. </input>
  146. <reference>
  147. <prop>/autopilot/internal/target-roll-deg</prop>
  148. </reference>
  149. <output>
  150. <prop>/controls/flight/aileron</prop>
  151. </output>
  152. <config>
  153. <Kp>0.02</Kp> <!-- proportional gain -->
  154. <beta>1.0</beta> <!-- input value weighing factor -->
  155. <alpha>0.1</alpha> <!-- low pass filter weighing factor -->
  156. <gamma>0.0</gamma> <!-- input value weighing factor for -->
  157. <!-- unfiltered derivative error -->
  158. <Ti>5.0</Ti> <!-- integrator time -->
  159. <Td>0.00001</Td> <!-- derivator time -->
  160. <u_min>-3.0</u_min> <!-- minimum output clamp -->
  161. <u_max>3.0</u_max> <!-- maximum output clamp -->
  162. </config>
  163. </pid-controller>
  164. <!-- Nav1 hold. 2 stage cascade controller. -->
  165. <!-- Stage #1 sets target roll based on diff between current heading -->
  166. <!-- and target heading. -->
  167. <pid-controller>
  168. <name>Nav1 Hold Stage 1</name>
  169. <debug>false</debug>
  170. <enable>
  171. <prop>/autopilot/locks/heading</prop>
  172. <value>nav1-hold</value>
  173. </enable>
  174. <input>
  175. <prop>/autopilot/internal/nav1-track-error-deg</prop>
  176. </input>
  177. <reference>
  178. <value>0.0</value>
  179. </reference>
  180. <output>
  181. <prop>/autopilot/internal/target-roll-deg</prop>
  182. </output>
  183. <config>
  184. <Kp>-1.0</Kp> <!-- proportional gain -->
  185. <beta>1.0</beta> <!-- input value weighing factor -->
  186. <alpha>0.1</alpha> <!-- low pass filter weighing factor -->
  187. <gamma>0.0</gamma> <!-- input value weighing factor for -->
  188. <!-- unfiltered derivative error -->
  189. <Ti>10.0</Ti> <!-- integrator time -->
  190. <Td>0.00001</Td>
  191. <u_min>-30.0</u_min> <!-- minimum output clamp -->
  192. <u_max>30.0</u_max> <!-- maximum output clamp -->
  193. </config>
  194. </pid-controller>
  195. <!-- Stage #2 drives the ailerons to achieve the desired roll deg. -->
  196. <pid-controller>
  197. <name>Nav1 Hold Stage 2</name>
  198. <debug>false</debug>
  199. <enable>
  200. <prop>/autopilot/locks/heading</prop>
  201. <value>nav1-hold</value>
  202. </enable>
  203. <input>
  204. <prop>/orientation/roll-deg</prop>
  205. </input>
  206. <reference>
  207. <prop>/autopilot/internal/target-roll-deg</prop>
  208. </reference>
  209. <output>
  210. <prop>/controls/flight/aileron</prop>
  211. </output>
  212. <config>
  213. <Kp>0.02</Kp> <!-- proportional gain -->
  214. <beta>1.0</beta> <!-- input value weighing factor -->
  215. <alpha>0.1</alpha> <!-- low pass filter weighing factor -->
  216. <gamma>0.0</gamma> <!-- input value weighing factor for -->
  217. <!-- unfiltered derivative error -->
  218. <Ti>10.0</Ti> <!-- integrator time -->
  219. <Td>0.00001</Td> <!-- derivator time -->
  220. <u_min>-1.0</u_min> <!-- minimum output clamp -->
  221. <u_max>1.0</u_max> <!-- maximum output clamp -->
  222. </config>
  223. </pid-controller>
  224. <!-- Second Stage #2 drives the rudder. -->
  225. <pid-controller>
  226. <name>Nav1 Hold Stage 2</name>
  227. <debug>false</debug>
  228. <enable>
  229. <prop>/autopilot/locks/heading</prop>
  230. <value>nav1-hold</value>
  231. </enable>
  232. <input>
  233. <prop>/orientation/roll-deg</prop>
  234. </input>
  235. <reference>
  236. <prop>/autopilot/internal/target-roll-deg</prop>
  237. </reference>
  238. <output>
  239. <prop>/controls/flight/rudder</prop>
  240. </output>
  241. <config>
  242. <Kp>0.005</Kp> <!-- proportional gain -->
  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. <!-- unfiltered derivative error -->
  247. <Ti>10.0</Ti> <!-- integrator time -->
  248. <Td>0.000000001</Td> <!-- derivator time -->
  249. <u_min>-0.25</u_min> <!-- minimum output clamp -->
  250. <u_max>0.25</u_max> <!-- maximum output clamp -->
  251. </config>
  252. </pid-controller>
  253. <!-- Tacan hold. 2 stage cascade controller. -->
  254. <!-- Stage #1 sets target roll based on diff between current heading -->
  255. <!-- and target heading. -->
  256. <pid-controller>
  257. <name>Tacan Hold (DG based) Stage 1</name>
  258. <debug>false</debug>
  259. <enable>
  260. <prop>/autopilot/locks/heading</prop>
  261. <value>tacan-hold</value>
  262. </enable>
  263. <input>
  264. <prop>/autopilot/internal/fdm-heading-bug-error-deg</prop>
  265. </input>
  266. <reference>
  267. <value>0.0</value>
  268. </reference>
  269. <output>
  270. <prop>/autopilot/internal/target-roll-deg</prop>
  271. </output>
  272. <config>
  273. <Kp>-1.0</Kp> <!-- proportional gain -->
  274. <beta>1.0</beta> <!-- input value weighing factor -->
  275. <alpha>0.1</alpha> <!-- low pass filter weighing factor -->
  276. <gamma>0.0</gamma> <!-- input value weighing factor for -->
  277. <!-- unfiltered derivative error -->
  278. <Ti>10.0</Ti> <!-- integrator time -->
  279. <Td>0.00001</Td> <!-- derivator time -->
  280. <u_min>-30.0</u_min> <!-- minimum output clamp -->
  281. <u_max>30.0</u_max> <!-- maximum output clamp -->
  282. </config>
  283. </pid-controller>
  284. <!-- Stage #2 drives the ailerons to achieve the desired roll deg. -->
  285. <pid-controller>
  286. <name>Tacan Hold (DG based) Stage 2</name>
  287. <debug>false</debug>
  288. <enable>
  289. <prop>/autopilot/locks/heading</prop>
  290. <value>tacan-hold</value>
  291. </enable>
  292. <input>
  293. <prop>/orientation/roll-deg</prop>
  294. </input>
  295. <reference>
  296. <prop>/autopilot/internal/target-roll-deg</prop>
  297. </reference>
  298. <output>
  299. <prop>/controls/flight/aileron</prop>
  300. </output>
  301. <config>
  302. <Kp>0.05</Kp> <!-- proportional gain -->
  303. <beta>1.0</beta> <!-- input value weighing factor -->
  304. <alpha>0.1</alpha> <!-- low pass filter weighing factor -->
  305. <gamma>0.0</gamma> <!-- input value weighing factor for -->
  306. <!-- unfiltered derivative error -->
  307. <Ti>5.0</Ti> <!-- integrator time -->
  308. <Td>0.00001</Td> <!-- derivator time -->
  309. <u_min>-3.0</u_min> <!-- minimum output clamp -->
  310. <u_max>3.0</u_max> <!-- maximum output clamp -->
  311. </config>
  312. </pid-controller>
  313. <!-- =============================================================== -->
  314. <!-- Pitch Axis Modes -->
  315. <!-- =============================================================== -->
  316. <!-- Simple pitch hold -->
  317. <pid-controller>
  318. <name>Pitch hold</name>
  319. <debug>false</debug>
  320. <enable>
  321. <prop>/autopilot/locks/altitude</prop>
  322. <value>pitch-hold</value>
  323. </enable>
  324. <input>
  325. <prop>/orientation/pitch-deg</prop>
  326. </input>
  327. <reference>
  328. <prop>/autopilot/settings/target-pitch-deg</prop>
  329. </reference>
  330. <output>
  331. <prop>/controls/flight/elevator-trim</prop>
  332. </output>
  333. <config>
  334. <Kp>-0.005</Kp> <!-- proportional gain -->
  335. <beta>1.0</beta> <!-- input value weighing factor -->
  336. <alpha>0.1</alpha> <!-- low pass filter weighing factor -->
  337. <gamma>0.0</gamma> <!-- input value weighing factor for -->
  338. <!-- unfiltered derivative error -->
  339. <Ti>1.0</Ti> <!-- integrator time 1.0 -->
  340. <Td>0.00001</Td> <!-- derivator time 0.00001 -->
  341. <u_min>-0.4</u_min> <!-- minimum output clamp -->
  342. <u_max>0.4</u_max> <!-- maximum output clamp -->
  343. </config>
  344. </pid-controller>
  345. <!-- Simple angle of attack hold -->
  346. <pid-controller>
  347. <name>AOA hold</name>
  348. <debug>false</debug>
  349. <enable>
  350. <prop>/autopilot/locks/altitude</prop>
  351. <value>aoa-hold</value>
  352. </enable>
  353. <input>
  354. <prop>/orientation/alpha-deg</prop>
  355. </input>
  356. <reference>
  357. <prop>/autopilot/settings/target-aoa-deg</prop>
  358. </reference>
  359. <output>
  360. <prop>/controls/flight/elevator-trim</prop>
  361. </output>
  362. <config>
  363. <Kp>-0.005</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>0.5</Ti> <!-- integrator time -->
  369. <Td>0.00001</Td> <!-- derivator time -->
  370. <u_min>-0.4</u_min> <!-- minimum output clamp -->
  371. <u_max>0.4</u_max> <!-- maximum output clamp -->
  372. </config>
  373. </pid-controller>
  374. <!-- Altitude hold. 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>altitude-hold</value>
  383. </enable>
  384. <input>
  385. <prop>/position/altitude-ft</prop>
  386. </input>
  387. <reference>
  388. <prop>/autopilot/settings/target-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>-33.33</u_min> <!-- minimum output clamp -16.67-->
  397. <u_max>33.33</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>altitude-hold</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>-0.5</u_min> <!-- minimum output clamp -->
  426. <u_max>0.5</u_max> <!-- maximum output clamp -->
  427. </config>
  428. </pid-controller>
  429. <!-- AGL hold. 2 stage cascade controller. -->
  430. <!-- Stage #1 sets target rate of climb based on diff between current agl -->
  431. <!-- and target agl. -->
  432. <pid-controller>
  433. <name>AGL Hold (Altimeter based) Stage 1</name>
  434. <debug>false</debug>
  435. <enable>
  436. <prop>/autopilot/locks/altitude</prop>
  437. <value>agl-hold</value>
  438. </enable>
  439. <input>
  440. <prop>/position/altitude-agl-ft</prop>
  441. </input>
  442. <reference>
  443. <prop>/autopilot/settings/target-agl-ft</prop>
  444. </reference>
  445. <output>
  446. <prop>/autopilot/internal/target-climb-rate-fps</prop>
  447. </output>
  448. <config>
  449. <Kp>1.0</Kp> <!-- proportional gain -->
  450. <beta>1.0</beta> <!-- input value weighing factor -->
  451. <alpha>0.1</alpha> <!-- low pass filter weighing factor -->
  452. <gamma>0.0</gamma> <!-- input value weighing factor for -->
  453. <!-- unfiltered derivative error -->
  454. <Ti>25.0</Ti> <!-- integrator time -->
  455. <Td>0.00000001</Td> <!-- derivator time -->
  456. <u_min>-45.33</u_min> <!-- minimum output clamp -->
  457. <u_max>45.33</u_max> <!-- maximum output clamp -->
  458. </config>
  459. </pid-controller>
  460. <!-- Stage #2 drives the elevator-trim to achieve the desired climb rate. -->
  461. <pid-controller>
  462. <name>Altitude Hold (Altimeter based) Stage 2</name>
  463. <debug>false</debug>
  464. <enable>
  465. <prop>/autopilot/locks/altitude</prop>
  466. <value>agl-hold</value>
  467. </enable>
  468. <input>
  469. <prop>/velocities/vertical-speed-fps</prop>
  470. </input>
  471. <reference>
  472. <prop>/autopilot/internal/target-climb-rate-fps</prop>
  473. </reference>
  474. <output>
  475. <prop>/controls/flight/elevator-trim</prop>
  476. </output>
  477. <config>
  478. <Kp>-0.0025</Kp> <!-- proportional gain -->
  479. <beta>1.0</beta> <!-- input value weighing factor -->
  480. <alpha>0.1</alpha> <!-- low pass filter weighing factor -->
  481. <gamma>0.0</gamma> <!-- input value weighing factor for -->
  482. <!-- unfiltered derivative error -->
  483. <Ti>10.0</Ti> <!-- integrator time -->
  484. <Td>0.00001</Td> <!-- derivator time -->
  485. <u_min>-1.0</u_min> <!-- minimum output clamp -->
  486. <u_max>1.0</u_max> <!-- maximum output clamp -->
  487. </config>
  488. </pid-controller>
  489. <!-- Glideslope hold. -->
  490. <!-- Stage #2 drives the elevator-trim to achieve the desired climb rate. -->
  491. <pid-controller>
  492. <name>Glideslop Hold</name>
  493. <debug>false</debug>
  494. <enable>
  495. <prop>/autopilot/locks/altitude</prop>
  496. <value>gs1-hold</value>
  497. </enable>
  498. <input>
  499. <prop>/velocities/vertical-speed-fps</prop>
  500. </input>
  501. <reference>
  502. <prop>/instrumentation/nav[0]/gs-rate-of-climb</prop>
  503. </reference>
  504. <output>
  505. <prop>/controls/flight/elevator-trim</prop>
  506. </output>
  507. <config>
  508. <Kp>-0.005</Kp> <!-- proportional gain -->
  509. <beta>1.0</beta> <!-- input value weighing factor -->
  510. <alpha>0.1</alpha> <!-- low pass filter weighing factor -->
  511. <gamma>0.0</gamma> <!-- input value weighing factor for -->
  512. <!-- unfiltered derivative error -->
  513. <Ti>10.0</Ti> <!-- integrator time -->
  514. <Td>0.00001</Td> <!-- derivator time -->
  515. <u_min>-1.0</u_min> <!-- minimum output clamp -->
  516. <u_max>1.0</u_max> <!-- maximum output clamp -->
  517. </config>
  518. </pid-controller>
  519. <!-- vertical speed hold -->
  520. <pid-controller>
  521. <name>Vertical Speed Hold</name>
  522. <debug>false</debug>
  523. <enable>
  524. <prop>/autopilot/locks/altitude</prop>
  525. <value>vertical-speed-hold</value>
  526. </enable>
  527. <input>
  528. <prop>/velocities/vertical-speed-fps</prop>
  529. </input>
  530. <reference>
  531. <prop>/autopilot/settings/vertical-speed-fpm</prop>
  532. <scale>0.01667</scale>
  533. </reference>
  534. <output>
  535. <prop>/controls/flight/elevator-trim</prop>
  536. </output>
  537. <config>
  538. <Kp>-0.0025</Kp> <!-- proportional gain -->
  539. <beta>1.0</beta> <!-- input value weighing factor -->
  540. <alpha>0.1</alpha> <!-- low pass filter weighing factor -->
  541. <gamma>0.0</gamma> <!-- input value weighing factor for -->
  542. <!-- unfiltered derivative error -->
  543. <Ti>10.0</Ti> <!-- integrator time -->
  544. <Td>0.00001</Td> <!-- derivator time -->
  545. <u_min>-1.0</u_min> <!-- minimum output clamp -->
  546. <u_max>1.0</u_max> <!-- maximum output clamp -->
  547. </config>
  548. </pid-controller>
  549. <!-- =============================================================== -->
  550. <!-- Velocity Modes -->
  551. <!-- =============================================================== -->
  552. <!-- Auto throttle -->
  553. <pid-controller>
  554. <name>Auto Throttle (5 sec lookahead)</name>
  555. <debug>false</debug>
  556. <enable>
  557. <prop>/autopilot/locks/speed</prop>
  558. <value>speed-with-throttle</value>
  559. </enable>
  560. <input>
  561. <prop>/autopilot/internal/lookahead-5-sec-airspeed-kt</prop>
  562. </input>
  563. <reference>
  564. <prop>/autopilot/settings/target-speed-kt</prop>
  565. </reference>
  566. <output>
  567. <prop>/controls/engines/engine[0]/throttle</prop>
  568. <prop>/controls/engines/engine[1]/throttle</prop>
  569. <prop>/controls/engines/engine[2]/throttle</prop>
  570. <prop>/controls/engines/engine[3]/throttle</prop>
  571. </output>
  572. <config>
  573. <Kp>0.1</Kp> <!-- proportional gain -->
  574. <beta>1.0</beta> <!-- input value weighing factor -->
  575. <alpha>0.1</alpha> <!-- low pass filter weighing factor -->
  576. <gamma>0.0</gamma> <!-- input value weighing factor for -->
  577. <!-- unfiltered derivative error -->
  578. <Ti>5.0</Ti> <!-- integrator time -->
  579. <Td>0.00001</Td> <!-- derivator time -->
  580. <u_min>0.0</u_min> <!-- minimum output clamp -->
  581. <u_max>1.00</u_max> <!-- maximum output clamp -->
  582. </config>
  583. </pid-controller>
  584. <!-- Hold speed by varying pitch (Two stage cascading controller) -->
  585. <pid-controller>
  586. <name>Speed hold (vary pitch) Stage #1</name>
  587. <debug>false</debug>
  588. <enable>
  589. <prop>/autopilot/locks/speed</prop>
  590. <value>speed-with-pitch</value>
  591. </enable>
  592. <input>
  593. <prop>/autopilot/internal/lookahead-5-sec-airspeed-kt</prop>
  594. </input>
  595. <reference>
  596. <prop>/autopilot/settings/target-speed-kt</prop>
  597. </reference>
  598. <output>
  599. <prop>/autopilot/settings/target-pitch-deg</prop>
  600. </output>
  601. <config>
  602. <Kp>-1.0</Kp> <!-- proportional gain -->
  603. <beta>1.0</beta> <!-- input value weighing factor -->
  604. <alpha>0.1</alpha> <!-- low pass filter weighing factor -->
  605. <gamma>0.0</gamma> <!-- input value weighing factor for -->
  606. <!-- unfiltered derivative error -->
  607. <Ti>1.0</Ti> <!-- integrator time -->
  608. <Td>0.00001</Td> <!-- derivator time -->
  609. <u_min>-15.0</u_min><!-- minimum output clamp -->
  610. <u_max>15.0</u_max> <!-- maximum output clamp -->
  611. </config>
  612. </pid-controller>
  613. <pid-controller>
  614. <name>Speed hold (vary pitch) Stage #2</name>
  615. <debug>false</debug>
  616. <enable>
  617. <prop>/autopilot/locks/speed</prop>
  618. <value>speed-with-pitch</value>
  619. </enable>
  620. <input>
  621. <prop>/orientation/pitch-deg</prop>
  622. </input>
  623. <reference>
  624. <prop>/autopilot/settings/target-pitch-deg</prop>
  625. </reference>
  626. <output>
  627. <prop>/controls/flight/elevator-trim</prop>
  628. </output>
  629. <config>
  630. <Kp>-0.05</Kp> <!-- proportional gain -->
  631. <beta>1.0</beta> <!-- input value weighing factor -->
  632. <alpha>0.1</alpha> <!-- low pass filter weighing factor -->
  633. <gamma>0.0</gamma> <!-- input value weighing factor for -->
  634. <!-- unfiltered derivative error -->
  635. <Ti>1.0</Ti> <!-- integrator time -->
  636. <Td>0.00001</Td> <!-- derivator time -->
  637. <u_min>-1.0</u_min> <!-- minimum output clamp -->
  638. <u_max>1.0</u_max> <!-- maximum output clamp -->
  639. </config>
  640. </pid-controller>
  641. <!-- Terrain follow. 2 stage cascade controller. -->
  642. <!-- Stage #1 sets target rate of climb based on diff between current alt -->
  643. <!-- and target altitude. -->
  644. <pi-simple-controller>
  645. <name>Altitude Hold (Altimeter based) Stage 1</name>
  646. <debug>false</debug>
  647. <enable>
  648. <prop>/autopilot/locks/altitude</prop>
  649. <value>terrain-follow</value>
  650. </enable>
  651. <input>
  652. <prop>/position/altitude-ft</prop>
  653. </input>
  654. <reference>
  655. <prop>/autopilot/settings/target-follow-altitude-ft</prop>
  656. </reference>
  657. <output>
  658. <prop>/autopilot/internal/target-climb-rate-fps</prop>
  659. </output>
  660. <config>
  661. <Kp>0.25</Kp> <!-- proportional gain -->
  662. <Ki>0.0</Ki> <!-- integral gain -->
  663. <u_min>-120.00</u_min> <!-- minimum output clamp -16.67-->
  664. <u_max>300.00</u_max> <!-- maximum output clamp 33.33-->
  665. </config>
  666. </pi-simple-controller>
  667. <!-- Stage #2 drives the elevator-trim to achieve the desired climb rate. -->
  668. <pid-controller>
  669. <name>Altitude Hold (Altimeter based) Stage 2</name>
  670. <debug>false</debug>
  671. <enable>
  672. <prop>/autopilot/locks/altitude</prop>
  673. <value>terrain-follow</value>
  674. </enable>
  675. <input>
  676. <prop>/velocities/vertical-speed-fps</prop>
  677. </input>
  678. <reference>
  679. <prop>/autopilot/internal/target-climb-rate-fps</prop>
  680. </reference>
  681. <output>
  682. <prop>/controls/flight/elevator-trim</prop>
  683. </output>
  684. <config>
  685. <Kp>-0.0025</Kp> <!-- proportional gain -0.01 -->
  686. <beta>1.0</beta> <!-- input value weighing factor -->
  687. <alpha>0.1</alpha> <!-- low pass filter weighing factor -->
  688. <gamma>0.0</gamma> <!-- input value weighing factor for -->
  689. <!-- unfiltered derivative error -->
  690. <Ti>10.0</Ti> <!-- integrator time 10.0 -->
  691. <Td>0.00001</Td> <!-- derivator time -->
  692. <u_min>-1</u_min> <!-- minimum output clamp -->
  693. <u_max>1</u_max> <!-- maximum output clamp -->
  694. </config>
  695. </pid-controller>
  696. </PropertyList>