Absolute value photoelectric encoder position calculation method for servo system

By using absolute value photoelectric encoder position calculation method in the servo system, the table lookup method and interpolation algorithm are used to optimize the calculation process, the calculation complexity is reduced, real-time and accuracy are improved, and it is suitable for real-time control of high-speed servo systems, and it supports multi-turn position detection and fault alarm.

CN119882858BActive Publication Date: 2025-07-11新时达工控技术(杭州)有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510373651.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-03-27
Publication Date
2025-07-11
Estimated Expiration
2045-03-27

AI Technical Summary

Technical Problem

The position calculation complexity of absolute value photoelectric encoder in existing servo systems is high, and the real-time performance is insufficient, making it difficult to meet the real-time control needs of high-speed servo systems, especially in scenarios such as laser cutting and robot high-speed grabbing.

Method used

The absolute value photoelectric encoder position calculation method is used to calculate the initial absolute position through the initialization module, determine the timer CNT value and the working interval of the M code channel, and only signal acquisition and subdivision calculation are performed on the M code channel. Combined with the table lookup method and the interpolation algorithm, a redundant inspection module is set for secondary verification, and the position information is transmitted using 485, EtherCAT or CAN protocols.

Benefits of technology

It reduces the calculation amount and calculation complexity, improves the calculation speed and accuracy, meets the real-time control needs of high-speed servo systems, enhances the reliability and stability of position calculation, and is suitable for multi-turn position detection and fault alarm.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119882858B_ABST
    Figure CN119882858B_ABST
Patent Text Reader

Abstract

The present invention provides a method for calculating the position of an absolute photoelectric encoder for a servo system, belonging to the field of servo system control. The steps of the present invention include S1. Initialization module. In the initial stage, the initial absolute position is calculated using the cursor code, and the working range of the timer CNT value calculation unit is determined according to the initial absolute position, and then the working range of the M track is determined; S2. Fast position calculation. During operation, only signal acquisition and subdivision calculation are performed on the M track, and the synthesized single-turn absolute angle is output. Combining with the timer CNT value, the total absolute position is further obtained; S3. Position transmission. The calculated absolute position information is sent to the servo system through the position information communication unit. In this solution, the arctangent value is obtained by using the look-up table method during the subdivision calculation, and the input ratio index is used to look up the table and combined with the difference algorithm to quickly obtain it, which greatly reduces complex mathematical operations, improves the calculation speed, and meets the real-time control requirements of high-speed servo systems.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of servo system control, and particularly relates to a method for calculating encoder position, and more particularly to a method for calculating the position of an absolute optical encoder for a servo system. Background Art

[0002] In modern servo systems, high-precision position control is the core basis for achieving precise motion. As the core device for position feedback, the performance of an absolute optical encoder directly determines the control accuracy and dynamic response ability of the servo system. For example, a Chinese patent document discloses a decoding device, a driving device and a parameter determination method for a sine-cosine encoder [CN2022102964044]. The sine-cosine encoder detects the rotor position information of the motor and outputs sine-cosine differential signals; the differential operational amplifier unit performs differential operational amplification on the sine-cosine differential signals to obtain sine-cosine analog signals; the sine-cosine analog signals are divided into two paths; the interleaved trigger unit interleaves and triggers the sine signal and the cosine signal in the first path of sine-cosine analog signals to obtain sine-cosine square wave signals; the ADC unit performs analog-to-digital conversion processing on the second path of sine-cosine analog signals to obtain sine-cosine digital signals; the control unit determines the rotor position information of the motor according to the sine-cosine square wave signals and the sine-cosine digital signals.

[0003] The above technical solution solves the related technical problems such as the pulse counting error caused by the interference of the sine-cosine encoder signal, which affects the accuracy of the angular position information and the control accuracy of the servo driver. However, in the process of its position calculation, due to the complex arctangent operation process, there are key defects of high calculation complexity and insufficient real-time performance. This technical bottleneck seriously restricts the real-time control performance of high-speed servo systems. Especially in scenarios with strict dynamic response requirements such as laser cutting and high-speed robot grasping, the limitations of the traditional scheme are more prominent, and it is difficult to meet the real-time control requirements. Urgent breakthroughs are needed for optimization and upgrading. Summary of the Invention

