A linear absolute position measurement method and device based on a single code channel coding structure

By using linear CMOS array and fast Fourier transform technology, high transmittance and anti-fouling properties of the single-channel coding structure are achieved, solving the problems of position measurement error and excessive size of the single-channel absolute optical system in polluted environments, and providing a fast and accurate position measurement method.

CN122192165APending Publication Date: 2026-06-12ZHEJIANG REAGLE SENSING TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
ZHEJIANG REAGLE SENSING TECH CO LTD
Filing Date
2026-05-13
Publication Date
2026-06-12

AI Technical Summary

Technical Problem

Single-track absolute optical systems are susceptible to contaminants such as dust and oil in polluted environments, resulting in large position measurement errors and large system size, making it difficult to meet the requirements of long life and miniaturization of industrial equipment.

Method used

A linear CMOS array is used to acquire the grayscale image of the code track. The first position is determined by fast Fourier transform and binarization. The current absolute position is obtained quickly and accurately during product operation. The grayscale image of the code track and the previous actual position are used for subdivision position calibration to improve anti-contamination performance and position measurement accuracy.

🎯Benefits of technology

Under the premise of wide spectrum, high transmittance and compact structure, long-term anti-fouling and accurate positioning of single-channel coding structure are achieved, solving problems such as coding signal interference, poor anti-fouling durability and excessive system size, and ensuring fast and accurate position measurement.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122192165A_ABST
    Figure CN122192165A_ABST
Patent Text Reader

Abstract

The application relates to the technical field of optical measurement, in particular to a linear absolute position measurement method and device based on a single code channel coding structure. The method comprises the following steps: when a product is powered on, a code channel gray scale image is acquired based on a linear array CMOS, a code channel binary image is acquired based on the code channel gray scale image, and a first position is determined based on the code channel binary image; wherein the first position is determined based on the code channel binary image specifically comprises the following steps: a second code channel area is determined; when there is an uncontaminated second code channel area, the first position is determined based on the uncontaminated second code channel area; and when there is no uncontaminated second code channel area, the first position is determined based on a unified strategy of all second code channels. The method can accurately acquire the first position only when a small number of second code channel areas are not contaminated, greatly improves the contamination resistance, and can quickly and accurately acquire a current actual position during product operation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of optical measurement technology, and specifically to a method and apparatus for measuring the absolute position of a straight line based on a single-track coding structure. Background Technology

[0002] In fields such as precision manufacturing, aerospace attitude control, and semiconductor wafer positioning, the demand for "reference-free rapid start-up" and "zero cumulative error" in position measurement is becoming increasingly urgent. Single-track absolute optical systems have become a key technology choice due to their core advantages. This system directly outputs absolute position information through an absolute coding pattern (such as Gray code or pseudo-random code) on a single track, without relying on an initial reference point and count accumulation as incremental systems. It also features a simplified structure, no yaw error, and relaxed installation tolerances.

[0003] However, the "absolute coding imaging dependency" and "optical path openness" of single-track absolute optical systems make them more susceptible to contamination interference problems. The position recognition of absolute systems relies entirely on the accurate imaging of each segment of the coded pattern on the code track. If contaminants such as dust, oil stains, and metal debris adhere to the grating coding area or optical window, it will not only lead to decreased optical transmittance and blurred imaging, but will also directly destroy the integrity of the local absolute coding. For example, 0.5μm-level dust covering the coded stripes in an industrial workshop may cause misreading of a certain segment of the signal, resulting in the system outputting incorrect absolute position data; oil accumulation on outdoor wind power equipment will cause a decrease in the contrast of the coded pattern, leading to a "startup failure" problem where the system cannot recognize the initial absolute position after power-on. Compared to multi-channel absolute systems, single-channel structures lack a redundant coding verification mechanism. Even slight contamination can cause position measurement failure. In special scenarios such as around semiconductor cleanrooms, even a thin film formed by the condensation of trace amounts of volatile organic compounds can interfere with the photoelectric conversion of the coded signal, causing the positioning accuracy to degrade from ±20nm to over ±100nm. This severely restricts the reliable application of the system in harsh or highly clean environments.

[0004] Existing technologies primarily address the aforementioned problems through three main approaches: first, applying an anti-fouling coating to the surface of optical components; second, optimizing the system's sealing and protective structure; and third, employing absolute coding signal compensation algorithms. However, the first approach suffers from several drawbacks. The micro / nano structure of the coating is prone to optical interference with the fine coding pattern (stripe width often <10μm) of a single-track absolute system, leading to crosstalk in the coded signal. Furthermore, the durability of the liquid-like super-lubricating film is less than 3000 hours under high-speed (e.g., 100m / s) friction from the reading head, failing to meet the long-life requirements of industrial equipment. The second approach requires the absolute system's reading head to cover a larger coding area to obtain complete coding information, resulting in a sealing structure volume increase of over 40% compared to incremental systems. This not only increases costs but also limits its application in miniaturized devices (e.g., micro-robot joints), and frequent seal maintenance disrupts production processes. Finally, existing technologies lack a dedicated compensation model for the logical characteristics of single-track absolute coding (e.g., the correlation between adjacent codes), making it impossible to avoid absolute position misjudgments under heavy contamination or sudden contaminant coverage (e.g., falling metal debris).

[0005] Therefore, developing a protection technology for a single-channel absolute optical system that balances wide-spectrum high transmittance, absolute coding imaging compatibility, long-term anti-fouling properties, and compact structure, and solving problems such as coding signal interference, poor anti-fouling durability, and excessive system size in existing solutions, has become a key requirement for breaking through the application bottleneck in this field. Summary of the Invention

