2024-05-22 05:31 AM
Hello Everyone!
I am working on a project Ecompass using controllers STM32F401CBU6 and mems sensor ISM303DAC. can able to read raw values of both accelerometer data and magnetometer data properly and after reading the magnetometer data i am parsing magnetometer data to MotionMC library for calibration purpose but after calling MotionMC_GetCalParams function output is always showing as
HI_Bias = {0, 0, 0},
SF_Matrix = {{1, 0, 0}, {0, 1, 0}, {0, 0, 1}},
CalQuality = MMC_CALQSTATUSUNKNOWN
i have used systick as timestamp and and also cross verified with heap and stack, rotating the sensor in 3D space 8 direction everting tried but nothing got work..... got stuck at this point.
could anyone please let me know what might be the problem.
Thank you!!!
ANIL.
Solved! Go to Solution.
2024-06-05 03:55 AM
I'm glad you finally calibrated successfully. After disconnecting power you need to calibrate it again otherwise you should implement storage of your calibration parameters and reload it after powerup but since magnetic field can change it's always better to calibrate again. Concerning the drift I'm not an expert for the algorithm so I cannot answer. Bye bye.
2024-05-23 06:00 AM
Hello @Anil3,
Could you please send me the datalog containing all your input data including timestamp that you feed to library?
Attached is the example of the datalog format I'd be able to use for offline analysis.
Thanks and regards,
Petr
2024-05-24 05:16 AM - edited 2024-05-24 05:28 AM
Thanks for the reply @Petr S
Here is the data that I transmit as input for the Motion MC library, also i am attaching my project file link please have a look and suggest me if any changes required.
https://drive.google.com/file/d/1HZHeFVc6uA-nNU5QG3OdYpGI2Ij1SvnH/view?usp=drive_link
regards,
ANIL.
2024-05-24 05:56 AM
I just checked your datalog and for the first look I noticed that accZ axis is copy of accY axis (or vice versa) so please check the data you get from the sensors, their processing (like unit conversion) and correctness of data feeding into library. Please take MagnetometerCalibration application in latest X-CUBE-MEMS1 as reference.
2024-05-24 10:31 PM
Hello @Petr S
Yah!! by mistake while printing the data i have printed the accelerometer both y and z axis as same sorry for inconvenience!!! here is the exact data that i am being received from sensor.
I have considered UM2192 for my reference.
Please find the attached.
Thank you!
Here i am having a doubt like... while feeding data to Motion_MC library we are feeding only magnetometer data with timestamp on such case we need to consider only the magnetometer data right or both accelerometer and magnetometer??
regards,
ANIL.
2024-05-27 09:14 PM
can anyone please looking into this issue?? as I have got stuck with this thing!!!!
Thank you.
regards,
ANIL.
2024-05-30 04:16 AM
You're right, only magnetometer data are needed. But the data in your last datalog shows you're not rotating the board at all.
You need to rotate the board around all 3 axes (ideally more than 360° around each axis). Then the elliptic magnetometer data are transformed into sphere and shifted to 0,0,0. The transformation parameters are actually soft iron and hard iron calibration parameters. See the example of my datalog I sent you before:
2024-06-02 09:39 PM
Hello @Petr S
As i have mentioned earlier (at beginning of my post) even tried by rotating device 3d space 8 shaped direction, then also it not getting the calibrated output...
Don't know exactly what I am missing with.
regards,
ANIL.
2024-06-03 12:31 AM
Aha, ok, so please send me your datalog with rotation around all 3 axes and I'll simulate it here to see if the problem is in your data or in your code. Again I really suggest to compare your code with MagnetometerCalibration application code in latest X-CUBE-MEMS1 package to see if you do everything the same way, especially if there is some data conversion and so on. Every detail can count.
2024-06-03 10:35 PM
Hello @Petr S
Here is the data log that i have logged with rotation.
Please find the attached.
Thank you!!!
regards,
ANIL.