CanberraBI8-autopilot.xml 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631
  1. <?xml version="1.0"?>
  2. <!--
  3. Autopilot Configuration for the Canberra B(I)8.
  4. -->
  5. <!--
  6. This is still in development, so not all of the controllers are
  7. currently used, or work properly.
  8. -->
  9. <PropertyList>
  10. <!-- =============================================================
  11. Common Aileron controllers.
  12. All controllers use the same final stage.
  13. =============================================================
  14. -->
  15. <!--
  16. Common final stage aileron driver controller.
  17. Drives the aileron-trim to achieve the desired deflection.
  18. -->
  19. <pid-controller>
  20. <name>Common Aileron Controller - stage 2</name>
  21. <debug>false</debug>
  22. <enable>
  23. <prop>/autopilot/locks/common-aileron-control</prop>
  24. <value>engaged</value>
  25. </enable>
  26. <input>
  27. <prop>/surface-positions/aileron-pos-norm</prop>
  28. </input>
  29. <reference>
  30. <prop>/autopilot/internal/target-aileron-deflection-norm</prop>
  31. </reference>
  32. <output>
  33. <prop>/controls/flight/aileron</prop>
  34. </output>
  35. <config>
  36. <Ts>0.02</Ts>
  37. <Kp>0.4</Kp>
  38. <beta>1.0</beta>
  39. <alpha>0.1</alpha>
  40. <gamma>0.0</gamma>
  41. <Ti>0.5</Ti>
  42. <Td>0.0001</Td>
  43. <u_min>-1.0</u_min>
  44. <u_max>1.0</u_max>
  45. </config>
  46. </pid-controller>
  47. <!--
  48. Roll hold (common aileron) controller - stage1.
  49. Sets the target aileron deflection for the common aileron controller.
  50. -->
  51. <filter>
  52. <name>Roll Hold (common aileron) filter</name>
  53. <debug>false</debug>
  54. <type>noise-spike</type>
  55. <input>/autopilot/settings/target-roll-deg</input>
  56. <output>/autopilot/internal/target-roll-deg-filtered</output>
  57. <max-rate-of-change>20.0</max-rate-of-change>
  58. </filter>
  59. <pid-controller>
  60. <name>Roll Hold</name>
  61. <debug>false</debug>
  62. <enable>
  63. <prop>/autopilot/locks/ca-roll-hold</prop>
  64. <value>engaged</value>
  65. </enable>
  66. <input>
  67. <prop>/orientation/roll-deg</prop>
  68. </input>
  69. <reference>
  70. <prop>/autopilot/internal/target-roll-deg-filtered</prop>
  71. </reference>
  72. <output>
  73. <prop>/autopilot/internal/target-aileron-deflection-norm</prop>
  74. </output>
  75. <config>
  76. <Ts>0.02</Ts>
  77. <Kp>0.04</Kp>
  78. <beta>1.0</beta>
  79. <alpha>0.1</alpha>
  80. <gamma>0.0</gamma>
  81. <Ti>20.0</Ti>
  82. <Td>0.01</Td>
  83. <u_min>-1.0</u_min>
  84. <u_max>1.0</u_max>
  85. </config>
  86. </pid-controller>
  87. <!--
  88. True Heading hold (common aileron) controller - stage1.
  89. Sets the target roll deg for the Roll Hold controller.
  90. -->
  91. <filter>
  92. <name>True Heading Hold filter</name>
  93. <debug>false</debug>
  94. <type>noise-spike</type>
  95. <input>/autopilot/internal/true-heading-error-deg</input>
  96. <output>/autopilot/internal/true-heading-error-deg-filtered</output>
  97. <max-rate-of-change>10.0</max-rate-of-change>
  98. </filter>
  99. <pid-controller>
  100. <name>True Heading Hold Stage 1</name>
  101. <debug>false</debug>
  102. <enable>
  103. <prop>/autopilot/locks/ca-true-heading-hold</prop>
  104. <value>engaged</value>
  105. </enable>
  106. <input>
  107. <prop>/autopilot/internal/true-heading-error-deg-filtered</prop>
  108. </input>
  109. <reference>
  110. <value>0.0</value>
  111. </reference>
  112. <output>
  113. <prop>/autopilot/settings/target-roll-deg</prop>
  114. </output>
  115. <config>
  116. <Ts>0.02</Ts>
  117. <Kp>-2.0</Kp>
  118. <beta>1.0</beta>
  119. <alpha>0.1</alpha>
  120. <gamma>0.0</gamma>
  121. <Ti>20.0</Ti>
  122. <Td>0.00001</Td>
  123. <u_min>-40.0</u_min>
  124. <u_max>40.0</u_max>
  125. </config>
  126. </pid-controller>
  127. <!--
  128. Nav1 Heading hold (common aileron) controller - stage 1.
  129. The moving average filter is used to smooth the nav1 heading error deg at
  130. extreme ranges but two filters are needed to overcome a bug that seems to
  131. occur when a moving average filter is used on an input that hasn't been
  132. initialised yet and which results in a permenent offset to the output.
  133. The noise spike filter isn't affected by this problem and so provides a
  134. valid input to the moving average filter.
  135. The output from the moving average filter is also used by the nasal
  136. scripts.
  137. -->
  138. <filter>
  139. <name>Nav1 filter 1</name>
  140. <debug>false</debug>
  141. <type>noise-spike</type>
  142. <input>/autopilot/internal/nav1-heading-error-deg</input>
  143. <output>/autopilot/internal/nav1-heading-error-deg-filtered</output>
  144. <max-rate-of-change>20.0</max-rate-of-change>
  145. </filter>
  146. <pid-controller>
  147. <name>Nav1 Hold Stage 1</name>
  148. <debug>false</debug>
  149. <enable>
  150. <prop>/autopilot/locks/heading</prop>
  151. <value>nav1-hold</value>
  152. </enable>
  153. <input>
  154. <prop>/autopilot/internal/nav1-heading-error-deg-filtered</prop>
  155. </input>
  156. <reference>
  157. <value>0.0</value>
  158. </reference>
  159. <output>
  160. <prop>/autopilot/settings/target-roll-deg</prop>
  161. </output>
  162. <config>
  163. <Ts>0.02</Ts>
  164. <Kp>-0.4</Kp>
  165. <beta>1.0</beta>
  166. <alpha>0.1</alpha>
  167. <gamma>0.0</gamma>
  168. <Ti>60</Ti>
  169. <Td>0.000000000000000000000000000000000000001</Td>
  170. <u_min>-30.0</u_min>
  171. <u_max>30.0</u_max>
  172. </config>
  173. </pid-controller>
  174. <!-- =============================================================
  175. Common Elevator controllers.
  176. All controllers use the same final stage.
  177. =============================================================
  178. -->
  179. <!-- Common final stage elevator driver controller.
  180. Drives the elevator-trim to achieve the desired deflection.
  181. -->
  182. <pid-controller>
  183. <name>Common Elevator Controller - Stage 2</name>
  184. <debug>false</debug>
  185. <enable>
  186. <prop>/autopilot/locks/common-elevator-control</prop>
  187. <value>engaged</value>
  188. </enable>
  189. <input>
  190. <prop>/surface-positions/elevator-pos-norm</prop>
  191. </input>
  192. <reference>
  193. <prop>/autopilot/internal/target-elevator-deflection-norm</prop>
  194. </reference>
  195. <output>
  196. <prop>/controls/flight/elevator-trim</prop>
  197. </output>
  198. <config>
  199. <Ts>0.02</Ts>
  200. <Kp>0.4</Kp>
  201. <beta>1.0</beta>
  202. <alpha>0.1</alpha>
  203. <gamma>0.0</gamma>
  204. <Ti>0.5</Ti>
  205. <Td>0.0001</Td>
  206. <u_min>-1.0</u_min>
  207. <u_max>1.0</u_max>
  208. </config>
  209. </pid-controller>
  210. <!--
  211. VFPS hold (common elevator) controller - stage1.
  212. Sets the target elevator deflection for the common elevator controller.
  213. -->
  214. <filter>
  215. <name>VFPS Hold (common elevator) filter</name>
  216. <debug>false</debug>
  217. <type>noise-spike</type>
  218. <input>/autopilot/settings/target-climb-rate-fps</input>
  219. <output>/autopilot/internal/target-climb-rate-fps-filtered</output>
  220. <max-rate-of-change>4.0</max-rate-of-change>
  221. </filter>
  222. <pid-controller>
  223. <name>VFPS Hold</name>
  224. <debug>false</debug>
  225. <enable>
  226. <prop>/autopilot/locks/ce-vfps-hold</prop>
  227. <value>engaged</value>
  228. </enable>
  229. <input>
  230. <prop>/velocities/vertical-speed-fps</prop>
  231. </input>
  232. <reference>
  233. <prop>/autopilot/internal/target-climb-rate-fps-filtered</prop>
  234. </reference>
  235. <output>
  236. <prop>/autopilot/internal/target-elevator-deflection-norm</prop>
  237. </output>
  238. <config>
  239. <Ts>0.02</Ts>
  240. <Kp>-0.01</Kp>
  241. <beta>1.0</beta>
  242. <alpha>0.1</alpha>
  243. <gamma>0.0</gamma>
  244. <Ti>10.0</Ti>
  245. <Td>0.0000001</Td>
  246. <u_min>-1.0</u_min>
  247. <u_max>1.0</u_max>
  248. </config>
  249. </pid-controller>
  250. <!--
  251. Pitch hold (common elevator) controller.
  252. Sets the target elevator deflection for the common elevator controller.
  253. -->
  254. <filter>
  255. <name>Pitch Hold (common elevator) filter</name>
  256. <debug>false</debug>
  257. <type>noise-spike</type>
  258. <input>/autopilot/settings/target-pitch-deg</input>
  259. <output>/autopilot/internal/target-pitch-deg-filtered</output>
  260. <max-rate-of-change>2.0</max-rate-of-change>
  261. </filter>
  262. <pid-controller>
  263. <name>Pitch Hold</name>
  264. <debug>false</debug>
  265. <enable>
  266. <prop>/autopilot/locks/ce-pitch-hold</prop>
  267. <value>engaged</value>
  268. </enable>
  269. <input>
  270. <prop>/orientation/pitch-deg</prop>
  271. </input>
  272. <reference>
  273. <prop>/autopilot/internal/target-pitch-deg-filtered</prop>
  274. </reference>
  275. <output>
  276. <prop>/autopilot/internal/target-elevator-deflection-norm</prop>
  277. </output>
  278. <config>
  279. <Ts>0.02</Ts>
  280. <Kp>-0.08</Kp>
  281. <beta>1.0</beta>
  282. <alpha>0.1</alpha>
  283. <gamma>0.0</gamma>
  284. <Ti>4.0</Ti>
  285. <Td>0.2</Td>
  286. <u_min>-1.0</u_min>
  287. <u_max>1.0</u_max>
  288. </config>
  289. </pid-controller>
  290. <!--
  291. Altitude hold (common elevator) controller.
  292. Sets a target climb rate for the VFPS controller
  293. -->
  294. <filter>
  295. <name>Atitude Hold (common elevator) filter</name>
  296. <debug>false</debug>
  297. <type>noise-spike</type>
  298. <input>/autopilot/settings/target-altitude-ft</input>
  299. <output>/autopilot/internal/target-altitude-ft-filtered</output>
  300. <max-rate-of-change>100.0</max-rate-of-change>
  301. </filter>
  302. <pid-controller>
  303. <name>Altitude Hold (common elevator) stage 1</name>
  304. <debug>false</debug>
  305. <enable>
  306. <prop>/autopilot/locks/ce-altitude-hold</prop>
  307. <value>engaged</value>
  308. </enable>
  309. <input>
  310. <prop>/position/altitude-ft</prop>
  311. </input>
  312. <reference>
  313. <prop>/autopilot/internal/target-altitude-ft-filtered</prop>
  314. </reference>
  315. <output>
  316. <prop>/autopilot/settings/target-climb-rate-fps</prop>
  317. </output>
  318. <config>
  319. <Ts>0.02</Ts>
  320. <Kp>0.1</Kp>
  321. <beta>1.0</beta>
  322. <alpha>0.01</alpha>
  323. <gamma>0.0</gamma>
  324. <Ti>40.0</Ti>
  325. <Td>0.0000000000000000000000001</Td>
  326. <u_min>-60.0</u_min>
  327. <u_max>40.0</u_max>
  328. </config>
  329. </pid-controller>
  330. <!--
  331. AGL hold (common elevator) controller.
  332. Sets a target climb rate for the VFPS controller
  333. -->
  334. <filter>
  335. <name>AGL Hold filter</name>
  336. <debug>false</debug>
  337. <type>noise-spike</type>
  338. <input>/position/altitude-agl-ft</input>
  339. <output>/autopilot/internal/altitude-agl-ft-filtered</output>
  340. <max-rate-of-change>100</max-rate-of-change>
  341. </filter>
  342. <pid-controller>
  343. <name>AGL Hold (common elevator) Stage 1</name>
  344. <debug>false</debug>
  345. <enable>
  346. <prop>/autopilot/locks/ce-agl-hold</prop>
  347. <value>engaged</value>
  348. </enable>
  349. <input>
  350. <prop>/autopilot/internal/altitude-agl-ft-filtered</prop>
  351. </input>
  352. <reference>
  353. <prop>/autopilot/settings/target-agl-ft</prop>
  354. </reference>
  355. <output>
  356. <prop>/autopilot/settings/target-climb-rate-fps</prop>
  357. </output>
  358. <config>
  359. <Ts>0.02</Ts>
  360. <Kp>0.25</Kp>
  361. <beta>1.0</beta>
  362. <alpha>0.01</alpha>
  363. <gamma>0.0</gamma>
  364. <Ti>20.0</Ti>
  365. <Td>0.000001</Td>
  366. <u_min>-30.0</u_min>
  367. <u_max>180.0</u_max>
  368. </config>
  369. </pid-controller>
  370. <!--
  371. Mach Climb Hold (common elevator) controller - stage 1.
  372. -->
  373. <pid-controller>
  374. <name>Mach Lock Climb (common elevator) Stage 1</name>
  375. <debug>false</debug>
  376. <enable>
  377. <prop>/autopilot/locks/altitude</prop>
  378. <value>mach-climb</value>
  379. </enable>
  380. <input>
  381. <prop>/autopilot/settings/target-mach</prop>
  382. </input>
  383. <reference>
  384. <prop>/velocities/mach</prop>
  385. </reference>
  386. <output>
  387. <prop>/autopilot/settings/target-climb-rate-fps</prop>
  388. </output>
  389. <config>
  390. <Ts>0.02</Ts>
  391. <Kp>400.0</Kp>
  392. <beta>1.0</beta>
  393. <alpha>0.1</alpha>
  394. <gamma>0.0</gamma>
  395. <Ti>120.0</Ti>
  396. <Td>0.0000000000000000000000000000000001</Td>
  397. <u_min>0.0</u_min>
  398. <u_max>80.0</u_max>
  399. </config>
  400. </pid-controller>
  401. <!--
  402. ==============
  403. Velocity Modes
  404. ==============
  405. -->
  406. <!-- Simple Auto throttle -->
  407. <pid-controller>
  408. <name>Auto Throttle (5 sec lookahead)</name>
  409. <debug>false</debug>
  410. <enable>
  411. <prop>/autopilot/locks/speed</prop>
  412. <value>speed-with-throttle</value>
  413. </enable>
  414. <input>
  415. <prop>/autopilot/internal/lookahead-5-sec-airspeed-kt</prop>
  416. </input>
  417. <reference>
  418. <prop>/autopilot/settings/target-speed-kt</prop>
  419. </reference>
  420. <output>
  421. <prop>/controls/engines/engine[0]/throttle</prop>
  422. <prop>/controls/engines/engine[1]/throttle</prop>
  423. </output>
  424. <config>
  425. <Ts>0.02</Ts>
  426. <Kp>0.05</Kp> <!-- proportional gain -->
  427. <beta>1.0</beta> <!-- input value weighing factor -->
  428. <alpha>0.1</alpha> <!-- low pass filter weighing factor -->
  429. <gamma>0.0</gamma> <!-- input value weighing factor for -->
  430. <!-- unfiltered derivative error -->
  431. <Ti>20.0</Ti> <!-- integrator time -->
  432. <Td>0.00001</Td> <!-- derivator time -->
  433. <u_min>0.0</u_min> <!-- minimum output clamp -->
  434. <u_max>1.0</u_max> <!-- maximum output clamp -->
  435. </config>
  436. </pid-controller>
  437. <!-- Hold speed by varying pitch (Two stage cascading controller) -->
  438. <pid-controller>
  439. <name>Speed hold (vary pitch) Stage #1</name>
  440. <debug>false</debug>
  441. <enable>
  442. <prop>/autopilot/locks/speed</prop>
  443. <value>speed-with-pitch</value>
  444. </enable>
  445. <input>
  446. <prop>/autopilot/internal/lookahead-5-sec-airspeed-kt</prop>
  447. </input>
  448. <reference>
  449. <prop>/autopilot/settings/target-speed-kt</prop>
  450. </reference>
  451. <output>
  452. <prop>/autopilot/settings/target-pitch-deg</prop>
  453. </output>
  454. <config>
  455. <Ts>0.02</Ts>
  456. <Kp>-1.0</Kp> <!-- proportional gain -->
  457. <beta>1.0</beta> <!-- input value weighing factor -->
  458. <alpha>0.1</alpha> <!-- low pass filter weighing factor -->
  459. <gamma>0.0</gamma> <!-- input value weighing factor for -->
  460. <!-- unfiltered derivative error -->
  461. <Ti>1.0</Ti> <!-- integrator time -->
  462. <Td>0.00001</Td> <!-- derivator time -->
  463. <u_min>-15.0</u_min><!-- minimum output clamp -->
  464. <u_max>15.0</u_max> <!-- maximum output clamp -->
  465. </config>
  466. </pid-controller>
  467. <pid-controller>
  468. <name>Speed hold (vary pitch) Stage #2</name>
  469. <debug>false</debug>
  470. <enable>
  471. <prop>/autopilot/locks/speed</prop>
  472. <value>speed-with-pitch</value>
  473. </enable>
  474. <input>
  475. <prop>/orientation/pitch-deg</prop>
  476. </input>
  477. <reference>
  478. <prop>/autopilot/settings/target-pitch-deg</prop>
  479. </reference>
  480. <output>
  481. <prop>/controls/flight/elevator-trim</prop>
  482. </output>
  483. <config>
  484. <Ts>0.02</Ts>
  485. <Kp>-0.05</Kp> <!-- proportional gain -->
  486. <beta>1.0</beta> <!-- input value weighing factor -->
  487. <alpha>0.1</alpha> <!-- low pass filter weighing factor -->
  488. <gamma>0.0</gamma> <!-- input value weighing factor for -->
  489. <!-- unfiltered derivative error -->
  490. <Ti>1.0</Ti> <!-- integrator time -->
  491. <Td>0.00001</Td> <!-- derivator time -->
  492. <u_min>-1.0</u_min> <!-- minimum output clamp -->
  493. <u_max>1.0</u_max> <!-- maximum output clamp -->
  494. </config>
  495. </pid-controller>
  496. <!--
  497. ==================
  498. Custom Controllers
  499. ==================
  500. -->
  501. <!-- Auto throttle (Mach Hold)-->
  502. <pid-controller>
  503. <name>Auto Throttle (Mach Hold)</name>
  504. <debug>false</debug>
  505. <enable>
  506. <prop>/autopilot/locks/speed</prop>
  507. <value>mach-with-throttle</value>
  508. </enable>
  509. <input>
  510. <prop>/velocities/mach</prop>
  511. </input>
  512. <reference>
  513. <prop>/autopilot/settings/target-mach</prop>
  514. </reference>
  515. <output>
  516. <prop>/controls/engines/engine[0]/throttle</prop>
  517. <prop>/controls/engines/engine[1]/throttle</prop>
  518. </output>
  519. <config>
  520. <Ts>0.02</Ts>
  521. <Kp>8.0</Kp> <!-- proportional gain -->
  522. <beta>1.0</beta> <!-- input value weighing factor -->
  523. <alpha>0.1</alpha> <!-- low pass filter weighing factor -->
  524. <gamma>0.0</gamma> <!-- input value weighing factor for -->
  525. <!-- unfiltered derivative error -->
  526. <Ti>8.0</Ti> <!-- integrator time -->
  527. <Td>0.00001</Td> <!-- derivator time -->
  528. <u_min>0.0</u_min> <!-- minimum output clamp -->
  529. <u_max>1.0</u_max> <!-- maximum output clamp -->
  530. </config>
  531. </pid-controller>
  532. <!-- Simple Ground Roll Rudder Heading Hold -->
  533. <pid-controller>
  534. <name>Ground Roll Rudder hold</name>
  535. <debug>false</debug>
  536. <enable>
  537. <prop>/autopilot/locks/rudder-control</prop>
  538. <value>rudder-hold</value>
  539. </enable>
  540. <input>
  541. <prop>/orientation/heading-deg</prop>
  542. </input>
  543. <reference>
  544. <prop>/autopilot/settings/ground-roll-heading-deg</prop>
  545. </reference>
  546. <output>
  547. <prop>/controls/flight/rudder</prop>
  548. </output>
  549. <config>
  550. <Ts>0.02</Ts>
  551. <Kp>0.2</Kp> <!-- proportional gain -->
  552. <beta>1.0</beta> <!-- input value weighing factor -->
  553. <alpha>0.1</alpha> <!-- low pass filter weighing factor -->
  554. <gamma>0.0</gamma> <!-- input value weighing factor for -->
  555. <!-- unfiltered derivative error -->
  556. <Ti>8.0</Ti> <!-- integrator time -->
  557. <Td>0.000000000000000000000000000000001</Td> <!-- derivator time -->
  558. <u_min>-1.0</u_min> <!-- minimum output clamp -->
  559. <u_max>1.0</u_max> <!-- maximum output clamp -->
  560. </config>
  561. </pid-controller>
  562. <!-- Simple AoA-by-speed Hold -->
  563. <pid-controller>
  564. <name>AoA-by-speed Hold</name>
  565. <debug>false</debug>
  566. <enable>
  567. <prop>/autopilot/locks/aoa</prop>
  568. <value>aoa-with-speed</value>
  569. </enable>
  570. <input>
  571. <prop>/orientation/alpha-deg</prop>
  572. </input>
  573. <reference>
  574. <prop>/autopilot/settings/target-aoa-deg</prop>
  575. </reference>
  576. <output>
  577. <prop>/autopilot/settings/target-speed-kt</prop>
  578. </output>
  579. <config>
  580. <Ts>0.02</Ts>
  581. <Kp>-2.0</Kp> <!-- proportional gain -->
  582. <beta>1.0</beta> <!-- input value weighing factor -->
  583. <alpha>0.1</alpha> <!-- low pass filter weighing factor -->
  584. <gamma>0.0</gamma> <!-- input value weighing factor for -->
  585. <!-- unfiltered derivative error -->
  586. <Ti>40.0</Ti> <!-- integrator time -->
  587. <Td>0.00001</Td> <!-- derivator time -->
  588. <u_min>70.0</u_min> <!-- minimum output clamp -->
  589. <u_max>110.0</u_max> <!-- maximum output clamp -->
  590. </config>
  591. </pid-controller>
  592. </PropertyList>