Designing Airgap-Stable Magnetic Linear Position Systems

This work addresses the topic of magnetic linear position detection, a common method used in modern industries to determine linear displacement by magnetic means. One major shortcoming of this method is the inherent airgap instability, which puts strong constraints on mechanical construction tolerances and limits resolution and sensitivity. We propose a method to improve the airgap stability by adding a second magnet, which makes the field and by extension the system output (locally) independent of the distance from the source. It is shown that the measurement error for 1-D systems can be reduced by a factor of ~14 and for 2-D systems by a factor of ~5 by application of this method for a realistic example.


I. INTRODUCTION
M AGNETIC position and orientation detection systems determine the relative motion of mechanical parts. A permanent magnet is mounted on one part and a magnetic field sensor on the other, so that the relative motion can be calculated from the modulation of the magnetic field. In this way, depending on the requirements of the application, 1-D [1], [2], 2-D [3] translations, rotations [4]- [7] or even the combination of translation and rotation [8]- [10] can be measured. Such sensor systems are widely used in modern industrial applications due to their excellent properties in terms of cost, robustness, and non-contact. An overview to the variety of different types of magnetic sensors and their measuring methods is given in [11]- [14] and it is furthermore described for which applications they can be used in terms of field amplitudes [13], [14]. Sophisticated magnetic sensing ideas based on optical fibers with magnetic nanoparticles or flexible piezoelectric techniques have been explored in this context [15], [16]. With the clever implementation of one or more magnetic sensors, new opportunities are constantly opening up, such as magnet-based joysticks [10], space applications [17], geophysical studies on smartphone applications [18], permanent magnet motors [19] and have begun to replace existing mechanical, electronic and optical technologies. Today, there are more than 100 applications for magnetic position sensor systems in the automotive sector alone [20]- [22].
Magnetic linear position sensing is one common representative, with prominent applications like automotive shift forks, gas and brake pedals, detection of shifting shafts, flexible arms, lifting systems, in the gearbox, and many others. In this case, a permanent magnet moves along a straight line with a sensor mounted centrally above in a distance g termed the airgap. The range of the system is given by the stroke s with the magnet Manuscript [26] by different sensor alignments and improved magnet shapes.
The magnetic field at the position of the sensor is given by B(x) and the sensor output β(B) is assumed to be proportional to it, β ∝ B, which is characteristic for the commonly used linear Hall sensors. The system output signal ζ(β) is determined from the sensor output and the position is calculated from it For a typical linear position system, based on the magnet configuration from Fig. 1(c), the field B(x) is shown in Fig. 1 If only a 1-D sensor is available, it must detect B odd for a linear and unique relation between position and output The potential range of such a system is then given by the central, monotonous linear part of the curve. A more sophisticated scheme can be used with a 2-D sensor where atan 2 denotes the common two-argument arctangent function (see [25]). While the 2-D method features a higher level of signal stability, precision, and measurement range when compared to the 1-D counterpart, the latter is still used for its cost-efficiency. Any 1-D or 2-D sensor can be used to measure the field components [12], however, in industrial applications where moderate precision is sufficient, Hall-type sensors are a common choice [20]. Finally, a sensor system is characterized by its sensitivity S. It is given by the change of the system output with variation A more detailed analysis of 1-D and 2-D sensing schemes, sensors, and systems can be found in [25] and [27]. In Table I below, we show a list of system parameters and their typical sizes for state-of-the-art Hall-based industrial linear position systems.
II. PROBLEM Linear magnetic position sensor systems are currently used in many different applications and have been analyzed and improved in the past with respect to their functionality and cost optimization [23]- [27]. However, one of their major still unsolved problems is their inherent instability to airgap variations g. Industrial and automotive systems are only competitive if they are cost-efficient and fabrication tolerances are expensive to control. In automotive shift-fork systems airgap variations of up to ±20% are common. Such variations are usually calibrated out in an end-of-the-line process which ultimately results in large variations of the sensitivity. In addition, dynamic airgap variations of few percent over lifetime and during system operation must also be accounted for.
The sketch in Fig. 2 shows how an airgap variation leads to a inaccurate output signal ζ(x 0 , z) instead of ζ(x 0 , g), which further results in a wrong position estimation x 0 for the real position x 0 . In first order, the position error x := x 0 − x 0 , which results from airgap variation, is directly connected to the system output error ζ := ζ(x 0 , g) − ζ(x 0 , z) through the nominal sensitivity S(x 0 , g). We can therefore write Fig. 2. Sketch of the system response. The airgap variation leads to a measurement error x, which is determined by ζ and the local slope S(x 0 , g) of the function ζ(x, g). at position x 0 . For convenience we have expressed everything through z, which is connected to the airgap variation through To demonstrate the effects of airgap variations, we show the magnetic field of the example system from Section I for different airgaps in Fig. 3(a). The maximal position error s] x(x 0 , z) as a function of the airgap variation g is given in Fig. 3(b) for s = 5 mm. The inherent higher stability of the 2-D scheme is clearly visible. The reason for this observation is that the system output signal of a 2-D sensor expression (3) contains the ratio of β odd and β eve and is independent of the amplitude of the measured magnetic field, which strongly depends on the airgap. However, since not only the amplitude but also the field angle varies as a function of the airgap, a small deviation remains in the 2-D system. In contrast, the output of the 1-D system (2) suffers drastically from the varying field amplitude.

