cancel
Showing results for 
Search instead for 
Did you mean: 

MotionAC and MotionGC Libraries

N ORhan
Associate III

Hi everyone, i've just started to learn using MEMS libraries in my project and have some questions. First of all; my device is a three wheeled omniwheel-omnidirectional robot which can move only on a flat table(i.e. XY-plane only). So no movements in Z-direction. I want to know its position with respect to its initial position using LSM6DSL chip. I will use both accelerometer and gyroscope data to help to estimate device's real time position and heading(yaw angle with respect to initial heading). To do so, i have to calibrate LSM6DLS at first but because of MEMS libraries are not open source, i can not understand how to implement algorithms. For example my device can not turn in roll or pitch axis, it only moves on xy-plane and turns only in yaw axis. So;

1) which calibration style do i have to use : dynamic or six-point calibration for accelerometer?

2) Do i have to calibrate accelerometer before gyroscope calibration because of MotionGC uses accelerometer data too?

3) How many times should i call for example "MotionAC_GetCalParams" function to have a good calibration output data, or should it be called as long as the duration of motion on the table?

4) If i will use MotionFX library for the estimation of the position and heading angle of my devicei should i call MotionAC and MotionGC libraries before i call MotionFX? Or does MotionFX implement calibration processes internally?

Thanks a lot.

2 REPLIES 2
Eleon BORLINI
ST Employee

Hi @Nazım Önder ORhan​ , thank you for the detailed explanation of your real application case. Please consider below my (tentative) answers:

1) which calibration style do i have to use : dynamic or six-point calibration for accelerometer?

They both calibrate the accelerometer, but I think that 6-point calibration is less expensive in terms of computational effort.

2) Do i have to calibrate accelerometer before gyroscope calibration because of MotionGC uses accelerometer data too?

It's not necessary to launch MotionAC before Motion GC to get good results from MotionGC. You can increase the accuracy inside the MotionGC actiong on AccThr knob, which is the accelerometer threshold to detect steady state in g. The default value is 0.01 g. The input range is 0.003 to 0.05 g. For higher accuracy, set the value low; for platforms inherent vibration or noisy sensor, set the value high.

3) How many times should i call for example "MotionAC_GetCalParams" function to have a good calibration output data, or should it be called as long as the duration of motion on the table?

It depends mostly on you application: if you have to measure and keep track of high frequency acceleration (especially if you have to perform integration to get the distance from the acceleration), you should sometimes perform your calibration during the motion; while if you are almost static and you don't have to perform many integrations, you can perform the calibration only one time.

4) If i will use MotionFX library for the estimation of the position and heading angle of my devicei should i call MotionAC and MotionGC libraries before i call MotionFX? Or does MotionFX implement calibration processes internally?

In UM2220, p.6: Sensor calibration in the MotionFX library Gyroscope and accelerometer calibration Accelerometer calibration is not necessary for sensor fusion except for applications demanding very high orientation precision; it involves aligning the system in several positions according to the gravity direction. Gyroscope calibration is handled automatically by the MotionFX library by continuously compensating the zerorate offset effect. Please consider also that MotionFX library contains routines for magnetometer hard iron calibration, if magnetometer is needed in the sensor fusion.

Regards

N ORhan
Associate III

Thank you very much Mr. @Eleon BORLINI​  for sharing your valuable knowledge with me. I want to ask some more questions based on your answers.

1) This device will be a tele-rehabilitation medical device so patient can not perform any rotational movements to calibrate the device prior to application. I'm talking about this because someone is performing 8-like shaped movements in 3D-space during calibration. Are this movements required to be performed at "dynamic calibration"? Does "dynamic" also require these movements? As i mentioned above, our device can not move or rotate in those directions. So, if i understood the difference of two calibration methods correctly, should i use 6-point calibration in my application? (p.s. we have no magnetometer due to having 3 motors on our device, i think this creates noisy magnetic field around the device.)

2) What is "gyroscope bias learning"? If i called the MotionGC when the device is standing still at the start of the rehabilitation application, should i tune "LMode = 0"?

3) In example projects and applications, i think there are more header files than the required ones like MotionAC_Manager.h. I have to add only "MotionAC_CM4F_wc32_ot.a" and "motion_ac.h", right? And also; without creating a "middlewares" file and adding "MotionAC_CM4F_wc32_ot.a" to my "src" file, does library give permission to acces this library files?

If my questions seem silly, please forgive because i will use these advanced libraries for the first time and if i make them work, i wil use for other projects too. So i have to understand to use these libraries strongly.

Thanks.