An investigation of the effects of magnetic variations on inertial/magnetic orientation sensors

Rigid body orientation can be estimated in a "sourceless manner" through the use of small three degree of freedom sensor modules containing orthogonally mounted triads of micromachined angular rate sensors, accelerometers, and magnetometers. With proper filter design, drift errors can be eliminated. However, variations in the direction of the local magnetic field reference vector can cause errors in the estimated orientation. The experimental work described in this paper attempts to quantify these errors with an eye toward the development of corrective algorithms. To determine the types and magnitudes of errors that can be expected, three different types of inertial/magnetic sensor modules were subjected to controlled changes in the direction and magnitude of the local magnetic field. The amount of magnetic variation caused by several common objects was also measured in order to gain insight into the magnitude of errors that can be expected during operation in a typical environment. The experiments indicate that variations in the direction of the local magnetic field lead to errors only in azimuth estimation when using inertial/magnetic sensor modules. In a common room environment, errors due to local variations caused by objects such as electrical heaters, CRT monitors, and metal furniture can be expected to be no more than 16 degrees. In most cases these errors can be avoided by maintaining a separation of approximately two feet from the source of interference.


I. INTRODUCTION
Accurate real-time tracking of the orientation or attitude of rigid bodies has wide applications in robotics pissanayake et al. 20011, helicopters [Saipalli, et al. 20031, tele-operation, augmented reality, and virtual reality pachmann et al. 20011. For body tracking applications, the human body can be viewed as an articulated rigid-body consisting of approximately fifteen segments or links. If the orientation relative to a fixed reference frame can be determined for each of the links then the overall posture of the buman subject can be accurately measured. Limb segment orientation can be estimated through the attachment of an inertiaYmagnetic sensor module to each segment. This method of U.S. Government work not protected by US. copyright 1115 orientation estimation is desirable since it is not dependent on any artificially generated reference signal or any line of sight requirements [Meyer et al. 19921. Since no generated signals are involved, there is no range of operation restriction. All latency in such a system is due to the computational demands of the data filtering algorithms and not to the physical characteristics of the generated source.
Full three degree of freedom inertiaumagnetic sensor modules contain nine sensing axes. The axes are divided between three orthogonally mounted angular rate sensors, three orthogonally mounted linear accelerometers and three orthogonally mounted magnetometers. Each of the triads is mounted in a way such that there is a sensor aligned with each of the principle axes of the coordinate frame of the sensor module. The accelerometers are used to measure the gravity vector relative to the coordinate frame of the module. Similarly, the magnetometers are used to measure the local magnetic field vector. The angular rate sensors allow for the measurement of body rate and make possible orientation tracking in dynamic applications. If magnetometer and accelerometer are considered low fiequency data sources and the rate sensors are treated as a high fiequency data source, drift in orientation estimates can be eliminated through the use of a properly designed complementary filter. Such nine-axis inertiaVmagnetic sensor modules are referred to as magnetic, angular rate, and gravity (MARC) sensors in the remaining of this paper.
MARC sensor module complementary filtering algorithms commonly heat the gravity and local magnetic field vectors as fixed vectors. In case of the gravity vector, the assumption that it is fixed leads to no difficulties since this vector does in fact point straight down in any inertial frame located on or near the surface of the earth. Making the same assumption regarding the local magnetic field vector can however lead to problems. In a typical roam setting the direction as well as the magnitude of the local magnetic field vector can be expected to vary to some degree due to the presence of ferrous objects or electrical appliances. This paper describes several experiments designed to quantify small scale magnetic inference caused by typical objects and how this interference can be expected to affect the accuracy of orientation estimates produced using data from a MARC sensor module. The results provide insight into the limitations of MARG sensor module orientation tracking as well as direction towards what type of algorithmic improvements could be made to improve estimation performance and robustness.

n. BACKGROUND
The following paragraphs go further into the basic theory of operation for inertidmagnetic sensors and briefly describe three types of sensor modules. The modules discussed are the InterSense Inertiacube, the Microstrain 3DM-G, and the McKinney Technology MARG III. Some basic background on ambient magnetic field of the earth and how it is distorted by ferrous objects and electrically powered devices is then provided.

A. M R G Sensors
MARG sensor filtering algorithms are based on a general set of principles. These algorithms produce accurate orientation estimates by taking advantage of the complementary natures of the three types of sensors in the modules. The manner in which the data from the different types of sensors is combined can be described as follows: The accelerometer triad output is normally averaged (or low pass filtered) for a period of time in order to measure the components of the gravity vector or the 1ocal'i.ertical relative to the reference frame of the triad. Determination of the relationship of the coordinate frame of the sensor nnit to this known vector allows estimation of orientation relative to a horizontal plane. However, in the event that the sensor module it rotated about the vertical axis, there projection of the gravity vector on each of the principle axes of the accelerometer will not change. The local magnetic field vector is not normally aligned with the gravity vector. Since the accelerometer triad can not be used to sense a rotation about the vertical axis, an orthogonally mounted triad of magnetometers is used to measure the local magnetic field vector in body coordinates and eliminate drift in azimuth. Thus, combining magnetometer data with accelerometer data provides a method for estimating the orientation of a static or slow moving rigid body.
Alternatively, assuming the initial orientation of the body is known, integration of the output of a triad of orthogonally mounted angular rate sensors provides another method of estimating orientation. If however, the rate sensors are susceptible to noise or bias effects, as is the case for the small low cost sensors used in MARG sensor modules, errors will render these estimates useless after a short period. To avoid lag or overshoot in dynamic applications, MARG sensor filtering algorithms combine high frequency angular rate sensor data with lowfrequency accelerometer and magnetometer data in a complementary manner to produce continuously accurate orientation estimates in real-time. More detailed examinations of MARG sensor data filtering algorithms can be found in wun et al. 20031. Foxlin [InterSense Inc.] developed and marketed an MARG sensor module called the Inertiacube. The primary application for this sensor has been head tracking [Fuchs 19931. Manufacture's literature indicates that the Inertiacube is capable of measuring angular rates, linear accelerations, and the local magnetic field along three axes Foxlin et al. 1998a;Foxlm et al. 1998bI Inc. 2001]. Overall, dimensions of the MARG IU unit are . approximately 0.7"~1.2"x1.0". Various complementary and Kalman filters based on a quaternion representation of orientation have been used to process MARG 111 sensor data. Estimation accuracy has been measured to be better than one degree. Further form factor reductions through the use of ADXRSISO angular rate sensors are expected for the MARG N. Approximate dimensions will be on the order of 0.929"x0.943"x0.392".

B. Magnetic Field Variations
MARG sensor filtering algorithms commonly treat the local magnetic field vector as a fvted vector with a known orientation relative to an Earth fxed coordinate W e . It is assumed that this vector will remain constant throughout the tracking area. Each sensor module contains a triad of magnetometers for the purpose of measuring the x, y, and z components of the ambient magnetic field in .the coordinate frame of the sensor module. Magnetometers such as the HMC1052 used in the MARG I11 are micromachined Hall effect sensors. Measuring the orientation of the module relative to a fixed reference with a h o w n orientation in an Earth fxed frame should make it possible to determine the orientation of the sensor module relative to that Earth fixed kame. However, if a filtering algorithm is based on the assumption the vector representing the magnitude and direction of ambient magnetic field is a constant reference and it is not, orientation estimation errors will result.
Magnetic fields surround permanent magnets or electrical conductors and can be visualized as a collection of magnetic flux lines along which magnetic field vector has a constant magnitude and direction. Flux lines are said to emanate kom a 'north' pole and return to a 'south' pole in a magnet. Flux density, or magnetic induction, is a measure of the number of flux l i e s passing through a given cross sectional area. It is commonly represented by the symbol B. Units of measure for magnetic induction are the tesla, gauss, and gamma. In the metric system, a gauss (G) is one line of flux passing through a 1 cm2 area, while a tesla (T) is ~O,OOO lines per cmz. A gamma (9) is 100,OOOth of a gauss.
Magnetic field strength is commonly assigned the symbol If. It is a measure of force produced by an electric current or a permanent magnet. While magnetic field strength and magnetic flux density are not the same, they are equal within a vacuum. In this case, 1 gauss = 1 oersted. Magnetic permeability is a constant of proportionality that exists between magnetic induction, B, and magnetic field intensity, H. It can be viewed as a measure of how easily magnetic lines of flux will pass through a given material; In the presence of an object made of a material with a relatively high permeability, magnetic field lines will bend toward or be attracted to the object. This phenomenon can be expected to occur near large ferrous objects. The direction and magnitude of ambient magnetic field at a given point is the vector sum of all magnetic fields present at that point. The predominate field in most cases would be that of the Earth. However, additional magnetic fields caused by conductors through which a current is flowing and magnets also contribute to the total field at a given point. All of the fields present will be distorted by objects made of materials with a high magnetic permeability. The Earth's main field varies &om approximately 0.23 to 0.61 gauss. Except at the magnetic equator, the earth's field is not horizontal. The angle that the field makes with the horizontal is called the dip angle or the inclination. Local variation of the Earth's main field can occur due to large local phenomena, such as iron ore . . deposits. This type of variation would be uniform and unchanging on the scale of a typical indoor environment.
In an indoor environment, sources of magnetic interference are constantly present and can include common items such as computer monitors, fluorescent lighting and powered-up electrical wiring inside walls. Table 1 lists the fields generated by some common appliances. In some cases the strength of the generated field exceeds that of the Earth within a short distance of the appliance. If a magnetic direction sensor is placed in this nearby area the generated field can be expected to have an effect on the direction and magnitude of the field measured by the sensor. Unless the field generated by the appliance happens to be aligned with that of the Earth the reported direction will not be that of the Earth's magnetic field. In a room size environment such fields would constitute locals variations from the average field in the room.

III. EFFECTS OF MAGNETIC FIELD VARIATIONS
MAkG sensor filtering algorithms are dependent on sensing the local magnetic field to eliminate drift in azimuth portion of orientation estimates. Given that variations in the direction and magnitude of the ambient magnetic field can be expected to occur as a result of the presence of ferrous materials and electrical appliances operating in the tracking environment, what type of estimation errors can be expected and how large can the estimation errors be expected to be? Knowing the answer to this question provides insight into when MARG sensors can be expected to work properly with minimal estimation error and what type of algorithm modifications can be expected to improve performance. The experiments described below attempt to answer this question. In the first series of experiments, MARG sensors were subjected to controlled changes in the direction and strength of the sensed magnetic field in order to characterize the orientation estimation errors. The second set of experiments involved exposing a MARG sensor to magnetic fields generated by various electrical appliances in order to determine the magnitude of the errors that can be expected [Peterson 20031.

A. Change in Estimated Orientation
Magnetic field variations were applied to the three MARG sensors to measure the deviation in their orientation estimates due to the change in the sensed magnetic field. The change was generated using a Helmholtz coil. The sensors were placed inside the coil to observe how the orientation estimate would change as changes to the local magnetic field were generated and applied. The coil was a Cenco, catalog number 71267. It was powered by a Hickok model 5055 power supply. The three different sensors modules tested were the MARG-I (Bachmann et al., 2001), the Microstrain 3DM-G (Microstrain), and the Intersense Inertiacube2 (Intersense).
During the experiments, the Helmholtz coil was set to generate a magnetic induction that would be reversed approximately 180' in azimuth from the Earth's magnetic field. The sensors were placed in several different orientations, and then the Helmholtz coil was energized to observe the type and magnitude of change that occurred in the orientation estimate produced by the sensor and its associated filtering algorithm. Throughout these experiments the voltage applied to the Helmholtz coil was monitored using a voltmeter, to ensure a stable supply of power.
The data plots from these experiments show a period of measuring the Earth's ambient magnetic field, followed by a period in which the Helmholtz coil was energized for 20 to 30 seconds. Following the energized period, the coil was de-energized and the plots reflect the return to sensing only the ambient field in the laboratory. Though each of the sensors used in this experiment are capable of outputting the orientation estimate in quaternion form, all orientation estimates produced by the sensors are displayed in Euler angle form. In the experiments presented here, the sensors were oriented with the x axis of the module pointing towards the local North, the y axis pointing East and the z axis pointing down. At no time was a sensor actually rotated before, during, or after the application of the altered magnetic field. Figure 1 and Figure 2 show the responses for the MARG I and Microstrain 3DM-G respectively when the magnetic field was altered using the Helmholtz coil. It can be observed that the MARG-I and MicroStrain sensors responded to the change in the sensed magnetic field by altering their orientation estimates by approximately 180" in yaw. In all experiments, changes in the orientation estimates produced by sensor modules appeared only in the azimuth portion of the orientation estimate. This was true regardless of the orientation of the sensor modules. This is significant since the magnetic field vector prior to power being applied to the coil was undoubtedly not in the horizontal plan due to the dip angle of the Earth's field. It indicates the errors due to magnetic variation are restricted only to the horizontal plane.  In order to investigate the response of the InertiaCube, further additional experiments were performed. In Figure 4, the sensor was again left in the same position within the Helmholtz coil. The coil was again energized for approximately 30 seconds. Unlike previous experiments, during the time when the magnetic field was changing the sensor was physically tapped. This caused the sensor to proceed through a full 180" change in observed measurement, similar to the other two sensors. These results indicate that the filtering algorithm of the InetiaCube will not accept changes in its orientation estimate without some accompanying response from the angular rate sensors.  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   . , 5 0 . . -. . . . . . .~~~~. . . . . . . . . . . . . . -~. . . . . . . the local magnetic field only cause estimation errors in azimuth or the horizontal plan for MARG orientation trackers. The magnitude of the errors appears to be roughly equal to the amount of deviation of the local magnetic field in the horizontal plane. The dip angle itself or changes in the dip angle of the local magnetic field appear to have no bearing on the accuracy or amount of variation seen in orientation estimates produced using MARG sensor data.

E. Variations Caused by Common Objects
To determine the magnitude of azimuth errors that can be expected in a typical indoor environment, the second set of experiments measured the magnetic field variation experienced at varying distances from several test objects. The MARG I filtering algorithm utilizes a normalized magnetic field vector of unit length and is thus not affected by changes in the length of the magnetic field vector. It is assumed the algorithms associated with the InertiaCube and 3DM-G are similar in this regard. Therefore, the experimental results presented here concentrate on the changes in the direction of the local magnetic field near different objects and not changes in magnitude.
In these experiments, a "track" was constructed using non-ferrous materials and set so that the orientation of a MARG sensor could be held constant as the sensor was moved through successive positions approaching various test objects (Figure 5). The sensor was placed at twelve locations along the track shown in Figure 5. This set-up allowed the direction of the magnetic field vector to be measured since the sensor module orientation was kept constant. The test objects included. -.

Large steel shelf
Electric cord powering a light source Simple appliance (small space heater with fan), powered and un-powered states Computer monitor (CRT type), powered and unpowered states The Microstrain 3DM-G sensor module is factory calibrated and allows access to scaled senor output h m each of the nine sensors in the module. Due to these factors, the magnetometers in the 3DMG sensor were thought to be most suitable for measuring the magnetic field, and the results presented in this section were conducted using the 3DM-G sensor. Scaled raw data was not available from the Inertiacube. The MARG I is normally calibrated by hand using a simple, but assumed less precise procedure than that used to calibrate the 3DM-G [Bachmann et al. 20031.
The amount of deviation caused by the test object at each location was determined by finding the difference between the initial orientation of the magnetic field when the sensor module was at the most distant point fiom the object and the field orientation at each of the other eleven test positions using A =& -x w y +(yo -y n +(z, -z n y . where x, y, and z denote the components of the magnetic vector, the subscript zero denotes the initial measurement and the subscript n denotes the nfh measurement. The vectors were normalized to unit length before being compared. Two normal vectors have a maximum%eviation of 2.0 when they are directly opposite one another. Therefore, the range of A is 0.0 to 2.0. Figure 6 is a plot from an initial control case during which no test object was present. The horizontal axis is the distance in inches between the sensor module and the test object position. The vertical axis is the deviation between the initial magnetic field vector and the magnetic field vector at each subsequent position. The field deviation does not exceed 0.02 and is less than 1%. Maximum deviation is therefore less than 1.146O and is attributed to noise in the ambient magnetic field of the laboratory. Figure 7 plots the magnetic deviation sensed with an electrical power cord as the test object. The cord was connected to a work light containing a 60-watt light bulb drawing a current measured at 0.508 amps. The plot is statistically identical to that shown in Figure 6. This indicates that electrical wiring powering a light will not have an effect on orientation estimates made by MARC sensors. Figure 8 shows the results of two experiments in which a portable heater was used as a test object. In the fist experiment both the heater fan and heating elements were off. In the second experiment both the fan and the heat were on. Examination of the figure indicates that the amount of magnetic field variation increased dramatically as the sensor was brought in close proximity to this appliance when the fan and heat were both turned on. The large bars around the "heater w/ heat on" curve represent the amount of magnetic field fluctuation as the sensor was brought closer to the running heater. It is hypothesized this fluctuation was due to the use of alternating current to power the appliance. The field variation when the heater was off, represented by the "heater o f f curve, is comparable to the plots in Figure 6    began approximately two.feet from the shelf. This was the greatest distance of any of the objects used in the experiments. It should be noted that unlike the heater large fluctuations were not observed in the deviations. This was taken to indicate that the magnetic field deviation was DC in nature. The maximum deflection caused by the metal shelfwas 16.1". Figure 10 shows two scans of experiments in which a CRT computer monitor was the test object. The magnetic field showed approximately the same amount of deflection whether the monitor was attached to a PC and powered up or turned off. The size of the fluctuations of the deviations in both experiments was small indicating the deviation was a DC effect. Some impact from this appliance was observed to almost two feet of separation distance. The running space heater and computer monitor each caused a maximum deflection of approximately 12.6" in the magnetic field.  Overall this second set of experiments indicates that when MARG sensors are less than approximately two feet from common appliances and ferrous objects the amount of azimuth error can be significant. However, beyond this distance objects such as those used in these experiments have very little effect on the ambient magnetic field and it should thus be possible to avoid azimuth errors.
Depending on the object, the fluctuations can be either AC or DC in nature.

N. FUTUREWORK
The results presented here increase knowledge regarding how common appliances and metal furniture can affect the performance of MARG orientation trackers.
These effects are relatively small scale. Little insight into what type of larger scale variations can be present in a room sized environment and how orientation-trackers might be affected is given. Exploration of larger effects could best be accomplished by tracking the position of a calibrated triad of magnetometers as it is moved throughout a tracking area. The data recorded during this period would provide further insight by allowing the construction of a vector map of the magnetic field. In addition, the data could be used to create a lookup table that allowed the magnetic field deviation at any given position to be calculated. This lookup table data could be used as an input to MARG filtering algorithms.
If the larger scale variations could be expected to affect the trackers on all limb segments in the same way are present in typical tracking environments, it is possible that a single precision Ih4U attached to one limb segment could be used to dynamically measure the direction of the magnetic field. MARG filtering algorithms could then be modified to use this dynamic measure of the magnetic field instead of a static reference.
It appears that little can be done about the observed DC effects in these experiments other than maintainimg an adequate separation from the source of interference. Some AC effects were also observed. If the frequency of these effects is known, they could be mitigated through the use of a notch filter. Further experiments may be required to determine the AC frequency, but in North America it is most likely 60 Hz.
The performance of MARG sensors is expected to improve due to availability of low noise, high resolution micromachined accelerometers [Najafi et al. 20031.

V. SUMMARY AND CONCLUSIONS
This paper presented results from experiments designed to ascertain the type and size of errors that can be expected when tracking orientation using MARG sensor modules in the presence of operating electrical appliances or furniture made of ferrous materials. These results indicate that the errors will appear only in the azimuth portions of the orientation estimates. These errors will be roughly equal in size to the amount the magnetic field deviates in the horizontal plane from the original reference. They do not appear to be caused by changes in the dip angle of the magnetic field.
The largest errors observed ranged fiom 12" to 16". Based on the test objects used in these experiments it appears that such errors can be avoided by maintaining a distance of approximately two feet from the source of magnetic interference. Appliances powered by alternating current produce magnetic interference with an AC component. This type of interference or noise could most likely be mitigated through the use of a notch filter tuned to the proper frequency.