paparazzi-devel
[Top][All Lists]
Advanced

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

Re: [Paparazzi-devel] Temperature compensation of rate sensors solved


From: Prof. Dr.-Ing. Heinrich Warmers
Subject: Re: [Paparazzi-devel] Temperature compensation of rate sensors solved
Date: Thu, 14 Mar 2013 23:29:46 +0100
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; de-DE; rv:1.4) Gecko/20030619 Netscape/7.1 (ax)

Hi,
i have implemented and tested the temperature compensation.
It works perfect. I think it was the temperature drift of the ADX355 (accelerator sensor)
Since my current Version is  4.2  it will need some time to make a pull request.
I use the MBMINI Autopilot.
This can also very easy integrated in the MPU60X0 drivers.

Therfore the changes i made:

aircraft.xml
<define name="RADIO_KILL_SWITCH" value="RADIO_GEAR"/> -->
    <target name="ap" board="hbmini_2.0">
      <define name="CS_74138" value="1"/>
          <define name="IMU_HBMINI_I_VERSION_1_0" value="1"/>
      <define name="BMP_I2C_DEV" value="i2c1"/>
      <define name="SENSOR_SYNC_SEND" value="1"/>
      <define name="FAILSAFE_GROUND_DETECT"/>
      <define name="USE_GPS_ACC4R"/>
      <define name="CRITIC_BAT_LEVEL" value="9.3"/>
       <define name="LOW_BAT_LEVEL" value="9.7"/>
       <define name="BAT_CHECKER_LED" value="3"/>
       <define name="INVERT_BAT_LED" value="1"/>
       <define name="USE_LED_6" value="1"/>
       <define name="BAT_CHECKER_DELAY" value="2"/>
       <define name="HBminiBMP" value="1"/>

new
       <define name="DXA" value="-0.0785"/>
       <define name="DYA" value="-0.0338"/>
       <define name="DZA" value="-0.171"/>
       <define name="DXG" value="0.1301"/>
       <define name="DYG" value="-0.1592"/>
       <define name="DZG" value="-0.0"/>
       <define name="TREF" value="19420"/>


*********************************************************************************************
/sw/airborne/subsystems/imu.h  line 56

******************************************************************************
/** abstract IMU interface providing floating point interface  */
struct ImuFloat {
  struct FloatRates   gyro;
  float  temp;
  struct FloatVect3   accel;


**************************************** line  103
   RATES_COPY(_imu.gyro_prev, _imu.gyro);                               \
    _imu.gyro.p = ((_imu.gyro_unscaled.p +(TREF-imu.temp)*DXG -
_imu.gyro_neutral.p)*IMU_GYRO_P_SIGN*IMU_GYRO_P_SENS_NUM)/IMU_GYRO_P_SENS_DEN;
\
    _imu.gyro.q = ((_imu.gyro_unscaled.q +(TREF-imu.temp)*DYG-
_imu.gyro_neutral.q)*IMU_GYRO_Q_SIGN*IMU_GYRO_Q_SENS_NUM)/IMU_GYRO_Q_SENS_DEN;
\
    _imu.gyro.r = ((_imu.gyro_unscaled.r +(TREF-imu.temp)*DZG -
_imu.gyro_neutral.r)*IMU_GYRO_R_SIGN*IMU_GYRO_R_SENS_NUM)/IMU_GYRO_R_SENS_DEN;
\
  }
#endif



#ifndef ImuScaleAccel
#define ImuScaleAccel(_imu) {                                   \
    VECT3_COPY(_imu.accel_prev, _imu.accel);                            \
    _imu.accel.x = ((_imu.accel_unscaled.x +(TREF-imu.temp)*DXA -
_imu.accel_neutral.x)*IMU_ACCEL_X_SIGN*IMU_ACCEL_X_SENS_NUM)/IMU_ACCEL_X_SENS_DEN;
\
    _imu.accel.y = ((_imu.accel_unscaled.y +(TREF-imu.temp)*DYA -
_imu.accel_neutral.y)*IMU_ACCEL_Y_SIGN*IMU_ACCEL_Y_SENS_NUM)/IMU_ACCEL_Y_SENS_DEN;
\
    _imu.accel.z = ((_imu.accel_unscaled.z +(TREF-imu.temp)*DZA -
_imu.accel_neutral.z)*IMU_ACCEL_Z_SIGN*IMU_ACCEL_Z_SENS_NUM)/IMU_ACCEL_Z_SENS_DEN;
\
  }