[0006] The purpose of this invention is to provide a method and device for measuring the absolute position of a straight line based on a single-channel coding structure. The linear CMOS array can acquire a grayscale image of the channel and determine the first position through the grayscale image. Moreover, as long as a small number of second channel areas are not contaminated, the first position can be accurately obtained, which greatly improves the anti-contamination performance. After accurately obtaining the first position, the current actual position can be quickly and accurately obtained during product operation.

[0007] In a first aspect of the present invention, a method for measuring the absolute position of a straight line based on a single-track coding structure is provided, comprising:

[0008] When the product is powered on, a grayscale image of the code channel is acquired based on the linear CMOS, a binary image of the code channel is acquired based on the grayscale image of the code channel, and the first position is determined based on the binary image of the code channel.

[0009] Specifically, determining the first position based on the code channel binarized image includes:

[0010] Determine the second code channel area; when an uncontaminated second code channel area exists, determine the first position based on the uncontaminated second code channel area; when no uncontaminated second code channel area exists, determine the first position based on the overall strategy of all second code channels.

[0011] As a preferred embodiment of the present invention, obtaining a code channel binarized image based on a code channel grayscale image specifically includes:

[0012] The code channel grayscale image is converted into a spectrum image based on the fast Fourier transform, the target frequency is calculated, and the initial amplitude corresponding to the target frequency is found based on the spectrum image.

[0013] The negative and positive thresholds are determined based on the initial amplitude.

[0014] The gray value sequence of the code channel grayscale image is differentiated to obtain the gray value difference sequence, and the continuously increasing gray value difference subsequence is determined based on the threshold of the number of consecutively increasing values.

[0015] Select continuously increasing gray-scale difference subsequences whose minimum gray-scale difference is less than the negative threshold and whose maximum gray-scale difference is greater than the positive threshold as continuously increasing gray-scale difference intervals;

[0016] The partitioning position of the continuously increasing gray-level difference interval is determined based on the zero-crossing position of the continuously increasing gray-level difference interval, and the gray-level value sequence of the code channel gray-level image is divided into multiple gray-level value intervals based on the partitioning position.

[0017] Binarize the gray values ​​in each gray value range to obtain a code channel binarized image.

[0018] As a preferred embodiment of the present invention, calculating the target frequency specifically includes:

[0019] The product value is obtained by multiplying the code track grating pitch by the linear CMOS imaging magnification ratio;

[0020] Divide the product value by the pixel size to obtain the target frequency.

[0021] As a preferred embodiment of the present invention, binarizing the gray values ​​in each gray value range specifically includes:

[0022] Obtain the maximum and minimum gray values ​​within a certain gray value range, and calculate the average gray value based on the maximum and minimum gray values;

[0023] Pixels with gray values ​​greater than or equal to the average gray value in the corresponding gray value range are set as the first pixel value, and pixels with gray values ​​less than the average gray value in the corresponding gray value range are set as the second pixel value.

[0024] As a preferred embodiment of the present invention, determining the second code channel region specifically includes:

[0025] The first code track region is determined based on the binarized image of the entire code track, and the first code track region includes M consecutive scribing lines;

[0026] Multiple second code zones are defined within the first code zone, and each second code zone includes N consecutive etch lines;

[0027] When an uncontaminated second code channel region exists, determining the first position based on the uncontaminated second code channel region specifically includes:

[0028] The uncontaminated second code channel area is used to determine the absolute position of the corresponding second code channel area on the entire code channel through its N etch lines; based on the absolute position of the second code channel area on the entire code channel, the center point position of the first code channel area is determined, and the center point position is determined as the first position;

[0029] When there is no uncontaminated second code channel area, the first position is determined based on the overall strategy of all second code channels, specifically including:

[0030] The contaminated second code channel area is used to determine the possible positions of multiple second code channel areas on the entire code channel through its fewer than N scribe lines; based on the possible positions of the second code channel areas on the entire code channel, the possible center point position of the first code channel area is determined, and one possible position is determined to obtain a corresponding possible center point position; the possible center point position that appears most frequently and whose frequency is greater than the frequency threshold is determined as the first position.

[0031] As a preferred embodiment of the present invention, it further includes:

[0032] During product operation, the current code channel grayscale image is acquired based on the linear CMOS, the current code channel binarized image is acquired based on the current code channel grayscale image, and the current absolute position is determined based on the previous actual position and the current code channel binarized image; wherein, when the current absolute position is determined for the first time, the previous actual position is the first position;

[0033] During product operation, the current sub-position is obtained based on the current code track grayscale image, and the current actual position is obtained based on the current absolute position and the current sub-position.

[0034] As a preferred embodiment of the present invention, determining the current absolute position based on the previous actual position and the current code channel binarized image specifically includes:

[0035] Determine the current location range based on the previous actual location;

[0036] Based on the current code track binarized image, obtain L scribe lines, and based on the L scribe lines, obtain several possible current positions;

[0037] The current absolute position is determined based on the current position range and several possible current positions.

[0038] As a preferred embodiment of the present invention, obtaining the current subdivision position based on the current code channel grayscale image specifically includes:

[0039] Perform a fast Fourier transform on the current code track grayscale image to obtain the frequency components corresponding to the code track scribe lines, obtain the phase based on the frequency components, and obtain the initial subdivision position based on the phase.