III. PROPOSAL
To improve airgap stability in linear position systems, we propose to make the magnetic field B(x, z) or rather the system output ζ(x, z) locally independent of the airgap by combining the fields of several simple magnets in the spirit of [25], [28]. A sketch of the main idea is outlined in Fig. 4. There, the quick decay of the magnetic field of a small, close magnet is superposed with the slow decay of a large, distant magnet with reversed magnetization. By suitable arrangement of the two magnets (or magnet systems) we can achieve stationary points z s of the field components in airgap direction, dB/dz(x, z s ) = 0. Ideally, this is achieved for both components simultaneously and all positions x so that the system output becomes locally airgap independent dζ dz The system output error is closely connected to the derivative of ζ in z-direction  so that property (6) translates directly to the position error (5).
Note that stationary points of field B are sufficient, but in the 2-D case not necessary for the desired stationary points of the system output ζ . While it is difficult to achieve stationarity for all positions x at the same time, it is enough to sample the "low slope area" near z s to improve stability [see Fig. 4(b)].

IV. METHOD
We compare 1-magnet (state-of-the-art) and 2-magnet (proposal) systems with 1-D and 2-D sensors, respectively. For good magnetic stability the 2-magnet system is constructed as indicated in Fig. 5 with magnet dimensions  a 1 , b 1 , c 1 , a 2 , b 2 , c 2 and distance d. This work is based on a multivariate optimization of these magnet system parameters to reduce the position error as much as possible. For comparison with optimal 1-magnet systems a similar optimization with a 1 = b 1 = c 1 = 0 is performed.
One must take care in the optimization process that the sensitivity does not tend to small or even negative values. This would violate the fundamental requirement that the system output ζ is a bijective map of the observable of interest.

A. Cost Function
The optimal system is found by global minimization of a cost function F which expresses the desired system qualities. We choose a weighted position error introducing the Gaussian weight function w(z) with μ = g and σ = g/3 to account for realistic stochastic deviations of industrial systems. A corresponding cost function can then be defined as the maximal weighted position error over the whole range At the same time, the quality of a sensor system is strongly related to its sensitivity (4) which can be represented through another cost function F s that could, for example, be given by the minimal sensitivity over the whole range. A total cost function F can then be written as a convex combination of these two terms, i.e., with λ ∈ [0, 1]. Minimization of F leads to minimized position error and maximized sensitivity at the same time, where λ specifies the balance between F p and F s . In this work, we set λ = 0 and neglect the sensitivity term F s because the sensitivity must always be related to sensor resolution and noise behavior and we do not want to focus on one specific sensor type.

B. Scaling Invariance
A system where the sources are only ideal hard magnets is invariant with respect to the scaling of the spatial dimensions. This means that transformations of the form with k 1 > 0 on the whole system (i.e., stroke, airgap, magnet dimensions) result in the same magnetic field at the scaled sensor position. Furthermore, the scaling of the magnetization amplitude 12) has no influence on the optimization problem, as the fields are directly proportional to it, |B| ∝ M.
The optimization is independent of the scaling, i.e., for different system sizes and materials the same optimum solution is found up to the scaling factor k 1 for geometric parameters and k 2 for field and magnetization. With (11) and (12) we can define a characteristic length l 0 and magnetic field M 0 and express all spatial variables, magnetizations and fields as dimensionless multiples of these parameters. Eventually, l 0 and M 0 can be used after solving the optimization problem, to set a system size and a material for practical applications.

