AN 006. Handheld Electronic Compass Applications Using a Kionix MEMS Tri-Axis Accelerometer. Introduction

Similar documents
AN 038. Getting Started with the KXTJ2. Introduction

KXCJK AN 039. Getting Started with the KXCJK. Introduction

AN055. Replacing KX023, KX123, KX124 with KXG07. Introduction

Navigational Aids 1 st Semester/2007/TF 7:30 PM -9:00 PM

AN065. AN065 Getting Started with the KXTJ3. Introduction

AN023. Getting started with the KXTF9. Introduction. Circuit Schematic

POINT Gyro-Stabilized Compass Module HMR3601

DETERMINING ANGLE POSITION OF AN OBJECT USING ACCELEROMETERS

EZ430-C9. Getting Started with Kionix EZ430-C9 Evaluation Board for the Texas Instruments MSP430 USB Stick Development Tool

MMA7260QT. 3 Axis Accelerometer Module

DIGITAL COMPASS SOLUTION

± 2g Tri-Axis Accelerometer Specifications

ECV ecompass Series. Technical Brief. Rev A. Page 1 of 8. Making Sense out of Motion

± 2g Tri-axis Accelerometer Specifications

± 2g Tri-axis Accelerometer Specifications

HMR3200/HMR3300 APPLICATIONS. Features. General Description. Block Diagram. Compassing & Navigation. Attitude Reference. Satellite Antenna Positioning

This was written by a designer of inertial guidance machines, & is correct. **********************************************************************

Technical Document Compensating. for Tilt, Hard Iron and Soft Iron Effects

Local Magnetic Distortion Effects on 3-Axis Compassing

1.1.1 Orientation Coordinate Systems

± 2g Tri-axis Accelerometer Specifications

Application Note: Multipoint Calibration Primer

Mio- x AHRS. Attitude and Heading Reference System. Engineering Specifications

SCA620-EF1V1B SINGLE AXIS ACCELEROMETER WITH ANALOG INTERFACE

± 10g Tri-axis Accelerometer Specifications

Inertial Measurement Units I!

Digital Compass Accuracy

HMR3200/HMR3300. Digital Compass Solutions. User s Guide HMR3200/HMR3300 SENSOR PRODUCTS

Calibration of Triaxial Accelerometer and Triaxial Magnetometer for Tilt Compensated Electronic Compass

Fall 2016 Semester METR 3113 Atmospheric Dynamics I: Introduction to Atmospheric Kinematics and Dynamics

Digital Compass Solution HMR3400

DATASHEET SQ-SI-360DA-VMP SOLID-STATE MEMS INCLINOMETER ±70 º DUAL AXIS, 360 º SINGLE AXIS, SERIAL AND ANALOG OUTPUT. -Az RANGE AND SCALE

AC-43 Accelerometer. User Manual

Sensor Toolbox (Part 2): Inertial Sensors

AN 025 Getting Started with the KXTI9

Towards the Consumerization of Smart Sensors

Navigation coordinate systems

Inertial Navigation Static Calibration

Surface Mount Micromachined Accelerometer

MEMS motion sensors. June

HL2430/2432/2434/2436

ORIENTATIONS OF LINES AND PLANES IN SPACE

Application Guidelines for MEMS Compass

XDK HARDWARE OVERVIEW

OPERATING MANUAL AND TECHNICAL REFERENCE

Adafruit Analog Accelerometer Breakouts

Fully Integrated Thermal Accelerometer MXC6225XU

Inertial Navigation Systems

DATASHEET SQ-SI-360DA-VMP SOLID-STATE MEMS INCLINOMETER ±70 º DUAL AXIS, 360 º SINGLE AXIS, SERIAL AND ANALOG OUTPUT FUNCTIONAL DIAGRAMS

HOBO Pendant G Data Logger (UA ) White Paper

MP3V5050V, -50 to 0 kpa, Gauge Pressure Sensor

Surface Mount Micromachined Accelerometer