[0040] The grayscale values ​​within a preset range are obtained with the initial subdivision position as the center. A weighted average value is calculated based on the obtained grayscale values, and the current subdivision position is obtained based on the weighted average value.

[0041] In a second aspect of the present invention, a linear absolute position measuring device based on a single-track coding structure is provided, comprising:

[0042] The first position determination module is configured to acquire a code channel grayscale image based on a linear CMOS array, acquire a code channel binarized image based on the code channel grayscale image, and determine the first position based on the code channel binarized image when the product is powered on.

[0043] Specifically, determining the first position based on the code channel binarized image includes:

[0044] Determine the second code channel area; when an uncontaminated second code channel area exists, determine the first position based on the uncontaminated second code channel area; when no uncontaminated second code channel area exists, determine the first position based on the overall strategy of all second code channels.

[0045] In a third aspect of the present invention, an electronic device is provided, including one or more processors and a memory associated with the one or more processors, the memory being used to store program instructions that, when read and executed by the one or more processors, perform the method provided in the first aspect.

[0046] In summary, the present invention has the following beneficial effects:

[0047] The method of this invention can obtain an accurate first position through the code track grayscale image when the product is powered on. During product operation, it can quickly and accurately obtain the current absolute position through the current code track grayscale image and the previous actual position (the previous actual position is the first position when the current absolute position is determined for the first time). It can also obtain the current subdivision position through the current code track grayscale image. The accurate current actual position can be obtained through the current absolute position and the current subdivision position. That is, the method of this invention can quickly and accurately obtain the current actual position during product operation. Finally, it can solve the problems of coding signal interference, poor anti-fouling durability, and excessive system size in the existing solution while taking into account wide spectrum high transmittance, absolute coding imaging compatibility, long-term anti-fouling performance and compact structure.

[0048] Further or more detailed beneficial effects will be described in conjunction with specific embodiments in the detailed implementation. Attached Figure Description

[0049] Figure 1 A flowchart of a linear absolute position measurement method based on a single-track coding structure according to an embodiment of the present invention is shown;

[0050] Figure 2 A block diagram of a linear absolute position measuring device based on a single-track coding structure according to an embodiment of the present invention is shown.

[0051] Figure 3 A block diagram of an electronic device according to an embodiment of the present invention is shown. Detailed Implementation

[0052] Embodiments of the present invention will now be described in more detail with reference to the accompanying drawings. While some embodiments of the invention are shown in the drawings, it should be understood that the invention can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of the invention. It should be understood that the accompanying drawings and embodiments are for illustrative purposes only and are not intended to limit the scope of protection of the invention.

[0053] In the description of embodiments of the present invention, the term "comprising" and similar terms should be understood as open-ended inclusion, i.e., "including but not limited to". The term "based on" should be understood as "at least partially based on". The term "one embodiment" or "the embodiment" should be understood as "at least one embodiment". The terms "first", "second", etc., may refer to different or the same objects. Other explicit and implicit definitions may also be included below.

[0054] Figure 1 A flowchart of a straight line absolute position measurement method 100 based on a single-track coding structure according to an embodiment of the present invention is shown. The method 100 includes:

[0055] Step 102. When the product is powered on, acquire a grayscale image of the code channel based on the linear CMOS array, acquire a binary image of the code channel based on the grayscale image of the code channel, and determine the first position based on the binary image of the code channel.

[0056] In this embodiment, powering on the product can be done either when the product is first used or when the product is powered on again after being powered off.

[0057] In this embodiment, the linear CMOS is an image sensor used to acquire a grayscale image of a code track. This embodiment can be understood as the linear CMOS acquiring a grayscale image of a code track with only one row of pixels (in practical applications, it can also acquire a grayscale image of a code track with multiple rows of pixels). That is, when the product is powered on, the linear CMOS can acquire a grayscale image of a code track with only one row of pixels.

[0058] In this embodiment, obtaining the code channel binarized image based on the code channel grayscale image specifically includes:

[0059] Step 410. Convert the code channel grayscale image into a spectrum image based on the Fast Fourier Transform, calculate the target frequency, and find the initial amplitude corresponding to the target frequency based on the spectrum image.

[0060] Assuming a row of a grayscale image contains 100 pixels, performing a Fast Fourier Transform (FFT) on it will yield 100 frequency points. Each frequency point corresponds to a set of complex numbers, and taking the modulus of each set of complex numbers gives the amplitude of each frequency point.

[0061] In this embodiment, calculating the target frequency specifically includes:

[0062] Step 411. Multiply the code track grating pitch by the linear CMOS imaging magnification ratio to obtain the product value. Assuming the code track grating pitch is 20kJ and the linear CMOS imaging magnification ratio is 1:1, then the product value is 20kJ.

[0063] Step 412. Divide the product by the pixel size to obtain the target frequency. Assuming the pixel size is 5k, the target frequency is 4. At this point, the amplitude at frequency point 4 is the initial amplitude.

[0064] Step 420. Determine the negative and positive thresholds based on the initial amplitude. The positive threshold is equal to the initial amplitude multiplied by the scaling factor K, and the negative threshold is equal to the initial amplitude multiplied by the scaling factor - K. In this embodiment, K is an empirical constant, for example, 0.2. The larger the initial amplitude, the clearer the black and white contrast, and the larger the determined positive threshold and the smaller the negative threshold; the smaller the initial amplitude, the lower the black and white contrast, and the smaller the determined positive threshold and the larger the negative threshold.

[0065] Step 430. Take the derivative of the gray value sequence of the code channel grayscale image to obtain the gray value difference sequence, and determine the continuously increasing gray value difference subsequence based on the threshold of the number of continuously increasing values.

[0066] Assuming a row of a grayscale image contains 100 pixels, the grayscale value sequence contains 100 grayscale values. Taking the derivative of these 100 grayscale values ​​will yield 99 grayscale difference values ​​(i.e., the grayscale difference value sequence).

[0067] Taking a black scale as an example, assuming it comprises 5 pixel values, theoretically the grayscale values ​​of the black scale and its surrounding pixels would be: 4000 (white), 4000 (white), 1500 (black), 1500 (black), 1500 (black), 1500 (black), 1500 (black), 4000 (white), 4000 (white). However, in reality, the transitions from "white" to "black" and from "black" to "white" are gradual, with larger changes at the edges and smaller changes in the middle. For example, the actual grayscale values ​​of the black scale and its surrounding pixels would be: 4000 (white), 3000 (white), 2200 (black), 1700 (black), 1500 (black), 1700 (black), 2200 (black), 3000 (white), 4000 (white). The resulting grayscale difference sequence after taking its derivative (i.e., calculating the difference between two adjacent grayscale values ​​by subtracting the preceding grayscale value from the subsequent grayscale value) is: -1000, -800, -500, -200, 200, 500, 800, 1000. The grayscale differences in this sequence increase continuously. In this embodiment, the threshold for the number of consecutive increases can be the number of pixels included in the black scale minus one. For example, when the number of pixels included in the black scale is 5, the threshold for the number of consecutive increases is 4. This embodiment will find a subsequence of consecutively increasing grayscale differences from the grayscale difference sequence whose number of consecutive increases is greater than the threshold for the number of consecutive increases.

[0068] Assume the complete grayscale difference sequence is: -1000, -800, -500, -200, 200, 500, 800, 1000, 100, 100, 100, -200, 200, 500, 800, 1000. Then the first continuously increasing grayscale difference subsequence is: -1000, -800, -500, -200, 200, 500, 800, 1000 (corresponding to indices 1-8), and the second continuously increasing grayscale difference subsequence is: -200, 200, 500, 800, 1000 (corresponding to indices 13-17).

[0069] Step 440. Select the continuously increasing gray-level difference subsequences whose minimum gray-level difference is less than the negative threshold and whose maximum gray-level difference is greater than the positive threshold as the continuously increasing gray-level difference interval.

[0070] This embodiment assumes that the negative threshold determined in step 420 is -600 and the positive threshold is 600.

[0071] For the first continuously increasing grayscale difference subsequence: -1000, -800, -500, -200, 200, 500, 800, 1000 (corresponding to indices 1-8), since the minimum grayscale difference "-1000" is less than the negative threshold "-600" and the maximum grayscale difference "1000" is greater than the positive threshold "600", this continuously increasing grayscale difference subsequence is taken as the continuously increasing grayscale difference interval.

[0072] For the second continuously increasing grayscale difference subsequence: -200, 200, 500, 800, 1000 (corresponding to indices 13-17), since the minimum grayscale difference "-200" is not less than the negative threshold "-600", this continuously increasing grayscale difference subsequence is not considered as a continuously increasing grayscale difference interval.

[0073] Step 450. Determine the partitioning position of the continuously increasing gray-level difference interval based on the zero-crossing position of the continuously increasing gray-level difference interval, and divide the gray-level value sequence of the code channel gray-level image into multiple gray-level value intervals based on the partitioning position.

[0074] This embodiment assumes the grayscale value sequence of the code channel grayscale image is: 4000, 3000, 2200, 1700, 1500, 1700, 2200, 3000, 4000, 3000, 2200, 1700, 1500, 1700, 2200, 3000, 4000. Its grayscale difference sequence is: -1000, -800, -500, -200, 200, 500, 800, 1000, -1000, -800, -500, -200, 200, 500, 800, 1000. The first continuously increasing grayscale difference subsequence is: -1000, -800, -500, -200, 200, 500, 800, 1000 (corresponding to indices 1-8), and the second continuously increasing grayscale difference subsequence is: -1000, -800, -500, -200, 200, 500, 800, 1000 (corresponding to indices 9-16). Since the minimum grayscale difference "-1000" in the first continuously increasing grayscale difference subsequence is less than the negative threshold "-600" and the maximum grayscale difference "1000" is greater than the positive threshold "600", the first continuously increasing grayscale difference subsequence is taken as the first continuously increasing grayscale difference interval (corresponding to indices 1-8). Since the minimum gray-scale difference "-1000" in the second continuously increasing gray-scale difference subsequence is less than the negative threshold "-600" and the maximum gray-scale difference "1000" is greater than the positive threshold "600", the second continuously increasing gray-scale difference subsequence is taken as the second continuously increasing gray-scale difference interval (corresponding to index 9-16).

[0075] For the first continuously increasing grayscale difference interval, its zero-crossing point is between index 4 and 5, so in this embodiment, the first partition position is set between index 4 and 5; for the second continuously increasing grayscale difference interval, its zero-crossing point is between index 12 and 13, so in this embodiment, the second partition position is set between index 12 and 13.

[0076] The gray value sequence of the code channel grayscale image is partitioned based on the first and second partition positions to obtain the following gray value intervals: "4000, 3000, 2200, 1700", "1500, 1700, 2200, 3000, 4000, 3000, 2200, 1700", and "1500, 1700, 2200, 3000, 4000".

[0077] Step 460. Binarize the gray values ​​in each gray value range to obtain a code channel binarized image.