[0004] The invention purpose of this application is to provide a method for calculating the position of an absolute optical encoder for a servo system with high calculation efficiency.

[0005] To achieve the above invention purpose, the technical solution of this application is as follows:

[0006] This method for calculating the position of an absolute optical encoder for a servo system includes:

[0007] S1. Initialization module. In the initial stage, the initial absolute position is calculated using the cursor code, and the working range of the timer CNT value calculation unit is determined according to the initial absolute position, and then the working range of the M track is determined;

[0008] S2. Fast position calculation. During operation, only signal acquisition and subdivision calculation are performed on the M track, and the synthesized single-turn absolute angle is output. Combining with the timer CNT value, the total absolute position is further obtained.

[0009] S3. Position transmission. The calculated absolute position information is sent to the servo system through the position information communication unit.

[0010] In the above method for calculating the absolute position of an optical encoder for a servo system, S2 includes the following steps:

[0011] S21. Obtain the sine signal and cosine signal of the M track from the analog-to-digital converter.

[0012] S22. Perform offset correction on the obtained sine signal and cosine signal.

[0013] After offset correction, calibrate the signal using the pre-calibrated zero-offset parameter and gain correction coefficient.

[0014] In the above method for calculating the absolute position of an optical encoder for a servo system, after signal acquisition, center offset correction is first performed on it, and the formula is:

[0015]

[0016] Among them, 、 are the original data sampled by the ADC, and 2048 is the center value.

[0017] Then, through the pre-calibrated zero offset and gain coefficient, calibrate the signal that has completed center offset correction, and the formula is:

[0018]

[0019]

[0020] Among them, is the zero offset parameter, is the gain correction coefficient;

[0021] Then perform phase compensation on the calibrated signal, and the formula is:

[0022]

[0023]

[0024] Among them is the phase correction coefficient.

[0025] In the above-mentioned absolute value photoelectric encoder position calculation method for a servo system, for fine division calculation, according to the corrected sine value and cosine value, an arctangent value is obtained through the arctangent function. The formula is:

[0026]

[0027] Among them, the look-up table method is a look-up table for pre-stored angle values, and only one calculation is performed on the M code track.

[0028] In the above-mentioned absolute value photoelectric encoder position calculation method for a servo system, the look-up table method pre-constructs an angle-tangent value mapping table, and by inputting the ratio index is used to look up the table, and the arctangent value is quickly obtained by combining the interpolation algorithm.

[0029] In the above-mentioned absolute value photoelectric encoder position calculation method for a servo system, the single-turn absolute angle synthesis method is as follows: combining the grating index of the M code track with the fine division value to generate an angle value with a resolution of 23 bits. The formula is:

[0030]

[0031] Where is the index of the current grating determined by the timer CNT value of the M code track, a 9-digit number; is to take the high 14 bits of the fine division value.

[0032] In the above-mentioned absolute value photoelectric encoder position calculation method for a servo system, the system supports multi-turn absolute position detection. The number of turns is accumulated through the direction signal and an external counter, and combined with the single-turn angle value to generate a complete absolute position.

[0033] In the above-mentioned absolute value photoelectric encoder position calculation method for a servo system, it also includes a redundancy check module for performing a secondary verification on the fast calculation result. The verification condition is:

[0034] When the fast calculation result and the secondary calculation result are inconsistent for 8 consecutive times, an error alarm mechanism is triggered;

[0035] The secondary verification of the redundancy check module uses an algorithm or data source independent of the fast calculation module.

[0036] In the above-mentioned absolute value photoelectric encoder position calculation method for a servo system, it also includes an alarm output module for generating and transmitting an error alarm signal. The alarm signal is output through a 485 communication interface and includes an error code and a position deviation value.

[0037] In the above-mentioned method for calculating the position of an absolute value photoelectric encoder for a servo system, the position transmission module uses the 485, EtherCAT or CAN protocol to transmit the absolute position information in the form of periodic messages.

[0038] Compared with the prior art, the beneficial effects of this application are reflected in:

[0039] Reduce the calculation amount: Traditional methods usually require multiple arctangent operations, with high calculation complexity. In this solution, the look-up table method is used to obtain the arctangent value during the subdivision calculation, and only one calculation is performed on the M code track. By pre-constructing the angle - tangent value mapping table, using the input ratio index to look up the table and combining with the interpolation algorithm to quickly obtain the arctangent value, the complex mathematical operations are greatly reduced, the calculation speed is improved, and the real-time control requirements of the high-speed servo system are met.

[0040] Narrow the calculation range: In the initial stage, the cursor code is used to calculate the initial absolute position to determine the working intervals of the timer CNT value calculation unit and the M code track. During the operation, only signal acquisition and subdivision calculation are performed on the M code track, avoiding the processing of all data, further reducing the calculation complexity, and improving the real-time performance.

[0041] After signal acquisition, first perform center offset correction, then calibrate the signal through the pre-calibrated zero offset and gain coefficient, and finally perform phase compensation to ensure the accuracy of the sine and cosine signals of the M code track collected, thereby improving the accuracy of position calculation.

[0042] A redundancy check module is set up to perform a secondary verification on the fast calculation result. When the fast calculation result is inconsistent with the secondary calculation result for 8 consecutive times, the error alarm mechanism is triggered. And the secondary verification uses an algorithm or data source independent of the fast calculation module, effectively improving the reliability and stability of position calculation, and timely discovering and handling possible calculation errors. Brief Description of the Drawings

[0043] Figure 1 It is a flowchart of the method for calculating the position of an absolute value photoelectric encoder for a servo system provided by the present invention;

[0044] Figure 2 It is a flowchart of the method for fast position calculation in the method for calculating the position of an absolute value photoelectric encoder for a servo system provided by the present invention. Detailed Description of the Embodiment

[0045] The technical solutions of the present invention will be further described in detail below in conjunction with the drawings and specific embodiments.

[0046] Taking the industrial robot joint servo motor system as an example, the absolute value photoelectric encoder described in the present invention is integrated at the rear end of the industrial robot joint servo motor. The absolute value photoelectric encoder position calculation method for the servo system of the present invention adopts a unique MNS cursor code structure, including cursor codes with 512, 510, and 480 engraved lines, which are the main code track (M code track), the cursor code (N), and the segment code (S), respectively, and is connected to the ADC through a double-shielded twisted pair wire.

[0047] A dedicated microcontroller unit MCU is provided in the absolute value photoelectric encoder. The pre-calibrated zero offset, gain coefficient, and phase correction parameters are stored in the internal non-volatile memory of the MCU. The 485 bus is used for alarm output and periodic position data transmission.

[0048] The photoelectric signals of the MNS code track are converted into analog electrical signals by a photoelectric sensor, and then sampled by the analog-to-digital converter built in the encoder.

[0049] Load the center value: 2048, zero offset parameter (IQ14 format), (IQ14 format), gain correction coefficient (IQ14 format), phase compensation coefficient 、

[0050] Enter the operation. As Figure 1 shown, collect the signals of the M code track (512 engraved tracks), N code track (510 engraved lines), and S code track (480 engraved lines), and eliminate the manufacturing errors through differential calculation. Calculate the initial absolute position using the cursor code. The formula is:

[0051] ΔP = ∣PN - PS∣×(510×480) / ∣510 - 480∣,

[0052] where PN represents the position information corresponding to the cursor code (N code track), and PS represents the position information corresponding to the segment code (S code track).

[0053] In this embodiment, the engraved lines of the N / S code tracks are arranged in a periodic staggered manner. The signal characteristics are that the signal period of the N code track is 360° / 510 ≈ 0.70588°, the signal period of the S code track is 360° / 480 = 0.75°, and the difference frequency period is 360° / (510 - 480) = 12°