Compass Module 3-Axis HMC5883L (#29133)

Lab 21.1 The Tangent Galvanometer

TLP100 INCLINATION SENSOR MEMS technology with High resolution

MPXH6300A, 20 to 300 kpa, Absolute, Integrated, Pressure Sensor

ORDERING INFORMATION # of Ports Pressure Type Device Name

MPXHZ6130A, 15 to 130 kpa, Absolute, Integrated Pressure Sensor

MP3V5050, 0 to 50 kpa, Differential, and Gauge Pressure Sensor

XEN1210 Magnetic Sensor

TECHNICAL NOTE. VS1000: Evaluation Kit EVBA_2.0. Contents. EVBA_2.0 is a plug and play Evaluation Kit for Colibrys VS1000 accelerometers line.

SILICON DESIGNS, INC Model 1210 ANALOG ACCELEROMETER

±1.5g Three Axis Low-g Micromachined Accelerometer

Pedometer 3 Click. PID: MIKROE 3259 Weight: 24 g

TEST RESULTS OF A GPS/INERTIAL NAVIGATION SYSTEM USING A LOW COST MEMS IMU

Calibration of Inertial Measurement Units Using Pendulum Motion

Mathematics in Orbit

DYNAMIC POSITIONING CONFERENCE September 16-17, Sensors

RE<C: Heliostat Orientation Estimation Using a 3-Axis Accelerometer

Physics 101, Lab 1: LINEAR KINEMATICS PREDICTION SHEET

AMS 5812 OEM pressure sensor with an analog and digital output

Game Application Using Orientation Sensor

2011 FIRST Robotics Competition Sensor Manual

AccuStar Electronic Clinometer

Path Tracking - Guiding Smartphones Based on Recorded Tracks

Experiment 6. Snell s Law. Use Snell s Law to determine the index of refraction of Lucite.

3-Axis Compass with Algorithms HMC6343

±4g, ±9g Two Axis Low-g Micromachined Accelerometer

Programmable Dual Axis Digital Accelerometer and Impact Sensor ADIS16204

AVR4018: Inertial Two (ATAVRSBIN2) Hardware User's Guide. 8-bit Microcontrollers. Application Note. Features. 1 Introduction

Three-Dimensional Magnetometer Calibration with Small Space Coverage for Pedestrians

11.0 Measurement of Spindle Error Motion

BRx6 Sensor Calibration Using SurvCE/SurvPC

DIGITAL COMPASS-RD DIGITAL COMPASS REFERENCE DESIGN KIT USER' S GUIDE. 1. Kit Contents. 2. Introduction. 3. Quick-Start Guide. 4. General Description

NEULOG ACCELERATION LOGGER SENSOR GUIDE

AN Theory of Operation. Abstract. 1 Introduction. Using the AS5046 Rotary Encoder in 3D Joystick Applications APPLICATION NOTE

Measurement of Deformations by MEMS Arrays, Verified at Sub-millimetre Level Using Robotic Total Stations

USB Virtual Reality HID. by Weston Taylor and Chris Budzynski Advisor: Dr. Malinowski

Camera Drones Lecture 2 Control and Sensors

Applications: Industrial Automation, Cranes, Hoists, Utility Vehicles, Off-highway, Ag, and Forestry Equipment

EE565:Mobile Robotics Lecture 3

Estimation of Altitude and Vertical Velocity for Multirotor Aerial Vehicle using Kalman Filter

MEMSENSE. AccelRate3D. Triaxial Accelerometer & Gyroscope Analog Inertial Sensor

Power Cycling Algorithm using the MMA73x0L 3-Axis Linear Accelerometer

ACTIVITY TWO CONSTANT VELOCITY IN TWO DIRECTIONS

Instrument Distortion Calibration File Transformation

K-Beam Accelerometer. Acceleration. Capacitive MEMS, Triaxial Accelerometer. Type 8395A...

Preview. Two-Dimensional Motion and Vectors Section 1. Section 1 Introduction to Vectors. Section 2 Vector Operations. Section 3 Projectile Motion

WIRELESS SERIES Single or Dual Axis MEMS Inclinometer

Tangent Galvanometer

Transcription:

Handheld Electronic Compass Applications Using a Kionix 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 one of the next standard features. This application note explains the integration of a Kionix 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. Magnetic Field Basics The earth s magnetic field is approximately 0.6 gauss or 600 milli-gauss in terms of magnetic flux density. In free air, this also correlates to 0.6 Oersted in magnetic field intensity. Other equivalents for earth field values are about 48 Amperes/meter of magnetic field intensity and about 60 micro-tesla for magnetic flux density. The earth s magnetic field reference polarity is from the earth s south pole to the north pole. So a handheld electronic compass on the equator pointed at the north pole should read about +0.6 gauss, and 0.6 gauss when pointed at the south pole. Typically two or three anisotropic magnetic sensors are used for a compass in orthogonal angles (perpendicular to each other) to measure the incident earth s magnetic field into Cartesian coordinates X, Y and Z. For a mechanical reference, usually the X magnetic sensing element will point towards the top of a handheld device. The Y sensor will point across the assembly and to the right, and the Z sensor will point down through the device. Magnetic Inclination Because the earth s magnetic field is not perfect between the south and north poles, it tends to incline or dip upward or downward from the ground into the atmosphere as it gets toward the poles. This is known as the angle of inclination or dip angle. At latitudes near the equator the angle is very small and most of the 0.6 gauss is horizontal to ground. If an electronic compass with magnetic sensors is placed flat (horizontal), the X and Y sensors receive the majority of the magnetic field intensity and accurate compass headings are the result. As your location s gets closer to the magnetic poles, less of the earth s field is horizontal and more vertical. As a way of defining these field proportions, the magnetic inclination (dip angle) is defined as the vector angle above or below horizontal that the earth s magnetic field projects. For example, much of the United States has a dip angle of about 55 to 70 degrees; so much of the 0.6 gauss magnetic component is downward leaving only 0.2 to 0.4 gauss horizontal with respect to the earth s surface. Of course, it is the horizontal field amplitude that is measured by a compass. Figure 1 shows a pictorial example of magnetic inclination angle. 36 Thornwood Dr. - Ithaca, NY 14850 tel: 607-257-1080 fax: 607-257-1146 www.kionix.com info@kionix.com Kionix 2007 27 June 2007 Page 1 of 2

Fig. 1) Magnetic Inclination Angle Compassing From the days of magnetized rocks to needles, humans have used the earth s magnetic field to determine direction of travel (heading, bearing, or azimuth) relative to the magnetic north pole. For electronic compasses, compassing occurs when two or three sensors break the earth s magnetic field into the two or three magnitudes to describe field vector direction. When using with an electronic compass, the handheld device containing the sensor must be held level with the ground (no tilt). The X and Y sensor outputs will determine the heading according to: α = arctan Y X Eq. 1) Heading (azimuth α) in degrees. Since the arc-tangent function repeats itself every 180 degrees, the polarity of the X and Y values (plus or minus) is needed to determine where in the 0 to 359 degree heading circle the handheld device is pointed. Tilt Compensation Most wireless phone customers tend to hold their phones at an upright angle ( 45 pitched up) for optimum viewing, instead of holding the phone flat for optimum compass accuracy. With the phone pointing in the north or south heading, the amount of un-levelness or tilt adds very little inaccuracy to the compass reading. However for east or west headings, each degree of tilt may contribute up to two degrees of indicated heading error. Figure 2 shows this phenomenon for pitch errors at a nominal latitude (inclination angle = 40 ). Page 2 of 2

