A High Precision Position Sensor Design and Its Signal Processing Algorithm for a Maglev Train

High precision positioning technology for a kind of high speed maglev train with an electromagnetic suspension (EMS) system is studied. At first, the basic structure and functions of the position sensor are introduced and some key techniques to enhance the positioning precision are designed. Then, in order to further improve the positioning signal quality and the fault-tolerant ability of the sensor, a new kind of discrete-time tracking differentiator (TD) is proposed based on nonlinear optimal control theory. This new TD has good filtering and differentiating performances and a small calculation load. It is suitable for real-time signal processing. The stability, convergence property and frequency characteristics of the TD are studied and analyzed thoroughly. The delay constant of the TD is figured out and an effective time delay compensation algorithm is proposed. Based on the TD technology, a filtering process is introduced in to improve the positioning signal waveform when the sensor is under bad working conditions, and a two-sensor switching algorithm is designed to eliminate the positioning errors caused by the joint gaps of the long stator. The effectiveness and stability of the sensor and its signal processing algorithms are proved by the experiments on a test train during a long-term test run.


Introduction
The suspension function of high speed maglev trains is carried out by the electromagnetic attractive force between the electromagnets and the rail, and the train is driven by linear synchronous motor [1,2] which has high power factor and can provide strong enough tractive force. The long stator of the motor made of laminated silicon-steel sheets is installed along the rail, and the rotor is the suspension electromagnet group shown in Figure 1.  In order to reach the most efficient and stable traction performance, the traction system needs to control the current phase of the 3-phased windings to make the traveling magnetic field be synchronized with the magnetic field of the electromagnets. In this process, the precise relative position between the electromagnets and the long stator is a prerequisite. Considering the dimensional accuracy of the tooth-slot structure of the long stator, high precision positioning can be achieved by detecting the tooth-slot structure based on nondestructive detection technology [3][4][5][6].
This paper researches the system design and the signal processing algorithms of a high precision position sensor of a high speed maglev train. The sections of this paper are organized as follows: in Section 2, the operating principle of the sensor is introduced. Then, a multiple-table lookup algorithm and a suspension gap fluctuation compensation algorithm are designed to improve the positioning precision and enhance the capacity of resisting mechanical disturbances. In Section 3, the reasons for the positioning signal distortion are analyzed. In Section 4, a new kind of time-discrete tracking differentiator (TD) is proposed based on nonlinear optimal control theory. The stability, convergence property and frequency characteristics of the TD are studied and analyzed thoroughly. The delay constant of the TD is figured out, and an effective time delay compensation algorithm is designed. In Section 5, based on the TD technology, a filtering process is introduced in to improve the positioning signal waveform when the sensor is under bad working conditions, and a two-sensor switching algorithm is designed to eliminate the positioning errors caused by the joint gaps of the rails. Section 6 presents the conclusions of this paper. The effectiveness and stability of the sensor and its signal processing algorithms are proven through experiments on a test train during a long-term test run.

System Design
There are four same "8"-shaped coils arranged on one side of the sensor facing the long stator [7,8], shown in Figure 2. Taking one of the coils for example, the resonance circuit of the coil is stimulated by a signal source with a constant frequency. Because the electromagnetic characteristics of the long stator are different from those of the air, when the coil moves along the long stator at a certain suspension gap, its equivalent inductance changes periodically with the tooth-slot structure. Thus, the signal amplitude of the resonance circuit changes accordingly to form an amplitude-modulated signal. After demodulation, an approximated sinusoidal wave can be obtained, shown in Figure 3. According to the relative location between the two coils in one group shown in Figure 2, the phase difference between the two demodulated signals of the two coils is 180°, shown in Figure 3. The two demodulated signals of one coil group are input into a subtractor amplifier to get their difference signal. The subtraction process can eliminate common-mode disturbances such as temperature drift. The difference signal has a better waveform and is more approximate to an ideal sine wave. According to the relative locations among the four coils, the phase difference between the two difference signals is 90°. Square waves can be obtained by putting the difference signals into comparators. The tooth-slot period number passed by the train can be gotten by counting the jumping edges of the square waves, and the phase relationship between the two square waves indicates the running direction. The phase relationship shown in Figure 3 corresponds to the situation where the sensor is moving in the direction indicated by the arrowhead shown in Figure 2.

