update airframe to new gyro system and fix ir_i2c in sim

This commit is contained in:
Gautier Hattenberger
2011-11-25 15:58:49 +01:00
parent 9da17235b8
commit 454d8b055f
2 changed files with 16 additions and 26 deletions
+13 -20
View File
@@ -19,13 +19,6 @@
</load>
<load name="infrared_i2c.xml"/>
<load name="pbn.xml"/>
<!--load name="airspeed_adc.xml">
<configure name="ADC_AIRSPEED" value="ADC_4"/>
<define name="AIRSPEED_SCALE" value="1"/>
<define name="AIRSPEED_BIAS" value="0"/>
</load-->
<!--load name="airspeed_ets.xml"/>
<load name="baro_ets.xml"/-->
</modules>
<firmware name="fixedwing">
@@ -35,9 +28,7 @@
<define name="LOITER_TRIM"/>
<target name="sim" board="pc"/>
<target name="ap" board="tiny_2.11">
<configure name="FLASH_MODE" value="IAP"/>
</target>
<target name="ap" board="tiny_2.11"/>
<subsystem name="radio_control" type="ppm"/>
<!--subsystem name="joystick"/-->
@@ -47,10 +38,11 @@
<!-- Actuators are automatically chosen according to board-->
<subsystem name="control"/>
<subsystem name="ahrs" type="infrared"/>
<!-- Sensors -->
<subsystem name="gps" type="ublox"/>
<subsystem name="gyro" type="roll">
<configure name="ADC_GYRO_ROLL" value="ADC_5"/>
<subsystem name="imu" type="analog">
<configure name="GYRO_P" value="ADC_5" />
</subsystem>
<subsystem name="current_sensor">
@@ -60,13 +52,12 @@
<subsystem name="navigation"/>
</firmware>
<firmware name="setup">
<target name="tunnel" board="tiny_2.11"/>
<target name="setup_actuators" board="tiny_2.11"/>
</firmware>
<!-- commands section -->
<servos>
<servo name="MOTOR" no="0" min="1040" neutral="1040" max="2000"/>
<servo name="AILEVON_LEFT" no="2" min="1900" neutral="1500" max="1050"/>
@@ -122,12 +113,14 @@
<define name="PITCH_NEUTRAL_DEFAULT" value="2." unit="deg"/>
</section>
<section name="GYRO" prefix="GYRO_">
<define name="ADC_ROLL_NEUTRAL" value="487"/>
<define name="ADXRS300_RESISTOR_BRIDGE" value="(3.3/(3.3+1.8))"/>
<define name="ADXRS300_SENSITIVITY" value="5" unit="mV/(deg/s)"/>
<define name="ROLL_SCALE" value="3.3*1000./1024./(GYRO_ADXRS300_SENSITIVITY*GYRO_ADXRS300_RESISTOR_BRIDGE)" unit="deg/s/adc_unit"/>
<define name="ROLL_DIRECTION" value="1."/>
<!-- Gyro sensitivity : -->
<!-- GYRO_ADXRS300_RESISTOR_BRIDGE value="(3.3/(3.3+1.8))" -->
<!-- GYRO_ADXRS300_SENSITIVITY value="5" unit="mV/(deg/s)" -->
<!-- ROLL_SCALE value="RadOfDeg(3.3*1000./1024./(GYRO_ADXRS300_SENSITIVITY*GYRO_ADXRS300_RESISTOR_BRIDGE))" unit="rad/s/adc_unit" -->
<section name="IMU" prefix="IMU_">
<define name="GYRO_P_SIGN" value="1"/>
<define name="GYRO_P_NEUTRAL" value="487"/>
<define name="GYRO_P_SENS" value="0.0173851" integer="16"/>
</section>
<section name="BAT">
@@ -121,10 +121,7 @@ void infrared_i2c_update( void ) {
ir_i2c_data_ver_available = FALSE;
}
}
#else /* SITL || HITL */
/** ir_roll and ir_pitch set by simulator in sim_ir.c */
estimator_update_state_infrared();
#endif
#endif /* SITL || HITL */
}
#define FilterIR(_ir_prev, _ir_next) (((1<<ir_i2c_conf_word)*_ir_prev + _ir_next) / ((1<<ir_i2c_conf_word) + 1))