sparkfun/SparkFun_LSM9DS1_Arduino_Library

accelerometer dynamic range

JVHooligan opened this issue · 1 comments

In the sample code (LSM9DS1_Settings for the IMU breakout board LSM9DS1 from sparkfun) the accelerometer dynamic range can be set in the line of code:

imu.settings.accel.scale = 16; // Set accel scale to +/-16g.

when I set the range to 2, 4, or 8 the acceleration measured when the IMU is 'flat' on a given axis the acceleration reads about 1 or - 1 which makes sense as it is being accelerated with 1 G of gravity. When I set it to 16 the acceleration is about 0.68 when exposed to 1 G. My question is does anyone know what is going on? Why is the acceleration not 1?

Looks like there was a bug in calculating both accelerometer and gyroscope values. It was most prevalent when the accelerometer was set to 16g.

Try updating to the latest release, should be fixed in commit b149428. Calculations now use constants derived from table 3 of the LSM9DS1 datasheet instead of a straight division of 215.