Fig. 2) Heading errors due to pitch without tilt compensation (Inclination Angle =40 ). To retain accurate headings in the presence of pitch or roll angles, the traditional method was to mechanically gimbal the compass assembly to keep the compass perpendicular to the downward gravity direction. Since mechanical gimbaling is impractical for handheld devices, designers must choose an electronic gimbaling method, or tilt compensation. Tilt compensation requires a third, Z-axis, sensor to be added to the X and Y sensors to break the sensed earth s magnetic field into a vector direction via Cartesian math. Besides the XYZ magnetic sensors, some method of sensing the gravity vector relative to the magnetic sensor directions is required. Traditionally fluidic sensors performed this inclinometer function by measuring fluid in a small container (ampoule) for pitch and roll angles. Since the ampoule was halffilled with conductive fluid, contacts in the pitch and roll orientations could create a voltage output proportional to the amount of tilt. Because fluidic tilt sensors are relatively large, an alternative method for gravity vector sensing has recently appeared in the form of Micro-Electro-Mechanical System (MEMS) accelerometers. To date, tilt-compensated handheld electronic compass applications have used a dual-axis accelerometer as a tilt sensor, electronically gimbaling the X, Y and Z magnetic field sensors. Unfortunately, with a horizontally mounted dual-axis accelerometer, steep tilt angles and linear accelerations can introduce tilt errors into the system, resulting in compass heading errors. A single Kionix tri-axis accelerometer has significant advantages over a dual-axis accelerometer for tilt compensation and linear motion detection. Also, the low noise of the Kionix accelerometer offers a drastic improvement in compass heading precision. These advantages are addressed in subsequent text. Also, please see the Kionix application note entitled AN 005 Tilt-Sensing with Kionix MEMS Accelerometers for additional information on accelerometer tilt sensing. Tilt Compensation Calculations The math that goes into tilt compensated compassing is well beyond the simple arctangent equation solution (Eq. 1). Two additional equations are solved to come up with flattened X and Y values ready for the arctangent heading equation. These equations are: Page 3 of 2

