A precision calibration method, system, device and storage medium for an optical encoder

The standard values ​​and ratios of the optical encoder were obtained through the horizontal standard analysis method, which solved the problem that the optical encoder could not be effectively calibrated in the tilted state, and achieved accurate calibration of the optical encoder and data accuracy in the tilted state.

CN119197619BActive Publication Date: 2025-03-28横川机器人(深圳)有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411675867.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-22
Publication Date
2025-03-28
Estimated Expiration
2044-11-22

AI Technical Summary

Technical Problem

The existing optical encoder accuracy calibration methods cannot effectively calibrate the accuracy of the optical encoder in the tilted state, resulting in data distortion.

Method used

The horizontal standard analysis method is used to obtain the horizontal and tilt standard values ​​of the optical encoder, analyze and calculate the positive and inverse tilt standard ratios, obtain the signals in real time and calibrate based on these ratios.

Benefits of technology

Effectively identify and calibrate optical encoder in tilted state, improve calibration accuracy and avoid data distortion.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119197619B_ABST
    Figure CN119197619B_ABST
Patent Text Reader

Abstract

The present invention discloses an optical encoder precision calibration method, system, device and storage medium, and relates to the technical field of optical encoders, including: placing the optical encoder horizontally, and using a horizontal standard analysis method to obtain a horizontal standard value; tilting the optical encoder to obtain a tilt standard value; obtaining a positive tilt standard ratio and a reverse tilt standard ratio; analyzing the obtained signals, and calibrating the optical encoder; the present invention is used to solve the problem in the existing method for precision calibration of optical encoders that when the optical encoder is tilted, if the photosensor happens to receive a valid signal at this time, the existing improved method cannot effectively calibrate the optical encoder in a tilted state, thereby causing the data collected by the optical encoder to be distorted.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of optical encoders, and in particular to an accuracy calibration method, system, device and storage medium for an optical encoder. Background Art

[0002] An optical encoder is a digital sensor mainly used in industrial control and automation. It can convert physical displacement in motion into digital signal output to achieve precise position detection and control. Optical encoders are easier to improve accuracy and resolution than magnetic encoders and can be used in applications that generate strong magnetic fields. The accuracy of the encoder is used to measure the repeatable average deviation between the actual value and the set value under normal circumstances. For rotary encoders, it is generally defined as arc seconds or arc minutes, while for linear encoders, the accuracy is generally microns.

[0003] The existing method for calibrating the accuracy of optical encoders usually adds a calibration algorithm and calibration parameters for calibrating the accuracy in the digital processor inside the optical encoder, and calibrates the accuracy of the optical encoder based on the calibration algorithm and calibration parameters during the operation of the optical encoder. Although this improved method can improve the accuracy of the optical encoder without adding hardware costs, when the optical encoder is in a specific position and causes the optical encoder to tilt, if the photosensor happens to receive a valid signal at this time, the tilted optical encoder will still be judged as a normal optical encoder only by the calibration algorithm and calibration parameters, resulting in the inability to effectively calibrate the optical encoder in a tilted state, thereby causing distortion of the data collected by the optical encoder. For example, in a patent application with publication number CN107843227A, a method for improving the accuracy of an encoder based on calibration technology is disclosed. The solution is to calibrate the encoder angle by calling calibration parameters through a polynomial calibration algorithm, while other improvements in the accuracy calibration of optical encoders usually analyze the preset angle during rotation, and perform accuracy calibration by comparing the actual rotation angle with the preset angle. If the optical encoder is tilted, the actual angle of rotation of the code disk in the optical encoder will still be equal to the preset angle, resulting in this improved method still being unable to effectively calibrate the optical encoder in a tilted state. In view of this, it is necessary to improve the existing accuracy calibration method for optical encoders. Summary of the invention

[0004] The present invention aims to solve one of the technical problems in the prior art to at least a certain extent, by proposing a precision calibration method, system, device and storage medium for an optical encoder, so as to solve the problem in the existing precision calibration method for an optical encoder that when the optical encoder is in a specific position causing the optical encoder to tilt, if the photosensitive sensor happens to receive a valid signal at this time, the existing improved method will still judge the tilted optical encoder as a normal optical encoder, resulting in the inability to effectively calibrate the optical encoder in the tilted state, thereby causing the data collected by the optical encoder to be distorted.

[0005] To achieve the above objectives, in a first aspect, the present application provides a method for calibrating the accuracy of an optical encoder, comprising the following steps:

[0006] The photoelectric sensors in the optical encoder are respectively recorded as Class A sensors and Class B sensors; the optical encoder is placed horizontally, and after starting the light source, the horizontal standard analysis method is used to obtain the horizontal standard values ​​of the Class A sensors and the Class B sensors, wherein the horizontal standard values ​​include the positive neighbor standard value, the positive neighbor buffer value, the positive standard mean value, the positive standard buffer value, the reverse neighbor standard value, the reverse neighbor buffer value, the reverse standard mean value, and the reverse standard buffer value;

[0007] The horizontally placed optical encoder is tilted, and the tilt standard values ​​of the class A sensor and the class B sensor are obtained based on the horizontal standard analysis method; the horizontal standard value and the tilt standard value are analyzed, and a positive tilt standard ratio and a reverse tilt standard ratio are obtained based on the analysis results;

[0008] When the optical encoder is calibrated for accuracy, the signals of the Class A sensor and the Class B sensor are acquired in real time, and the acquired signals are analyzed based on the horizontal standard analysis method. The optical encoder is calibrated based on the analysis results, the positive tilt standard ratio, and the reverse tilt standard ratio.

[0009] Furthermore, using the level standard analysis method to obtain the level standard values ​​of the A-level sensor and the B-level sensor includes:

[0010] Place the optical encoder horizontally and place the Class A sensor and Class B sensor at the signal receiving position under standard conditions, where the standard conditions are free from external influences and accurate in accuracy;

[0011] Start the light source and use the horizontal standard analysis method for analysis; the horizontal standard analysis method includes the forward standard analysis method and the reverse standard analysis method;

[0012] The forward standard analysis method includes: establishing a plane rectangular coordinate system, recorded as the forward analysis coordinate system, wherein the unit of the X-axis of the forward analysis coordinate system is time, and the unit of the Y-axis is signal strength; rotating the code disk clockwise, and drawing corresponding curves in the forward analysis coordinate system based on the signal strengths received by the A-level sensor and the B-level sensor, recorded as forward curve A and forward curve B respectively;

[0013] The highest point and the lowest point in the forward curve A are recorded as the peak point FDA and the valley point GDA respectively; the highest point and the lowest point in the forward curve B are recorded as the peak point FDB and the valley point GDB respectively; for any peak point FDA, the two peak points GDB closest to the peak point FDA are recorded as adjacent peak points LF 1 and adjacent peak point LF 2 , the two valley points GDB closest to the peak point FDA are recorded as adjacent valley points LG 1 And the adjacent valley point LG 2 , where the adjacent peak point LF 1 LG 1 Compared to the peak FDA, it is on the same side and adjacent to the peak LF 2 LG 2 Compared to the peak point, FDA is on the same side;

