mag_qmc5883l

Module to be able to use an QMC5883L magnetometer. Intorduction: Honeywell discontinued the HMC5983/HMC5883L in 2016 and licensed the technology to QST Corporation, who now manufacture the replacement QMC5883L. However, while the QMC5883L is pin compatible with HMC, it’s registers are not the same as the Honeywell device. It’s essentially a different chip. QST Corporation have produced two versions of the QMC5883L: A completely undocumented ‘A’ version with “DA 5883” on the QFN package that responds to the I2C address 0x1E. It’s identical to the HMC5983/HMC5883L, except that the status register doesn’t work. The DA 5883 is not supported by this driver since we have not seen any samples of this DA version in the wild A documented ‘B’ version with “DB 5833” on the QFN package that responds to I2C address 0x0D. This works as per the QMC5883L datasheet. TIP: An arbitrary rotation between the sensor frame and the IMU frame can be compensated with a MAG_TO_IMU rotation, defined by three euler angles. The three angles must be defined to enable this correction. Otherwise it is assumed that the IMU and MAG axis are aligned.

Configures

Name

Value

Description

MAG_QMC5883L_I2C_DEV

i2c1

I2C device to use (e.g. i2c2)

Defines

Name

Value

Description

MODULE_QMC5883L_SYNC_SEND

TRUE|FALSE

Send IMU_RAW message with each new measurement for debugging purposes (default: FALSE)

MODULE_QMC5883L_UPDATE_AHRS

TRUE|FALSE

Copy measurements to IMU and send as ABI message (default: FALSE)

QMC5883L_CHAN_X_SIGN

+|-

Set the polarity of x axis (default: +)

QMC5883L_CHAN_Y_SIGN

+|-

Set the polarity of y axis (default: +)

QMC5883L_CHAN_Z_SIGN

+|-

Set the polarity of z axis (default: +)

QMC5883L_CHAN_X

0|1|2

Channel id of x axis (default: 0)

QMC5883L_CHAN_Y

0|1|2

Channel id of y axis (default: 1)

QMC5883L_CHAN_Z

0|1|2

Channel id of z axis (default: 2)

Section MAG_QMC

QMC5883L_

Name

Value

Description

MAG_TO_IMU_PHI

0.0

Rotation between sensor frame and IMU frame (phi angle)

MAG_TO_IMU_THETA

0.0

Rotation between sensor frame and IMU frame (theta angle)

MAG_TO_IMU_PSI

0.0

Rotation between sensor frame and IMU frame (psi angle)

DATA_RATE

QMC5883L_ODR_200

Continuous conversion data rate

Depends

  • i2c
  • @imu

Provides

  • mag

Sections