[0054] After obtaining the position information of the N-code track and the S-code track, according to the formula, for example, when the robot joint rotates to the position of 123.456°, the N-code track reading is 178 lines (corresponding to 178×0.70588° = 125.647°), and the S-code track reading is 165 lines (corresponding to 165×0.75×0.7° = 123.75°). First, calculate the phase difference: ∣PN−PS∣ = |125.647° - 123.75°| = 1.897°, and the absolute position is 1.897° × 8160 = 15479.52°. Then, perform vernier magnification, and magnify the tiny phase difference by (510×480) / ∣510 - 480∣ = 8160 times for observation.

[0055] The principle of vernier code difference reduces the initial position error from ±1 / 2 scale line to ±1 / 4 scale line according to the way of double-track error cancellation, and the accuracy is improved by 50%.

[0056] And determine the timer CNT value (range 0 - 511) according to the initial absolute position, calculate the working range of the calculation unit, and then determine the working range of the M-code track, and at the same time determine the current M-code track period. In this embodiment, after dividing the absolute position by 360°, the integer part of the period is 43, the single-turn angle is converted to 156°, and the theoretical CNT value is calculated as 156° / 360°×510×4096 / 510 = 1775. Further, CNT = 1775 (0x06EF), then locked_zone = 0x06E0 = 1760, corresponding to the M-code track scale line is 1760 / 4096×510 = 220. According to the size of the optimized interval of the system (32 CNT), the upper limit is 1760 + 31 = 1791. Similarly, the corresponding M-code track scale line is 223. Finally, the working range of the M-code track scale line is determined to be 220 - 223. Using the base value + 31 (i.e., 1791) instead of the base value + 64 can reduce the calculation amount by 50%. On the other hand, it can still cover the complete cycle of the M-code track signal (the sine / cosine signal completes 1 / 4 cycle within 32 CNT).

[0057] Compared with full-cycle scanning, redundant calculations are reduced. By locking the working range of the M-code track through the CNT value, full-range scanning is avoided, and the calculation amount is reduced by 75%. This method provides a clear range for subsequent position calculations, avoids unnecessary calculations, and improves the calculation efficiency. By determining the working range, the calculation range is reduced, so that subsequent signal acquisition and subdivision calculations are only targeted at specific M-code tracks, reducing the overall calculation amount.

[0058] Further, as Figure 2 shown, obtain the sine signal and cosine signal of the M-code track from the analog-to-digital converter.

[0059] Specifically, a 16-bit ADC samples the M-track sine / cosine signals, and the original data range is 0-4095.

[0060] Furthermore, perform offset correction on the acquired sine and cosine signals; after offset correction, calibrate the signals using pre-calibrated zero-offset parameters and gain correction coefficients.

[0061] Among them, perform offset correction and calibration on the sine and cosine signals of the M-track, and gradually optimize the signal quality. Offset correction can eliminate the DC offset in the signal, and calibration further adjusts the amplitude and zero point of the signal, making the signal more accurately reflect the position information of the motor rotor. After offset correction and calibration, the accuracy and stability of the signal are improved, providing a more reliable data basis for subsequent position calculation, thereby improving the accuracy of position calculation.

[0062] Specifically, for example, the acquired signal is 2632, is 1208. After signal acquisition, perform center offset correction on it first.

[0063] = 2632 - 2048 = 584, = 1280 - 2048 = -768

[0064] Among them, , are the original data sampled by the ADC, and 2048 is the center value;

[0065] Then, through the pre-calibrated zero offset and gain coefficient, calibrate the signal that has completed the center offset correction. The formula is:

[0066] = 584 - 0 = 584, = (-768 - 9) * 16240 / 16384.0 = -771

[0067] Among them, is the zero offset parameter, is the gain correction coefficient;

[0068] Then, perform phase compensation on the calibrated signal. The formula is:

[0069] =(584 * 16380 - (-768) * 299) / 16384.0 = 597, = ((-771) * 16380 - 584 * 299) / 16384.0 = -782

[0070] Among them is the phase correction coefficient.

