Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Magnetometer Calibration #9

Closed
dmamalis opened this issue Dec 20, 2017 · 4 comments
Closed

Magnetometer Calibration #9

dmamalis opened this issue Dec 20, 2017 · 4 comments

Comments

@dmamalis
Copy link

dmamalis commented Dec 20, 2017

@kriswiner i have been using your code to make an ecompass and I have had a few problems which I am trying to pin down. Seeing issues on other repos of yours I decided to put some more effort on calibrating the magnetometer before posting.

According to my results, unless I am doing something terribly wrong, the magcal algorithm seems to be inadequate.

First I run it multiple times and found out that the magBias results are completely different. Then I plotted some experiments to make this a bit more concise. In the next screenshots you can see three views of the same experiment (mx, my, mz being printed)

screenshot from 2017-12-20 23-21-00
screenshot from 2017-12-20 23-20-39
screenshot from 2017-12-20 23-20-22

It looks like there is need for both soft and hard iron calibration.

@kriswiner
Copy link
Owner

kriswiner commented Dec 20, 2017 via email

@dmamalis
Copy link
Author

That was a quick reply! Thank you.

I also used the MotionCalc calibration tool to visualize data and I realized that the previous screenshots MUST be wrong, at least with regards to the soft iron issue. I am guessing my gnuplot script is faulty.

Here is the MotionCalc screenshot with shows much better soft iron results
screenshot from 2017-12-21 00-26-24

No I am definitely not leaving it flat but I guess a few more samples might be a better solution.

Last but not least, could you please explain to me why the magBias is commented out in these lines?
https://github.com/kriswiner/LSM9DS1/blob/master/LSM9DS1_MS5611_BasicAHRS_t3.ino#L437

@kriswiner
Copy link
Owner

kriswiner commented Dec 20, 2017 via email

@dmamalis
Copy link
Author

I changed the samples to 512 to give some extra data and the calibration is much better now. I consider this closed. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants