Android gets normalized acceleration

I want to get the acceleration vector of an Android phone. The problem is that the coordinates of the accelerometer relative to the rotation of the phone. What I want is “absolute” acceleration, that is, it should return the same values, no matter what the phone is. (I want to determine if the user who is skiing slides down the hill without using GPS. I also need to be able to differentiate the slip and climb the chairlift.)

I can probably get these values ​​by combining the accelerometer with a gyroscope, but I have no idea how to compensate for the values ​​of the accelerometer with a gyroscope.

Is this possible, and if so, how?

+6
source share
4 answers

What you describe cannot be accomplished unless you revise the problem a bit. To help you rethink it, I will talk about the main issues:

First, I assume that what you mean by "absolute acceleration" is acceleration with respect to geographic reference. This cannot be done only with the help of an accelerometer, since it has no idea about geographic links. If you move far enough for gps or use a compass, you can get around this, but each of them has its own problems (although at least the problem is solvable).

The second question is that gravity and acceleration are completely indistinguishable using only an accelerometer (this is called the principle of equivalence). Therefore, any measured acceleration will always be a vector sum of gravity and acceleration, but there are always many solutions to these equations, and in ordinary cases when the acceleration is less than gravity, you really can’t determine anything about acceleration, since gravity is somewhat constant, there are ways to get around this. using, say, a gyroscope, or maybe your user can hold the phone in a fixed orientation (for example, looking at external signals such as the horizon), and any of these approaches can allow you to subtract the effects e gravity, but this is usually a non-trivial problem.

The last question is not what you seem to think in a fixed-earth coordinate system, but the phone’s accelerometer is only fixed by telephone. This is the z axis of the accelerometer, which many have nothing to do with the earth up and down - and the dependence will depend on the orientation of the phone. Indeed, many people will prefer a fixed-land system, but the phone simply does not know this. You can use external signals (GPS, magnetic field, gyroscope, gravity, horizon, etc.) to try to align them, but given only one arbitrary form of reading the accelerometer, there is simply no information.

Definitions:
acceleration vector : this is the count of x, y, z from the accelerometer (and each reading will depend on the orientation of the phone), sometimes written as A = (a x , a y , a z ).
acceleration value : this = sqrt (a x 2 + a y 2 + a z 2 ), and this should not depend on the orientation of the phone (if different axes are calibrated the same way). If the phone is stationary, it will basically be just a gravity read. We also note that most of the information in the acceleration vector is lost using this measure.
normalized acceleration : the direction of acceleration, which has a value of 1, i.e. A / a
acceleration in earth coordinates: I think that this is what you really want, there is simply no easy way to get it, and even if you could, I do not think that it would be as useful as it might seem at first.

Skis :
I think you have a good chance of determining when someone is skiing based on measurements from the accelerometer. Things like bumps and turns should be completely distinguishable with an accelerometer. For this, I would use the full acceleration vector. For example, in turn, the magnitude of the acceleration would remain approximately constant and the sweep direction. Also note that free fall (i.e., basically, when the skier does not have his heaven / legs / butt / etc on the ground, do they rise when they leave with a kick / jump or fall out of the chair rope), the magnitude of the acceleration will be zero in a free fall. For a chairlift, it seems that it is likely to have a characteristic rhythmic effect mainly within the same aircraft.

All of this could be understood. I would recommend if you really want to solve this problem, it is to record data from your accelerometer while skiing and see if you can determine when you are skiing based on the characteristics of the data. (My guess is that your main stumbling block with this will be math, because it can be a little harder to come up with an algorithm that can distinguish signatures for skis, so it seems like it would be nice to consider a vector of math and things like point products and cross- products, and I suspect that a slightly different topic, known as FFT or Fourier transforms, may be useful in sorting time and frequency signatures of skiing versus rocking in a chair.)

You can also reset GPS measurements that would not be equally reliable or provide good temporal resolution, but could at least be used to double check your algorithm.

+10
source

You can calculate the acceleration regardless of the orientation of the phone using:

a = sqrt(x*x + y*y + z*z) 

Where a is the absolute acceleration, and x , y and z are the accelerometer values ​​for each of the axes of the telephone 3.

+3
source

Some phones have a built-in barometer (air pressure sensor). After applying the moving average, I found that he was ready to record to determine if the user was going up or down - perhaps useful for your problem. In galaxy s4 and 5, I get a resolution good enough to determine if the device is simply moved from the table to the floor.

Note that a gradual change in the weather will affect your readings, so you should consider Delta for a reasonable time interval and ignore changes around a threshold.

+1
source

Consider using GPS. In the flight registration application, I use acceleration (albeit an absolute value, not a vector) to filter noisy GPS data (I delete places where the acceleration needed to change the speed is not plausible):

 /** * Remove noise from the measurement of the location. * @param loc a location * @return Answer <code>false</code> iff the location should not be used. */ private boolean filterNoise(final Location loc) { if( ! loc.hasSpeed() ) return true; if( this.recentSpeeds.isEmpty() ) { // rescentSpeeds is a queue of locations this.recentSpeeds.add(loc); return true; } final Location lastFix = this.recentSpeeds.getHead(); final long delta_t = (loc.getTime() - lastFix.getTime()) / 1000; if( delta_t == 0 ) return false; final float delta_v = loc.getSpeed() - lastFix.getSpeed(); final float a = delta_v / delta_t; if( Math.abs(a) <= AccelThreshold ) { this.recentSpeeds.add(loc); return true; } return false; } 

If you calculate the speed using the coordinates from the last fix and the current fix, you get acceleration as a vector.

0
source

Source: https://habr.com/ru/post/904100/


All Articles