Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Khedron

Suspended
Sep 27, 2013
2,561
5,755
Because I'm interested in these things I've put in a bit of time to get my thoughts down on the problem from a purely academic point of view and thought some people may be interested to see what I have put down, for those that aren't feel free to skip over it.

To assess the orientation of the phone, the processor receives the triaxial data from the accelerometer, and resolves the acceleration data measured on each axis.

When the phone is perfectly horizontal as shown below (assuming the axis of the accelerometer are perfectly aligned to the phone) there should be no acceleration measured in the z axis, and a full 1g acceleration measured in the y axis.

Please note - where I have used the term sensor values related to measurements of g, obviously these values are processed based on raw electrical data output from the sensor, however for the sake of clarity of point I will continue referring to the sensor values in g.

[url=http://i128.photobucket.com/albums/p188/sport1901966/HorizontalAligned_zps07c2c75e.png]Image[/URL]

If the phone is rotated around the x-axis (into the page/screen) y gets smaller and z gets larger, until they are equal. At this point, when y = z, the angle of rotation is 45°, past that point z gets larger as y gets smaller until z = 1g and y = 0g, at this point the angle is 90°.

[url=http://i128.photobucket.com/albums/p188/sport1901966/RotatedAligned_zps8ae66d93.png]Image[/URL]

If the sensor has a resolution of 0.0625g between a range of ±2g (as per the new Bosch accelerometer), as the phone is rotated around the x-axis the next step that the accelerometer will pick up after y = 1g and z = 0g will be y = 0.9375g and z = 0.0625g. The angle of the phone is calculated based on the values of y and z using trigonometry. The size of the measurement step (sensor resolution) determines the angular resolution of the sensor, following processing of the raw data. Below is a table comparing the resolutions of the ST and Bosch sensors. It would seem the ST sensor resolution is massively overkill, but the Bosch sensor is about 1000 times less precise - going completely the other way.

[url=http://i128.photobucket.com/albums/p188/sport1901966/Restable_zpsf3fb0cad.png]Image[/URL]

That is the first, and more concerning problem as others have mentioned - as was said, how can the phone display increments of 1° when the sensor can only resolve changes of 3.8°………. The only posibility is that the gyroscope is used to assess the motion of the phone within the angular steps that the accelerometer can measure - fairly complex from a programming point of view, but possible I think.

The other issue is the fact that when set flat, the 5S does seem to believe it is inclined anywhere between 2 and 6 degrees. This could well be because the accelerometer is not in fact orientated correctly in the phone as shown below.

[url=http://i128.photobucket.com/albums/p188/sport1901966/Horizonalmisaligned_zps1efc0c60.png]Image[/URL]

It has been mentioned that the zero g offset difference between the 2 sensors could be the cause of the problem. But I am not sure this is the case. In terms of the inclinometer output, it doesn’t matter what the absolute g value measured is, simply that when the phone is flat, only 1 axis is measuring any acceleration. For example as long as the z axis has a value of 0g, it doesn't matter if y is measuring 0.2g or 20g, the trigonometry will output a 0 value for the angle. However, if apple haven't accounted for the extra offset of the Bosch sensor and continued to use the ST sensor offset, then the software could think z is measuring an acceleration when it isn't.

If it is simply an orientation problem, then it should be a simple case of low level recalibration in the OS as others have said, obviously the complication being where different phones seem to have the problem to different degrees. The only accurate way to do it would be to allow individual calibration of the phone. If the offset is the problem, this should be fixable by a more 'blanket' solution, assuming the sensors are all within spec.

Do you think that Apple's alleged "calibrate by leaving in do not disturb mode for a long time" could work in practice (i.e. at the moment only some simple bug is stopping it)?

Of course the phone does not know it is on a level surface or not, but if it just knows it is stationary then taking multiple readings of the direction of gravity over an hour (improve the statistics of the measurement) could allow the direction and magnitude of gravity to be calibrated. A level surface is then just any surface perpendicular to the direction of gravity.
 

ce0311

macrumors newbie
Jun 1, 2010
4
0
I have tried about 15 iPhone 5S in the past week, about 10 at the Apple Store, then my very own iPhone 5S which I already returned for a refund and the iPhone 5s of some coworkers.
I have yet to come across a WORKING 5s. They ALL seem to be off by about -3 which leads me to think that it would be fixable through software.

Compare the iPhone 5 and iPhone 5s - it s incredibly easy to tell which one is which, even though the surface they were lying on was not 100% even: http://cl.ly/S0CP

Can anyone prove the existence of a WORKING iPhone 5s accelerometer/gyro by a photo or video with it lying next to an iPhone 5 or a 4S?
 

gatd

macrumors regular
Jun 2, 2008
126
14
just spoke with Apple care tech and they told me I was the first call they have had re this problem.LOL
 

E1Geoff

macrumors newbie
Sep 26, 2013
20
0
Do you think that Apple's alleged "calibrate by leaving in do not disturb mode for a long time" could work in practice (i.e. at the moment only some simple bug is stopping it)?

Of course the phone does not know it is on a level surface or not, but if it just knows it is stationary then taking multiple readings of the direction of gravity over an hour (improve the statistics of the measurement) could allow the direction and magnitude of gravity to be calibrated. A level surface is then just any surface perpendicular to the direction of gravity.

I hadn't come across that method, but I would be dubious.

If the phone doesn't know what its orientation is i.e. what acceleration it is supposed to be measuring in each axis, it has no reference to calibrate itself against.

I suppose the best it could do is to recognise that it has been still for a long time, therefore the highest g it is likely to be being subjected to is 1g (9.81m/s2) and therefore if the sensor data is indicating it is higher or lower, it could automatically add a correction factor in the processing such that it does come up with 1g. Potentially this could be used to counteract any error in the sensors zero g offset. It's possible, but seems somewhat unlikely...
 
Last edited:

Khedron

Suspended
Sep 27, 2013
2,561
5,755
I hadn't come across that method, but I would be dubious.

If the phone doesn't know what its orientations is i.e. what acceleration it is supposed to be measuring in each axis, it has no reference to calibrate itself against.

I suppose the best it could do is to recognise that it has been still for a long time, therefore the highest g it is likely to be being subjected to is 1g (9.81m/s2) and therefore if the sensor data is indicating it is higher or lower, it could automatically add a correction factor in the processing such that it does come up with 1g. Potentially this could be used to counteract any error in the sensors zero g offset. It's possible, but seems somewhat unlikely...

Yes the idea would be that if the phone is stationary (DND mode makes sure no vibrations for texts etc.) i.e. all the accelerometer readings are approximtaely constant for 1 hour, then it knows that (assuming you are at Earth sea level) the readings should be (0,0,1g) and so whatever the actual readings are should be taken as a zero point.
 

Morac

macrumors 68020
Dec 30, 2009
2,172
611
I'm more concerned about the fact that the accuracy of the 6-bit output of the sensor isn't nearly enough to provide accurate readings. How does an accelerometer show 1° changes in phone position when the smallest possible change in output is 4°?

The smallest possible change is definitely not 4° otherwise it wouldn't be possible to tilt the device and have it change by only 1°. It would always jump by 4°, which isn't happening.
 

E1Geoff

macrumors newbie
Sep 26, 2013
20
0
Yes the idea would be that if the phone is stationary (DND mode makes sure no vibrations for texts etc.) i.e. all the accelerometer readings are approximtaely constant for 1 hour, then it knows that (assuming you are at Earth sea level) the readings should be (0,0,1g) and so whatever the actual readings are should be taken as a zero point.

So you mean leave it on a perfectly flat surface in DND mode? If so then yeah I agree, the readings should be 0,0,1 and the phone could calibrate itself on this basis. Obviously 0,0,1 is assuming the axis into the screen is z-axis (in my post with the diagrams I assumed the axis into the screen would be the x-axis so it would be 1,0,0 - but the theory stands up either way - I dont know what convention apple/bosch uses on the sensor). If the phone was not on a flat surface then it wouldn't work, as the phone would not know what values it was supposed to be calibrating against

EDIT: Also this would only calibrate it in 1 plane, the same process would have to be performed again with the phone on its side/standing up to have the vertical planes calibrated as well

----------

The smallest possible change is definitely not 4° otherwise it wouldn't be possible to tilt the device and have it change by only 1°. It would always jump by 4°, which isn't happening.

Unless we are missing something, a 6 bit sensor, over a 4g range (-2 to +2) gives resolution steps of 0.0625g, which translates to steps of ~3.8 degrees.

My guess is the gyro sensor comes into play, to fill in the gaps as it were.
 

Black Magic

macrumors 68030
Sep 30, 2012
2,787
1,499
I have tried about 15 iPhone 5S in the past week, about 10 at the Apple Store, then my very own iPhone 5S which I already returned for a refund and the iPhone 5s of some coworkers.
I have yet to come across a WORKING 5s. They ALL seem to be off by about -3 which leads me to think that it would be fixable through software.

Compare the iPhone 5 and iPhone 5s - it s incredibly easy to tell which one is which, even though the surface they were lying on was not 100% even: http://cl.ly/S0CP

Can anyone prove the existence of a WORKING iPhone 5s accelerometer/gyro by a photo or video with it lying next to an iPhone 5 or a 4S?

I can. My coworker has a iPhone 5s with a good gyro. I'll post a pic when I get back to work. He ordered it 2 weeks ago and got it like 2 days ago.
 

leafspring

macrumors newbie
Oct 8, 2013
10
0
<snip>

It has been mentioned that the zero g offset difference between the 2 sensors could be the cause of the problem. But I am not sure this is the case. In terms of the inclinometer output, it doesn’t matter what the absolute g value measured is, simply that when the phone is flat, only 1 axis is measuring any acceleration. For example as long as the z axis has a value of 0g, it doesn't matter if y is measuring 0.2g or 20g, the trigonometry will output a 0 value for the angle.
First of all - nice write-up.

Concerning the part with the bias: I don't know how an accelerometer actually works mechanically but I'd assume the bias applies to all three axes, so in a worst case scenario a phone lying flat on the back would have an acceleration vector of (+-0.095g, 0.905g, +-0.095g) which would be a deviation of ~8.5°.

So Apple disregarding the new bias specs would certainly explain the problems we see.
 

madKIR

macrumors 6502a
Feb 2, 2010
849
801
NYC
I have tried about 15 iPhone 5S in the past week, about 10 at the Apple Store, then my very own iPhone 5S which I already returned for a refund and the iPhone 5s of some coworkers.
I have yet to come across a WORKING 5s. They ALL seem to be off by about -3 which leads me to think that it would be fixable through software.

Compare the iPhone 5 and iPhone 5s - it s incredibly easy to tell which one is which, even though the surface they were lying on was not 100% even: http://cl.ly/S0CP

Can anyone prove the existence of a WORKING iPhone 5s accelerometer/gyro by a photo or video with it lying next to an iPhone 5 or a 4S?
I did that already some pages ago.
Mine is perfect in this regard, even more accurate than my iPhone 5 sometimes.
 

toptip

macrumors member
Oct 7, 2013
33
0
Berlin, Germany
Just a quick info for you guys:

My iPhone5s 14day return window is up tomorrow.
Talked to Apple support hotline today and

a) I cannot prolong my 14day return window (at least here in Germany) - if I would have gotten a prolonged period I would not have changed it

b) I get a new one from China - hopefully next week

c) I can keep the "old" one until I get the new one.

d) Apple Support says he did not know about the issue and thinks it is hardware (but I dont know how qualified this answer was since he seemed not to be aware of the problem at all - at least he told me that)