C. Reasonable System Constraints
When dealing with realistic problems the end-user has specific requirements which must be included in the optimization process. These "reasonable system constraints" include: 1) the detection range or length of the stroke s; 2) the airgap g and airgap tolerance g; 3) a required resolution given by choice of sensor and sensitivity S; 4) the construction space with maximal magnet system dimensions x max , y max , z max typically limited to ∼s; 5) the construction costs reflected in magnet volume V and magnetic material (magnetization M). For our demonstration in Section V we choose l 0 = 1 mm, μ 0 M 0 = 1 mT and a set of reasonable constraints in Table II that reflect standard system parameters for a linear position system.

D. Simulation Method
The fields are calculated by an analytical method using the magpylib package [29] which is based on the expressions from [30]- [32]. The speed of the analytical solution (effective sub-microsecond computation times) enables highly efficient multivariate parameter variation which is not feasible with  II  REALISTIC SYSTEM PARAMETERS AND CONSTRAINTS   TABLE III  BOUNDS AND OPTIMIZATION RESULTS OF THE MAGNET SYSTEM   PARAMETERS SHOWN IN FIG. 5   TABLE IV SENSITIVITY S(0, g) FOR ALL CONFIGURATIONS common numerical methods like finite element (FE) or boundary element (BE). The error of the analytical solution is below 1% field amplitude and 1 • angle for magnet L/D ratios of the order of 1 (cubical magnet dimensions) when compared to FE results of hard magnets with linear demagnetization slopes of μ r < 1.05 [10].

V. RESULTS
The optimization procedure described in Section IV is carried out to find optimal configurations for 1-D and 2-D systems with one or two magnets. Optimization bounds and results are given in Table III. For each of the four cases, the resulting sensor output is shown in Fig. 6. Two effects can be observed there: On the positive side, the 2-magnet systems show increasing airgap stability confirming the original proposal. However, one has to pay for this stability with reduced field amplitudes and sensitivities. This is directly visible in the figures and is given quantitatively in Table IV. In Fig. 7 we shown the actual position error of the sensor output x as a function of the position x and the airgap variation g. The lower level of position error within the working area (10 mm × 2 mm rectangle in the figure) is clearly visible.
Finally, we compare the weighted position error x(x 0 ) from (8) as well as the maximal position error x(x 0 , z) for z ∈ [g − g, g + g] for all four configurations in Fig. 8(a) and (b). The 2-magnet systems are visibly improved over their 1-magnet counterparts.
VI. DISCUSSION AND OUTLOOK In this article we show how to design an airgap stable linear position sensor system by adding a second magnet which stabilizes the field. Here stabilization means a reduction of the position error resulting from airgap variation. It was shown that the proposed method works for both, 1-D and 2-D sensor systems. For our model problem with airgap variation of   ±1 mm, 5 mm nominal airgap and a range of 10 mm, this can lead to a reduction of the maximal weighted position error by a factor of ∼14 for 1-D systems and by a factor of ∼5 for 2-D systems within our chosen system requirements. It must be noted that these factors depend on the chosen system. Further improvements are possible which is also visible in Table III by the fact that the optimization returns boundary values. In general, we find that position error reduction by one order of magnitude in 1-D and a factor of 3-5 in 2-D is easily achieved for the typical linear position systems outlined in Table I.
The major downside of the proposed method is the reduction of field amplitude, which translates directly to the sensitivity and potential resolution. However, our results are just a proof of principle where we have demonstrated a novel airgap stabilization mechanism for magnetic systems. With additional constraints and the choice λ > 0 in (10), the balance between stability and field amplitudes can be adjusted at will.
While the proposed method is based on only two cuboid magnets, it is easily extended to more complex magnet structures as proposed in [25]. With the chosen spatial dimensions, we have investigated realistic size relationships in applications. Moreover, as mentioned in Section IV-B, the computation is scale invariant, so that other airgaps can be covered by simultaneously adjusting the magnet dimensions. The fundamental concept of stationary points in the magnetic field profile can of course be applied to other length ratios, magnet shapes, component alignments, etc. as well Finally, we note that the odd component of a single magnet's field already has natural stationary points with a high level of airgap stability. However, these extrema lie very close to the magnet surface (assuming cuboids) so that if the system is scaled up to achieve desired airgaps, the magnet size exceeds our reasonable system constraints. Further investigation and exploitation of this effect is planned.

VII. CONCLUSION
Linear positioning systems are state of the art in many technical applications. Since they are mass-produced, the industrial requirements for them are mainly cost efficiency and robustness. With the idea of adding a small second magnet to the system, we could show that the common problem of airgap variation due to mechanical tolerances during installation can be massively reduced. Our approach shows how such a problem can be formulated, studied and solved as a mathematical optimization problem. The authors believe that potential further improvements to magnetic sensor systems can be studied in an analogous manner.