I test flighted my beer fridge calibration, and frankly the results were rubbish verging on scary. Turns out that was nothing to do with the calibration, and everything to do with a bug in the code. Having reviewed the calibration math(s), there was a flaw:
G * sin θ = gain * (sensor1 + offset)
The correct version was something along the lines of
G = sensorx * sin θ + sensorz * cos θ
At the same time, I lost confidence I could calculate offsets at anything other than 90° (the math(s) just didn’t feel right), so I ordered a small perspex cube from e-bay to allow me to calibrate all axes at ±90°.
And with that on order, I had time to kill, so I went back to reviewing the dynamic calibration code. And I found 2 bugs: one related to take-off timings, and the other related to correct handling of gravity when integrating accelerometers to determine speed.
Long story short, dynamic calibration is back at the top of the my priorities, the perspex cube is probably redundant, and the beer fridge is passing the “Ronseal TestTM” and that alone.