Suppressing Harmonics in Resolver Signals via FLL Based Complementary Filters

In order to obtain accurate angular position and velocity from resolver signals, Resolver-to-Digital Conversion (RDC) is necessary. However, there are inevitable harmonics in resolver signals, which will deteriorate RDC accuracy seriously. Although the harmonics of resolver signals can be suppressed by using low-pass filters (LPFs), the phase lag of LPFs will result in additional errors in RDC, especially for the suppression of lower-order harmonics. In this paper, a novel filtering strategy is proposed for resolver signals by combining two complementary filters (CFs) with a frequency locked loop (FLL). Firstly, CFs are designed for the sinusoidal and cosinusoidal channels by using the natural orthogonality in the resolver signals. Each CF consists of two LPFs assisted by the estimated frequency from FLL with a frequency discriminator and a second-order observer. Secondly, a frequency discriminator is designed to detect the frequency error between the resolver signals before and after CFs. Thirdly, a second-order observer is designed to estimate the signal frequency by regulating the frequency error. Compared with conventional LPFs, FLL based CFs can suppress the low-frequency harmonics without phase lags and can improve RDC accuracy. Simulation and experimental results demonstrate the effectiveness of the proposed strategy.


I. INTRODUCTION
As a kind of shaft angle transducers with high accuracy, strong reliability, and great ruggedness, resolvers have been widely used in many harsh environments, such as aerospace, navigation, ordnance, industrial robots, and electric vehicles, etc. [1]- [5]. Since resolvers can only output two orthogonal signals modulated by high-frequency excitation, resolver-todigital conversion (RDC) is necessary to obtain rotor position and velocity [6]. High accuracy RDC is the key to realize high performance servo control [7].
However, the accuracy of RDC depends on the quality of resolver signals, which are usually disturbed by many unexpected factors, such as amplitude asymmetry, DC offsets, quadrature error, and harmonics [8]. The first three factors do not change with the rotor speed and can be removed in software-based RDC by using calibration methods in [9]- [10]. Unfortunately, the last factor can not be simply rejected by using calibration since it varies with the rotor speed. Although the resolver structure can be optimized to minimize harmonic distortion in resolver signals, there are a certain amount of harmonics owing to manufacturing tolerance and non-ideal conditioning circuits [11]- [13]. The residual harmonics can degrade RDC accuracy to a great extent. Therefore, suppressing harmonics in resolver signals is still a challenging task to improve RDC accuracy [14].
Low-pass filter (LPF) is the most common solution to suppress harmonics in resolver signals. For example, a 4thorder Butterworth LPF was adopted in [15] to filter the resolver signals before the angle tracking loop. In [16] and [17], low-pass FIR filters were also used to suppress harmonics and noises in resolver signals. These filters have fixed cutoff frequency which design is a dilemma in applications. If the harmonic frequency to be filtered is very low, only a lower cutoff frequency can be selected, which will cause a large phase lag in the fundamental component of resolver signals. To reduce the phase lag caused by LPF, a higher cutoff frequency should be selected. However, the LPF with higher cutoff frequency can only reject highfrequency harmonics and noises in resolver signals.
To solve the contradiction between the filtering performance and the phase lag of LPFs, an auto-tuning highpass filter was proposed for the noisy speed output in [18]. By using the high-pass filter, the harmonics and noises in the speed are estimated first and then subtracted from the unfiltered speed. However, the high-pass filter plus the subtraction are still low pass in essence and the phase lag problem of LPF can not be avoided. In [19], an adaptive digital PLL was proposed for magnetic encoders and four LPFs with adjustable cutoff frequency were designed to remove low-frequency harmonics from the inputs. In addition, the phase lag caused by LPFs was compensated by using frequency-aided detector. However, the frequencyaided detector needs the derivatives of the signals which may result in noise amplification.
Many other methods are also reported to suppress harmonics for resolvers or magnetic encoders. In [18], a peak filter was proposed to estimate the amplitudes of harmonics in the speed estimation and then subtract them from the unfiltered speed of resolvers. In [20], a gradient descent algorithm was designed to estimate the harmonics in the demodulated angle and then compensate them in the phase locked loop. However, it is very difficult to achieve highprecision estimates for all harmonics. Although the secondorder generalized integrator with FLL in [21] could filter resolver signals without estimation of harmonics, it was an adaptive notch filter in essence and could not suppress lowerorder harmonics as well.
Actually, there is a filtering method without phase lags reported in many literatures, i.e., complementary filters (CFs) [22]. The idea of complementary filters is to remove highfrequency and low-frequency noises in the complementary signals by using low-pass and high-pass filters respectively. The so-called complementary signals refer to pair signals containing the same useful information but different noises with low or high frequency. Typically, the complementary signals are measured by two kinds of sensors with the relationship of differentiation [23]- [24]. One can output useful information containing high-frequency noises, the other can output useful information containing lowfrequency noises [25]. By using complementary filters, the useful information can be extracted from complementary signals without phase delay.
Inspired by complementary filters without phase delay [26], a novel filtering strategy is proposed for resolver signals in this paper. Since the pair signals of resolver are only orthogonal, they can be reconstructed to be complementary by using the information of angular frequency. Thus, complementary filters can be designed for sinusoidal and cosinusoidal channels respectively. For the information of angular frequency, it can be estimated by using the proposed FLL consisting of a frequency discriminator and a secondorder observer. The frequency discriminator can detect the frequency error before and after the complementary filters, and the second-order observer can estimate the angular frequency. By using FLL based CFs, the low-frequency harmonics can be suppressed in revolver signals without phase delay.
The rest sections of the paper are arranged as follows. In Section II, RDC principles are described and harmonic effects on RDC accuracy are analyzed. In Section III, FLL based CFs are proposed. In Section IV, simulation and experimental results are given. Finally, the conclusion of the paper is made in Section V.

