Magnetic CubesCollocated Coils as Sensors for Displacement Positioning

NENAD S. JOVIČIĆ, University of Belgrade, Professional paper School of Electrical Engineering, Belgrade UDC: 681.586.7 MILICA D. ĐURIĆ-JOVIČIĆ, University of Belgrade, DOI: 10.5937/tehnika1505828J Innovation Center, School of Electrical Engineering, Belgrade AGNES ROBY-BRAMI, Université Pierre et Marie Curie, Institut des Systèmes Intelligents et de Robotique, Paris, France, MIRJANA B. POPOVIĆ, University of Belgrade, School of Electrical Engineering, Belgrade, Serbia, ANTONIJE R. ĐORĐEVIĆ, University of Belgrade, School of Electrical Engineering, Belgrade, Serbian Academy of Sciences and Arts


INTRODUCTION
We describe the design and verification of a magnetic tracking system for evaluating the relative position and orientation of two objects (displacement positioning).
Magnetic tracking is a technology applicable for short-range localization.It is used widely in biomedical [1][2][3] and other applications [4], which include proximity of the human body.The main advantage of this technology is no need for line-of-site visibility.The main disadvantage is high susceptibility to distortion from nearby metal and ferromagnetic objects, as well as limited range.The limited range can, however, be advantageous in some cases to reduce interference to/from nearby equipment or other concurrently operating magnetic systems.By the principle of operation, the magnetic localization systems are divided into three groups: AC systems, which are based on active AC-coupled magnetic receivers and transmitters [5], DC systems, which are driven by quasistatic direct currents [6], and passive systems, which use permanent magnets as transmitters [7].
The main difference between the AC and DC systems lies in their behavior when metallic objects are in close proximity to either transmitter or receiver.In the case of the AC systems, eddy currents are induced in nearby metallic objects, while in the case of DC systems, the natural magnetic field of the Earth is superimposed to artificially generated magnetic fields.
In general, all active systems consist of several orthogonal coils for receiving and transmitting.One of the first implementations of the AC coupled systems is Polhemus [5].This basic system consists of two sets of coils, which emit and receive signals in the frequency range of (8-14) kHz.Each set has three collocated coils [8], placed in orthogonal planes.The coupling among the collocated coils is low [9].One set of coils (the transmitter) is energized by calibrated timevarying currents, and the other set of coils (receiver) senses the magnetic field produced by these currents.
The receiver can mimic an isotropic sensor by combining the detected signals, which is the standard procedure in measurements of magnetic fields [10].The transmitter can also mimic an isotropic source by using time-domain multiplexing.
By measuring the signals induced in the receiver, it is possible to estimate the distance from the transmitter in a straightforward manner [11].By more elaborate processing of the signals induced in the three coils, it is possible to estimate the rotation matrix that relates the two coordinate systems attached to the transmitter and receiver, respectively.
An array of such sensors may be used to estimate positions of a set of points on a human body.
There are several magnetic-based solutions described in the literature.In the magnetic sensing technology, the best known commercial systems are those offered by Polhemus [5].These systems are accurate and reliable, but very expensive and they cannot be tailored by the user.
Another solution offers explicit evaluation of distances and angles, which may be prone to errors due to noise and interferences from nearby objects [4].Finally, Song et al. described a magnetic system with a rotating coil, which is a mechanically complicated solution [12].
We have designed and developed our magnetic system, which can be modified as required by the application, in order to overcome the described problems.
The system which we propose is based on active AC-coupled magnetic receivers and transmitters, working at the frequency of 480 kHz, which uses resonant circuits as filtering elements, thus increasing the sensitivity and range.The system is verified by comparing its results with those obtained by a commercial optical system based on active markers, which is a golden standard in the motion-capture analysis.

A. Theoretical background 1) Collocated loops
By definition, an electromagnetic sensor is an electrically small electrical dipole antenna or an electrically small loop antenna (magnetic dipole), or a set of such antennas.When used for receiving (sensing) in an electromagnetic field, the output of a sensor is proportional to the corresponding component of the electric field, viz. the magnetic field.
We consider here collocated sensors [8], i.e., sensors whose centers are practically at the same point (Figure 1).More specifically, we consider three collocated loops.The loops in Figure 1 are slightly offset with respect to the coordinate origin, to avoid galvanic contact and also to reduce parasitic capacitances among the loops.We assume that the axes of the loops coincide with the axes of a local Cartesian system.Hence, each sensor "picks up" one Cartesian component of the magnetic field.Together with the Cartesian system, we observe an attached spherical coordinate system as in Figure 2.Each loop has a port (a pair of closely spaced terminals).For lower frequencies, the positions of the terminals are not critical.However, at higher frequencies, the locations of the ports must be selected with care [9] in order to minimize the parasitic coupling (cross-talk) among the loops.
When used as a receiving system, the signal induced in the first (green) loop is proportional to x H , the signal induced in the second (blue) loop is proportional to y H , and the signal induced in the third (red) loop is proportional to z H .The proportionality coefficients are equal if loops are congruent.
In more detail, according to Faraday's law, in the time-harmonic regime, the complex (phasor) emf TEHNIKA -ELEKTROTEHNIKA 64 (2015) 5 induced in a coil is , where  is the angular frequency, H is the complex magnetic field, n is the unit normal on the loop, N is the number of turns (if a multiturn coil is used instead of a simple loop), and S is the area of the flat surface (circle) bounded by the loop.For the first loop, for the second loop, and for the third loop, (3) Further, for the RMS values we have and , where H is the RMS value of H, | | H  H [11]. Hence, we have obtained an isotropic sensor, which can be used to measure the intensity (RMS) of the magnetic field, irrespective of the field polarization.The corresponding practical design is relatively simple: a detector with a square-law characteristic is attached to each loop, and the outputs of the detectors are summed.
Such isotropic sensors are used for measurement of magnetic fields [10] in the control of electromagnetic pollution, EMC testing, etc.

2) Magnetic field of a loop
If we have a known source of a time-harmonic magnetic field, by measuring the RMS of its magnetic field, it is possible to evaluate the distance between the source and the sensor.However, it is not possible to construct an isotropic source of the magnetic field, i.e., a source whose RMS field would depend only on the distance r from the source.
In more detail, any electrically small time-harmonic system of currents can be approximated by one magnetic dipole, whose complex momentum is m.In the general case, m is elliptically polarized, but it can be separated into three Cartesian components, x m , y m , and z m .Assuming a quasi-stationary regime (i.e., neglecting the retardation), and considering only one component, z m (which corresponds to the case when the red loop in Figure 1 is energized), the magneticfield vector of this dipole, at a point that is far from the loop in terms of its diameter, but not far in terms of the wavelength, is given by [11] where depends both on r and . Figure 1 shows field lines of a magnetic dipole.H is measured by a collocated system of three loops (assuming that z m is known), it is not possible to accurately evaluate the distance r because the term is not known, unless, for the given field point, we already know the zenith angle θ.The error in r introduced by the   2 cos 1 term is about % 30  (with respect to the average value).A similar analysis can be performed for the other two components, x m , y m , as well as for any linear combination of these three momentums, which yields an arbitrarily polarized vector H is nonuniform on a sphere of radius r, i.e., the magnetic-field source is anisotropic.

3) Estimation of distance
An apparently isotropic field source can be obtained by time-multiplexing.Let us consider the three loops shown in Fig. 1 H , can be evaluated from (5), by taking, instead of θ, the angle between the axis of the energized loop (x, y, viz.z) and the ray r ( x  , y  , viz.

   z
).By summing, we obtain Hence, by knowing m and having measured H , we can evaluate the distance r between the source collocated loops and the sensor collocated loops.
We shall refer to H as the apparent intensity of the magnetic field, as opposed to H, given by equation ( 5), which is the actual intensity for each particular excitation.
Note that the application of equation ( 7) requires a single calibration of the system (assuming that the coils are identical).
The time interval in which a loop is energized should be long enough so that all transients practically vanish, but short enough to be able to consider r constant if the field source and the field sensor are in relative motion.

4) Estimation of spherical angles
Let us consider a magnetic dipole of given RMS of the momentum | | m , located at the coordinate origin in Figure 1, and a field point, whose spherical coordinates are ) , , (   r , at which a sensor is located. Following the algorithm from the previous subsection, we assume to have evaluated the distance r between the source and sensor (transmitter and receiver).
A simple way to evaluate the angles of the spherical coordinate system, which define the position of the field point, follows from ( 5) and (6).The actual squared RMS of the magnetic field is where i  should be interpreted as x  , y  , viz.z  . Hence, Since i  cos is the cosine of the angle between the ray (connecting the centroid of the transmitting loops and centroid of the receiving loops) and the axis of the transmitting loop, we have now defined the direction of the ray.However, there are, generally, eight different solutions, one for each octant.To completely define the position, the ambiguity about the octants should be resolved based on some additional information.
This analytical procedure can be extended to estimate the rotation matrix of the coordinate system of the receiving loops with respect to the coordinate system of the transmitting loops.However, the practical implementation of this analytical procedure suffers from poor accuracy: various measurement errors (e.g., noise and small influence of nearby objects) can lead to prohibitively large uncertainty of the estimated angles.
Note that the human body does have an influence on the magnetic field because eddy currents are induced in the body.Also, due to the dielectric properties of the body, the wavelength is much shorter than in a vacuum.However, we have verified both by simulations and by experiments that this influence is negligible at frequencies on the order of 1 MHz.Much larger influence have metallic objects that are placed close to the loops, because eddy currents in such objects can be significant.

5) Optimization procedure
Instead of evaluating the spherical angles and the rotation matrix analytically, we use an optimization procedure, as described in this subsection.
We energize the transmitting loops one by one and measure the signals in the receiving loops.We measure both the intensities of the received signals and their phase relation with respect to the current driving the energized loop.Actually, there only two possible phase differences, which we refer to as "in phase" and "in counterphase".These differences reflect the signs in equation ( 9) and enable resolving the ambiguity about the octants.
The distance between the transmitting and receiving loops is evaluated analytically, using equation ( 7).We have a numerical simulation model of the transmitting-receiving system, based on equations (1)-( 4).Using this model, we systematically vary the two spherical angles and the elements of the rotation matrix, using the Nelder-Mead simplex optimization procedure [13], with the aim to minimize the differences between the measured and the simulated signals.More precisely, we express the rotation matrix as a product of three rotation matrices, each corresponding to a finite rotation about one Cartesian axis (for a given TEHNIKA -ELEKTROTEHNIKA 64 (2015) 5 angle).Instead of optimizing nine elements of the rotation matrix, we optimize only these three angles.
We start the Nelder-Mead optimization from a set of random points and use the best result as the final solution for the five angles.We carry on measurements in a time-stepping procedure.For each step, we repeat the optimization, using the previously obtained angles as one of the initial points for the optimization.

B. Instrumentation
The principal block diagram of the magnetic measurement system is presented in Figure 4a.

Figure 4 -(a) Principal block diagram of the Magnetic measurement system. (b) Coil activity and typical rectifier output waveform during one cycle of operation
The core of the system is a Cortex-M4 microcontroller equipped with a multichannel 5 MS/s 12-bit AD converter, 7 high-speed comparators, a USB communication interface, and timers capable of generating periodic events and PWM output signals.The transmitter side is driven by a single sine-wave generator.The signal from the generator is multiplexed to the transmitting coils through an analog multiplexer that comprises reed-relays.The reed-relays were selected because of their low impedance and relatively high operating speed.The receiver side comprises a multiplexer for the receiving coils, a triple-stage amplifier, and three precision rectifiers.The feedback circuit of the first stage of the amplifier has a ceramic resonator with a high Q-factor.It acts as a very selective band-pass filter with the pass-band gain of 40 dB and center frequency of 480 kHz.The second and third stages are pure flat-band amplifiers with a 20 dB gain.The voltage outputs of all three stages are rectified by the three independent precision rectifiers and further sampled by an AD converter integrated into the microcontroller.In order to determine the phase shift between the transmitting and receiving sine-wave signals, the outputs of all three amplifier stages are compared with the transmitter signal using integrated high-speed comparators.
The triple stage configuration of the amplifier is selected in order to cover a wide dynamic range of the signal on the receiver side.Due to the wide dynamic range, for shorter distances, the higher stages of the amplifier can exhibit saturation, while for longer distances, the outputs of the lower stages tend to be too small for a direct AD conversion.In order to overcome that problem, all three outputs are sampled simultaneously and decision about the valid range and correct value of the signal is made in the software.
Figure 4b presents waveforms of the characteristic signals during one typical cycle of operation.As it can be seen from the diagram, the transmitting and receiving coils are sequentially driven by multiplexers.Because of the high Q-factor of the receiving coils, a significant delay time td between switching of the input multiplexer and sampling of the signal must be implemented in order to avoid the transient period.On the other side, there is also some time tr needed after switching the receiving coil for relaxation of the energy stored in the feedback circuitry of the first stage of the amplifier.Finally, the time needed for the AD conversion to take place is denoted by ts.Considering all time constraints, the maximum operation frequency of the system can be evaluated as For our system, ms , and tr=1 ms, so that the maximum frequency is about 10 Hz.
The complete Magnetic Cubes System includes two cubes (side length 5 cm), each carrying three collocated coils, a set of coaxial cables, the electronic measurement system (described in the previous paragraphs), and a laptop computer with a custom-made software for acquisition and real-time monitoring of the measurement process.
An optical motion capture system with active markers (CODA cx1, Charnwood Dynamics Ltd, UK) is used as the reference system for the verification of the proposed system.
The acquisition software was designed in Lab-Windows CVI (National Instruments, USA).

