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

. 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 PFCSTmaintains 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 eﬀectiveness of the proposed method.


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].
e existing RDC methods can be divided into two categories: hardware-based and software-based [3].e core of the hardware-based RDC method is to use a special decoding chip [4,5].
is method has a high decoding accuracy, but the chip cost is high and the hardware design is complex.erefore, more and more researchers are seeking more flexible, convenient, and low-cost RDC methods.e 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.e 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 highspeed 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].
e ADO-based RDC method can obtain a highprecision rotor position by using closed-loop control [15].However, the steady-state error will be introduced when the speed changes [16,17].erefore, 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].
e sine-cosine signal output by the resolver is essentially the single-frequency nonstationary signal, and their main frequency component is the excitation frequency.e timefrequency 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.

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 excitation v e , and its two output signals are sinusoidal and cosine modulation of excitation, which are v sin and v cos , respectively, as shown in Figure 1.
According to Figure 1, the excitation coil installed in the rotor generates alternating the magnetic field by input excitation v e .e 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 v sin and v cos , whose amplitude is related to the rotor position.v e , v sin , and v cos can be expressed as follows: v e � U e sin(ωt), where k is the transformer voltage ratio, U e is the excitation amplitude, ω is the excitation angular frequency, and θ is the rotation angle of the rotor.e envelopes of orthogonal signals v sin and v cos can be obtained by demodulation technology and expressed as follows: v s � kU e sin θ, According to (2), the rotor position θ can be derived as follows: In formula (2), v s and v c are usually detected by the peak value of v e , 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].erefore, it is very important to develop a noise-insensitive envelope extraction technology for solving accurate θ.

PFCST.
S-transform is a kind of time-frequency analysis method, which adds Gauss window to every frequencydomain point, resulting in a large amount of calculation [24].
e amplitude of specific frequency components of nonstationary signals can be effectively obtained by NEST [23], and the expression of NEST is where n and m are the time and frequency index, l r is the index of concern frequency point r, N is the number of h(n) samples, j is the complex operator, and H(m) is the DFT of h(n).G(m, l, q r ) is the Gaussian window which is tuned by the coefficient q r .G(m, l r , q r ) and q r can be expressed by where g is a constant.In the NESTprocess, only R 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.e principal frequency component of the resolver signals v sin and v cos is the excitation frequency.e 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: where l e is the index of excitation frequency.
According to NEST implementation in [23], the process of S p (n) is shown in Figure 2 and the calculation steps of S p (n) can be expressed as follows: Step 1: calculate the FFT of the input signal h(n) to obtain the spectrum H(m) Step 2: the peak value of the absolute H(m) is fined to obtain the corresponding index of the principal frequency point l e Step 3: shift H(m) with l e to obtain H(m + l e ) and compute the Gaussian window G(m, l e , q e ) Step 4: use IFFT to the product of H(m + l e ) and G(m, l e , q e ) for obtaining the S p (n) If the signal length of each analysis remains unchanged, the second step mentioned above can be omitted because l e is a fixed value.In this case, G(m, l e , q e ) does not need to be calculated every time because the value of the Gauss window function is the same.erefore, under the condition of the equal-length signal analysis, the calculation time of S p (n) can be further reduced.On a computer with Intel i5-5300U@2.30GHz 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.

The Proposed Technique
e block diagram of PFCST-based RDC is shown in Figure 3, and its process can be expressed as follows: (1) e two output signals v sin (n) and v cos (n) of the resolver are transformed by PFCST to obtain S ps (n) and S pc (n), respectively.(2) By calculating the arctangent of the absolute values of S ps (n) and S pc (n), the angular values corresponding to the first quadrant  θ 0 (n) can be obtained, which can be expressed as follows: (3) In order to get the accurate angle value, quadrant information is needed to modify  θ 0 (n).e quadrant information is obtained by Q value, which is expressed as follows: where sign[ ] is the sign function and n op 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 v sin (n) and v cos (n).n op 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 v sin (n) and v cos (n) have sufficient amplitudes for polarity judgment and are not disturbed by noise.(4) Quadrant s 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: where floor( ) means downward rounding.(5) Finally, the following equation is used to get the corrected angle  θ(n) to complete the RDC process: Journal of Electrical and Computer Engineering e 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.
is 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: where f s 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.e unit of  v(n) in formula (11)

Simulations.
To verify the validity of the proposed method, MATLAB software is used to simulate the excitation v e (n) and v sin (n) and v cos (n) signals of the resolver.e v e (n) frequency is 10 kHz, the sampling frequency f s 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.e rotational speed parameters are set to simulate the ultralow-speed, low-speed, medium-speed, and high-speed conditions of the resolver.Figure 6 is the process data graph of the rotation angle of the resolver calculated by the proposed method when the rotation speed is 2300 rpm.e 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.
e error analysis of the proposed method under different working conditions is carried out.e main sources of the error are investigated by using the di erence sequence between the estimated angle value and the true value, and its expression is as follows: 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 |S ps (n)| or |S pc (n)|, 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.e statistics of ε(n) under di erent speed conditions of the proposed algorithm are shown in Figure 8.It can be seen that ε(n) increases with the increase of rotating speed. is is because the higher the speed is, the faster the envelopes change, which leads to the larger tracking error of PFCST.
In order to verify the e ect of noise on this method, white Gaussian noise is added to the original signal in Figure 7 to make its SNR (signal to noise ratio) 20 dB. e 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.e di erence 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 ltering characteristics, and the |S ps (n)| and |S pc (n)| transformed by PFCST have almost eliminated the in uence of noise, so the θ(n) obtained from them is almost una ected by noise.

Experiments.
To verify the adaptability of the proposed algorithm to the actual signals, a setup for resolver signal decoding is built, as shown in Figure 10.e test device mainly includes the resolver (pole-pair number is 4), drive motor, inverter, DSP development board, signal generator, and oscilloscope.e drive motor is controlled by the inverter to operate at di erent rotating speeds.
e signal generator provides the excitation signal for the resolver.e      Figures 11 and 12 are the oscilloscope waveforms of RDC under 1000 rpm and 8000 rpm rotating speed conditions, respectively.e 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.

Conclusion
e 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 highangle resolution.e 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.e computational complexity of this method is relatively small and easy to implement.Journal of Electrical and Computer Engineering

Figure 1 :
Figure 1: Simplified operation principle diagram of the resolver.

Figure 6 :
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.

Figure 7 :Figure 9 :
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 di erence between the estimated value and the true value.
sinusoidal and cosine signals output by the resolver are sampled by A/D converter of DSP board, and the PFCSTbased RDC algorithm is realized by the TMS320F28335 chip.e resolver signal is decoded.e decoding result is output by a D/A converter for the oscilloscope observation.e decoding results of the resolver at the ultralowspeed, 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.e decoding results of some working conditions are on the oscilloscope as shown in Figures 11 and 12 .

Table 2 :
e maximum error of speed decoding under various conditions.