[0014] The peak point FDA is respectively 1 LG 1 The angle formed by the connecting line is recorded as the adjacent angle LJ 1 ; The peak point FDA is respectively connected with the adjacent peak point LF 2 LG 2 The angle formed by the connecting line is recorded as the adjacent angle LJ 2 ; Use the neighboring angle algorithm to obtain the neighboring eigenvalues ​​of the peak point FDA. The neighboring angle algorithm is: , where T is the neighboring eigenvalue, J 1 is the adjacent angle LJ 1 The value corresponding to the angle, J 2 is the adjacent angle LJ 2 The value corresponding to the angle, L 1 LF is the adjacent peak point 1 The distance from the peak FDA, L 2 LF is the adjacent peak point 2 The distance from the peak FDA, L 0 It is the distance between the peak point FDA and the valley point GDA closest to the peak point FDA;

[0015] Obtain the neighboring characteristic values ​​of all peak FDAs, and record the average value of all neighboring characteristic values ​​as the neighboring standard value; record the maximum value of the difference between all neighboring characteristic values ​​and the neighboring standard value as the neighboring buffer value.

[0016] Furthermore, the positive standard analysis method also includes:

[0017] For any peak point FDB, the two valley points GDA closest to the peak point FDB are recorded as the lower valley points XG 1 And the lower valley point XG 2 , use the intensity mean algorithm to obtain the intensity mean corresponding to the peak point FDB. The intensity mean algorithm is: , where G is the mean intensity, g 0 is the ordinate of the peak point FDB, g 1 is the ordinate of the lower valley point XG1, g 2 is the ordinate of the lower valley point XG2;

[0018] Obtain the intensity mean values ​​corresponding to all peak FDB points, and record the average value of all intensity means as the standard mean value; record the maximum value of the difference between all intensity means and the standard mean value as the standard buffer value;

[0019] The neighbor standard value, neighbor buffer value, standard mean and standard buffer value obtained in the forward standard analysis method are recorded as the positive neighbor standard value, positive neighbor buffer value, positive standard mean and positive standard buffer value, respectively.

[0020] Furthermore, the reverse standard analysis method is: after rotating the code wheel in the forward standard analysis method counterclockwise, execute the subsequent steps in the forward standard analysis method, and record the obtained neighbor standard value, neighbor buffer value, standard mean and standard buffer value as the reverse neighbor standard value, reverse neighbor buffer value, reverse standard mean and reverse standard buffer value respectively.

[0021] Further, based on the horizontal standard analysis method, the tilt standard values ​​of the A-level sensor and the B-level sensor are obtained; the horizontal standard value and the tilt standard value are analyzed, and based on the analysis result, the positive tilt standard ratio and the reverse tilt standard ratio are obtained, including:

[0022] The code disk in the horizontally placed optical encoder is tilted k degrees, and the horizontal standard analysis method is used for analysis. The neighbor standard value, neighbor buffer value, standard mean value and standard buffer value obtained during the analysis are recorded as the tilt standard value, where k is the maximum angle allowed for the code disk to tilt;

[0023] In the forward standard analysis method after the code disk is tilted: the obtained neighbor standard value is recorded as the positive neighbor tilt value, and the obtained neighbor buffer value is recorded as the positive neighbor tilt buffer value; when the positive neighbor standard value is greater than or equal to the positive neighbor tilt value, |(C 1 -c 1 )-(C 2 +c 2 )| is recorded as the tilt judgment value, where C 1 is the standard value of the positive neighbor, c 1is the positive neighbor buffer value, C 2 is the positive adjacent tilt value, c 2 is the positive neighbor tilt buffer value; when the positive neighbor standard value is less than the positive neighbor tilt value, |(C 2 -c 2 )-(C 1 +c 1 )| is recorded as the tilt judgment value;

[0024] The obtained standard mean is recorded as the positive slope mean, and the obtained standard buffer value is recorded as the positive slope buffer value; |Z 1 -z 1 -Z 2 -z 2 The value of | is recorded as the signal judgment value, where Z 1 is the positive standard mean, Z 2 is the positive slope mean, z 1 is the positive standard buffer value, z 2 is the positive slope buffer value;

[0025] The value obtained by dividing the tilt judgment value by the positive signal judgment value is recorded as the positive tilt standard ratio.

[0026] Further, analyzing the horizontal standard value and the tilt standard value, and obtaining the positive tilt standard ratio and the reverse tilt standard ratio based on the analysis result also includes:

[0027] In the reverse standard analysis method after the code disk is tilted: the obtained neighbor standard value is recorded as the reverse neighbor tilt value, and the obtained neighbor buffer value is recorded as the reverse neighbor tilt buffer value; when the reverse neighbor standard value is greater than or equal to the reverse neighbor tilt value, |(D 1 -d 1 )-(D 2 +d 2 )| is recorded as the tilt judgment value, where D 1 is the inverse neighbor standard value, d 1 is the reverse neighbor buffer value, D 2 is the inverse neighbor tilt value, d 2 is the reverse neighbor tilt buffer value; when the reverse neighbor standard value is less than the reverse neighbor tilt value, |(D 2 -d 2 )-(D 1 +d 1 )| is recorded as the tilt judgment value;

[0028] The obtained standard mean is recorded as the inverse oblique mean, and the obtained standard buffer value is recorded as the inverse oblique buffer value; |X 1 -x 1 -X 2 -x 2 The value of | is recorded as the signal judgment value, where X 1 is the inverse standard mean, X2 is the inverse slant mean, x 1 is the inverse standard buffer value, x 2 is the reverse slope buffer value;

[0029] The value obtained by dividing the tilt judgment value by the inverse signal judgment value is recorded as the inverse tilt standard ratio.

[0030] Further, the acquired signal is analyzed based on the horizontal standard analysis method, and the optical encoder is calibrated based on the analysis result, the positive tilt standard ratio and the reverse tilt standard ratio, including:

[0031] When the optical encoder is calibrated for accuracy, the rotation direction of the code disk at this time is recorded as the real-time rotation direction, the signals of the A-level sensor and the B-level sensor are obtained in real time, and the standard analysis method in which the rotation direction of the code disk is the same as the real-time rotation direction is used for analysis, wherein the standard analysis method includes a forward standard analysis method and a reverse standard analysis method;

[0032] The neighbor standard value, neighbor buffer value, standard mean value and standard buffer value obtained through analysis are recorded as the real-time standard value, real-time neighbor buffer value, real-time mean value and real-time standard buffer value respectively; based on the method for obtaining the tilt judgment value and the tilt signal value in the standard analysis method after the code disk is tilted, the real-time standard value, the real-time neighbor buffer value, the real-time mean value and the tilt judgment value and the tilt signal value corresponding to the horizontal standard value are obtained, and are recorded as the real-time tilt judgment value and the real-time tilt signal value respectively;

[0033] When the real-time rotation direction is clockwise and the ratio of the real-time tilt judgment value to the real-time tilt signal value is equal to the positive tilt standard ratio, there is no need to calibrate the optical encoder;

[0034] When the real-time rotation direction is counterclockwise and the ratio of the real-time tilt judgment value to the real-time tilt signal value is equal to the counter-tilt standard ratio, there is no need to calibrate the optical encoder;

[0035] When the ratio of the real-time tilt judgment value and the real-time tilt signal value is not equal to the positive tilt standard ratio, when the real-time tilt judgment value is greater than the tilt judgment value, reset the tilt angle of the code disk; when the real-time tilt signal value is greater than the tilt signal value, reset the brightness of the light source and the tilt angle of the code disk; when the real-time tilt judgment value is less than or equal to the tilt judgment value and the real-time tilt signal value is less than or equal to the tilt signal value, no processing is required, wherein the tilt judgment value and the tilt signal value are the tilt judgment value and the tilt signal value obtained when the code disk is tilted k degrees in the standard analysis method corresponding to the real-time tilt judgment value and the real-time tilt signal value.

