# A Novel Technique for Resolver-to-Digital Conversion Using Principal Frequency Component S-Transform

Authors: Like He; Jiliang Yi
Journal: Journal of Electrical and Computer Engineering
 (2019)

---

## Abstract

A novel technique for resolver-to-digital conversion (RDC) using principal frequency component S-transform (PFCST) is proposed in this paper. First, the mode envelope of two output signals of the resolver is extracted by PFCST. The envelope extracted by PFCST maintains the same time resolution as the original signal because it performs time-frequency conversion for each sampling point. Then, the quadrant of the resolver is determined by the judgment rule formed by the polarity of the optimum nonzero region of the signals, and the quadrant information is used to correct the arctangent to obtain the accurate rotor position. Finally, the simulations prove that the maximum angle error of the resolver estimated by this method occurs at the quadrant junction but does not exceed one deg., and the experiments are used to verify the effectiveness of the proposed method.


---

## Body

## 1. Introduction

As a position and speed sensor of rotating shaft, a resolver has the advantages of ruggedness, wide operating temperature, and restraining common mode noise. It can work stably in harsh cases such as rail transit, new energy vehicles, and aviation [1]. However, the two output signals of the resolver are generated by sinusoidal and cosine modulation of excitation, respectively, and it is not easy to obtain the exact position of the rotor position [2].The existing RDC methods can be divided into two categories: hardware-based and software-based [3]. The core of the hardware-based RDC method is to use a special decoding chip [4, 5]. This method has a high decoding accuracy, but the chip cost is high and the hardware design is complex. Therefore, more and more researchers are seeking more flexible, convenient, and low-cost RDC methods. The implementation of RDC based on an FPGA (Field-Programmable Gate Array) chip has attracted much attention because it has the advantages of both hardware real time and software flexibility. The current controller and the decoding algorithm are incorporated into a single FPGA chip in [6]. In [7], an improved design of feedforward resolver-to-digital conversion methodology has been proposed, and it is implemented on a hardware using an FPGA. CORDIC (Coordinate Rotation Digital Computer) algorithm is another method suitable for fast calculation of trigonometric functions and suitable for the FPGA implementation [8]. However, the accuracy of the CORDIC algorithm is mainly affected by the limited number of iterations for microcontroller, mentioned in [9], and it is a challenge for general developers to have experience in developing special chips.At present, software-based RDC methods of the resolver are usually implemented in the time domain [10]. In this method, the peak point is usually used to extract the envelope of the signal, but this will cause the resolution of the envelope signal to decline, and the rotor position calculated by the sampled values is inaccurate in the high-speed region when the excitation frequency is relatively low [11]. In software-based RDC, the arctangent or the angle tracking observer are often used to calculate the rotor position [12, 13]. Because of the direct arctangent operation on the envelope, the smooth angular value cannot be obtained by the arctangent method when there is noise [14]. The ADO-based RDC method can obtain a high-precision rotor position by using closed-loop control [15]. However, the steady-state error will be introduced when the speed changes [16, 17]. Therefore, although the RDC algorithm based on the time domain can be operated online, it is difficult to get the ideal decoding effect under the severe condition of noise interference. In order to overcome these problems, some researchers use Hilbert transform to extract the signal envelope of the resolver [18]. Hilbert is essentially a phase shifter, which is suitable for the offline operation. However, in strong noise applications, it is often necessary to combine other filtering techniques to achieve efficient envelope extraction [19, 20].The sine-cosine signal output by the resolver is essentially the single-frequency nonstationary signal, and their main frequency component is the excitation frequency. The time-frequency analysis has been proved to be an effective tool for analyzing unsteady signals. However, its real-time application is limited due to the large amount of computation [21]. Nonergodic S-transform (NEST), as a time-frequency analysis method, adopts the nonergodic spectrum calculation mode, inherits the intuitive and antinoise characteristics of S-transform, and reduces the computational load obviously. It has been applied in power quality analysis and other fields [22]. Under the condition of synchronous sampling, NEST can effectively extract signal amplitude and get accurate mode envelope, but in the case of asynchronous sampling, there will be an end effect problem [23].In this paper, NEST is introduced into the RDC method, which is named as the principal frequency component S-transform (PFCST) because it only deals with the excitation frequency. By analyzing the relationship between the accuracy of envelope extracted by S-transform and the window width coefficient of its kernel function, as well as the end effect elimination technology, the specific method of extracting the mode envelope of the output signal of the resolver by S-transform is determined. In the nonzero region, the quadrant judgment rules are established by the polarity of excitation and the resolver output signals, and a complete method of rotor position calculation is formed by combining the arctangent method. Because of the inherent filtering property of S-transform and the calculation of single-frequency components, the real time and accuracy of the proposed method can meet the requirements of the practical application, which has been verified by simulations and experiments.


