# Resolver Decoding Method Using Hilbert Transform and ATO

Authors: Jiliang Yi; Xuechun Zhou; Huabing Tan; Zhongqi Li
Journal: Journal of Electrical and Computer Engineering
 (2021)

---

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


---

## Body

## 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 Figure1. The input signal ve of the resolver is the excitation, and two orthogonal modulated output signals vs and vc are generated by two induction coils which are installed vertically [19].Figure 1
Schematic diagram of the resolver.vs and vc are related to the excitation and rotor angle θ, and the relationship between them can be expressed as(1)ve=Ufsinωt,vc=kUfsinωtcosθ,vs=kUfsinωtsinθ,where Uf 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 vs and vc related to the rotor spatial relative position, which is measured by detecting θ, will be generated when ve is applied to the input end of the resolver. In order to obtain θ, the envelopes of vs and vc 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 transformf^t can be regarded as the output of a linear time-invariant system with input ft, and its impulse response is 1/πt [20, 21], so f^t can be expressed as(2)f^t=Hft=1π∫−∞∞fτt−τdτ,where τ is an integral variable.An analytic signalZt can be constructed as(3)Zt=ft+jf^t,where j is an imaginary operator.The modular envelope of the resolver signal can be directly obtained by Hilbert transform, and the envelopeAt can be expressed as(4)At=f2t+f^2t.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 Figure2, sinθ and cosθ are the detected demodulation signals, and φ is the output of the ATO. It uses the last estimate φn−1 plus K1ε 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:(5)ε=sinθ−φ≈θ−φ⟶0.Figure 2
ATO schematic diagram.Therefore, the value ofθ can be obtained from the estimated φ.


## 2.1. Foundation of the Resolver

The working principle of the resolver is shown in Figure1. The input signal ve of the resolver is the excitation, and two orthogonal modulated output signals vs and vc are generated by two induction coils which are installed vertically [19].Figure 1
Schematic diagram of the resolver.vs and vc are related to the excitation and rotor angle θ, and the relationship between them can be expressed as(1)ve=Ufsinωt,vc=kUfsinωtcosθ,vs=kUfsinωtsinθ,where Uf 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 vs and vc related to the rotor spatial relative position, which is measured by detecting θ, will be generated when ve is applied to the input end of the resolver. In order to obtain θ, the envelopes of vs and vc 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 transformf^t can be regarded as the output of a linear time-invariant system with input ft, and its impulse response is 1/πt [20, 21], so f^t can be expressed as(2)f^t=Hft=1π∫−∞∞fτt−τdτ,where τ is an integral variable.An analytic signalZt can be constructed as(3)Zt=ft+jf^t,where j is an imaginary operator.The modular envelope of the resolver signal can be directly obtained by Hilbert transform, and the envelopeAt can be expressed as(4)At=f2t+f^2t.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 Figure2, sinθ and cosθ are the detected demodulation signals, and φ is the output of the ATO. It uses the last estimate φn−1 plus K1ε 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:(5)ε=sinθ−φ≈θ−φ⟶0.Figure 2
ATO schematic diagram.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 Figure3. The Hilbert transform is employed to obtain the analytic signals Hs and Hc which correspond to vs and vc, respectively. Then, the module envelopes Ms and Mc are obtained by taking modulus and filtering Hs and Hc. The demodulation signals sinθ and cosθ are achieved by adding polarity to Ms and Mc. Finally, the improved ATO is used to calculate the rotor angle θ.Figure 3
Decoding process diagram.As shown in Figure3, the unit of polarity determination is employed to gain the polarity of Ms and Mc. The difference of polarity between ve and vx is found at the point of maximum of Mx, where vx represents vs or vc and Mx represents Ms or Mc, so P can be expressed as(6)P=signveImaxvxImax,where sign[] is the signum function and Imax is the index number of maximum of Mx.A multiplication rule is adopted to obtain the demodulation signalssinθ and cosθ, and the rule can be expressed as(7)dx=P×Mxn,Imin>Imax,n<IminorImin<Imax,n>Imin,−P×Mxn,Imin>Imax,n>IminorImin<Imax,n<Imin,where dx represents sinθ or cosθ, n is the sample number, and Imin is the index number of minimum of Mx.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(8)ε=θ−φi−1≈sinθ−φi−1=sinθ×cosφi−1−cosθ×sinφi−1,(9)φi=φi−1+K1ε,where φi−1 and φi are the angle of two adjacent iterations and K1 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, K1 = 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 vs and vc to obtain the corresponding analytic signal Hs and Hc of the two signalsStep 2: the amplitudes ofHs and Hc, i.e., the modular envelopes of vs and vc, are obtained by using formula (4)Step 3: a FIR filter is used to smooth the modular envelopes to getMs and McStep 4: formula (6) is used to obtain the polarity value P, and formula (7) is used to determine the polarity of Ms and Mc 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 valueAccording 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 areN 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 frequencyf = 10 kHz, the sampling frequency fs = 160 kHz, the excitation amplitude Uf=10 V, the voltage ratio K = 0.2, and the resolver is set as the constant forward speed. The original signals vs and vc are shown in Figure 4.Figure 4
Original signals.


### 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 Figure5. 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.Figure 5
Simulation results without the filter. (a) Demodulation signals. (b) Rotor angle. (c) Angle error.
(a)(b)(c)Figure 6
Simulation results using the filter. (a) Demodulation signals. (b) Rotor angle. (c) Angle error.
(a)(b)(c)As shown in Figure6, 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 nl 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, nl can be 5∼20. The simulation results after linearization are shown in Figure 7.Figure 7
Simulation results using the filter and zero-crossing linearization. (a) Demodulation signals. (b) Angle error.
(a)(b)As shown in Figure7(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. Figure8 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.Figure 8
Simulation results under various working conditions. (a) Demodulation signals. (b) Rotor angle. (c) Angle error.
(a)(b)(c)Table 1
Angle error statistics under various working conditions.
Working condition (rpm)Error (degree)MaximumMeanStandard deviation1000.4060.0280.16710000.452−0.0210.18020000.445−0.0200.17580000.492−0.1170.152It can be seen from Table1 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.Table 2
Decoding errors of various decoding methods for noise-containing signals.
SNR (dB)Maximum error (degree)Hilbert + ATOMultiplied excitation signalPeak detection400.1620.5012.067300.4451.8505.617


## 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 Figure5. 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.Figure 5
Simulation results without the filter. (a) Demodulation signals. (b) Rotor angle. (c) Angle error.
(a)(b)(c)Figure 6
Simulation results using the filter. (a) Demodulation signals. (b) Rotor angle. (c) Angle error.
(a)(b)(c)As shown in Figure6, 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 nl 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, nl can be 5∼20. The simulation results after linearization are shown in Figure 7.Figure 7
Simulation results using the filter and zero-crossing linearization. (a) Demodulation signals. (b) Angle error.
(a)(b)As shown in Figure7(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. Figure8 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.Figure 8
Simulation results under various working conditions. (a) Demodulation signals. (b) Rotor angle. (c) Angle error.
(a)(b)(c)Table 1
Angle error statistics under various working conditions.
Working condition (rpm)Error (degree)MaximumMeanStandard deviation1000.4060.0280.16710000.452−0.0210.18020000.445−0.0200.17580000.492−0.1170.152It can be seen from Table1 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.Table 2
Decoding errors of various decoding methods for noise-containing signals.
SNR (dB)Maximum error (degree)Hilbert + ATOMultiplied excitation signalPeak detection400.1620.5012.067300.4451.8505.617


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



---

*Source: 5579692-2021-05-04.xml*