[0036] In a second aspect, the present application also provides an optical encoder accuracy calibration system, including a horizontal standard analysis module, a tilt standard analysis module, and a real-time tilt calibration module;

[0037] The horizontal standard analysis module is used to record the photoelectric sensors in the optical encoder as Class A sensors and Class B sensors respectively; the optical encoder is placed horizontally, and after the light source is started, the horizontal standard analysis method is used to obtain the horizontal standard values ​​of the Class A sensors and the Class B sensors, wherein the horizontal standard values ​​include the positive neighbor standard value, the positive neighbor buffer value, the positive standard mean value, the positive standard buffer value, the reverse neighbor standard value, the reverse neighbor buffer value, the reverse standard mean value, and the reverse standard buffer value;

[0038] The tilt standard analysis module is used to tilt the horizontally placed optical encoder, and obtain the tilt standard values ​​of the A-level sensor and the B-level sensor based on the horizontal standard analysis method; analyze the horizontal standard value and the tilt standard value, and obtain the positive tilt standard ratio and the reverse tilt standard ratio based on the analysis results;

[0039] The real-time tilt calibration module is used to obtain the signals of Class A sensors and Class B sensors in real time when calibrating the accuracy of the optical encoder, analyze the obtained signals based on the horizontal standard analysis method, and calibrate the optical encoder based on the analysis results, the positive tilt standard ratio and the reverse tilt standard ratio.

[0040] In a third aspect, the present application provides an electronic device, comprising a processor and a memory, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the steps in the above method are performed.

[0041] In a fourth aspect, the present application provides a storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps in the above method are performed.

[0042] Beneficial effects of the present invention: the present invention first places the optical encoder horizontally, and after starting the light source, uses the horizontal standard analysis method to obtain the horizontal standard values ​​of the A-level sensor and the B-level sensor; then tilts the horizontally placed optical encoder, and obtains the tilt standard values ​​of the A-level sensor and the B-level sensor based on the horizontal standard analysis method. The advantage of this is that by obtaining the horizontal standard value and the tilt standard value, it is helpful to effectively identify the optical encoder in a tilted state in the subsequent calibration process of the optical encoder, thereby ensuring that the optical encoder is in a tilted state or the code disk is in a tilted state during calibration, and then effectively calibrating the optical encoder in a tilted state;

[0043] The present invention also analyzes the horizontal standard value and the tilt standard value, and obtains the positive tilt standard ratio and the reverse tilt standard ratio based on the analysis result; finally, the obtained signal is analyzed based on the horizontal standard analysis method, and the optical encoder is calibrated based on the analysis result, the positive tilt standard ratio and the reverse tilt standard ratio. The advantage of this is that by obtaining the positive tilt standard ratio and the reverse tilt standard ratio, the tilt direction of the optical encoder in a tilted state can be effectively distinguished, thereby improving the accuracy of calibration. At the same time, by calculating the real-time tilt judgment value and the real-time tilt signal value, the optical encoder after tilt can be calibrated while avoiding the incorrect calibration of the optical encoder that has not generated tilt, thereby causing the problem of data distortion collected by the optical encoder. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] Figure 1 is a functional block diagram of the system of the present invention;

[0045] Figure 2 is a flow chart of the steps of the method of the present invention;

[0046] Figure 3 It is a schematic structural diagram of the optical encoder of the present invention;

[0047] Figure 4 is a schematic diagram of a forward analysis coordinate system of the present invention;

[0048] Figure 5 It is a schematic structural diagram of the electronic device of the present invention. DETAILED DESCRIPTION

[0049] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0050] Example 1, first aspect, please refer to Figure 1 As shown, the present application provides an optical encoder precision calibration system, including a horizontal standard analysis module, a tilt standard analysis module and a real-time tilt calibration module;

[0051] The horizontal standard analysis module is used to record the photoelectric sensors in the optical encoder as Class A sensors and Class B sensors respectively; the optical encoder is placed horizontally, and after the light source is started, the horizontal standard analysis method is used to obtain the horizontal standard values ​​of the Class A sensors and the Class B sensors, wherein the horizontal standard values ​​include the positive neighbor standard value, the positive neighbor buffer value, the positive standard mean value, the positive standard buffer value, the reverse neighbor standard value, the reverse neighbor buffer value, the reverse standard mean value, and the reverse standard buffer value;

[0052] The horizontal standard analysis module includes a horizontal standard analysis unit, the horizontal standard analysis unit is configured with a horizontal standard analysis strategy, the horizontal standard analysis strategy includes: placing the optical encoder horizontally and placing the A-level sensor and the B-level sensor at the signal receiving position under a standard condition, wherein the standard condition is a condition that is not affected by the outside world and has accurate precision;

[0053] In a specific implementation, for example, in a data processing process, the structure in the optical encoder is as follows: Figure 3 As shown, GG1 is the light source in the optical encoder, GG2 is the code disk in the optical encoder, GG3 and GG4 are the A-level sensor and the B-level sensor, and GG0 is the light emitted by the light source;

[0054] Start the light source and use the horizontal standard analysis method for analysis; the horizontal standard analysis method includes the forward standard analysis method and the reverse standard analysis method; the forward standard analysis method includes: establishing a plane rectangular coordinate system, recorded as the forward analysis coordinate system, wherein the unit of the X-axis of the forward analysis coordinate system is time, and the unit of the Y-axis is signal strength; rotating the code disk clockwise, and drawing corresponding curves in the forward analysis coordinate system based on the signal strengths received by the A-level sensor and the B-level sensor, recorded as the forward curve A and the forward curve B respectively;

[0055] In the specific implementation process, for example, in a data processing process, the forward analysis coordinate system is obtained as follows Figure 4 As shown, curve QQ1 is the positive curve A, curve QQ2 is the positive curve B, point FDA is a peak point FDA in curve QQ1, and points FDB1 and FDB2 are adjacent peak points LF of point FDA. 1 and adjacent peak point LF 2 , point GDB1 and point GDB2 are the adjacent valley points LG of point FDA 1 And the adjacent valley point LG 2 ;

[0056] The highest point and the lowest point in the forward curve A are recorded as the peak point FDA and the valley point GDA respectively; the highest point and the lowest point in the forward curve B are recorded as the peak point FDB and the valley point GDB respectively; for any peak point FDA, the two peak points GDB closest to the peak point FDA are recorded as adjacent peak points LF 1 and adjacent peak point LF 2 , the two valley points GDB closest to the peak point FDA are recorded as adjacent valley points LG 1 And the adjacent valley point LG 2 , where the adjacent peak point LF 1 LG 1 Compared to the peak FDA, it is on the same side and adjacent to the peak LF2 LG 2 Compared to the peak point, FDA is on the same side;

[0057] In the specific implementation process, by analyzing the peak point FDA and the valley point GDA adjacent to the peak point FDA, it is possible to ensure that the positions of the peak points FDA and the valley point GDA adjacent to the peak point FDA when it is acquired are obtained. If the positions of the peak points FDA and the valley point GDA adjacent to the peak point FDA when it is acquired in the subsequent analysis are greatly different from the current situation, the data obtained in the subsequent analysis will be different from the data at this time, which can provide data support when the optical encoder is subsequently determined to be tilted;

