XloBorg Calibration issue(s)
Forums:
I'm getting some odd results as I try to "calibrate" my XloBorg magnetometer using this instructables article:
http://www.instructables.com/id/Simple-Manual-Magnetometer-Calibration/
I haven't had a chance to look at this closely yet, but I suspect his code isn't reading things properly.
Anybody else ever looked at this?
Thanks!
'sig
piborg
Fri, 04/15/2016 - 10:51
Permalink
Checking if the XloBorg is okay
It might be worth checking the XloBorg is working correctly.
We have seen one before which seemed to have a damaged Z reading:
https://www.piborg.org/comment/612#comment-612
sigpaw@hotmail.com
Fri, 04/15/2016 - 15:48
Permalink
When using the utility
When using the utility downloaded from the instructables article mentioned above, I see NO change in the X magnetic reading. Although Y and Z show repeatable change. But none of the axis are bipolar when flipped 180 deg as he sugests.
When I use examples from this site I see repeatable changes in X, Y and Z. But none are bipolar there either.
Should each magnetic axis flip in sign as it is rotated 180 deg in it's axis?
Thanks!
FYI
I do see + and - 1G in each accelerometer axis as I align each axis with respect to earths gravity.
piborg
Fri, 04/15/2016 - 16:14
Permalink
Raw magnetometer readings
Usually you would, but it might just be very offset readings.
What sort of readings are you seeing?
sigpaw@hotmail.com
Fri, 04/15/2016 - 20:25
Permalink
Samples using "their" software
Here are the samples I obtained using the code off of the instructables webpage (however, using YOUR XLoBorg.py driver, I am seeing a nice variance in the X axis - albeit not bipolar):
x -594.4
y 277.6
z -129.2
x -546. ;Rotated 180 deg
y 683.3
z -134.7
x -543.7 ;Flipped upside down
y 313.2
z -1076.6
x -607.6 ;Upside down and rotatedd back 180 deg
y 684.4
z -1073.7
As you can see, X has very little variance with their driver/software. I'm going to do a "diff" between their XLoBorg.py file and yours. Hopefully they are similar enough to point out the difference(s).
I will do another run using your example XLoBorg.py file and post them shortly...
sigpaw@hotmail.com
Wed, 04/20/2016 - 11:37
Permalink
Okay
Okay.
I'm using the ReadCompass.py file off of the Instrucables "Simple Manual Magnetometer Calibration" (at the URL above). But in this set of values I used YOUR XLoBorg.py file (included at the top of ReadCompass.py) rather than the one he supplies. I did a simple N, S, E, W sample of all the values as outlined below:
North STDVN
X -677.9 2.1
Y 698.7 2.2
Z -282.8 3.3
East
X -738.7 2.6
Y 424.6 2.0
Z -302.6 3.4
South
X -504.2 2.1
Y 331.1 2.4
Z -310.4 3.7
West
X -399.9 2.8
Y 581.4 1.8
Z -309.9 3.5
I see values within the STDVN time after time. But they are severely "tweaked" to say the least.
ideas? :-)
piborg
Wed, 04/20/2016 - 12:02
Permalink
XLoBorg.py differences
I have had a look at the differences between our script and his and they are:
I am not entirely sure how much of an effect this will all have.
One question is do you have a
MAG3110offsets
file and if so what are the values in it?The calbration routine we have been using here was a simple offset and gain procedure like this:
https://www.piborg.org/comment/400#comment-400
The examples are for C but the idea of what it does should be fairly straight forward.
On a side note I am guessing the XLoBorg is fitted inside your Metal Edition.
If so I expect that the two large metal plates affect the magnetometer readings somewhat.
It is quite possible they are the reason for such large offsets.
Hopefully the calibration will remove the unwanted effects.
sigpaw@hotmail.com
Wed, 04/20/2016 - 16:53
Permalink
There is no MAG3110offsets
There is no MAG3110offsets file. But now I wonder if he is initializing his offset variables to zero prior to looking for/reading in a file.
Not using the stainless diddy yet. All my tinkering thus far has been "indoors" with my DiddyRed.
I had also considered a gain value for my X axis, since it has slightly less "travel" than the Y axis. Just enough gain to get it to run from 0 to 400 like the Y axis. Something like a multiplier of 1.18 or so...
So you concur then that my XLoBorg is likely OK?
I'm going to order a second XLoBorg (or two) here in a bit for my diddy stainless, I guess I can compare them to one another then. ;-)
piborg
Thu, 04/21/2016 - 10:33
Permalink
XLoBorg okay
Yes, it does sound like it is okay, it just has some rather large offsets.
The gain between axes is not that unusual, a fair number I have tried had an axis which wanted a ±10% gain or more.
I think a large amount of the gain comes from the mounting of the magnetometer, even the board itself adds some 'noise' to the reading.
As a heads-up if you put the same XLoBorg into a different robot later it will probably warrant a re-calibration.
In particular I would suspect the metal plates to throw the readings somewhat.
sigpaw@hotmail.com
Thu, 04/21/2016 - 20:16
Permalink
Motor magnets?
You know... It may actually work BETTER on the Diddy Metal. The permanent magnets in those 6 large motors HAVE to be causing some interference. Don't you think? :-)
piborg
Fri, 04/22/2016 - 10:21
Permalink
Motor noise
That is a very good point, it probably deserves a bit of an experiment :)