C. Experimental protocol
The experimental protocol included the following: The receiving MCube (MCubeR) was firmly positioned on a wooden table, located in the centre of the laboratory, and aligned with the origin of the global reference system (defined by the camera system).The transmitting MCube (MCubeT) was fixed to a wooden board (40 cm  40 cm  1.5 cm).MCubeT was positioned in one corner of the board, and active markers were placed in the other three corners.In the initial position, the board was placed on the table.
Assessment of MCubes and their positioning estimation was verified through various types of 2D and 3D motion, all of them starting by lifting the board from the table and followed by moving it upward/downward (translation); moving it left and right (translation); changing orientation around each axis (rotation); and moving it in 3D with arbitrary movements (combined translation and rotation).
Each recording was ended in returning the board to the table.A total of 35 different movements were performed and recorded.

D. Data analysis
The signal analysis was performed in Matlab 7.7.1 (MatWorks Inc, USA).
The quality of the results is described in terms of Pearson's correlation coefficient, the absolute RMS error, and the relative RMS error between the results obtained by the two systems, averaged for all recorded files.

RESULTS
An example of an arbitrary 3D motion within the described protocol (MCubeT positioned on wooden board and moved arbitrarily in space, MCubeR stationary) is presented in Figures 5 and 6.
Figure 5 -Distance between two MCubes, obtained from magnetic sensors (red solid line) and from cameras (black dashed line) For this particular movement, comparisons of results obtained from two systems are shown in Figures 5 and 6, and Table 1.Values obtained from the magnetic sensors are plotted by red lines, while values obtained from the active markers captured by cameras are drawn by black dashed lines.
Figure 5 shows the distance between centers of the two cubes.Cartesian coordinates of the center of the moving MCube calculated by the two systems are presented in Figure 6 (one graph for each axis).
Numerical data comparing the two systems are presented in Table I.

DISCUSSION AND CONCLUSION
As illustrated in the previous section, testing and verification of the designed system showed remarkably good agreement with the reference system.For all the recorded files, the maximal RMS error for the estimation of the distance between the cube centers is 10 mm (less than 2% of the average distance), the RMS error for the estimation of the Cartesian coordinates of the two cubes is less than 40 mm (less than 7% of the average distance), whereas the RMS error for the elements of the rotation matrix is less than 0.15.The discrepancies between the results from two systems were also assessed by the Pearson correlation coefficient (greater than 0.9 for the Cartesian coordinates and greater than 0.99 for the estimation of the distances between the cubes).The accuracy of the distance estimation does not depend on the performed movement as much as it depends on the distance between the two cubes.Namely, if the distance between the cubes is too small, the cubes cannot be considered as point objects, so that the model becomes inaccurate.On the other hand, if the distance is large, signal to noise ratio deteriorates.
Our system works at substantially higher frequencies than other systems reported in the literature.This improves the sensitivity, enables higher sensing rates, and enables air coils to be used (without ferrites).Higher sensitivity means lower power and smaller and lightweight sensors.On the other hand, the implemented frequency is low enough so that the system is negligibly influenced by the presence of the human body.
Considering implementation in hardware, our solution is simple and efficient.By using the configuration of three constant-gain cascaded amplifiers and three independent rectifiers, we obtained measurements with high dynamic range.Using a ceramic resonator in the first amplifier stage produced excellent sensitivity and selectivity.The phase detection was implemented using high-speed comparators integrated in the microcontroller.A powerful integrated AD converter enabled true 12-bit resolution of measurements.
The novelty in signal processing is using the Nelder-Mead optimization algorithm to estimate six variables that define the mutual position of the two cubes.Such an approach is less prone to noise and the influence of nearby conducting objects than the explicit evaluation of these variables presented by Liu et al. [4].
After having proven the concept, various versions of the sensor system may be designed for other applications, besides those for biomedical engineering.
The next step will be to make the system wireless.The future work would also include using independent frequencies for transmission.We may improve the system by using nine independent receivers, always fully opened, thus avoiding switches and improving the sampling speed.

i
are the unit vectors of the spherical coordinate system.The squared RMS of this field,

Figure 6 -
Figure 6 -Cartesian coordinates of the center of the moving MCube, obtained from magnetic sensors (red solid line) and from cameras (black dashed line)

Table 1 .
Magnetic system vs. camera system