A few weeks ago we confirmed reports that the iPhone 5S motion sensors were embarrassingly off. Some enterprising devs have investigated the problem, and figured out that at its root, it's indeed a hardware design issue that Apple either overlooked or ignored. The good news is that there's a fix coming—but not from Apple.
The iPhone 5S level is powered by the phone's accelerometer, and according to developer RealityCap, the reason we've been seeing problems is that Apple switched hardware vendors for the part. In a blog post, CEO Eagle Jones points to the Chipworks teardown of the iPhone 5S guts, which reveals that while previous iPhones use STMicroelectronics accelerometers, the iPhone 5S uses a Bosch Sensortech part. That's an incredibly nerdy observation, but it's one that matters, because the STMicroelectronics and Bosch Sensortech accelerometers don't have the same specs.
Jones explains that these tiny precision devices rely on two key measurements that tell you how accurate they are: Variance and Bias. The former tells you how consistent an accelerometer's readings are, while the latter describes a constant inaccuracy stemming from a hardware manufacturing. He detailed this further in an email:
Let's say we're just measuring the strength of gravity, which should be 9.81 m/s^2.
A low bias, but high variance sensor might output: 9.85 9.75 9.81 9.90 9.79 9.77
A high bias, low variance sensor might have output like: 9.60 9.61 9.59 9.60 9.62 9.58
According to RealityCap's measurements, the old ST component and the new Bosch part have similar variance, but their bias specification is way different:
This is where we find the problem: the typical bias for the ST part is +/- 20m g, while the Bosch part lists +/-95m g. This almost 5x greater offset range is confirmed by our measurements, and is absolutely consistent with the failures being reported by users and the media. Specifically, a +/- 20m g offset range would translate to around a +/-1 degree accuracy range in tilt detection, and a +/-95m g offset translates to +/-5 degrees in tilt.
The result, as we saw in our previous report, is that the overall equilibrium of the phone's measurements is off, affecting everything from the level to how you play racing games.
Jones told me that Apple could have accounted for this change in hardware with factory calibration, but for whatever reason, it appears that the company didn't. That doesn't mean everything has to be borked forever; app developers can compensate for the new accelerometer's spec change with additional calibration.
It is possible to work around the problem by incorporating a calibration procedure into apps. This procedure would ask the user to place the device in different orientations to determine the accelerometer bias. Apps can then subtract this measured bias from the data coming from the accelerometer to get a corrected reading.
Which would be a huge pain to have to do for every single affected app. RealityCap, meanwhile, currently working on code for devs to seamlessly make just this kind of fix, which it plans to reveal in another blog post in the coming weeks.
Apple remains silent on the issue. According to Jones, the company could perform calibration on each new iPhone and bake the bias into the firmware—that they haven't appeared to do so indicates that Apple thinks it's not worth it.
What's most disappointing is that Cupertino appears to have opted for an inferior part without compensating for it. Theoretically, it could push out an additional calibration step for its apps, and provide some sample code to help out its developers. It's the least they can do. But if it hasn't happened yet, it doesn't seem likely to happen any time soon. [RealityCap and Chipworks]
RealityCap got in touch to inform us that it has posted its sample code for a simple calibration procedure. Unfortunately, it's not as comprehensive as they would have hoped because it turns out that the accelerometer was incorrectly identified by Chipworks in the first place. So while there is something demonstrably wrong with either the hardware or software, it's not necessarily because of the bias specification. Hrm. The truth is still out there.