Explorer/PPRZ/Configuration

From PaparazziUAV
Revision as of 05:38, 29 September 2020 by Xp31 (talk | contribs)
Jump to navigation Jump to search

xp_option_board_apogee_mpu9150.xml

<firmware>
   <module name="imu" type="apogee_mpu9150">
     <define name="APOGEE_LOWPASS_FILTER" value="MPU60X0_DLPF_256HZ"/>
     <define name="APOGEE_SMPLRT_DIV"     value="1"/>
   </module>
</firmware>

xp_option_imu_apogee_mpu9150.xml

<airframe>
 <section name="IMU" prefix="IMU_">
   <define name="GYRO_P_SIGN"       value="1"/>
   <define name="GYRO_Q_SIGN"       value="-1"/>
   <define name="GYRO_R_SIGN"       value="-1"/>
   <define name="ACCEL_X_SIGN"      value="1"/>
   <define name="ACCEL_Y_SIGN"      value="-1"/>
   <define name="ACCEL_Z_SIGN"      value="-1"/>
   <define name="ACCEL_X_NEUTRAL"   value="-87"/>
   <define name="ACCEL_Y_NEUTRAL"   value="50"/>
   <define name="ACCEL_Z_NEUTRAL"   value="-16"/>
   <define name="ACCEL_X_SENS"      value="2.26755822693" integer="16"/>
   <define name="ACCEL_Y_SENS"      value="2.4468957791" integer="16"/>
   <define name="ACCEL_Z_SENS"      value="2.45151941617" integer="16"/>
   <define name="MAG_X_SIGN"        value="1"/>
   <define name="MAG_Y_SIGN"        value="-1"/>
   <define name="MAG_Z_SIGN"        value="-1"/>
   <define name="MAG_X_NEUTRAL"     value="6"/>
   <define name="MAG_Y_NEUTRAL"     value="-8"/>
   <define name="MAG_Z_NEUTRAL"     value="45"/>
   <define name="MAG_X_SENS"        value="15.406512237311269" integer="16"/>
   <define name="MAG_Y_SENS"        value="14.315784652910315" integer="16"/>
   <define name="MAG_Z_SENS"        value="16.04339395369838" integer="16"/>
   <define name="BODY_TO_IMU_PHI"   value="0." unit="deg"/>
   <define name="BODY_TO_IMU_THETA" value="0." unit="deg"/>
   <define name="BODY_TO_IMU_PSI"   value="0." unit="deg"/>
 </section>
</airframe>

xp_common_target_flying.xml

<airframe>
 <module name="radio_control" type="sbus"/>
 <define name="RADIO_KILL_SWITCH" value="RADIO_GAIN1"/>
 <!-- module name="tlsf"/>
 <module name="pprzlog"/>
 <module name="logger" type="sd_chibios"/>
 <module name="flight_recorder"/-->
</airframe>

xp_option_target_apogee.xml

<airframe>
 <!-- Info: Tawaki: Auxa1, Apogee: PPMin -->
 <module name="light_scheduler">
   <define name="WS2812_NB_LEDS" value="12"/>
   <define name="WS2812_SEQUENCE" value="2"/>
 </module>
 <module name="actuators" type="pwm"/>
 <module name="switch" type="servo"/>
 <module name="extra_dl">
   <configure name="EXTRA_DL_PORT" value="UART6"/>
   <configure name="EXTRA_DL_BAUD" value="B115200"/>
 </module>
 <servos driver="Pwm">
   <servo name="SWITCH" no="1" min="1000" neutral="1000" max="1900"/>
 </servos>
 <module name="actuators" type="dshot">
   <define name="DSHOT_SPEED" value="300"/>
   <define name="USE_DSHOT_TIM3" value="TRUE"/>
   <define name="USE_DSHOT6" value="TRUE"/>
 </module>
 <servos driver="DShot">
   <servo name="FR" no="0" min="0" neutral="100" max="2000"/>
   <servo name="BR" no="2" min="0" neutral="100" max="2000"/>
   <servo name="BL" no="3" min="0" neutral="100" max="2000"/>
   <servo name="FL" no="6" min="0" neutral="100" max="2000"/>
 </servos>  
</airframe>

