eCompass

Document Sample
eCompass Powered By Docstoc
					            Precision in Motion
                                                     Handheld Electronic Compass Applications Using
                                                     the Kionix KXM52 MEMS Tri-Axis Accelerometer


 Introduction

 Today’s world is about mobility. The expanded and growing availability of cell phones, PDA’s and GPS
 has resulted in a massive integration of features into handheld devices. Growing in popularity, the
 integrated electronic compass is sure to become the next standard feature.

 This application note explains the integration of a Kionix KXM52 MEMS tri-axis accelerometer into a
 handheld electronic compass application. Required theory, plots, equations and circuit block diagrams
 are provided with this note as guidelines.

 Electronic Compass Implementation

 To date, tilt-compensated handheld electronic compass applications have used a dual-axis acceler-
 ometer as a tilt sensor, electronically gimbaling X, Y and Z magnetic field sensors. Magnetic field sen-
 sors require a horizontal orientation to the earth’s surface at all times, and, therefore, tilt data pro-
 vided by an accelerometer is required to compensate for field sensor errors introduced when the com-
 pass is arbitrarily oriented.

 Unfortunately, with a horizontally mounted dual-axis accelerometer, steep tilt angles and linear accel-
 erations can introduce tilt errors into the system, resulting in compass heading errors. Tilt errors of
 1° typically correlate to 2° of compass heading error.

 A single Kionix KXM52 tri-axis accelerometer has significant advantages over a dual-axis accelerome-
 ter for tilt compensation and linear motion detection. Also, the low noise of the Kionix KXM52 offers a
 drastic improvement in compass heading precision. These advantages are addressed in subsequent
 text. Also, please see the Kionix application note entitled Tilt-Sensing with Kionix MEMS Accelerome-
 ters for additional information on accelerometer tilt sensing.

 Tilt Compensation Calculations

 While tilt compensating magnetic field sensors, the accelerometer supplies pitch (ø) and roll (ρ) angles
 for the final heading calculation. For this note, we will follow the pitch and roll assignments described
 below in Fig. 1 with heading (azimuth) in the positive x-axis direction. For simplicity, this note will
 focus on pitching and rolling around a single axis, but this methodology is valid for any orientation –
 any combination of pitch (ø) and roll (ρ) angles.
                                                                                             Z
                                                           Z
                        Z                                                  Y                     θ       Y
                                        Y                      θ                                        ρ



                                        X                                ø X
                                                                                                                    1g


                                               Pitch (ø) is the angle of the x   Roll (ρ) is the angle of the Y
        No pitch or roll; level
                                               axis relative to the ground. θ    axis relative to the ground.     Earth’s Surface
        with the ground.
                                               is the angle of the z axis        θ is the angle of the z axis
                                               relative to gravity.              relative to gravity.



                                            Fig. 1) Pitch and Roll Assignments Relative to Ground

36 Thornwood Dr. - Ithaca, NY 14850                                                                               © Kionix 2004
tel: 607-257-1080 — fax: 607-257-1146                 PN: AN006 — 041001                                          October 1, 2004
www.kionix.com — info@kionix.com                                                                                  Page 1 of 4
            Precision in Motion
                                                                        Handheld Electronic Compass Applications Using
                                                                        the Kionix KXM52 MEMS Tri-Axis Accelerometer


 When using a dual-axis accelerometer, the pitch (ø) and roll (ρ) angles can be calculated using Eq. 1
 where Xaccel and Yaccel are the two accelerometer outputs(g).

                                                                                 Pitch (ø) = arcsin (Xaccel)

                                                                                   Roll (ρ) = arcsin (Yaccel)

                                                                Eq.1) Dual-Axis Pitch (ø) and Roll (ρ) Angles

 Tilt compensated X and Y magnetic vectors (X’, Y’) are calculated from the raw X, Y and Z magnetic
 sensor inputs and the pitch (ø) and roll (ρ) angles using Eq. 2. Based on these calculations, the mag-
 netic field sensors are much more sensitive to rotations around the heading axis (roll) than around the
 pitch axis, requiring more tilt compensation.

                                                  X’ = X * cos(ø) + Y * sin(ρ) * sin(ø) – Z * cos(ρ) * sin(ø)

                                                                               Y’ = Y * cos(ρ) + Z * sin(ρ)

                                                          Eq. 2) Tilt Compensated Magnetic Vectors (X’, Y’)


 The final compass heading (azimuth) can be calculated using the equation in Eq. 3.

                                                                        Heading (Azimuth) = arctan (Y’/X’)

                                                                                Eq. 3) Heading Calculation

 Tilt Sensitivity and Noise

 When tilting around a single axis of a horizontally mounted dual-axis accelerometer from 0° to 90°,
 noise begins to increase drastically as you begin to tilt beyond 45°. The noise increases when tilted
 beyond 45° because the sensing axis becomes less sensitive, starting at 17.4 mg/° at 0° and decreas-
 ing to 12 mg/° at ~ 45°. The plot in Fig. 2 shows the expected heading error due to noise of a low
 noise Kionix dual-axis accelerometer vs. a competitor as they are tilted from 0° to 90°.


                                                   Heading Error Vs Tilt Angle
                                                                                                        __35µg/rtHz (Kionix KXM52 Dual-Axis)
                                                               based on product spec noise              __200µg/rtHz (Competitor 1 Dual-Axis)
                                                                 w / 25 Hz Low Pass filter
                                                          2
                                                        1.5
                                  Heading Error




                                                          1
                                    (degrees)




                                                        0.5
                                                           0
                                                        -0.5
                                                          -1
                                                        -1.5
                                                          -2
                                                  -10                   10                   30              50              70                 90
                                                                                             Tilt angle (degrees)



                              Fig. 2) Dual–Axis Heading Error Due to Noise, Kionix vs. Competitor 1