**************************************************************************************+
/sw/airborne/subsystems/imu/imu_b2.h line 39
*************************************************************************************

#ifdef IMU_HBMINI_I_VERSION_1_0
#if !defined IMU_GYRO_P_CHAN & !defined IMU_GYRO_Q_CHAN & !defined
IMU_GYRO_R_CHAN
#define IMU_GYRO_P_CHAN  3
#define IMU_GYRO_Q_CHAN  4
#define IMU_GYRO_R_CHAN  5
#define IMU_GYRO_TEMP_CHAN 6
#endif

line 237



#define ImuEvent(_gyro_handler, _accel_handler, _mag_handler) {         \
    if (max1168_status == STA_MAX1168_DATA_AVAILABLE) {         \
      imu.gyro_unscaled.p  = max1168_values[IMU_GYRO_P_CHAN]; \
      imu.gyro_unscaled.q  = max1168_values[IMU_GYRO_Q_CHAN]; \
      imu.gyro_unscaled.r  = max1168_values[IMU_GYRO_R_CHAN]; \
      imu.temp  = max1168_values[IMU_GYRO_TEMP_CHAN]; \
      imu.accel_unscaled.x = max1168_values[IMU_ACCEL_X_CHAN]; \
      imu.accel_unscaled.y = max1168_values[IMU_ACCEL_Y_CHAN]; \
      imu.accel_unscaled.z = max1168_values[IMU_ACCEL_Z_CHAN]; \
      max1168_status = STA_MAX1168_IDLE;                                \
      _gyro_handler();                                          \
      _accel_handler();                                         \
    }                                                                   \
    ImuMagEvent(_mag_handler);                                  \
  }

*********************************************************************************************************
/sw/airborne/fimwares/rotorcraft/telemetry.h  line  157  to see the temperature value 

/*            &imu.gyro_unscaled.r);         \ */

#define PERIODIC_SEND_IMU_GYRO_RAW(_trans, _dev) {
         \
    DOWNLINK_SEND_IMU_GYRO_RAW(_trans, _dev,
         \
                   &imu.gyro_unscaled.p,                \
                   &imu.gyro_unscaled.q,                \
                                    &imu.temp);                 \
  }


***********************************************************************************************************

Felix Ruess schrieb:
Hi,

gyro bias drift due to temperature should not be a real problem with ahrs int_cmpl_quat since the bias is estimated when running.
And at startup the initial gyro bias is set through the AHRS aligner...
However if the sensitivity changes with temperature it could become a problem.
Also bias (drift) of the accelerometers might be a problem, since this is not estimated by the complementary AHRS.

But compensating for bias drift due to temperature directly is of course always nicer than estimating the bias. But you usually need to calibrate this yourself with a more or less elaborate setup...

Cheers, Felix

On Thu, Mar 14, 2013 at 4:12 PM, Prof. Dr.-Ing. Heinrich Warmers <address@hidden> wrote:
Hi,
i made a new warm up experiment:
                     accel.      x y rate  last temperatur of the die  x 62,510E-10   in Volt  4mV/°C
20,6°C    x  26310    21808
                y   26680   21620
                z  31710    18081 temperature of the IDG500

25°C         26307       21841
                 26673       21598
                 31680       18350

30°C        26280         21870
                26648         21555
                31645         18620

35°C      26248          21902
               26650         21502
               31577         18908

40°C      26230            21959
               26641           21446
               31523           19200

Therfore we get   for the accerlatiometers
x     -4/°C
y     -1.95 /°C
z     -9.35 /°C

and for the rate sensors

x    7.55/°C
y   -8.7/°C

I think that a impementation  of  bias  correction will   help.
Six constants  multiplication's  and addition's

Heinrich.
 


Sergey Krukowski schrieb:

I don’t have much experience with the latest paparazzi DCM ahrs, but worked with the initial dcm implementation and actually came to the same solution – measuring and modelling the rate sensors temperature drift. But the solution is really annoying, needs lot of handwork.

Have you tried the cmpl_quat ahrs? There is also of centrifugal force compensation implemented and from my experience (based however on rotorcrafts basically) works well. If you are sure you don’t have significant accelerometer drift could carefully try it.

 

Regards,

Sergey


_______________________________________________ Paparazzi-devel mailing list address@hidden https://lists.nongnu.org/mailman/listinfo/paparazzi-devel

_______________________________________________
Paparazzi-devel mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel



_______________________________________________ Paparazzi-devel mailing list address@hidden https://lists.nongnu.org/mailman/listinfo/paparazzi-devel

reply via email to

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