cancel
Showing results for 
Search instead for 
Did you mean: 

ISM330DHCX: Gyro range in driver: calculation does not make sense

GHope.2
Associate II

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 

1 ACCEPTED SOLUTION

Accepted Solutions
Federica Bossi
ST Employee

Hi @GHope.2 ,

Yes, for the sensitivity you can refer to the Table 2 of the Datasheet: you need to multiply the output in LSB by the sensitivity value corresponding to your full scale.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

View solution in original post

2 REPLIES 2
GHope.2
Associate II

I found the mdps / LSB section in Table 2 in the datasheet. I assume this explains it?

Federica Bossi
ST Employee

Hi @GHope.2 ,

Yes, for the sensitivity you can refer to the Table 2 of the Datasheet: you need to multiply the output in LSB by the sensitivity value corresponding to your full scale.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.