Multiple-Table Lookup Algorithm
A magnetic pole phase period of the 3-phased windings contains six tooth-slot periods as shown in Figure 1. Thus, the length of a tooth-slot period corresponds to an electrical angle of 60° shown in Figure 4. The difference signals in a tooth-slot period are shown in Figure 5.   The data shown in Figure 5 can be used as a look-up table. Using the current sampled values of the difference signals as the indexes, the current phase can be found out from the table. However, there are some problems with the lookup phase using only one of the two sampled signals, because the signal is not monotonic and the rate of slope near the peaks and troughs is too small. Therefore, a multiple-table lookup algorithm is proposed.
At first, we choose two proper threshold values T 1 and T 2 . T 1 is slightly bigger than the upper crossing point of the two sampled signals and T 2 is slightly smaller than the lower crossing point. The four signal sections between the thresholds with relatively better linearity and bigger slope rate are used as phase tables, as shown in Figure 5. In one signal processing cycle, only one phase table is chosen for phase lookup. Let s 1 denote the sampled value of the difference signal of coil group 1 shown as the continuous line in Figure 5, and s 2 is that of coil group 2 shown as the dotted line. If phase Table 1 or 2 is chosen in the current processing cycle, the current value of s 1 is the index. Otherwise, s 2 is the index. The phase table chosen in the current processing cycle is decided by the phase table chosen in the previous cycle and the relationship between the current sampled values and the threshold values. The phase table switching algorithm is shown in Table 1.

Suspension Gap Fluctuation Compensation Algorithm
The four phase tables are calibrated under a certain normal suspension gap. When the train is running, it's impossible for the suspension control system to make the suspension gap be absolutely invariable considering external disturbances such as the topographical relief. But the fluctuation is controlled to be within a certain range. When the suspension gap fluctuates, the amplitude and the DC components of the sampled signals deviate from the calibrated values causing considerable table lookup error. So, before the table-lookup, the sampled values should be normalized.
The latest peak value p and trough value v of the sampled signal of one coil group can be gotten by recording the sampled value at the corresponding jumping moments of the square wave of the other coil group, according to

Reason Analysis for Phase Signal Distortion
The sensor designed above operates well under normal working conditions, but there are still some special cases need to be considered: (1) Errors caused by suspension gap fluctuation compensation algorithm The compensation algorithm supposes that the fluctuation frequency is low enough to ignore the gap change in a tooth-slot period, so the compensation is invalid for high frequency vibration, although this rarely happens. Besides, when suspension gap is too large, the amplitude of the sample signals reduces considerably. In this case, the gap fluctuation compensation method may amplify noises and errors. Further more, considering comparator hysteresis, its impossible for a jumping moment of a square wave to be exactly at the time when the sampled signal of the other coil group reaches its peaks or troughs. This also introduces errors.
(2) Errors caused by joint gaps of long stator sections There are two kinds of gaps with different size shown in Figure 6. The phase signal will be distorted seriously when the sensor is above a joint gap because there is no silicon-steel tooth-slot structure. But the traction system still requires normal phase signal in this situation, shown in Figure 6.    The situations shown in Figure 7(b,c) can be improved through filtering, but when the sensor passes a 172 mm joint gap as shown in Figure 7(d), tooth-slot period number counting loss happens. The tooth-slot period number obtained by the sensor is less than the number required by the traction system by 1. Thus, the phase lag is 60°. The phase nonsynchronous will reduce the efficiency of the traction and cause overcurrent protection. If the sensor has already passed several joint gaps of this size, the phase lag may become 180° causing the traction current phase to be inverted and resulting in serious accidents. Therefore, redundant position sensors are needed. Because of the structure and space limitation of the train, there are only two redundant sensors. So the switching algorithm is more complicated than that of a three-mode redundancy system. In order to solve this problem, a new kind of discrete-time tracking differentiator (TD) is proposed to further process the phase signal.