36 Thornwood Dr. - Ithaca, NY 14850                                                                                                                  © Kionix 2004
tel: 607-257-1080 — fax: 607-257-1146                                     PN: AN006 — 041001                                                         October 1, 2004
www.kionix.com — info@kionix.com                                                                                                                     Page 2 of 4
            Precision in Motion
                                                                                               Handheld Electronic Compass Applications Using
                                                                                               the Kionix KXM52 MEMS Tri-Axis Accelerometer


 When using the Kionix KXM52 tri-axis accelerometer, the Z-axis can be combined with the X and Y
 axes to maintain constant sensitivity through all 90° of tilt. Fig. 3 shows the expected tilt sensitivity
 through 90° of tilt when using just the pitch or roll axis, just the Z-axis and all three axes.



                                                                                                       T ilt S e n s itiv ity v s T ilt A n g le
                                                                              18
                                                                              16
                                               Tilt Sensitivity (mg/degree)




                                                                              14                                                                            1 : A rc S in(X)
                                                                              12                                                                            2 : A rc C o s (Z)
                                                                              10                                                                            3 : A rc Tan(X/Z)
                                                                               8
                                                                               6
                                                                               4
                                                                               2
                                                                               0
                                                                                   0              15             30                  45                60        75              90
                                                                                                                      T i l t A n g l e ( d e g r e e s)




                                                                                               Fig. 3) Tilt Sensitivity vs. Tilt Angle


  As you can see, 17.4 mg/° of sensitivity can be maintained at any tilt orientation when combining
  the pitch and roll axis with the Z-axis. Therefore, with the KXM52 tri-axis accelerometer, the head-
  ing error due to noise will remain relatively constant at any tilt orientation as shown in Fig. 4.




                                                                              Heading Error Vs Tilt Angle                             __35&65µg/rtHz (Kionix KXM52 Tri-Axis)
                                                                                       based on product spec noise                    __200µg/rtHz (Competitor 1 Dual-Axis)
                                                                                         w / 25 Hz Low Pass filter
                                                                                  2
                                                                                1.5
                                    Heading Error




                                                                                  1
                                      (degrees)




                                                                                0.5
                                                                                  0
                                                                               -0.5
                                                                                 -1
                                                                               -1.5
                                                                                 -2
                                                         -10                                     10                    30                        50              70                   90
                                                                                                                      Tilt angle (degrees)




                       Fig. 4) Heading Error Due to Noise, Kionix Tri-Axis vs. Competitor 1 Dual-axis




36 Thornwood Dr. - Ithaca, NY 14850                                                                                                                                                        © Kionix 2004
tel: 607-257-1080 — fax: 607-257-1146                                                           PN: AN006 — 041001                                                                         October 1, 2004
www.kionix.com — info@kionix.com                                                                                                                                                           Page 3 of 4
            Precision in Motion
                                               Handheld Electronic Compass Applications Using
                                               the Kionix KXM52 MEMS Tri-Axis Accelerometer


  When using the KXM52 tri-axis accelerometer, and combining the pitch and roll axes with the z-axis,
  additional calculations are needed to create new pitch (ø) and roll (ρ) angles for more precise tilt
  compensation. The equations in Eq. 4 can be used to create the new pitch (ø) and roll (ρ) angles for
  use in the previously mentioned tilt compensated magnetic vectors and final heading calculations
  (Eq. 2, Eq. 3).

                                                                   X accel           
                                                Ø=    arctan                         
                                                              Yaccel 2 + Z accel 2   
                                                                                     

                                                                  Yaccel             
                                                 ρ = arctan 
                                                 ?                                    
                                                             X accel 2 + Z accel 2   
                                                                                     

                                        Eq. 4) Combined Pitch (ø) and Roll (ρ) Calculations

 Note that the sign of pitch is the same as the sign of Xaccel, and the sign of roll is the same as the
 sign of Yaccel. Also, pitch and roll can be calculated using only Xaccel and Yaccel as shown in Eq.1 to en-
 able error checking.


  Linear Acceleration Induced Tilt Error

  Linear accelerations can introduce tilt error into an electronic compass application. Typically, a dual-
  axis accelerometer provides tilt angles without knowing if the acceleration was caused by an actual
  tilt or a linear acceleration. This can result in a false tilt correction when the component is not tilted
  but, instead, linearly accelerated, perhaps when walking.

  With the Kionix KXM52 tri-axis accelerometer, you can monitor the total acceleration, Eq. 5, which
  should remain close to 1g during all tilt operations.


                                                               X accel + Yaccel + Z accel
                                                                      2         2           2
                                                Acceltotal =

                                                      Eq. 5) Total Acceleration

  If a tilt guard band were placed around the total acceleration, representing normal tilt operation, any
  values outside that guard band would indicate that the compass has been linearly accelerated and
  heading errors are present. This information could then be used to either display a potential margin
  for error in the compass heading or notify the user of a heading error and suggest that a new read-
  ing be taken.




