cancel
Showing results for 
Search instead for 
Did you mean: 

ISM330BX SFLP drift

Leo0n
Associate

Hi everyone,

I’m developing an application that tracks the path of a device using the ISM330BX IMU and sensor fusion. I’ve based my implementation on ST’s GitHub example for sensor fusion, and the rotation outputs appear to respond correctly when I move the sensor. Pitch and roll are stable, and the orientation updates as expected.

However, I’m seeing significant drift in the yaw when the device is stationary. I understand that yaw is difficult to estimate accurately with only a 6-axis sensor (no magnetometer), but I’ve observed a big difference between my application and the ISM330BX demo board (STEVAL-MKI245KA) running in MEMS Studio.

For example:

  • On my custom board, I’ve observed drift of nearly 2° per minute at a 3.84 kHz data rate.
  • Lowering the data rate to 30 Hz helps — I now see around 0.5° per minute.
  • In contrast, with the demo board in MEMS Studio (also at 3.84 kHz), the drift is only about 0.1° per minute.

I’m trying to figure out what could be causing the higher drift in my setup. Is there anything I can do in the code or configuration to reduce yaw drift?

Any suggestions on what settings or techniques might help would be greatly appreciated.

Thanks in advance!

my power up code is:

void gyro_powerup()
{
    ism330bx_reset_t rst;
    ism330bx_sflp_gbias_t gbias;

    dev_ctx.write_reg = platform_write;
    dev_ctx.read_reg = platform_read;
    dev_ctx.mdelay = platform_delay;
    dev_ctx.handle = NULL;

    ism330bx_device_id_get(&dev_ctx, &whoamI);
    if (whoamI != ISM330BX_ID)
    {
        ESP_LOGE(TAG, "Wrong WHOAMI: 0x%02X", whoamI);
        return;
    }
    ism330bx_reset_set(&dev_ctx, ISM330BX_RESTORE_CTRL_REGS);
    do
    {
        ism330bx_reset_get(&dev_ctx, &rst);
    } while (rst != ISM330BX_READY);

    ism330bx_sflp_configure(&dev_ctx);

    /* Enable Block Data Update */
    ism330bx_block_data_update_set(&dev_ctx, PROPERTY_ENABLE);

    ism330bx_xl_full_scale_set(&dev_ctx, ISM330BX_8g);
    ism330bx_gy_full_scale_set(&dev_ctx, ISM330BX_4000dps);
    /*
     * Set FIFO watermark (number of unread sensor data TAG + 6 bytes
     * stored in FIFO) to FIFO_WATERMARK samples
     */
    ism330bx_fifo_watermark_set(&dev_ctx, 32);

    /* Set FIFO batch of sflp data */
    fifo_sflp.game_rotation = 1;
    fifo_sflp.gravity = 1;
    fifo_sflp.gbias = 1;
    ism330bx_fifo_sflp_batch_set(&dev_ctx, fifo_sflp);

    /* Set FIFO mode to Stream mode (aka Continuous Mode) */
    ism330bx_fifo_mode_set(&dev_ctx, ISM330BX_STREAM_MODE);

    /* Set Output Data Rate */
    ism330bx_xl_data_rate_set(&dev_ctx, ISM330BX_XL_ODR_AT_30Hz);
    ism330bx_gy_data_rate_set(&dev_ctx, ISM330BX_XL_ODR_AT_30Hz);
    ism330bx_sflp_data_rate_set(&dev_ctx, ISM330BX_SFLP_30Hz);

    ism330bx_sflp_game_rotation_set(&dev_ctx, PROPERTY_ENABLE);

    gbias.gbias_x = 0.0f;
    gbias.gbias_y = 0.0f;
    gbias.gbias_z = 0.0f;
    ism330bx_sflp_game_gbias_set(&dev_ctx, &gbias);
}

 

1 REPLY 1
Federica Bossi
ST Employee

Hi @Leo0n ,

In MEMS Studio a FS of 2000 dps is set, values <= of 2000dps improve Sensor fusion performance consistent with the application.
Generally, the suggestion is to put the minimum full scale for the signals of interest: for example, if the maximum you can have in the app is 850, then set 1000 dps.

With 4000 dps there will be a quatization effect in HFP.

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.