cancel
Showing results for 
Search instead for 
Did you mean: 

Gain problem with ST accelerometer

BSago.1
Associate

we are trying to test ISM330 for recoding acceleration signal in a BW of 10-1000Hz. We have done the test on a few different sensors with a calibrated shaker. The results show quite erratic and non-linear behavior even from the low frequency of 100Hz.We are really puzzled of this behavior. Below are some sensor Gain plots. reference line is a Gain of 1.based on the constant amplitude input from the shaker.

Below is the register dump from the sensor. We only have the LP filter on and no other filters and are removing the average from the raw data to take out the DC offset.

1. Read ID of ISM330 DHCX

2. Initialize ISM330DHCX

2.1 /* Enable register address automatically incremented during a multiple byte access with a serial interface */

ism330dhcx_auto_increment_set(&(pObj->Ctx), PROPERTY_ENABLE);

/* Register Dump */

ISM330DHCX_CTRL3_C = 44

2.2 /* SW reset */

ism330dhcx_reset_set( &(pObj->Ctx), PROPERTY_ENABLE)

/* Register Dump */

ISM330DHCX_CTRL3_C = 04

2.3 /* Enable register address automatically incremented during a multiple byte access with a serial interface */

ism330dhcx_auto_increment_set(&(pObj->Ctx), PROPERTY_ENABLE)

/* Register Dump */

ISM330DHCX_CTRL3_C = 04

/* Enable BDU */

if (ism330dhcx_block_data_update_set(&(pObj->Ctx), PROPERTY_ENABLE)

/* Register Dump */

ISM330DHCX_CTRL3_C = 44

2.4 /* FIFO mode selection */

ism330dhcx_fifo_mode_set(&(pObj->Ctx), ISM330DHCX_BYPASS_MODE)

/* Register Dump */

ISM330DHCX_FIFO_CTRL4 = 00

2.5 /* Output data rate selection - power down. */

ism330dhcx_xl_data_rate_set(&(pObj->Ctx), ISM330DHCX_XL_ODR_OFF)

/* Register Dump */

ISM330DHCX_CTRL1_XL = 00

2.6 /* Full scale selection. */

ism330dhcx_xl_full_scale_set(&(pObj->Ctx), ISM330DHCX_2g)

/* Register Dump */

ISM330DHCX_CTRL1_XL = 00

2.7 /* Output data rate selection - power down. */

ism330dhcx_gy_data_rate_set(&(pObj->Ctx), ISM330DHCX_GY_ODR_OFF)

/* Register Dump */

ISM330DHCX_CTRL2_G = 00

2.8 /* Full scale selection. */

ism330dhcx_gy_full_scale_set(&(pObj->Ctx), ISM330DHCX_2000dps)

/* Register Dump */

ISM330DHCX_CTRL2_G = 0C

3. /* Enabling Accelerometer */

pObj->acc_odr = ISM330DHCX_XL_ODR_104Hz;

ism330dhcx_xl_data_rate_set(&(pObj->Ctx), pObj->acc_odr)

/* Register Dump */

ISM330DHCX_CTRL1_XL = 40

4. /* Enabling Accelerometer */

pObj->acc_odr = ISM330DHCX_XL_ODR_104Hz;

ism330dhcx_xl_data_rate_set(&(pObj->Ctx), pObj->acc_odr)

/* Register Dump */

ISM330DHCX_CTRL1_XL = 94

5. /* Set FS value */

new_fs = ISM330DHCX_16g;

ism330dhcx_xl_full_scale_set(&(pObj->Ctx), new_fs)

/* Register Dump */

ISM330DHCX_CTRL1_XL = 94

6. /* Set ODR value */

new_odr = ISM330DHCX_XL_ODR_3333Hz;

ism330dhcx_xl_data_rate_set(&(pObj->Ctx), new_odr)

/* Register Dump */

ISM330DHCX_CTRL1_XL = 94

7. /* Set FIFO watermark */

Watermark = 256

ism330dhcx_fifo_watermark_set(&(pObj->Ctx), Watermark)

/* Register Dump */

ISM330DHCX_FIFO_CTRL2 = 01

8. /* Selects decimation for timestamp batching in FIFO */

decimation = ISM330DHCX_NO_DECIMATION;

ism330dhcx_fifo_timestamp_decimation_set(&(pObj->Ctx), (ism330dhcx_odr_ts_batch_t)decimation)

/* Register Dump */

ISM330DHCX_FIFO_CTRL4 = 00

9. /* Selects batching data rate for temperature data */

bdr = ISM330DHCX_TEMP_NOT_BATCHED

ism330dhcx_fifo_temp_batch_set(&(pObj->Ctx), (ism330dhcx_odr_t_batch_t)bdr);

/* Register Dump */

ISM330DHCX_FIFO_CTRL4 = 00

10. /* Set FIFO mode */

Mode = ISM330DHCX_STREAM_MODE

ism330dhcx_fifo_mode_set(&(pObj->Ctx), (ism330dhcx_fifo_mode_t)Mode)

/* Register Dump */

ISM330DHCX_FIFO_CTRL4 = 06

11. /* INT2_FIFO_FULL interrupt enable */

reg.int2_ctrl.int2_fifo_th = 1;

ism330dhcx_write_reg(&(pObj->Ctx), ISM330DHCX_INT2_CTRL, &reg.byte)

/* Register Dump */

ISM330DHCX_INT2_CTRL = 08

12. /* INT1_FIFO_FULL interrupt disable */

reg.int1_ctrl.int1_fifo_full = 0;

if (ism330dhcx_write_reg(&(pObj->Ctx), ISM330DHCX_INT1_CTRL, &reg.byte, 1)

/* Register Dump */

ISM330DHCX_INT1_CTRL = 00

13. /* Set FIFO BDR value */

new_odr = ISM330DHCX_XL_BATCHED_AT_3333Hz

ism330dhcx_fifo_xl_batch_set(&(pObj->Ctx), new_odr)

/* Register Dump */

ISM330DHCX_FIFO_CTRL3 = 09

14. Wait for Interrupt

15. Read ISM330DHCX_FIFO_STATUS1 & ISM330DHCX_FIFO_STATUS2 for unread samples

16. Read data from FIFO starting from ISM330DHCX_FIFO_DATA_OUT_TAG

Your feedback is much appreciated.

Regards

1 REPLY 1
Eleon BORLINI
ST Employee

Hi @BSago.1​ ,

which amplitude (in "g") are you using for your test?

-Eleon