## 2. Principle of Resolver and PFCST

### 2.1. Operation Principle of Resolver

As a high-precision rotor position sensor, the input signal of the resolver is excitationve, and its two output signals are sinusoidal and cosine modulation of excitation, which are vsin and vcos, respectively, as shown in Figure 1.Figure 1
Simplified operation principle diagram of the resolver.According to Figure1, the excitation coil installed in the rotor generates alternating the magnetic field by input excitation ve. The sinusoidal coil and cosine coil which are orthogonally installed in the stator of the resolver are induced by the magnetic field of the excitation coil to produce alternating voltage vsin and vcos, whose amplitude is related to the rotor position. ve, vsin, and vcos can be expressed as follows:(1)ve=Uesinωt,vsin=kUesinωtsinθ,vcos=kUesinωtcosθ,where k is the transformer voltage ratio, Ue is the excitation amplitude, ω is the excitation angular frequency, and θ is the rotation angle of the rotor.The envelopes of orthogonal signalsvsin and vcos can be obtained by demodulation technology and expressed as follows:(2)vs=kUesinθ,vc=kUecosθ.According to (2), the rotor position θ can be derived as follows:(3)θ=actanvsvc.In formula (2), vs and vc are usually detected by the peak value of ve, which causes the resolution of the envelope to decrease. In addition, under the condition of noise, θ obtained from (3) has a large error, and even a sharp jump makes the result unavailable [1]. Therefore, it is very important to develop a noise-insensitive envelope extraction technology for solving accurate θ.


### 2.2. PFCST

S-transform is a kind of time-frequency analysis method, which adds Gauss window to every frequency-domain point, resulting in a large amount of calculation [24]. The amplitude of specific frequency components of nonstationary signals can be effectively obtained by NEST [23], and the expression of NEST is(4)Sn,lr=∑m=0N−1Hm+lrGm,lr,qre2πjmn/N,r=1,2,…,R,where n and m are the time and frequency index, lr is the index of concern frequency point r, N is the number of hn samples, j is the complex operator, and Hm is the DFT of hn. Gm,l,qr is the Gaussian window which is tuned by the coefficient qr. Gm,lr,qr and qr can be expressed by(5)Gm,lr,qr=e−qm2/lr,qr=2π2gNT,where g is a constant.In the NEST process, onlyR vectors of concern frequency points are calculated, which significantly reduces the computational complexity compared with S-transform because S-transform needs to compute N vectors. The principal frequency component of the resolver signals vsin and vcos is the excitation frequency. The envelope of the resolver signals can be demodulated by calculating the amplitude of the excitation frequency component. Using NEST to analyze the resolver signal only needs to analyze its principal frequency component; that is, only a single vector is calculated. In this case, the NEST is named PFCST and can be expressed as follows:(6)Spn=Sn,le,where le is the index of excitation frequency.According to NEST implementation in [23], the process of Spn is shown in Figure 2 and the calculation steps of Spn can be expressed as follows:Step 1: calculate the FFT of the input signalhn to obtain the spectrum HmStep 2: the peak value of the absoluteHm is fined to obtain the corresponding index of the principal frequency point leStep 3: shiftHm with le to obtain Hm+le and compute the Gaussian window Gm,le,qeStep 4: use IFFT to the product ofHm+le and Gm,le,qe for obtaining the SpnFigure 2
PFCST process.If the signal length of each analysis remains unchanged, the second step mentioned above can be omitted becausele is a fixed value. In this case, Gm,le,qe does not need to be calculated every time because the value of the Gauss window function is the same. Therefore, under the condition of the equal-length signal analysis, the calculation time of Spn can be further reduced. On a computer with Intel i5-5300U@2.30 GHz CPU, the calculation time of the 1000-point data and 2000-point data tested by S-transform is 44.852 ms and 178.097 ms, respectively. In the same case, PFCST only takes 0.066 ms and 0.125 ms. It can be seen that the computation time of PFCST is much shorter than that of S-transform.