e) After Sales says it could also be software (but in the end he did not care because he is just responsible for exchanging it)

My bottom line is:
I "bought" some time to resolve the issue if there will be a software update next week.
If it can be fixed with software I keep the one with the better readouts.
If the "new" one is on spot without an update I keep the new one.

If neither works or not an update is in sight - I decide from there on....
 

BMcCoy

macrumors 68000
Jun 24, 2010
1,718
3,421
My 5s is perfect too.... perfect zero on the level.

No point me posting a photo, as A photo proves nothing as I could just re-calibrate it immediately prior to photo.
 

E1Geoff

macrumors newbie
Sep 26, 2013
20
0
First of all - nice write-up.

Concerning the part with the bias: I don't know how an accelerometer actually works mechanically but I'd assume the bias applies to all three axes, so in a worst case scenario a phone lying flat on the back would have an acceleration vector of (+-0.095g, 0.905g, +-0.095g) which would be a deviation of ~8.5°.

So Apple disregarding the new bias specs would certainly explain the problems we see.

Thanks, and yes I think you're right there.

I've done a little playing with the phone and the behaviour of the level gauge in iOS app does strongly backup what you say.

General convention is that, if you were standing up straight, the x-axis points out ahead of you (i.e. backwards is -ve), the y-axis points out to your rights (left is -ve) and the z-axis points downwards (up is -ve). If you translate this to the phone, as if it was standing up - the axis positive directions would be as shown below:



