[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Paparazzi-devel] drotek 10dof v2 imu

From: Chris
Subject: Re: [Paparazzi-devel] drotek 10dof v2 imu
Date: Thu, 20 Jun 2013 18:53:45 +0300
User-agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130510 Thunderbird/17.0.6

Hi Felix.
I wan't to help as much as i can.
I use the Twog with the master branch.
The drotek imu i have has at least the "Y" mislabeled on the pcb it looks 180 degrees to the other side because when i checked the raw readings without applying any signs on them i found that it was needed to negate the y axis. I have installed the imu with the solder pad row facing the back of the airplane and the ic side up.
If you need more data let me know.

Here is the git branch i follow:
address@hidden:~/paparazzi$ git remote show origin
* remote origin
  Fetch URL:
  Push  URL:
  HEAD branch: master
  Remote branches:
    ahrs_int_cmpl_quat_correction_scaling tracked
    airframe_editor                       tracked
    campaign2011                          tracked
    campaign2013                          tracked
    feature4_fixedwing_in_rotor           tracked
imu_drotek new (next fetch will store in remotes/origin)
    master                                tracked
    mavlink                               tracked
    messages                              tracked
    px4                                   tracked
    quadshot_integration                  tracked
refs/remotes/origin/aspirin_improved stale (use 'git remote prune' to remove) refs/remotes/origin/mpu60x0 stale (use 'git remote prune' to remove) refs/remotes/origin/stm32f4 stale (use 'git remote prune' to remove)
    telemetry                             tracked
    transitioning_vehicles                tracked
    v4.0                                  tracked
    v4.2                                  tracked
    v5.0                                  tracked
  Local branch configured for 'git pull':
    master merges with remote master
  Local ref configured for 'git push':
    master pushes to master (local out of date)

Here is the warnings i get from the paparazzi center:

CC /home/hendrix/paparazzi/var/Cessna_182/ap/subsystems/imu/imu_drotek_10dof_v2.o subsystems/imu/imu_drotek_10dof_v2.c: In function 'imu_drotek2_configure_mag_slave': subsystems/imu/imu_drotek_10dof_v2.c:119:57: warning: unused parameter 'mpu_set' [-Wunused-parameter] subsystems/imu/imu_drotek_10dof_v2.c:119:72: warning: unused parameter 'mpu' [-Wunused-parameter]
CC /home/hendrix/paparazzi/var/Cessna_182/ap/peripherals/mpu60x0.o
CC /home/hendrix/paparazzi/var/Cessna_182/ap/peripherals/mpu60x0_i2c.o
peripherals/mpu60x0_i2c.c: In function 'mpu60x0_i2c_event':
peripherals/mpu60x0_i2c.c:100:33: warning: cast discards '__attribute__((noreturn))' qualifier from pointer target type [-Wcast-qual]

Here is the relevant airframe part:

<airframe name="Cessna_182_twog.xml">

<firmware name="fixedwing">

<target name="ap"             board="twog_1.0"/>
<target name="sim"             board="pc"/>

    <configure name="SYS_TIME_LED" value="1"/>
    <configure name="GPS_LED" value="2"/>
     <define name="USE_LED_1"/>
    <define name="USE_LED_2"/>
    <define name="USE_LED_3"/>
    <define name="USE_LED_4"/>
    <define name="USE_LED_5"/>
        <define name="AGR_CLIMB"/>
    <define name="WIND_INFO"/>
    <define name="WIND_INFO_RET"/>
    <define name="STRONG_WIND"/>
    <define name="ALT_KALMAN"/>
    <define name="USE_I2C"/>
    <define name="USE_I2C0"/>
    <define name="SENSOR_SYNC_SEND"/>
    <define name="USE_AHRS_GPS_ACCELERATIONS"/>
    <define name="USE_GROUNDSPEED_CONTROL"/>
    <configure name="PERIODIC_FREQUENCY" value="120"/>
    <configure name="AHRS_PROPAGATE_FREQUENCY" value="100"/>
    <configure name="AHRS_CORRECT_FREQUENCY" value="100"/>
<!--    <define name="ADC_CHANNEL_VSUPPLY" value="ADC_1" />  -->
<!--    <define name="MEASURE_AIRSPEED"/>  -->
<!--    <define name="USE_AIRSPEED"/>  -->
<!--    <define name="USE_BAROMETER"/>  -->
<!-- <define name="USE_INS_NAV_INIT" value=FALSE"/> --> <!--Set Home to flight plan coordinates -->

    <subsystem name="telemetry" type="transparent">
    <configure name="MODEM_BAUD" value="B115200"/>
<!--    <configure name="MODEM_PORT" value="UART2"/> -->
<!--    <configure name="MODEM_LED"  value="5"/>  -->
        <subsystem name="gps" type="ublox">
    <configure name="GPS_BAUD"          value="B38400"/>
