STMicroelectronics / STMems_Standard_C_drivers

Platform-independent drivers for STMicroelectronics MEMS motion and environmental sensors, based on standard C programming language.
BSD 3-Clause "New" or "Revised" License
710 stars 517 forks source link

Incorrect unit for the gyro self-test values in Example for LSM9DS1 #80

Closed siddhantmodi closed 4 years ago

siddhantmodi commented 4 years ago

In the LSM9DS1 self_test example, the self-test values for the gyroscope are as following:

/* Self test limits in mdps @ 2000 dps*/ static const float min_st_gy_limit[] = {200.0f, 200.0f, 200.0f}; static const float max_st_gy_limit[] = {800.0f, 800.0f, 800.0f};

However, I believe that these numbers are in dps rather than in mdps. This datasheet for the LSM6DS3 shows the self-test limits for the gyro to be in the range of 150-700 dps. If you look at the self-test example for the LSM6DS3, lines 100 and 101 show that these numbers have been multiplied by 1000 to bring them to the mdps unit.

I therefore argue that the same should be done for the LSM9DS1 too. I have run the self-test on my platform and the test is failing unless the numbers are converted to mdps from dps.

albezanc commented 4 years ago

Thank you for your contribution! The example was now fixed.