If the phone is lying face up on a flat surface, it indicates a slope downward roughly in the direction of the lower right hand corner (i.e. right and down in the y and z directions) - suggesting a positive bias on the y and z axis. If the phone is stood upright on its speaker end, with the screen in facing you, the level of the bar is above the 0 line, suggesting a positive bias on the x axis (which points out the back of the phone), and if you put the phone on its side (volume buttons facing up) it indicates the home button end is lower, again this shows a positive bias on the z axis.

I wonder if the error of angles being displayed is equal to the difference in zero g bias of the 2 sensors....
 

leafspring

macrumors newbie
Oct 8, 2013
10
0
I wonder if the error of angles being displayed is equal to the difference in zero g bias of the 2 sensors....
Shouldn't be too difficult to figure out using one of the sensor data apps (like Sensor Data Streamer). I'd do it myself but I'm unable to use my Apple ID to get the app at the moment (thanks Adobe -.-).

edit:
Managed to get my ID working again - here are some readouts flat on the back:

x: +0.004 to +0.007 (~5.5mg, so negligible)
y: -0.087 to -0.0912
z: -0.997 -1.0023 (negligible as well)

The level shows a deviation of 4° on the verge to 5° almost perfectly along the y-axis.
 
Last edited:

predation

macrumors 65816
Apr 3, 2013
1,237
867
I can. My coworker has a iPhone 5s with a good gyro. I'll post a pic when I get back to work. He ordered it 2 weeks ago and got it like 2 days ago.

