Skip to main content
Visitor II
June 14, 2019
Question

Sampling frequency of ACC GYRO and MAG for MotionFX

  • June 14, 2019
  • 4 replies
  • 1215 views

Hello in my project I use LSM6DS3TR and LIS3MDLTR.

The data from MEMS is processed by MotionFX.

How high should the sampling rate of LIS3MDLTR be?

How best should I synchronize the data before coming to the MotionFX?

The program runs on the stm32l452 microcontroller.

Thank you!

    This topic has been closed for replies.

    4 replies

    ST Employee
    June 14, 2019

    Please read UM for MotionFX libray.

    https://www.st.com/content/ccc/resource/technical/document/user_manual/group0/31/0e/66/39/cb/f7/4e/cd/DM00394369/files/DM00394369.pdf/jcr:content/translations/en.DM00394369.pdf

    The output data rate for:

    - the gyroscope and the accelerometer should be equal to or greater than 100 Hz

    - the magnetometer can be lower - 20/40 Hz is typically good for a magnetic field sensor

    YLAuthor
    Visitor II
    June 14, 2019

    Hello Miroslav, thank you, for your answer.

    In moment I have set ACC and Gyro on 250Hz and Mag on 80Hz.

    In the moment I synchronize read with the "data ready IRQ" of LSM6.

    I notice that because my magnetometer is out of sync with ACC I do not get values from it.

    My question: do I have to wait on the magnetometer and then transfer all 9 values to MotionFX?

    Should I write 0 in magnetometer data? or should I repeat worth of the last result?

    Thank you for your help!

    ST Employee
    June 14, 2019

    You have to pass all 9 values to MotionFX library. You can't pass 0 in magnetometer data, all data must be valid.

    There is no problem to have lower rate for the magnetometer, each time you have new data from acceleromtere/gyroscope add the latest magnetometer data and pass it to the library.

    You can check DatalogFusion application in X-CUBE-MEMS1 package. You can take it as example.

    YLAuthor
    Visitor II
    June 14, 2019

    Very good, that's exactly what I was interested in.

    Thank you!