Skip to main content
IKhan.1
Associate
February 11, 2021
Solved

ST IMU LSM6DSL- software or algorithm to implement in to our firmware to determine the speed/acceleration & distance from IMU data.

  • February 11, 2021
  • 1 reply
  • 1860 views

We are using ST IMU LSM6DSL in to our chipset/PCB.

We are looking for ready to use software or algorithm to implement in to our firmware to determine the speed/acceleration & distance from IMU data.

Is there any example code available for share?

    Best answer by Eleon BORLINI

    Hi @IKhan.1​ ,

    I believe that the problem can be divided into two step.

    The first step is data acquisition process. For this purpose, especially if you are using a custom application processor, you can refer to the C drivers (lsm6dsl_reg.c) and the C example on Github (lsm6dsl_read_data_polling.c). If you instead are using an STM32, there a re a lot of project /examples

    The second step is the algorithm implementation. If you want to calculate the speed and the distance from the raw data, you should use more complex libraries, and take care of the periodic calibration of the sensors. There are some examples available for STM32 in the X-CUBE-MEMS1 firmware function pack (such as the MotionPE real-time pose estimation or the MotionFX sensor fusion library). You could start from these examples (although the source code of these libraries is not open source) and build up your own code.

    -Eleon

    1 reply

    Eleon BORLINI
    Eleon BORLINIBest answer
    ST Employee
    February 12, 2021

    Hi @IKhan.1​ ,

    I believe that the problem can be divided into two step.

    The first step is data acquisition process. For this purpose, especially if you are using a custom application processor, you can refer to the C drivers (lsm6dsl_reg.c) and the C example on Github (lsm6dsl_read_data_polling.c). If you instead are using an STM32, there a re a lot of project /examples

    The second step is the algorithm implementation. If you want to calculate the speed and the distance from the raw data, you should use more complex libraries, and take care of the periodic calibration of the sensors. There are some examples available for STM32 in the X-CUBE-MEMS1 firmware function pack (such as the MotionPE real-time pose estimation or the MotionFX sensor fusion library). You could start from these examples (although the source code of these libraries is not open source) and build up your own code.

    -Eleon

    IKhan.1
    IKhan.1Author
    Associate
    February 15, 2021
    Hi Eleon,
    Thanks much for the excellent suggestions.
    Have a great day.
    Eleon BORLINI
    ST Employee
    February 15, 2021

    Thank you @IKhan.1​  :smiling_face_with_smiling_eyes:

    Have a nice day you too,

    -Eleon