[0058] The peak point FDA is respectively 1 LG 1 The angle formed by the connecting line is recorded as the adjacent angle LJ 1 ; The peak point FDA is respectively connected with the adjacent peak point LF 2 LG 2 The angle formed by the connecting line is recorded as the adjacent angle LJ 2 ; Use the neighboring angle algorithm to obtain the neighboring eigenvalues ​​of the peak point FDA. The neighboring angle algorithm is: , where T is the neighboring eigenvalue, J 1 is the adjacent angle LJ 1 The value corresponding to the angle, J 2 is the adjacent angle LJ 2 The value corresponding to the angle, L 1 LF is the adjacent peak point 1 The distance from the peak FDA, L 2 LF is the adjacent peak point 2 The distance from the peak FDA, L 0 It is the distance between the peak point FDA and the valley point GDA closest to the peak point FDA;

[0059] In the specific implementation process, for example, during a data processing, the neighboring angle LJ 1 The value corresponding to the angle is 45, and the adjacent angle LJ 2 The angle corresponding to the value is 45, and the adjacent peak point LF 1 The distance between the peak point FDA is 9, and the adjacent peak point LF 2 The distance between the peak point FDA and the valley point GDA closest to the peak point FDA is 10, and the distance between the peak point FDA and the valley point GDA closest to the peak point FDA is 6. Then, by calculation, it can be obtained that the neighboring eigenvalue of the peak point FDA is about -0.167;

[0060] Obtain the neighboring characteristic values ​​of all peak points FDA, and record the average value of all neighboring characteristic values ​​as the neighboring standard value; record the maximum value of the difference between all neighboring characteristic values ​​and the neighboring standard value as the neighboring buffer value; in the specific implementation process, by obtaining the neighboring characteristic values ​​and the neighboring buffer values, the range in which the neighboring characteristic values ​​of the peak point FDA should be located when being obtained in a normal state can be obtained, which is helpful to provide a judgment basis for the subsequent judgment of the tilt of the optical encoder;

[0061] For any peak point FDB, the two valley points GDA closest to the peak point FDB are recorded as the lower valley points XG 1 And the lower valley point XG 2 , use the intensity mean algorithm to obtain the intensity mean corresponding to the peak point FDB. The intensity mean algorithm is: , where G is the mean intensity, g 0 is the ordinate of the peak point FDB, g 1 is the ordinate of the lower valley point XG1, g 2 is the ordinate of the lower valley point XG2;

[0062] In a specific implementation process, for example, in a data processing, the ordinate of the peak point FDB is 3, the ordinate of the lower valley point XG1 is 1, and the ordinate of the lower valley point XG2 is 2. Then, by calculation, it can be obtained that the intensity average of the peak point FDB is 1;

[0063] The intensity mean values ​​corresponding to all peak points FDB are obtained, and the average value of all intensity mean values ​​is recorded as the standard mean value; the maximum value of the difference between all intensity mean values ​​and the standard mean value is recorded as the standard buffer value; in the specific implementation process, by calculating the standard mean value and the standard buffer value, the range of the signal intensity received by the internal photoelectric sensor of the optical encoder during normal operation can be obtained, which is helpful to provide a judgment basis for the subsequent judgment of the tilt of the optical encoder;

[0064] The neighbor standard value, neighbor buffer value, standard mean, and standard buffer value obtained in the forward standard analysis method are recorded as the positive neighbor standard value, positive neighbor buffer value, positive standard mean, and positive standard buffer value, respectively;

[0065] The reverse standard analysis method is as follows: after rotating the code disk in the forward standard analysis method counterclockwise, the subsequent steps in the forward standard analysis method are performed, and the obtained neighbor standard value, neighbor buffer value, standard mean value and standard buffer value are recorded as the reverse neighbor standard value, reverse neighbor buffer value, reverse standard mean value and reverse standard buffer value respectively;

[0066] In the specific implementation process, in this embodiment, only the clockwise and counterclockwise rotations of the code disk in the horizontal state are analyzed. If there is a standard condition when the code disk is at a certain angle during the actual analysis, the analysis steps under the standard condition can be added according to the actual situation and the standard analysis method.

[0067] The tilt standard analysis module is used to tilt the horizontally placed optical encoder, and obtain the tilt standard values ​​of the A-level sensor and the B-level sensor based on the horizontal standard analysis method; analyze the horizontal standard value and the tilt standard value, and obtain the positive tilt standard ratio and the reverse tilt standard ratio based on the analysis results;

[0068] The tilt standard analysis module includes a tilt standard analysis unit, and the tilt standard analysis unit is configured with a tilt standard analysis strategy, and the tilt standard analysis strategy includes:

[0069] The code disk in the horizontally placed optical encoder is tilted k degrees, and the horizontal standard analysis method is used for analysis. The neighbor standard value, neighbor buffer value, standard mean value and standard buffer value obtained during the analysis are recorded as the tilt standard value, where k is the maximum angle allowed for the code disk to tilt;

[0070] In the forward standard analysis method after the code disk is tilted: the obtained neighbor standard value is recorded as the positive neighbor tilt value, and the obtained neighbor buffer value is recorded as the positive neighbor tilt buffer value; when the positive neighbor standard value is greater than or equal to the positive neighbor tilt value, |(C 1 -c 1 )-(C 2 +c 2 )| is recorded as the tilt judgment value, where C 1 is the standard value of the positive neighbor, c 1 is the positive neighbor buffer value, C 2 is the positive adjacent tilt value, c 2 is the positive neighbor tilt buffer value; when the positive neighbor standard value is less than the positive neighbor tilt value, |(C 2 -c 2 )-(C 1 +c 1 )| is recorded as the tilt judgment value;

[0071] In the specific implementation process, for example, in a data processing, the positive neighbor standard value obtained is -1, and the positive neighbor buffer value is 0.5; the positive neighbor tilt value obtained in the forward standard analysis method after the code disk is tilted is 0 and the positive neighbor tilt buffer value is 0.2, then the tilt judgment value can be calculated to be 0.3;

[0072] The obtained standard mean is recorded as the positive slope mean, and the obtained standard buffer value is recorded as the positive slope buffer value; |Z 1 -z 1 -Z 2 -z 2 The value of | is recorded as the signal judgment value, where Z 1 is the positive standard mean, Z 2 is the positive slope mean, z 1 is the positive standard buffer value, z 2is the positive slope buffer value; in the specific implementation process, for example, in a data processing, the positive standard value obtained is 1, the positive standard buffer value is 0.5, the positive slope mean value obtained in the forward standard analysis method after the code disk is tilted is 0.5, and the positive slope buffer value is 0.2, then the signal judgment value obtained by calculation is 0.2;

[0073] The value of dividing the tilt judgment value by the positive signal judgment value is recorded as the positive tilt standard ratio;

[0074] In the reverse standard analysis method after the code disk is tilted: the obtained neighbor standard value is recorded as the reverse neighbor tilt value, and the obtained neighbor buffer value is recorded as the reverse neighbor tilt buffer value; when the reverse neighbor standard value is greater than or equal to the reverse neighbor tilt value, |(D 1 -d 1 )-(D 2 +d 2 )| is recorded as the tilt judgment value, where D 1 is the inverse neighbor standard value, d 1 is the reverse neighbor buffer value, D 2 is the inverse neighbor tilt value, d 2 is the reverse neighbor tilt buffer value; when the reverse neighbor standard value is less than the reverse neighbor tilt value, |(D 2 -d 2 )-(D 1 +d 1 )| is recorded as the tilt judgment value;

