Advertisement
Guest User

airframe file jan2016

a guest
Jan 24th, 2016
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.42 KB | None | 0 0
  1. <!DOCTYPE airframe SYSTEM "../airframe.dtd">
  2. <!--Zephyr II with Umarim Lite-->
  3.  
  4. <airframe name="ZII_photo_ahrs">
  5.  
  6. <!-- ************************* FIRMWARE ************************* -->
  7.  
  8. <firmware name="fixedwing">
  9. <define name="USE_I2C0"/>
  10. <define name="USE_I2C1"/>
  11. <define name="AGR_CLIMB"/>
  12. <define name="USE_AIRSPEED"/>
  13. <define name="STRONG_WIND"/>
  14. <!--define name="USE_KFF_UPDATE"/-->
  15.  
  16.  
  17. <target name="sim" board="pc"/>
  18. <target name="nps" board="pc">
  19. <subsystem name="fdm" type="jsbsim"/>
  20. <define name="IMU_MAG_X_SENS" value="1"/>
  21. <define name="IMU_MAG_Y_SENS" value="1"/>
  22. <define name="IMU_MAG_Z_SENS" value="1"/>
  23. </target>
  24. <target name="ap" board="umarim_lite_2.0"/>
  25.  
  26.  
  27. <subsystem name="radio_control" type="ppm"/>
  28.  
  29. <!--subsystem name="radio_control" type="sbus">
  30. <configure name="SBUS_PORT" value="UART0"/>
  31. </subsystem-->
  32.  
  33. <!-- Communication -->
  34. <subsystem name="telemetry" type="transparent"/>
  35.  
  36. <!-- Actuators are automatically chosen according to board-->
  37. <subsystem name="imu" type="umarim"/>
  38. <subsystem name="ahrs" type="float_dcm"/>
  39. <subsystem name="control" type="energyadaptive"/>
  40. <subsystem name="navigation"/>
  41. <!-- Sensors -->
  42. <subsystem name="gps" type="ublox"/>
  43. <subsystem name="ins" type="alt_float"/>
  44. </firmware>
  45.  
  46. <!-- ************************* MODULES ************************* -->
  47. <modules>
  48. <load name="digital_cam.xml">
  49. <!--define name="DC_SHOOT_ON_BUTTON_RELEASE"/-->
  50. <define name="DC_SHUTTER_GPIO" value="GPIOA,GPIO10"/>
  51. <define name="DC_PUSH" value="gpio_clear"/>
  52. <define name="DC_RELEASE" value="gpio_set"/>
  53. <define name="DC_AUTOSHOOT_QUARTERSEC_PERIOD" value="4"/>
  54. <define name="DC_AUTOSHOOT_DISTANCE_INTERVAL" value="40"/>
  55. <define name="DC_AUTOSHOOT_SURVEY_INTERVAL" value="40"/>
  56. <define name="DC_SHUTTER_DELAY" value="0.1"/>
  57. <define name="DC_SHOT_SYNC_SEND" value="FALSE"/>
  58. </load>
  59. <load name="photogrammetry_calculator.xml">
  60. </load>
  61. <load name="openlog.xml"/>
  62. <load name="nav_survey_zamboni.xml"/>
  63. <load name="airspeed_amsys.xml">
  64. <define name="AIRSPEED_AMSYS_I2C_DEV" value="i2c0"/>
  65. <define name="AIRSPEED_AMSYS_MAXPRESURE" value="1034"/>
  66. <define name="AIRSPEED_AMSYS_SCALE" value="1.0"/>
  67. <define name="AIRSPEED_AMSYS_FILTER" value="0.6"/>
  68. <define name="USE_AIRSPEED_AMSYS" value="TRUE"/>
  69. </load>
  70. <load name="level_trigger.xml"/>
  71. <!--load name="nav_line.xml"/-->
  72.  
  73. </modules>
  74.  
  75. <!-- ************************* SENSORS ************************* -->
  76.  
  77. <section name="IMU" prefix="IMU_">
  78.  
  79. <!-- Calibration Neutral -->
  80. <define name="GYRO_P_NEUTRAL" value="0"/>
  81. <define name="GYRO_Q_NEUTRAL" value="0"/>
  82. <define name="GYRO_R_NEUTRAL" value="0"/>
  83.  
  84. <!-- SENS = 14.375 LSB/(deg/sec) * 57.6 deg/rad = 828 LSB/rad/sec / 12bit FRAC: 4096 / 828 -->
  85. <define name="GYRO_P_SENS" value="4.947" integer="16"/>
  86. <define name="GYRO_Q_SENS" value="4.947" integer="16"/>
  87. <define name="GYRO_R_SENS" value="4.947" integer="16"/>
  88.  
  89. <!-- SENS = 256 LSB/g @ 2.5V [X&Y: 265 LSB/g @ 3.3V] / 9.81 ms2/g = 26.095 LSB/ms2 / 10bit FRAC: 1024 / 26.095 for z and 1024 / 27.01 for X&Y -->
  90. <define name="ACCEL_X_NEUTRAL" value="0"/>
  91. <define name="ACCEL_Y_NEUTRAL" value="2"/>
  92. <define name="ACCEL_Z_NEUTRAL" value="-15"/>
  93.  
  94. <!-- SENS ADXL345 16G 31.2 mg/LSB, accel frac 10bit => 31.2 * 2^10 / 1000 -->
  95. <define name="ACCEL_X_SENS" value="38.1442395325" integer="16"/>
  96. <define name="ACCEL_Y_SENS" value="38.1047091338" integer="16"/>
  97. <define name="ACCEL_Z_SENS" value="39.461186443" integer="16"/>
  98.  
  99. <!-- Just to compile -->
  100. <define name="MAG_X_NEUTRAL" value="0"/>
  101. <define name="MAG_Y_NEUTRAL" value="0"/>
  102. <define name="MAG_Z_NEUTRAL" value="0"/>
  103.  
  104. <define name="BODY_TO_IMU_PHI" value="0"/>
  105. <define name="BODY_TO_IMU_THETA" value="0"/>
  106. <define name="BODY_TO_IMU_PSI" value="0"/>
  107. </section>
  108.  
  109. <section name="INS" prefix="INS_">
  110. <define name="ROLL_NEUTRAL_DEFAULT" value="0." unit="rad"/>
  111. <define name="PITCH_NEUTRAL_DEFAULT" value="0." unit="rad"/>
  112. </section>
  113.  
  114. <!-- ************************* ACTUATORS ************************* -->
  115.  
  116. <servos> <!-- Trimmed for 49% throttle -->
  117. <servo name="MOTOR" no="2" min="1100" neutral="1100" max="1900"/>
  118. <servo name="AILEVON_LEFT" no="1" min="1900" neutral="1500" max="1100"/>
  119. <servo name="AILEVON_RIGHT" no="0" min="1100" neutral="1500" max="1900"/>
  120. </servos>
  121.  
  122. <commands>
  123. <axis name="THROTTLE" failsafe_value="0"/>
  124. <axis name="ROLL" failsafe_value="0"/>
  125. <axis name="PITCH" failsafe_value="10"/>
  126. </commands>
  127.  
  128. <rc_commands>
  129. <set command="THROTTLE" value="@THROTTLE"/>
  130. <set command="ROLL" value="@ROLL"/>
  131. <set command="PITCH" value="@PITCH"/>
  132. </rc_commands>
  133.  
  134. <section name="MIXER">
  135. <define name="AILEVON_AILERON_RATE" value="0.60"/>
  136. <define name="AILEVON_ELEVATOR_RATE" value="0.40"/>
  137. </section>
  138.  
  139. <command_laws>
  140. <let var="aileron" value="@ROLL * AILEVON_AILERON_RATE"/>
  141. <let var="elevator" value="@PITCH * AILEVON_ELEVATOR_RATE"/>
  142. <set servo="MOTOR" value="@THROTTLE"/>
  143. <set servo="AILEVON_LEFT" value="$elevator - $aileron"/>
  144. <set servo="AILEVON_RIGHT" value="$elevator + $aileron"/>
  145. </command_laws>
  146.  
  147. <section name="AUTO1" prefix="AUTO1_">
  148. <define name="MAX_ROLL" value="RadOfDeg(55)"/>
  149. <define name="MAX_PITCH" value="RadOfDeg(45)"/>
  150. </section>
  151.  
  152. <section name="FAILSAFE" prefix="FAILSAFE_">
  153. <define name="DELAY_WITHOUT_GPS" value="2" unit="s"/>
  154. <define name="DEFAULT_THROTTLE" value="0.0" unit="%"/>
  155. <define name="DEFAULT_ROLL" value="0.3" unit="rad"/>
  156. <define name="DEFAULT_PITCH" value="0.05" unit="rad"/>
  157. <define name="HOME_RADIUS" value="100" unit="m"/>
  158. </section>
  159.  
  160. <!-- ************************* GAINS ************************* -->
  161.  
  162.  
  163. <section name="VERTICAL CONTROL" prefix="V_CTL_">
  164.  
  165. <define name="GLIDE_RATIO" value="8"/>
  166. <define name="POWER_CTL_BAT_NOMINAL" value="14.8" unit="volt"/>
  167. <define name="MAX_ACCELERATION" value="1"/>
  168. <define name="THROTTLE_SLEW_LIMITER" value="0.4" unit="m/s/s"/>
  169.  
  170. <define name="ALTITUDE_PGAIN" value="0.15"/>
  171. <define name="ALTITUDE_MAX_CLIMB" value="10"/> <!--default 2, values higher than 3 only for energy loop with airspeed-->
  172.  
  173. <define name="AUTO_THROTTLE_NOMINAL_CRUISE_THROTTLE" value="0.45"/>
  174. <define name="AUTO_THROTTLE_NOMINAL_CRUISE_PITCH" value="0."/> <!-- default 0 -->
  175.  
  176. <define name="AUTO_THROTTLE_CLIMB_THROTTLE_INCREMENT" value="0." unit="%/(m/s)"/>
  177. <define name="AUTO_THROTTLE_PITCH_OF_VZ_PGAIN" value="0."/>
  178.  
  179. <define name="AIRSPEED_PGAIN" value="0.61"/>
  180.  
  181. <define name="AUTO_THROTTLE_OF_AIRSPEED_PGAIN" value="0"/>
  182. <define name="AUTO_THROTTLE_OF_AIRSPEED_IGAIN" value="0"/>
  183.  
  184. <define name="AUTO_PITCH_OF_AIRSPEED_PGAIN" value="0"/>
  185. <define name="AUTO_PITCH_OF_AIRSPEED_IGAIN" value="0"/>
  186. <define name="AUTO_PITCH_OF_AIRSPEED_DGAIN" value="0"/>
  187.  
  188. <define name="ENERGY_TOT_PGAIN" value="0.18"/>
  189. <define name="ENERGY_TOT_IGAIN" value="0.3"/>
  190. <define name="ENERGY_DIFF_PGAIN" value="0.18"/>
  191. <define name="ENERGY_DIFF_IGAIN" value="0.25"/>
  192.  
  193. <define name="AUTO_GROUNDSPEED_SETPOINT" value="13.0" unit="m/s"/>
  194. <define name="AUTO_GROUNDSPEED_PGAIN" value="0.75"/>
  195. <define name="AUTO_GROUNDSPEED_IGAIN" value="0.25"/>
  196.  
  197. </section>
  198. <section name="HORIZONTAL CONTROL" prefix="H_CTL_">
  199.  
  200. <define name="COURSE_PGAIN" value="0.7"/>
  201. <define name="COURSE_DGAIN" value="0.3"/>
  202. <define name="COURSE_PRE_BANK_CORRECTION" value="1."/>
  203.  
  204. <define name="ROLL_MAX_SETPOINT" value="50" unit="deg"/>
  205. <define name="ROLL_ATTITUDE_GAIN" value="7500"/>
  206. <define name="ROLL_RATE_GAIN" value="1500"/>
  207. <define name="ROLL_IGAIN" value="0"/>
  208. <define name="ROLL_KFFA" value="0"/>
  209. <define name="ROLL_KFFD" value="0"/>
  210.  
  211. <define name="PITCH_MAX_SETPOINT" value="35" unit="deg"/>
  212. <define name="PITCH_MIN_SETPOINT" value="-35" unit="deg"/>
  213. <define name="PITCH_PGAIN" value="7000"/>
  214. <define name="PITCH_DGAIN" value="2"/>
  215. <define name="PITCH_IGAIN" value="50"/>
  216. <define name="PITCH_KFFA" value="0"/>
  217. <define name="PITCH_KFFD" value="0"/>
  218.  
  219. <define name="PITCH_OF_ROLL" value="0.06"/>
  220. <define name="AILERON_OF_THROTTLE" value="0.0"/>
  221. </section>
  222.  
  223. <section name="AGGRESSIVE" prefix="AGR_">
  224. <define name="BLEND_START" value="20"/><!-- Altitude Error to Initiate Aggressive Climb CANNOT BE ZERO!!-->
  225. <define name="BLEND_END" value="10"/><!-- Altitude Error to Blend Aggressive to Regular Climb Modes CANNOT BE ZERO!!-->
  226. <define name="CLIMB_THROTTLE" value="0.90"/><!-- Gaz for Aggressive Climb -->
  227. <define name="CLIMB_PITCH" value="0.35"/><!-- Pitch for Aggressive Climb -->
  228. <define name="DESCENT_THROTTLE" value="0.1"/><!-- Gaz for Aggressive Decent -->
  229. <define name="DESCENT_PITCH" value="-0.25"/><!-- Pitch for Aggressive Decent -->
  230. <define name="CLIMB_NAV_RATIO" value="0.8"/><!-- Percent Navigation for Altitude Error Equal to Start Altitude -->
  231. <define name="DESCENT_NAV_RATIO" value="1.0"/>
  232. </section>
  233.  
  234.  
  235. <!-- ************************* MISC ************************* -->
  236. <section name="BAT">
  237. <define name="MILLIAMP_AT_FULL_THROTTLE" value="57000."/>
  238. <define name="CATASTROPHIC_BAT_LEVEL" value="12.8" unit="V"/> <!-- 3S lipo 3.1*3=9.3 -->
  239. <define name="CRITIC_BAT_LEVEL" value="13" unit="V"/>
  240. <define name="LOW_BAT_LEVEL" value="14" unit="V"/>
  241. <define name="MAX_BAT_LEVEL" value="16.8" unit="V"/>
  242. </section>
  243.  
  244. <section name="MISC">
  245. <define name="CLIMB_AIRSPEED" value="16" unit="m/s"/>
  246. <define name="NOMINAL_AIRSPEED" value="17" unit="m/s"/>
  247. <define name="GLIDE_AIRSPEED" value="14." unit="m/s"/>
  248. <define name="RACE_AIRSPEED" value="23." unit="m/s"/>
  249. <define name="STALL_AIRSPEED" value="11.5" unit="m/s"/>
  250. <define name="AIRSPEED_SETPOINT_SLEW" value="0.4" unit="m/s/s"/> <!--default is 1-->
  251.  
  252. <define name="CARROT" value="3." unit="s"/>
  253. <define name="KILL_MODE_DISTANCE" value="(1.5*MAX_DIST_FROM_HOME)"/>
  254. <define name="DEFAULT_CIRCLE_RADIUS" value="80."/>
  255. </section>
  256.  
  257. <section name="Photogrammetry" prefix="PHOTOGRAMMETRY_">
  258. <!-- Camera Parameters -->
  259. <define name="FOCAL_LENGTH" value="16" unit="mm"/>
  260. <define name="SENSOR_WIDTH" value="15.6" unit="mm"/>
  261. <!-- In direction of the plane's wings -->
  262. <define name="SENSOR_HEIGHT" value="23.4" unit="mm"/>
  263. <!-- In direction of the plane's nose -->
  264. <define name="PIXELS_WIDTH" value="3264" unit=""/>
  265.  
  266. <!-- Flight Safety Parameters -->
  267. <define name="HEIGHT_MIN" value="50" unit="m"/>
  268. <define name="HEIGHT_MAX" value="300" unit="m"/>
  269. <define name="RADIUS_MIN" value="50" unit="m"/>
  270. </section>
  271.  
  272. <section name="SIMULATOR" prefix="NPS_">
  273. <define name="JSBSIM_MODEL" value="&quot;Malolo1&quot;"/>
  274. <define name="JSBSIM_LAUNCHSPEED" value="20"/>
  275. <define name="COMMANDS_NB" value="3"/>
  276. <define name="ACTUATOR_NAMES" value="{&quot;throttle-cmd-norm&quot;, &quot;aileron-cmd-norm&quot;, &quot;elevator-cmd-norm&quot;}"/>
  277. <define name="SENSORS_PARAMS" value="&quot;nps_sensors_params_invariant.h&quot;"/>
  278. <define name="JS_AXIS_MODE" value="4"/>
  279. <define name="BYPASS_AHRS" value="TRUE"/>
  280. </section>
  281.  
  282. </airframe>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement