Module/Mag HMC58xx

From PaparazziUAV
Jump to: navigation, search


Introduction

Paparazzi allows the use of external Magnetometers. This module supports the use of the Honeywell HMC5843 and HMC5883 magnetometers. These magnetometers can be connected to your autopilot board via i2c.


File: conf/airframes/myplane.xml
  <firmware>
    ...
    <define name="USE_I2C2" />
    ...
    <subsystem name="ahrs" type="float_cmpl_quat">
      <define name="AHRS_XXX_MAG_ID" value="MAG_HMC58XX_SENDER_ID"/>
    </subsystem>
  </firmware>
  ...
    <modules>
     <load name="mag_hmc58xx.xml">
      <define name="MODULE_HMC58XX_UPDATE_AHRS"/>
      <define name="MAG_HMC58XX_I2C_DEV" value="i2c2"/>
     </load>
    </modules>

You will need to specify the AHRS_XXX_MAG_ID value. See AHRS External Sensors

Recently, the module is being used like the below example, see how the channel order and the signs can be changed :

    <module name="mag" type="hmc58xx">
      <configure name="MAG_HMC58XX_I2C_DEV" value="i2c2"/>
      <define name="MODULE_HMC58XX_UPDATE_AHRS"/>
      <define name="HMC58XX_CHAN_X" value="0"/>
      <define name="HMC58XX_CHAN_Y" value="1"/>
      <define name="HMC58XX_CHAN_Z" value="2"/>

      <define name="HMC58XX_CHAN_X_SIGN" value="+"/>
      <define name="HMC58XX_CHAN_Y_SIGN" value="+"/>
      <define name="HMC58XX_CHAN_Z_SIGN" value="-"/>
    </module>