[0078] In this embodiment, the binarization process for the gray values ​​in each gray value range specifically includes:

[0079] Step 461. Obtain the maximum and minimum gray values ​​in a certain gray value range, and calculate the average gray value based on the maximum and minimum gray values.

[0080] The first grayscale value range is 4000, 3000, 2200, and 1700. Its average grayscale value is 2850.

[0081] The second grayscale value range is: 1500, 1700, 2200, 3000, 4000, 3000, 2200, 1700. Its average grayscale value is 2750.

[0082] The third grayscale value range is: 1500, 1700, 2200, 3000, 4000. Its average grayscale value is 2750.

[0083] Step 462. Set the pixel values ​​in the corresponding grayscale range that are greater than or equal to the average grayscale value as the first pixel value, and set the pixel values ​​in the corresponding grayscale range that are less than the average grayscale value as the second pixel value.

[0084] In this embodiment, it is assumed that the first pixel value is 4000 and the second pixel value is 1500.

[0085] Therefore, the first grayscale value range becomes a binary range: 4000, 4000, 1500, 1500.

[0086] The second grayscale range becomes a binary range: 1500, 1500, 1500, 4000, 4000, 4000, 1500, 1500.

[0087] The third grayscale value range becomes a binary range: 1500, 1500, 1500, 4000, 4000.

[0088] The final binary image of the code channel is "4000, 4000, 1500, 1500, 1500, 1500, 1500, 4000, 4000, 4000, 1500, 1500, 1500, 1500, 1500, 4000, 4000".

[0089] If a certain grayscale image of a code channel is not contaminated, then the resulting binary image of the code channel will definitely be very accurate.

[0090] Suppose a grayscale image of a code channel is contaminated, and there is only one contaminated area. The grayscale value range of this contaminated area is 1500, 1700, 2200, 2500 (normally it should be 3000), 3500 (normally it should be 4000). If a standard binarization method is used (e.g., a binarization threshold of 2800), the resulting binarization range is 1500, 1500, 1500, 1500 (normally it should be 4000), 4000, resulting in a high error rate. However, using the method steps in this embodiment, the resulting binarization range is 1500, 1500, 1500, 4000, 4000, demonstrating higher accuracy, meaning the final binarized image of the code channel has higher accuracy.

[0091] In this embodiment, determining the first position based on the code channel binarized image specifically includes:

[0092] Determine the second code channel area; when an uncontaminated second code channel area exists, determine the first position based on the uncontaminated second code channel area; when no uncontaminated second code channel area exists, determine the first position based on the overall strategy of all second code channels.

[0093] Specifically, determining the second code channel area includes:

[0094] Step 510. Determine the first code channel region based on the entire code channel binarized image. The first code channel region includes M consecutive scribing lines.

[0095] In this embodiment, the grating ruler is stationary, and it is assumed that the grating ruler has 10,000 scribe lines. The linear CMOS array can move linearly along the grating ruler, thereby acquiring a code track grayscale image including a portion of the grating ruler. The method in this embodiment can convert the code track grayscale image into a code track binarized image. This embodiment assumes that there are 100 scribe lines in the entire code track binarized image, then the first code track region includes 100 consecutive scribe lines.

[0096] Step 520. Within the first code channel area, determine multiple second code channel areas, each of which includes N consecutive etch lines.

[0097] In this embodiment, the second code channel area may include 28 consecutive etched lines. For example, the 1st to 28th consecutive etched lines in the first code channel area constitute one second code channel area; another example is the 2nd to 29th consecutive etched lines in the first code channel area; yet another example is the 3rd to 30th consecutive etched lines in the first code channel area. A total of M-N+1 second code channel areas can be obtained from the first code channel area. In this embodiment, 100-28+1 (i.e., 73) second code channel areas can be determined from the first code channel area.

[0098] Specifically, when an uncontaminated second code channel region exists, determining the first position based on the uncontaminated second code channel region includes:

[0099] Step 530. The absolute position of the uncontaminated second code channel area on the entire code channel is determined by its N etch lines; the center point position of the first code channel area is determined based on the absolute position of the second code channel area on the entire code channel, and the center point position is determined as the first position.

[0100] Under normal circumstances, the lines in the second code channel alternate between white and black in an orderly manner, indicating that the second code channel is not contaminated. When continuous white lines or continuous black lines appear, it indicates that the second code channel is contaminated.

[0101] The system starts by determining whether the first second code channel area is contaminated. If the first second code channel area is contaminated, it continues to determine whether the second second code channel area is contaminated. Assuming the second second code channel area is not contaminated, it compares the 28 consecutive lines in the second second code channel area with the lines on the grating ruler to obtain a globally unique position. That is, an absolute position can be obtained through the 28 consecutive lines in the second second code channel area.

[0102] At this point, the center point of the first code track area can be determined by the absolute position of the second code track area on the entire code track (the absolute position plus the difference in distance between the two center points is the center point of the first code track area). Finally, the center point of the first code track area is determined as the first position. In this embodiment, it is assumed that the center point of the first code track area is the middle scribe line of the first code track area (e.g., the 50th scribe line).

[0103] Step 540. When there is no uncontaminated second code channel area, the first position is determined based on the overall strategy of all second code channels, specifically including:

[0104] The contaminated second code channel area is used to determine the possible positions of multiple second code channel areas on the entire code channel through its fewer than N scribe lines; based on the possible positions of the second code channel areas on the entire code channel, the possible center point position of the first code channel area is determined, and one possible position is determined to obtain a corresponding possible center point position; the possible center point position that appears most frequently and whose frequency is greater than the frequency threshold is determined as the first position.

