Skip to main content
IKhan.1
Associate
Solved

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

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?

    This topic has been closed for replies.
    Eleon BORLINI
    Eleon BORLINIBest answer
    ST Employee

    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

    4 replies

    Eleon BORLINI
    Eleon BORLINIBest answer
    ST Employee

    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
    Hi Eleon,
    Thanks much for the excellent suggestions.
    Have a great day.
    Eleon BORLINI
    ST Employee

    Thank you @IKhan.1​  :smiling_face_with_smiling_eyes:

    Have a nice day you too,

    -Eleon