xp_option_outdoor.xml

<airframe>
 <module name="ins" />
 <module name="gps" type="ublox">
     <configure name="GPS_BAUD" value="B115200"/>
     <define name="USE_GPS_UBX_RTCM" value="TRUE"/>
 </module>
 <!-- Firmware Option (1) --> 
 <section name="INS" prefix="INS_"/>
 <section name="AHRS" prefix="AHRS_">
   <define name="H_X" value="0.51385"/>
   <define name="H_Y" value="0.00299"/>
   <define name="H_Z" value="0.85787"/>
 </section>   
 <!-- Firmware Option (2) -->
 <!-- section name="INS" prefix="INS_">
   <define name="H_X" value="0.576084"/>
   <define name="H_Y" value="-0.00275807"/>
   <define name="H_Z" value="0.817385"/>
   <define name="INV_NXZ" value="0.25"/>
   <define name="INV_NH" value="2.0"/>
   <define name="INV_MVZ" value="8."/>
 </section-->
</airframe>

xp_option_indoor.xml

<airframe>
 <module name="gps" type="datalink"/>
   <module name="ins" type="gps_passthrough"/>
   <module name="ahrs" type="int_cmpl_quat">
     <configure name="USE_MAGNETOMETER" value="FALSE"/>
 </module>
 <section name="AHRS" prefix="AHRS_">
   <define name="USE_GPS_HEADING" value="1"/>
   <define name="HEADING_UPDATE_GPS_MIN_SPEED" value="0"/>
 </section>
</airframe>

xp_common_stab_rate.xml

<airframe>
 <section name="STABILIZATION_RATE" prefix="STABILIZATION_RATE_">
   <define name="SP_MAX_P" value="10000"/>
   <define name="SP_MAX_Q" value="10000"/>
   <define name="SP_MAX_R" value="10000"/>
   <define name="GAIN_P" value="400"/>
   <define name="GAIN_Q" value="400"/>
   <define name="GAIN_R" value="350"/>
 </section>
</airframe>

xp_common_stab_attitude.xml

<airframe>
 <section name="STABILIZATION_ATTITUDE" prefix="STABILIZATION_ATTITUDE_">
   <!-- setpoints -->
   <define name="SP_MAX_PHI" value="45." unit="deg"/>
   <define name="SP_MAX_THETA" value="45." unit="deg"/>
   <define name="SP_MAX_R" value="90." unit="deg/s"/>
   <define name="DEADBAND_R" value="250"/>
   <!-- reference -->
   <define name="REF_OMEGA_P" value="800" unit="deg/s"/>
   <define name="REF_ZETA_P" value="0.85"/>
   <define name="REF_MAX_P" value="300." unit="deg/s"/>
   <define name="REF_MAX_PDOT" value="RadOfDeg(7000.)"/>
   <define name="REF_OMEGA_Q" value="800" unit="deg/s"/>
   <define name="REF_ZETA_Q" value="0.85"/>
   <define name="REF_MAX_Q" value="300." unit="deg/s"/>
   <define name="REF_MAX_QDOT" value="RadOfDeg(7000.)"/>
   <define name="REF_OMEGA_R" value="500" unit="deg/s"/>
   <define name="REF_ZETA_R" value="0.85"/>
   <define name="REF_MAX_R" value="90." unit="deg/s"/>
   <define name="REF_MAX_RDOT" value="RadOfDeg(900.)"/>
   <!-- feedback -->
   <define name="PHI_PGAIN" value="432"/>
   <define name="PHI_DGAIN" value="207"/>
   <define name="PHI_IGAIN" value="100"/>
   <define name="THETA_PGAIN" value="432"/>
   <define name="THETA_DGAIN" value="207"/>
   <define name="THETA_IGAIN" value="100"/>
   <define name="PSI_PGAIN" value="1392"/>
   <define name="PSI_DGAIN" value="350"/>
   <define name="PSI_IGAIN" value="20"/>
   <!-- feedforward -->
   <define name="PHI_DDGAIN" value="60"/>
   <define name="THETA_DDGAIN" value="60"/>
   <define name="PSI_DDGAIN" value="170"/>
   <define name="PHI_AGAIN" value="0"/>
   <define name="THETA_AGAIN" value="0"/>
   <define name="PSI_AGAIN" value="0"/>
 </section>
