Author Topic: Magnetometer - Questions  (Read 310 times)

0 Members and 1 Guest are viewing this topic.

Offline mzdenkov

  • Regular Contributor
  • *
  • Posts: 78
  • Country: hr
Magnetometer - Questions
« on: February 06, 2020, 03:56:11 pm »
So i have this magnetometer LIS2MDL.
Normally i use magnetometers that have scale  +-8 or +-2 gauss.

They say that it has " ±50 gauss magnetic dynamic range ", what does "dynamic range" mean?
Is it good to determinate where north pole is(aka use it as a compass)?

Thank you.
Best Regards.
To Solder or not to solder, that is the question!
 

Offline m98

  • Frequent Contributor
  • **
  • Posts: 415
  • Country: de
Re: Magnetometer - Questions
« Reply #1 on: February 06, 2020, 09:57:07 pm »
Dynamic range is the range the physical quantity you want to measure lies in. So in this case, the magnetometer will give you a value from -50 to +50 gauss, with adjustable null point.
In this case, the higher range allows you to compensate for stronger magnetic fields in the environment while still being able to measure the earth's weak magnetic field. This comes at the price of resolution.
 

Offline mzdenkov

  • Regular Contributor
  • *
  • Posts: 78
  • Country: hr
Re: Magnetometer - Questions
« Reply #2 on: February 08, 2020, 12:43:22 pm »
Greetings,

Quote
This comes at the price of resolution.

Thank you for your answer.

After making little calculations and using WIKI.

Earths magnetic field is: 0.25(250mgauss) to 0.65(650mgauss) gauss.
LIS2MDL has 16bit data registers and sensitivity 1.5 mgauss/LSB

250 mgauss / 1.5 (mgauss / LSB) = 166.66 -> 167
650 mgauss / 1.5 (mgauss / LSB) = 433.33 -> 434

And if im not wrong ill be working in range of  8 to 12 bits of usable data ?

« Last Edit: February 08, 2020, 12:45:05 pm by mzdenkov »
To Solder or not to solder, that is the question!
 

Offline Siwastaja

  • Super Contributor
  • ***
  • Posts: 2661
  • Country: fi
Re: Magnetometer - Questions
« Reply #3 on: February 08, 2020, 05:57:21 pm »
Yes, having already been answerred, do note that using magnetometer as a compass is a fairly complicated task.

If you need more accuracy than, say, +/- 45 degrees, you need at minimum:
1) A calibration jig
2) A calibration and data compensation algorithm against hard iron and soft iron distortion. This needs to be unit-by-unit. The math for simple compensation (say, to +/- 20 degree accuracy) is fairly simple, do some offset & gain scaling, but for really usable compass, especially 3D (one which can be used at any angle), the math is very convoluted and I haven't been able to find any open-source implementation or freely available description

Getting low-noise data practically requires averaging over a long time, say second-scale. If you then need quick response, you need to do some sensor fusion with gyros, which in itself is fairly trivial if you have already solved 1 and 2.

PCB layout and device casing matters as well.

All of this is because the earth's magnetic field is very weak, interference sources are often much stronger, and all the nearby components and metallic materials distort the fields.

This is something I tried to do as a part of a bigger project, and never had time to do properly. It was more difficult than I thought.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf