Signal processing method of sine and cosine encoder
The preprocessing, decoding and error correction of the cosine encoder signal through mathematical model and digital signal processing technology is solved, and the problems of complex signal processing, insufficient anti-interference capability and limited accuracy in the prior art are solved, achieving higher accuracy, robustness and real-timeness.
Patent Information
- Application Number
- CN202411903994.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-23
- Publication Date
- 2025-04-29
AI Technical Summary
In the prior art, the signal processing of the cosine encoder is complex, the anti-interference ability is insufficient, and the accuracy is limited, especially when the feedback control of high-speed moving parts is difficult to take into account both real-time and accuracy.
Mathematical model and digital signal processing technology are used to pre-process, decode and error correction of sinusoidal and cosine signals, including signal filtering, normalization, allocation to different sectors, and decode and error correction using fast arctangent function.
It improves the accuracy, robustness and real-time nature of the system, effectively eliminates noise and nonlinear errors in the signal, and enhances the precise feedback control capability of high-speed moving parts.
Smart Images

Figure BDA0005203936110000054 
Figure BDA0005203936110000061 
Figure BDA0005203936110000063
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of electric servo control, and in particular provides a sine-cosine encoder signal processing method. Background Art
[0002] In modern automation and control systems, accurate measurement of position and speed is crucial, especially in equipment such as industrial robots, CNC machine tools, and automated production lines, where the monitoring of rotational or linear motion requires highly accurate feedback. Sincosine encoders are a common position and speed sensor and are widely used in these systems. Sincosine encoders reflect the current position of a shaft or moving body by outputting continuous sine and cosine signals. However, sine and cosine signals are analog signals and are often affected by noise, temperature changes, and nonlinear factors, which makes it difficult to directly apply them to precise position feedback.
[0003] Traditional encoder signal processing methods rely on hardware circuits or low-level digital signal processing algorithms, and usually require high-performance processors to implement signal decoding, filtering, and error compensation. Although these methods can improve the accuracy of position measurement to a certain extent, they are limited in their effectiveness when dealing with complex errors and noise, especially when performing feedback control on high-speed moving parts, where it is difficult to balance the real-time and accuracy requirements of processing.
[0004] Therefore, it is particularly important to propose an efficient and robust sine-cosine encoder signal processing algorithm. Summary of the invention
[0005] The purpose of this application is to solve the problems of complex signal processing, insufficient anti-interference ability and limited accuracy in the prior art. An algorithm is provided to preprocess, decode and correct errors of sine and cosine signals using mathematical models and digital signal processing technology to improve the accuracy, robustness and real-time performance of the system.
[0006] In order to achieve the above object, the present invention adopts the following technical solution: a sine-cosine encoder signal processing method, the method comprising:
[0007] S1: Collect the sine and cosine signals output by the sine and cosine encoder and filter the collected signals;
[0008] S2: normalize the filtered sine and cosine signals;
[0009] S3: distribute the normalized signals to different sectors;
[0010] S4: Decode the normalized signal according to the fast arc tangent function corresponding to different sectors to obtain the position information corresponding to the sine and cosine signals.
[0011] The sine-cosine encoder signal processing method provided by the present invention also has such a technical feature that S2 includes: the normalization processing is to make the amplitudes of the sine and cosine signals within the same range, and the amplitude is [-1, 1].
[0012] The sine-cosine encoder signal processing method provided by the present invention also has such a technical feature that S3 comprises:
[0013] S3.1: Take the absolute value of the normalized sine signal and cosine signal to obtain the absolute value of the sine signal U sin1 and the absolute value of the cosine signal U cos1 ;
[0014] S3.2: Pass and U sin1 -U cos1 Calculate the sector operator N;
[0015] S3.3: Obtain the sector number NUM through the sector operator N.
[0016] The sine-cosine encoder signal processing method provided by the present invention also has such a technical feature that in S3.2, the sector operator N is:
[0017] N=u×4+v×2+w×1
[0018] Among them, u is the cosine operator, if u=1, otherwise u=0;
[0019] v is a sine operator, if v = 1, otherwise u = 0;
[0020] w is the absolute value difference operator, if U sin1 -U cos1 >=0, w=1, otherwise w=0.
[0021] The sine-cosine encoder signal processing method provided by the present invention also has such a technical feature that the sector number NUM obtained by the sector operator N is shown in the following table:
[0022] Sector number (NUM) Operator (N) 1 7 2 6 3 2 4 3 5 1 6 0 7 4 8 5 .
[0023] The sine-cosine encoder signal processing method provided by the present invention also has such a technical feature that the fast inverse tangent function is:
[0024] θ=(y+(NUM-1))×π / 4
[0025] Where y is the sector tangent value,
[0026] If N is 0 or 3 or 6 or 5, y=-U sin1 / U cos1 +1; otherwise, y=U sin1 / U cos1 ,
[0027] N is the sector operator and NUM is the sector number.
[0028] The sine-cosine encoder signal processing method provided by the present invention also has the following technical features: the method also includes performing error correction on the angle.
[0029] Beneficial Effects
[0030] A sine-cosine encoder signal processing algorithm proposed in the present invention converts the analog sine-cosine signals from the encoder into position information through a digital processing flow, and eliminates noise and nonlinear errors in the signal in the process; the algorithm uses mathematical models and digital signal processing technology to preprocess, decode and correct errors of sine and cosine signals, thereby improving the accuracy, robustness and real-time performance of the system. DETAILED DESCRIPTION
[0031] The present application is further described in detail below in conjunction with examples, but it should be noted that these implementations are not limitations of the present application, and any equivalent transformations or substitutions in functions, methods, or structures made by ordinary technicians in the field based on these implementations are all within the scope of protection of the present application.
[0032] The present application provides a method for processing sine-cosine encoder signals, the method comprising:
[0033] S1: Collect the sine and cosine signals output by the sine and cosine encoder and filter the collected signals; collect the sine and cosine voltage signals U output by the position encoder through a high-precision analog-to-digital converter (ADC) sin and U cos Sin-cosine difference signal, and remove high frequency noise through filter;
[0034] S2: normalize the filtered sine and cosine signals;
[0035] S3: distribute the normalized signals to different sectors;
[0036] S4: Decode the normalized signal according to the fast arc tangent function corresponding to different sectors to obtain the position information corresponding to the sine and cosine signals.
[0037] In some embodiments, S2 includes: the normalization process is to make the amplitudes of the sine and cosine signals in the same range, and the amplitude is [-1, 1], so as to reduce the error caused by amplitude mismatch.
[0038] In some embodiments, S3 includes:
[0039] S3.1: Take the absolute value of the normalized sine signal and cosine signal to obtain the absolute value of the sine signal U sin1 and the absolute value of the cosine signal U cos1 ;
[0040] S3.2: Pass and U sin1 -U cos1 Calculate the sector operator N;
[0041] S3.3: Obtain the sector number NUM through the sector operator N.
[0042] In some embodiments, in S3.2, the sector operator N is:
[0043] N=u×4+v×2+w×1
[0044] Among them, u is the cosine operator, if u=1, otherwise u=0;
[0045] v is a sine operator, if v = 1, otherwise u = 0;
[0046] w is the absolute value difference operator, if U sin1 -U cos1 >=0, w=1, otherwise w=0.
[0047] In some embodiments, the sector number NUM obtained by the sector operator N is shown in the following table:
[0048]
[0049]
[0050]
[0051] In some embodiments, the fast inverse tangent function is:
[0052] θ=(y+(NUM-1))×π / 4
[0053] Where y is the sector tangent value,
[0054] If N is 0 or 3 or 6 or 5, y=-U sin1 / U cos1 +1; otherwise, y=Usin1 / U cos1 ,
[0055] N is the sector operator and NUM is the sector number.
[0056] In some embodiments, the method further includes performing an error correction on the angle.
[0057] In some embodiments, the above calculation method sacrifices a certain degree of accuracy (maximum error 0.0525rad) in order to reduce the calculation complexity and speed up the calculation. If the accuracy requirement is high, the corrected interpolation table can be used to calculate the precise angle.
[0058] The interpolation table is as follows:
[0059] When NUM=1, 3, 5, 7, use the following interpolation table to calculate the corrected value y'
[0060]
[0061]
[0062] When NUM=2, 4, 6, 8, use the following interpolation table to calculate the corrected value y' of y
[0063]
[0064]
[0065]
[0066] Substitute the exact value y' corrected by the interpolation table into:
[0067] θ=[y ′ +(NUM-1)]×π / 4
[0068] The corrected encoder angle value can be obtained.
[0069] The above is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent replacements and improvements made within the spirit and principles of the present application shall be included in the protection scope of the present application. The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and variations can be made without departing from the technical principles of the present application, and these improvements and variations should also be regarded as the protection scope of the present application.
Claims
1. A sine-cosine encoder signal processing method, characterized in that: The method comprises: S1: Collect the sine and cosine signals output by the sine and cosine encoder and filter the collected signals; S2: normalize the filtered sine and cosine signals; S3: distribute the normalized signals to different sectors; S4: Decode the normalized signal according to the fast arc tangent function corresponding to different sectors to obtain the position information corresponding to the sine and cosine signals.
2. The sine-cosine encoder signal processing method according to claim 1, characterized in that: The S2 includes: the normalization process is to make the amplitudes of the sine and cosine signals in the same range, and the amplitude is [-1, 1].
3. The sine-cosine encoder signal processing method according to claim 1, characterized in that: The S3 includes: S3.1: Take the absolute value of the normalized sine signal and cosine signal to obtain the absolute value of the sine signal U sun1 and the absolute value of the cosine signal U cos1 ; S3.2: Pass and U sin1 -U cos1 Calculate the sector operator N; S3.3: Obtain the sector number NUM through the sector operator N.
4. The sine-cosine encoder signal processing method according to claim 3, characterized in that: In S3.2, the sector operator N is: N=u×4+v×2+w×1 Among them, u is the cosine operator, if u=1, otherwise u=0; v is a sine operator, if v = 1, otherwise u = 0; w is the absolute value difference operator, if U sin1 -U cos1 >=0, w=1, otherwise w=0.
5. The sine-cosine encoder signal processing method according to claim 3, characterized in that: The sector number NUM obtained by the sector operator N is shown in the following table: 。 6. The sine-cosine encoder signal processing method according to claim 1, characterized in that: The fast inverse tangent function is: θ=(y+(NUM-1))×π / 4 Where y is the sector tangent value, If N is 0 or 3 or 6 or 5, y=-U sin1 / U cos1 +1; otherwise, y=U sin1 / U cos1 , N is the sector operator and NUM is the sector number.
7. The sine-cosine encoder signal processing method according to claim 1, characterized in that: The method also includes performing an error correction on the angle.