well the 6-dof and 9-dof are much abused teminology which I don't use. Because they are not, really.
My approach is for the accelerometer and the magnetometer. Not for the gyro. In both those cases,
you are attempting to measure a vector which is a fixed, physical quantity. in the first case, the gravity
vector and in the second case, the earth's magnetic field vector.
I collect thousands of samples of that vector. If you then represent all these vectors as pointing outwards
from the coordinate system origin, you get a surface. I then calculate the transform of that surface
which gives the least squares best fit to a sphere, assuming a model with an offset and scaling parameter
for each axis, which appears to be sufficient. So I have 6 calibration parameters, and I calculate the value
which gives the least sum squared deviation from the sphere.
This is probably the same fundamental approach as the other one you mentioned. You are mapping something
which can be approximated as an off-centre ellipsoid, to a sphere.
For the gyro, I just capture the value when the device is stationary, and use that as the offset. ation device that spins at a
fixed rate. Rate scaling
difference for the gyro would be very hard to measure, you would need a calibrIn my experience, this is best done every time you use the device.