X ' = X cos Y ' = Y cos ( φ) + Y sin( ρ) sin( φ) Z cos( ρ) sin( φ) ( ρ) + Z sin( ρ) Eq. 2) Tilt Compensated Magnetic Vectors (X, Y ) The final compass heading (azimuth α) can be calculated using the equation: Y ' α = arctan X ' Eq. 3) Heading Calculation Based on these calculations, the magnetic field sensors are much more sensitive to rotations around the heading axis (roll ρ) than around the perpendicular axis (pitch φ). The MEMS 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. 3 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. No pitch or roll; level with the ground. Pitch (φ) is the angle of the x axis relative to the ground. θ is the angle of the z axis relative to gravity. Roll (ρ) is the angle of the Y axis relative to the ground. θ is the angle of the z axis relative to gravity. Fig. 3) Pitch and Roll Assignments Relative to Ground When using a dual-axis accelerometer, the pitch (φ) and roll (ρ) angles can be calculated using Eq. 4 where a x and a y are the two accelerometer outputs (in g). φ = arcsin ρ = arcsin ( a ) x ( a ) Eq. 4) Dual-Axis Pitch (ø) and Roll (ρ) Angles y Page 4 of 2

As seen in Eq. 2, tilt compensated X and Y magnetic vectors (X, Y ) are calculated from the raw X, Y and Z magnetic sensor inputs using the pitch (φ) and roll (ρ) angles from Eq 4. One can also see that the compass heading is now dependent on the accuracy of the pitch and roll measurements. Errors in the angle measurments will result in errors in the heading! Heading Error - The Lost Hiker How does heading error really affect your final position? Consider the following reallife 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. N D=1km ε = 2 degrees D=1km END target END error = 35m W S E Note: Drawing Not To Scale END actual Fig. 4) 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. END error Dsinε = 180 ε sin 2 Compass Tilt Errors Eq. 5) Distance From Planned Destination, D = 1km, ε = 2 Heading errors due to the tilt sensor depend somewhat on geographic location. At the equator, tilt errors are less critical since the earth's field is strictly in the horizontal plane. (Fig. 1) Near the magnetic poles, tilt errors are extremely important. Tilt errors are also dependent on the heading (Fig. 2). Since a compasses error budget falls heavily on the pitch and roll angle accuracy, the chosen MEMS accelerometer must have sufficient tilt accuracy so as not to consume the entire heading accuracy error budget. A reasonable goal of less than 0.5 degrees of either pitch or roll error can create up to ±1 degrees of compass heading error at North American latitudes. The curve in Fig. 5 shows the effect on heading for various tilt sensor errors. In this figure, a pitch error of 0.3 and no roll error can contribute a 0.5 heading error alone. Page 5 of 2

