detecting upward

Discussion in 'General Electronics Chat' started by bug13, Aug 6, 2013.

  1. bug13

    Thread Starter Well-Known Member

    Feb 13, 2012
    1,208
    38
    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!
     
  2. mcgyvr

    AAC Fanatic!

    Oct 15, 2009
    4,770
    970
    Yep accelerometer.. every cell phone now has one.
     
  3. bug13

    Thread Starter Well-Known Member

    Feb 13, 2012
    1,208
    38
    How would you deal with the noise and drift of a accelerometer? Is there some sort of algorithm to deal with it?
     
  4. crutschow

    Expert

    Mar 14, 2008
    13,016
    3,235
    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".
     
  5. WBahn

    Moderator

    Mar 31, 2012
    17,748
    4,796
    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.
     
  6. WBahn

    Moderator

    Mar 31, 2012
    17,748
    4,796
    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.
     
  7. THE_RB

    AAC Fanatic!

    Feb 11, 2008
    5,435
    1,305
    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.
     
    bug13 likes this.
  8. GopherT

    AAC Fanatic!

    Nov 23, 2012
    6,058
    3,820
    Or, you could go low-tech with one or more mercury switches (or environmentally friendly equivalants).
     
  9. bug13

    Thread Starter Well-Known Member

    Feb 13, 2012
    1,208
    38
  10. bug13

    Thread Starter Well-Known Member

    Feb 13, 2012
    1,208
    38
     
  11. THE_RB

    AAC Fanatic!

    Feb 11, 2008
    5,435
    1,305
    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.
     
    GopherT likes this.
Loading...