[0075] In this embodiment, the tilt judgment value and the signal judgment value obtained in different standard analysis methods are different from each other. For example, the tilt judgment value and the signal judgment value obtained in the reverse standard analysis method after the code disk is tilted are different from the tilt judgment value and the signal judgment value obtained in the forward standard analysis method after the code disk is tilted.

[0076] The obtained standard mean is recorded as the inverse oblique mean, and the obtained standard buffer value is recorded as the inverse oblique buffer value; |X 1 -x 1 -X 2 -x 2 The value of | is recorded as the signal judgment value, where X 1 is the inverse standard mean, X 2 is the inverse slant mean, x 1 is the inverse standard buffer value, x 2 is the reverse slope buffer value;

[0077] The value obtained by dividing the tilt judgment value by the inverse signal judgment value is recorded as the inverse tilt standard ratio.

[0078] The real-time tilt calibration module is used to obtain the signals of the class A sensor and the class B sensor in real time when calibrating the accuracy of the optical encoder, analyze the obtained signals based on the horizontal standard analysis method, and calibrate the optical encoder based on the analysis results, the positive tilt standard ratio and the reverse tilt standard ratio;

[0079] The real-time tilt calibration module includes a real-time calibration unit, which is configured with a real-time calibration strategy. The real-time calibration strategy includes: when the optical encoder is calibrated for accuracy, the rotation direction of the code disk at this time is recorded as the real-time rotation direction, the signals of the A-level sensor and the B-level sensor are acquired in real time, and the standard analysis method in which the rotation direction of the code disk is the same as the real-time rotation direction is used for analysis in the horizontal standard analysis method, wherein the standard analysis method includes a forward standard analysis method and a reverse standard analysis method;

[0080] In the specific implementation process, for example, when processing data once, if the real-time rotation direction is clockwise, the forward standard analysis method in the horizontal standard analysis method should be used for analysis to ensure that the data obtained by the analysis can effectively determine whether the optical encoder is tilted, and then perform effective calibration;

[0081] The neighbor standard value, neighbor buffer value, standard mean value and standard buffer value obtained through analysis are recorded as the real-time standard value, real-time neighbor buffer value, real-time mean value and real-time standard buffer value respectively; based on the method for obtaining the tilt judgment value and the tilt signal value in the standard analysis method after the code disk is tilted, the real-time standard value, the real-time neighbor buffer value, the real-time mean value and the tilt judgment value and the tilt signal value corresponding to the horizontal standard value are obtained, and are recorded as the real-time tilt judgment value and the real-time tilt signal value respectively;

[0082] In the specific implementation process, for example, when the real-time rotation direction during one analysis is clockwise, when obtaining the real-time standard value, the real-time neighbor buffer value, the real-time mean, and the tilt judgment value and the tilt signal value corresponding to the real-time standard buffer value, the method of obtaining the tilt judgment value and the tilt signal value in the forward standard analysis method after the code disk is tilted and the positive neighbor standard value, the positive neighbor buffer value, the positive standard mean, and the positive standard buffer value in the horizontal standard value are used for analysis;

[0083] When the real-time rotation direction is clockwise and the ratio of the real-time tilt judgment value to the real-time tilt signal value is equal to the positive tilt standard ratio, there is no need to calibrate the optical encoder;

[0084] When the real-time rotation direction is counterclockwise and the ratio of the real-time tilt judgment value to the real-time tilt signal value is equal to the counter-tilt standard ratio, there is no need to calibrate the optical encoder;

[0085] When the ratio of the real-time tilt judgment value and the real-time tilt signal value is not equal to the positive tilt standard ratio, when the real-time tilt judgment value is greater than the tilt judgment value, reset the tilt angle of the code disk; when the real-time tilt signal value is greater than the tilt signal value, reset the brightness of the light source and the tilt angle of the code disk; when the real-time tilt judgment value is less than or equal to the tilt judgment value and the real-time tilt signal value is less than or equal to the tilt signal value, no processing is required, wherein the tilt judgment value and the tilt signal value are the tilt judgment value and the tilt signal value obtained when the code disk is tilted k degrees in the standard analysis method corresponding to the real-time tilt judgment value and the real-time tilt signal value;

[0086] During the specific implementation process, for example, during a data processing, the ratio of the real-time tilt judgment value and the real-time tilt signal value is not equal to the positive tilt standard ratio. At the same time, when the real-time tilt judgment value is greater than the tilt judgment value and the real-time tilt signal value is less than or equal to the tilt signal value, only the tilt angle of the code disk is reset.

[0087] Example 2, second aspect, please refer to Figure 2 As shown, the present application also provides a method for calibrating the accuracy of an optical encoder, comprising the following steps:

[0088] Step S1, recording the photoelectric sensors in the optical encoder as Class A sensors and Class B sensors respectively; placing the optical encoder horizontally, starting the light source, and using the horizontal standard analysis method to obtain the horizontal standard values ​​of the Class A sensors and the Class B sensors, wherein the horizontal standard values ​​include a positive neighbor standard value, a positive neighbor buffer value, a positive standard mean value, a positive standard buffer value, an inverse neighbor standard value, an inverse neighbor buffer value, an inverse standard mean value, and an inverse standard buffer value;

[0089] Step S1 includes the following sub-steps: Step S101, placing the optical encoder horizontally and placing the Class A sensor and the Class B sensor at a signal receiving position under a standard condition, wherein the standard condition is a condition that is not affected by the outside world and has accurate accuracy;

[0090] Step S102, start the light source and use the horizontal standard analysis method to perform analysis; the horizontal standard analysis method includes a forward standard analysis method and a reverse standard analysis method.

[0091] Step S103, the forward standard analysis method includes: step S1031, establishing a plane rectangular coordinate system, recorded as a forward analysis coordinate system, wherein the unit of the X-axis of the forward analysis coordinate system is time, and the unit of the Y-axis is signal strength; rotating the code disk clockwise, and drawing corresponding curves in the forward analysis coordinate system based on the signal strengths received by the A-level sensor and the B-level sensor, which are recorded as forward curve A and forward curve B respectively;

[0092] Step S1032: record the highest point and the lowest point in the forward curve A as the peak point FDA and the valley point GDA respectively; record the highest point and the lowest point in the forward curve B as the peak point FDB and the valley point GDB respectively; for any peak point FDA, record the two peak points GDB closest to the peak point FDA as adjacent peak points LF respectively. 1 and adjacent peak point LF 2 , the two valley points GDB closest to the peak point FDA are recorded as adjacent valley points LG 1 And the adjacent valley point LG 2 , where the adjacent peak point LF 1 LG 1 Compared to the peak FDA, it is on the same side and adjacent to the peak LF 2 LG 2 Compared to the peak point, FDA is on the same side;

[0093] Step S1033: compare the peak point FDA with the adjacent peak point LF 1 LG 1 The angle formed by the connecting line is recorded as the adjacent angle LJ 1 ; The peak point FDA is respectively connected with the adjacent peak point LF 2 LG 2 The angle formed by the connecting line is recorded as the adjacent angle LJ 2 ; Use the neighboring angle algorithm to obtain the neighboring eigenvalues ​​of the peak point FDA. The neighboring angle algorithm is: , where T is the neighboring eigenvalue, J 1 is the adjacent angle LJ 1 The value corresponding to the angle, J 2 is the adjacent angle LJ 2 The value corresponding to the angle, L 1 LF is the adjacent peak point 1 The distance from the peak FDA, L 2 LF is the adjacent peak point 2 The distance from the peak FDA, L 0 It is the distance between the peak point FDA and the valley point GDA closest to the peak point FDA;