## 2.1. Operation Principle of Resolver

As a high-precision rotor position sensor, the input signal of the resolver is excitationve, and its two output signals are sinusoidal and cosine modulation of excitation, which are vsin and vcos, respectively, as shown in Figure 1.Figure 1
Simplified operation principle diagram of the resolver.According to Figure1, the excitation coil installed in the rotor generates alternating the magnetic field by input excitation ve. The sinusoidal coil and cosine coil which are orthogonally installed in the stator of the resolver are induced by the magnetic field of the excitation coil to produce alternating voltage vsin and vcos, whose amplitude is related to the rotor position. ve, vsin, and vcos can be expressed as follows:(1)ve=Uesinωt,vsin=kUesinωtsinθ,vcos=kUesinωtcosθ,where k is the transformer voltage ratio, Ue is the excitation amplitude, ω is the excitation angular frequency, and θ is the rotation angle of the rotor.The envelopes of orthogonal signalsvsin and vcos can be obtained by demodulation technology and expressed as follows:(2)vs=kUesinθ,vc=kUecosθ.According to (2), the rotor position θ can be derived as follows:(3)θ=actanvsvc.In formula (2), vs and vc are usually detected by the peak value of ve, which causes the resolution of the envelope to decrease. In addition, under the condition of noise, θ obtained from (3) has a large error, and even a sharp jump makes the result unavailable [1]. Therefore, it is very important to develop a noise-insensitive envelope extraction technology for solving accurate θ.


## 2.2. PFCST

S-transform is a kind of time-frequency analysis method, which adds Gauss window to every frequency-domain point, resulting in a large amount of calculation [24]. The amplitude of specific frequency components of nonstationary signals can be effectively obtained by NEST [23], and the expression of NEST is(4)Sn,lr=∑m=0N−1Hm+lrGm,lr,qre2πjmn/N,r=1,2,…,R,where n and m are the time and frequency index, lr is the index of concern frequency point r, N is the number of hn samples, j is the complex operator, and Hm is the DFT of hn. Gm,l,qr is the Gaussian window which is tuned by the coefficient qr. Gm,lr,qr and qr can be expressed by(5)Gm,lr,qr=e−qm2/lr,qr=2π2gNT,where g is a constant.In the NEST process, onlyR vectors of concern frequency points are calculated, which significantly reduces the computational complexity compared with S-transform because S-transform needs to compute N vectors. The principal frequency component of the resolver signals vsin and vcos is the excitation frequency. The envelope of the resolver signals can be demodulated by calculating the amplitude of the excitation frequency component. Using NEST to analyze the resolver signal only needs to analyze its principal frequency component; that is, only a single vector is calculated. In this case, the NEST is named PFCST and can be expressed as follows:(6)Spn=Sn,le,where le is the index of excitation frequency.According to NEST implementation in [23], the process of Spn is shown in Figure 2 and the calculation steps of Spn can be expressed as follows:Step 1: calculate the FFT of the input signalhn to obtain the spectrum HmStep 2: the peak value of the absoluteHm is fined to obtain the corresponding index of the principal frequency point leStep 3: shiftHm with le to obtain Hm+le and compute the Gaussian window Gm,le,qeStep 4: use IFFT to the product ofHm+le and Gm,le,qe for obtaining the SpnFigure 2
PFCST process.If the signal length of each analysis remains unchanged, the second step mentioned above can be omitted becausele is a fixed value. In this case, Gm,le,qe does not need to be calculated every time because the value of the Gauss window function is the same. Therefore, under the condition of the equal-length signal analysis, the calculation time of Spn can be further reduced. On a computer with Intel i5-5300U@2.30 GHz CPU, the calculation time of the 1000-point data and 2000-point data tested by S-transform is 44.852 ms and 178.097 ms, respectively. In the same case, PFCST only takes 0.066 ms and 0.125 ms. It can be seen that the computation time of PFCST is much shorter than that of S-transform.


## 3. The Proposed Technique

