abaskind / hedrot

open-source head tracker -
https://abaskind.github.io/hedrot/
GNU General Public License v3.0
24 stars 4 forks source link

Broken magnetometer calibration on MacOS #4

Open madskjeldgaard opened 5 years ago

madskjeldgaard commented 5 years ago

Hello Thanks for all of this work. I'm really happy that you have made this project! I'm experiencing some trouble on MacOS. For some reason, I can't calibrate the magnetometer anymore. When I plug in my HedRot, the app receives data and reacts as expected. It sends OSC and everything. Center works and preset loading works. But when I go into calibration, I can see that it needs calibration. I press the magnometer calibration button and press the calibration button, but the live stats on the right don't update. When I press the "Stop calibration" button I get an error message that it failed, but if I export the raw calibration data, it looks like it did some actual work. See below for a screenshot and an example of calibration data exported.

Skærmbillede 2019-03-21 kl  06 31 50

![Uploading Skærmbillede 2019-03-21 kl. 06.33.20.png…]() headtrackerRawMagCalibrationData.txt

madskjeldgaard commented 5 years ago

The accelerometer calibration seems to work, but doesn't have live updates either.

abaskind commented 5 years ago

Hi,

It looks from the raw data that the magnetometer is working (i.e. it still delivers data on 3 axes). It's hard to tell from observing the raw data, but it looks like the z data is clipping. This may happen if something changed recently in your setup, for instance if you attached hedrot on a metallic support. That may add an offset to the raw data that sometimes entails clippings. Could you try 2 different things:

1/ test hedrot in free field, i.e. as far as possible from any metallic and/or magnetic interference?

2/ raise the "range (Gauss)" in "magnetometer settings" in "headtracker settings" ?

Best

Alexis

madskjeldgaard commented 5 years ago

Okay I set range to 16G and I don't know if that did it but I spent a bit more time calibrating it and it now seems okay!

madskjeldgaard commented 5 years ago

This issue pervails for me

abaskind commented 5 years ago

Hi,

could you confirm that you also tested in a clean magnetic environment, far from metallic and/or magnetic sources?

Alexis

madskjeldgaard commented 5 years ago

Hi again Alexis

I finally had time to look at this again.

I've found the following: Testing conditions: 1.5meter usb cable connected to macbook pro, sitting by wooden table. When the hedrot isn't attached to anything, I can calibrate the magnetometer with no problems. But when attached to my headphones (a pair of Beyer Dynamic dt770 with a metallic brace) it doesn't work. This seems to confirm your speculations above, but then how can one work with a pair of headphones like this then? Or should one use ones made entirely of plastic?

Thanks!

madskjeldgaard commented 5 years ago

Oh and adding to that, the hedrot itself is in a 3d printed enclosure

abaskind commented 5 years ago

Hi,

I use hedrot almost all the time with dt990 headphones which have the same metallic brace as the dt770. This may be indeed sometimes a problem for the reasons I mentioned before, depending on the magnetometer (all units have different behaviors). I was however always able to find a solution that works, using one of the following strategies: . either fine-tuning the magnetometer settings, and above all the range and the bias . or by inserting an object (1-2cm dick) between the headphones and hedrot. . or get rid of the magnetometer in the angle calculation (put "max Beta" to 0 in the receiver settings).

The last solution corresponds basically to what the majority of commercial algorithms do. It works, but is less stable (the accelerometer is noisy and the angle be "smoothed" by the magnetometer), and entails drifting especially after rapid movements, meaning needing to reset the zero ("center") every now and then.

Best,

Alexis

madskjeldgaard commented 5 years ago

Hi Alexis

Thank you for the very thorough feedback. I will try some of your suggestions. Do you think the density of the 3d printed plastic enclosure plays a part in this as well?

Best regards, Mads Kjeldgaard

On Sun, 7 Jul 2019, Alexis Baskind wrote:

Hi,

I use hedrot almost all the time with dt990 headphones which have the same metallic brace as the dt770. This may be indeed sometimes a problem for the reasons I mentioned before, depending on the magnetometer (all units have different behaviors). I was however always able to find a solution that works, using one of the following strategies: . either fine-tuning the magnetometer settings, and above all the range and the bias . or by inserting an object (1-2cm dick) between the headphones and hedrot. . or get rid of the magnetometer in the angle calculation (put "max Beta" to 0 in the receiver settings).

The last solution corresponds basically to what the majority of commercial algorithms do. It works, but is less stable (the accelerometer is noisy and the angle be "smoothed" by the magnetometer), and entails drifting especially after rapid movements, meaning needing to reset the zero ("center") every now and then.

Best,

Alexis

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or mute the thread.[AFLO64EEMU4LEMI7WCG6ZSLP6G37RA5CNFSM4HAC77RKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZLIHFY.gif]

abaskind commented 5 years ago

If it's plastic, it should be magnetically transparent and not play any role for the magnetometer.

madskjeldgaard commented 5 years ago

Ah yes, of course. I'll experiment a bit with your suggestions and get back to you!

Best regards, Mads Kjeldgaard

On Sun, 7 Jul 2019, Alexis Baskind wrote:

If it's plastic, it should be magnetically neutral and not play any role for the magnetometer.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or mute the thread.[AFLO64EKIPWTAHGZNYN73CTP6HASXA5CNFSM4HAC77RKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZLIZHI.gif]