[0094] Step S1034, obtaining the neighboring characteristic values ​​of all peak points FDA, and recording the average value of all neighboring characteristic values ​​as the neighboring standard value; recording the maximum value of the difference between all neighboring characteristic values ​​and the neighboring standard value as the neighboring buffer value;

[0095] Step S1035: for any peak point FDB, the two valley points GDA closest to the peak point FDB are recorded as lower valley points XG 1 And the lower valley point XG 2 , use the intensity mean algorithm to obtain the intensity mean corresponding to the peak point FDB. The intensity mean algorithm is: , where G is the mean intensity, g 0 is the ordinate of the peak point FDB, g 1 is the ordinate of the lower valley point XG1, g 2 is the ordinate of the lower valley point XG2;

[0096] Step S1036, obtaining the intensity means corresponding to all peak points FDB, and recording the average of all intensity means as the standard mean; recording the maximum value of the difference between all intensity means and the standard mean as the standard buffer value;

[0097] Step S1037, record the neighbor standard value, neighbor buffer value, standard mean value and standard buffer value obtained in the forward standard analysis method as the positive neighbor standard value, positive neighbor buffer value, positive standard mean value and positive standard buffer value respectively.

[0098] Step S104, the reverse standard analysis method is: after rotating the code disk in the forward standard analysis method counterclockwise, execute the subsequent steps in the forward standard analysis method, and record the obtained neighbor standard value, neighbor buffer value, standard mean and standard buffer value as the reverse neighbor standard value, reverse neighbor buffer value, reverse standard mean and reverse standard buffer value respectively.

[0099] Step S2, tilting the horizontally placed optical encoder, and obtaining the tilt standard values ​​of the class A sensor and the class B sensor based on the horizontal standard analysis method; analyzing the horizontal standard value and the tilt standard value, and obtaining the positive tilt standard ratio and the reverse tilt standard ratio based on the analysis result;

[0100] Step S2 includes: step S201, tilting a code disk in a horizontally placed optical encoder by k degrees, and analyzing it using a horizontal standard analysis method, recording the neighbor standard value, neighbor buffer value, standard mean value and standard buffer value obtained during the analysis as tilt standard values, wherein k is the maximum angle allowed for the code disk to tilt;

[0101] Step S202, in the forward standard analysis method after the code disk is tilted: the obtained neighbor standard value is recorded as the positive neighbor tilt value, and the obtained neighbor buffer value is recorded as the positive neighbor tilt buffer value; when the positive neighbor standard value is greater than or equal to the positive neighbor tilt value, |(C 1 -c 1 )-(C 2 +c 2 )| is recorded as the tilt judgment value, where C 1 is the standard value of the positive neighbor, c 1 is the positive neighbor buffer value, C 2 is the positive adjacent tilt value, c 2 is the positive neighbor tilt buffer value; when the positive neighbor standard value is less than the positive neighbor tilt value, |(C 2 -c 2 )-(C 1 +c1 )| is recorded as the tilt judgment value;

[0102] Step S203, record the obtained standard mean as the positive slope mean, record the obtained standard buffer value as the positive slope buffer value; 1 -z 1 -Z 2 -z 2 The value of | is recorded as the signal judgment value, where Z 1 is the positive standard mean, Z 2 is the positive slope mean, z 1 is the positive standard buffer value, z 2 is the positive slope buffer value;

[0103] Step S204, the value obtained by dividing the tilt judgment value by the positive signal judgment value is recorded as the positive tilt standard ratio;

[0104] Step S205, in the reverse standard analysis method after the code disk is tilted: the obtained neighbor standard value is recorded as the reverse neighbor tilt value, and the obtained neighbor buffer value is recorded as the reverse neighbor tilt buffer value; when the reverse neighbor standard value is greater than or equal to the reverse neighbor tilt value, |(D 1 -d 1 )-(D 2 +d 2 )| is recorded as the tilt judgment value, where D 1 is the inverse neighbor standard value, d 1 is the reverse neighbor buffer value, D 2 is the inverse neighbor tilt value, d 2 is the reverse neighbor tilt buffer value; when the reverse neighbor standard value is less than the reverse neighbor tilt value, |(D 2 -d 2 )-(D 1 +d 1 )| is recorded as the tilt judgment value;

[0105] Step S206, record the obtained standard mean as the inverse oblique mean, record the obtained standard buffer value as the inverse oblique buffer value; 1 -x 1 -X 2 -x 2 The value of | is recorded as the signal judgment value, where X 1 is the inverse standard mean, X 2 is the inverse slant mean, x 1 is the inverse standard buffer value, x 2 is the reverse slope buffer value;

[0106] Step S207: The value obtained by dividing the tilt judgment value by the inverse signal judgment value is recorded as the inverse tilt standard ratio.

[0107] Step S3, when the optical encoder is calibrated for accuracy, the signals of the class A sensor and the class B sensor are acquired in real time, and the acquired signals are analyzed based on the horizontal standard analysis method, and the optical encoder is calibrated based on the analysis results, the positive tilt standard ratio and the reverse tilt standard ratio;

[0108] Step S3 includes: step S301, when the optical encoder is calibrated for accuracy, the rotation direction of the code disk at this time is recorded as the real-time rotation direction, the signals of the class A sensor and the class B sensor are acquired in real time, and the standard analysis method in which the rotation direction of the code disk is the same as the real-time rotation direction in the horizontal standard analysis method is used for analysis, wherein the standard analysis method includes a forward standard analysis method and a reverse standard analysis method;

[0109] Step S302, the neighbor standard value, neighbor buffer value, standard mean value and standard buffer value obtained through analysis are recorded as real-time standard value, real-time neighbor buffer value, real-time mean value and real-time standard buffer value respectively; based on the method for obtaining the tilt judgment value and the tilt signal value in the standard analysis method after the code disk is tilted, the real-time standard value, the real-time neighbor buffer value, the real-time mean value and the tilt judgment value and the tilt signal value corresponding to the horizontal standard value are obtained, and they are recorded as real-time tilt judgment value and real-time tilt signal value respectively;

[0110] Step S303, when the real-time rotation direction is clockwise and the ratio of the real-time tilt judgment value to the real-time tilt signal value is equal to the positive tilt standard ratio, there is no need to calibrate the optical encoder;

[0111] Step S304, when the real-time rotation direction is counterclockwise and the ratio of the real-time tilt judgment value to the real-time tilt signal value is equal to the counter-tilt standard ratio, there is no need to calibrate the optical encoder;

[0112] Step S305, when the ratio of the real-time tilt judgment value and the real-time tilt signal value is not equal to the positive tilt standard ratio, when the real-time tilt judgment value is greater than the tilt judgment value, reset the tilt angle of the code disk; when the real-time tilt signal value is greater than the tilt signal value, reset the brightness of the light source and the tilt angle of the code disk; when the real-time tilt judgment value is less than or equal to the tilt judgment value and the real-time tilt signal value is less than or equal to the tilt signal value, no processing is required, wherein the tilt judgment value and the tilt signal value are the tilt judgment value and the tilt signal value obtained when the code disk is tilted k degrees in the standard analysis method corresponding to the real-time tilt judgment value and the real-time tilt signal value.