The block diagram of PFCST-based RDC is shown in Figure3, and its process can be expressed as follows:(1)
The two output signalsvsinn and vcosn of the resolver are transformed by PFCST to obtain Spsn and Spcn, respectively.(2)
By calculating the arctangent of the absolute values ofSpsn and Spcn, the angular values corresponding to the first quadrant θ^0n can be obtained, which can be expressed as follows:(7)θ^0n=arctanSpsnSpcn.(3)
In order to get the accurate angle value, quadrant information is needed to modifyθ^0n. The quadrant information is obtained by Q value, which is expressed as follows:(8)Q=signvsinnopvenop+2×signvcosnopvenop,wheresign is the sign function and nop is the index of the optimal peak point.It can be seen from formula (8) that the Q value is obtained by calculating the polarity relationship between the peak value of excitation and the peak value of vsinn and vcosn. nop is selected near the intersection of the amplitudes (see Figure 4) or in the large area of the smaller ones (see Figure 5) to ensure that vsinn and vcosn have sufficient amplitudes for polarity judgment and are not disturbed by noise.(4)
Quadrants is obtained by using Q through the table of quadrant recognition rules, as shown in Table 1, and two-angle correction coefficients u and w are obtained by using the following equation:(9)u=−1s,w=2×floors2,wherefloor means downward rounding.(5)
Finally, the following equation is used to get the corrected angleθ^n to complete the RDC process:(10)θ^n=u×θ^0n+w×90.Figure 3
Block diagram of PFCST-based RDC.Figure 4
n
op selection case 1: (a) original signals; (b) PFCST results of signals in (a).
(a)
(b)Figure 5
n
op selection case 2: (a) original signals; (b) PFCST results of signals in (a).
(a)
(b)Table 1
Quadrant recognition rules.
Value
Rules
Q
3
−1
−3
1
S
1
2
3
4The unit ofθ^n obtained by formula (10) is degree.It should be noted that RDC based on PFCST needs to deal with the end effects and the window width coefficients. This paper uses the method of reference [16] to deal with them, without further elaboration.According to (1), the rotation speed of the resolver can be easily obtained as follows:(11)v^n=fs×Δθ^np×α×60,where fs is the sampling frequency, p is the pole-pair number of the resolver, and Δθ^n is the change value of θ^n of the consecutive α sampling points. The unit of v^n in formula (11) is rpm. Because Δθ^n can be positive or negative, the polarity of v^n can reflect the rotation direction of the resolver.


## 4. Simulations and Experiments

### 4.1. Simulations

To verify the validity of the proposed method, MATLAB software is used to simulate the excitationven and vsinn and vcosn signals of the resolver. The ven frequency is 10 kHz, the sampling frequency fs is 250 kHz, the amplitude is 10 pu (1pu = 1 volt), the pole-pair number p is 4, and the transformer voltage ratio k is 0.2.The rotational speed parameters are set to simulate the ultralow-speed, low-speed, medium-speed, and high-speed conditions of the resolver. Figure6 is the process data graph of the rotation angle of the resolver calculated by the proposed method when the rotation speed is 2300 rpm. The maximum error of speed decoding under various conditions is shown in Table 2. From Table 2, it can be seen that the absolute error of the proposed method is less than 1 rpm, which has a high accuracy.Figure 6
Process data of PFCST-based RDC: (a) original signals; (b) PFCST results of signals in (a); (c) quadrant recognition result; (d) rotation angle of the resolver calculated by the proposed method.
(a)
(b)
(c)
(d)Table 2
The maximum error of speed decoding under various conditions.
Speed condition
Setting rotation speed (rpm)
Decoding speed value (rpm)
Absolute error (rpm)
Ultralow
100
99.90
0.10
Low
750
749.38
0.62
Medium
2300
2299.91
0.09
High
8000
7999.15
0.85The error analysis of the proposed method under different working conditions is carried out. The main sources of the error are investigated by using the difference sequence between the estimated angle value and the true value, and its expression is as follows:(12)εn=θ^n−θn,where θn is the true value of the rotation angle of the resolver.Taking the working condition with a set rotation speed of 5000 rpm as an example, the rotation angle of the resolver obtained by the proposed method is compared with the true angle to obtain theεn value, as shown in Figure 7. From Figure 7(d), it can be seen that larger εn occurs at the quadrant junction. At these points, there is always a vector value close to zero in Spsn or Spcn, so it is easy to bring errors when using the arctangent to calculate the angle value. At the same time, it can be seen that even at these points, the error of θ^n does not exceed one deg., which shows that the RDC method in this paper has high accuracy. The statistics of εn under different speed conditions of the proposed algorithm are shown in Figure 8. It can be seen that εn increases with the increase of rotating speed. This is because the higher the speed is, the faster the envelopes change, which leads to the larger tracking error of PFCST.Figure 7
Estimation error ofθ^n at 5000 rpm speed: (a) original signals; (b) PFCST results of signals in (a); (c) rotation angle of the resolver; (d) the difference between the estimated value and the true value.
(a)
(b)
(c)
(d)Figure 8
Estimation error ofθ^n under various conditions.In order to verify the effect of noise on this method, white Gaussian noise is added to the original signal in Figure7 to make its SNR (signal to noise ratio) 20 dB. The noise is added to the original signal by using the Gaussian white noise-adding function AWGN (add white Gaussian noise to a signal) of MATLAB. The difference between the PFCST-based angle and the real angle is shown in Figure 9(c). From Figure 9, it can be seen that because PFCST has intrinsic filtering characteristics, and the Spsn and Spcn transformed by PFCST have almost eliminated the influence of noise, so the θ^n obtained from them is almost unaffected by noise.Figure 9
Analysis of signals containing noise: (a) original signals; (b) PFCST results of signals in (a); (c) the difference between the estimated value and the true value.
(a)
(b)
(c)