[0105] Assume that all second code channels are contaminated.

[0106] First, locate the first second code track area. Assuming there are 8 abnormal lines in the first second code track area, compare the remaining 20 lines in the second code track area with the lines on the grating ruler to obtain multiple possible positions, and thus multiple possible center point positions. In this embodiment, the possible center point positions are assumed to be: 11, 23, 35, 47, 59, 6123, 741.

[0107] Then, the second second code track area is located. Assuming there are 5 abnormal lines in this second second code track area, the remaining 23 lines in this area are compared with the lines on the grating ruler to obtain multiple possible positions, and thus multiple possible center point positions. In this embodiment, the possible center point positions are assumed to be: 1, 35, 11, 24.

[0108] Next, the third second code track area is located. Assuming there are 8 abnormal lines in this area, the remaining 20 lines are compared with the lines on the grating ruler to obtain multiple possible positions, and thus multiple possible center point positions. In this embodiment, the possible center point positions are assumed to be: 9, 99, 999, 35, 123, 455, 11.

[0109] Next, the fourth second code track area is found. Assuming that there are 3 abnormal lines in the fourth second code track area, the remaining 25 lines in the second code track area are compared with the lines on the grating ruler to obtain multiple possible positions, and thus multiple possible center point positions. In this embodiment, the possible center point positions are assumed to be: 35, 111, 22, 999.

[0110] By repeatedly performing step 540, multiple possible center point positions can be determined for each second code channel area. Finally, the possible center point position that appears most frequently and whose frequency exceeds a threshold is determined as the first position.

[0111] This embodiment assumes a threshold of 10. Assuming the most frequent possible center point is "35", we determine whether the frequency of "35" is greater than 10. If it is greater than 10, then "35" is determined as the first position.

[0112] When the product is first powered on, the linear CMOS is stationary. Through step 102 of this embodiment, the linear CMOS can obtain the code channel grayscale image and determine the initial position (i.e., the first position) through the code channel grayscale image. Moreover, as long as a small number of second code channel areas are not contaminated, the first position (i.e., the center point position of the first code channel area) can be accurately obtained, which greatly improves the anti-contamination performance.

[0113] Step 104. During product operation, the current code channel grayscale image is acquired based on the linear CMOS, the current code channel binarized image is acquired based on the current code channel grayscale image, and the current absolute position is determined based on the previous actual position and the current code channel binarized image; wherein, when the current absolute position is determined for the first time, the previous actual position is the first position.

[0114] During product operation, the linear CMOS sensor moves linearly along the grating ruler from the first position, acquiring grayscale images of the code channels at a certain frequency. For ease of understanding, this embodiment uses acquiring one grayscale image of a code channel every 35 µs as an example; that is, after the product starts operating, one grayscale image of a code channel is acquired every 35 µs. The most recently acquired grayscale image of a code channel is the current grayscale image of that code channel.

[0115] In this embodiment, the current code channel grayscale image is converted into the current code channel binarized image. The specific steps for converting the current code channel grayscale image into the current code channel binarized image are the same as those in step 102.

[0116] In this embodiment, determining the current absolute position based on the previous actual position and the current code channel binarized image specifically includes:

[0117] Step 610. Determine the current position range based on the previous actual position. Assuming the previous actual position is 500mm, the current position range could be, for example, 495-505mm.

[0118] Step 620. Obtain L scribe lines based on the current code track binarized image, and obtain several possible current positions based on the L scribe lines. In this embodiment, the value of L can be 10, and 10 scribe lines can determine a locally unique position. There are 100 scribe lines on the current code track binarized image. In this embodiment, the 46th to 55th scribe lines can be obtained, and then these 10 scribe lines can be compared with the scribe lines on the grating ruler to obtain several locally unique positions. For example, 301mm, 501mm, 701mm. In addition, when the 50th to 55th scribe lines are contaminated, the 46th to 49th scribe lines and the 56th to 61st scribe lines, a total of 10 scribe lines, can be obtained and compared with the scribe lines on the grating ruler.

[0119] Step 630. Determine the current absolute position based on the current position range and several possible current positions.

[0120] If the current position range is 495-505mm, and the possible current positions are 301mm, 501mm, and 701mm, then the current absolute position can be directly determined to be 501mm.

[0121] The method in this embodiment only needs to compare L etch lines to accurately determine the current absolute position, making the acquisition of the current absolute position very fast.

[0122] Step 106. During product operation, the current subdivision position is obtained based on the current code track grayscale image, and the current actual position is obtained based on the current absolute position and the current subdivision position.

[0123] In this embodiment, obtaining the current subdivision position based on the current code channel grayscale image specifically includes:

[0124] Step 710. Perform a fast Fourier transform on the current code track grayscale image to obtain the frequency components corresponding to the code track scribe lines, obtain the phase based on the frequency components, and obtain the initial subdivision position based on the phase.

[0125] The frequency corresponding to the code track etched lines is calculated in the same way as the target frequency in step 410, and the frequency component is the complex number corresponding to the target frequency. This is achieved through the formula... The phase can be directly calculated, where A is the real part of the complex number and B is the imaginary part. Assuming a phase of 3.14 radians, and a complete cycle of 2 μm (approximately 6.28 radians), the displacement ratio is 3.14 / 6.28 (approximately 0.5 cycles). Further assuming 10 pixels per cycle, the physical displacement is 5 pixels.

