Research on Resolver Decoding Algorithm

        At present, the position sensors used for motor rotor position detection mainly include photoelectric encoders, resolvers, and circular induction synchronizers. The feature of the photoelectric encoder is that it directly outputs digital signals without angle decoding, has large noise tolerance and high detection resolution, and is suitable for detecting high-speed synchronous motors. However, it is not resistant to impact and high temperature, and is easily disturbed by noise, so it is not suitable for use in harsh environments. The characteristic of the resolver is that it can directly output the absolute position of the rotor. It is resistant to pollution, dust, vibration, electromagnetic interference, low cost, long life, and wide temperature range. Therefore, it is especially suitable for occasions where the environment is harsh and high precision is required. However, the resolver needs to provide an excitation signal to work, and the signal output by the resolver is an analog signal, which needs to be processed to obtain data. Therefore, the resolver requires peripheral electronic circuits to complete a complete position detection system.

        Introduction to the working principle of the sine-cosine resolver: The resolver can be simply regarded as an ordinary transformer that can rotate, and its working principle is also based on electromagnetic induction. The following figure is a schematic diagram of the structure of the sine-cosine resolver.

         As shown in the figure, the high-frequency sinusoidal signal (excitation signal) is passed through the excitation winding of the resolver, and the induction of the high-frequency envelope signal containing position information is just right in the return winding, and it is extracted Envelope, the corresponding sine and cosine information can be obtained, and then the absolute position information of the stator can be obtained.

        Assuming that the excitation signal is: V = Vs*sin(w*t), then the signals in the two induction coils can be obtained as Va = Vs*sin(w*t)*sin\thetaand respectively Vb = Vs*sin(w*t)*cos\theta. It can be understood that the sinusoidal curve is generated by the excitation source, and the constant change of the angle between the rotor and the stator \thetaleads to the constant change of the amplitude.

        To use a resolver, you need to use resolver decoding technology. Resolver decoding refers to the generation of excitation signals and the extraction of the outer envelope of sinusoidal signals and angle calculation. At present, resolver decoding technology is mainly divided into two categories: hard decoding and soft decoding: the so-called resolver hard decoding is to use hardware to process resolver signals, of course, including the generation of excitation signals. The excitation signal is mostly generated inside the chip. The processing of the feedback sine and cosine signals is also completed by the decoding chip, and finally the decoding result is transmitted to the MCU through SPI and other communication methods. What the MCU acquires is the final position information or speed information we need. The principle of soft decoding is the same as that of hard decoding. The most important thing to complete the position signal acquisition is the generation of the excitation signal, the extraction of the outer envelope and the calculation of the angle. The principle of excitation generation is the same as that of hard decoding. The following mainly introduces the extraction method of the outer envelope and the decoding method of the angle.

        In soft decoding, there are two main steps, the first is to extract the outer envelope of the resolver output signal, and the second is to calculate the angle. Among them, the method of extracting the outer envelope is mainly the peak detection method and the integral method, and the methods used in the angle decoding process are the arctangent method and the angle following method based on the phase-locked loop.

        Hard decoding uses a dedicated solution chip, which has the characteristics of fast speed, reliable operation, mature technology, high accuracy, and high performance, but it is expensive, difficult to modify, and inflexible in design.

        The approaching speed of the angle following method is fast, but it is complicated to implement, has a certain filtering effect, and has strong anti-interference ability.

        Resolver decoding can be divided into open-loop and closed-loop decoding algorithms. The most typical open-loop method is the arctangent method, which can be implemented through function calls, look-up tables, and CORDIC algorithms. However, open-loop decoding algorithms are susceptible to noise interference, and If you want to get the speed information, you need to differentiate it. The closed-loop decoding algorithm is an algorithm based on a phase-locked loop, which can not only accurately track the angular position and speed information of the rotor, but also has certain anti-interference ability.

        DSP decoding method: use the A/D conversion chip to convert the analog output of the resolver into digital, so as to realize the decoding algorithm by using the computing power of DSP itself. The problem is that the decoding algorithm requires a large number of complex mathematical operations, which consumes a lot of time, which is not good for real-time systems.

        The inverse triangular transformation methods mainly include the arctangent look-up table method, the CORDIC algorithm, and the method of calling the arctangent function. The peripheral circuit of the arctangent method is relatively simple, and the requirements for hardware configuration are not high, but the envelope signal is easily disturbed by external noise, and the accuracy will be affected during conversion. The look-up table method and the calling function method generally require a large amount of hardware resources and are time-consuming.

        After a brief introduction to the current mainstream algorithms, this article mainly uses MATLAB to extract the envelope of the output signal of the resolver through peak detection, and then calculates the angle through arctangent transformation.

                        

        First, the corresponding carrier signal and baseband modulation signal are created according to the principle of the resolver. In the figure above, there are two sinusoidal signals and a carrier signal with a phase difference of 90°. The frequency of the carrier signal is 20KHZ, the sampling rate is set to 1M, and the working frequency of the resolver is set to 3KHZ, then it \thetais 3K*2*pi. Since the sampling frequency is 1M, that is, one point is sampled in 1us, in order to avoid the sampling points being too dense and difficult to observe, 1000 points are sampled, and the signal length is 0.001s.

        Next, the two sinusoidal signals with a phase difference of 90° are multiplied by the carrier signal to form the synchro signal. In the figure below, it is realized as a DSB modulation signal, and the dotted line is its outer envelope signal.

                             

        To decode the output signal of the resolver shown in the figure above, the outer envelope signals of the two signals must first be obtained. There are many methods for extracting the outer envelope. In addition to the peak detection method, there are integration methods and coherent demodulation and other methods, the peak detection method used in this paper.

         The above figure is the result of peak detection of the two output signals of the resolver respectively. The green dotted line is the modulation signal output by the resolver, while the pink discrete signal is the result of peak detection of the modulation signal. It can be seen that the peak detection The method can correctly extract the outer envelope signal of the modulated signal. In order to improve the accuracy of the envelope signal, we sample both the maximum value point and the minimum value point within one cycle of the modulation signal, and then invert the sampling value of the second half cycle, so that the sampling accuracy of the obtained envelope signal is improved. double.

        As mentioned earlier, after extracting the outer envelope signal of the resolver output signal, the angle can be calculated using the information in the envelope signal. In fact, it is easy to understand that the two envelope signals are the sum , sin(\theta)and cos(\theta)the angle information can be obtained by dividing them and then using the arctangent operation. The result is shown in the figure below:

        In this way, we decode the output signal of the resolver into angles using the peak detection and arctangent methods. However, in the actual implementation process, if the frequency of the carrier signal is low, the obtained envelope signal will inevitably be distorted. Therefore, before decoding, the sampling point data of the envelope signal can be increased by interpolation to improve the calculation accuracy. In addition, there may also be a phase difference between the two output signals of the resolver and the carrier signal, so in order to improve the accuracy, the phase difference between the signals can be calculated by the phase difference measurement algorithm, and then the phase difference is compensated before Perform envelope extraction.

        The decoding of the resolver has good research value. It is still in the stage of theoretical research. It may involve hardware implementation in the future. If we have better insights, we will continue to share it.

 

        

Guess you like

Origin blog.csdn.net/qq_57541474/article/details/130012766