propulsion-rules.xml 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. <?xml version="1.0"?>
  2. <PropertyList>
  3. <!--
  4. Propulsion with turbines for YASIM helicopters.
  5. Implements property rules and a governor PID controller that is configured by the Nasal
  6. propulsion.nas script.
  7. To use this you must load propulsion.nas from the aircraft-set file.
  8. This file propulsion-rules.xml must reside in the aircrafts Systems folder and must be
  9. included via the aircraft-set file in the property tree as autopilot.
  10. -->
  11. <!-- engine 1 freewheel -->
  12. <filter>
  13. <type>gain</type>
  14. <gain>1.0</gain>
  15. <reference>0</reference>
  16. <input> <!-- if rotor running n2 diff -->
  17. <condition>
  18. <greater-than>
  19. <property>rotors/main/rpm-pct</property>
  20. <value>0.01</value>
  21. </greater-than>
  22. </condition>
  23. <expression>
  24. <dif>
  25. <property>engines/engine[0]/n2-pct</property>
  26. <property>rotors/main/rpm-pct</property>
  27. </dif>
  28. </expression>
  29. </input>
  30. <input> <!-- if rotor not running set to 0 -->
  31. <condition>
  32. <less-than>
  33. <property>rotors/main/rpm-pct</property>
  34. <value>0.01</value>
  35. </less-than>
  36. </condition>
  37. <value>0.0</value>
  38. </input>
  39. <output>
  40. <property>controls/rotor/gov/n2-diff[0]</property>
  41. </output>
  42. </filter>
  43. <filter>
  44. <type>gain</type>
  45. <gain>1.0</gain>
  46. <reference>0</reference>
  47. <input>
  48. <expression>
  49. <table>
  50. <property>controls/rotor/gov/n2-diff[0]</property>
  51. <entry><ind>-100.0</ind><dep>1.0</dep></entry>
  52. <entry><ind>-1.0</ind><dep>1.0</dep></entry>
  53. <entry><ind>0.0</ind><dep>0.0</dep></entry>
  54. <entry><ind>100.0</ind><dep>0.0</dep></entry>
  55. </table>
  56. </expression>
  57. </input>
  58. <output>
  59. <property>engines/engine[0]/freewheel</property>
  60. </output>
  61. </filter>
  62. <!-- engine 2 freewheel -->
  63. <filter>
  64. <type>gain</type>
  65. <gain>1.0</gain>
  66. <reference>0</reference>
  67. <input> <!-- if rotor running n2 diff -->
  68. <condition>
  69. <greater-than>
  70. <property>rotors/main/rpm-pct</property>
  71. <value>0.01</value>
  72. </greater-than>
  73. </condition>
  74. <expression>
  75. <dif>
  76. <property>engines/engine[1]/n2-pct</property>
  77. <property>rotors/main/rpm-pct</property>
  78. </dif>
  79. </expression>
  80. </input>
  81. <input> <!-- if rotor not running set to 0 -->
  82. <condition>
  83. <less-than>
  84. <property>rotors/main/rpm-pct</property>
  85. <value>0.01</value>
  86. </less-than>
  87. </condition>
  88. <value>0.0</value>
  89. </input>
  90. <output>
  91. <property>controls/rotor/gov/n2-diff[1]</property>
  92. </output>
  93. </filter>
  94. <filter>
  95. <type>gain</type>
  96. <gain>1.0</gain>
  97. <reference>0</reference>
  98. <input>
  99. <expression>
  100. <table>
  101. <property>controls/rotor/gov/n2-diff[1]</property>
  102. <entry><ind>-100.0</ind><dep>1.0</dep></entry>
  103. <entry><ind>-1.0</ind><dep>1.0</dep></entry>
  104. <entry><ind>0.0</ind><dep>0.0</dep></entry>
  105. <entry><ind>100.0</ind><dep>0.0</dep></entry>
  106. </table>
  107. </expression>
  108. </input>
  109. <output>
  110. <property>engines/engine[1]/freewheel</property>
  111. </output>
  112. </filter>
  113. <!-- governor target rpm difference -->
  114. <filter>
  115. <type>gain</type>
  116. <gain>1.0</gain>
  117. <reference>controls/rotor/gov/reltarget-internal</reference>
  118. <input>
  119. <expression>
  120. <prod>
  121. <property>rotors/main/rpm-pct</property>
  122. <value>0.01</value>
  123. </prod>
  124. </expression>
  125. </input>
  126. <output>
  127. <property>controls/rotor/gov/reltarget-diff</property>
  128. </output>
  129. </filter>
  130. <!--unused : alternatively to using YASIMs internal PD for a gonernor, this PID has been used
  131. <pid-controller>
  132. <name>Rotor Governor</name>
  133. <debug>false</debug>
  134. <input>
  135. <property>controls/rotor/gov/reltarget-diff</property>
  136. </input>
  137. <reference>
  138. <value>0.0</value>
  139. </reference>
  140. <output>
  141. <property>controls/rotor/gov/maxreltorque</property>
  142. </output>
  143. <config>
  144. <Kp>40</Kp>
  145. <beta>1.0</beta>
  146. <gamma>0.0</gamma>
  147. <alpha>0.1</alpha>
  148. <Ti>1.0</Ti>
  149. <Td>0.001</Td>
  150. <u_min>0.0</u_min>
  151. <u_max>1.2</u_max>
  152. </config>
  153. </pid-controller>
  154. <filter>
  155. <name>Governor Power Limiter</name>
  156. <type>gain</type>
  157. <gain>1.0</gain>
  158. <reference>0</reference>
  159. <input>
  160. <condition>
  161. <greater-than>
  162. <property>controls/rotor/gov/maxreltorque</property>
  163. <property>controls/rotor/gov/maxrelpower</property>
  164. </greater-than>
  165. </condition>
  166. <property>controls/rotor/gov/maxrelpower</property>
  167. </input>
  168. <input>
  169. <property>controls/rotor/gov/maxreltorque</property>
  170. </input>
  171. <output>
  172. <property>controls/rotor/maxreltorque</property>
  173. </output>
  174. </filter>
  175. -->
  176. </PropertyList>