[0071] The three - level signal correction covers the complete signal processing flow from center - offset correction to gain calibration and then to phase compensation, optimizing all aspects of the signal. It controls the signal error within a small range, improves the signal quality and accuracy, and thus enhances the accuracy of position calculation. For example, the center - offset correction can adjust the center of the signal to an appropriate position, reducing the error in subsequent calculations.

[0072] Furthermore, for the subdivision calculation, according to the corrected sine and cosine values, the arctangent value is obtained through the arctangent function, and then the subdivision value within one grating of the M - track is obtained through the look - up table method. The calculation is as follows:

[0073]

[0074] Among them, the look - up table method is a look - up table for pre - stored angle values, and only one calculation is performed on the M - track. By replacing the floating - point arctangent with integer operations and memory access, the real - time performance is significantly improved.

[0075] Specifically, the corresponding relationship between the sine / cosine ratio table of 2048 uniformly distributed angle values in the range of 0° - 90° and the subdivision values is calculated and pre - stored in advance, and the look - up is performed through indexing. The storage format is as follows:

[0076] Index: 0 - 2047, corresponding to the quantization value of the input ratio

[0077] Value: Subdivision value, represented by fixed - point numbers

[0078] After inputting the corrected sine value of 597 and cosine value of 782, the calculated ratio is 597 / 782 = 0.763. Further, find the entry in the look - up table whose tangent value is closest to 0.763, and the obtained subdivision value is 25968.

[0079] Here, through calculation, the subdivision value obtained by the look - up table method is verified by comparison.

[0080] =32768 - arctan(597 / 782) / 90*16384 = 25968.

[0081] Using the look - up table method to obtain the subdivision value avoids the traditional complex arctangent operation. The look - up table method pre - stores the corresponding relationship between the subdivision value and the tangent value, and the subdivision value can be obtained through simple index look - up, greatly reducing the amount of calculation. And only one calculation is performed on the M - track, further reducing the workload of calculation. The calculation speed of the look - up table method is much faster than the traditional arctangent operation, and the arctangent value can be obtained in a short time, thus improving the real - time performance of position calculation. At the same time, it reduces the occupation of processor resources and lowers the burden on the system.

[0082] Those skilled in the art can also quickly obtain the arctangent value by combining interpolation algorithms. The mapping table provides the corresponding relationship between the basic subdivision values and tangent values, and the interpolation algorithm can perform approximate calculations when the input value is not in the mapping table, improving the accuracy and applicability of the table lookup method. The use of the interpolation algorithm enables the table lookup method to handle a wider range of input values, avoiding errors caused by the incomplete matching of the input value with the values in the mapping table, improving the accuracy of arctangent value calculation, and thus improving the accuracy of position calculation.

[0083] Further, the method for synthesizing the single-turn absolute angle is as follows: combining the grating index of the M track and the subdivision value to generate an angle value with a resolution of 23 bits.

[0084] Specifically, the subdivision value is 25968. At this time, the timer CNT value is 1045, and the single-turn absolute angle is calculated as follows:

[0085] =(1045>>2)*16384 + 25968 / 4 = 4282716

[0086] Where is the index of the current grating determined by the timer CNT value of the M track, a 9-bit number; is to take the high 14 bits of the subdivision value. The timer CNT value 1045 in binary is 010000010101, and after shifting two bits to the right, it is 000100000101, which is converted to decimal to get 261.

[0087] After looking up the table, the subdivision value (16 bits) is shifted two bits to the right and the high 14 bits are taken to cover the fine adjustment within the grating. Combining with the 9-bit grating index to cover the coarse positioning, a resolution of 0.00017° for a single turn is achieved. Combining the grating index of the M track and the subdivision value to generate an angle value with a resolution of 23 bits, making full use of the information of the encoder, effectively combining the grating index and the subdivision value to obtain a more accurate single-turn absolute angle. The 23-bit resolution angle value can more accurately represent the position of the motor rotor, improving the accuracy of position detection, and achieving the technical effect of high calculation efficiency and accuracy in combination with the above algorithms.