[0113] Example 3, please refer to Figure 5 As shown, Figure 5The structural schematic diagram of an electronic device is illustrated, and the electronic device may include: a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus. The memory stores computer-readable instructions, and the processor may call the instructions in the memory. When the computer-readable instructions are executed by the processor, the steps in the precision calibration method of an optical encoder are executed to achieve the following functions: the present invention first places the optical encoder horizontally, and after starting the light source, uses the horizontal standard analysis method to obtain the horizontal standard values ​​of the A-level sensor and the B-level sensor; then tilts the horizontally placed optical encoder, and obtains the inclination standard values ​​of the A-level sensor and the B-level sensor based on the horizontal standard analysis method; analyzes the horizontal standard value and the inclination standard value, and obtains the positive inclination standard ratio and the reverse inclination standard ratio based on the analysis result; finally, analyzes the obtained signal based on the horizontal standard analysis method, and calibrates the optical encoder based on the analysis result, the positive inclination standard ratio and the reverse inclination standard ratio.

[0114] In addition, the logic instructions in the above-mentioned memory can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0115] Embodiment 4, the present application also provides a computer-readable storage medium, the present application provides a storage medium, on which a computer program is stored, and when the computer program is executed by the processor, the steps in the above optical encoder accuracy calibration method are executed to achieve the following functions: the present invention first places the optical encoder horizontally, and after starting the light source, uses the horizontal standard analysis method to obtain the horizontal standard values ​​of the A-level sensor and the B-level sensor; then tilts the horizontally placed optical encoder, and obtains the inclination standard values ​​of the A-level sensor and the B-level sensor based on the horizontal standard analysis method; analyzes the horizontal standard value and the inclination standard value, and obtains the positive inclination standard ratio and the reverse inclination standard ratio based on the analysis results; finally, analyzes the obtained signal based on the horizontal standard analysis method, and calibrates the optical encoder based on the analysis results, the positive inclination standard ratio and the reverse inclination standard ratio.

[0116] Through the description of the above implementation methods, the embodiments of the present invention can be provided as methods, systems or computer program products. Based on such an understanding, the above technical solutions can be essentially or partly contributed to the prior art in the form of software products, which can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, an optical disk, etc., and include several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0117] In the embodiments provided in the present application, it should be understood that the disclosed system or method can be implemented in other ways. The embodiments described above are merely schematic. For example, the division of modules or units is only a logical function division. There may be other division methods in actual implementation. For example, multiple modules or units can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of systems, modules and units can be electrical, mechanical or other forms.

[0118] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A precision calibration method for an optical encoder, characterized in that: The steps include: The photoelectric sensors in the optical encoder are respectively recorded as Class A sensors and Class B sensors; the optical encoder is placed horizontally, and after starting the light source, the horizontal standard analysis method is used to obtain the horizontal standard values ​​of the Class A sensors and the Class B sensors, wherein the horizontal standard values ​​include the positive neighbor standard value, the positive neighbor buffer value, the positive standard mean value, the positive standard buffer value, the reverse neighbor standard value, the reverse neighbor buffer value, the reverse standard mean value, and the reverse standard buffer value; The horizontally placed optical encoder is tilted, and the tilt standard values ​​of the class A sensor and the class B sensor are obtained based on the horizontal standard analysis method; the horizontal standard value and the tilt standard value are analyzed, and a positive tilt standard ratio and a reverse tilt standard ratio are obtained based on the analysis results; When the optical encoder is calibrated for accuracy, the signals of the class A sensor and the class B sensor are acquired in real time, and the acquired signals are analyzed based on the horizontal standard analysis method, and the optical encoder is calibrated based on the analysis results, the positive tilt standard ratio, and the reverse tilt standard ratio; The horizontal standard analysis method is used to obtain the horizontal standard values ​​of Class A sensors and Class B sensors, including: Place the optical encoder horizontally and place the Class A sensor and Class B sensor at the signal receiving position under standard conditions, where the standard conditions are free from external influences and accurate in accuracy; Start the light source and use the horizontal standard analysis method for analysis; the horizontal standard analysis method includes the forward standard analysis method and the reverse standard analysis method; The forward standard analysis method includes: establishing a plane rectangular coordinate system, recorded as the forward analysis coordinate system, wherein the unit of the X-axis of the forward analysis coordinate system is time, and the unit of the Y-axis is signal strength; rotating the code disk clockwise, and drawing corresponding curves in the forward analysis coordinate system based on the signal strengths received by the A-level sensor and the B-level sensor, recorded as forward curve A and forward curve B respectively; The highest point and the lowest point in the forward curve A are recorded as the peak point FDA and the valley point GDA respectively; the highest point and the lowest point in the forward curve B are recorded as the peak point FDB and the valley point GDB respectively; for any peak point FDA, the two peak points GDB closest to the peak point FDA are recorded as the adjacent peak point LF1 and the adjacent peak point LF2 respectively, and the two valley points GDB closest to the peak point FDA are recorded as the adjacent valley point LG1 and the adjacent valley point LG2 respectively, wherein the adjacent peak point LF1 and the adjacent valley point LG1 are on the same side compared to the peak point FDA, and the adjacent peak point LF2 and the adjacent valley point LG2 are on the same side compared to the peak point FDA; The angle formed by the lines connecting the peak point FDA with the adjacent peak point LF1 and the adjacent valley point LG1 is recorded as the adjacent angle LJ1; the angle formed by the lines connecting the peak point FDA with the adjacent peak point LF2 and the adjacent valley point LG2 is recorded as the adjacent angle LJ2; the adjacent angle algorithm is used to obtain the adjacent eigenvalues ​​of the peak point FDA, and the adjacent angle algorithm is: , where T is the neighboring eigenvalue, J1 is the value corresponding to the angle of the neighboring angle LJ1, J2 is the value corresponding to the angle of the neighboring angle LJ2, L1 is the distance between the neighboring peak point LF1 and the peak point FDA, L2 is the distance between the neighboring peak point LF2 and the peak point FDA, and L0 is the distance between the peak point FDA and the valley point GDA closest to the peak point FDA; Obtain the neighboring characteristic values ​​of all peak FDAs, and record the average value of all neighboring characteristic values ​​as the neighboring standard value; record the maximum value of the difference between all neighboring characteristic values ​​and the neighboring standard value as the neighboring buffer value; Positive standard analysis also includes: For any peak point FDB, the two valley points GDA closest to the peak point FDB are recorded as the lower valley point XG1 and the lower valley point XG2 respectively, and the intensity mean algorithm is used to obtain the intensity mean corresponding to the peak point FDB. The intensity mean algorithm is: , where G is the intensity mean, g0 is the ordinate of the peak point FDB, g1 is the ordinate of the lower valley point XG1, and g2 is the ordinate of the lower valley point XG2; Obtain the intensity mean values ​​corresponding to all peak FDB points, and record the average value of all intensity means as the standard mean value; record the maximum value of the difference between all intensity means and the standard mean value as the standard buffer value; The neighbor standard value, neighbor buffer value, standard mean, and standard buffer value obtained in the forward standard analysis method are recorded as the positive neighbor standard value, positive neighbor buffer value, positive standard mean, and positive standard buffer value, respectively; Obtaining the tilt standard values ​​of the A-level sensor and the B-level sensor based on the horizontal standard analysis method; analyzing the horizontal standard value and the tilt standard value, and obtaining the positive tilt standard ratio and the reverse tilt standard ratio based on the analysis results include: The code disk in the horizontally placed optical encoder is tilted k degrees, and the horizontal standard analysis method is used for analysis. The neighbor standard value, neighbor buffer value, standard mean value and standard buffer value obtained during the analysis are recorded as the tilt standard value, where k is the maximum angle allowed for the code disk to tilt; In the forward standard analysis method after the code disk is tilted: the obtained neighbor standard value is recorded as the positive neighbor tilt value, and the obtained neighbor buffer value is recorded as the positive neighbor tilt buffer value; when the positive neighbor standard value is greater than or equal to the positive neighbor tilt value, the value of |(C1-c1)-(C2+c2)| is recorded as the tilt judgment value, where C1 is the positive neighbor standard value, c1 is the positive neighbor buffer value, C2 is the positive neighbor tilt value, and c2 is the positive neighbor tilt buffer value; when the positive neighbor standard value is less than the positive neighbor tilt value, the value of |(C2-c2)-(C1+c1)| is recorded as the tilt judgment value; The obtained standard mean is recorded as the positive slant mean, and the obtained standard buffer value is recorded as the positive slant buffer value; the value of |Z1-z1-Z2-z2| is recorded as the signal judgment value, wherein Z1 is the positive standard mean, Z2 is the positive slant mean, z1 is the positive standard buffer value, and z2 is the positive slant buffer value; The value of dividing the tilt judgment value by the positive signal judgment value is recorded as the positive tilt standard ratio; The acquired signal is analyzed based on the horizontal standard analysis method, and the optical encoder is calibrated based on the analysis result, the positive tilt standard ratio and the reverse tilt standard ratio, including: When the optical encoder is calibrated for accuracy, the rotation direction of the code disk at this time is recorded as the real-time rotation direction, the signals of the A-level sensor and the B-level sensor are obtained in real time, and the standard analysis method in which the rotation direction of the code disk is the same as the real-time rotation direction is used for analysis, wherein the standard analysis method includes a forward standard analysis method and a reverse standard analysis method; The neighbor standard value, neighbor buffer value, standard mean value and standard buffer value obtained through analysis are recorded as the real-time standard value, real-time neighbor buffer value, real-time mean value and real-time standard buffer value respectively; based on the method for obtaining the tilt judgment value and the tilt signal value in the standard analysis method after the code disk is tilted, the real-time standard value, the real-time neighbor buffer value, the real-time mean value and the tilt judgment value and the tilt signal value corresponding to the horizontal standard value are obtained, and are recorded as the real-time tilt judgment value and the real-time tilt signal value respectively; When the real-time rotation direction is clockwise and the ratio of the real-time tilt judgment value to the real-time tilt signal value is equal to the positive tilt standard ratio, there is no need to calibrate the optical encoder; When the real-time rotation direction is counterclockwise and the ratio of the real-time tilt judgment value to the real-time tilt signal value is equal to the counter-tilt standard ratio, there is no need to calibrate the optical encoder; When the ratio of the real-time tilt judgment value and the real-time tilt signal value is not equal to the positive tilt standard ratio, when the real-time tilt judgment value is greater than the tilt judgment value, reset the tilt angle of the code disk; when the real-time tilt signal value is greater than the tilt signal value, reset the brightness of the light source and the tilt angle of the code disk; when the real-time tilt judgment value is less than or equal to the tilt judgment value and the real-time tilt signal value is less than or equal to the tilt signal value, no processing is required, wherein the tilt judgment value and the tilt signal value are the tilt judgment value and the tilt signal value obtained when the code disk is tilted k degrees in the standard analysis method corresponding to the real-time tilt judgment value and the real-time tilt signal value.

