ISM330DHCX: Gyro range in driver: calculation does not make sense
Greetings,
I am trying to figure out the full chain scaling values for the gyro and accelerometer of the ISM330DHCX. I am reading the datasheet as well as the AN5398.
According to the datasheet the output values of accelerometer and gyro is scaled with the configured range over an int16 to milli-g and milli-dps. So to convert an acceleration reading for with the sensor configured to 2g we do:
scale = 2 * 1000 / 2**15
accel = raw * scale // accel now in milli-g
for 2g scale is about 0.061. The same formula can be used to get the scale for the other ranges. For acceleration these values make sense in existing drivers (linked below).
However, when doing the same calculation for the gyro range things do not make sense. E.g. for a range of 250 dps we should get:
scale = 250 * 1000 / 2**15 = 7.629
but this value is not the one that is listed in existing drivers, there rather 8.75 is listed which corresponds to a range of 286.72 dps! The example output in table 20 in AN5398 also corresponds to the 8.75 scale rather than the expected 7.629. What is the correct way to calculate the scale of the gyro and is this documented somewhere?
Best regards, Gaute
Existing drivers:
* https://github.com/STMicroelectronics/ism330dhcx-pid/blob/master/ism330dhcx_reg.c#L91
* https://github.com/adafruit/Adafruit_LSM6DS/blob/master/Adafruit_LSM6DS.cpp#L491