i'd like to see this...

hopefully all the ones that are being delivered at the end of the month have the issue corrected...

since this a hardware issue, i think apple will not officially confirm this and just quietly swap out affected units with working ones IF the end user requests...
 

E1Geoff

macrumors newbie
Sep 26, 2013
20
0
Shouldn't be too difficult to figure out using one of the sensor data apps (like Sensor Data Streamer). I'd do it myself but I'm unable to use my Apple ID to get the app at the moment (thanks Adobe -.-).

I did do a quick calculation and if we take my diagram from before (note: from the tests I did earlier, the Z arrow should actually be pointing the other direction)

HorizontalAligned_zps07c2c75e.png


If we assume the offsets are at the most extreme of the tolerance in all cases (0.02g for the ST, and 0.095g for the Bosch). The bosch sensor may be giving the iphone data saying z accel = 0.02g, and y accel = 1.02g (all axis 0.02g too high, the iphone then subtracts the bias of 0.02g, and then calculates the angle based on z = 0, y = 1, which is great.

If we take the Bosch sensor (phone in the same position as the above case), it is giving the iphone data saying z = 0.095g and y = 1.095g. If Apple have not corrected for the new bias, then it will subtract 0.02g as before, and will be left calcuating the angle based on z=0.075g and y=1.075g. Using trig where the angle = tan(0.075/1.075) the error comes out to be 4.004 degrees.

I think we have to be careful as what I have done above is massively simplifying things to the point where its almost invalid. The sensor bias specs are + OR - 0.02 and + OR - 0.095 for the ST and Bosch respectively. So this says the bias of the sensors can be anywhere in these ranges, which takes us back to square one... The error in every sensor could be different, some will be down in the same range as the ST - although very few it would seem, and others could be right at the extremes of the range.

For interest a worst case error for the ST sensor where z=0.02 and y=1-0.02=0.98 will be 1.17 deg. For the Bosch sensor where z=0.095 and y=1-0.095=0.905 will be 6.04 deg
 

LV426

macrumors 68000
Jan 22, 2013
1,835
2,262
Yes the idea would be that if the phone is stationary (DND mode makes sure no vibrations for texts etc.) i.e. all the accelerometer readings are approximtaely constant for 1 hour, then it knows that (assuming you are at Earth sea level) the readings should be (0,0,1g) and so whatever the actual readings are should be taken as a zero point.

Unless the phone happens to be in my jeans pocket, crumpled by the side of the bed, while I'm asleep. Can you tell me what the zero point should be then?
 

i-aamir

macrumors 65816
Jul 7, 2010
1,103
691
UK - London
Just a quick info for you guys:

My iPhone5s 14day return window is up tomorrow.
Talked to Apple support hotline today and

a) I cannot prolong my 14day return window (at least here in Germany) - if I would have gotten a prolonged period I would not have changed it