Derivation of the TD
Consider the system: where, x 1 and x 2 are the system states, u is the input signal and r is a certain constant. According to optimal control theory, the control law to drive the states of Equation (1) to the original point from any initial values in the shortest time is [9]: Driving by input Equation (2), the states firstly move to the control law switching line: And then, move to the original point along the switching line, shown in Figure 8. The state trajectory shown in Figure 8 is the time optimal state trajectory.  (1) and (2).  (2), a kind of continuous-time TD is obtained as follows [10]: where, v(t) is the signal to be tracked. For digital signal processing applications, a discrete form of Equation (4) is needed. But conventional discretization methods may bring in bad dynamic characteristics such as high frequency oscillation [10]. In order to solve this problem, [10,11] derive a discrete form of Equation (4) called as "Fhan" through Euler's polygonal arc method based on a conception of "isochronal area". Reference [12] applies "Fhan" to zero allocation. In [13,14] the authors propose another form of discrete-time TD called "Fast" by making the state trajectory of the discrete system be coincident with that of Equation (4). In [8], research on the filtering performance of "Fast" by applying it to the phase signal of maglev train is reported. In [15] "Fast" is used to extract the derivative signal of the suspension gap sensor of a maglev train, and compare it with the integral signal of the vertical accelerometer to detect the accelerometer faults, but the two discrete forms mentioned above containing several switch conditions, have a relatively big calculation load and are not suitable for dynamic characteristic analysis. Besides, the parameter settings of the two discrete TDs are experiential. In [16,17] the authors propose another kind of nonlinear TD with high speed in whole course. Its discretization is based on Runge-Kutta-Merson method which still has relatively big calculation load.
Based on Equation (4), this paper derives another discrete TD which has a linear form but contains the meanings of nonlinear optimal control theory. The noise-resisting ability and differentiating performance of the new TD are as good, but its calculation load is relatively less, and it can be studied and analyzed using many developed theories.
By properly introduce in sampling switch and zero-order hold, a discrete system corresponding to Equation (1) is obtained as follows: where T is the discretization time step length. Usually, the states of Equation (5) need at least two steps to move to the original point from certain initial values (x 1 (0), x 2 (0)). In order to make the state trajectory of Equation (5) satisfies a certain time optimal trajectory, choose control law u a (0) satisfies: Substituting (x 1 (0), x 2 (0)) into Equation (5), and then substituting Equations (5) into (6), we have: If the initial states satisfy: Let: Then, the system states can move to the original point in one step. Where r can be any nonzero value and (x 1 (1), x 2 (1)) = (0, 0). On the other hand, to make the states of Equation (5) move to the original point in two steps, substituting (x 1 (0), x 2 (0)) into Equation (5), the expression of (x 1 (2), x 2 (2)) can be obtained. Substituting the expression into: We have: According to Equations (7) and (11), r is solved out as follows: If the initial values satisfy Equations (8), then (11) reduces to Equation (9), where r can be any nonzero value. To sum up, the discrete-time optimal control law is written as follows: Furthermore, denoting ru a (k) as u(k), Equations (5) and (13) reduces to: Although, Equations (14) and (15) have a simple linear form, their equivalent Equations (5) and (13) reveal their physical significance in optimal control field. That is, driven by control law (15), the states of system (14) will reach a switching line determined by parameter r(x 1 (k), x 2 (k)) at k = 1, and then reach the original point at k = 2. Substituting x 1 (k) − v(k) for x 1 (k) and substituting c 0 T for T in Equation (15), we have: (16) is the smoothed approximate value of signal v(k), and x 2 (k) is the approximate value of . c 0 (≥1) is called as filtering factor. The bigger c 0 is, the smoother x 1 (k) is, and the bigger the time delay of x 2 (k) is.
The characteristic Equation (16) is: It can be proved that the roots of Equation (17) satisfy < 1, i = 1, 2. Thus TD (16) is stable. Figure 9 shows the tracking and differentiating performances of the TD designed. Where: v(k) = sin(0.05k) and c 0 = 1.

Convergence Property Analysis
For convenience, the analysis is carried out in continuous-time field. Consider the system: where f(z 1 , z 2 ) = −z 1 -3z 2 /2. Choose the Lyapunov function as: Its easy to prove that there exists a constant c > 0 satisfying: Because the partial derivatives of V(z) are continuous and unbounded, V(z) satisfies local Lipschitz condition. And because of the following relationship: ( ) there exist ñ i (0, 1], i = 1, 2 and a nonnegative constant A satisfying: On the other hand, consider the continuous form of Equation (16): where å = c 0 T Though parameter setting, we can have 0 < å < 1. Most signals in engineering practice can be expressed by the linear combination or integral of sinusoidal signals with different frequencies.

Frequency Characteristic Analysis
The block diagram of Equation (16) is shown as Figure 10.
Its transfer function is: To avoid frequency aliasing, according to Shannon's sampling theorem, it should be satisfied that ùT < ðrad. So only the frequency characteristics under the condition ùT < ðrad are studied. Figure 11 shows the amplitude-frequency characteristic of system (31) when c 0 is assigned to different values. It can be seen that the system is a low pass filter. The bigger c 0 is, the lower the pass band is. According to the amplitude-frequency characteristic diagram, to make the amplitude of the filtered signal be approximate to that of the original signal, it should be satisfied that c 0 ùT << ðrad. Usually, the position signal of maglev train satisfies this requirement. Figure 12 is the Nyquist diagram of Equation (31).
is the phase angle of complex function T f (ù). When c 0 ùT << ðrad, I m (ù)/R e (ù) can be approximated by its first order Taylor expansion as follows: Thus: Considering that a phase lag of ù is equivalent to a time lag of 1/ù second, the time lag constant of Equation (31) is calculated as: Figure 13 is the phase-frequency characteristic diagram of Equation (31). It can be seen, when c 0 ωT << πrad, the phase-frequency characteristic function is approximated to a linear function of ω.

