autopilot3.xml 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300
  1. <?xml version="1.0"?>
  2. <!-- Tornado Autopilot -->
  3. <PropertyList>
  4. <predict-simple>
  5. <name>predicted altitude 5 seconds ahead</name>
  6. <debug>false</debug>
  7. <input>/position/altitude-ft</input>
  8. <output>/autopilot/internal/altitude-5-sec-ahead</output>
  9. <seconds>2.0</seconds>
  10. <filter-gain>0.1</filter-gain>
  11. </predict-simple>
  12. <filter>
  13. <name>Bank Angle Limiter</name>
  14. <type>gain</type>
  15. <debug>false</debug>
  16. <input>
  17. <property>/velocities/airspeed-kt</property>
  18. </input>
  19. <output>
  20. <property>/autopilot/internal/bank-angle-limit-deg</property>
  21. </output>
  22. <gain>0.15</gain>
  23. <u_min>20.0</u_min>
  24. <u_max>45.0</u_max>
  25. </filter>
  26. <filter>
  27. <name>Aileron Command Limiter</name>
  28. <type>gain</type>
  29. <debug>false</debug>
  30. <input>
  31. <property>/controls/flight/wing-sweep</property>
  32. </input>
  33. <output>
  34. <property>/autopilot/internal/aileron-limit-norm</property>
  35. </output>
  36. <gain>0.15</gain>
  37. <u_min>20.0</u_min>
  38. <u_max>45.0</u_max>
  39. </filter>
  40. <filter>
  41. <name>Pitch Hold</name>
  42. <type>gain</type>
  43. <debug>false</debug>
  44. <enable>
  45. <condition>
  46. <equals>
  47. <property>/autopilot/locks/altitude</property>
  48. <value>pitch-hold</value>
  49. </equals>
  50. </condition>
  51. </enable>
  52. <input>
  53. <property>/autopilot/settings/target-pitch-deg</property>
  54. <value>0</value>
  55. </input>
  56. <output>
  57. <property>/autopilot/internal/target-pitch-deg</property>
  58. </output>
  59. <gain>1.0</gain>
  60. <u_min>-70.0</u_min>
  61. <u_max>70.0</u_max>
  62. </filter>
  63. <pid-controller>
  64. <name>Altitude Hold Computer</name>
  65. <debug>false</debug>
  66. <enable>
  67. <condition>
  68. <equals>
  69. <property>/autopilot/locks/altitude</property>
  70. <value>altitude-hold</value>
  71. </equals>
  72. </condition>
  73. </enable>
  74. <input>
  75. <property>/position/altitude-ft</property>
  76. </input>
  77. <reference>
  78. <property>/autopilot/settings/target-altitude-ft</property>
  79. </reference>
  80. <output>
  81. <property>/autopilot/internal/target-pitch-deg</property>
  82. </output>
  83. <config>
  84. <Kp>0.075</Kp> <!-- proportional gain -0.01 -->
  85. <beta>1.0</beta> <!-- input value weighing factor -->
  86. <alpha>0.5</alpha> <!-- low pass filter weighing factor -->
  87. <gamma>0.0</gamma> <!-- input value weighing factor for -->
  88. <!-- unfiltered derivative error -->
  89. <Ti>7.5</Ti> <!-- integrator time 10.0 -->
  90. <Td>0.0001</Td> <!-- derivator time -->
  91. <u_min>-6.0</u_min> <!-- minimum output clamp -->
  92. <u_max>6.0</u_max> <!-- maximum output clamp -->
  93. </config>
  94. </pid-controller>
  95. <pid-controller>
  96. <name>Altitude TFR Computer</name>
  97. <debug>false</debug>
  98. <enable>
  99. <condition>
  100. <equals>
  101. <property>/autopilot/locks/altitude</property>
  102. <value>agl-hold</value>
  103. </equals>
  104. </condition>
  105. </enable>
  106. <input>
  107. <property>/position/altitude-agl-ft</property>
  108. </input>
  109. <reference>
  110. <property>/autopilot/settings/target-agl-ft</property>
  111. </reference>
  112. <output>
  113. <property>/autopilot/internal/target-pitch-deg</property>
  114. </output>
  115. <config>
  116. <Kp>0.075</Kp> <!-- proportional gain -0.01 -->
  117. <beta>1.0</beta> <!-- input value weighing factor -->
  118. <alpha>0.5</alpha> <!-- low pass filter weighing factor -->
  119. <gamma>0.0</gamma> <!-- input value weighing factor for -->
  120. <!-- unfiltered derivative error -->
  121. <Ti>7.5</Ti> <!-- integrator time 10.0 -->
  122. <Td>0.0001</Td> <!-- derivator time -->
  123. <u_min>-10.0</u_min> <!-- minimum output clamp -->
  124. <u_max>15.0</u_max> <!-- maximum output clamp -->
  125. </config>
  126. </pid-controller>
  127. <filter>
  128. <name>Target Roll Computer</name>
  129. <debug>false</debug>
  130. <type>gain</type>
  131. <enable>
  132. <condition>
  133. <or>
  134. <equals>
  135. <property>/autopilot/locks/heading</property>
  136. <value>dg-heading-hold</value>
  137. </equals>
  138. <equals>
  139. <property>/autopilot/locks/heading</property>
  140. <value>true-heading-hold</value>
  141. </equals>
  142. </or>
  143. </condition>
  144. </enable>
  145. <input>
  146. <condition>
  147. <equals>
  148. <property>/autopilot/locks/heading</property>
  149. <value>dg-heading-hold</value>
  150. </equals>
  151. </condition>
  152. <property>/autopilot/internal/heading-bug-error-deg</property>
  153. </input>
  154. <input>
  155. <condition>
  156. <equals>
  157. <property>/autopilot/locks/heading</property>
  158. <value>true-heading-hold</value>
  159. </equals>
  160. </condition>
  161. <property>/autopilot/internal/true-heading-error-deg</property>
  162. </input>
  163. <output>
  164. <property>/autopilot/internal/target-roll-deg</property>
  165. </output>
  166. <gain>5</gain>
  167. <u_min>
  168. <property>/autopilot/internal/bank-angle-limit-deg</property>
  169. <scale>-1.0</scale>
  170. </u_min>
  171. <u_max>
  172. <property>/autopilot/internal/bank-angle-limit-deg</property>
  173. </u_max>
  174. </filter>
  175. <pid-controller>
  176. <name>System Command: Roll</name>
  177. <debug>false</debug>
  178. <enable>
  179. <condition>
  180. <not-equals>
  181. <property>/autopilot/locks/heading</property>
  182. <value />
  183. </not-equals>
  184. </condition>
  185. </enable>
  186. <input>
  187. <property>/orientation/roll-deg</property>
  188. </input>
  189. <reference>
  190. <condition>
  191. <not-equals>
  192. <property>/autopilot/locks/heading</property>
  193. <value>wing-leveler</value>
  194. </not-equals>
  195. </condition>
  196. <property>/autopilot/internal/target-roll-deg</property>
  197. </reference>
  198. <reference>
  199. <condition>
  200. <equals>
  201. <property>/autopilot/locks/heading</property>
  202. <value>wing-leveler</value>
  203. </equals>
  204. </condition>
  205. <value>0</value>
  206. </reference>
  207. <output>
  208. <property>/controls/flight/aileron-trim</property>
  209. </output>
  210. <config>
  211. <Kp>0.0025</Kp> <!-- proportional gain -->
  212. <beta>1.0</beta> <!-- input value weighing factor -->
  213. <alpha>0.1</alpha> <!-- low pass filter weighing factor -->
  214. <gamma>0.0</gamma> <!-- input value weighing factor for -->
  215. <!-- unfiltered derivative error -->
  216. <Ti>5.0</Ti> <!-- integrator time -->
  217. <Td>0.00001</Td> <!-- derivator time -->
  218. <u_min>-0.35</u_min> <!-- minimum output clamp -->
  219. <u_max>0.35</u_max> <!-- maximum output clamp -->
  220. </config>
  221. </pid-controller>
  222. <pid-controller>
  223. <name>System Command: Pitch</name>
  224. <debug>false</debug>
  225. <enable>
  226. <condition>
  227. <not-equals>
  228. <property>/autopilot/locks/altitude</property>
  229. <value />
  230. </not-equals>
  231. </condition>
  232. </enable>
  233. <input>
  234. <property>/orientation/pitch-deg</property>
  235. </input>
  236. <reference>
  237. <property>/autopilot/internal/target-pitch-deg</property>
  238. </reference>
  239. <output>
  240. <property>/controls/flight/elevator</property>
  241. </output>
  242. <config>
  243. <Kp>-0.05</Kp>
  244. <beta>1.0</beta> <!-- input value weighing factor -->
  245. <alpha>0.1</alpha> <!-- low pass filter weighing factor -->
  246. <gamma>0.0</gamma> <!-- input value weighing factor for -->
  247. <Ti>20.0</Ti> <!-- integrator time 10.0 -->
  248. <Td>0.00001</Td> <!-- derivator time -->
  249. <u_min>-0.35</u_min> <!-- minimum output clamp -->
  250. <u_max>0.35</u_max>
  251. </config>
  252. </pid-controller>
  253. <pid-controller>
  254. <name>Auto Throttle</name>
  255. <debug>false</debug>
  256. <enable>
  257. <condition>
  258. <equals>
  259. <property>/autopilot/locks/speed</property>
  260. <value>speed-with-throttle</value>
  261. </equals>
  262. </condition>
  263. </enable>
  264. <input>
  265. <prop>/velocities/airspeed-kt</prop>
  266. </input>
  267. <reference>
  268. <prop>/autopilot/settings/target-speed-kt</prop>
  269. </reference>
  270. <output>
  271. <prop>/controls/engines/engine[0]/throttle</prop>
  272. <prop>/controls/engines/engine[1]/throttle</prop>
  273. </output>
  274. <config>
  275. <Kp>0.01</Kp> <!-- proportional gain -->
  276. <beta>1.0</beta> <!-- input value weighing factor -->
  277. <alpha>0.1</alpha> <!-- low pass filter weighing factor -->
  278. <gamma>0.0</gamma> <!-- input value weighing factor for -->
  279. <!-- unfiltered derivative error -->
  280. <Ti>10.0</Ti> <!-- integrator time -->
  281. <Td>0.00001</Td> <!-- derivator time -->
  282. <u_min>0.0</u_min> <!-- minimum output clamp -->
  283. <u_max>0.84</u_max> <!-- maximum output clamp -->
  284. </config>
  285. </pid-controller>
  286. </PropertyList>