Magnetometer Not Working on MMR

Hello Laura and Eric,

I am getting invalid data from the Magnetometer and I need help with that. Here is the device info, and I am going to explain the issue in detail.

  • Model: MetaMotion R
  • Firmware: 1.4.4
  • Hardware: 0.3
  • I am using Python 2.7 API on Ubuntu 16.04

I edited the data_fuser.py (see the attached file) to include the magnetometer in the same pack with the acc and gyro. Both the acc and gyro displayed the data correctly, but the mag data were all zeros, or constant values. I tried to use MetaBase app from ios app store, and the mag data were not zeros, but still constant/almost constant as in the following screenshot.

I found another discussion in this form stating that the buzzer connected to the circuit was interfering with the Magnetometer. I opened the plastic case and moved the buzzer away from the circuit. Now, after I calibrate the device (based on https://mbientlab.com/tutorials/Calibration.html?highlight=sensors), the mag works once, but when I try to connect it back, it gives zeros again. I tried many times, and the mag only gives valid data once after the calibration.

Data after Calibration, but before moving the buzzer:
acc: (0.0986,0.0742,0.0196)
mag: (-2048.000000000,-2048.000000000,-103.437500000)
gyro:(-33.17073,-291.46341,1203.47559)

Data after calibration and after moving the buzzer:
acc: (-0.7628,1.1407,-0.2247)
mag: (-19.687500000,-105.562500000,-21.562500000)
gyro:(702.62195,14.75610,-925.67078)

Data at 2nd+ run after calibration (with or without the buzzer around) :
acc: (-0.0997,-0.2483,0.7635)
mag: (0.000000000,0.000000000,0.000000000)
gyro:(-460.06097,-178.10976,380.18292)

I assume that the device is not designed to require a new calibration each time I run the code since that makes it unusable. So, my questions are:
Q1: How can we get the Magnetometer to give the correct values without requiring calibration for every single run? Please provide us with a python sample code for that.
Q2: What can we do regarding the buzzer interfering with the mag? Should we just cut it from the circuit?
Q3: When I get the valid data from the calibration, I see that the mag is at 10HZ. How can we increase that? I checked the Magnetometer page on your website (https://mbientlab.com/cppdocs/0.7.0/magnetometer.html) but it did not give details on how to configure the sensor. A python sample code illustrating the Magnetometer configuration would be appreciated.

Thank you in advance and I look forward to hearing from you soon.
Maher

Comments

  • edited May 2019

    Q1: Calibrate it once it the way it will be used. So if it will be used with the buzzer, then calibrate with the buzzer.
    Q2: You need to calibrate against it.
    Q3: A magnetometer is a compass measurement (using fields), it is a slow signal and sampling it at a higher frequency will not give you more accuracy. i/e magnetometers are slow.

  • But still, if I calibrate the device and put on a table, the magnetometer gives correct values in the first run, but after that, it just gives zeros. My question is how to avoid this issue and have it give the correct values without calibrating it before every use?

  • gives zeros? Can you elaborate?

  • Basically this is what it prints the second time I ran the code after the calibration.

    F0:2E:BF:A0:AF:F1 -> acc: (-0.0997,-0.2483,0.7635) mag: (0.000000000,0.000000000,0.000000000) gyro:(-460.06097,-178.10976,380.18292)
    F0:2E:BF:A0:AF:F1 -> acc: (-0.1100,-0.2905,0.6783) mag: (0.000000000,0.000000000,0.000000000) gyro:(-419.14636,-198.53659,375.30490)
    F0:2E:BF:A0:AF:F1 -> acc: (-0.1671,-0.2441,0.6013) mag: (0.000000000,0.000000000,0.000000000) gyro:(-411.58539,-225.24391,388.41464)
    F0:2E:BF:A0:AF:F1 -> acc: (-0.1732,-0.1503,0.5975) mag: (0.000000000,0.000000000,0.000000000) gyro:(-353.71951,-249.39024,381.76831)
    F0:2E:BF:A0:AF:F1 -> acc: (-0.1562,-0.0433,0.5245) mag: (0.000000000,0.000000000,0.000000000) gyro:(-248.96342,-257.74390,387.50000)
    F0:2E:BF:A0:AF:F1 -> acc: (-0.2241,-0.0550,0.4523) mag: (0.000000000,0.000000000,0.000000000) gyro:(-166.52440,-279.51221,378.78049)
    F0:2E:BF:A0:AF:F1 -> acc: (-0.4808,-0.0392,0.3376) mag: (0.000000000,0.000000000,0.000000000) gyro:(-224.81708,-363.90244,381.76831)
    F0:2E:BF:A0:AF:F1 -> acc: (-0.4127,-0.0936,0.6818) mag: (0.000000000,0.000000000,0.000000000) gyro:(-282.43903,-460.42685,386.70734)
    F0:2E:BF:A0:AF:F1 -> acc: (-0.6430,-0.0153,0.4189) mag: (0.000000000,0.000000000,0.000000000) gyro:(-326.46341,-541.46344,376.15854)

  • what is your calibration method?

Sign In or Register to comment.