Time Delay Compensation
Maglev trains' acceleration and change rate are limited to a relatively small range, so they can be approximately treated as constants in time span ô. Thus, we have the following compensation algorithm: The compensation effect is shown in Figures 14 and 15. Where, the input signal is v(k) = sin(0.01k) and c 0 = 5. Thus: The block diagram of compensation Equation (44) is shown in Figure 16. By the same method, more tracking differentiators can be added to the algorithm to realize higher order compensation.   It can be seen that the performance of Equation (39) is better than that of Equation (44). This is because Equation (44) is more sensitive to the precision of ô. The estimation error of ô will be cumulated and magnified though multi-stage filtering. But if ô is known precisely, the performance of Equation (44) is much better than that of Equation (39). Figure 18 shows the compensation effect when ô is known precisely.  The compensation method proposed in [8] implies that the time delays of each filtering stage are the same which is not satisfied exactly, so its compensation effect is also relatively worse. Figure 19 shows the compensation effect of the method proposed in reference [8], where v 1 and v 2 are compensation results of Equation (39) and the algorithm mentioned in [8].

Experiment Platform
The experiments are carried out on the 1.5 km test line in Shanghai. The position sensors designed are installed in the box girder of a maglev train shown in Figure 1. The sensors are connected to an onboard computer via a communication cable. Once a sensor figure out a phase datum, it is sent to the computer immediately. The computer further processes the data according to the algorithms designed in the later sections, and then sends the final results to the traction system.
The onboard computer can save and monitor the original data, midcourse data and final data on-line, and the saved data can be analyzed off-line to guide the algorithm modification and program debugging. In the debugging phase, the train is pulled by a rail test truck. After the performance of the positioning system is verified to some extent, traction system can be introduced in to drive the train and further test the positioning system. Generally, the performance of the positioning system can be verified in several ways: (1) The slope edges of the saw-tooth phase signal wave is always fine and smooth in any case as shown in Figure 7 However, considering the text length, only the experiment results when the positioning system is under certain bad working conditions are given in this paper.

Filtering Results
Taking the data shown in Figure 7(c) as an example, the jumping edges of the phase signal contain high frequency components. Filtering the phase signal straightforwardly will cause a serious information loss, so at first, the phase signal needs to be converted to a certain form suitable for filtering. Let ph(k) denote the current phase value and n(k) denote the current tooth-slot period number. Considering a tooth-slot period is corresponding to a phase angle of 60°, the converted signal is calculated as follows: Because of the slight time difference between the jumping edges of the phase signal and those of the tooth-slot number signal, there are spike pulses in signal ph a (k). The spike pulses can be eliminated though simple logical pretreatment. Figure 20 shows the filtering effect without time delay compensation, where c 0 = 100, T = 0.001s, v is the pretreated signal ph a (k) and v 1 is the filtered signal. It can be seen that the smoothing effect is good, but the time delay is serious which will result in considerable positioning errors. Figure 21 shows the results after time delay compensation, where v 2 is the compensated signal. It can be seen, the phase waveform is improved obviously after the procedure.

Switching Experiment Results
Denote the compensated differential signal and filtered signal of v(k) by ( ) v k and ( ) v k , respectively. Forecasting v(k + 1) by ( ) v k and ( ) v k , the error between the forecasted value and the real value can be obtained as: ( 1) ( where ( 1) When the error exceeds a certain threshold value, it can be regard that the sensor is passing a joint gap, so the switching is triggered at this moment. Figure 22 shows the forecast signal and the error signal of the data shown in Figure 7(d), where v is the pretreated signal ph a (k), and v f is the forecast signal. Setting the threshold value to be 10, Switching can be triggered at k = 208. Figure 23 shows the performance of the switching algorithm, where v 1 is the combined signal of sensor 1 and sensor 2 though the switching algorithm, and v 2 is the filtered signal. It can be seen that, the algorithm guaranties a normal signal when the sensors are passing a large joint gap, and tooth-slot period counting loss is avoided.

Conclusions
High precision positioning technology for a high speed maglev train is studied. At first, the operating principle of the position sensor is introduced. A multiple-table lookup algorithm is proposed to improve the linearity of the phase table and the table-lookup precision. A suspension gap fluctuation compensation method is designed to enhance the sensor's capacity of resisting mechanical disturbance. Then, in order to further improve the signal waveform and enhance the reliability of the sensor, a new kind of discrete tracking differentiator is proposed to do some further signal processing based on optimal control theory. The new TD has good filtering and differentiating performances and relatively small calculation load. The dynamic characteristics of the TD are studied thoroughly. The delay constant of the TD is figured out and an effective time delay compensation algorithm is proposed. The TD is use to filter the phase signal, obviously improving the waveform. Finally, a two-sensor switching algorithm is designed based on the TD to avoid the phase signal distortion and tooth-slot period counting loss caused by the large joint gap. The designed sensor performed well during long-term testing runs.