Fig. 5) Heading error due to roll and pitch tilt errors (.2P/.2R =.2 error in pitch and roll). A MEMS accelerometer can have several sources of error that will contribute to the overall tilt accuracy. These error sources and the means by which they can be reduced are discussed below. 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 decreasing to 12 mg/ at ~ 45. (gravitational acceleration = 1g; 1 mg = 1/1000 th of a g = 9.8m/s 2 / 1000 = 0.0098m/s 2 ) The plot in Fig. 6 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 (degrees) Heading Error Vs Tilt Angle base d on product spec nois e w/ 25 Hz Low Pass filter 35µg/rtHz (Kionix KXM52 Dual-Axis) 200µg/rtHz (Competitor 1 Dual-Axis) 2 1.5 1 0.5 0-0.5-1 -1.5-2 -10 10 30 50 70 90 Tilt angle (degrees) Fig. 6) Dual Axis Heading Error Due to Noise, Kionix vs. Competitor 1 Page 6 of 2

When using the Kionix 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. 7 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. Tilt Sensitivity vs. Tilt Angle 20 18 16 Tilt Sensitivity (mg/deg) 14 12 10 8 6 4 2 1: ArcSin(X) 2: ArcCos(Z) 3: ArcTan(X/Z) 0 0 10 20 30 40 50 60 70 80 90 Tilt Angle (deg) Fig. 7) 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 Kionix tri-axis accelerometer, the heading error due to noise will remain relatively constant at any tilt orientation as shown in Fig. 8. Heading Error (degrees) Heading Error Vs Tilt Angle base d on product s pe c nois e w/ 25 Hz Low Pas s filte r 35&65µg/rtHz (Kionix KXM52 Tri-Axis) 200µg/rtHz (Competitor 1 Dual-Axis) 2 1.5 1 0.5 0-0.5-1 -1.5-2 -10 10 30 50 70 90 Tilt angle (degrees) Fig. 8) Heading Error Due to Noise, Kionix Tri-Axis vs. Competitor 1 Dual-axis Page 7 of 2

When using a Kionix 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. 6 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). φ = arctan ax 2 2 a y + az ρ = arctan a a 2 x y + a 2 z Eq. 6) Combined Pitch (φ) and Roll (ρ) Calculations Note that the sign of pitch is the same as the sign of a x, and the sign of roll is the same as the sign of a y. Also, pitch and roll can be calculated using only a x and a y as shown in Eq. 4 to enable error checking. Accelerometer calibration One detail so far unmentioned is the accelerometer s ability to create accurate pitch and roll angles. Calibrating accelerometers is mostly a factory test problem. Endusers can re-zero (level) pitch and roll in their production line. Pitch and roll offsets can be found by placing the phone or circuit board assembly on a known flat surface and measuring the values with a near zero expectation for the φ and ρ values. The offset error can be zeroed out after installation and will include any platform leveling error. Sensitivity or scale factors could be done for accelerometer pitch and roll outputs by robotically tilting the assembly and matching the resulting output with the desired output. Obviously test costs must be assessed with the desired compass accuracy and the quality of accelerometers. Additional information on the sources of error and how to minimize them can be found in Application Note:AN012 Accelerometer Errors. Linear Acceleration Linear accelerations can introduce tilt error into an electronic compass application. For example, an aircraft or car making a turn will cause the tilt sensors to experience the centripetal acceleration in addition to gravity and the compass heading will be in error. 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 a Kionix tri-axis accelerometer, you can monitor the total acceleration, Eq. 7, which should remain close to 1g during all tilt operations. Page 8 of 2

