AP07_4-5.vp 1 Navigation Satellite navigation systems can determine an absolute po- sition on the Earth’s surface. An electronic compass must be a part of an inertial navigation system to be able to do the same. The output value from an electronic compass is the azimuth. The azimuth can be calculated using equation (1), where HEY and HEX are the horizontal parts of the magnetic vector and D is the declination in the measurement location (see Fig. 1). Y H H D� � � � � � � � � arctan EY EX . (1) The azimuth calculated using equation (1) is correct on- ly when the magnetic sensors are in the horizontal plane (pitch = 0, roll � 0). This cannot be easily mechanically as- sured in underground drilling applications. Therefore tilt sensors must be introduced into the system. The data from the magnetometers is then mathematically compensated for the actual measured pitch and roll. Three MEMS accelerome- ters are used as tilt sensors. 2 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 dimen- sions and power consumption are critical, e.g. watches and mobile phones. An AMR sensor (Honeywell HMC1001) of- fers 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 com- pass 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 differ- ence 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 er- ror. However, a higher compensation current is needed be- cause 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. 18 © Czech Technical University Publishing House http://ctn.cvut.cz/ap/ Acta Polytechnica Vol. 47 No. 4–5/2007 An Improved Version of the Fluxgate Compass Module V. Petrucha Satellite based navigation systems (GPS) are widely used for ground, air and marine navigation. In the case of a malfunction or satellite signal inaccessibility, some back-up navigation system is needed. An electronic compass can provide this function. The compass module described in this paper is designed for precise navigation purposes. The compass module is equipped with electronic tilt error compensation, and includes everything in one package - electronics with digital output, sensors. A typical application of this compass is in underground drilling. A critical parameter in this application is heading accuracy. A reading error of 1 degree can cause a displacement of 1.8 metres in the target area (length of tunnel 100m). This is not acceptable in an urban conglomeration, and therefore a more accurate heading sensing device must be used. An improved version of this electronic compass is being finished. Keywords: navigation, azimuth, electronic compass, fluxgate, magnetometer. Fig. 1: Azimuth, heading direction and magnetic vector components Fig. 2: Three types of PCB fluxgate sensors developed at CTU. Type A on the left, type B on the right, and C at the bottom 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 ver- sion of the electronic compass. 2.1 Magnetometer electronics Fluxgate sensors are usually excited using a sine wave signal. In order to suppress the power consumption, pulse ex- citation is used. Typical signal evaluation electronics for sine wave excitation is the second harmonic detector. When oper- ating 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 demand- ing 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 com- ponents 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 con- siderable selfheating. By using resistors with a very small temperature coefficient ( 3 ppm) as a current to voltage con- verter (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 flux- gate magnetometer linearity. The test field ( 55000 nT) was generated with a Helmholtz coil driven by the power sup- ply 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 condi- tions (presence of magnetic disturbance). A typical non-lin- earity value was 0.05 % of full scale (see Fig. 5). 2.2 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 si- multaneously, 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 �g/ °C max. (scale factor temperature coefficient 100 ppm/ °C typ.) and white noise spectral density 36 �g/�Hz. Battery operated power supply with USB/Serial converter was used for field testing. 3 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 © Czech Technical University Publishing House http://ctn.cvut.cz/ap/ 19 Acta Polytechnica Vol. 47 No. 4–5/2007 Fig. 3: From top to bottom: excitation current (600 mAp-p), synchronization signals for evaluation electronics, sensor output response (B ~ 40 �T) Fig. 4: PCB fluxgate magnetometer offset temperature drift (0.9 nT/ °C) measured in a six-layer shielding -60 -40 -20 0 20 40 -60000 -40000 -20000 0 20000 40000 60000 B [nT] e [n T ] Fig. 5: PCB fluxgate magnetometer linearity error (channel X, 0.036 % F.S.) 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 consider- able errors in azimuth estimation). The complete system ready for testing is shown in Fig. 7. 4 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 calibra- tion. 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 magne- tometers 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 ac- quired 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 an- gles). The algorithm minimizes the variance of the total field (ERMS), which is computed using equations (2), (3), (4) and (5). FMEAS-X is the value measured by sensor X, fkX is sensitiv- ity, fOX is sensor offset, a11–a33 are coeficients that represent the non-orthogonality of the sensor triplet, and FMEAS is the total field value measured by a scalar magnetometer (Over- hauser magnetometer). F F F F F F T TEMP-X TEMP-Y TEMP-Z MEAS-X MEAS-Y ME � � � � � � � � � � AS-Z X Y Z OX OY O � � � � � � � � � � � � � � � � � � � T k k k f f f f f f 0 0 0 0 0 0 Z � � � � � � � � � T , (2) F F F a a a a a a a a a X Y Z � � � � � � � � � � � � � � �11 12 13 21 22 23 31 32 33 � � � � � � � � � � � � � � F F F TEMP-X TEMP-Y TEMP-Z , (3) F F F F� � �X Y Z 2 2 2 , (4) � �E n- F F i n RMS MEAS� � �11 2 1 . (5) The operation of the iteration algorithm is shown in Fig. 8. At the beginning of the iteration cycle, the esti- mated parameter value and its range are known (e.g. off- 20 © Czech Technical University Publishing House http://ctn.cvut.cz/ap/ Acta Polytechnica Vol. 47 No. 4–5/2007 Fig. 6: Three PCB fluxgate sensors in the left picture and three MEMS accelerometers are placed in the compass case in the picture on the right Fig. 7: Compass module on a non-magnetic tripod. On the table is a module with accumulators and a USB/serial converter Fig. 8: Iteration algorithm – one step of iteration of one parameter set � 0 0.1 �T). The interval is segmented into five equal parts. The ERMS value (5) is computed in the middle of each part. The interval with minimum ERMS is chosen. The new parameter range is 60 percent of the previous one. The itera- tion algorithm is terminated after a predefined number of it- erations, or when the minimum predefined difference be- tween 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 ERMS (5) was decreased from 1729 nT to 31 nT. In the case of gravitation, a reduction from 24 mg to 4 mg was achieved. 4.1 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 �, � and � (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. 5 Software equipment The software equipment (created in LabWindows/CVI ver. 5.5) is also very important. The software for the supervis- ing 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 measure- ment. Otherwise, a significant error in azimuth estimation could remain hidden. 6 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 measure- ments 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 ver- sion 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: � lower power consumption (30 % reduction) � elimination of current loops � a lower amount of ferromagnetic materials contained in the electronics of the compass � improved electromechanical construction (SMDs) � better software for the control CPU (invariable ADC setting) � the type C fluxgate sensor (better linearity of the magneto- meters) The last part of the work consists in completing the soft- ware equipment and calibration of the device. © Czech Technical University Publishing House http://ctn.cvut.cz/ap/ 21 Acta Polytechnica Vol. 47 No. 4–5/2007 Fig. 9: Total field before and after scalar calibration Fig. 10: Misalignment of the sensor triplet sensitivity axis and the compass case Fig. 11: PC software – output data presentation: Azimuth, Roll, Pitch, Total magnetic field References [1] Kubík, J., Janošek, M., Ripka, P., Včelák, J.: Low-power Fluxgate Signal Processing using Gated Differential In- tegrator. In: EMSA’06 – 6th European Magnetic Sensors and Actuators Conference, Bilbao, 2006, p. 132. [2] Včelák, J., Ripka, P., Kubík, J., Platil, A., Kašpar, P.: AMR Navigation Systems and Methods of their Calibra- tion. Sensors and Actuators. A, Physical Vol. 123–4 (2005), p. 122–128. Ing. Vojtěch Petrucha e-mail: petruv1@fel.cvut.cz Department of Measurement Czech Technical University in Prague Faculty of Electrical Engineering Technická 2 166 27 Prague 6, Czech Republic 22 © Czech Technical University Publishing House http://ctn.cvut.cz/ap/ Acta Polytechnica Vol. 47 No. 4–5/2007 Dimensions (length, diameter) 230 mm, 48 mm Power consumption (power supply voltage �12 V) <2 W ( <1.4 W new version) Azimuth accuracy (after calibration) �0.5° Table 1: Compass parameters summarized