Resolver Decoding Method Using Hilbert Transform and ATO

Resolvers are widely used in electric vehicles, trains, and other harsh ﬁelds because of their robustness. However, the resolver outputs two orthogonal analog signals, which make the resolver decoding either high hardware cost or poor decoding accuracy. A noise robust resolver decoding method using Hilbert transform and angle-tracking observer (ATO) is proposed in this paper. Firstly, Hilbert transform is employed to obtain the modular envelopes of resolver signals. Next, the modular envelopes are ﬁltered, and their quadrants are recognized by the polarity relation of the resolver signals and the modular envelope extreme point. Then, the ideal demodulating signals are gained through the linearization of the envelope zero point. Finally, the improved ATO is used to obtain the rotor angle by iteratively calculating the demodulating signal. The eﬀectiveness of the proposed method is veriﬁed by experiments under various rotor speed conditions and compared with other methods in noise immunity. The results show that the proposed method can control the decoding error within 0.5 ° when the SNR is 30dB, which provides a high-precision and low-cost decoding scheme for practical applications.


Introduction
Resolver, a type of position sensor, has the advantages of durability and adaptability to harsh environments and is widely used in rail transit, new energy vehicles, aerospace, and other industrial fields [1]. However, the resolver signals, rather than the direct digital signal containing rotor angle, involve orthogonal cosine and sine analog signal. erefore, the resolver signals need to be decoded to obtain the rotor angle.
Existing methods of resolver decoding can be divided into two categories: hardware-based and software-based [2]. e hardware-based decoding method mainly uses a specific decoding chip-resolver-to-digital conversion (RDC). However, the RDC chip is expensive and makes the circuit more complicated [3]. e software-based method usually takes two steps to decode resolver signals, and obtaining the demodulation signal is the first step. As a time-frequency analysis tool, S-transform is used to extract the resolver signal envelope in [3], but calculation burden of S-transform is heavy, and it is mainly applied in power quality analysis [4][5][6]. Other timefrequency methods such as wavelet transform are mainly used in system optimization in related industries [7]. Currently, the common methods of resolver signal envelope extraction are peak detection or multiplying excitation technique. e output signals are sampled only at the moment when the excitation reaches its peak in the peak detection technique [8], so it is relatively simple to realize and has a good real-time performance. However, the method will cause the loss of the resolution of the envelope, and it is susceptible to noise. e multiplying excitation technique multiplies resolver signals by the excitation to obtain their envelopes, and a filter is needed to filter out the excitation components to obtain demodulation signals [9], so the operation process is relatively complicated [10,11]. e second step of the software-based method is to calculate the rotor angle according to the demodulation signal. e commonly used angle calculation methods include arc-tangent method and ATO [12]. In the former method, the arc-tangent operation is directly applied to the demodulated signal, so the decoding results are greatly affected by noise. e ATO uses the closed-loop control method to calculate the angle, but there are large decoding errors in calculating the initial angle. In [9], ATO based on acceleration compensation was used to reduce the steady-state decoding errors under the acceleration condition. However, the implementation of this method is relatively complex. e software-based decoding method has become a better choice for many applications due to its low cost and flexibility. However, the accuracy and noise robustness of the existing software-based methods need to be further improved [13].
e Hilbert transform is convenient for extracting the signal envelope which is mentioned in [14], but there is no in-depth discussion about how to apply in resolver decoding. In recent years, Hilbert transform has been mainly applied in seismic analysis and power grid quality disturbance detection [15][16][17][18].
In this paper, combining the advantages of Hilbert transform in envelope extraction and ATO in angle calculation, a new resolver decoding method is proposed for various conditions. Firstly, Hilbert transform is used to transform the resolver signals into an analytic signal and extract their modular envelope. en, after filtering the modular envelope, the perfect demodulation signal is formed by using the polarity rule and zero-crossing linearization. Finally, the improved ATO is used to decode the demodulated signal to obtain the rotation angle. rough the simulations under various conditions, it is verified that the decoding error of the proposed method is less than 0.5°w hen the SNR is 30 dB. Compared with other methods such as the peak detection method and multiplying excitation technique, the proposed method has better antinoise performance.

Foundation of the Resolver.
e working principle of the resolver is shown in Figure 1. e input signal v e of the resolver is the excitation, and two orthogonal modulated output signals v s and v c are generated by two induction coils which are installed vertically [19]. v s and v c are related to the excitation and rotor angle θ, and the relationship between them can be expressed as where U f is the amplitude of the excitation, ω is the angular frequency of the excitation, and k is the voltage ratio of the resolver. It can be seen from (1) that output signals v s and v c related to the rotor spatial relative position, which is measured by detecting θ, will be generated when v e is applied to the input end of the resolver. In order to obtain θ, the envelopes of v s and v c need to be extracted by mathematical tools. In this paper, Hilbert transform is used because of its fast processing ability for nonstationary signals.

