Method and apparatus for correcting multi-channel optical signals of an encoder, and electronic device
By constructing light intensity-position and light intensity-delay mapping tables in the encoder, the accuracy error problem of the encoder during high-speed motion is solved, high-precision measurement is achieved, and costs are reduced.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SUZHOU OPTICAL CODE FUTURE INTELLIGENT TECHNOLOGY CO LTD
- Filing Date
- 2026-03-27
- Publication Date
- 2026-05-29
AI Technical Summary
Existing encoders suffer from excessive accuracy errors due to feedback delays from multiple optical signals during high-speed operation. Current hardware optimization methods cannot completely eliminate nonlinear characteristics, thus affecting measurement accuracy.
By constructing a standard light intensity-position mapping table under slow measurement conditions and forming a target light intensity-delay mapping table under high-speed conditions, the historical light signal intensity and position information are obtained using the measurement master unit, and the relative delay is calculated to achieve real-time signal correction.
It significantly improves the measurement accuracy of the encoder under high-speed motion, reduces hardware costs, has wide applicability, and does not change the encoder hardware structure.
Smart Images

Figure CN122108208A_ABST
Abstract
Description
Technical Field
[0001] This specification relates to the field of optical sensor measurement and control technology, and in particular to a method for correcting multi-channel optical signals of an encoder. Background Technology
[0002] Existing encoders generally suffer from feedback delay. Taking infrared phototransistors as an example, when the transmitting lamp is lit, the signal rise rate varies with the signal intensity as the receiving lamp receives the signal and the signal rises to a stable value. In systems requiring multi-channel optical signal coordination, especially those demanding high precision, the accuracy loss caused by this delay variation is negligible during slow motion. However, during high-speed motion, such as when the encoder rotates at high speed, the signal blockage caused by this delay variation increases significantly with increasing speed. Compared to the signal combination at low speeds, the combination of multiple signals exhibits a discrete distribution trend based on the relative delays between the signals. The higher the speed, the higher the dispersion, leading to excessive measurement errors for the encoder at high speeds. Therefore, it is necessary to improve the encoder's accuracy. However, current accuracy improvement methods often involve hardware performance enhancements such as using faster-responding photosensitive devices and optimizing front-end analog circuits. These methods are limited by component costs and physical limitations and cannot completely eliminate the nonlinear characteristics of delay variation with intensity, thus reducing user satisfaction. Summary of the Invention
[0003] This application provides a method, apparatus, and electronic device for correcting multi-channel optical signals in an encoder, the technical solution of which is as follows:
[0004] In a first aspect, embodiments of this application provide a method for correcting multiple optical signals of an encoder, the method comprising:
[0005] The encoder is set to a slow measurement state. A standard light intensity-position mapping table is constructed based on the historical light signal intensity and historical position information of each signal path in the encoder at each sampling time. The slow measurement state is used to characterize that the encoder speed is less than a first preset speed. The historical position information is obtained by a measurement machine that rotates coaxially with the encoder.
[0006] The encoder is set to a high-speed measurement state. Based on the standard light intensity-position mapping table, the target position information corresponding to each target light signal intensity obtained by the encoder in the high-speed measurement state is queried. The target light intensity-delay mapping table corresponding to each signal path is determined according to each target position information. The high-speed measurement state is used to characterize that the encoder speed is greater than the second preset speed.
[0007] For any real-time signal light intensity corresponding to any signal path acquired in the encoder, the target delay corresponding to the real-time signal light intensity is determined based on the target light intensity-delay mapping table, and the target corrected light intensity of the signal path corresponding to the real-time signal light intensity is determined based on the target delay.
[0008] Secondly, a multi-channel optical signal correction device for an encoder is provided, the device comprising:
[0009] The mapping module is used to set the encoder to a slow measurement state and construct a standard light intensity-position mapping table based on the historical light signal intensity and historical position information of each signal path in the encoder at each sampling time. The slow measurement state is used to characterize that the encoder speed is less than a first preset speed. The historical position information is obtained by a measurement machine that rotates coaxially with the encoder.
[0010] The determination module is used to set the encoder to a high-speed measurement state, query the target position information corresponding to each target light signal intensity obtained by the encoder in the high-speed measurement state based on the standard light intensity-position mapping table, and determine the target light intensity-delay mapping table corresponding to each signal path according to each target position information. The high-speed measurement state is used to characterize that the encoder speed is greater than a second preset speed.
[0011] The correction module is used to determine the target delay corresponding to the real-time signal light intensity based on the target light intensity-delay mapping table for any signal light intensity corresponding to the real-time signal light intensity obtained in the encoder, and to determine the target corrected light intensity of the signal path corresponding to the real-time signal light intensity based on the target delay.
[0012] Thirdly, an electronic device is provided, including a device processor and a memory;
[0013] The device processor is connected to the memory;
[0014] The memory is used to store executable program code;
[0015] The device processor runs a program corresponding to the executable program code stored in the memory to perform the steps of the method provided as in the first aspect or any possible implementation thereof.
[0016] Fourthly, a computer-readable storage medium is provided having a computer program stored thereon, the computer-readable storage medium storing instructions that, when executed on a computer or device processor, cause the computer or device processor to perform the method provided as in the first aspect or any possible implementation thereof.
[0017] The beneficial effects of the technical solutions provided in some embodiments of this application include at least the following:
[0018] In one or more embodiments of this application, by introducing a master measuring unit as an external reference, a precise mapping relationship between signal strength and absolute position is established at extremely low speeds, thereby obtaining the theoretical position reference for each signal path under different intensities. Based on this, using sampling data at high speeds, the relative delay of each signal path under different intensities is accurately determined by calculating the ratio of the theoretical position difference between different signal paths at the same moment to the rotational speed, forming a storable target light intensity-delay mapping table. In practical applications, the encoder no longer needs to rely on the master unit; it only needs to look up the corresponding delay value in the mapping table based on the real-time sampled light intensity, and then perform real-time compensation and correction on the sampled value in conjunction with the signal change rate, effectively eliminating position calculation errors caused by signal delay. This method not only significantly improves the measurement accuracy of the encoder under high-speed motion but also does not change the existing encoder hardware structure, being implemented only through algorithms, and has the advantages of low cost, easy integration, and wide applicability. Attached Figure Description
[0019] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0020] Figure 1 A flowchart illustrating a multi-channel optical signal correction method for an encoder provided in this application embodiment;
[0021] Figure 2 This is a schematic diagram of the structure of a multi-channel optical signal correction device for an encoder provided in an embodiment of this application;
[0022] Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0023] The technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings.
[0024] The terms "first," "second," "third," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish different objects, not to describe a specific order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or apparatuses.
[0025] The following description provides examples and does not limit the scope, applicability, or examples set forth in the claims. Changes may be made to the function and arrangement of the described elements without departing from the scope of this application. Various processes or components may be appropriately omitted, substituted, or added to the examples. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Furthermore, features described with respect to some examples may be combined into other examples.
[0026] Please see Figure 1 , Figure 1 The diagram shows an overall flowchart of a multi-channel optical signal correction method for an encoder provided in an embodiment of this application.
[0027] like Figure 1 As shown, the multi-channel optical signal correction method of this encoder may include at least the following steps:
[0028] Step 101: Set the encoder to slow measurement mode and construct a standard light intensity-position mapping table based on the historical light signal intensity and historical position information of each signal path in the encoder at each sampling time.
[0029] The slow measurement state is used to indicate that the encoder speed is less than a first preset speed, and the historical position information is obtained by a measurement machine that rotates coaxially with the encoder.
[0030] In this embodiment, the encoder is equipped with multiple sets of infrared photodiodes, each forming a signal path to receive signal light intensity. However, during the process from receiving the signal to its stable value, the signal rise rate varies with the signal intensity, resulting in a feedback delay. When the encoder moves at high speed, the signal obstruction accuracy error caused by this feedback delay is amplified, leading to a significant loss of accuracy. Therefore, to improve the position measurement accuracy of the encoder under high-speed rotation conditions, it is necessary to correct the multi-channel optical signals of the encoder.
[0031] Specifically, the encoder can be set to a slow-speed measurement state. Since slow-speed measurement means the encoder operates at extremely low speeds (e.g., 3 r / min), the position error caused by signal delay is negligible due to the extremely small angular velocity. Therefore, it can be approximated that there is a one-to-one correspondence between the light signal intensity at that sampling moment and the encoder's current physical position. The encoder under test is coaxially connected to the measurement machine via a rigid coupling, ensuring complete synchronous rotation. During slow rotation, the signal receiving tubes inside the encoder under test (e.g., A, B, and Z phase signal receiving tubes) collect the current light signal intensity at a fixed sampling frequency, while the measurement machine synchronously outputs its current position coordinates. Because the two are coaxial and move synchronously, the position coordinates of the measurement machine represent the actual physical position of the encoder under test at that moment. By continuously collecting data over multiple rotations (e.g., 3-5 rotations), a large number of discrete sampling points covering the full range from 0° to 360° can be obtained. For each signal path, the sampled optical signal intensity is stored in a one-to-one correspondence with the position coordinates output by the master unit, thus initially establishing the intensity-position correspondence for that signal path. Through the above steps, a delay-free "signal intensity-true position" benchmark is established under negligible delay conditions, providing a reliable query basis for subsequently using intensity to deduce position under high-speed conditions.
[0032] In one possible implementation, the step of constructing a standard light intensity-position mapping table based on the historical optical signal intensity and historical position information corresponding to each signal path in the encoder at each sampling time includes:
[0033] The historical optical signal intensity of each signal path at each sampling time is obtained based on each signal receiving tube in the encoder.
[0034] Based on the aforementioned measurement machine, historical location information of each signal path at each sampling time is obtained;
[0035] Based on the timestamp alignment method, the intensity of each historical optical signal is mapped to the historical location information to obtain a standard light intensity-location mapping table.
[0036] In this embodiment, the historical optical signal intensity of each signal path at each sampling moment can be obtained first from the signal receiving tubes in the encoder. Then, the historical position information of each signal path at each sampling moment can be obtained through the measurement machine that rotates coaxially with the encoder. Since the encoder under test and the measurement machine are two independent measurement systems, a unified time reference is required to align their data. Specifically, based on the timestamp alignment method, the position of the measurement machine and the corresponding timestamp are recorded simultaneously with the optical signal intensity. After sampling, the optical signal intensity with the same timestamp is paired and mapped with the position information of the measurement machine through timestamp matching to obtain a standard optical intensity-position mapping table. Through the above method, it can be ensured that the correspondence between each set of intensity and position comes from the same physical moment, thereby eliminating the additional error introduced by asynchronous sampling and laying a reliable data foundation for subsequent high-precision delay measurement.
[0037] Step 103: Set the encoder to high-speed measurement state, query the target position information corresponding to each target light signal intensity obtained by the encoder in the high-speed measurement state based on the standard light intensity-position mapping table, and determine the target light intensity-delay mapping table corresponding to each signal path according to each target position information.
[0038] The high-speed measurement state is used to characterize that the encoder speed is greater than the second preset speed, and the second preset speed is greater than the first preset speed.
[0039] In this embodiment, the encoder is set to a high-speed measurement state. In this state, the encoder rotation speed is greater than a second preset rotation speed, which is significantly greater than a first preset rotation speed. For example, the encoder rotation speed can be set to 3000 r / min. First, the intensity of each target optical signal acquired by the encoder in this high-speed measurement state is obtained. Then, the intensity of each target optical signal is looked up in a standard light intensity-position mapping table to obtain the corresponding target position information. Theoretically, the target position information should be nearly identical. However, due to signal delay, the target position information is not equal to the actual physical position at that moment, but only reflects the position of the signal at a certain point in the past. This results in differences between the target position information, and these differences are proportional to their relative delay. Therefore, by analyzing these position differences in a large amount of frame data and combining them with the known rotation speed, the relative delay value of each signal at different intensities can be calculated step by step, ultimately forming a target light intensity-delay mapping table.
[0040] In one possible implementation, determining the target light intensity-delay mapping table corresponding to each signal path based on the target location information includes:
[0041] Determine the encoder rotation speed corresponding to the high-speed measurement state;
[0042] Based on the target position information and the measured encoder rotation speed, a target light intensity-delay mapping table corresponding to each signal path is determined.
[0043] In this embodiment, the position difference value output by the measuring machine is directly read, and the angle change per unit time is calculated to determine the measuring encoder speed r corresponding to the high-speed measuring state. Then, under high-speed constant speed, r can be considered stable in a short time. The difference value corresponding to each target position information contains time delay information. Therefore, the position information difference can be determined through each target position information. The relative delay between each signal path is calculated through the linear relationship between the position information difference, the measuring encoder speed, and the relative delay. Finally, each relative delay is paired and mapped one-to-one with each target optical signal intensity to obtain a target optical intensity-delay mapping table.
[0044] In one possible implementation, determining the target light intensity-delay mapping table corresponding to each signal path based on the target position information and the measured encoder rotation speed includes:
[0045] For any two signal paths in each of the signal paths, the position information difference is determined based on the target position information corresponding to each of the two signal paths;
[0046] The relative delay between any two signal paths is determined based on the difference in position information and the ratio of the measured encoder rotation speed.
[0047] Based on the relative delay of each group, a target light intensity-delay mapping table corresponding to each signal path is determined.
[0048] In this embodiment of the application, when specifically calculating the relative delay, for each frame of data, all signal paths at the rising or falling edge are selected (because only the intensity at the edge can uniquely correspond to a position, while the intensity at the top or bottom corresponds to multiple possible positions, which cannot be looked up in a table). Therefore, for any two signal paths i and j in each signal path, their target position information is obtained by querying the standard light intensity-position mapping table. and Next, confirm. and Location information difference between Furthermore, based on the following formula, the relative delay between the two signal paths is determined by the ratio of the position information difference to the encoder rotation speed measurement. :
[0049]
[0050] in, Let i be the delay of signal path i relative to signal path j. denoted as the position information difference, and r is the measured encoder rotation speed.
[0051] Finally, each relative delay is paired and mapped with each target optical signal intensity to obtain a target optical intensity-delay mapping table.
[0052] In one possible implementation, determining the target light intensity-delay mapping table corresponding to each of the signal paths based on the relative delays of each group includes:
[0053] The calculated delay for each signal path is determined based on the relative delay and the initial set delay of each group.
[0054] The target light signal intensity and the calculated delay corresponding to each of the signal paths are mapped to obtain a target light intensity-delay mapping table.
[0055] In this embodiment, a storage unit is first allocated in memory for each possible intensity value of each signal to store the delay value at that intensity. Initially, all delay values are set to a large number (e.g., 0x7FFFFFFF) to represent unknown values. Then, a reference point is selected. Typically, the intermediate intensity (e.g., intensity 50) of the first signal (e.g., phase A) can be chosen as the reference zero point, i.e., let... The choice of this reference point is arbitrary because the delay is relative, and the final mapping table will be normalized. Then, for each frame of high-speed sampled data, the following relationship can be obtained:
[0056]
[0057] If in the above formula It is known that If it is unknown, it can be calculated. The value is then stored in the corresponding position in the delay table. Similarly, iterative calculations are performed, traversing all relationships across all frames, continuously using known values to deduce unknown values, until the calculated delay for all signal paths is relative to the reference zero point. The relative delay allows us to find the minimum value in the entire table. And subtract each computation delay This process makes all delays non-negative, and after processing, all normalized delays become non-negative. Finally, the target light signal intensity and normalized delay corresponding to each signal path are mapped and paired one-to-one to obtain the target light intensity-delay mapping table.
[0058] In one possible implementation, the first preset rotational speed is not greater than 10 r / min, and the second preset rotational speed is not less than 1000 r / min.
[0059] In this embodiment, to ensure that the angle error caused by signal delay is negligible during the low-speed meter building phase, the first preset rotational speed is set to no more than 10 r / min; for example, the first preset rotational speed can be set to 3 r / min. Meanwhile, to generate a sufficiently large delay difference during the high-speed phase that can be distinguished by the measurement system, the second preset rotational speed can be set to no less than 1000 r / min; for example, the second preset rotational speed can be set to 3000 r / min.
[0060] Step 105: For any real-time signal light intensity obtained in the encoder, determine the target delay corresponding to the real-time signal light intensity based on the target light intensity-delay mapping table, and determine the target corrected light intensity of the signal path corresponding to the real-time signal light intensity based on the target delay.
[0061] In this embodiment, once the target light intensity-delay mapping table is obtained, i.e., after the encoder has completed calibration and is put into actual operation, it will work independently and no longer require measurement of the host machine. During operation, the encoder collects the real-time light intensity values of each signal at a fixed sampling frequency. For each sampling point of each signal, the target light intensity-delay mapping table is first consulted based on its current light intensity value to obtain the delay time corresponding to that intensity. ,
[0062] The delay time This indicates the delay of the signal path relative to the reference zero point at the current intensity. Next, due to the delay, the current sampled value is actually the signal value at a past moment. Therefore, based on the signal's changing trend, the sampled value needs to be "overlooked" by a delay time to estimate the current real-time signal value. The target correction intensity corresponding to the real-time signal intensity is then determined using the target delay.
[0063] In one possible implementation, determining the target corrected light intensity of the signal path corresponding to the real-time signal light intensity based on the target delay includes:
[0064] Determine the signal sampling difference and sampling time difference corresponding to the real-time signal light intensity of the signal path, and calculate the sampling ratio between the signal sampling difference and the sampling time difference;
[0065] The sampling ratio and the target delay are multiplied to obtain the target corrected light intensity corresponding to the real-time signal light intensity of the signal path.
[0066] In this embodiment, when determining the target corrected light intensity of the signal path corresponding to the real-time signal light intensity based on the target delay, the signal sampling difference and sampling time difference of the signal path corresponding to the real-time signal light intensity can be determined first, and the sampling ratio between the signal sampling difference and the sampling time difference can be calculated. Then, the sampling ratio and the target delay are multiplied to obtain the target corrected light intensity of the signal path corresponding to the real-time signal light intensity, as shown in the following formula:
[0067]
[0068] in, Adjust the light intensity for the target. The original light intensity value sampled in the current frame. This is the original light intensity value sampled from the previous frame. The frame sampling interval time. Delayed for the target, with current light intensity The target light intensity-delay mapping table is obtained by querying it.
[0069] The foregoing has described specific embodiments of this application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired results. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0070] Please refer to the following. Figure 2 , Figure 2 A schematic diagram of a multi-channel optical signal correction device for an encoder provided in an embodiment of this application is shown. It should be noted that... Figure 2 The multi-channel optical signal correction device of the encoder shown is used to perform the present application. Figure 1 The methods shown in the embodiments are illustrated for ease of explanation, showing only the parts relevant to the embodiments of this application. For specific technical details not disclosed, please refer to this application. Figure 1 The example shown.
[0071] like Figure 2 As shown, the multi-channel optical signal correction device of the encoder may include at least:
[0072] The mapping module 201 is used to set the encoder to a slow measurement state and construct a standard light intensity-position mapping table based on the historical light signal intensity and historical position information of each signal path in the encoder at each sampling time. The slow measurement state is used to characterize that the encoder speed is less than a first preset speed. The historical position information is obtained by a measurement machine that rotates coaxially with the encoder.
[0073] The determination module 202 is used to set the encoder to a high-speed measurement state, query the target position information corresponding to each target light signal intensity obtained by the encoder in the high-speed measurement state based on the standard light intensity-position mapping table, and determine the target light intensity-delay mapping table corresponding to each signal path according to each target position information. The high-speed measurement state is used to characterize that the encoder rotation speed is greater than a second preset rotation speed, and the second preset rotation speed is greater than the first preset rotation speed.
[0074] The correction module 203 is used to determine the target delay corresponding to the real-time signal light intensity based on the target light intensity-delay mapping table for any real-time signal light intensity corresponding to any signal path obtained in the encoder, and to determine the target corrected light intensity of the signal path corresponding to the real-time signal light intensity based on the target delay.
[0075] In one possible implementation, the mapping module 201 is specifically used for:
[0076] The historical optical signal intensity of each signal path at each sampling time is obtained based on each signal receiving tube in the encoder.
[0077] Based on the aforementioned measurement machine, historical location information of each signal path at each sampling time is obtained;
[0078] Based on the timestamp alignment method, the intensity of each historical optical signal is mapped to the historical location information to obtain a standard light intensity-location mapping table.
[0079] In one possible implementation, the determining module 202 is specifically used for:
[0080] Determine the encoder rotation speed corresponding to the high-speed measurement state;
[0081] Based on the target position information and the measured encoder rotation speed, a target light intensity-delay mapping table corresponding to each signal path is determined.
[0082] In one possible implementation, the determining module 202 is further configured to:
[0083] For any two signal paths in each of the signal paths, the position information difference is determined based on the target position information corresponding to each of the two signal paths;
[0084] The relative delay between any two signal paths is determined based on the difference in position information and the ratio of the measured encoder rotation speed.
[0085] Based on the relative delay of each group, a target light intensity-delay mapping table corresponding to each signal path is determined.
[0086] In one possible implementation, the determining module 202 is further configured to:
[0087] The calculated delay for each signal path is determined based on the relative delay and the initial set delay of each group.
[0088] The target light signal intensity and the calculated delay corresponding to each of the signal paths are mapped to obtain a target light intensity-delay mapping table.
[0089] In one possible implementation, the determining module 202 is further configured to:
[0090] The first preset speed is no greater than 10 r / min, and the second preset speed is no less than 1000 r / min.
[0091] In one possible implementation, the correction module 203 is specifically used for:
[0092] Determine the signal sampling difference and sampling time difference corresponding to the real-time signal light intensity of the signal path, and calculate the sampling ratio between the signal sampling difference and the sampling time difference;
[0093] The sampling ratio and the target delay are multiplied to obtain the target corrected light intensity corresponding to the real-time signal light intensity of the signal path.
[0094] Those skilled in the art will clearly understand that the technical solutions of the embodiments of this application can be implemented by means of software and / or hardware. In this application, "unit" and "module" refer to software and / or hardware that can independently complete or cooperate with other components to complete a specific function, wherein the hardware may be, for example, a field-programmable gate array (FPGA), an integrated circuit (IC), etc.
[0095] Each processing unit and / or module in the embodiments of this application can be implemented by an analog circuit that implements the functions described in the embodiments of this application, or by software that executes the functions described in the embodiments of this application.
[0096] Please refer to the following. Figure 3 , Figure 3 A schematic diagram of the structure of an electronic device provided in an embodiment of this application is shown.
[0097] like Figure 3 As shown, the electronic device 300 may include at least one device processor 301, at least one network interface 304, a user interface 303, a memory 305, and at least one communication bus 302.
[0098] The communication bus 302 can be used to realize the connection and communication of the above components.
[0099] The user interface 303 may include buttons, and the optional user interface may also include a standard wired interface or a wireless interface.
[0100] The network interface 304 may include, but is not limited to, Bluetooth modules, NFC modules, Wi-Fi modules, etc.
[0101] The device processor 301 may include one or more processing cores. The device processor 301 connects to various parts within the electronic device 300 using various interfaces and lines. It executes various functions and processes data of the electronic device 300 by running or executing instructions, programs, code sets, or instruction sets stored in the memory 305, and by calling data stored in the memory 305. Optionally, the device processor 301 may be implemented using at least one hardware form of DSP, FPGA, or PLA. The device processor 301 may integrate one or more of the following: CPU, GPU, and modem. The CPU primarily handles the operating system, user interface, and applications; the GPU is responsible for rendering and drawing the content required for display; and the modem handles wireless communication. It is understood that the modem may also not be integrated into the device processor 301 and may be implemented as a separate chip.
[0102] The memory 305 may include RAM or ROM. Optionally, the memory 305 may include a non-transitory computer-readable medium. The memory 305 may be used to store instructions, programs, code, code sets, or instruction sets. The memory 305 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as touch function, sound playback function, image playback function, etc.), instructions for implementing the above-described method embodiments, etc.; the data storage area may store data involved in the above-described method embodiments, etc. Optionally, the memory 305 may also be at least one storage device located remotely from the aforementioned device processor 301. Figure 3 As shown, the memory 305, which serves as a computer storage medium, may include an operating system, a network communication module, a user interface module, and program instructions.
[0103] Specifically, the device processor 301 can call the encoder multi-channel optical signal correction application stored in the memory 305, and perform the following operations:
[0104] The encoder is set to a slow measurement state. A standard light intensity-position mapping table is constructed based on the historical light signal intensity and historical position information of each signal path in the encoder at each sampling time. The slow measurement state is used to characterize that the encoder speed is less than a first preset speed. The historical position information is obtained by a measurement machine that rotates coaxially with the encoder.
[0105] The encoder is set to a high-speed measurement state. Based on the standard light intensity-position mapping table, the target position information corresponding to each target light signal intensity obtained by the encoder in the high-speed measurement state is queried. The target light intensity-delay mapping table corresponding to each signal path is determined according to each target position information. The high-speed measurement state is used to characterize that the encoder speed is greater than the second preset speed, and the second preset speed is greater than the first preset speed.
[0106] For any real-time signal light intensity corresponding to any signal path acquired in the encoder, the target delay corresponding to the real-time signal light intensity is determined based on the target light intensity-delay mapping table, and the target corrected light intensity of the signal path corresponding to the real-time signal light intensity is determined based on the target delay.
[0107] As an optional embodiment of this application, the step of constructing a standard light intensity-position mapping table based on the historical light signal intensity and historical position information corresponding to each signal path in the encoder at each sampling time includes:
[0108] The historical optical signal intensity of each signal path at each sampling time is obtained based on each signal receiving tube in the encoder.
[0109] Based on the aforementioned measurement machine, historical location information of each signal path at each sampling time is obtained;
[0110] Based on the timestamp alignment method, the intensity of each historical optical signal is mapped to the historical location information to obtain a standard light intensity-location mapping table.
[0111] As an optional embodiment of this application, the step of determining the target light intensity-delay mapping table corresponding to each signal path based on the target location information includes:
[0112] Determine the encoder rotation speed corresponding to the high-speed measurement state;
[0113] Based on the target position information and the measured encoder rotation speed, a target light intensity-delay mapping table corresponding to each signal path is determined.
[0114] As an optional embodiment of this application, the step of determining the target light intensity-delay mapping table corresponding to each signal path based on the target position information and the measured encoder rotation speed includes:
[0115] For any two signal paths in each of the signal paths, the position information difference is determined based on the target position information corresponding to each of the two signal paths;
[0116] The relative delay between any two signal paths is determined based on the difference in position information and the ratio of the measured encoder rotation speed.
[0117] Based on the relative delay of each group, a target light intensity-delay mapping table corresponding to each signal path is determined.
[0118] As an optional embodiment of this application, the step of determining the target light intensity-delay mapping table corresponding to each signal path based on the relative delay of each group includes:
[0119] The calculated delay for each signal path is determined based on the relative delay and the initial set delay of each group.
[0120] The target light signal intensity and the calculated delay corresponding to each of the signal paths are mapped to obtain a target light intensity-delay mapping table.
[0121] As an optional embodiment of this application, the first preset rotational speed is not greater than 10 r / min, and the second preset rotational speed is not less than 1000 r / min.
[0122] As an optional embodiment of this application, determining the target corrected light intensity of the signal path corresponding to the real-time signal light intensity based on the target delay includes:
[0123] Determine the signal sampling difference and sampling time difference corresponding to the real-time signal light intensity of the signal path, and calculate the sampling ratio between the signal sampling difference and the sampling time difference;
[0124] The sampling ratio and the target delay are multiplied to obtain the target corrected light intensity corresponding to the real-time signal light intensity of the signal path.
[0125] This application also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps of the above-described method. The computer-readable storage medium may include, but is not limited to, any type of disk, including floppy disks, optical disks, DVDs, CD-ROMs, microdrives, as well as magneto-optical disks, ROMs, RAMs, EPROMs, EEPROMs, DRAMs, VRAMs, flash memory devices, magnetic cards or optical cards, nanosystems (including molecular memory ICs), or any type of medium or device suitable for storing instructions and / or data.
[0126] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application.
[0127] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.
[0128] In the several embodiments provided in this application, it should be understood that the disclosed apparatus can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some service interface; the indirect coupling or communication connection between devices or units may be electrical or other forms.
[0129] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0130] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0131] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage device (CMD). Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a memory and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned memory includes various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.
[0132] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, which may include: flash drive, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.
[0133] The foregoing has described specific embodiments of this application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired results. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
Claims
1. A method for correcting multi-channel optical signals in an encoder, characterized in that, The method includes: The encoder is set to a slow measurement state. A standard light intensity-position mapping table is constructed based on the historical light signal intensity and historical position information of each signal path in the encoder at each sampling time. The slow measurement state is used to characterize that the encoder speed is less than a first preset speed. The historical position information is obtained by a measurement machine that rotates coaxially with the encoder. The encoder is set to a high-speed measurement state. Based on the standard light intensity-position mapping table, the target position information corresponding to each target light signal intensity obtained by the encoder in the high-speed measurement state is queried. The target light intensity-delay mapping table corresponding to each signal path is determined according to each target position information. The high-speed measurement state is used to characterize that the encoder speed is greater than the second preset speed, and the second preset speed is greater than the first preset speed. For any real-time signal light intensity corresponding to any signal path acquired in the encoder, the target delay corresponding to the real-time signal light intensity is determined based on the target light intensity-delay mapping table, and the target corrected light intensity of the signal path corresponding to the real-time signal light intensity is determined based on the target delay.
2. The method according to claim 1, characterized in that, The construction of a standard light intensity-position mapping table based on the historical light signal intensity and historical position information of each signal path in the encoder at each sampling time includes: The historical optical signal intensity of each signal path at each sampling time is obtained based on each signal receiving tube in the encoder. Based on the aforementioned measurement machine, historical location information of each signal path at each sampling time is obtained; Based on the timestamp alignment method, the intensity of each historical optical signal is mapped to the historical location information to obtain a standard light intensity-location mapping table.
3. The method according to claim 1, characterized in that, The step of determining the target light intensity-delay mapping table corresponding to each signal path based on the target location information includes: Determine the encoder rotation speed corresponding to the high-speed measurement state; Based on the target position information and the measured encoder rotation speed, a target light intensity-delay mapping table corresponding to each signal path is determined.
4. The method according to claim 3, characterized in that, The step of determining the target light intensity-delay mapping table corresponding to each signal path based on the target position information and the measured encoder rotation speed includes: For any two signal paths in each of the signal paths, the position information difference is determined based on the target position information corresponding to each of the two signal paths; The relative delay between any two signal paths is determined based on the difference in position information and the ratio of the measured encoder rotation speed. Based on the relative delay of each group, a target light intensity-delay mapping table corresponding to each signal path is determined.
5. The method according to claim 4, characterized in that, The determination of the target light intensity-delay mapping table corresponding to each signal path based on the relative delay of each group includes: The calculated delay for each signal path is determined based on the relative delay and the initial set delay of each group. The target light signal intensity and the calculated delay corresponding to each of the signal paths are mapped to obtain a target light intensity-delay mapping table.
6. The method according to claim 1, characterized in that, The first preset speed is no greater than 10 r / min, and the second preset speed is no less than 1000 r / min.
7. The method according to claim 1, characterized in that, Determining the target corrected light intensity of the signal path corresponding to the real-time signal light intensity based on the target delay includes: Determine the signal sampling difference and sampling time difference corresponding to the real-time signal light intensity of the signal path, and calculate the sampling ratio between the signal sampling difference and the sampling time difference; The sampling ratio and the target delay are multiplied to obtain the target corrected light intensity corresponding to the real-time signal light intensity of the signal path.
8. A multi-channel optical signal correction device for an encoder, characterized in that, The device includes: The mapping module is used to set the encoder to a slow measurement state and construct a standard light intensity-position mapping table based on the historical light signal intensity and historical position information of each signal path in the encoder at each sampling time. The slow measurement state is used to characterize that the encoder speed is less than a first preset speed. The historical position information is obtained by a measurement machine that rotates coaxially with the encoder. The determination module is used to set the encoder to a high-speed measurement state, query the target position information corresponding to each target light signal intensity obtained by the encoder in the high-speed measurement state based on the standard light intensity-position mapping table, and determine the target light intensity-delay mapping table corresponding to each signal path according to each target position information. The high-speed measurement state is used to characterize that the encoder speed is greater than a second preset speed. The correction module is used to determine the target delay corresponding to the real-time signal light intensity based on the target light intensity-delay mapping table for any signal light intensity corresponding to the real-time signal light intensity obtained in the encoder, and to determine the target corrected light intensity of the signal path corresponding to the real-time signal light intensity based on the target delay.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method as described in any one of claims 1-7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, The computer-readable storage medium stores instructions that, when executed on a computer or processor, cause the computer or processor to perform the steps of the method as described in any one of claims 1-7.