<!--    <configure name="GPS_PORT" value="UART3"/>  -->
<!--    <configure name="GPS_LED"           value="none"/> -->

    <subsystem name="control" />
    <subsystem name="radio_control" type="ppm"/>
    <subsystem name="navigation" type="extra"/>

    <subsystem name="imu"    type="drotek_10dof_v2">
        <configure name="DROTEK_2_I2C_DEV" value="i2c0"/>

        <subsystem name="ahrs" type="float_dcm">
        <define name="USE_MAGNETOMETER" value="0"/>
        <define name="USE_MAGNETOMETER_ONGROUND" value="0"/>

    <subsystem name="ins" type="alt_float"/>

<section name="AHRS" prefix="AHRS_" >
    <define name="H_X" value="(26536.9/45821.6)" />
    <define name="H_Y" value="(1850.1/45821.6)" />
    <define name="H_Z" value="(37309.3/45821.6) " />
    <define name="MAG_DECLINATION" value="(RadOfDeg(4))" />

<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="MAG_X_SIGN" value="1"/>
    <define name="MAG_Y_SIGN" value="1"/>
    <define name="MAG_Z_SIGN" value="1"/>

    <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"/>

<!-- SENS=16.4 LSB/(deg/sec)*57.295779513 deg/rad=939.65078 LSB/rad/sec / 12bit FRAC: 4096/939.65 -->
    <define name="GYRO_P_SENS" value="4.359" integer="16"/>
    <define name="GYRO_Q_SENS" value="4.359" integer="16"/>
    <define name="GYRO_R_SENS" value="4.359" integer="16"/>

    <define name="GYRO_P_Q" value="0."/>
    <define name="GYRO_P_R" value="0"/>
    <define name="GYRO_Q_P" value="0."/>
    <define name="GYRO_Q_R" value="0."/>
    <define name="GYRO_R_P" value="0."/>
    <define name="GYRO_R_Q" value="0."/>

<!-- Found with script and visual observation of the RAW values -->
    <define name="ACCEL_X_NEUTRAL" value="72"/>
    <define name="ACCEL_Y_NEUTRAL" value="2"/>
    <define name="ACCEL_Z_NEUTRAL" value="-70"/>

<!-- SENS = 2048 LSB/g / 9.81 ms2/g = 208.766564729 LSB/ms2 / 10bit FRAC: 1024 / 208.7665 -->
    <!-- Found with script -->
    <define name="ACCEL_X_SENS" value="4.87542830698" integer="16"/>
    <define name="ACCEL_Y_SENS" value="4.89064537368" integer="16"/>
    <define name="ACCEL_Z_SENS" value="4.81527520369" integer="16"/>

    <!-- Found with script -->
    <define name="MAG_X_NEUTRAL" value="73"/>
    <define name="MAG_Y_NEUTRAL" value="118"/>
    <define name="MAG_Z_NEUTRAL" value="169"/>

    <define name="MAG_X_SENS" value="4.25741044617" integer="16"/>
    <define name="MAG_Y_SENS" value="4.26451705702" integer="16"/>
    <define name="MAG_Z_SENS" value="4.87790997442" integer="16"/>


Here is the part of my driver that assigns the values to the imu structure when the imu is positioned with the solder pad row facing the airplane's tail and the IC's are facing up.
(all signs in the airframe are set to "1")
#define MPU_OFFSET_ACC 1
x = (int16_t) ((mpu60x0_trans.buf[0+MPU_OFFSET_ACC] << 8) | mpu60x0_trans.buf[1+MPU_OFFSET_ACC]); y = (int16_t) ((mpu60x0_trans.buf[2+MPU_OFFSET_ACC] << 8) | mpu60x0_trans.buf[3+MPU_OFFSET_ACC]); z = (int16_t) ((mpu60x0_trans.buf[4+MPU_OFFSET_ACC] << 8) | mpu60x0_trans.buf[5+MPU_OFFSET_ACC]);
VECT3_ASSIGN(imu.accel_unscaled, x, -y, -z);

x = (int16_t) ((mpu60x0_trans.buf[0+MPU_OFFSET_GYRO] << 8) | mpu60x0_trans.buf[1+MPU_OFFSET_GYRO]); y = (int16_t) ((mpu60x0_trans.buf[2+MPU_OFFSET_GYRO] << 8) | mpu60x0_trans.buf[3+MPU_OFFSET_GYRO]); z = (int16_t) ((mpu60x0_trans.buf[4+MPU_OFFSET_GYRO] << 8) | mpu60x0_trans.buf[5+MPU_OFFSET_GYRO]); RATES_ASSIGN(imu.gyro_unscaled, x, -y, -z); // Update the IMU gyro values

reply via email to

[Prev in Thread] Current Thread [Next in Thread]