In this post we will talk about inertial sensors. The fact that they measure and how these physical quantities can be used.
Most modern mobile phones have on board a triad of accelerometers, gyroscopes and magnetometers, often in addition to them, an atmospheric pressure sensor is installed.
Everything is very clear with the last sensor: almost every one of us has a barometer hanging at home or in the country and millimeters of its mercury column are firmly connected with the rain, bad weather and general well-being of their beloved grandmother. But what is measured by the accelerometer, gyroscope and magnetometer, and how to use this information to determine the orientation of the device in space?
Wikipedia says that an accelerometer is a device that measures the projection of apparent acceleration. A typical accelerometer consists of three mutually perpendicular measuring axes that register gravitational and linear accelerations.
Using measurements of a triaxial accelerometer, one can determine its orientation relative to the reference vector, which in this case is gravitational acceleration. Then, however, the orientation will not be fully resolved - there will be uncertainty about the angle of rotation around an axis parallel to the direction of the acceleration of gravity.
This is explained in more detail in the figure below. Imagine that we have a measuring device with an accelerometer that has three X, Y, and Z axes. In the figure, these axes are marked in red, green, and blue and form the left three of vectors. Obviously, if only the gravitational acceleration vector is available for determining the orientation, then there will be an infinite number of possible orientations of the measuring device, in which the Z axis of the accelerometer will measure the gravitational acceleration value, but we cannot resolve the absolute orientation of the device.
To allow orientation completely, we need a second basis vector that will not be parallel to the first. Such a vector may be, for example, the vector of the magnetic field of our planet. If its direction is known, then the orientation will be resolved unequivocally.
Knowing the orientation of one coordinate system relative to another, it becomes possible to transfer measurements from the device coordinate system to the global one. And knowledge of accelerations in the global coordinate system will allow, by integration, to restore speed and obtain information about the relative location.
The gyroscope allows you to measure the speed of rotation of the device, respectively, in order to bring the speed to the angle of rotation, we must integrate it. The main orientation problem is connected with this position only with the help of a gyroscope - due to continuous integration of not quite accurate measurements of angular velocities caused by zero displacement or temperature effects, we will get an orientation drift, or, in other words, it will “float” from the true value.
The advantage of using all three sensors in the orientation filter is that:
In addition to the traditional and well-studied task of determining the orientation of the device, inertial sensors can be used for:
Restoration of the trajectory of the object. Such an object may be a pedestrian or a car. In some cases, for example, when mounting the device on the leg and preliminary calibrating the sensors, it is possible to achieve an error of returning to the starting point of movement not exceeding tens of centimeters for a path length exceeding 100 meters. An example of a restored trajectory using the ZUPT method (when resetting an error during periods of immobility), supplemented by measurements of the atmospheric pressure sensor, is shown in the following figure (the trajectory included the passage along the corridor, descending the stairs, another passage and the elevator). The similar method was already mentioned on Habré here .
With an arbitrary fixing of the device on the human body, the error of returning to the starting point, as a rule, is much larger and amounts to 15-20% of the distance covered. This value is due, firstly, to the error in determining the step length, and secondly, to the error in determining the direction of movement.
Initiating any event or device control. This can be done by using a device to draw a figure or image in the air, for example, the ∞ symbol can be used to start the calibration of a magnetometer, longitudinal sweeps by the device to generate an emergency message, and triple tap to turn it off. These problems are solved with the help of pre-trained classifiers.
In future articles, it is planned to reveal the topics of how to work with inertial sensors — discuss ways of calibrating them (although this has already been discussed in Habré), look at existing ways of restoring the trajectory of a person’s movement, explore approaches to detecting and eliminating magnetic field disturbances, and discuss firmware architecture for timely time stamping and processing of their measurements.
The author - Alexander Mikov.
Source: https://habr.com/ru/post/302650/
All Articles