#### Abstract

Resolvers are widely used in electric vehicles, trains, and other harsh fields 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 filtered, 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 effectiveness of the proposed method is verified 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 30 dB, which provides a high-precision and low-cost decoding scheme for practical applications.

#### 1. 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. Therefore, 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]. The 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].

The 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–6]. Other time-frequency 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. The 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. The 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].

The second step of the software-based method is to calculate the rotor angle according to the demodulation signal. The 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. The 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.

The 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]. The 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–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. Then, 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. Through the simulations under various conditions, it is verified that the decoding error of the proposed method is less than 0.5° when 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.

#### 2. Foundation

##### 2.1. Foundation of the Resolver

The working principle of the resolver is shown in Figure 1. The input signal of the resolver is the excitation, and two orthogonal modulated output signals and are generated by two induction coils which are installed vertically [19].

and are related to the excitation and rotor angle , and the relationship between them can be expressed aswhere 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 and related to the rotor spatial relative position, which is measured by detecting , will be generated when is applied to the input end of the resolver. In order to obtain , the envelopes of and need to be extracted by mathematical tools. In this paper, Hilbert transform is used because of its fast processing ability for nonstationary signals.

##### 2.2. Foundation of Hilbert

The Hilbert transform can be regarded as the output of a linear time-invariant system with input , and its impulse response is [20, 21], so can be expressed aswhere is an integral variable.

An analytic signal can be constructed aswhere *j* is an imaginary operator.

The modular envelope of the resolver signal can be directly obtained by Hilbert transform, and the envelope can be expressed as

The 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.

##### 2.3. Foundation of the ATO

The 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, and are the detected demodulation signals, and is the output of the ATO. It uses the last estimate plus 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:

Therefore, the value of can be obtained from the estimated .

#### 3. The Proposed Technique

The resolver decoding method proposed in this paper is shown in Figure 3. The Hilbert transform is employed to obtain the analytic signals and which correspond to and , respectively. Then, the module envelopes and are obtained by taking modulus and filtering and . The demodulation signals and are achieved by adding polarity to and . 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 and . The difference of polarity between and is found at the point of maximum of , where represents or and represents or , so *P* can be expressed aswhere sign[] is the signum function and is the index number of maximum of .

A multiplication rule is adopted to obtain the demodulation signals and , and the rule can be expressed aswhere represents or , is the sample number, and is the index number of minimum of .

As mentioned above, the rotor angle is obtained by performing ATO to the obtained demodulation signals and . ATO usually has a large error in solving initial angle [7]. In this paper, the improved ATO is used to solve the initial angles and . Based on the ATO, improved ATO carries out iterative operation to continuously reduce the error, and it can be expressed aswhere and are the angle of two adjacent iterations and 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.

The 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 and to obtain the corresponding analytic signal and of the two signals Step 2: the amplitudes of and , i.e., the modular envelopes of and , are obtained by using formula (4) Step 3: a FIR filter is used to smooth the modular envelopes to get and Step 4: formula (6) is used to obtain the polarity value *P*, and formula (7) is used to determine the polarity of and to obtain demodulation signals and 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 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. Therefore, the algorithm in this paper can meet the real-time operation.

#### 4. Experiments

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

##### 4.1. 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. The 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°. Therefore, a filter is used to reduce errors, as shown in Figure 3, and the simulation results using the filter are shown in Figure 6.

**(a)**

**(b)**

**(c)**

**(a)**

**(b)**

**(c)**

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°. This 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 . The 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. The simulation results after linearization are shown in Figure 7.

**(a)**

**(b)**

As shown in Figure 7(a), the steepness of the zero-crossing 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°. Therefore, 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.

##### 4.2. 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. The angle error statistics under various working conditions are shown in Table 1.

**(a)**

**(b)**

**(c)**

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. This is because the proposed algorithm contains a filtering unit (Figure 3), which can filter out noise and weaken fast-changing 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.

##### 4.3. 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. The 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.

#### 5. Conclusion

The 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. The 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. The 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 real-time requirements of practical applications. Compared with other methods, it also has advantages in noise immunity. Therefore, 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.

#### Conflicts of Interest

The authors declare that they have no conflicts of interest.

#### Acknowledgments

This work was supported by the Scientific Research Fund of Hunan Education Department of China (18A272).