2019-06-14 06:39 AM
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!
2019-06-14 06:57 AM
Please read UM for MotionFX libray.
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
2019-06-14 07:12 AM
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!
2019-06-14 07:22 AM
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.
2019-06-14 09:22 AM
Very good, that's exactly what I was interested in.
Thank you!