SHARE
TWEET

Untitled

a guest May 16th, 2016 8 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!DOCTYPE airframe SYSTEM "../airframe.dtd">
  2. <!-- This is the UA_Mothra airframe file. The plane is equipped with a lisa MX, two spectrum satteilte receivers, ubox neo gps, xbee pro telemetry link, a current sensor(.6V at 0 A and 40mV/A scale, a vbat in with an external resistor of 2kohm. Firmware is flashed via black magic probe.-->
  3.  
  4. <airframe name="Mothra">
  5.  
  6.   <firmware name="fixedwing">
  7.     <target name="ap" board="lisa_mx_2.1">
  8.      
  9.      <subsystem name="ins" type="alt_float">
  10.        <define name="USE_BAROMETER" value="TRUE"/>
  11.      </subsystem>
  12.  
  13.       <define name="UAARG_MOTHRA"/>
  14.       <define name="USE_ADC"/>
  15.       <define name="USE_I2C1"/>
  16.  
  17.     </target>
  18.  
  19.     <target name="sim" board="pc">
  20.       <subsystem name="ins" type="alt_float"/>
  21.    
  22.     </target>
  23.  
  24.     <subsystem name="radio_control" type="spektrum">
  25.         <define name="RADIO_MODE" value="RADIO_AUX2"/>
  26.         <configure name="USE_SECONDARY_SPEKTRUM_RECEIVER" value="1"/>
  27.     </subsystem>
  28.  
  29.     <subsystem name="actuators"     type="pwm">
  30.      
  31.       <!-- define name="USE_SERVOS_7AND8"/-->
  32.     </subsystem>
  33.    
  34.     <define name="RC_LOST_MODE" value="PPRZ_MODE_AUTO2"/>
  35.     <define name="AGR_CLIMB"/>
  36.     <define name="LOITER_TRIM"/>
  37.     <define name="MEASURE_AIRSPEED"/>
  38.  
  39.  
  40.  
  41.     <subsystem name="gps" type="ublox">
  42.       <configure name="GPS_BAUD" value="B57600"/>
  43.     </subsystem>
  44.     <subsystem name="telemetry" type="transparent">
  45.       <configure name="MODEM_BAUD" value="B57600"/>
  46.     </subsystem>
  47.     <subsystem name="imu" type="lisa_mx_v2.1"/>
  48.     <subsystem name="navigation" />
  49.     <subsystem name="control" />
  50.     <subsystem name="ahrs" type="float_cmpl_quat">
  51.       <define name="ASPIRIN_2_DISABLE_MAG" value="TRUE" />
  52.       <define name="USE_MAGNETOMETER" value="TRUE"/>
  53.       <define name="AHRS_FC_MAG_ID" value="MAG_HMC58XX_SENDER_ID"/>
  54.       <!--define name="AHRS_ACCEL_OMEGA" value=".9"/>
  55.      <define name="AHRS_MAG_OMEGA" value=".9"/--> <!---Adjust this for mag/gyro heading mixing--->
  56.     </subsystem>
  57.    
  58.  
  59.  
  60.     <configure name="NO_LUFTBOOT" value="1"/>
  61.     <configure name="FLASH_MODE" value="SWD"/>
  62.     <!---<configure name="BMP_PORT" value="/dev/ttyACM0"/> -->
  63.  
  64.   </firmware>
  65.  
  66. <!--The following is the commands sections. This deals with how the control surface relate to movement and rc inpu-->
  67.   <commands> <!--The commands the autopilot board outputs-->
  68.     <axis name="THROTTLE" failsafe_value="0"/>
  69.     <axis name="ROLL" failsafe_value="9600"/>
  70.     <axis name="PITCH" failsafe_value="-9600"/>
  71.     <axis name="BRAKE" failsafe_value="0"/>
  72.     <axis name="YAW" failsafe_value="0"/>
  73.     <axis name="GEAR" failsafe_value="0"/>
  74.   </commands>
  75.  
  76. <!-- Actuators Neutral: 1010,1003,1384,1775,1212,1467--->
  77.  
  78.   <servos><!--the servos the outpilot autoputs commands output to-->
  79.     <servo name="THROTTLE" max="2000" neutral="1000" min="1000" no="5"/>
  80.     <servo name="DROP" max="2000" neutral="1500" min="1000" no="0"/>
  81.     <servo name="ELEVATOR" max="1000" neutral="1577" min="2000" no="3"/>
  82.     <servo name="AILERON_RIGHT" max="1800" neutral="1500" min="1000" no="2"/>
  83.     <servo name="AILERON_LEFT" max="2000" neutral="1500" min="1200" no="1"/>
  84.     <servo name="RUDDER" max="2000" neutral="1395" min="1000" no="4"/>
  85.   </servos>
  86.  
  87.  
  88.   <command_laws> <!--How the commands relate to servo movement-->
  89.     <set value="@ROLL+1.3*(@BRAKE)" servo="AILERON_LEFT"/>
  90.     <set value="@ROLL-1.3*(@BRAKE)" servo="AILERON_RIGHT"/>
  91.     <set value="@THROTTLE" servo="THROTTLE"/>
  92.     <set value="@PITCH" servo="ELEVATOR"/>
  93.     <set value="@YAW" servo="RUDDER"/>
  94.     <set value="@GEAR" servo="DROP"/>
  95.   </command_laws>
  96.  
  97.  
  98.   <rc_commands> <!--controls available to pilot in full RC-->
  99.     <set value="@THROTTLE" command="THROTTLE"/>
  100.     <set value="@ROLL-224" command="ROLL"/>
  101.     <set value="@PITCH" command="PITCH"/>
  102.     <set value="@YAW" command="YAW"/>
  103.     <set value="@GEAR" command="GEAR"/>
  104.     <set value="@AUX1+476" command="BRAKE"/>
  105.   </rc_commands>
  106.  
  107.  
  108.   <auto_rc_commands> <!--controls available to pilot in AUTO2-->
  109.     <set value="@YAW" command="YAW"/>
  110.     <set command="GEAR" value="@GEAR"/>
  111.     <set value="@AUX1-476" command="BRAKE"/>
  112.   </auto_rc_commands>
  113.    
  114.  
  115.   <!--The following are sensor calibrations that need to be performed-->
  116.   <!--Note some calibrations are location specific. These need to be modified when flying at different fields-->
  117.   <include href="conf/airframes/UAARG/PF_Smile.xml"/>
  118.  
  119.   <section name="IMU" prefix="IMU_">
  120.     <!--These values can be calibrated by perfectly leveling the plane.-->
  121.     <!--Then open the messages windows and look at the attitude data-->
  122.     <!--Attitude should be completely 0. -->
  123.     <!--If not take the value given, convert to degrees and subtract from current values-->
  124.     <define name="BODY_TO_IMU_PHI" value="0." unit="deg"/>
  125.     <define name="BODY_TO_IMU_THETA" value="0." unit="deg"/>
  126.     <define name="BODY_TO_IMU_PSI" value="0." unit="deg"/>
  127.    
  128. <!-- Calibrate via sw/tools/calibration/calibrate.py-->
  129.  
  130. <define name="MAG_X_NEUTRAL" value="-46"/>
  131. <define name="MAG_Y_NEUTRAL" value="-4"/>
  132. <define name="MAG_Z_NEUTRAL" value="289"/>
  133. <define name="MAG_X_SENS" value="3.00962506336" integer="16"/>
  134. <define name="MAG_Y_SENS" value="2.96508188226" integer="16"/>
  135. <define name="MAG_Z_SENS" value="3.61746210549" integer="16"/>
  136.  
  137.  
  138.     <define name="MAG_X_SIGN" value="1"/>
  139.     <define name="MAG_Y_SIGN" value="1"/>
  140.     <define name="MAG_Z_SIGN" value="-1"/>
  141.  
  142.  
  143.  
  144.     <!-- Current draw magnetic field calibration-->
  145.     <!--Please note that if you dont have any experience in Paparazzi and are not looking online you can enable current calibration raw data from a module. look below at modules and uncomment the module.-->
  146.     <!--
  147.     <define name= "MAG_X_CURRENT_COEF" value="0.0001933874537"/>
  148.     <define name= "MAG_Y_CURRENT_COEF" value="-0.000400915804419"/>
  149.     <define name= "MAG_Z_CURRENT_COEF" value="2.10856499033e-05"/>
  150.     -->
  151.   </section>
  152.  
  153.   <section name="AHRS" prefix="AHRS_"> <!--This is local magnetic field data. Needs to be changed for different fields-->
  154.     <!--CHANGE THIS FOR DIFFERENT LOCATIONS!!-->
  155.     <!--See http://wiki.paparazziuav.org/wiki/Subsystem/ahrs#Local_Magnetic_Field For more details-->
  156.     <!--Note a module that automatically updates this value has been added, see below. (geo_mag.xml)-->
  157.  
  158. <!-- Local magnetic field vector Bremner Field-->
  159. <!--
  160.    <define name="H_X" value="0.259"/>
  161.    <define name="H_Y" value="0.045"/>
  162.    <define name="H_Z" value="0.927124"/>
  163. -->
  164. <!-- club room
  165.    <define name="H_X" value=".523"/>
  166.    <define name="H_Y" value=".256"/>
  167.    <define name="H_Z" value="0.953"/>
  168. -->
  169. <!-- Southport-->
  170.  
  171.     <define name="H_X" value=".262"/>
  172.     <define name="H_Y" value=".018686"/>
  173.     <define name="H_Z" value="0.964887"/>
  174.  
  175.   </section>
  176.  
  177.  
  178.   <section name="BAT">
  179.     <define name="MILLIAMP_AT_FULL_THROTTLE" value="20000"/>
  180.     <define name="CATASTROPHIC_BAT_LEVEL" value="12.7" unit="V"/>
  181.     <define name="CRITIC_BAT_LEVEL" value="14.7" unit="V"/>
  182.     <define name="LOW_BAT_LEVEL" value="15.1" unit="V"/>
  183.     <define name="MAX_BAT_LEVEL" value="16.8" unit="V"/>
  184.     <define name="VOLTAGE_ADC_SCALE" value="0.0052047"/>
  185.     <define name="VOLTAGE_ADC_OFFSET" value="-0.011815"/>
  186.     <define name="VoltageOfAdc(adc)" value="(VOLTAGE_ADC_SCALE * adc + VOLTAGE_ADC_OFFSET)"/>
  187.   </section>
  188.  
  189.  
  190.   <section name="MISC">
  191.     <!--define name="CLIMB_AIRSPEED" value="12." unit="m/s"/ notin us comp-->
  192.     <define name="NOMINAL_AIRSPEED" value="15." unit="m/s"/>
  193.     <define name="CARROT" value="4." unit="s"/> <!-- hen carrot time away from waypoint in go and path, Paparazzi determines it has reached the waypoint-->
  194.     <define name="KILL_MODE_DISTANCE" value="(2.0*MAX_DIST_FROM_HOME)"/>
  195.     <define name="DEFAULT_CIRCLE_RADIUS" value="60."/>
  196.   </section>
  197.  
  198.  
  199. <!--AUTOPILOT TUNING SECTION-->
  200.  
  201.   <include href="conf/airframes/UAARG/EPP_FPV_TUNING.xml"/>
  202.  
  203.  
  204.   <section name="INS" prefix="INS_">
  205.     <define name="ROLL_NEUTRAL_DEFAULT" value="0" unit="deg"/>
  206.     <define name="PITCH_NEUTRAL_DEFAULT" value="0" unit="deg"/>
  207.   </section>
  208.  
  209.  
  210. <!-- End Autopilot Tuning Sections -->
  211.  
  212.   <modules>
  213.     <!--load name="geo_mag.xml"/-->
  214.  
  215.     <load name="airspeed_ets.xml">
  216.       <define name="AIRSPEED_ETS_SYNC_SEND"/>
  217.       <define name="AIRSPEED_ETS_I2C_DEV" value="i2c2"/>
  218.     </load>
  219.  
  220.     <load name="mag_hmc58xx.xml">
  221.       <define name="MODULE_HMC58XX_UPDATE_AHRS"/>
  222.       <configure name="MAG_HMC58XX_I2C_DEV" value="i2c2"/>
  223.       <define name="HMC58XX_CHAN_X" value="1"/>
  224.       <define name="HMC58XX_CHAN_Y" value="0"/>
  225.       <define name="HMC58XX_CHAN_Z" value="2"/>
  226.     </load>
  227.     <!--load name="send_imu_mag_current.xml"/--> <!-- uncomment this line to measure IMU current Calibration-->
  228.  </modules>
  229.  
  230. </airframe>
  231.  
  232.  
  233. <procedure>
  234.  
  235.   <section name="IMU" prefix="IMU_">
  236. <!--
  237.  <define name="ACCEL_X_NEUTRAL" value="-54"/>
  238.  <define name="ACCEL_Y_NEUTRAL" value="-33"/>
  239. -->
  240.   <define name="ACCEL_X_NEUTRAL" value="-18"/>
  241.   <define name="ACCEL_Y_NEUTRAL" value="-82"/>
  242.  
  243.   <define name="ACCEL_Z_NEUTRAL" value="15"/>
  244.   <define name="ACCEL_X_SENS" value="4.88998029654" integer="16"/>
  245.   <define name="ACCEL_Y_SENS" value="4.83817030461" integer="16"/>
  246.   <define name="ACCEL_Z_SENS" value="4.88394458398" integer="16"/>
  247.  
  248.     <!--See http://wiki.paparazziuav.org/wiki/ImuCalibration -->
  249.  
  250.   <!-- Calibrate via sw/tools/calibration/calibrate.py-->
  251.   </section>
  252.  
  253. </procedure>
  254.  
  255.  
  256.  
  257.  
  258.  
  259. <procedure>
  260.  
  261.  
  262.   <section name="FAILSAFE" prefix="FAILSAFE_">
  263.     <define name="DELAY_WITHOUT_GPS" value="2" unit="s"/>
  264.     <define name="DEFAULT_THROTTLE" value="0" unit="%"/>
  265.     <define name="DEFAULT_ROLL" value="17.2" unit="deg"/>
  266.     <define name="DEFAULT_PITCH" value="28.6" unit="deg"/>
  267.   </section>
  268.  
  269.  
  270.   <section name="AUTO1" prefix="AUTO1_"><!-- roll and pitch in auto1-->
  271.     <define name="MAX_ROLL" value="40." unit="deg"/>
  272.     <define name="MAX_PITCH" value="35." unit="deg"/>
  273.   </section>
  274.  
  275.   <section name="HORIZONTAL CONTROL" prefix="H_CTL_">
  276.     <define name="ROLL_MAX_SETPOINT" value="40." unit="deg"/>
  277.     <define name="PITCH_MAX_SETPOINT" value="40." unit="deg"/>
  278.     <define name="PITCH_MIN_SETPOINT" value="-10." unit="deg"/>
  279.  
  280.     <define name="PITCH_PGAIN" value="18513."/>
  281.     <define name="PITCH_DGAIN" value="1.5"/>
  282.  
  283.     <define name="ELEVATOR_OF_ROLL" value="3409"/>
  284.     <define name="AILERON_OF_THROTTLE" value="0.0"/>
  285.  
  286.     <define name="ROLL_ATTITUDE_GAIN" value="21698"/> <!--roll_pgain-->
  287.     <define name="ROLL_RATE_GAIN" value="1500"/><!-- roll_dgain-->
  288.  
  289.     <define name="COURSE_PGAIN" value="1.37"/>
  290.     <define name="COURSE_DGAIN" value="0.3"/> <!-- .3 -->
  291.     <!--define name="COURSE_PRE_BANK_CORRECTION" value="1.47"/--> <!-- usually 1 -->
  292.  
  293.     <define name="ROLL_SLEW" value="0.1"/> <!-- not too sure trying playing around with it. -->
  294.  
  295.   </section>
  296.  
  297.   <section name="VERTICAL CONTROL" prefix="V_CTL_">
  298.  
  299.     <define name="POWER_CTL_BAT_NOMINAL" value="14.7" unit="V"/>
  300.     <define name="THROTTLE_SLEW_LIMITER" value="1.5" unit="s"/>
  301.  
  302.     <define name="ALTITUDE_MAX_CLIMB" value="5."/>
  303.     <define name="AUTO_THROTTLE_NOMINAL_CRUISE_THROTTLE" value="0.56"/>
  304.     <define name="AUTO_THROTTLE_MIN_CRUISE_THROTTLE" value="0.11"/>
  305.     <define name="AUTO_THROTTLE_MAX_CRUISE_THROTTLE" value="0.95"/>
  306.     <define name="AUTO_THROTTLE_LOITER_TRIM" value="3248"/>
  307.     <define name="AUTO_THROTTLE_DASH_TRIM" value="2492"/>
  308.     <define name="AUTO_THROTTLE_CLIMB_THROTTLE_INCREMENT" value="0.075" unit="%/(m/s)"/> <!--throttle_incr-->
  309.     <define name="AUTO_THROTTLE_PGAIN" value="0.01"/>
  310.     <define name="AUTO_THROTTLE_IGAIN" value="0.1"/>
  311.     <define name="AUTO_THROTTLE_PITCH_OF_VZ_PGAIN" value="0.09"/><!--pitch_of_vz-->
  312.  
  313.     <define name="ALTITUDE_PGAIN" value="0.06"/>
  314.  
  315. <!-- comment the following lines do disable AUTO_PITCH -->
  316. <!--
  317.    <define name="AUTO_PITCH_PGAIN" value="0.04"/>
  318.    <define name="AUTO_PITCH_IGAIN" value="0.0"/>
  319.    <define name="AUTO_PITCH_MAX_PITCH" value="RadOfDeg(25)"/>
  320.    <define name="AUTO_PITCH_MIN_PITCH" value="RadOfDeg(-25)"/>
  321. -->
  322.  
  323.   </section>
  324.  
  325.   <section name="NAV" />
  326.  
  327.   <section name="AGGRESSIVE" prefix="AGR_">
  328.     <define name="BLEND_START" value="75"/><!-- Altitude Error to Initiate Aggressive Climb-->
  329.     <define name="BLEND_END" value="15"/><!-- Altitude Error to Blend Aggressive to Regular Climb Modes-->
  330.     <define name="CLIMB_THROTTLE" value="1.00"/><!-- Gaz for Aggressive Climb -->
  331.     <define name="CLIMB_PITCH" value="0.6"/><!-- Pitch for Aggressive Climb -->
  332.     <define name="DESCENT_THROTTLE" value="0.1"/><!-- Gaz for Aggressive Decent -->
  333.     <define name="DESCENT_PITCH" value="-0.25"/><!-- Pitch for Aggressive Decent -->
  334.     <define name="CLIMB_NAV_RATIO" value="0.8"/><!-- Percent Navigation for Altitude Error Equal to Start Altitude -->
  335.     <define name="DESCENT_NAV_RATIO" value="1.0"/>
  336.   </section>
  337.  
  338.  
  339. </procedure>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top