An Improved Version of the Fluxgate Compass Module

with an excitation coil around the whole core, type B on the right with an excitation coil only on the two sides, type C where the excitation coil is equally distributed around the whole core with a higher count of compensation coil turns). This difference in sensor excitation coil distribution has a considerable impact on the sensor properties. A type A sensor with the excitation coil equally distributed has lower non-linearity error. However, a higher compensation current is needed because of the lower count of sensing-compensation coil turns. A type B sensor is used in the compass module, as the lower compensation current (for the Earth’s magnetic field it is 28 mA) means easier design of the compensation loop. A common operational amplifier can supply such a current.


Magnetometer
The main part of the compass is a sensor of the Earth's magnetic field. Three types of sensors are typically used for geomagnetic field sensing. Hall-effect magnetometers are used in applications where the cost of the sensor, its dimensions and power consumption are critical, e.g. watches and mobile phones. An AMR sensor (Honeywell HMC1001) offers higher accuracy but it is still very difficult to achieve the desired error limits (<±0.5 degree). A fluxgate sensor is the best choice for applications where accuracy is the most critical parameter.
The miniature PCB fluxgate sensors used in this compass have smaller dimensions (34×16×1.2mm), lower power consumption (important for a battery operated device) and lower price (in case of mass production). Three types of PCB fluxgates sensors are shown in Fig. 2 (type A on the left with an excitation coil around the whole core, type B on the right with an excitation coil only on the two sides, type C where the excitation coil is equally distributed around the whole core with a higher count of compensation coil turns). This difference in sensor excitation coil distribution has a considerable impact on the sensor properties. A type A sensor with the excitation coil equally distributed has lower non-linearity error. However, a higher compensation current is needed because of the lower count of sensing-compensation coil turns. A type B sensor is used in the compass module, as the lower compensation current (for the Earth's magnetic field it is 28 mA) means easier design of the compensation loop. A common operational amplifier can supply such a current.
A type C sensor has been developed, which combines the best from type A and type B. This sensor, with low non-linearity error and small compensation current, is used in the new version of the electronic compass.

Magnetometer electronics
Fluxgate sensors are usually excited using a sine wave signal. In order to suppress the power consumption, pulse excitation is used. Typical signal evaluation electronics for sine wave excitation is the second harmonic detector. When operating with pulse excitation, some other type of evaluation has to be used. A differential switched integrator seems to be a good choice [1]. Various excitation signal patterns were tested (Fig. 3). The excitation frequency is constant (10 kHz), while the pulse width (e.g. 12 %) and the phase between excitation and evaluation sync. signals are changed.
A three-channel PCB fluxgate magnetometer is used in this compass. The construction of such a device is a demanding challenge. At least a four-layer PCB must be used for the three-channel magnetometer evaluation electronics. Because of the unavailability of SMD components (resistors with low temperature coeficient, high quality capacitors), mixed components were used. The second version is constructed entirely with SMT. Only three connectors are "through hole" types.
Another problem is the temperature bias stability of the PCB fluxgate sensors used here. The compass consumes less than two watts of electric energy, but this still causes considerable selfheating. By using resistors with a very small temperature coefficient (±3 ppm) as a current to voltage converter (magnetometers operate in a closed loop) and with a stable voltage reference (±3 ppm), the temperature stability is mainly influenced by the sensors themselves. Fig. 4 shows the temperature stability of the magnetometers.
Simple measuring equipment was used to test PCB fluxgate magnetometer linearity. The test field (±55000 nT) was generated with a Helmholtz coil driven by the power supply with an IEEE488 interface. The magnetometer output voltage digitized by the ADC of the compass was sent to the computer and processed with MS Excel. The measured non-linearity depends on the actual environmental conditions (presence of magnetic disturbance). A typical non-linearity value was ±0.05 % of full scale (see Fig. 5).

Compass electronics
The whole system consists of three magnetometers, three accelerometers, six delta-sigma ADCs (ADS1210) and two microcontrollers (ATMEL ATTiny2313) -the first one is used for data acquisition and communicates through a serial line with the master system (e.g. a PC), and the second is used in an excitation unit. An improved version contains ATMEGA16 in the ADC module (the larger FLASH memory allows easier programming using C language). The output voltages from the accelerometers and magnetometers must be converted simultaneously, so six single ADCs are used. Higher resolution can also be achieved with this configuration compared to a single ADC with a sampling unit. Colibrys MS7202 MEMS capacitive accelerometers with a low magnetic housing are used. MS7202 has sensitivity 500 mV/g with a range of ±2 G, bias temperature coeficient ±400 mg/°C max. (scale factor temperature coefficient 100 ppm/°C typ.) and white noise spectral density 36 mg/ÖHz. Battery operated power supply with USB/Serial converter was used for field testing.

Mechanical assembly
A compass case is made from a fibreglass-filled plastic rod (length 230 mm, diameter 48 mm). This material ensures solidity of sensor placement and its temperature deformation is very low (this is very important, because any change in sensor alignment extends the azimuth error). The rod was cut longitudinally into two pieces. Space for the electronics and sensors was then made in both pieces with the use of a milling machine. The sensors installed in the compass case are shown in Fig. 6. All sensors are fixed with non-magnetic screws and hot glue.
The electronic parts are mounted on four PCBs. All PCBs are four layered and are mounted one above the other in the center of the compass case. All components used in the compass should be made of non-magnetic materials (the presence of soft ferromagnetic materials has an unpredictable influence on the Earth's magnetic field, and causes considerable errors in azimuth estimation). The complete system ready for testing is shown in Fig. 7.

Calibration
Calibration of such a system is essential in order to achieve the desired accuracy. Sensitivities, offsets and orthogonality errors can be calibrated using a process called scalar calibration. The three sensors (magnetometers or accelerometers) must be orthogonally placed in order to be able to properly sense the vector of the appropriate field. Imperfections in mechanical placing cause the angle between two sensors not to be 90 degrees. A typical orthogonality error can be up to ±5 degrees for single axis sensors and up to ±1 degree for dual or triple axis sensors (depending on the actual inner sensor construction -one die or multiple dies in one package). Scalar calibration is based on the presumption of a stable and homogeneous field. Data from sensors is taken in various (random) positions of a sensor triplet. In the case of magnetometers this can be performed during smooth slow motion. This is not suitable for accelerometers, because the sensor output may be influenced by dynamic acceleration. The acquired data is then processed by an iteration algorithm. The purpose of the iteration algorithm is to find nine coefficients (three sensitivities, three offsets and three misalingment angles). The algorithm minimizes the variance of the total field (E RMS ), which is computed using equations (2), (3), (4) and (5). F MEAS-X is the value measured by sensor X, f kX is sensitivity, f OX is sensor offset, a 11 -a 33 are coeficients that represent the non-orthogonality of the sensor triplet, and F MEAS is the total field value measured by a scalar magnetometer (Overhauser magnetometer).
( ) ( 5 ) The operation of the iteration algorithm is shown in Fig. 8. At the beginning of the iteration cycle, the estimated parameter value and its range are known (e.g. off-  ). The interval is segmented into five equal parts. The E RMS value (5) is computed in the middle of each part. The interval with minimum E RMS is chosen. The new parameter range is 60 percent of the previous one. The iteration algorithm is terminated after a predefined number of iterations, or when the minimum predefined difference between iterations is reached. Other methods for finding the best parameters in nine-dimensional space are being studied. Fig. 9 shows the result of scalar calibration. The variance of total field E RMS (5) was decreased from 1729 nT to 31 nT. In the case of gravitation, a reduction from 24 mg to 4 mg was achieved.

Calibrating the misalignment of sensor triplets and the compass case
After scalar calibration has been done, we have the ideal vector magnetometer and accelerometer. The azimuth is measured in reference with the compass body. The sensitivity axis of the sensor triplets should coincide with the compass case axis. In real conditions, angles q, j and F (Fig. 10) are non-zero, and this misalignment must be calibrated otherwise a significant error in azimuth estimation can occur.
For this calibration, a stable non-magnetic platform is needed (e.g. a tripod). The compass module is then rotated in one axis. The output value (corresponding to the rotation axis) should be constant during this motion. In the real case the output will change sinusoidally. An iteration algorithm is used to minimize this change in all axes.

Software equipment
The software equipment (created in LabWindows/CVI ver. 5.5) is also very important. The software for the supervising PC consists of three basic parts. Data acquisition is the first part, followed by processing with a calibration algorithm [2] and measurement with a calibrated device with PC software, see in Fig. 11. Azimuth, pitch and roll are the main output values. The total magnetic field F can be used to check the presence of a magnetic disturbance in the place of measurement. Otherwise, a significant error in azimuth estimation could remain hidden.

Conclusion
A compass module suitable for underground drilling was constructed. The azimuth error is ±0.5°after all calibration procedures have been done. The technical parameters of the current version of the compass module are summarized in Table 1. A new version is being finished, and not all measurements have yet been made. The new design addresses the drawback of currently used PCB fluxgate sensors, i.e., the influence of the electronics on the magnetic sensors. It was anticipated that the mechanical dimensions of the new version would be slightly increased and the space between the fluxgate sensors and the rest of the compass would be wider. However, there were difficulties in manufacturing the case, and these have not yet been overcome. The main advantages of the new version are briefly mentioned here: l lower power consumption (30 % reduction) l elimination of current loops l a lower amount of ferromagnetic materials contained in the electronics of the compass l improved electromechanical construction (SMDs) l better software for the control CPU (invariable ADC setting) l the type C fluxgate sensor (better linearity of the magnetometers) The last part of the work consists in completing the software equipment and calibration of the device.