A. RDC PRINCIPLES
where  and  denote angular position and velocity of the rotor respectively; v 1 is the amplitude of the pair signals.
Usually, the excitation frequency e is designed much higher than the rotor frequency . As a result, the second terms in (1) can be neglected [27] and (1) can be approximated as In order to reduce the burden of A/D converters in software-based RDC, synchronous envelope detection is often used [28]. Ideally, the pair envelope signals after synchronous detection can be obtained as However, the envelope signals are not ideal in practice owing to many unexpected factors from resolvers and conditioning circuits. They often contains amplitude deviation, DC offsets, quadrature error, harmonics, and noises [29]. By using calibration and filtering technology, the non-ideal envelope signals can be corrected to be symmetric and orthogonal with low noises and harmonics. After that, the pretreated signals are sent to PLL to accomplish resolverto-digital conversion.

B. ANALYSIS OF HARMONICS EFFECTS ON RDC ACCURACY
As overviewed above, the problems of amplitude deviation, DC offsets, and quadrature error can be easily solved by calibration. However, it is very difficult to reject all the harmonics in the envelope signals, especially for the lower-order harmonics with the frequency near to the rotor velocity. The residual harmonics will still degrade RDC accuracy seriously. To analyze the effects of the harmonics on RDC accuracy, the envelope signals are assumed to be symmetric, orthogonal, and have unit fundamentals. They can be expressed as [ where kn is the coefficient of the nth-order harmonics. Let  denote the estimated position from PLL, then phase detection error of PLL can be derived as ˆĉ os sin Define the position error as =     , then (6) can be rewritten as 22 1 cos( 1) sin sin( 1) cos Since the aim of PLL is to regulate phase detection error  to be zero, the following equation can be derived from (7)  Since the position error  is very small when PLL enters steady state, cos 1   , sin   . And also, the harmonic coefficient kn is far less than 1 when n>1. Therefore, (8) can be approximated as From (9), it is clear that the nth harmonic of resolver signals will cause the (n-1)th harmonic component with the same coefficient kn in the demodulated position. To attenuate the harmonic effects on RDC accuracy, LPFs are often adopted to reduce the harmonic coefficient kn as small as possible. However, LPFs can not deal with lower-order harmonics close to the fundamental frequency. Furthermore, the phase delay of LPFs will cause additional adverse effects on RDC. Suppressing harmonics, especially the lower-order ones in resolver signals, is still an urgent problem to solve in the design of high accuracy RDC.

III. FLL BASED COMPLEMENTARY FILTERS
In order to suppress harmonics in resolver signals, a pair of CFs assisted by FLL are proposed in this section, as shown in Fig 2. The function of CFs is to filter resolver signals without phase delay, while the function of FLL is to provide the estimated fundamental frequency of resolver signals for CFs. In FLL, the frequency discriminator is in charge of detecting the frequency error before and after CFs, while the second-order observer is in charge of estimating the fundamental frequency. The FLL based CFs will designed from three parts as follows.

A. COMPLEMENTARY FILTERS
Owing to the advantages in simple implementation and zero delay, CFs have been widely used in many fields, such as attitude estimation, navigation, etc. To suppress harmonics without additional phase delay, CFs are introduced to filter resolver signals [31]. However, the pair signals of resolver are only orthogonal and do not conform to the condition of CFs. Actually, the pair signals of resolver can be reconstructed to meet the need of CF design by multiplying the signal with angular frequency or negative one. Now, we will take the sinusoidal channel as an example to show the reconstruction of the pair signals and the design of CF.
Assume the angular frequency is  and =t, then the pair signals of resolver after calibration in (4) can be rewritten as Taking Laplace transform of (10) gives Exmaine /(s 2 + 2 ) and s/(s 2 + 2 ) in (11), it is clear that the integral of the latter one multiplied by  will become the former one. Therefore, two LPFs can be designed as the CF.  (14) where the symbol  denotes the operation of convolution.
According to (14), it is known that the fundamental component can fully pass through the CF. However, there is also one nth of the nth harmonic in the filter output. The other harmonics can be effectively attenuated by LPFs with suitable cutoff frequency or time constant. Even if the cutoff frequency of LPFs is very near to the fundamental component, no additional phase lags will be introduced.
Although the proposed CF in (12) can effectively filter the harmonics in (10), the information of the angular frequency  is not available at this time. Therefore, the estimated angular frequency f from FLL can be used instead of  in (12 where int() represents a function rounding down to the nearest integer, b is the interval width of the angular frequency. According to (17), the cutoff frequency of CFs is chosen as the center of the interval [kb, (k+1)b] in which the estimated angular frequency f locates, k=0, 1, 2, . It means that CFs can suppress harmonics without additional harms to the fundamental components even if the cutoff frequency is designed lower than the fundamental frequency.

B. FREQUENCY DISTRIMINATOR
In order to derive the estimation of the angular frequency f in (15) and (16) from FLL, a frequency discriminator is designed to detect the estimation error f of . Since the estimation error f will result in certain errors in the output of CFs, the signals before and after CFs can be used to construct f. For simplicity, only fundamental components in the pair signals of resolver are considered here. Thus, the unfiltered signals (11) can be rewritten as 22 22 () Substitute (18) into (15) and (16) According to (25), the frequency error can be approximated as

C. SECOND-ORDER OBSERVER
By using the frequency error f from the frequency discriminator, a second-order observer can be designed to estimate the angular frequency f for CFs. Let f and f denote the estimates of angular frequency and acceleration respectively, then the second-order observer can be designed as (27) where l1 and l2 are positive observer gains. Define the errors as ff     , ff     , then the error dynamics of the observer can be derived from (27) as Since ff   and   , (28) can be rewritten as (29) According to (29) Obviously, the proposed observer can give accurate estimate of the angular frequency without steady-state error when the frequency is constant or varies with a fixed rate.

A. SIMULATION RESULTS
To verify the effectiveness of the proposed method, simulation is conducted on the MATLAB/Simulink platform. In the simulation, the envelope signals of the resolver are directly generated with harmonics similar to [21]. The harmonic ratios are set as Table Ⅰ. By using the generated envelope signals, the performance of the proposed method is evaluated under three conditions, i.e., fixed velocity, fixed acceleration, and sinusoidal velocity. For comparison purposes, the simulation results are also given without filter and with a first-order LPF.
In the simulation, the parameters of the proposed method are chosen as l1=450, l2=3000, b=6π rad/s. The first-order LPF only has one parameter to be designed, i.e., cutoff frequency or time constant. To achieve filtering performance as good as possible by using LPF, its parameter is adjusted carefully according to different conditions. Furthermore, the phase lag caused by LPF has been compensated in the demodulated results. A second-order angle tracking observer based on PLL [6] with the bandwidth of 100Hz is adopted as the demodulation algorithm in this paper. In the simulation curves, LPF and FLL-CF represent the results with the firstorder LPF, and the proposed method respectively.

Case 1: fixed speed
Set the angular speed ω=2π rad/s, then the pair envelope signals of the resolver can be simulated in Fig 3. In this case, the time constant of LPF is chosen as 0.0159s. According to (17) and b=6π rad/s, it is easy to know that the time constant of CFs is τ=0.106s.  After the envelope signals are filtered by using LPF and FLL-CF respectively, the filtered signals in sinusoidal channel are plotted in Fig 4. From Fig 4, it is clear that the phase lag of LPF is much larger than FLL-CF although the time constant of LPF is much less than FLL-CF. To demonstrate the filtering performance of different methods, the unfiltered and filtered signals in sinusoidal channel are also analyzed by using FFT and the spectrums are given in Fig 5. Obviously, the dominant harmonics in the unfiltered signal conform to Table Ⅰ and can be suppressed effectively by using LPF or FLL-CF. However, the amplitudes of the residual harmonics are much smaller by using FLL-CF than LPF.
To further evaluate the filtering performance of the proposed method, the unfiltered and filtered envelope signals of resolver are demodulated by PLL. The error curves of the demodulated position and velocity are given in Fig 6, and the statistical values of the demodulation errors in steady state are given in Table Ⅱ and Table Ⅲ. In the statistical tables, AVG and STD represent the average value and standard deviation respectively. From Fig 6, Table Ⅱ, and Table Ⅲ, it is known that the demodulation accuracy can be improved a lot when the harmonics in the envelope signals are suppressed by using FLL-CF. Compared with LPF, the standard deviations of the position and velocity errors with FLL-CF are reduced by 62.8% and 74.9% respectively.

Case 2: fixed acceleration
Set the angular speed =2π+πt rad/s, then the simulated envelope signals of the resolver are given in Fig 7. In this case, the time constant of LPF is also 0.0159s. Furthermore, the time constant of CFs is also 0.106s in the simulation time of 3 seconds according to (17) and b.
Similar to Case 1, the simulated envelope signals are also filtered by using LPF and FLL-CF respectively. The unfiltered and filtered signals in sinusoidal channel are shown in Fig 8. Fig 8 also demonstrates that LPF with a smaller time constant introduces certain phase delay while FLL-CF with a larger time constant does not.  The filtering performance of the proposed method can also be demonstrated by comparing the demodulation accuracy with LPF and without filters, as shown in Fig 9. The AVG and STD of the demodulation errors in steady state are also calculated in Table Ⅱ and Table Ⅲ. The results also indicate FLL-CF can improve the demodulation accuracy effectively owing to its superior performance in harmonics suppression. Compared with LPF, the standard deviations of the position and velocity errors with FLL-CF are reduced by 62.7% and 68.6% respectively.

Case 3: sinusoidal speed
Set the angular speed ω=4π+0.5πsin(0.5πt) rad/s, then the simulated envelope signals of resolver are given in Fig 10. In this case, the time constant of LPF is chosen as 0.00637s. The time constant of CFs is also 0.106s according to (17).  The demodulation errors of the position and velocity are given in Fig 12 and the error statistics are calculated in Table  Ⅱ and Table Ⅲ. Similarly, the statistical data also demonstrate the superior filtering performance of FLL-CF through demodulation accuracy. Compared with LPF, the standard deviations of the position and velocity errors with FLL-CF are reduced by 28.2% and 82.9% respectively.

FIGURE 13. Experimental platform.
To evaluate the performance of the proposed method through experimental results, an experimental platform is established, as shown in Fig 13. It consists of a power supply, a drive board, and a permanent magnet synchronous motor (PMSM) with resolver. The power supply provides constant voltage power for the drive board. In the drive board, the synchronous peak sampling method in [28] is adopted to detect the envelopes of resolver signals first. Then, the calibration method in [9] is used to calibrate the detected envelope signals . After the calibrated signals are filtered by LPF and FLL-CF respectively, they are demodulated to obtain the estimates of position and velocity by using a second-order angle tracking observer based on PLL. Finally, the closed-loop control of PMSM is accomplished by using the information from PLL. In the experiment, the parameters of PMSM and resolver are listed in Table Ⅳ, the parameters of FLL-CF and PLL are the same as simulation. The time constant of LPF is designed as 0.0159s. When the motor is driven to rotate stably with ω=2π rad/s by the driver board, experimental curves are plotted in Figs 14-17.    Fig 15 shows the unfiltered and filtered signals in sinusoidal channel. It is obvious that the phase delay of FLL-CF is much smaller than LPF although LPF has a smaller time constant. The filtering performance of different methods can be demonstrated by the spectrums of the signal in sinusoidal channel in Fig 16. It is clear that FLL-CF has better performance than LPF.
The demodulation results are given in Fig 17 and the statistics are calculated in Table Ⅴ. In Fig 17 and Table Ⅴ, the velocity error (  ) is used to reflect the estimation accuracy of velocity, where =-   , ω is expected velocity,  is estimated velocity. The phase detection error (  ) is used to reflect the estimation error of position.   In Fig 17, it is obvious that the FLL-CF curve has the smallest fluctuation, which proves that the demodulation accuracy can be improved most by FLL-CF. In Table Ⅴ, compared with LPF, the standard deviations of the phase detection error and velocity errors with FLL-CF are reduced by 80.7% and 78.1% respectively.

V. CONCLUSION
In this paper, a FLL based CF is proposed to solve the problem of resolver harmonics. In the proposed method, the relation of natural orthogonality in the pair signals of resolver is utilized to construct the complementary signal for the design of CFs. The proposed method has similar properties to conventional CFs and will not result in phase lags in the resolver signals. Compared with the conventional low-pass filters, the proposed method has better performance in harmonics suppression, and will not introduce additional errors in RDC. Both simulation and experimental results show that the proposed method has good performance on harmonics suppression.