11

The apple documentation for UIAcceleration class says,

"When a device is laying still with its back on a horizontal surface, each acceleration event has approximately the following values:
x: 0
y: 0
z: -1
"

Now, I am confused! How can the acceleration be non-zero, when you clearly say the "device is laying still"?

UPDATE

Judging by the responses, I think this should be called something like 'forceometer' or 'gravitometer' and not accelerometer!

ChenYilong
  • 8,543
  • 9
  • 56
  • 84
gigahari
  • 671
  • 1
  • 7
  • 19
  • So if you turn it around (on it's belly) it will measure x:0 y:0 z:+1 – Rok Jarc Feb 15 '12 at 13:22
  • 4
    A comment to your update: the [equivalence principle](http://en.wikipedia.org/wiki/Equivalence_principle) of the theory of general relativity will tell you that acceleration on a body is equivalent to gravitation (simply worded). So acceleratometer is, for me, as good as any term, though "forcemeter" would probably come closest to how the device actually works. Note that a [gravimeter](http://en.wikipedia.org/wiki/Gravimeter) is actually a slightly different device. –  Nov 30 '12 at 11:11
  • @Evert iOS reports the direction it *would* accelerate in the absence of an external force counteracting gravity. It would make more sense to measure that external force, but instead iOS confusingly presents a pseudo-acceleration gravity vector. Not only the ground's normal force counteracting gravity, but all forces are reversed. So maybe it should be called a decelerometer. – Potatoswatter Dec 14 '12 at 06:58
  • You wrong. Accelerometer is a correct name for it because any acceleration means that there is a force that applies to the object. Having an acceleration does not mean having a movement - if your device is laying still if does not mean that there is no acceleration on it. Because the gravity force is always present, it's correct to have it in the measurements. If there would be all zeros in the measurements, then if you will put your device in the air it will not fall down =) – Alexander Volkov Nov 30 '15 at 09:16
  • Potatoswatter is correct that the iOS acceleration directions are reversed. The apparent acceleration due to gravity is away from the earth, not towards it. But unfortunately if you reverse the signs of the accelerometer readings so they are in the correct direction then you have a left-handed coordinate system. See this page for a correct labelling of the accelerometer axes: http://nscookbook.com/2013/03/ios-programming-recipe-19-using-core-motion-to-access-gyro-and-accelerometer/ – PhilHarvey Oct 06 '16 at 12:07

7 Answers7

13

You get a -1 on the Z axis because gravity is acting on the device, applying a constant acceleration of 1G. I assume you want user acceleration, which you can get from the DeviceMotion object using a device motion handler as opposed to an acceleration handler. The userAcceleration property filters out the effects of gravity on the device and only gives you how much the user is accelerating it.

bensnider
  • 3,742
  • 1
  • 24
  • 25
  • I am just trying to understand the concepts here. Even if the phone experiences a force due to gravity, when it is stationary there is no change in its velocity along any direction. So the acceleration should still be zero, right? – gigahari Feb 15 '12 at 13:15
  • when stationary (or moving with constant speed in constant direction) it will measure (feel) 1g directed to the center of the earth. You should consider this 3 directions as vectors - their vectoral sum would be 1g and from their sizes you can calculate how the device is tilted. As Ali mentioned: it would measure 0 at free fall - when on table, it 'feels' the force of the table holding it in place :) – Rok Jarc Feb 15 '12 at 13:19
  • 5
    Device is still being pulled by the gravity. The Force is there. Jedis know that more than anyone. – macbirdie Feb 15 '12 at 13:20
7

I found the answer [in the CoreMotion Reference guide, thanks to bensnider:

The accelerometer measures the sum of two acceleration vectors: gravity and user acceleration. User acceleration is the acceleration that the user imparts to the device.

Community
  • 1
  • 1
gigahari
  • 671
  • 1
  • 7
  • 19
6

You'll find the best answers in datasheet of the accelerometer used (LIS302DL).

Rok Jarc
  • 18,765
  • 9
  • 69
  • 124
  • 1
    Link mentioned by @rokjarc is dead by now. Searching for `CD00135460.pdf` revealed following links: [eng.auburn.edu](http://www.eng.auburn.edu/~nelson/courses/elec5260_6260/LIS302DL%20MEMS%20Accelerometer.pdf), [myavr.info](http://www.myavr.info/download/mystm-produkte/stm32f4-discovery/LIS302DL-MEMS_3d-I2C-Beschleunigungssensor-CD00135460.pdf) and [cs.smith.edu](http://www.cs.smith.edu/~emendelo/classes/spring12/csc360/lectures/accelGyro.pdf). – trejder Jul 16 '13 at 10:14
5

It measures the gravity. The unit is chosen so that the gravity, 9.81 m/s^2, equals 1 unit. The sign tells how the phone axis is directed. In other words, what the phone considers downwards.

The phone measures 0 as acceleration in free fall. I don't know how much you want to throw your phone up and down to test it :)

Ali
  • 56,466
  • 29
  • 168
  • 265
  • just to add the official doc's link: https://developer.apple.com/library/ios/documentation/coremotion/reference/CMAccelerometerData_Class/Reference/Reference.html#//apple_ref/doc/c_ref/CMAcceleration – Ikhsan Assaat Aug 13 '14 at 23:35
2

When you're sitting, gravity is pulling you down to your chair. If it weren't for the chair or ground for that matter, you'd be falling down with acceleration of about 9.8m/s^2. In order for the chair to prevent you from falling down, it has to act with a force in the opposite direction with at least the same value.

The accelometer shows the value of the pulling force and it's a three-dimensional vector. In this case it's directed straight down. And the value given is expressed in G, units of gravity acceleration multiplied by that value.

macbirdie
  • 16,086
  • 6
  • 47
  • 54
0

Answerers keep missing the right wording that should set it straight for you... The device is "laying still" only relatively to you. It is actually not laying still at all. The http://en.wikipedia.org/wiki/Centripetal_force of gravity gives it (and you) centripetal acceleration. It is real, it is what keeps you from flying off Earth on a tangent, and it is what the accelerometer dutifully shows. (Earth is nothing special - we rotate about the Sun also etc etc, whose centripetal accelerations are way smaller, but they would be all shown by an accelerometer sensitive enough.)

Uldis Barbans
  • 59
  • 1
  • 3
0

I don't yet have sufficient reputation to reply directly to the comment by @gigahari above, but as an addendum, folks should be aware that some apps (such as the physics apps phyphox and PhysicsToolbox Sensor Suite) do not report (a+g) -- both phyphox's "with g" option and PhysicsToolbox report the vector sum (a-g), which is sometimes referred to as the "Operational Definition of Weight." A brief discussion of this version of the operational definition of weight is on WikiPedia, at https://en.wikipedia.org/wiki/Weight#Operational_definition

  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jan 11 '22 at 05:20