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
+15 -22
View File
@@ -19,13 +19,6 @@
</load> </load>
<load name="infrared_i2c.xml"/> <load name="infrared_i2c.xml"/>
<load name="pbn.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> </modules>
<firmware name="fixedwing"> <firmware name="fixedwing">
@@ -35,22 +28,21 @@
<define name="LOITER_TRIM"/> <define name="LOITER_TRIM"/>
<target name="sim" board="pc"/> <target name="sim" board="pc"/>
<target name="ap" board="tiny_2.11"> <target name="ap" board="tiny_2.11"/>
<configure name="FLASH_MODE" value="IAP"/>
</target>
<subsystem name="radio_control" type="ppm"/> <subsystem name="radio_control" type="ppm"/>
<!--subsystem name="joystick"/--> <!--subsystem name="joystick"/-->
<!-- Communication --> <!-- Communication -->
<subsystem name="telemetry" type="transparent"/> <subsystem name="telemetry" type="transparent"/>
<!-- Actuators are automatically chosen according to board--> <!-- Actuators are automatically chosen according to board-->
<subsystem name="control"/> <subsystem name="control"/>
<subsystem name="ahrs" type="infrared"/>
<!-- Sensors --> <!-- Sensors -->
<subsystem name="gps" type="ublox"/> <subsystem name="gps" type="ublox"/>
<subsystem name="gyro" type="roll"> <subsystem name="imu" type="analog">
<configure name="ADC_GYRO_ROLL" value="ADC_5"/> <configure name="GYRO_P" value="ADC_5" />
</subsystem> </subsystem>
<subsystem name="current_sensor"> <subsystem name="current_sensor">
@@ -60,13 +52,12 @@
<subsystem name="navigation"/> <subsystem name="navigation"/>
</firmware> </firmware>
<firmware name="setup"> <firmware name="setup">
<target name="tunnel" board="tiny_2.11"/> <target name="tunnel" board="tiny_2.11"/>
<target name="setup_actuators" board="tiny_2.11"/> <target name="setup_actuators" board="tiny_2.11"/>
</firmware> </firmware>
<!-- commands section -->
<servos> <servos>
<servo name="MOTOR" no="0" min="1040" neutral="1040" max="2000"/> <servo name="MOTOR" no="0" min="1040" neutral="1040" max="2000"/>
<servo name="AILEVON_LEFT" no="2" min="1900" neutral="1500" max="1050"/> <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"/> <define name="PITCH_NEUTRAL_DEFAULT" value="2." unit="deg"/>
</section> </section>
<section name="GYRO" prefix="GYRO_"> <!-- Gyro sensitivity : -->
<define name="ADC_ROLL_NEUTRAL" value="487"/> <!-- GYRO_ADXRS300_RESISTOR_BRIDGE value="(3.3/(3.3+1.8))" -->
<define name="ADXRS300_RESISTOR_BRIDGE" value="(3.3/(3.3+1.8))"/> <!-- GYRO_ADXRS300_SENSITIVITY value="5" unit="mV/(deg/s)" -->
<define name="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" -->
<define name="ROLL_SCALE" value="3.3*1000./1024./(GYRO_ADXRS300_SENSITIVITY*GYRO_ADXRS300_RESISTOR_BRIDGE)" unit="deg/s/adc_unit"/> <section name="IMU" prefix="IMU_">
<define name="ROLL_DIRECTION" value="1."/> <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>
<section name="BAT"> <section name="BAT">
@@ -121,10 +121,7 @@ void infrared_i2c_update( void ) {
ir_i2c_data_ver_available = FALSE; ir_i2c_data_ver_available = FALSE;
} }
} }
#else /* SITL || HITL */ #endif /* SITL || HITL */
/** ir_roll and ir_pitch set by simulator in sim_ir.c */
estimator_update_state_infrared();
#endif
} }
#define FilterIR(_ir_prev, _ir_next) (((1<<ir_i2c_conf_word)*_ir_prev + _ir_next) / ((1<<ir_i2c_conf_word) + 1)) #define FilterIR(_ir_prev, _ir_next) (((1<<ir_i2c_conf_word)*_ir_prev + _ir_next) / ((1<<ir_i2c_conf_word) + 1))