2. The method for calibrating the accuracy of an optical encoder according to claim 1, characterized in that: The reverse standard analysis method is: after rotating the code disk in the forward standard analysis method counterclockwise, execute the subsequent steps in the forward standard analysis method, and record the obtained neighbor standard value, neighbor buffer value, standard mean and standard buffer value as the reverse neighbor standard value, reverse neighbor buffer value, reverse standard mean and reverse standard buffer value respectively.

3. The method for calibrating the accuracy of an optical encoder according to claim 2, characterized in that: Analyzing the horizontal standard value and the tilt standard value, and obtaining the positive tilt standard ratio and the reverse tilt standard ratio based on the analysis results also includes: In the reverse standard analysis method after the code disk is tilted: the obtained neighbor standard value is recorded as the reverse neighbor tilt value, and the obtained neighbor buffer value is recorded as the reverse neighbor tilt buffer value; when the reverse neighbor standard value is greater than or equal to the reverse neighbor tilt value, the value of |(D1-d1)-(D2+d2)| is recorded as the tilt judgment value, where D1 is the reverse neighbor standard value, d1 is the reverse neighbor buffer value, D2 is the reverse neighbor tilt value, and d2 is the reverse neighbor tilt buffer value; when the reverse neighbor standard value is less than the reverse neighbor tilt value, the value of |(D2-d2)-(D1+d1)| is recorded as the tilt judgment value; The obtained standard mean is recorded as the inverse oblique mean, and the obtained standard buffer value is recorded as the inverse oblique buffer value; the value of |X1-x1-X2-x2| is recorded as the signal judgment value, wherein X1 is the inverse standard mean, X2 is the inverse oblique mean, x1 is the inverse standard buffer value, and x2 is the inverse oblique buffer value; The value obtained by dividing the tilt judgment value by the inverse signal judgment value is recorded as the inverse tilt standard ratio.

4. An optical encoder precision calibration system, used to implement the optical encoder precision calibration method according to any one of claims 1 to 3, characterized in that: It includes a horizontal standard analysis module, a tilt standard analysis module and a real-time tilt calibration module; The horizontal standard analysis module is used to record the photoelectric sensors in the optical encoder as Class A sensors and Class B sensors respectively; the optical encoder is placed horizontally, and after the light source is started, the horizontal standard analysis method is used to obtain the horizontal standard values ​​of the Class A sensors and the Class B sensors, wherein the horizontal standard values ​​include the positive neighbor standard value, the positive neighbor buffer value, the positive standard mean value, the positive standard buffer value, the reverse neighbor standard value, the reverse neighbor buffer value, the reverse standard mean value, and the reverse standard buffer value; The tilt standard analysis module is used to tilt the horizontally placed optical encoder, and obtain the tilt standard values ​​of the A-level sensor and the B-level sensor based on the horizontal standard analysis method; analyze the horizontal standard value and the tilt standard value, and obtain the positive tilt standard ratio and the reverse tilt standard ratio based on the analysis results; The real-time tilt calibration module is used to obtain the signals of Class A sensors and Class B sensors in real time when calibrating the accuracy of the optical encoder, analyze the obtained signals based on the horizontal standard analysis method, and calibrate the optical encoder based on the analysis results, the positive tilt standard ratio and the reverse tilt standard ratio.

5. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores computer-readable instructions. When the computer-readable instructions are executed by the processor, the steps in the method according to any one of claims 1 to 3 are executed.

6. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 3 are performed.

Citation Information

Patent Citations

  • Calibration technology-based encoder precision improving method

    CN107843227A

  • Calibration device and method for PSD nonlinear error

    CN111238558A