Real-time compensation method for moiré fringe subdivision error
By using the uniformity error inspection data provided by code disk manufacturers, the DC component of the moiré stripes in the photoelectric encoder is identified and compensated in real time, and the problem of error compensation in the prior art is solved, real-time segmentation error compensation is achieved, and development costs are reduced.
Patent Information
- Application Number
- CN202211542235.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-03
- Publication Date
- 2025-05-13
- Estimated Expiration
- 2042-12-03
Smart Images

Figure CN115876241B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of photoelectric displacement precision measurement, and in particular to a real-time compensation method for moire fringe subdivision error. Background Art
[0002] The photoelectric encoder is an angle measuring device that integrates optics, mechanics, and electronics. The moiré fringe photoelectric encoder is widely used because of its stable and reliable operation and fast response speed. The core component of the photoelectric encoder, the code disk, has uniformity errors. This error is caused by reasons such as line width and uneven film layer during the manufacturing process. It is unavoidable and has individual differences. Specifically, the DC component of the generated moiré fringe has drift, which is a low-frequency noise. There are currently two main compensation methods: the first is to subdivide the moiré fringe and compensate it as a whole through the binary angle value, but the overall calculation requires a special precision inspection device; the second is to collect the moiré fringe to the PC and compensate it through the PC algorithm, but there are problems such as non-real-time and PC-dependent and complex compensation algorithms. Summary of the invention
[0003] In view of the above problems, the purpose of the present invention is to propose a real-time compensation method for moiré fringe subdivision error. The present invention does not change the original circuit design of the photoelectric encoder. Through the uniformity error provided by the code disk manufacturer, the quadrant subdivision values of the coarse code and the moiré fringes are used to identify the moiré fringes and the corresponding uniformity error, and the DC component is averaged and then the moiré fringes are subdivided. The inspection data provided by the code disk manufacturer is fully utilized, and the step of re-inspecting the photoelectric encoder using a special inspection device is omitted. At the same time, there is no need to add a PC and a complex subdivision algorithm, which is more real-time and economical.
[0004] To achieve the above object, the present invention adopts the following specific technical solutions:
[0005] The present invention provides a real-time compensation method for moire fringe subdivision error, which is implemented based on the following hardware: a light emitting diode, a code disk, a grating, a photoelectric receiving tube, an AD data acquisition circuit and a microprocessor;
[0006] The light beam emitted by the light emitting diode passes through the code disk and the grating in turn, and the photoelectric receiving diode converts the coarse code signal, fine code signal and moiré fringes into electrical signals, and then enters the microprocessor through the AD data acquisition circuit; and completes the subdivision error compensation, decoding and sending of the moiré fringes according to the communication protocol in the microprocessor;
[0007] The following steps are involved:
[0008] S1. Calculate the mean value of the DC component of each moiré fringe according to the uniformity error test result of the code disk, and make it into a ROM table;
[0009] S2, acquiring moire fringes including fine code signals and coarse code signals through an AD data acquisition circuit, and performing coarse code decoding processing on the coarse code signals to obtain coarse code decoding values of the code disk;
[0010] S3, determining the moiré fringes of a single cycle according to the coarse code decoding value of the code disk, and subdividing the moiré fringes in the single cycle into quadrants;
[0011] S4, determine the quadrant corresponding to the precision code signal, and search the corresponding DC component mean value in the ROM table according to the quadrant;
[0012] S5, performing subdivision operation on the precise code signal according to the DC component mean value to obtain a precise code subdivision value;
[0013] S6. Perform fine-coarse correction and connection processing on the fine code subdivision value and the coarse code decoding value to obtain a binary angle value after subdivision error compensation.
[0014] Preferably, the process further includes a preprocessing step S0, and a uniformity error test result acquisition process of the code disc is as follows:
[0015] Firstly, the moiré fringes are measured, and then the low-frequency drift of the DC component in the moiré fringes is extracted using wavelet analysis, EMD and non-uniform sampling algorithms to obtain the uniformity error test result of the code disk.
[0016] Preferably, step S1 comprises:
[0017] The formula for moiré fringes is:
[0018] y=sin(θ)+A (1)
[0019] Where y is the moiré fringe, and A is the DC component;
[0020] The moiré fringe subdivision formula obtained from the above formula is:
[0021]
[0022] in:
[0023] sin(θ)+A is the sinusoidal component of the moiré fringe;
[0024] cos(θ)+A is the cosine component of the moiré fringe;
[0025] In this formula, the DC component A in the Moire fringe formula needs to be subtracted.
[0026] Preferably, the DC component averages V1 to V8 of the eight subdivided quadrants of the moiré fringes are calculated and used to replace the DC component A for subdivision operation;
[0027] The calculation method of the mean value of the DC component of the 8 subdivided quadrants is:
[0028] First, the single-cycle moiré fringes are divided into 8 quadrants according to the subdivision method. Different DC component values are collected in each quadrant and the average is calculated, and then the average DC component value of each quadrant is obtained. The calculation formula is:
[0029]
[0030] in,
[0031] n is a positive integer;
[0032] V (1,1) ,V (1,2) …V (1,n) 、V (2,1) ,V (2,2) …V (2,n) 、V (3,1) ,V (3,2) …V (3,n) 、V (4,1) ,V (4,2) …V (4,n) 、V (5,1) ,V (5,2) …V (5,n) 、V (6,1) ,V (6,2) …V (6,n) 、V (7,1) ,V (7,2) …V (7,n) 、V (8,1) ,V (8,2) …V (8,n) is the uniformity error of n code disks corresponding to the first to eighth quadrants respectively.
[0033] Preferably, the value of n ranges from 32 to 100.
[0034] Compared with the existing technology, the present invention makes full use of the code disc uniformity error inspection data provided by the code disc manufacturer, without changing the original circuit design, and uses microprocessors such as single-chip microcomputers (or ARM), DSP and FPGA to achieve real-time subdivision error compensation. This method can greatly reduce the workload, does not need to rely on PCs and special inspection equipment, and saves development costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1 4 is a hardware schematic diagram of a real-time compensation method for moire fringe subdivision error provided according to an embodiment of the present invention.
[0036] Figure 2 It is a flow chart of a method for real-time compensation of moire fringe subdivision error provided according to an embodiment of the present invention.
[0037] Figure 3It is a flowchart of a real-time compensation method for moire fringe subdivision error provided according to an embodiment of the present invention.
[0038] Figure 4 3 is a comparison diagram of moiré fringes according to a real-time compensation method for moiré fringe subdivision error provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0039] Hereinafter, embodiments of the present invention will be described with reference to the accompanying drawings. In the following description, the same modules are represented by the same reference numerals. In the case of the same reference numerals, their names and functions are also the same. Therefore, the detailed description thereof will not be repeated.
[0040] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and do not constitute a limitation of the present invention.
[0041] Figure 1 A hardware schematic diagram of a real-time compensation method for moire fringe subdivision error provided according to an embodiment of the present invention is shown.
[0042] like Figure 1 As shown, the hardware of the real-time compensation method for moire fringe subdivision error provided by the embodiment of the present invention includes: a light emitting diode, a code disk, a grating, a photoelectric receiving tube, an AD data acquisition circuit and a microprocessor.
[0043] The light beam emitted by the light emitting diode passes through the code disk and the grating in turn, and the coarse code signal and the fine code signal, namely the moiré fringes, are converted into electrical signals through the photoelectric receiving diode, and then directly enter the microprocessor through the AD data acquisition circuit.
[0044] The subdivision error compensation, decoding and sending of the moire fringe according to the communication protocol are completed in the microprocessor.
[0045] The decoding includes coarse code decoding, moiré fringe subdivision and fine and coarse correction connection. The moiré fringe subdivision adopts trigonometric function subdivision, namely, inverse tangent subdivision method or Cordic subdivision method.
[0046] Figure 2 A schematic flow chart of a method for real-time compensation of moire fringe subdivision error provided according to an embodiment of the present invention is shown.
[0047] Figure 3 A flowchart of a method for real-time compensation of moire fringe subdivision errors provided according to an embodiment of the present invention is shown.
[0048] like Figure 2-3 As shown, the real-time compensation method for moire fringe subdivision error provided by the embodiment of the present invention comprises the following steps:
[0049] S0. When the code disc manufacturer does not provide the uniformity error test results of the code disc, the process of obtaining the uniformity error test results of the code disc is as follows:
[0050] Firstly, the moiré fringes are measured, and then the low-frequency drift of the DC component in the moiré fringes is extracted using wavelet analysis, EMD and non-uniform sampling algorithms to obtain the uniformity error test result of the code disk.
[0051] The ROM table can also be stored in an external memory (such as EEPROM), and the processor can read the external memory data.
[0052] S1. First, the mean values of the eight DC components of each moiré fringe are calculated according to the uniformity error test results of the code disk, and a ROM table is prepared;
[0053] Step S1 includes:
[0054] The formula for moiré fringes is:
[0055] y=sin(θ)+A (1)
[0056] Among them, y is the moiré fringe, and A is the DC component. Therefore, calculating the accurate DC component is very necessary to reduce the subdivision error of the precise code signal.
[0057] Figure 4 A moire fringe comparison diagram of a moire fringe subdivision error real-time compensation method provided according to an embodiment of the present invention is shown.
[0058] like Figure 4 The figure shows a comparison of the moiré fringe signal with no DC component drift and the moiré fringe signal with DC component drift, as well as a diagram of the uniformity error of the code disc provided by the code disc manufacturer;
[0059] Depend on Figure 4 It can be seen that the DC component has an obvious offset. This offset is the uniformity error of the code disk and is a low-frequency noise. The DC component is an important parameter for calculating the subdivision of the Moire fringe. Therefore, the precise DC component is related to the subdivision error of the Moire fringe, which in turn affects the overall error of the photoelectric encoder.
[0060] The moiré fringe subdivision formula is:
[0061]
[0062] in:
[0063] sin(θ)+A is the sinusoidal component of the moiré fringe;
[0064] cos(θ)+A is the cosine component of the moiré fringe.
[0065] In this formula, the DC component A in the Moire fringe formula needs to be subtracted. The DC component is generally a fixed value, but in reality the value may drift due to uniformity error. The present invention calculates the average DC component V1 to V8 of the eight subdivided quadrants of the Moire fringe and uses this as the DC component A in the above formula to calculate the subdivisions.
[0066] The calculation method of the average DC component of the 8 subdivided quadrants is to first divide the single-cycle moiré fringes into 8 quadrants according to the subdivision method, collect a number of DC component values provided by the encoder manufacturer in each quadrant, the more the better, calculate the average of these values, and get the average DC component of each quadrant. The calculation formula is as follows:
[0067]
[0068] in,
[0069] n is a positive integer, and the optimal value range is 32 to 100;
[0070] V (1,1) ,V (1,2) …V (1,n) 、V (2,1) ,V (2,2) …V (2,n) 、V (3,1) ,V (3,2) …V (3,n) 、V (4,1) ,V (4,2) …V (4,n) 、V (5,1) ,V (5,2) …V (5,n) 、V (6,1) ,V (6,2) …V (6,n) 、V (7,1) ,V (7,2) …V (7,n) 、V (8,1) ,V (8,2) …V (8,n) is the uniformity error of n code disks corresponding to the first to eighth quadrants respectively.
[0071] S2. The moiré fringes are collected by an AD data collection circuit to obtain moiré fringes including a fine code signal and a coarse code signal, and the coarse code signal is subjected to coarse code decoding processing to obtain a coarse code decoding value of the code disk.
[0072] S3. Determine the moiré fringes of a single cycle according to the coarse code decoding value of the code disk, and subdivide the moiré fringes in the single cycle into quadrants.
[0073] S4. Determine the quadrant corresponding to the precise code signal, and search the corresponding DC component mean value in the ROM table according to the quadrant.
[0074] S5. Perform subdivision operation on the precise code signal according to the DC component mean value to obtain a precise code subdivision value.
[0075] S6. Perform fine-coarse correction and connection processing on the fine code subdivision value and the coarse code decoding value to obtain a binary angle value after subdivision error compensation.
[0076] Although the embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present invention. A person skilled in the art may change, modify, replace and vary the above embodiments within the scope of the present invention.
[0077] The above specific implementations of the present invention do not constitute a limitation on the protection scope of the present invention. Any other corresponding changes and modifications made based on the technical concept of the present invention should be included in the protection scope of the claims of the present invention.
Claims
1. A real-time compensation method for moiré fringe subdivision error is implemented based on the following hardware: light emitting diode, code disk, grating, photoelectric receiving tube, AD data acquisition circuit and microprocessor; The light beam emitted by the light emitting diode passes through the code disk and the grating in sequence, and is converted into an electrical signal including a coarse code signal, a fine code signal and a moiré fringe by the photoelectric receiving tube, and then enters the microprocessor through the AD data acquisition circuit; and the subdivision error compensation, decoding and sending of the moiré fringe according to the communication protocol are completed in the microprocessor; It is characterized in that The following steps are involved: S1. Calculate the mean value of the DC component of each moiré fringe according to the uniformity error test result of the code disk, and make it into a ROM table; S2, acquiring moire fringes including a fine code signal and a coarse code signal through the AD data acquisition circuit, and performing coarse code decoding processing on the coarse code signal to obtain a coarse code decoding value of the code disk; S3, determining the moiré fringes of a single cycle according to the coarse code decoding value of the code disk, and subdividing the moiré fringes in the single cycle into quadrants; S4, determining the quadrant corresponding to the precise code signal, and searching the corresponding DC component mean value in the ROM table according to the quadrant; S5, performing subdivision operation on the precise code signal according to the DC component mean value to obtain a precise code subdivision value; S6, performing fine and coarse correction connection processing on the fine code subdivision value and the coarse code decoding value to obtain a binary angle value after subdivision error compensation.
2. The real-time compensation method for moire fringe subdivision error according to claim 1, characterized in that: The process of obtaining the uniformity error test result of the code disc also includes a preprocessing step S0 as follows: First, the moire fringes are measured, and then the low-frequency drift of the DC component in the moire fringes is extracted using processing algorithms such as wavelet analysis, EMD and non-uniform sampling to obtain the uniformity error test result of the code disk.
3. The real-time compensation method for moire fringe subdivision error according to claim 2, characterized in that: The step S1 comprises: The formula for moiré fringes is: (1) Where y is the moiré fringe, and A is the DC component; The moiré fringe subdivision formula obtained from the above formula is: (2) in: is the sinusoidal component of the moiré fringe; is the cosine component of the moiré fringe; In this formula, the DC component in the moiré fringe formula needs to be subtracted .
4. The real-time compensation method for moire fringe subdivision error according to claim 3, characterized in that: By calculating the mean value of the DC component of the eight subdivided quadrants of the moiré fringe , use this to replace the DC component Perform subdivision operations; The calculation method of the DC component mean value of the 8 subdivided quadrants is: First, the single-period moiré fringe is divided into 8 quadrants according to the subdivision method, and different DC component values are collected in each quadrant and the average is calculated, so as to obtain the average DC component of each quadrant. The calculation formula is: (3) in, is a positive integer; , , , , , , , The first to eighth quadrants correspond to The uniformity error of the code disk.
5. The real-time compensation method for moire fringe subdivision error according to claim 4, characterized in that: The value range is 32~100.
Citation Information
Patent Citations
Sealed type optical grid line displacement sensor
CN1086011A
Method for error compensation of phase-shifting projectionmoire system
KR1020010002383A