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

LSM9DS1 Gyro lsb value #20

Open
aktorh opened this issue Jan 9, 2022 · 6 comments
Open

LSM9DS1 Gyro lsb value #20

aktorh opened this issue Jan 9, 2022 · 6 comments

Comments

@aktorh
Copy link

aktorh commented Jan 9, 2022

According to the datasheet, lsb of gyro is 8.75 mdps/lsb for +-245 dps. 245/32768 gives 7.4768 mdps. Its also different for +-500 and +-2000 dps. Which one we should use?

@kriswiner
Copy link
Owner

kriswiner commented Jan 9, 2022 via email

@kriswiner
Copy link
Owner

kriswiner commented Jan 9, 2022 via email

@aktorh
Copy link
Author

aktorh commented Jan 9, 2022

OK. i will ask them :)

@aktorh
Copy link
Author

aktorh commented Jan 11, 2022

While waiting answer from ST , i checked official ST drivers and found this.
float_t lsm9ds1_from_fs245dps_to_mdps(int16_t lsb)
{
return ((float_t)lsb * 8.75f);
}

float_t lsm9ds1_from_fs500dps_to_mdps(int16_t lsb)
{
return ((float_t)lsb * 17.50f);
}

float_t lsm9ds1_from_fs2000dps_to_mdps(int16_t lsb)
{
return ((float_t)lsb * 70.0f);
}

from source file (line 113)
https://github.com/STMicroelectronics/lsm9ds1/blob/2d4d0282f4628c4eee820d55a48b8d3d8494e7c3/lsm9ds1_reg.c

@aktorh
Copy link
Author

aktorh commented Jan 12, 2022

I got the answer from stm :
"Hi, you can refer to the datasheet or to the C drivers on Github.

In order to convert from LSB to physical units (in this case dps), you have to multiply the raw data (in LSB, obtained concatenating for example the OUT_X_H_G and the OUT_X_L_G, and casting the result into int16_t). Then, you have simply to multiply for 8.75, since the sensitivity is already expressed in milli-dps (so, no need to divide for 1000)

float_t lsm9ds1_from_fs245dps_to_mdps(int16_t lsb)
{
return ((float_t)lsb * 8.75f);
}"

@kriswiner
Copy link
Owner

kriswiner commented Jan 12, 2022 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