I have two magnetometers (Mag3110) and am trying to get the difference in angle heading between them. Theoretically, if they are oriented the same way (they are also in close proximity to each other), the heading should be the same. That is not the result I am getting, however. Here is an example of the output:
Am I getting incorrect heading data because of the large values? I searched this and someone else responded to the same problem and had said that "The outputs are 16-bit SIGNED integer (int)", so those large values are actually supposed to be negative numbers. Why is it outputting this data type rather than two's complement (which according to the hookup guide it should be outputting), and how do I fix this so that I can calculate the correct heading? Been struggling with this for a while now, any help would be great!
even though they are in close proximity there may be a local magnetic disturbance, a power supply, a mouse, usb cord, or a ring on your finger that is causing a weird disturbance as such.
In order to rule this out have you used processing or the serial window to visualize angles in different spots in your environment? just move around the room within your usb distance and see how wildly this determined angle fluctuates, if it is not much, then it will be great to know it is software. Just thinking of the weird edge case things! good luck!
So it is most likely some software issue. I do not have these modules nor experience with it but, who knows, mayyyybe I can help inspire you.
So I guess I am not entirely sure how I2C works, how are you addressing each module separately? do they both work properly If only one is plugged into the bus at a time? I am wondering if the actual data part of the packet is getting processed properly by the code/libraries running.
also related, are you using one I2C bus or two(one hardware and one software driven?)? If yes, I suspect the software driven part is to blame.
If you can swap the order of how they are plugged in does the same module keep spitting out the unsigned code?
Hope any part of this helps you!
again, good luck!
Blade:
I have two magnetometers (Mag3110) and am trying to get the difference in angle heading between them. Theoretically, if they are oriented the same way (they are also in close proximity to each other), the heading should be the same. That is not the result I am getting, however.
Did you do hard and soft iron correction/calibration on them? MEMS magnetometers require this.