Foundation of Hilbert.
e Hilbert transform f(t) can be regarded as the output of a linear time-invariant system with input f(t), and its impulse response is 1/πt [20,21], so f(t) can be expressed as where τ is an integral variable. An analytic signal Z(t) can be constructed as where j is an imaginary operator. e modular envelope of the resolver signal can be directly obtained by Hilbert transform, and the envelope A(t) can be expressed as e complete demodulation signal can be obtained by imposing quadrant interpretation to the modular envelope. And the complete demodulation signal will be employed to solve rotor angle θ based on an algorithm, and it is the ATO in this paper.

Foundation of the ATO.
e principle of the ATO is to track the angle error through the trigonometric function of the angle difference by using the detected demodulation signal. As shown in Figure 2, sin θ and cosθ are the detected demodulation signals, and φ is the output of the ATO. It uses the last estimate φ n−1 plus K 1 ε to get the current angle estimate. When the estimated angle φ is infinitely close to the actual angle θ, the error ε is infinitely close to zero, as shown in the following: erefore, the value of θ can be obtained from the estimated φ.

The Proposed Technique
e resolver decoding method proposed in this paper is shown in Figure 3. e Hilbert transform is employed to obtain the analytic signals H s and H c which correspond to v s and v c , respectively. en, the module envelopes M s and M c are obtained by taking modulus and filtering H s and H c . e demodulation signals sinθ and cosθ are achieved by adding polarity to M s and M c . Finally, the improved ATO is used to calculate the rotor angle θ. As shown in Figure 3, the unit of polarity determination is employed to gain the polarity of M s and M c . e difference of polarity between v e and v x is found at the point of maximum of M x , where v x represents v s or v c and M x represents M s or M c , so P can be expressed as where sign[] is the signum function and I max is the index number of maximum of M x . A multiplication rule is adopted to obtain the demodulation signals sinθ and cosθ, and the rule can be expressed as dx � P × M x (n), I min > I max , n < I min or I min < I max , n > I min , where d x represents sin θ or cos θ, n is the sample number, and I min is the index number of minimum of M x . As mentioned above, the rotor angle θ is obtained by performing ATO to the obtained demodulation signals sin θ and cos θ. ATO usually has a large error in solving initial angle [7]. In this paper, the improved ATO is used to solve the initial angles θ 0 and θ. Based on the ATO, improved ATO carries out iterative operation to continuously reduce the error, and it can be expressed as where φ i−1 and φ i are the angle of two adjacent iterations and K 1 is the gain, and it can be assigned a value between 1 and 1.026 [8]. Because the angle can be quickly approximated by the improved ATO through iteration, K 1 � 1 is adopted in this paper to avoid the result oscillation caused by the excessive value. e iterative termination condition of (8) and (9) is that the error ε is less than a certain set value. At this time, it can be considered that the obtained φ is equal to θ.
To sum up, the proposed resolver decoding method is implemented in the following steps: Step 1: formulas (2) and (3) are used to process the input signals v s and v c to obtain the corresponding analytic signal H s and H c of the two signals Step 2: the amplitudes of H s and H c , i.e., the modular envelopes of v s and v c , are obtained by using formula (4) Step 3: a FIR filter is used to smooth the modular envelopes to get M s and M c Step 4: formula (6) is used to obtain the polarity value P, and formula (7) is used to determine the polarity of M s and M c to obtain demodulation signals sinθ and cosθ Step 5: formulas (8) and (9) are used to iteratively calculate the estimated angle φ until the error ε is less than a certain set value According to the above algorithm steps, the calculation of this algorithm is mainly in three aspects, that is, (1) using Hilbert transform to form the analytic signal, (2) using FIR to filter the demodulation signal, and (3) using the ATO to decode the angle. If the processed data are N points, then the implementation of (1) needs N-point FFT and N-point IFFT, which is its main calculation [22]. In (2), N × R times of Journal of Electrical and Computer Engineering multiplication and accumulation are needed to calculate FIR, where R is the order of FIR. In (3), the multiplication and accumulation of 2 × N times sine and cosine need to be calculated. Obviously, if sine and cosine are calculated by looking up the table, the amount of calculation can be reduced. Because the resolver decoder needs to process the two signals mentioned above, the amount of computation needs to be doubled. MATLAB is used to run the algorithm on the computer with i5 CPU 2.3 GHz, and the execution time is about 0.3 ms when the data length is 256 points and FIR order is 102. Generally, the sampling rate of the resolver decoding system is lower than 250 kHz, and it takes more than 1 ms to sample 256 points of data. erefore, the algorithm in this paper can meet the real-time operation.

