Advertisement
Guest User

servos_7AND8

a guest
Apr 1st, 2015
229
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!DOCTYPE airframe SYSTEM "../airframe.dtd">
  2.  
  3. <!-- this is a quadrotor frame equiped with
  4.      * Autopilot:   Lisa/M 2.0             http://wiki.paparazziuav.org/wiki/Lisa/M_v20
  5.      * IMU:         Aspirin 2.2            http://wiki.paparazziuav.org/wiki/AspirinIMU
  6.      * Actuators:   PWM motor controllers  http://wiki.paparazziuav.org/wiki/Subsystem/actuators#PWM_Supervision
  7.      * GPS:         Ublox                  http://wiki.paparazziuav.org/wiki/Subsystem/gps
  8.      * RC:          two Spektrum sats      http://wiki.paparazziuav.org/wiki/Subsystem/radio_control#Spektrum
  9. -->
  10.  
  11. <airframe name="Quadrotor LisaM_2.0 pwm">
  12.  
  13.   <firmware name="rotorcraft">
  14.     <target name="ap" board="lisa_m_2.0">
  15.     <configure name="HAS_LUFTBOOT" value="0"/>
  16.        
  17.     <subsystem name="radio_control" type="spektrum">
  18.         <define name="RADIO_MODE" value="RADIO_AUX2"/>
  19.         <configure name="USE_SECONDARY_SPEKTRUM_RECEIVER" value="0"/>
  20.         <define name="RADIO_KILL_SWITCH" value="RADIO_GEAR"/>
  21.     </subsystem>
  22.     </target>
  23.  
  24.  
  25.     <target name="nps" board="pc">
  26.       <subsystem name="fdm" type="jsbsim"/>
  27.       <subsystem name="radio_control" type="ppm"/>  
  28.     </target>
  29.  
  30.  
  31.     <configure name="LISA_M_BARO" value="BARO_MS5611_SPI" />
  32.  
  33.     <define name="NO_GPS_LOST_WITH_RC_VALID" value="TRUE"/>    
  34.     <define name="NO_RC_THRUST_LIMIT" value="TRUE"/>       
  35.  
  36.     <subsystem name="actuators"     type="pwm">
  37.     <define name="SERVO_HZ" value="400"/>
  38.     <define name="USE_SERVOS_7AND8"/>
  39.     </subsystem>
  40.  
  41.     <subsystem name="motor_mixing"/>
  42.  
  43.     <subsystem name="telemetry"     type="transparent"/>
  44.  
  45.     <subsystem name="imu"           type="aspirin_v2.2"/>
  46.     <subsystem name="gps"           type="ublox"/>
  47.     <subsystem name="stabilization" type="int_quat"/>
  48.     <subsystem name="ahrs"          type="int_cmpl_quat">
  49.       <define name="AHRS_GRAVITY_HEURISTIC_FACTOR" value="30"/>
  50.     </subsystem>
  51.     <subsystem name="ins"/>
  52.  
  53.     <!--define name="KILL_ON_GROUND_DETECT" value="TRUE"/-->
  54.   </firmware>
  55.  
  56.   <modules>
  57.     OK
  58.     <load name="gps_ubx_ucenter.xml"> -->
  59.  
  60.   <servos driver="Pwm">
  61.     <servo name="FRONT"   no="0" min="1000" neutral="1100" max="1900"/>
  62.     <servo name="BACK"    no="1" min="1000" neutral="1100" max="1900"/>
  63.     <servo name="RIGHT"   no="2" min="1000" neutral="1100" max="1900"/>
  64.     <servo name="LEFT"    no="3" min="1000" neutral="1100" max="1900"/>
  65.   </servos>
  66.  
  67.   <commands>
  68.     <axis name="ROLL"   failsafe_value="0"/>
  69.     <axis name="PITCH"  failsafe_value="0"/>
  70.     <axis name="YAW"    failsafe_value="0"/>
  71.     <axis name="THRUST" failsafe_value="0"/>
  72.   </commands>
  73.  
  74.   <section name="MIXING" prefix="MOTOR_MIXING_">
  75.     <define name="TRIM_ROLL" value="0"/>
  76.     <define name="TRIM_PITCH" value="0"/>
  77.     <define name="TRIM_YAW" value="0"/>
  78.     <define name="NB_MOTOR" value="4"/>
  79.     <define name="SCALE" value="256"/>
  80.  
  81.     <!-- front/back turning CW, right/left CCW -->
  82.  
  83.     <define name="ROLL_COEF"   value="{    0,    0, -256,  256 }"/>
  84.     <define name="PITCH_COEF"  value="{  256, -256,    0,    0 }"/>
  85.     <define name="YAW_COEF"    value="{ -256, -256,  256,  256 }"/>
  86.     <define name="THRUST_COEF" value="{  256,  256,  256,  256 }"/>
  87.   </section>
  88.  
  89.   <command_laws>
  90.     <call fun="motor_mixing_run(autopilot_motors_on,FALSE,values)"/>
  91.     <set servo="FRONT"  value="motor_mixing.commands[0]"/>
  92.     <set servo="BACK"   value="motor_mixing.commands[1]"/>
  93.     <set servo="RIGHT"  value="motor_mixing.commands[2]"/>
  94.     <set servo="LEFT"   value="motor_mixing.commands[3]"/>
  95.   </command_laws>
  96.  
  97.   <section name="IMU" prefix="IMU_">
  98.     <define name="ACCEL_X_NEUTRAL" value="11"/>
  99.     <define name="ACCEL_Y_NEUTRAL" value="11"/>
  100.     <define name="ACCEL_Z_NEUTRAL" value="-25"/>
  101.  
  102.     <!-- replace this with your own calibration -->
  103.     <define name="MAG_X_NEUTRAL" value="-179"/>
  104.     <define name="MAG_Y_NEUTRAL" value="-21"/>
  105.     <define name="MAG_Z_NEUTRAL" value="79"/>
  106.     <define name="MAG_X_SENS" value="4.17334785618" integer="16"/>
  107.     <define name="MAG_Y_SENS" value="3.98885954135" integer="16"/>
  108.     <define name="MAG_Z_SENS" value="4.40442339014" integer="16"/>
  109.  
  110.  
  111. <!-- Burası incelenecek -->
  112.     <define name="BODY_TO_IMU_PHI"   value="180." unit="deg"/>
  113.     <define name="BODY_TO_IMU_THETA" value="0." unit="deg"/>
  114.     <define name="BODY_TO_IMU_PSI"   value="0." unit="deg"/>
  115.   </section>
  116.  
  117.   <section name="AHRS" prefix="AHRS_">
  118.     <define name="H_X" value="0.3770441"/>
  119.     <define name="H_Y" value="0.0193986"/>
  120.     <define name="H_Z" value="0.9259921"/>
  121.   </section>
  122.  
  123.   <section name="INS" prefix="INS_">
  124.   </section>
  125.  
  126.   <section name="STABILIZATION_RATE" prefix="STABILIZATION_RATE_">
  127.     <!-- setpoints -->
  128.     <define name="SP_MAX_P" value="10000"/>
  129.     <define name="SP_MAX_Q" value="10000"/>
  130.     <define name="SP_MAX_R" value="10000"/>
  131.     <define name="DEADBAND_P" value="20"/>
  132.     <define name="DEADBAND_Q" value="20"/>
  133.     <define name="DEADBAND_R" value="200"/>
  134.     <define name="REF_TAU" value="4"/>
  135.  
  136.     <!-- feedback -->
  137.     <define name="GAIN_P" value="400"/>
  138.     <define name="GAIN_Q" value="400"/>
  139.     <define name="GAIN_R" value="350"/>
  140.  
  141.     <define name="IGAIN_P" value="75"/>
  142.     <define name="IGAIN_Q" value="75"/>
  143.     <define name="IGAIN_R" value="50"/>
  144.  
  145.     <!-- feedforward -->
  146.     <define name="DDGAIN_P" value="300"/>
  147.     <define name="DDGAIN_Q" value="300"/>
  148.     <define name="DDGAIN_R" value="300"/>
  149.   </section>
  150.  
  151.  
  152.   <section name="STABILIZATION_ATTITUDE" prefix="STABILIZATION_ATTITUDE_">
  153.     <!-- setpoints -->
  154.     <define name="SP_MAX_PHI"     value="45." unit="deg"/>
  155.     <define name="SP_MAX_THETA"   value="45." unit="deg"/>
  156.     <define name="SP_MAX_R"       value="90." unit="deg/s"/>
  157.     <define name="DEADBAND_A"     value="0"/>
  158.     <define name="DEADBAND_E"     value="0"/>
  159.     <define name="DEADBAND_R"     value="250"/>
  160.  
  161.     <!-- reference -->
  162.     <define name="REF_OMEGA_P"  value="400" unit="deg/s"/>
  163.     <define name="REF_ZETA_P"   value="0.85"/>
  164.     <define name="REF_MAX_P"    value="400." unit="deg/s"/>
  165.     <define name="REF_MAX_PDOT" value="RadOfDeg(8000.)"/>
  166.  
  167.     <define name="REF_OMEGA_Q"  value="400" unit="deg/s"/>
  168.     <define name="REF_ZETA_Q"   value="0.85"/>
  169.     <define name="REF_MAX_Q"    value="400." unit="deg/s"/>
  170.     <define name="REF_MAX_QDOT" value="RadOfDeg(8000.)"/>
  171.  
  172.     <define name="REF_OMEGA_R"  value="250" unit="deg/s"/>
  173.     <define name="REF_ZETA_R"   value="0.85"/>
  174.     <define name="REF_MAX_R"    value="180." unit="deg/s"/>
  175.     <define name="REF_MAX_RDOT" value="RadOfDeg(1800.)"/>
  176.  
  177.     <!-- feedback -->
  178.     <define name="PHI_PGAIN"  value="1000"/>
  179.     <define name="PHI_DGAIN"  value="400"/>
  180.     <define name="PHI_IGAIN"  value="200"/>
  181.  
  182.     <define name="THETA_PGAIN"  value="1000"/>
  183.     <define name="THETA_DGAIN"  value="400"/>
  184.     <define name="THETA_IGAIN"  value="200"/>
  185.  
  186.     <define name="PSI_PGAIN"  value="500"/>
  187.     <define name="PSI_DGAIN"  value="300"/>
  188.     <define name="PSI_IGAIN"  value="10"/>
  189.  
  190.     <!-- feedforward -->
  191.     <define name="PHI_DDGAIN"   value="300"/>
  192.     <define name="THETA_DDGAIN" value="300"/>
  193.     <define name="PSI_DDGAIN"   value="300"/>
  194.   </section>
  195.  
  196.   <section name="GUIDANCE_V" prefix="GUIDANCE_V_">
  197.     <define name="HOVER_KP"    value="150"/>
  198.     <define name="HOVER_KD"    value="80"/>
  199.     <define name="HOVER_KI"    value="20"/>
  200.     <define name="NOMINAL_HOVER_THROTTLE" value="0.5"/>
  201.     <define name="ADAPT_THROTTLE_ENABLED" value="TRUE"/>
  202.   </section>
  203.  
  204.   <section name="GUIDANCE_H" prefix="GUIDANCE_H_">
  205.     <define name="MAX_BANK" value="20" unit="deg"/>
  206.     <define name="USE_SPEED_REF" value="TRUE"/>
  207.     <define name="PGAIN" value="50"/>
  208.     <define name="DGAIN" value="100"/>
  209.     <define name="AGAIN" value="70"/>
  210.     <define name="IGAIN" value="20"/>
  211.   </section>
  212.  
  213.   <section name="NAV">
  214.     <define name="ARRIVED_AT_WAYPOINT" value="2" unit="m"/>
  215.   </section>
  216.  
  217.   <section name="SIMULATOR" prefix="NPS_">
  218.     <define name="ACTUATOR_NAMES"  value="{&quot;front_motor&quot;, &quot;back_motor&quot;, &quot;right_motor&quot;, &quot;left_motor&quot;}"/>
  219.     <define name="JSBSIM_MODEL" value="&quot;simple_quad&quot;"/>
  220.     <define name="SENSORS_PARAMS" value="&quot;nps_sensors_params_default.h&quot;"/>
  221.     <!-- mode switch on joystick channel 5 (axis numbering starting at zero) -->
  222.     <define name="JS_AXIS_MODE" value="4"/>
  223.   </section>
  224.  
  225.   <section name="AUTOPILOT">
  226.     <define name="MODE_MANUAL" value="AP_MODE_ATTITUDE_DIRECT"/>
  227.     <define name="MODE_AUTO1"  value="AP_MODE_HOVER_Z_HOLD"/>
  228.     <define name="MODE_AUTO2"  value="AP_MODE_NAV"/>
  229.   </section>
  230.  
  231.   <section name="BAT">
  232.     <define name="CATASTROPHIC_BAT_LEVEL" value="9.3" unit="V"/>
  233.     <define name="CRITIC_BAT_LEVEL" value="9.6" unit="V"/>
  234.     <define name="LOW_BAT_LEVEL" value="10.1" unit="V"/>
  235.     <define name="MAX_BAT_LEVEL" value="12.4" unit="V"/>
  236.     <define name="MILLIAMP_AT_FULL_THROTTLE" value="30000"/>
  237.   </section>
  238.  
  239. </airframe>
Advertisement
RAW Paste Data Copied
Advertisement