</airframe>

xp_common_guidance.xml

<airframe>
 <section name="GUIDANCE_V" prefix="GUIDANCE_V_">
  <define name="REF_MIN_ZDD" value="-0.4*9.81"/>
  <define name="REF_MAX_ZDD" value=" 0.4*9.81"/>
  <define name="REF_MIN_ZD" value="-1.5"/>
  <define name="REF_MAX_ZD" value=" 1."/>
  <define name="HOVER_KP" value="90"/>
  <define name="HOVER_KD" value="110"/>
  <define name="HOVER_KI" value="10"/>
  <define name="NOMINAL_HOVER_THROTTLE" value="0.35"/>
  <define name="ADAPT_THROTTLE_ENABLED" value="TRUE"/>
  <define name="ADAPT_NOISE_FACTOR" value="1."/>
  <define name="ADAPT_INITIAL_HOVER_THROTTLE" value="0.3"/>
 </section>
 <section name="GUIDANCE_H" prefix="GUIDANCE_H_">
  <define name="MAX_BANK" value="20" unit="deg"/>
  <define name="PGAIN" value="41"/>
  <define name="DGAIN" value="108"/>
  <define name="IGAIN" value="20"/>
  <define name="NGAIN" value="0"/>
  <!-- feedforward -->
  <define name="AGAIN" value="0"/>
  <!--define name="REF_MAX_SPEED" value="0.2"/>
  <define name="REF_MAX_ACCEL" value="1."/-->
 </section>
</airframe>

xp_common_modules.xml

<airframe>
 <module name="telemetry" type="xbee_api"/>
 <module name="ahrs" type="int_cmpl_quat" />
 <module name="stabilization" type="int_quat"/>
 <module name="motor_mixing"/>
 <module name="air_data"/>
 <module name="filter" type="1euro_imu">
   <define name="AHRS_ICQ_IMU_ID" value="IMU_F1E_ID"/>
   <define name="AHRS_ALIGNER_IMU_ID" value="IMU_F1E_ID"/>
 </module>
 <commands>
   <axis name="ROLL" failsafe_value="0"/>
   <axis name="PITCH" failsafe_value="0"/>
   <axis name="YAW" failsafe_value="0"/>
   <axis name="THRUST" failsafe_value="0"/>
 </commands>
 <section name="MIXING" prefix="MOTOR_MIXING_">
   <define name="TYPE" value="QUAD_X"/>
   <define name="REVERSE" value="TRUE"/>
 </section>
 <command_laws>
   <call fun="motor_mixing_run(autopilot_get_motors_on(),FALSE,values)"/>
   <set servo="FR" value="motor_mixing.commands[MOTOR_FRONT_RIGHT]"/>
   <set servo="FL" value="motor_mixing.commands[MOTOR_FRONT_LEFT]"/>
   <set servo="BR" value="motor_mixing.commands[MOTOR_BACK_RIGHT]"/>
   <set servo="BL" value="motor_mixing.commands[MOTOR_BACK_LEFT]"/>
 </command_laws>
 <section name="NAV">
   <define name="ARRIVED_AT_WAYPOINT" value="0.25"/>
   <define name="NAV_DESCEND_VSPEED" value="-0.4"/>
   <define name="NAV_CLIMB_VSPEED" value="0.5"/>
 </section>
 <section name="BAT">
   <define name="CRITIC_BAT_LEVEL" value="9.3" unit="V"/>
 </section>
 <section name="AUTOPILOT">
   <define name="MODE_MANUAL" value="AP_MODE_ATTITUDE_DIRECT"/>
   <define name="MODE_AUTO1" value="AP_MODE_ATTITUDE_Z_HOLD"/>
   <define name="MODE_AUTO2" value="AP_MODE_NAV"/>
 </section>
 <section name="GCS">
   <define name="ALT_SHIFT_PLUS_PLUS" value="5"/>
   <define name="ALT_SHIFT_PLUS" value="1"/>
   <define name="ALT_SHIFT_MINUS" value="-1"/>
 </section>
</airframe>

Explorer