### 4.2. Experiments

To verify the adaptability of the proposed algorithm to the actual signals, a setup for resolver signal decoding is built, as shown in Figure10. The test device mainly includes the resolver (pole-pair number is 4), drive motor, inverter, DSP development board, signal generator, and oscilloscope. The drive motor is controlled by the inverter to operate at different rotating speeds. The signal generator provides the excitation signal for the resolver. The sinusoidal and cosine signals output by the resolver are sampled by A/D converter of DSP board, and the PFCST-based RDC algorithm is realized by the TMS320F28335 chip. The resolver signal is decoded. The decoding result is output by a D/A converter for the oscilloscope observation.Figure 10
The experiment setup.The decoding results of the resolver at the ultralow-speed, low-speed, medium-speed, and high-speed conditions are verified on the test platform. In order to match the voltage range of the D/A converter, the signals input to it are normalized. The decoding results of some working conditions are shown on the oscilloscope as shown in Figures11 and 12.Figure 11
Waveform at 1000 rpm rotation speed.Figure 12
Waveform at 8000 rpm rotation speed.Figures11 and 12 are the oscilloscope waveforms of RDC under 1000 rpm and 8000 rpm rotating speed conditions, respectively. The signal of channel 1 of the oscilloscope is the quadrant judgment result. From the sine and cosine signals of the resolver in channel 2 and channel 3, it can be seen that the quadrant judgment result is correct. At the same time, it can be seen from channel 4 that the decoding result of the resolver angle based on the proposed algorithm is also correct.


## 4.1. Simulations