2 2 2 a total = ax + a y + az Eq. 7) Total Acceleration For most applications the linear acceleration is small, or is in effect for a short duration, making a magnetic compass a useful navigation tool. 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 to notify the user of a heading error and suggest that a new reading be taken when the linear acceleration has dropped to acceptable limits. Kionix Tilt Compensated Electronic Compass System Accelerometer Selection A partial specifications table of Kionix accelerometers that can be used for electronic compass tilt correction is shown below: Parameter Units KXP74 KXP84 KXM52 KXPS5 Output Type SPI SPI & I2C Analog Analog, SPI & I2C Min. Required Detection Range g ± 2 ± 2 ± 2 ± 2 0g Offset at Room Temperature 2048 ± 102 2048 ± 102 1.65 ± 0.033 V 1.65 ± 0.087 V Offset Variation Over Temp mg/ C ± 2.4 (max) ± 2.4 (max) ± 2.4 (max) ± 1 (max) Offset ratiometric error (3.3V ± 5%) mg 37.5 37.5 37.5 37.5 Sensitivity at Room Temperature 819 ± 25 counts/g 819 ± 25 counts/g 0.660 ± 0.007 V/g 0.660 ± 0.013V/g Sensitivity Variation Over Temp %/ C ± 0.032 (max) ± 0.032 (max) ± 0.032 (max) ± 0.032 (max) Sensitivity ratiometric error (3.3V ± 5%) % 1.5 1.5 1.5 1.5 Noise Density μg/rthz 250 max 250 max 65 max 250 max Resolution at 50 Hz mg ± 3.2 ± 3.2 ± 0.8 ± 3.2 Nonlinearity % FS 0.5 max. 0.5 max. 0.5 max. 0.5 max. Operating Voltage Range V 2.7 5.25 2.7 5.25 2.7 5.25 1.8 5.25 Operating Current μa 800 750 1700 800 Standby Current μa <10 <10 <10 <0.1 Operating Temperature Range C -40 to+85-40 to+85-40 to+85-40 to+85 Size Maximum Area (x-y) (mm) 2 25 25 25 15 Height Maximum (z) mm 1.2 1.2 1.8 0.92 Circuitry For wireless handsets and other handheld devices, combining a Kionix KXM52 tri-axis accelerometer with magnetic sensors will make a tilt-compensated electronic compass system. The circuit schematic diagram below is an example of a proof-ofconcept electronic compass using the Kionix KXM52 with Honeywell s HMC6042 xy magnetic sensor and Honeywell s HMC1041Z z-axis magnetic sensor. Page 9 of 2

2.8V Z Vdd SR+ Honeywell HMC1041Z SR- Out- Out+ GND 2.8V 0.47µF SR- S/RC SR+ In Z- In Z+ Honeywell HMC6042 X Y C1 Vdd2 + - 4.7µF MagX MagY MagZ Vdd1 GND Vdd AIN0 AIN1 AIN2 AIN3 AIN4 AIN5 AIN6 Host Controller 2.8V DIO GND 0.1µF 1 2 3 4 5 6 7 AccX AccZ 14 AccY 13 12 Kionix GND 11 10 KXM52 9 PS Vdd 8 0.1µF 0.1µF 0.1µF 2.8V National Semiconductor LM60 Vtemp = 6.25mV/C + 424mV Fig. 10) Electronic Compass Schematic A temperature sensor allows for corrections to the pitch and roll measurements over temperature. Substitution of different magnetic or temperature sensors can be permitted for brand preferences, cost concerns, and layout. The host controller may not have enough onboard ADC channels, in which case a discrete ADC may be necessary. Firmware To implement the electronic compass function with tilt compensation, firmware must be developed to gather the magnetic and tilt sensor inputs and to interpret them into meaningful data. Typically the whole compass firmware can be broken into logical subroutines such as data acquisition, data offset corrections, heading computation, set/reset operation, and the calibration. Digital compass firmware is not a task to be attempted by novice designers with quick design times in mind. In most cases, hundreds to over a thousand hours of firmware development and testing are expended to create a successful compass routine. Page 10 of 2