b) I get a new one from China - hopefully next week

c) I can keep the "old" one until I get the new one.

d) Apple Support says he did not know about the issue and thinks it is hardware (but I dont know how qualified this answer was since he seemed not to be aware of the problem at all - at least he told me that)

e) After Sales says it could also be software (but in the end he did not care because he is just responsible for exchanging it)

My bottom line is:
I "bought" some time to resolve the issue if there will be a software update next week.
If it can be fixed with software I keep the one with the better readouts.
If the "new" one is on spot without an update I keep the new one.

If neither works or not an update is in sight - I decide from there on....

I am in exactly the same poition, my retail replacement got shipped from China today so I should have it next week, I'll then see which one is better and ask apple to collect the one that is worse off. After that I will leave it at that and enjoy the phone as all is else is perfect and the issue generally doesn't affect me!

Let's hope a software fix can sort it out though!
 

leafspring

macrumors newbie
Oct 8, 2013
10
0
For interest a worst case error for the ST sensor where z=0.02 and y=1-0.02=0.98 will be 1.17 deg. For the Bosch sensor where z=0.095 and y=1-0.095=0.905 will be 6.04 deg

I updated my post with some real-world data in the meantime. It's difficult to tell with only 5 minutes of testing (still at work :>) but it seems my level is a little less off (by about 1°) than it should be using the raw sensor data.

Could just as well be inaccuracy in my calculation/data collection, though.
My best guess at the moment would be that Apple simply doesn't calibrate at all and the previous 20mg bias still works reasonably well this way (especially since this is a maximum most phone never reach) while the new sensor bias causes enough deviation through bias to actually be noticeable on a lot (if not most) of the phones.

Conclusion: Apple will add a calibration procedure to iOS to correct the bias.

edit: Another interesting observation - the smallest change in raw data seems to be 0.0002g which kinda collides with the 6-bit spec. Accounting for some inaccuracies in the app that would actually indicate a 14-bit sensor...
 
Last edited:

Mercenary

macrumors 65816
Sep 17, 2012
1,241
626
Not sure if anyone has posted this link, but its fairly reasoned and clear what is going on with the accelerometer.

http://www.realitycap.com/iphone-5s-accelerometer/

Great article. Adds to the suspicion as to why Apple did it. The old sensor is more accurate but the cost for the old and new are about the same and the power savings from the new one are minimal. Why change parts? It certainly wasnt for the better.

But if app devs can compensate for the bias on an per app basis, makes sense that apple can on a system wide basis too.
 

RichP74

macrumors regular
Dec 16, 2012
198
105
just spoke with Apple care tech and they told me I was the first call they have had re this problem.LOL

You need to bump your case higher up the food chain. I spoke with a senior engineer dude and he knew full well about it. They told me they would replace my phones, but it wouldn't help, and please wait for a software update.
 

Sodner

macrumors 68020
Jan 12, 2011
2,112
78
Pittsburgh, PA
i'd like to see this...

hopefully all the ones that are being delivered at the end of the month have the issue corrected...

since this a hardware issue, i think apple will not officially confirm this and just quietly swap out affected units with working ones IF the end user requests...

I highly doubt they would change the sensor at this point. They have to fix this hardware mess with software.
 

MLAM

macrumors regular
Aug 7, 2011
208
1
United Kingdom
Well mine has gone back to Apple today on the last day of my 14 day return window.

It's a great shame as everything about it was perfect, screen was good, casing had ZERO damage and the power button was nice and firm.

We shall see what comes out of this from Apple...
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.