[0126] Step 720. Obtain grayscale values ​​within a preset interval centered on the initial subdivision position, calculate a weighted average value based on the obtained grayscale values, and obtain the current subdivision position based on the weighted average value.

[0127] This embodiment assumes the preset interval is two pixels (positive and negative). When the initial subdivision position is the 5th pixel, the grayscale value a1 corresponding to the 3rd pixel, the grayscale value a2 corresponding to the 4th pixel, the grayscale value a3 corresponding to the 5th pixel, the grayscale value a4 corresponding to the 6th pixel, and the grayscale value a5 corresponding to the 7th pixel are found. A weighted average is calculated for these grayscale values ​​"3, a1", "4, a2", "5, a3", "6, a4", and "7, a5". Specifically, the denominator is calculated by adding "a1" to "a2", "a3", "a4", and "a5". The numerator is calculated by adding "3 × a1" to "4 × a2", "5 × a3", "6 × a4", and "7 × a5". Finally, the weighted average is obtained by dividing the numerator by the denominator. Assume the calculated weighted average is 4.577 pixels. Assuming one pixel is 2k, then the current subdivision position is 9.154k.

[0128] Assuming the current absolute position is 501mm and the current subdivision position is 9.154kJ, then the current actual position is 501.009145mm. This current actual position can be used as the previous actual position in the next grayscale image of the current code track.

[0129] Step 102 only needs to be executed when the power is turned on. During product operation, steps 104 and 106 are executed repeatedly.

[0130] Figure 2 A block diagram of a linear absolute position measuring device 200 based on a single-track coding structure according to an embodiment of the present invention is shown. The device 200 includes:

[0131] The first position determination module 202 is configured to acquire a code channel grayscale image based on a linear CMOS array, acquire a code channel binarized image based on the code channel grayscale image, and determine the first position based on the code channel binarized image when the product is powered on.

[0132] Specifically, determining the first position based on the code channel binarized image includes:

[0133] Determine the second code channel area; when an uncontaminated second code channel area exists, determine the first position based on the uncontaminated second code channel area; when no uncontaminated second code channel area exists, determine the first position based on the overall strategy of all second code channels.

[0134] The current absolute position acquisition module 204 is configured to acquire the current code channel grayscale image based on the linear array CMOS during product operation, acquire the current code channel binarized image based on the current code channel grayscale image, and determine the current absolute position based on the previous actual position and the current code channel binarized image; wherein, when the current absolute position is determined for the first time, the previous actual position is the first position;

[0135] The current actual position acquisition module 206 is configured to acquire the current sub-position based on the current code track grayscale image and the current actual position based on the current absolute position and the current sub-position during product operation.

[0136] Figure 3 A block diagram of an electronic device 300 according to some embodiments of the present invention is shown. The device 300 includes a processor 301, which performs various appropriate actions and processes based on computer program instructions loaded into random access memory (RAM) 303 according to computer program instructions stored in read-only memory (ROM) 302. Various programs and data required for the operation of the device 300 may also be stored in RAM 303. The processor 301, ROM 302, and RAM 303 are interconnected via a bus 304. An input / output (I / O) interface 305 is also connected to the bus 304.

[0137] The various processes and procedures described above, such as method 100, can be executed by processor 301. For example, in some embodiments, method 100 may be implemented as a software program tangibly contained in a machine-readable medium. In some embodiments, part or all of the software program may be loaded and / or installed on device 300 via ROM 302. When the software program is loaded into RAM 303 and executed by processor 301, one or more actions of method 100 described above may be performed.

[0138] The functions described above in this document can be performed at least in part by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: field programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload programmable logic devices (CPLDs), and so on.

[0139] The program code used to implement the methods of the present invention can be written in any combination of one or more programming languages. This program code can be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing device, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code can be executed entirely on the machine, partially on the machine, as a standalone software package partially on the machine and partially on a remote machine, or entirely on a remote machine or server.

[0140] This invention can be a method, apparatus, system, and / or program product. The program product may include a machine-readable storage medium on which machine-readable program instructions for performing various aspects of the invention are loaded. The machine-readable program instructions described herein can be downloaded from the machine-readable storage medium to various computing / processing devices, or downloaded via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network, to an external computer or external storage device. The network may include copper transmission cables, fiber optic transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. A network adapter card or network interface in each computing / processing device receives the machine-readable program instructions from the network and forwards them for storage in the machine-readable storage medium of the respective computing / processing device.

[0141] Machine program instructions used to perform the operations of this invention may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Smalltalk, C++, etc., and conventional procedural programming languages ​​such as the "C" language or similar programming languages. The machine-readable program instructions may be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or may be connected to an external computer (e.g., via the Internet using an Internet service provider). In some embodiments, electronic circuitry, such as programmable logic circuitry, field-programmable gate arrays (FPGAs), or programmable logic arrays (PLAs), is personalized by utilizing state information from the machine-readable program instructions. This electronic circuitry can execute the machine-readable program instructions to implement various aspects of the invention.

[0142] In the context of this invention, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. Machine-readable media can include, but are not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing. Furthermore, although the operations are depicted in a specific order, this should be understood as requiring that such operations be performed in the specific order shown or in sequential order, or requiring that all illustrated operations be performed to achieve the desired result. In certain environments, multitasking and parallel processing may be advantageous. Similarly, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of the invention. Certain features described in the context of individual embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented individually or in any suitable sub-combination in multiple embodiments.

[0143] Although the subject matter has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely illustrative examples of implementing the claims.

Claims

1. A method for measuring the absolute position of a straight line based on a single-track coding structure, characterized in that, include: When the product is powered on, a grayscale image of the code channel is acquired based on the linear CMOS array, a binary image of the code channel is acquired based on the grayscale image of the code channel, and a first position is determined based on the binary image of the code channel. Specifically, determining the first position based on the code channel binarized image includes: Determine the second code channel area; when an uncontaminated second code channel area exists, determine the first position based on the uncontaminated second code channel area; when no uncontaminated second code channel area exists, determine the first position based on the overall strategy of all second code channels.

2. The method according to claim 1, characterized in that, Obtaining a binary image of a code channel based on the grayscale image of the code channel specifically includes: The code channel grayscale image is converted into a spectrum image based on the fast Fourier transform, the target frequency is calculated, and the initial amplitude corresponding to the target frequency is found based on the spectrum image. The negative and positive thresholds are determined based on the initial amplitude. The gray value sequence of the grayscale image is differentiated to obtain the gray value difference sequence, and the continuously increasing gray value difference subsequence is determined based on the threshold of the number of continuously increasing values. Select continuously increasing gray-scale difference subsequences whose minimum gray-scale difference is less than the negative threshold and whose maximum gray-scale difference is greater than the positive threshold as continuously increasing gray-scale difference intervals; The partitioning position of the continuously increasing gray-level difference interval is determined based on the zero-crossing position of the continuously increasing gray-level difference interval, and the gray-level value sequence of the code channel gray-level image is divided into multiple gray-level value intervals based on the partitioning position. Binarize the gray values ​​in each gray value range to obtain a code channel binarized image.

3. The method according to claim 2, characterized in that, The calculation of the target frequency specifically includes: The product value is obtained by multiplying the code track grating pitch by the linear CMOS imaging magnification ratio; The target frequency is obtained by dividing the product value by the pixel size.

4. The method according to claim 2, characterized in that, Binarization of gray values ​​within each gray value range specifically includes: Obtain the maximum and minimum gray values ​​within a certain gray value range, and calculate the average gray value based on the maximum and minimum gray values; Pixels with gray values ​​greater than or equal to the average gray value in the corresponding gray value range are set as the first pixel value, and pixels with gray values ​​less than the average gray value in the corresponding gray value range are set as the second pixel value.

5. The method according to claim 1, characterized in that, Determining the second code zone specifically includes: The first code track region is determined based on the entire code track binarized image, and the first code track region includes M consecutive scribing lines; Multiple second code channels are defined within the first code channel area, and each second code channel area includes N consecutive etch lines; When an uncontaminated second code channel region exists, determining the first position based on the uncontaminated second code channel region specifically includes: The uncontaminated second code channel area is determined by its N scribe lines to define the absolute position of the second code channel area on the entire code channel; the center point position of the first code channel area is determined based on the absolute position of the second code channel area on the entire code channel, and the center point position is defined as the first position; When there is no uncontaminated second code channel area, the first position is determined based on the overall strategy of all second code channels, specifically including: The contaminated second code channel area is used to determine multiple possible positions of the second code channel area on the entire code channel through its fewer than N scribe lines; based on the possible positions of the second code channel area on the entire code channel, the possible center point position of the first code channel area is determined, and one possible position is used to obtain a corresponding possible center point position; the possible center point position that appears most frequently and whose frequency is greater than the frequency threshold is determined as the first position.

6. The method according to claim 1, characterized in that, Also includes: During product operation, the current code channel grayscale image is acquired based on the linear CMOS array, the current code channel binarized image is acquired based on the current code channel grayscale image, and the current absolute position is determined based on the previous actual position and the current code channel binarized image; wherein, when the current absolute position is determined for the first time, the previous actual position is the first position; During product operation, the current subdivision position is obtained based on the current code track grayscale image, and the current actual position is obtained based on the current absolute position and the current subdivision position.

7. The method according to claim 6, characterized in that, Determining the current absolute position based on the previous actual position and the current code channel binarized image specifically includes: Determine the current location range based on the previous actual location; Based on the current code track binarized image, obtain L scribe lines, and based on the L scribe lines, obtain several possible current positions; The current absolute position is determined based on the current position range and several possible current positions.

8. The method according to claim 1, characterized in that, Obtaining the current subdivision position based on the current code channel grayscale image specifically includes: Perform a fast Fourier transform on the current code track grayscale image to obtain the frequency components corresponding to the code track scribe lines, obtain the phase based on the frequency components, and obtain the initial subdivision position based on the phase. The grayscale values ​​within a preset range are obtained with the initial subdivision position as the center. A weighted average value is calculated based on the obtained grayscale values, and the current subdivision position is obtained based on the weighted average value.

9. A linear absolute position measuring device based on a single-track coding structure, characterized in that, include: The first position determination module is configured to acquire a code channel grayscale image based on a linear CMOS array when the product is powered on, acquire a code channel binarized image based on the code channel grayscale image, and determine the first position based on the code channel binarized image. Specifically, determining the first position based on the code channel binarized image includes: Determine the second code channel area; when an uncontaminated second code channel area exists, determine the first position based on the uncontaminated second code channel area; when no uncontaminated second code channel area exists, determine the first position based on the overall strategy of all second code channels.

10. An electronic device, characterized in that, It includes one or more processors and memory associated with the one or more processors, the memory being used to store program instructions that, when read and executed by the one or more processors, perform the steps of the method according to any one of claims 1-8.