2024-01-04 07:36 AM
Hello,
I'm experimenting with algobuilder, motionFX and IKS01A3 + SMK1229AAA.
Btw, very cool app for investigation.
My goal is to obtain vertical speed. As motionFX provide gravity vector with magnitude 1 (let's call it G) and linear acceleration vector (let's call it A).
I computed the vertical acceleration with the dot product A.G which leads to
Ax * Gx + Ay * Gy +Az * Gz
It looks like this method gives the expected result: I get the "same" curve for the "same" vertical movement whatever the orientation of the device and whatever the direction of the movement. (I used quotes for "same" because I'm moving the device by hand ie the movement is not an exact reproduction of the previous one).
However, it seems that there's an offset in result which depends on the orientation. It is particularly visible when the device is not moving: there's still a residual computed speed. If I flip the board, the residual speed is inverted.
You can see it on the screenshot.
Here are my questions:
- Is my computation right?
- Is there a way to remove this offset without using another sensor?
Thanks
Julien
Solved! Go to Solution.
2024-01-08 07:10 AM
I think your calculation if correct. But there always will be some residual acceleration and if you integrate it to get the speed will be drifting.
I would propose to use MotionVC library - Vertical context which is using accelerometer and pressure sensor and can provide you vertical speed. You can find more details in the user manual:
https://www.st.com/content/ccc/resource/technical/document/user_manual/group1/40/a4/0c/23/54/f3/4b/25/DM00542666/files/DM00542666.pdf/jcr:content/translations/en.DM00542666.pdf
The library together with example application is available in X-CUBE-MEMS1 package.
https://www.st.com/en/embedded-software/x-cube-mems1.html
2024-01-08 07:10 AM
I think your calculation if correct. But there always will be some residual acceleration and if you integrate it to get the speed will be drifting.
I would propose to use MotionVC library - Vertical context which is using accelerometer and pressure sensor and can provide you vertical speed. You can find more details in the user manual:
https://www.st.com/content/ccc/resource/technical/document/user_manual/group1/40/a4/0c/23/54/f3/4b/25/DM00542666/files/DM00542666.pdf/jcr:content/translations/en.DM00542666.pdf
The library together with example application is available in X-CUBE-MEMS1 package.
https://www.st.com/en/embedded-software/x-cube-mems1.html
2024-01-09 06:22 AM
Hi Miroslav,
Thanks for you answer.
I'm looking for a solution much more faster than VC.
I did many attemps with differents strategies or sensors and I'm not far to conclude that it is not possible today... :(
thanks again.
Julien