36 Thornwood Dr. - Ithaca, NY 14850                                                             © Kionix 2004
tel: 607-257-1080 — fax: 607-257-1146           PN: AN006 — 041001                              October 1, 2004
www.kionix.com — info@kionix.com                                                                Page 4 of 4
            Precision in Motion
                                                   Handheld Electronic Compass Applications Using
                                                   the Kionix KXM52 MEMS Tri-Axis Accelerometer


 The Lost Hiker

 How does heading error really affect your final position? Consider the following real-life situation: A
 hiker would like to travel 1km due East. A two degree (2°) heading error resulting from as little as a
 one degree (1°) tilt error can put the hiker substantially off the mark.




                                                                          D=1km                                 ENDtarget
                                                                         2 degrees                      ENDerror =35m
                                                   N
                                                                          D=1km
                                               W       E                                                       ENDactual
                                                                                       Note: Drawing Not To Scale
                                                   S

                                                           Fig. 5) The Lost Hiker


 When applying the simple trigonometric equation in Eq. 6, where D equals 1km and θ equals a 2°
 heading error, we find our hiker 35m from the planned destination.


                                                                         D sin θ
                                                       END error =
                                                                          180 − θ 
                                                                     sin          
                                                                          2 

                                        Eq. 6) Distance From Planned Destination, D = 1km, θ = 2°




  KXM52 Tilt Compensated Electronic Compass System

  A proof-of-concept, tri-axially tilt-compensated electronic compass system can be quickly imple-
  mented using the Kionix KXM52 Development Board. (Please contact Kionix at info@kionix.com for
  more development board information.) The development board allows for easy integration of exter-
  nal components into a micro-controlled system with on-board KXM52, MCU, memory, real-time
  clock, and serial PC communication.

  For quick proof-of-concept, just integrate your X, Y and Z magnetic sensors and proper signal gain
  circuitry into the development board, along with a PC program, to manipulate the sensor data and
  emulate the compass display. The circuit block diagram in Fig. 6 is an example of a proof-of-
  concept electronic compass using the Kionix development board with Honeywell magnetic field sen-
  sors.




36 Thornwood Dr. - Ithaca, NY 14850                                                                                   © Kionix 2004
tel: 607-257-1080 — fax: 607-257-1146               PN: AN006 — 041001                                                October 1, 2004
www.kionix.com — info@kionix.com                                                                                      Page 5 of 4
            Precision in Motion
                                          Handheld Electronic Compass Applications Using
                                          the Kionix KXM52 MEMS Tri-Axis Accelerometer




                                        Fig. 6) Electronic Compass Block Diagram

  The Kionix Advantage

  The Kionix KXM52 tri-axis accelerometer can easily be integrated into handheld electronic compass
  applications. Prominent KXM52 advantages are:

  ®     Compass precision is significantly improved with the low noise tri-axis KXM52 accelerometer.
  ®     Low noise allows the sampling rate to be decreased, which allows power cycling for significant
        power savings.
  ®     The sensor assembly can be mounted in any orientation because the heading error does not in-
        crease with tilt angle, like it does with a dual-axis accelerometer.
  ®     Linear accelerations that cause invalid tilt compensation can be detected.

  Kionix technology provides for X, Y and Z-axis sensing on a single, silicon chip. One accelerometer
  can be used to enable a variety of simultaneous features including, but not limited to:

  ®     Drop force modeling for warranty management ®           Image stability, screen orientation
  ®     HDD shock protection                        ®           Computer pointer
  ®     Tilt screen navigation                      ®           Navigation, mapping
  ®     Theft, man-down, accident alarm             ®           Game playing

  Theory of Operation

  Kionix MEMS linear tri-axis accelerometers function on the principle of differential capacitance. Accel-
  eration causes displacement of a silicon structure resulting in a change in capacitance. A signal-
  conditioning CMOS technology ASIC detects and transforms changes in capacitance into an analog
  output voltage which is proportional to acceleration. These outputs can then be sent to a micro-
  controller for integration into various applications. For product summaries, specifications, and sche-
  matics, please refer to the Kionix KXM52 product sheet at http://www.kionix.com/Product-
  Index/product-index.htm.

36 Thornwood Dr. - Ithaca, NY 14850                                                              © Kionix 2004
tel: 607-257-1080 — fax: 607-257-1146      PN: AN006 — 041001                                    October 1, 2004
www.kionix.com — info@kionix.com                                                                 Page 6 of 4

				
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
views:12
posted:4/17/2012
language:
pages:6