The process of creating compass firmware starts with the prime routines of magnetic sensor data acquisition, data correction, and heading computation. To offer the best compass accuracy, each axis of magnetic sensor data must be quickly digitized. At nearly the same time, the best pitch and roll angles are to be acquired. Initialization Get Magnetic Data Solve 3D Equations Compute Heading Accelerometer Tilt Data And Tilt Data Confidence Factor Bi - directional Data Offset Deviation Angle Correction GPS Derived Lat, Long Bridge Offset fset Compensation Hard - Iron Compensation Set/Reset Routine Calibration Routine Declination World Angle Magnetic Model Correction Routine Heading To To Dead Host Reckoning Display Routine Location Fig. 11) Compass Firmware Flowchart Focusing only on the Tilt Data portion of the firmware, the following flowchart (Fig. 12) shows what it takes to get accurate pitch and roll angles. a x, a y, a z from accelerometer measurement Calculate total acceleration Temperature reading from temperature sensor Is total acceleration = 1g? NO Confidence factor = 0 YES Supply voltage measurement Confidence factor = 1 Compensate a x, a y, a z for temperature and supply voltage variations Temperature/ supply voltage compensation look-up table Tilt Data and Confidence factor Calculate pitch and roll angles 0 degree correction Fig. 12) Tilt Data Calculation Flowchart Page 11 of 2

One can see that the tilt angle calculation alone is not a simple task. In most cases, the amount of time spent refining this algorithm and the amount of effort spent characterizing the accelerometer will determine the accuracy of the tilt data. Test costs must be assessed with desired compass accuracy. To best describe various levels of magnetic sensor and electronic compass utility, Fig. 13 shows three tiers of accuracy. A low grade of magnetic field sensing can be called a direction sensor, and can be used for basic map orientation and basic 4 to 8-point cardinal directions (north, south, east, and west). Moderate grades of accuracy enable pointing for LBS and Telematics plus true compassing for 16-point cardinal directions degrees heading displays. Precision grade navigation (better than ±2 heading accuracy) is required for dead reckoning, airborne and seaborne navigation applications. While precision navigation once meant hundred of dollars for compassing, this application note shows circuits with ICs that are just a couple dollars each. Magnetic Sensor Accuracy Low (> ± 5 degrees) Electronic Compass Applications Direction Sensing (Not a Compass). Map Orientation for right reading legends. Moderate ( ± 2 to ± 5 degrees) Basic Cardinal Point Compassing (N, S, E, W), and Pointing Functions - Precision (< ± 2 degrees) Navigation - Grade Applications such as Dead - Reckoning, Ship, and Aircraft Navigation. The Kionix Advantage Fig. 13) Tiers of Sensor Accuracy The Kionix tri-axis accelerometers, with their small size and current consumption, can easily be integrated into handheld electronic compass applications. Prominent Kionix advantages are: Compass precision is significantly improved with low noise tri-axis accelerometers. 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 increase with tilt angle, like it does with a dual-axis accelerometer. Linear accelerations that cause invalid tilt compensation can be detected. Theory of Operation Kionix MEMS linear tri-axis accelerometers function on the principle of differential capacitance. Acceleration 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. Kionix technology provides for X, Y and Z- Page 12 of 2

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 Hard disk drive shock protection Tilt screen navigation Theft, man-down, accident alarm Image stability, screen orientation Computer pointer Navigation, mapping Game playing For product summaries, specifications, and schematics, please refer to the Kionix accelerometer product sheets at http://www.kionix.com/sensors/accelerometerproducts.html. Page 13 of 2