Jump to content

Accelerometer values

Guest rutgervvh

Recommended Posts

Guest DistortedLoop
What about your accelerometer values? (Phone -> Keypad -> *#0*# -> Sensor -> put your device on a flat/steady surface and see the accelerometer values)

I got = x:0,y:0,z:-216

does the 'z' value (-216) indicates that the accelerometer isn't working right? It should be all "0" when it is on a flat surface, or??

I decided to do this test since I experienced some steering problems in Asphalt 5.

Well, what about your device? Yet another galaxy problem :huh:?

Well.... The Galaxy S doesn't have a flat back, does it? It's got the big hump at one end, and the little notch to keep the speakerphone speaker from being flat on the table. Given that the phone isn't really flat when you lay it on a table, I wouldn't expect it to report a flat status (all zeros).

What do you think?

Link to comment
Share on other sites

Guest blooop

The accelerometer should have a reading even when stationary. Mine reads X:0 Y:0 Z:9.8 which is right. The 9.8 is due to gravity which will always act on the phone. I don't know why yours reads -216, in my application it gives the accelerations in m/s^2 but I think the accelerometer give values in G's so your should read 0,0,1.

Edited by blooop
Link to comment
Share on other sites

Guest xarxiusxiii

Mine reads the same as rutgervvh's does, but I'm not experiencing any steering problems in Asphalt 5. I've not had any accelerometer problems actually, so this reading doesn't bother me... What firmware are you using?

Link to comment
Share on other sites

Guest DistortedLoop
Mine reads the same as rutgervvh's does, but I'm not experiencing any steering problems in Asphalt 5. I've not had any accelerometer problems actually, so this reading doesn't bother me... What firmware are you using?

Yes, mine actually reads the same: 0,0,-216. JM5 here.

I can't even find a position to hold the phone that produces 0,0,0 values. I can zero the z axis by holding the phone so that top of the phone is parallel to the horizon. I actually think that this is the CORRECT way to get a zero reading.

Here's some interesting info from an article on programming for the G1:

Next, you take the sensor data and use a little filtering math to determine two critical pieces of information:

1 - The direction the phone is pointing

2- The screen's angle relative to the horizon

The first is called the Azimuth, or direction from north, and the second is called the inclination, or the angle above or below the horizon at which the camera is pointed

That last line is why I think you shouldn't expect a zero reading when laying flat on a table. The z axis is determined by the camera's position relative to the horizon (above or below it). So to get a zero, the camera needs to be pointing in such a way to take a picture that's level with the horizon. Makes sense in some regards, and my testing of how to get a zero reading confirms that's the way it's working. For whatever reason, the sensor measures 90 degrees off the horizon as +/-216. The article did mention doing some math on the sensor results to determine angular position; the 216 figure probably something to do with gravity measurements, which is how the accelerometer works.

What's more important in this discussion is that the lcdtest app we're using here doesn't appear to be very sensitive, at least in displayed values. You can see this by putting your phone on a flat countertop/table. I get a -216 just laying the phone on the surface, even though it's obvious to the eye the phone's not level. If I slide the phone to the edge of the table where the humpback is hanging over the edge, and the phone is much closer to level, visually, the reading remains at -216 (this is wrong - see below about the Bubble app).

Do a little more testing with the phone and you'll see that as you rotate the phone in lcdtest through the z-axis, the z values never change until you've reached an increment of 24 (216, 192, 168, 144...), so the lcdtest can only display 54 values for 180 degrees of orientation (216 to -216 in increments of 8 for 90 to -90 degrees relative to the horizon).

I grabbed two apps off the Market - Bubble and Accelerometer. Bubble allows you to calibrate, but I imagine its only calibrating for in app.

Bubble shows that my original response about the humped back on the phone affecting the level/horizontal state of the phone is accurate (obviously), but it also shows something more interesting and related to my above comments, which is that with this app, even without calibrating, the bubble level shows a different level state between the hump on the table, and the hump not on the table. This proves the phone is cable of more delicate measurements than the lcdtest mode displays. In other words the lcdtest mode isn't very accurate, and not very reliable for testing this stuff.

Accelerometer app shows similar. It shows higher sensitivity, but interestingly, for flat on the table, on my phone, it's displaying a value of +9.5. I'm going to assume that this is the same app that @bloop is using.

And as @xarx points out, games like Asphalt 5 don't misbehave with this reading, so it's not a real world issue to be concerned about.

Bottom line in my far-from-expert opinion, there's nothing wrong with the accelerometer showing -216 as the original poster describes and there is nothing wrong with the phone in this regard.

(This also shows the dangers of opening test-mode apps that aren't designed for consumer use when we don't know the full purpose of the test and what the readings displayed actual mean or tell us about the device.)

Nothing to see here, really, but a great learning experience for me, thanks for bringing it up rutgervvh! :huh:

Edited by DistortedLoop
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in

Sign In Now
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.