1.  Introduction {#sec1-sensors-17-00782}
===============

Permanent magnet tubular linear motors (PMTLM) have been the focus of significant research for the last few decades due to their high power density, small end effect and excellent dynamic performance \[[@B1-sensors-17-00782],[@B2-sensors-17-00782]\].  PMTLMs have been increasingly applied in electromagnetic launches, healthcare and other applications with strict volume restriction \[[@B2-sensors-17-00782]\]. 

Mover position detection is one of the key techniques for servo control of PMTLM, and is vital for thrust control and positioning accuracy.  In most applications, a grating scale is the most commonly used position sensor \[[@B3-sensors-17-00782],[@B4-sensors-17-00782]\].  A grating scale has the advantages of high precision, high resolution and fast response, but also suffers from shortcomings like high cost and large volume.  Furthermore, an auxiliary guide is needed for a grating scale, which restricts its application.  Some researchers have also adopted sensorless methods \[[@B5-sensors-17-00782],[@B6-sensors-17-00782],[@B7-sensors-17-00782],[@B8-sensors-17-00782],[@B9-sensors-17-00782],[@B10-sensors-17-00782]\], utilizing the voltage and current information to estimate mover position based on the electrical PMTLM model.  Sensorless methods can be divided into two categories: back-EMF-based methods and high frequency injection methods.  The former is highly dependent on electrical parameter accuracy and shows bad performance in low-speed region, while the latter introduces thrust ripple and extra loss.  Generally, sensorless methods are unfit for applications where high precision is demanded. 

As an alternative, linear Hall sensors are more and more widely used nowadays to detect mover position \[[@B11-sensors-17-00782],[@B12-sensors-17-00782],[@B13-sensors-17-00782],[@B14-sensors-17-00782],[@B15-sensors-17-00782],[@B16-sensors-17-00782],[@B17-sensors-17-00782]\].  They have merits like low cost and high robustness, and the installation is easy to implement.  Two linear Hall sensors electrically separated 90 degrees are widely adopted for both rotor angular detection and mover position detection.  Linear Hall sensors can measure varying magnetic field strength and continuously output the corresponding sine and cosine wave signals.  However, Hall sensor signals are contaminated by third-order harmonics, which are caused by air-gap magnetic distortion \[[@B18-sensors-17-00782]\].  Harmonics disrupt position detection accuracy, and should be filtered out from Hall sensor signals.  Some attempt to minimize the effect of harmonics by optimizing the installation position of Hall sensors \[[@B11-sensors-17-00782],[@B12-sensors-17-00782],[@B13-sensors-17-00782]\].  It has been found that the harmonic component is diminished as the sensors are radially away from the permanent magnet (PM), but the signal amplitude also decreases.  Others utilize signal processing methods to remove harmonics \[[@B14-sensors-17-00782],[@B15-sensors-17-00782],[@B16-sensors-17-00782],[@B17-sensors-17-00782]\].  In \[[@B14-sensors-17-00782]\], a phase-lock loop (PLL) is employed.  A PLL contains a PI-type low-pass filter, which can filter out high-order harmonics.  But the bandwidth of a PLL is small, and its performance deteriorates in low-speed regions.  To tackle this problem, an adaptive notch filter (ANF) is adopted to remove the third-order harmonics before applying a PLL \[[@B15-sensors-17-00782]\].  The notch frequency is adaptively tuned by software, so the ANF operates well even when the speed is very low.  In \[[@B16-sensors-17-00782]\], an improved ANF, i.e., a synchronous frequency extractor (SFE), is presented.  Compared with an ANF, an SFE can filter out higher order harmonics.  Therefore, the position detection error is reduced even more, as the 5th and 7th order harmonics are also removed.  Though ANF-based processing methods exhibit excellent performance in filtering out signal harmonics in all speed regions, their convergence rate and stability are not satisfactory, which could be severe problems in PMTLM application. 

In \[[@B19-sensors-17-00782],[@B20-sensors-17-00782]\], an extended Kalman filter (EKF) processing method is used to remove random errors in rotor angular detection of PMSM.  With an extremely simple form, an EKF can effectively eliminate white noise in Hall sensor signals. 

In this paper, EKF is utilized to filter out third-order harmonic components from Hall sensor signals.  The amplitude of fundamental component and the percent of harmonic component are estimated online via an EKF model.  In this way, the harmonics can be observed and removed.  Due to the merits of an EKF, both the dynamic and static accuracy of mover position detection can be greatly improved in all speed regions, while the convergence rate and stability are also guaranteed. 

[Section 2](#sec2-sensors-17-00782){ref-type="sec"} describes the implementation of mover position detection based on linear Hall sensors.  In [Section 3](#sec3-sensors-17-00782){ref-type="sec"}, the ANF processing method is described, and its stability is analyzed.  In [Section 4](#sec4-sensors-17-00782){ref-type="sec"}, EKF model is constructed, and then the idea of EKF processing is presented.  Finally, [Section 5](#sec5-sensors-17-00782){ref-type="sec"} validates the feasibility of the proposed method via experiments. 

2.  Position Detection Based on Linear Hall Sensors {#sec2-sensors-17-00782}
==================================================

Linear Hall sensors are based on the Hall Effect, and the sensor output is linear to the magnetic field strength.  As the mover transports inside the stator, the air-gap magnetic field is approximately distributed in a sine wave.  The diagram and physical map of PMTLM used for experiments are shown in [Figure 1](#sensors-17-00782-f001){ref-type="fig"} and [Figure 2](#sensors-17-00782-f002){ref-type="fig"}.  The pole pitch of PMTLM is 10 mm, and the two Hall sensors are separated by 5 mm axially so that the two sensor signals are electrically 90° apart.  The Hall sensors continuously output position-dependent sine/cosine signals, and then the mover position can be obtained by using an arctangent function, as shown in Equations (1) and (2).  $$u_{ak} = u_{mk}\sin\theta_{k},\ u_{bk} = u_{mk}\cos\theta_{k}$$ $$\begin{matrix}
{\theta_{k} = {atan}2\left( {u_{ak},u_{bk}} \right) \equiv \left\{ \begin{array}{l}
{\arctan\left( {u_{ak}/u_{bk}} \right),\ if\ u_{ak} > 0,u_{bk} \geq 0} \\
{\arctan\left( {u_{ak}/u_{bk}} \right) + \pi,\ if\ u_{bk} < 0} \\
{\arctan\left( {u_{ak}/u_{bk}} \right) + 2\pi,\ if\ u_{ak} \leq 0,u_{bk} \geq 0\ } \\
\end{array} \right.} \\ 
{x_{k} = {\left( {\tau \cdot \theta_{k}} \right)/\pi}} \\
\end{matrix}$$ where *x~k~* is mover position, *τ* is pole pitch, *u~ak~*, *u~bk~* are signals detected by Hall sensors, *u~mk~* is the amplitude of the fundamental component and *θ~k~* is the corresponding electrical angle of the mover. 

[Figure 3](#sensors-17-00782-f003){ref-type="fig"}a is a 2-D finite-element-method simulation result by Ansoft Maxwell, demonstrating the distribution of a magnetic line in air-gap.  The distribution curves of magnetic field strength at different radial distances can be seen more specifically in [Figure 3](#sensors-17-00782-f003){ref-type="fig"}b.  Obviously, the distribution curve is not a pure sine wave, and is even approximate to a triangular wave when 7 mm away from PMs, indicating that the magnetic field contains large odd-order harmonics.  As the radial distance becomes farther, the magnetic line becomes closer to a sine wave while its amplitude decreases.  Limited by the size of the motor, the two Hall sensors are installed 9 mm away from PMs in practice, producing third-order harmonic components in Hall sensor signals, as shown in Equation (3).  $$\begin{matrix}
{u_{ak} = u_{mk}\left( {\sin\theta_{k} - r_{k}\sin 3\theta_{k}} \right)} \\
{u_{bk} = u_{mk}\left( {\sin\left( {\theta_{k} + {\pi/2}} \right) - r_{k}\sin 3\left( {\theta_{k} + {\pi/2}} \right)} \right) = u_{mk}\left( {\cos\theta_{k} + r_{k}\cos 3\theta_{k}} \right)} \\
\end{matrix}$$ where *r~k~* is the percent of the third-order harmonic component. 

Therefore, the raw electrical angle ${\hat{\theta}}_{k}$ calculated by Equation (2) contains a large error, as described in Equations (4) and (5).  $${\hat{\theta}}_{k} = {atan}2\left( {u_{ak},u_{bk}} \right) = {atan}2\left( {\sin\theta_{k} - r_{k}\sin 3\theta_{k},\cos\theta_{k} + r_{k}\cos 3\theta_{k}} \right)$$ $$e_{k} = \theta_{k} - {\hat{\theta}}_{k} \approx \tan e_{k} \approx r_{k}\sin 4\theta_{k} \approx r_{k}\sin 4{\hat{\theta}}_{k}$$

Apparently, the third-order harmonics in sensor signals would introduce a fourth-order error in position detection result.  The amplitude of error is related to the percentage of the harmonic component, which could be large in some applications.  Thus, it is necessary to filter out third-order harmonics from the original sensor signals. 

3.  Analysis of ANF-Based Signal Processing {#sec3-sensors-17-00782}
==========================================

In order to eliminate harmonics in Hall sensor signals, \[[@B15-sensors-17-00782]\] proposed a signal processing procedure based on ANF, and an improved ANF is presented in \[[@B16-sensors-17-00782]\].  To the best of the author's knowledge, ANF remains one of the most effective signal processing methods to filter out harmonics.  ANF is a notch filter that is constructed by a closed loop, and can operate well even in a low-speed region.  In this section, its performance will be discussed. 

The simplified diagram of ANF processing is shown in [Figure 4](#sensors-17-00782-f004){ref-type="fig"}.  Two ANFs are used to process two channel sensor signals.  Take one ANF for example; the transfer function from *u~a~* to ${\hat{u}}_{a}$ is $$H(s) = \frac{{\hat{U}}_{a}}{U_{a}} = \frac{s^{2} + \omega_{h}^{2}}{s^{2} + \sigma s + \omega_{h}^{2}}$$

Equation (6) has the same form as a conventional second-order notch filter.  Its gain equals zero at *s = jω~h~*, so the harmonic component at the frequency of *ω~h~* is filtered out.  The parameter *σ* determines the sharpness of the notch filter.  As *σ* becomes larger, the bandwidth of ANF becomes larger, thus the convergence rate is faster, and yet the filtering performance gets worse.  Hence, there is always a dilemma between faster convergence rate and better filtering performance for ANF. 

Moreover, the ANF-based signal processing method is not stable at zero speed.  In steady state, the inputs of the two integrators in [Figure 4](#sensors-17-00782-f004){ref-type="fig"} should be fluctuating around zero.  Particularly, all variables in [Figure 4](#sensors-17-00782-f004){ref-type="fig"} are constant when mover speed is zero, and then the inputs of the two integrators are supposed to be equal to zero, i.e., $$\begin{array}{l}
{\sigma \cdot {\hat{u}}_{a} \cdot \sin\left( {3 \cdot {atan}2\left( {{\hat{u}}_{a},{\hat{u}}_{b}} \right)} \right) = 0} \\
{\sigma \cdot {\hat{u}}_{b} \cdot \cos\left( {3 \cdot {atan}2\left( {{\hat{u}}_{a},{\hat{u}}_{b}} \right)} \right) = 0} \\
\end{array}$$

Taking ${atan}2\left( {{\hat{u}}_{a},{\hat{u}}_{b}} \right)$ as ${\hat{\theta}}_{k}$, we then have, $$\begin{array}{l}
{\sin{\hat{\theta}}_{k} \cdot \sin 3{\hat{\theta}}_{k} = 0} \\
{\cos{\hat{\theta}}_{k} \cdot \cos 3{\hat{\theta}}_{k} = 0} \\
\end{array}$$

It can be easily proven that Equation (8) has no solution, suggesting that the method described in [Figure 4](#sensors-17-00782-f004){ref-type="fig"} cannot achieve a steady state when motor is at a standstill.  Therefore, ANF is obviously not suitable for applications where motors operate in a stationary state.  Moreover, the slow convergence rate of ANF could be a severe problem for a short-stroke linear motor, in that the motor might have already completed the whole stroke before the ANF algorithm converges to a steady state. 

Apart from ANF, the signal processing method based on SFE also has the abovementioned problems, which will not be discussed in detail in this section.  In order to obtain signals without harmonics promptly, precisely and stably, EKF-based signal processing is proposed in this paper. 

4.  Signal Processing Using EKF {#sec4-sensors-17-00782}
==============================

The EKF is a linearized extension of the Kalman filter.  The Kalman filter has proven to be the optimal filter in a linear system, so the EKF also has merits such as fast convergence rate and high robustness.  The EKF is a well-proven and commonly used recursive algorithm for signal estimation.  Here, we use the EKF to estimate the third-order harmonic component based solely on the raw data measured by linear Hall sensors. 

To employ the EKF, the state model and the observation model are first constructed.  Taking the amplitude of the fundamental component and the percentage of the harmonic component as state variables, the two original signals detected by Hall sensors as outputs, and the raw electrical angle calculated by Equation (4) as input, variables used in the EKF model are represented as follows: $$x_{k} = \begin{bmatrix}
u_{mk} \\
r_{k} \\
\end{bmatrix},y_{k} = \begin{bmatrix}
u_{ak} \\
u_{bk} \\
\end{bmatrix},u_{k} = {\hat{\theta}}_{k} = {atan}2\left( {u_{ak},u_{bk}} \right)$$ *r~k~* is only related to the mechanical structure of the PMTLM, and *u~mk~* barely changes if the running condition of the PMTLM is unchanged.  Hence, we can consider that *x~k+~*~1~ = *x~k~*, and then the EKF model can be described as in Equation (10).  $$\begin{matrix}
{x_{k + 1} = I \cdot x_{k} + w_{k}} \\
{y_{k} = h\left( {x_{k},u_{k}} \right) + v_{k}} \\
{h\left( {x_{k},u_{k}} \right) = \begin{bmatrix}
{u_{mk}\left( {\sin\theta_{k} - r_{k}\sin 3\theta_{k}} \right)} \\
{u_{mk}\left( {\cos\theta_{k} + r_{k}\cos 3\theta_{k}} \right)} \\
\end{bmatrix}} \\
\end{matrix}$$ where *w~k~* is the state equation noise, *v~k~* is the observation equation noise, and their covariance matrices are represented as *Q~k~* and *E~k~* respectively. 

Employing Equation (5), we have $$\begin{array}{ll}
{h\left( {x_{k},u_{k}} \right)} & {\approx \left\lbrack \begin{array}{l}
{u_{mk}\sin\left( {{\hat{\theta}}_{k} + r_{k}\sin 4{\hat{\theta}}_{k}} \right) - u_{mk}r_{k}\sin 3\left( {{\hat{\theta}}_{k} + r_{k}\sin 4{\hat{\theta}}_{k}} \right)} \\
{u_{mk}\cos\left( {{\hat{\theta}}_{k} + r_{k}\sin 4{\hat{\theta}}_{k}} \right) + u_{mk}r_{k}\cos 3\left( {{\hat{\theta}}_{k} + r_{k}\sin 4{\hat{\theta}}_{k}} \right)} \\
\end{array} \right\rbrack} \\
 & {= \left\lbrack \begin{array}{l}
{u_{mk}\sin\left( {u_{k} + r_{k}\sin 4u_{k}} \right) - u_{mk}r_{k}\sin 3\left( {u_{k} + r_{k}\sin 4u_{k}} \right)} \\
{u_{mk}\cos\left( {u_{k} + r_{k}\sin 4u_{k}} \right) + u_{mk}r_{k}\cos 3\left( {u_{k} + r_{k}\sin 4u_{k}} \right)} \\
\end{array} \right\rbrack} \\
\end{array}$$

The recursive EKF algorithm is divided into time prediction and measurement update \[[@B21-sensors-17-00782],[@B22-sensors-17-00782]\].  Equations for them are as follows. 

Time prediction: $${\hat{x}}_{k + 1}^{-} = F_{k} \cdot {\hat{x}}_{k}$$ $$P_{k + 1}^{-} = F_{k}P_{k}F_{k}^{T} + Q_{k}$$

Measurement update: $$K_{k} = P_{k}^{-}H_{k}^{T}\left( {H_{k}P_{k}^{-}H_{k}^{T} + E_{k}} \right)^{- 1}$$ $${\hat{x}}_{k} = {\hat{x}}_{k}^{-} + K_{k}\left( {y_{k} - H_{k}{\hat{x}}_{k}^{-}} \right)$$ $$P_{k} = \left( {1 - K_{k}H_{k}} \right)P_{k}^{-}$$ where *F~k~* is the identity matrix in our case, and *H~k~* is the linear approximation of *h (x~k~*, *u~k~*), i.e., $$\begin{array}{l}
{H_{k} = \frac{\partial h}{\partial x} = \left\lbrack \begin{array}{ll}
H_{11k} & H_{12k} \\
H_{21k} & H_{22k} \\
\end{array} \right\rbrack} \\
{H_{11k} = \frac{\partial u_{ak}}{\partial u_{mk}} = \sin{\widetilde{\theta}}_{k} - r_{k}\sin 3{\widetilde{\theta}}_{k}} \\
{H_{12k} = \frac{\partial u_{ak}}{\partial r_{k}} = u_{mk}\cos{\widetilde{\theta}}_{k}\sin 4u_{k} - u_{mk}\sin 3{\widetilde{\theta}}_{k} - 3u_{mk}r_{k}\cos 3{\widetilde{\theta}}_{k}\sin 4u_{k}} \\
{H_{21k} = \frac{\partial u_{bk}}{\partial u_{mk}} = \cos{\widetilde{\theta}}_{k} + r_{k}\cos 3{\widetilde{\theta}}_{k}} \\
{H_{22k} = \frac{\partial u_{bk}}{\partial r_{k}} = - u_{mk}\sin{\widetilde{\theta}}_{k}\sin 4u_{k} + u_{mk}\cos 3{\widetilde{\theta}}_{k} - 3u_{mk}r_{k}\sin 3{\widetilde{\theta}}_{k}\sin 4u_{k}} \\
{{\widetilde{\theta}}_{k} = u_{k} + r_{k}\sin 4u_{k}} \\
\end{array}$$

Based on Equations (12)--(17), *u~mk~* and *r~k~* are estimated online.  Then, the third-order harmonics can be calculated and removed.  We have the following: $$\begin{matrix}
{{\overline{u}}_{ak} = u_{ak} + u_{mk}r_{k}\sin(3{\hat{\theta}}_{k})} \\
{{\overline{u}}_{bk} = u_{bk} - u_{mk}r_{k}\cos(3{\hat{\theta}}_{k})} \\
{{\overline{\theta}}_{k} = {atan}2\left( {{\overline{u}}_{ak},{\overline{u}}_{bk}} \right)} \\
\end{matrix}$$ where ${\overline{u}}_{ak},{\overline{u}}_{bk}$ are the estimated fundamental components and ${\overline{\theta}}_{k}$ is the estimated electrical angle. 

In this way, the signals after EKF processing no longer contain large third-order harmonics.  Small errors may still exist due to the approximation error in Equation (5), but most of the harmonics are eliminated, contributing to a more precise mover position detection result. 

The diagram of EKF processing is shown in [Figure 5](#sensors-17-00782-f005){ref-type="fig"}.  The estimated electrical angle $\overline{\theta}$ is not feedback to the signal processing procedure.  Instead, the raw electrical angle $\hat{\theta}$ is used for EKF processing: $\left( {{\hat{\theta}}_{k} + r_{k}\sin 4{\hat{\theta}}_{k}} \right)$ rather than $\left( {{\hat{\theta}}_{k} + r_{k}\sin 4{\overline{\theta}}_{k}} \right)$ is used as the input of EKF, and $\sin 3{\hat{\theta}}_{k}$ rather than $\sin 3{\overline{\theta}}_{k}$ is used to produce the reference of third-order harmonic component.  There are two reasons for doing so.  First, the difference is small between ${\hat{\theta}}_{k}$ and ${\overline{\theta}}_{k}$, and it becomes even smaller between $\sin n{\hat{\theta}}_{k}$ and $\sin n{\overline{\theta}}_{k}$, thus the adverse impact of this approximation is limited.  In addition, as long as *u~mk~* and *r~k~* stay around the true values, $\overline{\theta}$ will stick to the true value.  When the motor operates at zero speed, the input and output data of EKF remain unchanged, and then they can be considered useless data.  The useless data have no effect on the update of state variables, so the convergence process of EKF is not undermined.  Therefore, useless data will not cause the divergence of *u~mk~* and *r~k~*, and then the stability of EKF processing at zero speed is guaranteed. 

5.  Experimental Results {#sec5-sensors-17-00782}
=======================

In this section, extensive experimental results are provided to confirm the validity of the proposed method.  The experimental platform is shown in [Figure 6](#sensors-17-00782-f006){ref-type="fig"}.  A grating scale is installed to provide the true value of the mover position, and its resolution is 1 μm.  The motor driver adopts a voltage source inverter, and the switching frequency is 10 kHz.  A float-point digital signal processor (DSP) TMS320F28335 is used to run the position detection and servo control algorithm.  In order to deal with the high nonlinearity of the model described in Equation (10), suboptimal multiple fading factors are employed in Equation (13) of EKF processing in actual experiments, and this can significantly enhance the robustness against system nonlinearity and model uncertainty \[[@B23-sensors-17-00782],[@B24-sensors-17-00782]\]. 

[Figure 7](#sensors-17-00782-f007){ref-type="fig"} describes the waveforms and FFT results of Hall sensor signals at the speed of 20 mm/s. The motor is at a standstill after 4.5 s. Apparently, the two Hall sensors output sine and cosine signals when the motor is moving and output constant signals when the mover stops moving.  The FFT result of sine/cosine waves is depicted in [Figure 7](#sensors-17-00782-f007){ref-type="fig"}b, which indicates that third-order harmonics exist in the original sensor signals.  ThenANF-based signal processing method is first utilized to remove third-order harmonics, and the corresponding FFT result shows that the harmonic content is reduced.  However, the ANF shows instability at zero speed, meaning that the ANF processed signals diverge from the original signals.  Conversely, EKF processed signals remain stable when the mover is at a standstill, as depicted in [Figure 7](#sensors-17-00782-f007){ref-type="fig"}e.  Moreover, [Figure 7](#sensors-17-00782-f007){ref-type="fig"}f shows that the harmonic content is further reduced when sensor signals are processed by the EKF, meaning that the EKF has a better filtering performance than the ANF. 

[Figure 8](#sensors-17-00782-f008){ref-type="fig"} shows experimental results at the speed of 600 mm/s, and the waveforms and FFT results are consistent with [Figure 7](#sensors-17-00782-f007){ref-type="fig"}.  Therefore, we can come to the conclusion that EKF processing is able to minimize the third-order harmonics at different speeds, including zero speed. 

When the processed signals are used for position calculation, the performance of different processing methods can be more specifically observed from [Figure 9](#sensors-17-00782-f009){ref-type="fig"}. [ Figure 9](#sensors-17-00782-f009){ref-type="fig"}c,d demonstrate the original error of position detection when using raw sensor data.  It can be seen that the maximum error is about 200 μm, and the original error fluctuates four times during an electrical period, which agrees with Equation (5).  In order to reduce this fourth-order error in position detection results, the third-order harmonics in Hall sensor signals are supposed to be filtered out.  When ANF is applied, its position detection error is described in [Figure 9](#sensors-17-00782-f009){ref-type="fig"}e,f. The error begins to diminish at the second electrical period, and yet diverges when the mover speed drops to zero.  Compared with ANF, EKF can converge within several signal sampling periods, thus EKF processing can minimize the error more rapidly and more effectively.  When EKF processing is employed, the maximum error is reduced to 60 μm at 20 mm/s and 100 μm at 600 mm/s (see [Figure 9](#sensors-17-00782-f009){ref-type="fig"}g,h).  Furthermore, the error sticks to zero when PMTLM operates at zero speed, which is consistent with discussions in [Section 4](#sec4-sensors-17-00782){ref-type="sec"}.  Apparently, EKF processing shows better performance than ANF processing for PMTLM mover position detection. 

Finally, the mover position detected by the proposed method is used for closed-loop control of the PMTLM, and the driver system operates well, as shown in [Figure 10](#sensors-17-00782-f010){ref-type="fig"}.  The mover gradually marches to 90 mm at a top speed of 1 m/s, halts for 50 ms, and then moves backward to the origin. 

The convergence process of EKF is depicted in [Figure 10](#sensors-17-00782-f010){ref-type="fig"}c,d. Both *u~mk~* and *r~k~* stay stable in all speed regions and remain invariant at zero speed.  Obviously, sensor signals measured at zero speed would not update the state variables of EKF, and this explains why *r~k~* starts to converge at 0.05 s. Also, the value of *u~mk~* fluctuates slightly along with the mover position, and this suggests that the magnetic field strengths of different PMs are distinctive, which could be caused by manufacturing differences. 

It can be seen in [Figure 10](#sensors-17-00782-f010){ref-type="fig"}e that the dynamic error of the proposed position detection method is within 100 μm, which is much smaller than the position estimation error using the original Hall sensor signals (see [Figure 10](#sensors-17-00782-f010){ref-type="fig"}f).  On the other hand, it is also noteworthy that the error at zero speed is significantly reduced from 200 μm to 36 μm.  Therefore, the presented method can achieve both higher dynamic accuracy and higher positioning accuracy.  Even though there are still errors due to things like sensor error or mechanical error, the proposed EKF processing method seems to be feasible and superior. 

6.  Conclusions {#sec6-sensors-17-00782}
==============

Linear Hall sensors are utilized for mover position detection of PMTLM, and the third-order harmonics in Hall sensor signals seriously impact the accuracy.  In this paper, an EKF-based signal processing method is introduced to filter out harmonics.  The proposed method is compared with the conventional method and validated by substantial experiments.  In the end, a PMTLM control loop based on EKF processing is constructed to manifest its performance in whole speed region.  Unlike the conventional method, EKF processing can converge within several sampling periods, and the processed signals remain stable at a standstill, so both the convergence rate and the stability are enhanced.  Furthermore, the proposed method also has higher position detection accuracy, whether the mover is dynamic or static.  The proposed method has the advantages of low cost, small volume and high accuracy, and can be easily extended to rotary machines and signals containing higher order harmonics.  The EKF processing algorithm can also be used for sensorless control methods to eliminate harmonics in the observed back-EMF. 

This work was supported by the National Key Technology Support Program of China (No.  2015BAI0B16) and the Beijing Municipal Science and Technology Project (No.  Z141100000514015). 

Leyang Yan and Peiqing Ye conceived and designed the study.  Leyang Yan deduced the model and performed the experiments.  Leyang Yan wrote the paper.  Peiqing Ye and Hui Zhang reviewed and improved the manuscript.  All authors read and approved the manuscript. 

The authors declare no conflict of interest. 

![ Diagram of PMTLM structure.](sensors-17-00782-g001){#sensors-17-00782-f001}

![ Physical map of a PMTLM.](sensors-17-00782-g002){#sensors-17-00782-f002}

![(** a**) FEM simulation result of magnetic line distribution; (**b**) Distribution curves of magnetic field strength at different radial distances.](sensors-17-00782-g003){#sensors-17-00782-f003}

![ Diagram of ANF processing.](sensors-17-00782-g004){#sensors-17-00782-f004}

![ Diagram of EKF processing.](sensors-17-00782-g005){#sensors-17-00782-f005}

![ Experimental platform.](sensors-17-00782-g006){#sensors-17-00782-f006}

![ Waveforms and FFT results of sensor signals at 20mm/s. (**a**,**b**) Original sensor signals. (** c**,**d**) ANF processed signals. (** e**,**f**) EKF processed signals.](sensors-17-00782-g007){#sensors-17-00782-f007}

![ Waveforms and FFT results of sensor signals at 600 mm/s. (**a**,**b**) Original sensor signals. (** c**,**d**) ANF processed signals. (** e**,**f**) EKF processed signals.](sensors-17-00782-g008){#sensors-17-00782-f008}

![ Position detection error at 20 mm/s and 600 mm/s. (**a**,**b**) Electrical angle of PMTLM. (** c**,**d**) Position detection error when using original sensor signals. (** e**,**f**) Error when using ANF processed signals. (** g**,**h**) Error when using EKF processed signals.  The left column is measured at 20 mm/s, and the right column is measured at 600 mm/s.](sensors-17-00782-g009){#sensors-17-00782-f009}

![ Position control of PMTLM using proposed position detection method. (** a**) Mover position of PMTLM; (**b**) Mover speed of PMTLM; (**c**) Convergence process of *u~mk~*; (**d**) Convergence process of *r~k~*; (**e**) Position detection error using proposed method; (**f**) Position estimation error using original sensor signals.](sensors-17-00782-g010){#sensors-17-00782-f010}
