Uncalibrated readings and need of calibration
In an ideal world, the sensor will produce an output that will be linear within the whole measurement range. The accelerometer uses a 16-bit register to store the accelerometer measurements for each axis, i.e. they can have 65536 different integer values within the full-scale setting. Therefore, when configured to +-2g, a reading on any axis should be "0" when the acceleration on that axis is 0g and, "-32768" when the acceleration is -2g, and "+32767" then the acceleration is +2g.
If we now go to the real world, we will probably see that the output for 0g is a non-zero value. This difference is called the "offset error". Also, if we steadily increase the acceleration on an axis, we should get proportional increases in the readings of that axis, which hardly ever happens, indeed. The ratio between the real increase in the magnitude and the increase obtained in the readings is called the "gain error" or the "scale factor", meaning the slope of the linear response is not exactly "1". By multiplying a reading by its scale factor, we can obtain the real acceleration.
As you can see in the image on the right, the uncalibrated readings of the accelerometer and magnetometer make an ellipsoid instead of the expected sphere and, the projections of this ellipsoid over the different plans defined by the axis are ellipses. This is due to the fact that the axis scale factors are not the same for each axis (if the scale factors where the same, we would be seeing a sphere here). In the same way the offsets are not the same for the different axis, the center of the ellipses are not 0.
I hope by now you have realized how important calibration is.
So, let's start the calibration process!