To verify the validity of the proposed method, MATLAB software is used to simulate the excitationven and vsinn and vcosn signals of the resolver. The ven frequency is 10 kHz, the sampling frequency fs is 250 kHz, the amplitude is 10 pu (1pu = 1 volt), the pole-pair number p is 4, and the transformer voltage ratio k is 0.2.The rotational speed parameters are set to simulate the ultralow-speed, low-speed, medium-speed, and high-speed conditions of the resolver. Figure6 is the process data graph of the rotation angle of the resolver calculated by the proposed method when the rotation speed is 2300 rpm. The maximum error of speed decoding under various conditions is shown in Table 2. From Table 2, it can be seen that the absolute error of the proposed method is less than 1 rpm, which has a high accuracy.Figure 6
Process data of PFCST-based RDC: (a) original signals; (b) PFCST results of signals in (a); (c) quadrant recognition result; (d) rotation angle of the resolver calculated by the proposed method.
(a)
(b)
(c)
(d)Table 2
The maximum error of speed decoding under various conditions.
Speed condition
Setting rotation speed (rpm)
Decoding speed value (rpm)
Absolute error (rpm)
Ultralow
100
99.90
0.10
Low
750
749.38
0.62
Medium
2300
2299.91
0.09
High
8000
7999.15
0.85The error analysis of the proposed method under different working conditions is carried out. The main sources of the error are investigated by using the difference sequence between the estimated angle value and the true value, and its expression is as follows:(12)εn=θ^n−θn,where θn is the true value of the rotation angle of the resolver.Taking the working condition with a set rotation speed of 5000 rpm as an example, the rotation angle of the resolver obtained by the proposed method is compared with the true angle to obtain theεn value, as shown in Figure 7. From Figure 7(d), it can be seen that larger εn occurs at the quadrant junction. At these points, there is always a vector value close to zero in Spsn or Spcn, so it is easy to bring errors when using the arctangent to calculate the angle value. At the same time, it can be seen that even at these points, the error of θ^n does not exceed one deg., which shows that the RDC method in this paper has high accuracy. The statistics of εn under different speed conditions of the proposed algorithm are shown in Figure 8. It can be seen that εn increases with the increase of rotating speed. This is because the higher the speed is, the faster the envelopes change, which leads to the larger tracking error of PFCST.Figure 7
Estimation error ofθ^n at 5000 rpm speed: (a) original signals; (b) PFCST results of signals in (a); (c) rotation angle of the resolver; (d) the difference between the estimated value and the true value.
(a)
(b)
(c)
(d)Figure 8
Estimation error ofθ^n under various conditions.In order to verify the effect of noise on this method, white Gaussian noise is added to the original signal in Figure7 to make its SNR (signal to noise ratio) 20 dB. The noise is added to the original signal by using the Gaussian white noise-adding function AWGN (add white Gaussian noise to a signal) of MATLAB. The difference between the PFCST-based angle and the real angle is shown in Figure 9(c). From Figure 9, it can be seen that because PFCST has intrinsic filtering characteristics, and the Spsn and Spcn transformed by PFCST have almost eliminated the influence of noise, so the θ^n obtained from them is almost unaffected by noise.Figure 9
Analysis of signals containing noise: (a) original signals; (b) PFCST results of signals in (a); (c) the difference between the estimated value and the true value.
(a)
(b)
(c)


## 4.2. Experiments

To verify the adaptability of the proposed algorithm to the actual signals, a setup for resolver signal decoding is built, as shown in Figure10. The test device mainly includes the resolver (pole-pair number is 4), drive motor, inverter, DSP development board, signal generator, and oscilloscope. The drive motor is controlled by the inverter to operate at different rotating speeds. The signal generator provides the excitation signal for the resolver. The sinusoidal and cosine signals output by the resolver are sampled by A/D converter of DSP board, and the PFCST-based RDC algorithm is realized by the TMS320F28335 chip. The resolver signal is decoded. The decoding result is output by a D/A converter for the oscilloscope observation.Figure 10
The experiment setup.The decoding results of the resolver at the ultralow-speed, low-speed, medium-speed, and high-speed conditions are verified on the test platform. In order to match the voltage range of the D/A converter, the signals input to it are normalized. The decoding results of some working conditions are shown on the oscilloscope as shown in Figures11 and 12.Figure 11
Waveform at 1000 rpm rotation speed.Figure 12
Waveform at 8000 rpm rotation speed.Figures11 and 12 are the oscilloscope waveforms of RDC under 1000 rpm and 8000 rpm rotating speed conditions, respectively. The signal of channel 1 of the oscilloscope is the quadrant judgment result. From the sine and cosine signals of the resolver in channel 2 and channel 3, it can be seen that the quadrant judgment result is correct. At the same time, it can be seen from channel 4 that the decoding result of the resolver angle based on the proposed algorithm is also correct.


## 5. Conclusion

The envelope of the resolver signal can be extracted accurately by PFCST, and the envelope curve can be kept smooth even in the noisy environment. Because the envelope based on PFCST has the same time resolution as the original signal, the PFCST-based RDC method can also obtain the high-angle resolution. The angle decoding error of this method mainly occurs at the quadrant junction, but the absolute value of the error is less than 1 deg., which has little effect on the result of the velocity calculation. The computational complexity of this method is relatively small and easy to implement.



---

*Source: 3167687-2019-12-11.xml*