There has been some activity over on GitHub about the MLX90393 Arduino driver, and it caused me to take another look at the datasheet. Guess what? They changed it! The scaling parameters are different now, which makes the output more accurate. I had to revive my Helmholtz coil to test it.
The new scaling factors and a previously undocumented HALL_CONF field (hall effect configuration?) field, which selects 2- or 4-phase hall plate spinning, are in the code and being tested. After a bit more mileage, I'll merge them into master. So far, the results are encouraging:
You can see the scaling numbers in the new datasheet are much closer to the calculated magnetic field in the Helmholtz coil (about 10% high). I previously measured the coil against the Earth's field and estimated it to be within 2%, so there's room for improvement, but it's getting closer!
The temperature compensation for the part is still mysterious and doesn't seem to work for me. I'll have to dig into the new version of the datasheet a little more closely to look for clues.
Temperature compensation appears to be working, as long as you remember to set the offsets relative to 0x8000.
At one point, I figured out how to get accurate offset values using a modified compass calibration algorithm. I'll have to revisit and publish it.