Absolute position encoder and absolute position determination method
Through the combination of image sensor and processing unit, the image sensor is used to capture the image of the measured object and compared with the calibration feature sequence, which solves the problems of complex structure and insufficient accuracy of the absolute position encoder, and achieves a simple structure, low cost and high reliability. Absolute position measurement of sex.
Patent Information
- Application Number
- CN202410726169.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-06
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2044-06-06
AI Technical Summary
Existing absolute position encoders have complex structures or insufficient accuracy, resulting in high cost and low accuracy.
An absolute position encoder is provided, including an image sensor and a processing unit, having a calibration mode and a measurement mode. In the calibration mode, the calibration feature sequence is obtained by taking the calibration image sequence of the measured object and sorting the feature differences. In the measurement mode, the absolute position information is determined based on the comparison of the measured image sequence and the calibration feature sequence.
It achieves absolute position determination with simple structure, low cost and high reliability of measurement results, and avoids the need for complex processing of the surface of the measured object.
Smart Images

Figure CN118293960B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of encoders, and in particular to an absolute position encoder and an absolute position determination method. Background Art
[0002] An encoder is a sensor used to convert information such as rotation angle or linear displacement into electrical signals. In terms of working principle, encoders include mechanical encoders, optical encoders, magnetic encoders, capacitive encoders, etc. In terms of output data, encoders are mainly divided into absolute and incremental types.
[0003] Among them, optical encoders and magnetic encoders are more widely used.
[0004] The optical encoder is composed of a light-emitting element, a photosensitive element, and a code disc. The accuracy of the optical encoder depends on the grating accuracy of the code disc, and has high requirements for the material and processing accuracy of the code disc. The processing circuit of the optical encoder is also relatively complex. This leads to a high processing cost and a large size of the code disc.
[0005] The magnetic encoder is composed of a permanent magnet and a Hall element. The magnetic encoder uses magnetic field changes to detect angles and is less affected by dust and other contaminants. However, the accuracy of the magnetic encoder is not as good as that of the optical encoder, and the magnetic encoder cannot be used in scenarios where the external magnetic field changes. Summary of the invention
[0006] The object of the present invention is to provide an absolute position encoder and an absolute position determination method to solve the problem that the existing absolute position encoder has a complex structure or insufficient precision.
[0007] In order to solve the above technical problems, the present invention provides an absolute position encoder, which includes an image sensor and a processing unit; the absolute position encoder has a calibration mode and a measurement mode;
[0008] When the absolute position encoder is in the calibration mode, the image sensor is configured to capture a calibration image sequence of the object moving in a preset manner according to a preset calibration time sequence; the processing unit is configured to select a frame of image in the calibration image sequence as a reference image frame; obtain calibration feature differences of each frame of image in the calibration image sequence relative to the reference image frame; the calibration feature differences are sorted corresponding to the calibration time sequence to obtain a calibration feature sequence;
[0009] When the absolute position encoder is in the measurement mode, the image sensor is configured to photograph the object under test according to a preset measured time sequence; the processing unit is configured to obtain a corresponding measured feature sequence based on the image photographed by the image sensor, and determine the absolute position information of the object under test based on the comparison between the measured feature sequence and the calibration feature sequence.
[0010] Optionally, when the absolute position encoder is in the calibration mode, the processing unit is further configured to:
[0011] Obtaining calibration displacement data of the object to be measured according to the difference between two frames of images in the calibration image sequence;
[0012] Based on the calibration displacement data and the actual movement of the object under test, the division data is determined.
[0013] Optionally, the position of the object under test corresponding to the reference image frame is taken as the starting position, and the object under test moves periodically;
[0014] When there is a frame in the calibration image sequence whose calibration feature difference with respect to the reference image frame is not greater than a preset first threshold, determining that the object under test completes a cycle of movement and returns to the starting position;
[0015] The calibration time series at least includes one cycle of the movement of the object being measured.
[0016] Optionally, the step of determining the absolute position information of the object under test based on the comparison between the measured feature sequence and the calibration feature sequence includes:
[0017] Comparing the correlation coefficient between the measured feature sequence and the calibration feature sequence, if the correlation coefficient is not less than a preset second threshold, determining the portion of the calibration feature sequence corresponding to the measured feature sequence as the current process frame sequence;
[0018] According to the image frame sequence in the calibration image sequence corresponding to the current process frame sequence, the absolute position information of the object to be measured relative to the image sensor is determined.
[0019] Optionally, the processing unit is further configured to obtain relative displacement data of the object under test corresponding to the measured time series; and obtain basic absolute position information of the object under test at a previous moment of the measured time series;
[0020] Based on the comparison between the measured feature sequence and the calibration feature sequence, the step of determining the absolute position information of the object under test includes:
[0021] The correlation coefficient of the measured feature sequence is compared with the calibration feature sequence. If the correlation coefficient is less than a preset second threshold, the sum of the basic absolute position information and the relative displacement data is determined as the absolute position information of the object under test.
[0022] Optionally, the step of obtaining a corresponding measured feature sequence based on the image captured by the image sensor includes:
[0023] Obtaining the measured feature difference between each frame of image captured by the image sensor and the reference image frame;
[0024] The measured feature differences are sorted corresponding to the measured time series to obtain the measured feature sequence.
[0025] Optionally, when the absolute position encoder is in the measurement mode, the processing unit is further configured to:
[0026] Repeat the shooting and comparing steps for multiple times, and accumulate the number of matches; wherein the shooting and comparing steps include respectively comparing the difference of measured feature difference between each frame image captured by the image sensor and the reference image frame; if there is a frame image whose difference of measured feature difference between the reference image frame and the reference image frame is not greater than a preset third threshold, then record the number of matches once;
[0027] When the accumulated number of matches is greater than a preset fourth threshold, the reference image frame is updated to an image whose difference in the current shooting and comparison step is not greater than the third threshold, and the number of matches is reset to zero.
[0028] Optionally, after the reference image frame is updated, multiple frames of images subsequently captured by the image sensor are compared with the updated reference image frame to calculate a feature sequence, and the calculated feature sequence is used to replace and update the calibration feature sequence.
[0029] Optionally, the processing unit is further configured to calculate the measured displacement data or measured velocity data of the object under test based on the difference between the two frames of images taken by the image sensor; and the step of obtaining the corresponding measured feature sequence based on the image taken by the image sensor also includes:
[0030] When the movement mode of the measured object is different from that in the calibration mode, the measured feature sequence is corrected by using the measured displacement data or the measured velocity data.
[0031] In order to solve the above technical problems, the present invention also provides an absolute position determination method, which comprises:
[0032] According to a preset calibration time sequence, a calibration image sequence of the object under test moving in a preset manner is obtained by shooting; a frame of image is selected from the calibration image sequence as a reference image frame; calibration feature differences of each frame of image in the calibration image sequence relative to the reference image frame are obtained; the calibration feature differences are sorted corresponding to the calibration time sequence to obtain a calibration feature sequence;
[0033] The object to be measured is photographed according to a preset measured time sequence; a corresponding measured feature sequence is obtained based on the image obtained by photographing the object to be measured, and the absolute position information of the object to be measured is determined based on the comparison between the measured feature sequence and the calibration feature sequence.
[0034] In summary, in the absolute position encoder and the absolute position determination method provided by the present invention, the absolute position encoder includes an image sensor and a processing unit; the absolute position encoder has a calibration mode and a measurement mode; when the absolute position encoder is in the calibration mode, the image sensor is configured to capture a calibration image sequence of the object under test moving in a preset manner according to a preset calibration time sequence; the processing unit is configured to select a frame of image in the calibration image sequence as a reference image frame; obtain the calibration feature difference of each frame of image in the calibration image sequence relative to the reference image frame; the calibration feature difference is sorted corresponding to the calibration time sequence to obtain a calibration feature sequence; when the absolute position encoder is in the measurement mode, the image sensor is configured to capture the object under test according to a preset measured time sequence; the processing unit is configured to obtain a corresponding measured feature sequence based on the image captured by the image sensor, and determine the absolute position information of the object under test based on the comparison between the measured feature sequence and the calibration feature sequence.
[0035] With this configuration, the absolute position information of the current object under test can be determined by imaging the object under test, calculating the features of the image, and then comparing the feature changes of the image during the movement of the object under test with the calibration feature sequence. There is no need to perform complex processing on the surface of the object under test, the structure is simple, the cost is low, and the reliability of the measurement results is high. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Those skilled in the art will appreciate that the accompanying drawings are provided for a better understanding of the present invention and do not constitute any limitation on the scope of the present invention.
[0037] Figure 1 Schematic diagram of the structure of the absolute position encoder according to an embodiment of the present invention.
[0038] Figure 2 , Figure 3 , Figure 4 Schematic diagram of several installation examples of the absolute position encoder according to the embodiment of the present invention.
[0039] Figure 5 Schematic diagram of a calibration feature sequence according to an embodiment of the present invention.
[0040] Figure 6 It is a schematic diagram of matching the measured feature sequence and the calibrated feature sequence according to an embodiment of the present invention.
[0041] Figure 7 4 is a flow chart of an absolute position determination method according to an embodiment of the present invention.
[0042] Figure 8 4 is a flow chart of the calibration steps of the absolute position determination method according to an embodiment of the present invention.
[0043] Fig. 9 It is a flowchart of the measurement steps of the absolute position determination method according to an embodiment of the present invention.
[0044] In the attached figure:
[0045] 1-absolute position encoder; 11-image sensor; 12-processing unit; 13-light source; 2-object to be measured. DETAILED DESCRIPTION
[0046] In order to make the purpose, advantages and features of the present invention clearer, the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that the drawings are all in a very simplified form and are not drawn to scale, and are only used to conveniently and clearly assist in explaining the purpose of the embodiments of the present invention. In addition, the structure shown in the drawings is often a part of the actual structure. In particular, the emphasis of each drawing is different, and sometimes different scales are used.
[0047] As used in the present invention, the singular forms "one", "an", "one" and "the" include plural objects, the term "or" is generally used in a sense including "and / or", the term "several" is generally used in a sense including "at least one", and the term "at least two" is generally used in a sense including "two or more". In addition, the terms "measured", "calibrated", and "third" are used only for descriptive purposes and cannot be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features. Therefore, the features defined as "measured", "calibrated", and "third" may explicitly or implicitly include one or at least two of the features, "one end" and "the other end" as well as "proximal end" and "distal end" generally refer to two corresponding parts, which include not only endpoints. In addition, as used in the present invention, "installed", "connected", "connected", and one element "set" on another element should be understood in a broad sense, usually only indicating that there is a connection, coupling, cooperation or transmission relationship between the two elements, and the connection, coupling, cooperation or transmission between the two elements can be direct or indirect through an intermediate element, and cannot be understood as indicating or implying the spatial position relationship between the two elements, that is, one element can be in any orientation such as inside, outside, above, below or one side of another element, unless the content clearly indicates otherwise. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances. In addition, directional terms such as above, below, up, down, upward, downward, left, right, etc. are used relative to the exemplary embodiments as shown in the figures, with the upward or upper direction toward the top of the corresponding figure, and the downward or lower direction toward the bottom of the corresponding figure.
[0048] The object of the present invention is to provide an absolute position encoder and an absolute position determination method to solve the problem that the existing absolute position encoder has a complex structure or insufficient precision.
[0049] Please refer to Figure 1The embodiment of the present invention provides an absolute position encoder 1, which includes an image sensor 11 and a processing unit 12; the absolute position encoder 1 has a calibration mode and a measurement mode; when the absolute position encoder 1 is in the calibration mode, the image sensor 11 is configured to shoot and obtain a calibration image sequence of a measured object moving in a preset manner according to a preset calibration time sequence; the processing unit 12 is configured to select a frame of image in the calibration image sequence as a reference image frame; obtain the calibration feature difference of each frame of image in the calibration image sequence relative to the reference image frame; the calibration feature difference is sorted corresponding to the calibration time sequence to obtain a calibration feature sequence; when the absolute position encoder 1 is in the measurement mode, the image sensor 11 is configured to shoot the measured object 2 according to a preset measured time sequence; the processing unit 12 is configured to obtain a corresponding measured feature sequence based on the image shot by the image sensor 11, and determine the absolute position information of the measured object 2 based on the comparison between the measured feature sequence and the calibration feature sequence.
[0050] In an alternative exemplary embodiment, the absolute position encoder 1 has a main body or a shell, at least the image sensor 11 is mounted on the main body or the shell, and preferably, the processing unit 12 is also arranged on the main body or the shell, or the processing unit 12 is connected to the image sensor 11. Therefore, the position of the absolute position encoder 1 can also be considered as the position of the image sensor 11 itself. There is a relative movement such as rotation and / or translation between the object 2 to be measured and the absolute position encoder 1. By shooting the object 2 to be measured multiple times by the image sensor 11, multiple images of the object 2 can be obtained. Furthermore, in the measurement mode, the processing unit 12 can determine the absolute position information of the object 2 to be measured, that is, determine the absolute position of the object 2 to be measured relative to the absolute position encoder 1, by processing and analyzing the multiple images taken by the image sensor 11 and comparing them with the calibration feature sequence obtained in advance.
[0051] Optionally, the absolute position encoder 1 further includes a light source 13, which is used to illuminate the object 2 to facilitate the image sensor 11 to capture the image. The installation position of the light source 13 is not limited, and it can be located on the same side of the object 2 as the image sensor 11, such as Figure 1 As shown. In some embodiments, the light source 13 and the image sensor 11 may be located on different sides of the object 2. Optionally, the surface of the object 2 may have one or more marks or no marks. The image sensor 11 may be used to receive light reflected or transmitted from the surface of the object 2, thereby capturing an image.
[0052] It is understandable that the wavelength of light emitted by the light source 13 is not limited, and it can be visible light or infrared light, etc. The image sensor 11 is preferably able to adapt to the wavelength of light emitted by the light source 13. For example, when the light source 13 emits infrared light, the image sensor 11 is preferably an infrared image sensor. There can be multiple image sensors 11, and they are preferably arranged in columns or arrays. Furthermore, the image sensor 11 and / or the light source 13 include a filter, which only allows light of a specific wavelength to pass through, thereby reducing the influence of ambient light. In some embodiments, the image sensor 11 also preferably has a lens or a lens group, which is used to improve the imaging effect. Those skilled in the art can understand and configure the structure and principle of the image sensor 11, the light source 13, the filter, the lens or the lens group according to the prior art, and the present invention will not be described in detail.
[0053] In some embodiments, the absolute position encoder 1 can be configured as a rotary encoder, that is, it is used to detect the rotation angle (referring to the absolute rotation angle) and / or the rotation speed (referring to the current rotation speed) of the object 2. Please refer to Figures 2 to 4 , which respectively show several installation examples of the absolute position encoder 1 and the object to be measured 2. Figure 2 As shown, the object 2 to be measured is a cylindrical rotating shaft, and the absolute position encoder 1 is arranged inside the object 2 to be measured. At this time, the image sensor 11 is used to capture an image of the inner wall of the rotating shaft of the object 2 to be measured. Figure 3 As shown, the object 2 to be measured is a rotating shaft, and the absolute position encoder 1 is arranged outside the outer peripheral wall of the object 2 to be measured. At this time, the image sensor 11 is used to capture an image of the outer peripheral wall of the rotating shaft of the object 2 to be measured. Figure 4 As shown, the object 2 to be measured is a rotating shaft, and the absolute position encoder 1 is arranged at the axial end of the object 2 to be measured and does not coincide with the rotation axis of the object 2 to be measured. At this time, the image sensor 11 is used to capture the image of the axial end of the object 2 to be measured.
[0054] In other embodiments, the absolute position encoder 1 may be configured as a linear encoder, that is, it is used to detect the translational motion position and / or speed of the object 2. It is understandable that the absolute position encoder 1 may be arranged on any side of the object 2.
[0055] The principle of the absolute position encoder 1 provided in this embodiment is described in detail below.
[0056] After the absolute position encoder 1 is installed relative to the object under test 2, the calibration feature sequence must be obtained first. At this time, the absolute position encoder 1 can be configured to enter the calibration mode. In the calibration mode, the object under test 2 is configured to move in a preset manner, and the preset manner can be set differently according to the application configuration of the absolute position encoder 1. For example, when the absolute position encoder 1 is configured as a rotary encoder, the object under test 2 can be configured to rotate at least one circle around its own rotation axis at a uniform speed. When the absolute position encoder 1 is configured as a linear encoder, the object under test 2 can be configured to move back and forth at a uniform speed at least once from the starting point of the stroke to the end point of the stroke.
[0057] During the movement of the object 2 under test in a preset manner, the image sensor 11 is configured to capture and obtain a calibration image sequence of the object 2 under test according to a preset calibration time sequence; the preset calibration time sequence here is preferably an equally spaced sequence at a certain frequency. The image sensor 11 captures the object 2 under test according to the preset calibration time sequence, and a plurality of frames of images arranged according to the calibration time sequence can be obtained, and a collection of these images is the calibration image sequence. Of course, in some other embodiments, the calibration time sequence is not limited to being an equally spaced sequence, for example, it can also be an unequally spaced sequence, and in the subsequent process of obtaining the calibration feature sequence, the displacement or speed of adjacent frames can be combined to fit (such as including interpolation, discarding frames, etc.) the changes in feature differences within a unit time, thereby obtaining an equally spaced calibration feature sequence.
[0058] The processing unit 12 is configured to select a frame of image in the calibration image sequence as a reference image frame; the reference image frame can be any frame of image in the calibration image sequence, preferably the first frame of image captured after the image sensor 11 works normally, that is, the first frame of image in the calibration image sequence. Then, the calibration feature difference of each frame of image in the calibration image sequence relative to the reference image frame is obtained; it should be noted that what is compared here is not the direct image difference of each frame of image relative to the reference image frame, but the feature difference between the image features of each frame of image and the image features of the reference image frame. The image features here include at least one of the average brightness of the image, the standard deviation of the image, the sum of the absolute values of the pixel differences of the image (SAD), and the correlation coefficient (CORR) of the image. Then, each feature difference is sorted corresponding to the calibration time series, that is, a calibration feature sequence is obtained. The calibration feature sequence and the reference image frame can preferably be stored for subsequent application in the measurement mode. Other images in the calibration image sequence can no longer be stored if there is no subsequent application demand. Please refer to Figure 5 , which shows an example of a calibration feature sequence a generated when the image feature includes the sum of absolute pixel differences (SAD) of the image.
[0059] Optionally, since the reference image frame is selected from the calibration image sequence, in some embodiments, several different frames of images can be selected from the calibration image sequence as reference image frames, that is, multiple reference image frames can be selected, and multiple different calibration feature sequences can be obtained.
[0060] Preferably, in the calibration mode, the object 2 is configured to move periodically. For ease of description, the position of the object 2 corresponding to the reference image frame is assumed to be the starting position. When there is a frame in the calibration image sequence whose calibration feature difference relative to the reference image frame is not greater than a preset first threshold, it is determined that the object 2 completes a cycle of movement and returns to the starting position; the calibration time series contains at least one cycle of the movement of the object. In order to ensure that the image captured by the image sensor 11 during calibration can completely cover the entire movement stroke of the object 2, on the one hand, it is necessary to ensure that the movement of the object 2 fills the entire stroke, for example, when the absolute position encoder 1 is configured as a rotary encoder, the movement of the object 2 is at least one circle; and when the absolute position encoder 1 is configured as a linear encoder, the movement of the object 2 is at least one reciprocating. At the same time, on the other hand, the calibration time series also needs to contain at least one complete cycle of the movement of the object 2. It can be understood that when there is a frame in the calibration image sequence whose calibration feature difference with respect to the reference image frame is not greater than the preset first threshold, it means that the frame is very similar to the reference image frame, which means that the object under test 2 has returned to the starting position of the reference image frame. The first threshold can be set differently according to different categories of image features.
[0061] Optionally, when the absolute position encoder 1 is in the calibration mode, the processing unit 12 is further configured to obtain calibration displacement data of the object 2 according to the difference between the two frames of images in the calibration image sequence, and determine the graduation data based on the calibration displacement data and the actual movement of the object 2. The processing unit 12 can calculate the relative displacements dx and dy of the object 2 when the two frames of images are taken according to the difference between the two frames of images in the calibration image sequence, thereby obtaining calibration displacement data. As the image sensor 11 continuously takes pictures according to the preset calibration time sequence, the processing unit 12 continuously obtains multiple calibration displacement data.
[0062] The actual movement of the object 2 under test may vary according to the application configuration of the absolute position encoder 1. Preferably, when the object 2 under test returns to the starting position of the reference image frame, the division data is determined in combination with the sum of all the calibration displacement data obtained by the processing unit 12 in the movement corresponding to one cycle. For example, when the absolute position encoder 1 is configured as a rotary encoder, the movement of the object 2 under test for one cycle is one rotation, and the division data may be the reading per revolution (CPR). The sum of all the calibration displacement data during one rotation of the object 2 under test is the reading per revolution (CPR). By dividing the reading per revolution (CPR) by 360°, the displacement generated when the object 2 under test rotates 1° can be obtained. When the absolute position encoder 1 is configured as a linear encoder, the division data may be the reading per inch (CPI). Its division principle is similar to the reading per revolution (CPR). Of course, in some embodiments, the actual movement of the object 2 is not limited to completing a complete cycle of movement. For example, the object 2 can also rotate only a certain angle (such as 90°). In this case, the per-circle reading (CPR) and the displacement generated when rotating 1° can also be obtained.
[0063] After the calibration is completed, the absolute position encoder 1 can be configured to enter the measurement mode. In the measurement mode, the duration of the measured time series can be set according to the matching accuracy, and the duration of the measured time series is preferably less than the duration of the calibration time series. The image sensor 11 shoots the object 2 according to the preset measured time series, and multiple frames of images of the object 2 arranged according to the measured time series can be obtained.
[0064] Optionally, the step of obtaining a corresponding measured feature sequence based on the image taken by the image sensor 11 includes: obtaining the measured feature difference of each frame image taken by the image sensor 11 relative to the reference image frame; and sorting the measured feature difference corresponding to the measured time series to obtain the measured feature sequence.
[0065] It is understandable that when obtaining the measured feature sequence, the selected image features are preferably of the same type as the image features selected in the calibration feature distinction. And when obtaining the measured feature sequence, the selected reference image frame should preferably be the same as the reference image frame corresponding to the current calibration feature sequence.
[0066] Furthermore, based on the comparison between the measured feature sequence and the calibrated feature sequence, the step of determining the absolute position information of the object under test 2 includes: comparing the correlation coefficient between the measured feature sequence and the calibrated feature sequence, if the correlation coefficient is not less than a preset second threshold, determining the part of the calibrated feature sequence corresponding to the measured feature sequence as the current process frame sequence; and determining the absolute position information of the object under test 2 according to the image frame sequence in the calibrated image sequence corresponding to the current process frame sequence.
[0067] It should be noted that when comparing the correlation coefficient (CORR) of the measured feature sequence with the calibration feature sequence, a segment with the same duration as the measured feature sequence can be selected in the calibration feature sequence for comparison. If the correlation coefficient (CORR) between the measured feature sequence and a certain segment in the calibration feature sequence is not less than the second threshold, it can be considered that the measured feature sequence matches a certain segment in the measured feature sequence. Those skilled in the art can set the second threshold according to the matching accuracy.
[0068] In some comparison processes between the measured feature sequence and the calibrated feature sequence, when the correlation coefficient (CORR) is not less than the preset second threshold, for example, when the correlation coefficient is close to 1, it can be considered that the confidence level of the match between the measured feature sequence and the calibrated feature sequence is very high at this time, and the absolute position information of the object 2 under test can be directly determined based on the current measured feature sequence.
[0069] Please refer to Figure 5 and Figure 6 , which shows an example of matching the measured feature sequence b with the calibrated feature sequence a. Figure 6 In the example shown, the image features of the measured feature sequence b and the calibrated feature sequence a both contain the sum of absolute pixel differences (SAD) of the images. It can be seen that Figure 6 The measured feature sequence b in the calibration feature sequence a is roughly overlapped with a portion of the segment, indicating that the measured feature sequence b matches the calibration feature sequence a. At this time, the portion of the calibration feature sequence a corresponding to the measured feature sequence b can be determined as the current process frame sequence.
[0070] Furthermore, based on the position of the current process frame sequence in the entire calibration feature sequence a, the image frame sequence in the calibration image sequence corresponding to the current process frame sequence can be inferred, that is, a series of calibration images corresponding to the current process frame sequence can be inferred, thereby further inferring the position information of the object under test 2 when these calibration images are taken, thereby determining the absolute position information of the object under test 2.
[0071] In some embodiments, the measured time series can be adapted and set according to the calibration time series, for example, the calibration time series is an evenly spaced sequence with a certain frequency, and the measured time series is an evenly spaced sequence with the same frequency as the calibration time series. In this way, the measured time series and the calibration time series have the same interval, which facilitates matching the measured feature series with the calibration feature series.
[0072] In some embodiments, in the measurement mode, the object 2 is preferably configured to move in the same preset manner as in the calibration mode, for example, when the object 2 is rotating at a constant speed in the calibration mode, the object 2 is also rotating at the same constant speed in the measurement mode, so that the time intervals of the measured feature sequence and the calibration feature sequence are consistent.
[0073] Of course, in some other embodiments, in the measurement mode, the object 2 is not limited to being configured to move in the same preset manner as in the calibration mode. For example, when the object 2 rotates at a uniform speed in the calibration mode, the object 2 may rotate at a non-uniform speed in the measurement mode. It is understandable that at this time, the movement speed of the object 2 is uneven, and even if the image sensor 11 shoots according to the measured time sequence at equal intervals, the measured feature sequence obtained cannot be directly matched with the calibration feature sequence.
[0074] In response to such a situation, preferably, the processing unit 12 is further configured to calculate the measured displacement data or measured velocity data of the object 2 according to the difference between the two frames of images captured by the image sensor 11. It can be understood that the processing unit 12 can calculate the relative displacements dx and dy of the object 2 when the two frames of images are captured according to the difference between the two frames of images, thereby obtaining the measured displacement data. As the image sensor 11 continuously captures according to the preset measured time sequence, the processing unit 12 continuously obtains multiple measured displacement data. These measured displacement data have multiple functions:
[0075] On the one hand, based on the measured displacement data and the measured time series, the measured speed data can be calculated by taking the first-order derivative of the measured displacement data. That is, at this time, the absolute position encoder 1 can feedback the real-time speed information of the measured object 2.
[0076] On the other hand, when the motion mode of the measured object 2 is different from that in the calibration mode, the measured feature sequence can be corrected by the measured displacement data or the measured velocity data so that the measured feature sequence and the calibrated feature sequence can be based on the same time interval. In an alternative exemplary embodiment, the correction can be obtained by fitting (such as including interpolation, discarding frames, etc.) to obtain the change of the measured feature difference within a unit time (the unit time is the same as the time interval of the calibrated feature sequence), thereby obtaining an equally spaced measured feature sequence. Then, the measured feature sequence and the calibrated feature sequence can be compared based on the same time interval. Furthermore, if the measured time sequence does not match the calibrated time sequence, the measured feature sequence and the calibrated feature sequence can also be matched by timing adjustment. For example, when the frequencies of the measured time sequence and the calibrated time sequence are different, the measured feature sequence can be adjusted by the proportional coefficient of the frequencies of the two, so that the measured feature sequence and the calibrated feature sequence have the same interval.
[0077] On the other hand, the relative displacement data of the current measured object 2 corresponding to the current measured time series can be determined based on the measured displacement data combined with the division data determined in the calibration mode. For example, when the division data is the reading per revolution (CPR), the displacement amount generated when the measured object 2 rotates 1° can be known, and the relative displacement data (i.e., the relative rotation angle) of the measured object 2 corresponding to the entire measured time series can be known based on the ratio of the sum of the measured displacement data of the measured object 2 corresponding to the entire measured time series and the displacement amount generated when the measured object 2 rotates 1°.
[0078] Optionally, the processing unit 12 is also configured to obtain the basic absolute position information of the object 2 at the previous moment of the measured time sequence. The basic absolute position information here refers to the reliable absolute position information before the current measured time sequence. The basic absolute position information can be obtained from several aspects. On the one hand, if the object 2 is in the starting position before the current measured time sequence, the basic absolute position information can be determined as the starting position. On the other hand, if the object 2 is not in the starting position before the measured time sequence, its basic absolute position information needs to be determined by comparing the aforementioned measured feature sequence with the calibration feature sequence. That is, the basic absolute position information is determined based on the measured feature sequence and the calibration feature sequence matched in the previous time. It should be noted that in some cases, there may be no reliable basic absolute position information at the previous moment of the current measured time sequence, or reliable basic absolute position information cannot be obtained. At this time, the processing unit 12 can be configured not to output the absolute position information until a reliable absolute position information is obtained by comparing the measured feature sequence with the calibration feature sequence during the subsequent movement of the object 2.
[0079] Furthermore, based on the comparison between the measured feature sequence and the calibrated feature sequence, the step of determining the absolute position information of the object under test 2 includes: comparing the correlation coefficient between the measured feature sequence and the calibrated feature sequence, and if the correlation coefficient is less than a preset second threshold, determining the sum of the basic absolute position information and the relative displacement data as the absolute position information of the object under test 2.
[0080] In some comparison processes between the measured feature sequence and the calibration feature sequence, when the correlation coefficient (CORR) is less than the preset second threshold, it can be considered that the confidence of the match between the measured feature sequence and the calibration feature sequence is low, and the absolute position information of the measured object 2 cannot be directly determined. At this time, the basic absolute position information of the previous moment plus the relative displacement data of the measured object 2 corresponding to the current measured time sequence can be used to obtain the current absolute position information of the measured object 2. It can be understood that the absolute position information obtained by adding the basic absolute position information of the previous moment to the current relative displacement data can also be used as the basic absolute position information in the next matching process.
[0081] During use, the absolute position encoder 1 may fail to match because the surface of the image sensor 11 is contaminated, or the surface of the object 2 is contaminated. Therefore, when the absolute position encoder 1 is in the measurement mode, it is also preferred to regularly update the reference image frame and / or the calibration feature sequence to improve the success rate of matching and enhance the reliability of the absolute position encoder 1 during use.
[0082] In an exemplary embodiment, when the absolute position encoder 1 is in the measurement mode, the processing unit 12 is further configured to: repeat multiple shooting and comparison steps and accumulate the number of matches; wherein the shooting and comparison steps include respectively comparing the differences in measured feature differences between each frame image captured by the image sensor 11 and the reference image frame; if there is a frame image whose measured feature difference relative to the reference image frame is not greater than a preset third threshold, record the number of matches once; when the accumulated number of matches is greater than a preset fourth threshold, update the reference image frame to an image whose difference in the current shooting and comparison step is not greater than the third threshold, and reset the number of matches to zero.
[0083] The shooting and comparison step is a step of comparing each frame of image captured by the image sensor 11 in the measurement mode with the current reference image frame. Specifically, the shooting and comparison step can obtain the measured feature difference by comparing the image features of each frame of image with the image features of the reference image frame. The image features here include at least one of the average brightness of the image, the standard deviation of the image, the sum of the absolute values of the pixel differences of the image (SAD), and the correlation coefficient (CORR) of the image. If there is a frame of image whose measured feature difference relative to the reference image frame is not greater than a preset third threshold, it can be considered that the frame of image matches the reference image frame, and the number of matches is recorded at the same time. The third threshold can be set differently according to different categories of image features.
[0084] It is understandable that the shooting and comparison step can be performed synchronously in the process of obtaining the measured feature sequence. When the absolute position encoder 1 is in the measurement mode, the image sensor 11 continuously shoots the object 2, and the processing unit 12 also continuously compares the obtained multiple frames of images with the reference image frame, that is, repeatedly performing multiple shooting and comparison steps.
[0085] When the absolute position encoder 1 is in the measurement mode, each time the object 2 moves to a position corresponding to the reference image frame, the number of matches is recorded. When the accumulated number of matches is greater than the preset fourth threshold, it means that the object 2 has completed multiple cycles of movement. At this time, the reference image frame can be updated to an image whose difference in the current shooting comparison step is not greater than the third threshold, and the number of matches is reset to zero.
[0086] Furthermore, after the reference image frame is updated, multiple frames of images subsequently captured by the image sensor 11 are compared with the updated reference image frame to calculate a feature sequence, and the calculated feature sequence is used to replace and update the calibration feature sequence. Preferably, the processing unit 12 can use the images subsequently captured by the image sensor 11 to calculate several feature sequences respectively, and then replace the corresponding parts in the calibration image sequence section by section, thereby completing the update of the entire calibration image sequence. It should be noted that these subsequent feature sequences can be continuous, discontinuous or even overlapped, and those skilled in the art can configure them according to actual conditions.
[0087] Optionally, the processing unit 12 includes a communication module, which can be used to interact with other devices and output images captured by the image sensor 11, absolute position information or measured speed data, etc.
[0088] Please refer to Figures 7 to 9 , an embodiment of the present invention further provides an absolute position determination method, which includes:
[0089] Step S1: obtaining a calibration feature sequence;
[0090] Step S2: photographing the object 2 according to a preset measured time sequence;
[0091] Step S3: obtaining a corresponding measured feature sequence based on the image obtained by photographing the object to be measured 2, and determining the absolute position information of the object to be measured 2 based on the comparison between the measured feature sequence and the calibration feature sequence.
[0092] Optionally, step S1 includes:
[0093] Step S11: photographing and acquiring a calibration image sequence of the object under test moving in a preset manner according to a preset calibration time sequence;
[0094] Step S12: selecting an image frame in the calibration image sequence as a reference image frame;
[0095] Step S13: obtaining the calibration feature difference of each frame image in the calibration image sequence relative to the reference image frame;
[0096] Step S14: The calibration feature differences are sorted according to the calibration time series to obtain a calibration feature sequence.
[0097] Optionally, step S3 includes:
[0098] Step S31: comparing the correlation coefficient between the measured feature sequence and the calibration feature sequence, and determining whether the correlation coefficient is less than a preset second threshold;
[0099] Step S32: if the correlation coefficient is not less than a preset second threshold, the portion of the calibration feature sequence corresponding to the measured feature sequence is determined as the current process frame sequence;
[0100] Step S33: determining the absolute position information of the object under test relative to the image sensor according to the image frame sequence in the calibration image sequence corresponding to the current process frame sequence.
[0101] Step S34: If the correlation coefficient is less than a preset second threshold, the sum of the basic absolute position information and the relative displacement data is determined as the absolute position information of the object under test.
[0102] The principles of each step of the absolute position determination method can be referred to the above description of the absolute position encoder 1, which will not be repeated here. Optionally, the absolute position determination method also includes other steps corresponding to the above absolute position encoder 1, which can be understood by those skilled in the art based on the above. An embodiment of the present invention also provides a readable storage medium on which a program is stored, and when the program is executed, the steps of the absolute position determination method as described above are implemented. The readable storage medium can be integrated into the absolute position encoder 1, for example, integrated into the processing unit 12, or it can be independent of the absolute position encoder 1, and those skilled in the art can set it according to actual conditions.
[0103] In summary, in the absolute position encoder and the absolute position determination method provided by the present invention, the absolute position encoder includes an image sensor and a processing unit; the absolute position encoder has a calibration mode and a measurement mode; when the absolute position encoder is in the calibration mode, the image sensor is configured to capture a calibration image sequence of the object under test moving in a preset manner according to a preset calibration time sequence; the processing unit is configured to select a frame of image in the calibration image sequence as a reference image frame; obtain the calibration feature difference of each frame of image in the calibration image sequence relative to the reference image frame; the calibration feature difference is sorted corresponding to the calibration time sequence to obtain a calibration feature sequence; when the absolute position encoder is in the measurement mode, the image sensor is configured to capture the object under test according to a preset measured time sequence; the processing unit is configured to obtain a corresponding measured feature sequence based on the image captured by the image sensor, and determine the absolute position information of the object under test based on the comparison between the measured feature sequence and the calibration feature sequence. With this configuration, the absolute position information of the current object under test can be determined by imaging the object under test, calculating the features of the image, and then comparing the feature changes of the image during the movement of the object under test with the calibration feature sequence. There is no need to perform complex processing on the surface of the object under test, the structure is simple, the cost is low, and the reliability of the measurement results is high.
[0104] It should be noted that the above embodiments can be combined with each other. The above description is only a description of the preferred embodiments of the present invention, and does not limit the scope of the present invention. Any changes and modifications made by ordinary technicians in the field of the present invention based on the above disclosure are within the protection scope of the present invention.
Claims
1. An absolute position encoder, characterized in that: It includes an image sensor and a processing unit; the absolute position encoder has a calibration mode and a measurement mode; When the absolute position encoder is in the calibration mode, the image sensor is configured to capture a calibration image sequence of the object moving in a preset manner according to a preset calibration time sequence; the processing unit is configured to select a frame of image in the calibration image sequence as a reference image frame; obtain calibration feature differences of each frame of image in the calibration image sequence relative to the reference image frame; the calibration feature differences are sorted corresponding to the calibration time sequence to obtain a calibration feature sequence; When the absolute position encoder is in the measurement mode, the image sensor is configured to photograph the object to be measured according to a preset measured time sequence; the processing unit is configured to obtain the measured feature difference of each frame image obtained by the image sensor relative to the reference image frame; the measured feature difference is sorted corresponding to the measured time sequence to obtain a measured feature sequence; and based on the comparison between the measured feature sequence and the calibration feature sequence, the absolute position information of the object to be measured is determined; The image features of the calibration feature difference and the measured feature sequence include at least one of the average brightness of the image, the standard deviation of the image, the sum of the absolute values of the pixel differences of the image, and the correlation coefficient of the image.
2. The absolute position encoder according to claim 1, characterized in that: When the absolute position encoder is in the calibration mode, the processing unit is further configured to: Obtaining calibration displacement data of the object to be measured according to the difference between two frames of images in the calibration image sequence; Based on the calibration displacement data and the actual movement of the object under test, the division data is determined.
3. The absolute position encoder according to claim 1, characterized in that: Taking the position of the object under test corresponding to the reference image frame as the starting position, the object under test moves periodically; When there is a frame in the calibration image sequence whose calibration feature difference with respect to the reference image frame is not greater than a preset first threshold, determining that the object under test completes a cycle of movement and returns to the starting position; The calibration time series at least includes one cycle of the movement of the object being measured.
4. The absolute position encoder according to claim 1, characterized in that: Based on the comparison between the measured feature sequence and the calibration feature sequence, the step of determining the absolute position information of the object under test includes: Comparing the correlation coefficient between the measured feature sequence and the calibration feature sequence, if the correlation coefficient is not less than a preset second threshold, determining the portion of the calibration feature sequence corresponding to the measured feature sequence as the current process frame sequence; According to the image frame sequence in the calibration image sequence corresponding to the current process frame sequence, the absolute position information of the object to be measured relative to the image sensor is determined.
5. The absolute position encoder according to claim 1, characterized in that: The processing unit is further configured to obtain the relative displacement data of the measured object corresponding to the measured time series; and obtain the basic absolute position information of the measured object at a previous moment of the measured time series; Based on the comparison between the measured feature sequence and the calibration feature sequence, the step of determining the absolute position information of the object under test includes: The correlation coefficient of the measured feature sequence is compared with the calibration feature sequence. If the correlation coefficient is less than a preset second threshold, the sum of the basic absolute position information and the relative displacement data is determined as the absolute position information of the object under test.
6. The absolute position encoder according to claim 1, characterized in that: When the absolute position encoder is in the measurement mode, the processing unit is further configured to: Repeat the shooting and comparing steps for multiple times, and accumulate the number of matches; wherein the shooting and comparing steps include respectively comparing the difference of measured feature difference between each frame image captured by the image sensor and the reference image frame; if there is a frame image whose difference of measured feature difference between the reference image frame and the reference image frame is not greater than a preset third threshold, then record the number of matches once; When the accumulated number of matches is greater than a preset fourth threshold, the reference image frame is updated to an image whose difference in the current shooting and comparison step is not greater than the third threshold, and the number of matches is reset to zero.
7. The absolute position encoder according to claim 6, characterized in that: After the reference image frame is updated, multiple frames of images subsequently captured by the image sensor are compared with the updated reference image frame to calculate a feature sequence, and the calculated feature sequence is used to replace and update the calibration feature sequence.
8. The absolute position encoder according to claim 1, characterized in that: The processing unit is further configured to calculate the measured displacement data or measured velocity data of the object under test according to the difference between the two frames of images taken by the image sensor; and the step of obtaining the corresponding measured feature sequence based on the image taken by the image sensor also includes: When the movement mode of the measured object is different from that in the calibration mode, the measured feature sequence is corrected by using the measured displacement data or the measured velocity data.
9. A method for determining an absolute position, characterized in that: include: Shooting according to a preset calibration time sequence to obtain a calibration image sequence of the object being measured moving in a preset manner; Selecting a frame of image in the calibration image sequence as a reference image frame; obtaining calibration feature differences of each frame of image in the calibration image sequence relative to the reference image frame; and arranging the calibration feature differences corresponding to the calibration time series to obtain a calibration feature sequence; The object to be measured is photographed according to a preset measured time sequence; the measured feature difference of each frame image obtained by the image sensor relative to the reference image frame is obtained; the measured feature difference is sorted according to the measured time sequence to obtain a measured feature sequence; and the absolute position information of the object to be measured is determined based on the comparison between the measured feature sequence and the calibration feature sequence; The image features of the calibration feature difference and the measured feature sequence include at least one of the average brightness of the image, the standard deviation of the image, the sum of the absolute values of the pixel differences of the image, and the correlation coefficient of the image.
