When we open the accelerometer menu in FizziQ we find two types of acceleration: linear acceleration and absolute acceleration. Other applications like Phyphox also call them acceleration without g and acceleration with g. What is the difference between these different types of acceleration?
In a previous post on acceleration, we saw that our laptop's accelerometer takes gravity into account. At rest it displays 9.8 m / s². The problem is that this component of the acceleration of gravity does not necessarily correspond to what we perceive to be the acceleration. Since we are born, we are used to living with gravity, and to deduce it automatically from our perceptions. Experiments have shown that at a few months babies have already acquired the notion that an object falls if it is not held. The acceleration that we would like to measure and which is useful for many uses is therefore that which is due solely to the movements of the user. That is to say that the gravity component must be deduced from the acceleration. This is called linear acceleration (or acceleration without g).
If we consider the laptop at rest, we can determine the components of the acceleration of gravity by measuring the absolute acceleration x, y and z. If we do a retilinear movement without changing its orientation, the components of the gravity vector remain the same in the frame of the laptop, and we can calculate the linear acceleration.
However if, during a movement, our laptop changes orientation, it is no longer possible to know how the gravity vector is oriented in the frame of our laptop and therefore we can no longer calculate the linear acceleration.
Fortunately, there are two other sensors in most laptops that can help us: the magnetometer and the gyroscope. These two sensors are also MEMS and provide other information that will allow us to calculate linear acceleration.
The gyroscope is a sensor that calculates the speed of rotation of our smartphone in three directions. It allows us to calculate at any time how the mobile has rotated in relation to its initial position. Thanks to the gyroscope, we can determine at any time how the orientation of the laptop has changed from its initial state of rest. By applying these changes to the initial vector calculated for the acceleration of gravity, we can then deduce from the absolute acceleration observed its component and thus determine the linear acceleration.
The magnetometer can also be used to calculate linear acceleration. It calculates the magnetic field to which our cell phone is subjected. In the absence of any other magnetic field (such as a magnet or a feromagnetic object), the magnetometer gives the coordinates of the earth's magnetic field, which makes it possible to know north, for example. This field is very stable and can therefore be used as an absolute frame of reference. As we know the magnetic field at the initial instant, we can know the changes in orientation of the laptop by comparing the vector of the magnetic field at any time, and therefore adjust the gravity component of the acceleration to determine the acceleration absolute. With one limit, however: if a magnetized or iron-magnetic object is close to the sensor, its measurement will be affected and the reference will be false. This explains why the gyroscope is a better sensor for calculating linear acceleration than the magnetometer.
It would seem from the above that the best method to calculate linear acceleration uses the combination of accelerometer and gyroscope. However, an additional element must be taken into account. Indeed, the gyroscope consumes significantly more energy than an accelerometer, which itself consumes much more than the magnetometer. It all depends on the precision you need and the energy you are willing to spend to achieve that precision.
To summarize, here is a small table of the simultaneous use of the sensors:
Sensors Calculation of linear acceleration
Accelerometer + Gyroscope Good - high consumption
Accelerometer + Magnetometer Average - low consumption
Accelerometer + Magnetometer + Gyroscope Excellent - very high consumption