Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adafruit NXP Library for LSM9DS1 #19

Open
mason-stafford opened this issue Oct 11, 2021 · 9 comments
Open

Adafruit NXP Library for LSM9DS1 #19

mason-stafford opened this issue Oct 11, 2021 · 9 comments

Comments

@mason-stafford
Copy link

Hi to all.

First of all, I want to appreciate @kriswiner for making this code, that's a huge one, it makes using the sensor so easy and understandable for me. Thanks again.
Currently I'm trying to use the adafruit NXP Library for LSM9DS1, but unfortunately it's not working correctly.
I'm having some yaw drift problem with it.

I'm gonna be grateful for any help.

Regards,
Mason

@kriswiner
Copy link
Owner

kriswiner commented Oct 11, 2021 via email

@mason-stafford
Copy link
Author

mason-stafford commented Oct 11, 2021

@kriswiner
Thanks for responding,
I'm using your LSM9DS1 code for my Arduino Nano 33 BLE Sense for obtaining raw calibrated IMU data, and passing it to Adafruit NXP Library which uses the Kalman Filter algorithm to estimate the orientation.
I'm using the following settings for my sensors:

uint8_t Gscale = GFS_2000DPS; // gyro full scale
uint8_t Godr = GODR_119Hz; // gyro data sample rate
uint8_t Gbw = GBW_low; // gyro data bandwidth
uint8_t Ascale = AFS_2G; // accel full scale
uint8_t Aodr = AODR_119Hz; // accel data sample rate
uint8_t Abw = ABW_408Hz; // accel data bandwidth
uint8_t Mscale = MFS_4G; // mag full scale
uint8_t Modr = MODR_80Hz; // mag data sample rate
uint8_t Mmode = MMode_UltraHighPerformance; // magnetometer operation mode

and running the Kalman filter on 100Hz, Everything is fine but when I'm leaving the sensor on the desk, it takes some time to corrects the yaw direction. When the sensor is staying steel on the desk the quaternion data will change and take some time to get stable.
When I'm passing the quaternion data to a python visualization environment, change of the quaternion data will only effect on yaw direction.

I hope I have achieved what I mean.

@kriswiner
Copy link
Owner

kriswiner commented Oct 11, 2021 via email

@mason-stafford
Copy link
Author

As I said I'm using your LSM9DS1 Library for my Arduino Nano BLE Sense, and your IMU calibration method too. How should make sure the calibration is done correctly?
I have already tested the different sample rates, doesn't make any difference.

Regards

@kriswiner
Copy link
Owner

kriswiner commented Oct 12, 2021 via email

@mason-stafford
Copy link
Author

I didn't think at all the solution might be easy at all.
After calibrating the sensors, mag and accel is OK but unfortunately gyro won't give zero values.
I did calibration with your code and Femme Verbeek's code. non gives zeros.
any suggestions?

Regards

@kriswiner
Copy link
Owner

kriswiner commented Oct 12, 2021 via email

@mason-stafford
Copy link
Author

mason-stafford commented Oct 19, 2021

Hi again, @kriswiner
I'm still working on this issue, after making sure the calibration has done properly, I realized it's all related to Kalman Covariance Variables and it should be personalized for any specific sensor.
It was just an update, I'm gonna share the exact settings.

Regards,

Mason

@kriswiner
Copy link
Owner

kriswiner commented Oct 19, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants