cancel
Showing results for 
Search instead for 
Did you mean: 

Continuously varying output from MEMS Gyroscope

Sharat_Rao
Associate III

We are using the X-STM32MP-GNSS2 (with the STM32 discovery board DK2), which has ISM330DHCX IMU. The accelerometer readings seem fine from the IMU, but the gyroscope gives enormously high and varying readings even when we are stationary. See below the varying output from the gyro

 

 

root@FAFUSION:/sys/bus/iio/devices/iio:device2# ls buffer in_anglvel_x_raw sampling_frequency buffer0 in_anglvel_y_raw sampling_frequency_available current_timestamp_clock in_anglvel_z_raw scan_elements dev name subsystem in_anglvel_scale of_node uevent in_anglvel_scale_available power waiting_for_supplier root@FAFUSION:/sys/bus/iio/devices/iio:device2# cat name ism330dhcx_gyro root@FAFUSION:/sys/bus/iio/devices/iio:device2# cat sampling_frequency 833.000000 root@FAFUSION:/sys/bus/iio/devices/iio:device2# cat in_anglvel_scale 0.000152716 root@FAFUSION:/sys/bus/iio/devices/iio:device2# cat in_anglvel_x_raw in_anglvel _y_raw in_anglvel_z_raw -19111 11246 -3500 root@FAFUSION:/sys/bus/iio/devices/iio:device2# cat in_anglvel_x_raw in_anglvel _y_raw in_anglvel_z_raw -18835 15691 -4096 root@FAFUSION:/sys/bus/iio/devices/iio:device2# root@FAFUSION:/sys/bus/iio/devices/iio:device2# cat in_anglvel_x_raw in_anglvel _y_raw in_anglvel_z_raw -19119 -22581 -10041 root@FAFUSION:/sys/bus/iio/devices/iio:device2# cat in_anglvel_x_raw in_anglvel _y_raw in_anglvel_z_raw -19194 16978 -4096 root@FAFUSION:/sys/bus/iio/devices/iio:device2#
View more

 

 

Also, the scale here does not seem correct. For a 16-bit 2s-complement max of 32767 and a scaling factor of 0.000152716, the full-scale range is 32767 x 0.000152716 = 5 degrees/sec, which is not what the datasheet says. I would expect this to be 125 dps.

 

3 REPLIES 3
Federica Bossi
ST Employee

Hi @Sharat_Rao ,

Can you try to follow our examples on Github and let me know if you still have the same issue?

Thanks

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.
Sharat_Rao
Associate III

Hi @Federica Bossi ,

We are using the drivers from that link which is what is causing the device to get enumerated as an IIO device. The question here is more about the gyroscope itself. Even at rest, it is measuring extremely large angular rates. How can we debug and fix this?

MZina.1
Associate II

We have same problem here: for example at range of 125 dps we are getting this results in full stop position:

raw data output: X: -29 Y: -98 Z: -86 which function "ism330dhcx_from_fs250dps_to_mdps" transates to: -87.500000 -542.500000 -437.500000 dps and this is not acceptable.