[0088] During operation, only signal acquisition and subdivision calculation are performed on the M track, and the synthesized single-turn absolute angle is output, simplifying the calculation process, quickly determining the working range and performing targeted calculations, and being able to obtain position information faster, meeting the requirements of the high-speed servo system of industrial robots for real-time control.

[0089] Further, the system supports multi-turn absolute position detection, accumulates the number of turns through the direction signal and an external counter, and combines it with the single-turn angle value to generate a complete absolute position.

[0090] Among them, the direction signal DIR controls an external counter (0 - 65535), with +1 for forward rotation and -1 for reverse rotation. During the operation of the encoder, the external counter accumulates the number of turns through the direction signal. The number of turns recorded by the external counter is multiplied by the number of subdivision positions per turn, 512 × 2^14, to obtain the cumulative position value from the initial position to the current number of turns. Adding the single-turn absolute angle value gives the complete absolute position.

[0091] The system supports multi-turn absolute position detection. By using the direction signal and the external counter to accumulate the number of turns, and combining it with the single-turn angle value to generate the complete absolute position. This method expands the application range of the encoder and is suitable for scenarios that require multi-turn position detection. In some applications where the motor needs to rotate multiple turns, such as the joint movement of industrial robots and the transmission systems of large equipment, it can accurately detect the multi-turn position of the motor, providing support for the precise control of the system.

[0092] After completing the calculation result of the main path: M-track look-up table method, the secondary verification of the quick calculation result is carried out through the secondary path. The verification conditions are as follows:

[0093] When the quick calculation result and the secondary calculation result are inconsistent for 8 consecutive times, the error alarm mechanism is triggered. In the case of instantaneous interference, for example, when the comparison results are inconsistent 1 - 3 times and the count does not reach the threshold, the error is ignored and the operation continues; when the continuous deviation is greater than 8 times, an alarm is triggered.

[0094] Preferably, the secondary verification of the redundancy detection module uses an algorithm or data source independent of the quick calculation module. In this technical solution, through the real-time comparison between the main path (look-up table method) and the secondary path, the following abnormalities can be effectively identified: signal noise interference (such as abnormal ADC sampling caused by electromagnetic interference), misreading of encoder graduations caused by mechanical vibration, hardware aging or sensor failure, etc., to avoid affecting the normal operation of the robot.

[0095] The alarm output module is used to generate and transmit an error alarm signal. The alarm signal is output through a 485 communication interface and includes an error code and a position deviation value. This clear alarm output method facilitates the operator to timely understand the fault situation of the system, which is convenient for fault troubleshooting and repair. The operator can quickly locate the fault type according to the error code and understand the severity of the fault according to the position deviation value, improving the efficiency of fault handling and reducing the system downtime.

[0096] The position transmission module adopts the 485 protocol and transmits absolute position information in the form of periodic messages. The position transmission module adopts the 485 protocol and transmits absolute position information in the form of periodic messages. Both of these protocols are commonly used communication protocols in the industrial field, featuring high real-time performance, reliability, and compatibility. The diverse selection of communication protocols enables this encoder position calculation method to adapt to different industrial field environments and equipment requirements, enhancing the universality and scalability of the system. Meanwhile, the periodic message transmission method ensures the real-time performance and continuity of position information.

[0097] As used in this application, terms such as "component", "module", "system", etc. are intended to refer to computer-related entities, which can be hardware, firmware, a combination of hardware and software, software, or software in operation. For example, a component can be, but is not limited to: a process running on a processor, the processor, an object, an executable file, a thread in execution, a program, and / or a computer. As an example, an application running on a computing device and the computing device itself can both be components. One or more components can exist in a process and / or thread in execution, and the components can be located in one computer and / or distributed between two or more computers. Additionally, these components can execute from various computer-readable media having various data structures thereon. These components can communicate in a local and / or remote process manner through signals such as according to one or more data packets (e.g., data from one component that interacts with another component in a local system, a distributed system, and / or communicates with other systems via a network such as the Internet in a signal manner).