Experiments
In order to verify the feasibility of the proposed method for resolver decoding, experiments were carried out through MATLAB simulation. e initial angle is set as 30°, the excitation frequency f � 10 kHz, the sampling frequency f s � 160 kHz, the excitation amplitude U f �10 V, the voltage ratio K � 0.2, and the resolver is set as the constant forward speed. e original signals v s and v c are shown in Figure 4.

Under Noise Conditions.
Take the medium speed working condition (2000 r/min) as an example, and noise is superimposed on the original signal, and the SNR is set to 30 dB. e simulation results are shown in Figure 5. Figure 5(a) shows the demodulation signal, but it is not filtered. Figure 5(b) shows θ of the original signal and estimated angle φ obtained by the ATO. Figure 5(c) shows the error ε. It can be seen that the demodulated signal is seriously interfered by noise due to no filtering, which results in great error in φ, and the maximum of error is close to 25°. erefore, a filter is used to reduce errors, as shown in Figure 3, and the simulation results using the filter are shown in Figure 6.
As shown in Figure 6, the rotor angle error is obviously reduced, and the maximum error occurs at the zero-crossing point of the demodulation signal, which is about 2°. is is because the filter not only filters out the noise but also smoothes the extremum of the modulus envelope, which makes the zero crossing of the demodulation signal discontinuous. In order to reduce the error, the zero-crossing section of the demodulated signal is linearized before transferring to the improved ATO to resolve θ. e principle of zero-crossing linearization is to take the polar conversion point as the center, take the demodulation signal point with the distance of n l from the polar conversion point as two endpoints, and then update the data between the two ends through the linear equation. In this way, the zero-crossing signal distortion caused by the weakening of the extreme point can be eliminated. Generally, n l can be 5∼20. e simulation results after linearization are shown in Figure 7.
As shown in Figure 7(a), the steepness of the zerocrossing point of the demodulation signal is eliminated, and as can be seen from Figure 7(b), the angle error ε is reduced to less than 0.5°. erefore, using Hilbert transform, filter, and zero-crossing linearization, the accurate demodulation signal under the condition of noise can be obtained, and the precise angle can be solved by the improved ATO.

Under Different Rotation Speed Conditions.
In order to verify the effectiveness of the proposed method under various working conditions, four working conditions, namely, the ultralow rotation speed (100 rpm), low rotation speed (1000 rpm), medium rotation speed (2000 rpm), and high rotation speed (8000 rpm), are set up for the adaptability experiment, and the noise level is 30 dB. A large number of experiments have been performed under various working conditions, and a section of signals (2500 samples) and their decoded results are randomly selected for statistical analysis. Figure 8 shows the demodulation signal, decoding angle, and error under the conditions of ultralow speed, low speed, and high speed, respectively. e angle error statistics under various working conditions are shown in Table 1.
It can be seen from Table 1 that the maximum angle errors under various working conditions are less than 0.5°. According to the decoding results, the rotor angle under different working conditions can be accurately obtained by the proposed method, which is also proved by the experimental results that it has the adaptability to working conditions. It should be noted that the mean value of angle error in the ultralow speed condition is positive, while that in other conditions is negative, as shown in Table 1. is is because the proposed algorithm contains a filtering unit (Figure 3), which can filter out noise and weaken fastchanging signals. However, the signal changes very slowly under the ultralow speed condition and is hardly weakened by the filter, so the estimated value will be greater than the real value under the effect of noise.

Comparison of the Antinoise Ability.
In order to compare the antinoise performance of the proposed method with other methods, a comparative experiment was conducted with the peak detection method [8] and the multiplicative excitation method [9]. All the methods use the same filter and add noise to make the SNR of resolver signals 40 dB and 30 dB under the medium-speed condition. e results are shown in Table 2. As can be seen from Table 2, with the increase of the noise level, the maximum angle error of these three methods also increases. However, the method in this paper is the least affected by noise, while the peak detection method is the most affected by noise.

Conclusion
e difficulty of resolver decoding is to achieve the best balance between cost and availability. If the software-based decoding technology can meet the actual requirements, the decoding system will have cost advantage. In this paper, a new method for calculating rotation angle is proposed by using Hilbert transform and improved ATO, which can adapt to various working conditions of the resolver and meet the requirements of precision and real time. e analytic signal formed by Hilbert transform can extract the signal envelope effectively; the zero-crossing linearization can eliminate the error caused by the filter on the minimum point of the module envelope. e decoding error of the proposed method is less than 0.5°when the SNR is 30 dB, and the algorithm time is less than 0.3 ms when the data length is 256 points, which can meet the accuracy and realtime requirements of practical applications. Compared with other methods, it also has advantages in noise immunity. erefore, as a low-cost software decoding method, this method has a good application prospect. It is true that in order to make the proposed method run in the actual system, the software and hardware design based on the DSP chip need to be further studied.

Data Availability
No data were used to support this study.