detecting upward

Thread Starter

bug13

Joined Feb 13, 2012
2,002
Hi guys

How can I detect my device is facing up/current orientation in 3D? Will an accelerometer do the job? I heard that they will drift over time, and very noisy.

I will just need the orientation info for a few second.

Thanks guys!
 

crutschow

Joined Mar 14, 2008
34,470
You can reduce any noise with an analog or digital low-pass filter.

I doubt the drift will be high enough to affect your location of "up".
 

WBahn

Joined Mar 31, 2012
30,088
I doubt the drift will be high enough to affect your location of "up".
Why not?

All inertial systems drift and the departure from the true orientation grows over time. A directional gyro in a small aircraft drifts noticeably over the course of a few hour flight and needs to be reset according to the magnetic compass regularly. The attitude indicator corrects itself because it is canted at an angle and has a slight imballance in the frame so that it tends to assume an upright position based on the assumption that the aircraft spends more of its time in level unaccelerated flight than it does maneuvering. This feature is critical for instrument flight because while you can correct the directional gyro using the magnetic compass while in the clouds, you can't do that for the attitude indicator. But you can still fool the attitude indicator into losing track of what direction is "up", it just takes some effort, time, and patience.

Now, if that happens over the course of an hour or so of flight using safety-critical and expensive hardware, how much worse must the problem be for a cheap instrument in a cell phone that is going to be used for years. Either it has to have some self-righting mechansim or it has to limit its output to information relative to the cell phone's frame of reference.
 

WBahn

Joined Mar 31, 2012
30,088
Ah, wait a minute. I was being muddle headed and confusing different things.

A three axis accelerometer will have no problem determining "up" when it is not being accelerated because, due to the equivalence principle, it sees "gravity" as an acceleration. Hence it will report a 1g upward acceleration (subject to inaccuracies and thermal drift and whatnot). Thus you can use that signal as a self-righting signal. What you won't be able to do is to keep track of the orientation about the vertical axis over a long period of time. Some systems use an embedded magnetometer to get the orientation of the magnetic field around that and correct based on that. So both of these techniques replicate what happens in an aircraft's inertial instrument package, both the automatic self-righting and the pilot-affected directional re-referencing.
 

THE_RB

Joined Feb 11, 2008
5,438
Correct, it's a 3-axis force sensor. G will remain constant and the output will remain fixed and have relatively low noise.

I think he might have confused a gyro module with an accelerometer module? The gyro has noise and drift.
 

THE_RB

Joined Feb 11, 2008
5,438
Ahah, now you are talking resolution? I thouhgt it was just to detect "up".

All cameras/phones etc these days have orientation sensors, not all are accelerometers some just use modern tilt sensors.

The modern replacement for a mercury switch looks a bit like this;
http://www.romanblack.com/tilt.htm

And you can get 1/2/3 axis versions of these type orientation sensors. They are less resolution than an accelerometer but are still made to detect "up", and are easier to interface to.
 
Top