Interactive model of magnetic field reconstruction stand for mobile robot navigation algorithms debugging which use magnetometer data ACTA IMEKO ISSN: 2221-870X December 2019, Volume 8, Number 4, 47 - 53 ACTA IMEKO | www.imeko.org December 2019 | Volume 8 | Number 4 | 47 Interactive model of a magnetic field reconstruction stand for the debugging of mobile robot navigation algorithms using magnetometer data Stanislaw Goll1,2, Alexander Borisov1,2 1 Department of Information-Measuring and Biomedical Engineering, Ryazan State Radio Engineering University (RSREU), Gagarin Street, 59/1, Ryazan, Russia 2 LLC KB Avrora, Skomoroshinskaja Street 9, of.3, Ryazan, Russia Section: RESEARCH PAPER Keywords: magnetic field reconstruction; Helmholtz coil system; magnetometer calibration; closed loop control; interactive Simulink model; adaptive regulator, frequency response estimation Citation: Stanislaw Goll, Alexander Borisov, Interactive model of magnetic field reconstruction stand for mobile robot navigation algorithms debugging which use magnetometer data, Acta IMEKO, vol. 8, no. 4, article 9, December 2019, identifier: IMEKO-ACTA-08 (2019)-04-09 Editor: Yvan Baudoin, International CBRNE Institute, Belgium Received November 23, 2018; In final form April 18, 2019; Published December 2019 Copyright: This is an open-access article distributed under the terms of the Creative Commons Attribution 3.0 License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original author and source are credited. Corresponding author: Stanislaw Goll, e-mail: likvon@list.ru 1. INTRODUCTION Simultaneous localization and mapping (SLAM), based on magnetometer data, is a rapidly growing field in robotics [1]-[8]. The unperturbed natural Earth’s Magnetic Field (EMF) is used to determine the orientation of the mobile robot, and local anomalies i.e. disturbances of the EMF are used as features for positioning and navigation algorithms [4], [6]. Magnetometer data-based algorithms and methods for navigation and mapping are relevant both for indoor usage and usage in urban environments. Such areas have many objects that perturb the EMF, which is expected to be homogeneous and stable in the mobile robots’ operation areas. Modern research has created systems for building maps of the magnetic environment along with maps based on data from LiDARs and cameras. To build a map of the magnetic environment, single- or multi-axis magnetometers are used. They can be combined into magnetometer systems and integrated into the exterior receptive sensor system of the mobile robot. Even a carefully calibrated magnetometer system combined with accelerometers is subject to influences of static, folding, retractable, and other elements of the robot, as well as its flowing currents. Distortion of magnetometer estimations caused by such influence may be mitigated by algorithms based on machine learning and the use of redundant data recorded by proprioceptive mobile robot sensor systems [9]. The quality of the compensation depends on the model of formation and the propagation of disturbances. The perturbation model is created ABSTRACT An important addition to inertial navigation systems is the magnetometer. Areas with magnetic field anomalies serve to determine the reference points. However, magnetometers can be influenced by both the robot’s configuration and its electrical equipment. Compensation for the robot’s self-influence on the readings of the magnetometers is carried out by computer tools. In order to obtain the initial data, live experiments are required in a natural environment. To simplify data acquisition concerning the behaviour of the magnetometric systems of a mobile robot, a special facility that allows for the local compensation of the Earth’s magnetic field is used, and an artificial magnetic field that varies according to a predetermined algorithm is created. Using this facility, we can also simulate the magnetic field that will be present in the intended environment of the application of the robot. The facility features are a working space that is sufficient to place the mobile robot; a coil temperature drift correction; uniformity of the frequency response in operating frequency range; compensation for the power supply interference and similar disturbances; sensitivity equalisation of control channels; compensation for the misalignment of the sensor’s and coil system’s coordinate systems. An interactive Simulink model is designed and evaluated. The automated stand is created as an experimental facility, its parameters proving the proposed model’s adequacy. mailto:likvon@list.ru ACTA IMEKO | www.imeko.org December 2019 | Volume 8 | Number 4 | 48 in a special environment known as ‘magnetic silence’, which significantly excludes sources of influences that are external to the robot, such as indoor engineering networks, specifically the power supply. Even influences from reinforced concrete beams and a metal-coated floor may be significant. For the model evaluation in [9], the authors were obliged to build an experimental site in the Utah desert. 2. MAGNETOMETERS CALIBRATION STAND It is common practice to calibrate magnetometers using facilities based on the Helmholtz coil system (or some similar coil system) and functional generators. These facilities can form an artificial magnetic field (MF) that is comparable with EMF. This homogeneous MF can be constant or variable according to a given function and may simultaneously mitigate the EMF as well as its perturbations of both an anthropogenic nature and magnetic storms. The control channel is implemented, both open [10]-[12] and closed [13]. The authors used this approach to design an automated stand for magnetic field reconstruction, aiming to solve the problem of determining perturbations caused by mobile robot elements. A mobile robot is placed in the test zone of a three- component contour system, where a series of experiments is performed. During these experiments, the robot’s executive subsystems operate in various modes. The reproducible MF is either constant or variable according to the specified function e.g. simulating the rotations of a mobile robot. The pre- recorded set of magnetic induction vectors serves as a training set for designing and evaluating various models that are invariant to the self-influence of the robot. The stand can also be used to debug and benchmark magnetic-based feature extraction algorithms. First, the changes in the magnetic field vector are recorded by the precision three-axis magnetometer during the robot’s normal operation. Second, the robot is placed inside the contour system, and the recorded data is played back to debug and verify the algorithms. Most emergency mobile robots can fit into a space of about 1 m3. However, we encountered several problems while building a coil system with such test zones. The current transmission coefficient decreases with the increase in the test site space. To mitigate this issue, we increased the number of coil turns. That caused an increase in the inductance of the coils and the narrowing of the operating frequency range. Increasing the control currents, in turn, requires non-trivial solutions for their formation, preserving low levels of interference. Furthermore, changes in currents caused by temperature drift of the coil resistance cannot be ignored in this case. This leads to deviations of the MF, with the magnitude comparable to that of the EMF. The MF stabilisation in the test site space is impossible without a closed loop system. Feedback can be realised either with a separate MF sensor or with the robot’s onboard sensor. The coaxial arrangement of the sensor and the Helmholtz coil circuit system also ensures the correct operation of the closed loop control system. The mechanical arrangement of the coordinate systems cannot be sufficiently accurate because mobile robots are usually not equipped with tools for precise orientation estimation. In addition, in a sequence of experiments, a robot is not always installed in a similar way; rather, it takes many different positions. The residual misalignment should be mitigated by the program setting of the test site. 3. AUTOMATED STAND MODEL Let us dwell on the problem of stabilising the MF in the test site space. To solve it, one must compensate for the misalignment of the coordinate systems of the sensor and the contour system as well as eliminate the power supply interferences and the influence of the temperature drift of the ring resistance. The proposed solution is explained using the Simulink model, which is a convenient interactive verification tool. The model of the automated stand for the reconstruction of the MF is shown in Figure 1(a). The Rings block defines the model of the contour system as a transmission function ( ) 1.4406 W s 0.0008s 0.8 = + for each reproducing channel. This transmission function is obtained as a result of identification of a real Helmholtz coil with a diameter of 2 m, with seven turns of copper wire and a cross- sectional area of 2 mm2. The Mul1 block determines the differences in the current transmission coefficients of the coils by multiplying the input signals by the matrix 0.9 0 0 M 0 1.0 0 0 0 1.1     =      . The translation factors here are chosen for demonstration purposes. The Sensor module simulates the transmission function of a three-component magnetic induction transducer ( ) 2 2 1 H s 0.000514 s 0.0019s 1 = + + for each of the channels ( )H s . Function ( )H s is an estimate of the transmission function of the serial sensor HB0302.61A, which was used during the experiments. The time step of the measurement data is 1 ms and is defined by the Zero-Order Hold block. It should be noted that the sampling interval of the entire Simulink model is 50 µs; therefore, the channel for reproducing the MF is 20 times faster than the measuring channel. The signals of the magnetic induction vector T x y zB B B   assigned for reproduction are combined by the Mux block into a vector signal; therefore, all other signals of the Simulink model have three components. The RM1 block specifies the misalignment of the coordinate systems of the contour system and the magnetic induction sensor. This is done by multiplying the vector of coil currents T x y zI I I   by the rotation matrix 0.9998 0.0118 0.0146 R 0.01 0.9933 0.1152 0.0158 0.115 0.9932 −    =    − −  . The settings of the rotation matrix are based on the rotation of the MF sensor’s reference system in relation to ψ= π 23− , 27θ=π , 25φ=π in the z x z− − order. Identification of this matrix in practice is performed using the formula ( ) 1 T T R DS SS − = , where D is the matrix of N test current vectors sequentially fed to the contour system, S is the corresponding matrix of the components of the magnetic induction vectors measured by the sensor T x y zB B B   . For an accurate estimation of R , it is necessary to reproduce ACTA IMEKO | www.imeko.org December 2019 | Volume 8 | Number 4 | 49 currents close to the borders of the ranges of the test MF, without causing saturation of the coils with respect to the current. It is necessary to take into account the displacement of the dynamic ranges of the channels by the magnetic induction, which is connected with the presence of a constant EMF in the region of system installation. The main feedback loop for the MF sensor closes on Sum1. Before the input signal reaches that block, it is multiplied by the matrix T R , called R in Simulink notation. This multiplication is done by the blocks RM2. These blocks are designed to compensate the misalignment of the axes of the sensor and the contour system. The difference signal from Sum1 is fed to the regulator Reg1 with a transmission function ( ) 0.2043z 0.1883 V z z 1 − = − . Its amplification factor is interactively tuned with the K_gain1 block. In addition to the K_gain1 block, there are also Amplitude, K_int, Ph, Amp, K_gain2, Temp and B0 interactive tuning blocks. All are built using the standard Slider Gain Simulink block. The background MF level and its perturbations are interactively set by the B0 block and then added by Sum4 block to the field created by the coil system. The Sum5 block introduces changes in the MF inside of the coil system, which are caused by the power supply interference. It is a 50 Hz sine wave, set by the Sin block with interactively arranged amplitude (Amp block) and phase (Ph block). The main feedback loop compensates for the constant or slowly changing external MF, but it does not satisfactorily mitigate the power supply interference. For that reason, another feedback loop was introduced with the regulator Reg2, built as a modification of the adaptive rejection filter for suppressing this interference [14]. The regulator’s structure is represented in Figure 1(b). The additive mixture of the useful signal and the power supply interference from the main feedback loop output is fed to the input of the adaptive regulator Reg2. The reference 50 Hz sine wave is generated by the Sin generator with a 50 µs sampling interval of the Simulink model. The reference signal with a delay of 100 sampling intervals, created by the Delay a b Figure 1. (a) Simulink model of the automated stand for the reconstruction of the magnetic field. (b) The structure of the adaptive regulator Reg2. ACTA IMEKO | www.imeko.org December 2019 | Volume 8 | Number 4 | 50 block, is converted into a 90 phase shifted signal. The reference signal and its shifted copy are multiplied with the input signal of the regulator Reg2, and the results are fed to the digital integrators Integrator1 and Integrator2. The corresponding integration results are weight coefficients of the adaptive regulator. The weighted reference signal and its shifted copy are summed, resulting in the regulator output, which is subtracted from the output signal of the main regulator Reg1. Adjustable weighting values allow changing the reference signal in amplitude and phase, thus obtaining the necessary signal characteristics to suppress the power supply interference. To change the speed of adaptation, Amplitude and K_int blocks can be used. The former is used to interactively adjust the amplitude of the reference sine wave. The latter adjusts the integration factor, which is the same for both Integrator1 and Integrator2. The temperature stabilisation loop includes system blocks associated with Helmholtz coil’s currents generation. The output, which contains coil currents for each of the spatial axes, is converted with the scale factor defined by the Mul2 block and then fed to the summation point Sum3. The signal compensating for the power supply interference also enters at this point. The feedback transfer ratio depends on the parameters of the coils and the electronics of the regulated current source, so it must be selected during the initial system calibration. The regulator Reg3 in the direct transfer circuit eliminates the residual steady-state error of the control channels, and the block K_gain2 allows for an interactive change of the parameters of the current generating unit. The temperature error is modelled by the interactive Temp block and is calculated using the current signals of the loop system. Figure 2 shows the results obtained at points 1, 2, 3, and 4 of the Simulink model. For effective demonstration of the proposed solution, let us designate three sawtooth signals offset from each other as changes in the component of the magnetic induction vector (point 1). The signals at point 2 describe the field formed by the Helmholtz coils. The graphs at point 3 show the result of the superposition of the field being formed and the local magnetic field and its perturbations. At time t 0.25= s, the amplitude and phase of the sine wave of the power supply interference are abruptly changed, and at time t 8.75= s, the level of the background MF is abruptly changed. Transient processes caused by these disturbances, are shown in the graph of field reproduced by the stand (Figure 2, point 3) and the graph of superposition of this field and perturbations at the sensor output (Figure 2, point 4). The system needed 10 ms to adapt to a new external field and 3.5 s to eliminate the power supply interference. Transient processes caused by an abrupt increase in the coil’s temperature are shown in Figure 2, point 3 at 9.25 s. System stabilisation took around 5 ms. At point 4, the temperature disturbance is imperceptible due to the sensor sampling rate. Such experimental conditions are stressful and not used in practice; for that reason, the values obtained can be considered sufficient for solving the designated tasks. The restored parallelism of the sawtooth signals at point 3 indicates that the compensation for the misalignment of the sensor, and the contour system was successfully performed. The resulting MF magnitude, which is shown at point 3, is equal to the programmed one (point 1). 4. AUTOMATED STAND IMPLEMENTATION The automated stand for the MF reconstruction, which was made as an experimental facility, is presented in Figure 3. Its performance proves the proposed Simulink model’s adequacy. 1 2 3 4 1 4 2 0 6 0 2 3 4 5 6 7 98 10 1 4 2 0 6 0 2 3 4 5 6 7 98 10 1 4 2 0 6 0 2 3 4 5 6 7 98 10 1 4 2 0 6 0 2 3 4 5 6 7 98 10 4 10 4 10 4 10 4 10 Figure 2. Signals at points 1, 2, 3 and 4 of the Simulink model. X-axes in seconds, Y-axes in nanotesla. ACTA IMEKO | www.imeko.org December 2019 | Volume 8 | Number 4 | 51 Due to the small number of independent variables in the model, it is possible to interactively tune the regulators’ parameters instead of using predefined constant close-to- optimal values, which should be estimated analytically beforehand. Operation of the model is preferred due to the wide variety of mobile robots and magnetometers used. The automated stand is used to experimentally evaluate the robot’s self-influence on its magnetometer system. For that, we chose a method similar to that shown in [9], where the process of compensation for the robot’s self-influence is described. According to [9], the system-immanent self-influence can be either static or dynamic. The main sources of such distortions are changes in motor currents and changes in the configuration of the robot and its parts, since they also modify the robot’s magnetic field. This, in turn, causes deviations in readings of onboard magnetometers. These readings, however, are used to describe the uniform magnetic field. Moreover, the position of the magnetometer relative to the robot can also cause deviations in sensor readings. To compensate for these deviations, in [9], the authors used a neural network based on the dependency between the deviations and the corresponding self-influences. However, to create a training set for such network, one needs a magnetic field that is as close to uniform as possible. In [9], the Utah desert was chosen as one. In this article, we have aimed to create a uniform magnetic field with the automated stand and to use changes in coil currents as the desired magnetometer deviations for the training set, since these changes are proportional to the deviations in magnetometer readings. The experimental procedure, consisting of several stages, is shown in Figure 4. During the first stage, a reference magnetic field (Figure 4, black arrows) is created inside of the contour system. The onboard magnetometer, at this point, is considered a part of the stand and is placed into the feedback loop. The contour system currents are considered to be reference ones. During the second stage, a mobile robot is placed inside the contour system. The same magnetometer, which is now mounted on the robot, is again used in the feedback loop. The distortions caused by static self-influence of the robot lead to changes in the contour system’s coil currents. The difference between the reference and the present currents is used to form the training set for the static self-influence compensation algorithm. During the third stage, all the robot’s subsystems are turned on. That causes additional distortions, which are compensated for using the same onboard magnetometer placed in the feedback loop. The difference between the reference and the present currents is used again to form the training set. Based on this set, both static and dynamic system-immanent distortions can be mitigated. Another use case of the stand is the determination of the frequency characteristics of the magnetometers. After transmitting a test sinusoidal signal with a linear frequency modulation to the coil system and simultaneously maintaining the specified amplitude of the coil currents, the unit will perceive all the frequency properties of the Sensor block. The process of generating the frequency response of the system is shown in Figure 5. In Figure 5, we demonstrate the response of the system to a linear FM impact at points 2 and 4. The frequency characteristic of the magnetometer is determined by the correlation of the signal envelopes at points 2 and 4. The graphs in Figure 5(a) illustrate the influence of an adaptive regulator, which eliminates power circuit noise on the response of the system. The work of the regulator distorts the recorded (a) (b) Figure 3. Automated stand for magnetic field reproduction. (a) A three-component system of Helmholtz coils. (b) A control block. I II III – magnetometer – mobile robot with moving parts – reference state – static disturbances – both static and dynamic disturbances Figure 4. The experimental procedure for the training set creation. ACTA IMEKO | www.imeko.org December 2019 | Volume 8 | Number 4 | 52 response, which is clearly evident at 50 s of the simulation process. It is possible to eliminate the influence of adaptive regulator by holding the characteristics of compensating signal (fed on the input of a summation point Sum3) fixed for the whole period of estimating the frequency response of the system. The graphs in Figure 5(b) illustrate the response of the system to a linear FM impact with a ‘frozen’ compensating signal. 5. FUTURE WORKS In future developments, all components of the system (i.e. the interactive model, the supporting software, and the hardware of the stand) will be improved. The work will be focused on the three main topics enumerated below. First, it is necessary to establish a procedure for both the automated calibration of the stand and the formation matrices R and M . Second, the interactive model will be used to create procedures for estimating the residual nonorthogonality of a Helmholtz coil circuit system, which could be used later to precisely form the artificial magnetic field. Third, it is important to analytically estimate the adaptive regulator’s influence on the estimation of the magnetometer’s frequency characteristics. With this information, we can estimate the frequency characteristics of magnetometers without changing the working mode of the automated stand. REFERENCES [1] A. Solin, M. Kok, N. Wahlström, T. B. Schön, Modeling and interpolation of the ambient magnetic field by gaussian processes. CoRR abs/1509.04634 (2015). [2] J. Haverinen, A. Kemppainen, Global indoor self-localization based on the ambient magnetic field. Robotics and Autonomous Systems 57(10) (2009) pp. 1028-1035. [3] I. Vallivaara, J. Haverinen, A. Kemppainen, J. Röning, ‘Magnetic field-based SLAM method for solving the localization problem in mobile robot floor-cleaning task’, Proc. of the 15th IEEE International Conference on Advanced Robotics: New Boundaries for Robotics, ICAR 2011, 20-23 June 2011, Tallinn, Estonia, pp. 198-203. [4] M. Angermann, M. Frassl, M. Doniec, B. J. Julian, P. Robertson, ‘Characterization of the indoor magnetic field for applications in localization and mapping’, Proc. of the IEEE International Conference on Indoor Positioning and Indoor Navigation, IPIN 2012, 13-15 November 2012, Sydney, Australia, pp. 1-9. [5] E. L. Grand, S. Thrun, ‘3-axis magnetic field mapping and fusion for indoor localization’, Proc. of the IEEE International Conference on Multisensor Fusion and Integration for Intelligent Systems, MFI 2012, 13-15 September 2012, Hamburg, Germany, pp. 358-364. [6] M. Frassl, M. Angermann, M. Lichtenstern, P. Robertson, B. J. Julian, M. Doniec, ‘Magnetic maps of indoor environments for precise localization of legged and non-legged locomotion’, 2 4 2 4 a b 4 10 4 10 4 10 4 10 0 -2 -4 -6 2 4 6 0 -2 -4 -6 2 4 6 0 -2 -4 -6 2 4 6 0 -2 -4 -6 2 4 6 0 10 20 30 40 60 7050 80 90 100 0 10 20 30 40 60 7050 80 90 100 0 10 20 30 40 60 7050 80 90 100 0 10 20 30 40 60 7050 80 90 100 Figure 5. Responses to the linear frequency modulated signal. (a) Response with the activated adaptive regulator: left – coil system response, right – sensor data. (b) The adaptive regulator’s output signal is ‘frozen’ before the linear FM generation. X-axis in seconds, Y-axis in nanotesla. Frequency sweep – 1 Hz/s. ACTA IMEKO | www.imeko.org December 2019 | Volume 8 | Number 4 | 53 Proc. of the IEEE/RSJ International Conference on Intelligent Robots and Systems, 3-7 November 2013, Tokyo, Japan, pp. 913-920. [7] N. Lee, S. Ahn, D. Han, AMID: accurate magnetic indoor localization using deep learning. Sensors 18(5) (2018) p. 1598. [8] A. Kemppainen, I. Vallivaara, J. Röning, ‘Magnetic field SLAM exploration: Frequency domain gaussian processes and informative route planning’, Proc. of the IEEE European Conference on Mobile Robots, ECMR 2015, 2-4 September 2015, Lincoln, United Kingdom, pp. 1-7. [9] L. Christensen, M. M. Krell, F. Kirchner, ‘Learning magnetic field distortion compensation for robotic systems’, Proc. of the IEEE/RSJ International Conference on Intelligent Robots and Systems, IROS 2017, 24-28 September 2017, Vancouver, BC, Canada, pp. 3516-3521. [10] S. Roman, S. Jacek, B. Adam, K. Rafal, S. Marcin, Testing of the three axis magnetometers for measurements of the earth magnetic field. Journal of Automation, Mobile Robotics and Intelligent Systems 3(4) (2009) pp. 96-98. [11] P. Mahavarkar, J. John, V. Dhapre, V. Dongre, S. Labde, Tri- axial square Helmholtz coil system at the Alibag Magnetic Observatory: upgraded to a magnetic sensor calibration facility. Geoscientific Instrumentation, Methods and Data Systems 7 (2018) pp. 143-149. [12] C. F. de Melo, R. L. Araújo, L. M. Ardjomand, N. S. R. Quoirin, M. Ikeda, A. A. Costa, Calibration of low frequency magnetic field meters using a Helmholtz coil Measurement 42 (2009) pp. 1330-1334. [13] A. R. Alvarez, E. F. Mejía, H. C. Ramírez, C. P. Jaramillo, A simple geomagnetic field compensation system for uniform magnetic field applications. Revista Facultad de Ingeniería 0(83) (2017) pp. 65-71. [14] B. Widrow, S. Stearns, Adaptive Signal Processing. Prentice Hall, Englewood Cliffs, NJ, 1985.