MAG3110 odd output
i have 2 magnetometers (mag3110) , trying difference in angle heading between them. theoretically, if oriented same way (they in close proximity each other), heading should same. not result getting, however. here example of output:
where:
heading2 = atan2(y2, x2)
heading3 = atan2(y3, x3)
radangle = heading2 - heading3
actualanlgle = radangle*(180/pi)
am getting incorrect heading data because of large values? searched , else responded same problem , had said "the outputs 16-bit signed integer (int)", large values supposed negative numbers. why outputting data type rather two's complement (which according hookup guide should outputting), , how fix can calculate correct heading? been struggling while now, great!
code: [select]
x1: 658, y1: 1301, z1: 1238
x2: 491, y2: 222, z2: 64045
x3: 65261, y3: 67, z3: 65459
heading1 = 1.10
heading2 = 0.42
heading3 = 0.00
radangle = 0.42
actualangle = 24.27
where:
heading2 = atan2(y2, x2)
heading3 = atan2(y3, x3)
radangle = heading2 - heading3
actualanlgle = radangle*(180/pi)
am getting incorrect heading data because of large values? searched , else responded same problem , had said "the outputs 16-bit signed integer (int)", large values supposed negative numbers. why outputting data type rather two's complement (which according hookup guide should outputting), , how fix can calculate correct heading? been struggling while now, great!
hello!
thinking of strictly hardware problems right now:
even though in close proximity there may local magnetic disturbance, power supply, mouse, usb cord, or ring on finger causing weird disturbance such.
in order rule out have used processing or serial window visualize angles in different spots in environment? move around room within usb distance , see how wildly determined angle fluctuates, if not much, great know software. thinking of weird edge case things! luck!
thinking of strictly hardware problems right now:
even though in close proximity there may local magnetic disturbance, power supply, mouse, usb cord, or ring on finger causing weird disturbance such.
in order rule out have used processing or serial window visualize angles in different spots in environment? move around room within usb distance , see how wildly determined angle fluctuates, if not much, great know software. thinking of weird edge case things! luck!
Arduino Forum > Using Arduino > Sensors > MAG3110 odd output
arduino
Comments
Post a Comment