[0098] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not restrictive. Although the present invention has been described in detail with reference to the preferred embodiments, those of ordinary skill in the art should understand that the technical solutions of the present invention can be modified or equivalently replaced without departing from the spirit and scope of the technical solutions of the present invention, and they should all be covered by the scope of the claims of the present invention.

Claims

1. An absolute photoelectric encoder position calculation method for a servo system, characterized in that, The method includes: S1. Initialization module. In the initial stage, the initial absolute position is calculated using the cursor code, and the working range of the timer CNT value calculation unit is determined based on the initial absolute position, and then the working range of the M track is determined; S2. Fast position calculation. During operation, signal acquisition and subdivision calculation are only performed on the M track, and the synthesized single-turn absolute angle is output. Combining with the timer CNT value, the total absolute position is further obtained; Among them, signal acquisition is to obtain the sine signal and cosine signal of the M track through an analog-to-digital converter; Subdivision calculation. According to the corrected sine value and cosine value, the arctangent value is obtained through the arctangent function. The formula is: Among them, the look-up table method is a look-up table for pre-stored angle values, and only one calculation is performed on the M track; The pre-built angle-tangent value mapping table by the look-up table method obtains the arctangent value quickly through ratio index look-up of and combination with the interpolation algorithm; The method for synthesizing the single-turn absolute value angle is: combining the grating index and subdivision value of the M track to generate an angle value with a resolution of 23 bits. The formula is: Among them, is the index of the current grating determined by the timer CNT value of the M track, 9 digits; is the upper 14 bits of the subdivision value; The external counter is controlled by the direction signal to accumulate the number of turns. The number of turns recorded by the external counter is multiplied by the number of subdivision positions per turn, 512 × 2^14, to obtain the cumulative position value from the initial position to the current number of turns. Adding the single-turn absolute angle value to obtain the complete absolute position S3. Position transmission. Through the position information communication unit, the calculated absolute position information is sent to the servo system.

2. The method for calculating the position of the absolute photoelectric encoder for a servo system according to claim 1, wherein In S2, it includes the following steps: S21. Obtain the sine signal and cosine signal of the M track from the analog-to-digital converter; S22. Perform offset correction on the obtained sine signal and cosine signal; S23. Calibrate the signal using the pre-calibrated zero offset parameter and gain correction coefficient after offset correction.

3. The method for calculating the position of the absolute photoelectric encoder for a servo system according to claim 2, wherein After signal acquisition, center offset correction is first performed on it. The formula is: , , where, and are the original data sampled by the ADC, and 2048 is the central value; Then, through the pre-calibrated zero offset and gain coefficient, the signal after center offset correction is signal calibrated. The formula is: Among them, is the zero-point offset parameter, is the gain correction coefficient; Then, phase compensation is performed on the calibrated signal. The formula is: Among them, is the phase correction coefficient.

4. The method for calculating the position of the absolute photoelectric encoder for a servo system according to claim 1, characterized in that, The system supports multi-turn absolute value detection. The number of turns is accumulated through the direction signal and the external counter, and combined with the single-turn angle value to generate the complete absolute position.

5. The method for calculating the position of the absolute photoelectric encoder for a servo system according to claim 1, wherein It also includes a redundancy detection module for secondary verification of the fast calculation result. The verification condition is: When the fast calculation result and the secondary calculation result are inconsistent for 8 consecutive times, the error alarm mechanism is triggered; The secondary verification of the redundancy detection module uses an algorithm or data source independent of the fast calculation module.

6. The method for calculating the position of the absolute photoelectric encoder for a servo system according to claim 5, characterized in that, It also includes an alarm output module for generating and transmitting an error alarm signal. The alarm signal is output through a 485 communication interface and includes an error code and a position deviation value.

7. The absolute photoelectric encoder position calculation method for a servo system according to claim 1, characterized in that The position transmission module uses the EtherCAT, CAN protocol or 485 protocol to transmit the absolute position information in the form of periodic messages.

Citation Information

Patent Citations

  • Device of three-channel encoder refinement and positional information acquisition with tested piece synchronization function

    CN105487489A

  • Compensation parameter obtaining method and system of absolute value encoder

    CN108844556A