LSM303DLHC Tilt compensation problems with Uno

An area to discuss AVR and Arduino specific problems and examples

Moderator: Benj

viktor_au
Posts: 116
Joined: Fri Jan 26, 2018 12:30 pm
Location: South Australia
Has thanked: 21 times
Been thanked: 26 times
Contact:

LSM303DLHC Tilt compensation problems with Uno

Postby viktor_au » Tue May 15, 2018 11:39 pm

Ebay module: Chinese LSM303DLHC e-Compass 3 axis Accelerometer and 3 axis Magnetometer.
Module connections: Vin (5v), Gnd, SDA->SDA (A4 on 'classic' Arduinos), SCL->SCL (A5 on 'classic' Arduinos), Int1 to Uno board A0. Note: Int2 is not connected.
Without using the tilt compensation the azimuth value is more stable but does change with module in off-level position.
With tilt compensation formulas (some from this forum and some from the internet) the azimuth value is noisy and not stable.
Is it the Chinese module? Is it the code? Any suggestions with a different tilt-compensated sensor (supported in FC7)?
Will appreciate any help.
Attachments
Uno_LSM303_tilt_1.fcfx
(43.68 KiB) Downloaded 35 times

viktor_au
Posts: 116
Joined: Fri Jan 26, 2018 12:30 pm
Location: South Australia
Has thanked: 21 times
Been thanked: 26 times
Contact:

Re: LSM303DLHC Tilt compensation problems with Uno

Postby viktor_au » Thu May 31, 2018 12:02 am

Probably this is the answer:
Because of drift and noise components at low angular rates, MEMS-based gyroscopes are typically not used directly in the calculation of heading...
https://www.sensorsmag.com/components/compensating-for-tilt-hard-iron-and-soft-iron-effects
These users thanked the author viktor_au for the post:
Benj (Fri Jun 01, 2018 12:44 pm)
Rating: 5.56%