Precision compensation method and device of magnetic encoder based on linear displacement detection
By performing equally spaced division and error calculation of the range calibration points of the magnetic encoder, a preset algorithm is used to determine the target moving output value, which solves the problem of low accuracy of the magnetic encoder in the detection process and achieves higher detection accuracy.
Patent Information
- Application Number
- CN202411481117.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-22
- Publication Date
- 2025-01-14
AI Technical Summary
The nonlinear errors generated by magnetic encoder during manufacturing and under the influence of environmental factors lead to low position detection accuracy, and accuracy compensation is required to improve measurement accuracy.
By dividing the reference total range of the moving part determined by the reference sensor at equal intervals, the reference output value and difference value of the range calibration point is obtained, and the target error and linear relationship are calculated using a preset algorithm to determine the magnetic encoder at the detection point. The target moves the output value for accuracy compensation.
Improves the accuracy of the magnetic encoder during the detection process, ensures that the moving output value in subsequent independent applications is more accurate, and reduces measurement errors.
Smart Images

Figure CN119309614A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of precision compensation of magnetic encoders, and in particular, to a precision compensation method and device for a magnetic encoder based on linear displacement detection. Background Art
[0002] The nonlinear error caused by errors in the manufacturing process, environmental factors, and installation of the magnetic encoder will lead to errors in the position calibration reading. If the accuracy compensation is not performed in the position detection of the servo motor to detect the linear displacement, it will cause measurement errors and low accuracy of the measurement results. Summary of the invention
[0003] The purpose of the embodiments of the present application is to provide a method and device for compensating the accuracy of a magnetic encoder based on linear displacement detection, so as to solve the above-mentioned problems existing in the prior art and improve the accuracy of the detection results.
[0004] In a first aspect, a method for compensating the accuracy of a magnetic encoder based on linear displacement detection is provided, and the method may include:
[0005] The reference total range of the moving part movement determined by the reference sensor is divided into equal intervals to obtain a preset number of range calibration points and a reference output value of each range calibration point;
[0006] Obtain the difference value corresponding to each range calibration point of the moving part;
[0007] Using a preset algorithm, the target reference output value of any detection point where the moving part is located, the first reference output value, the second reference output value, the first difference and the second difference corresponding to two adjacent range calibration points before and after the detection point are calculated to obtain a target error;
[0008] Based on the target error, the target reference output value and the linear relationship corresponding to the two adjacent range calibration points before and after the detection point, the target movement output value of the magnetic encoder at the detection point is determined; wherein the linear relationship is determined based on the reference output values corresponding to the two adjacent range calibration points and the displacement output values detected by the magnetic encoder at the two adjacent range calibration points.
[0009] In a possible implementation, the linear relationship is determined based on reference output values corresponding to two adjacent range calibration points and displacement output values detected by the magnetic encoder for the two adjacent range calibration points, including:
[0010] For any two adjacent first range calibration points and second range calibration points among the multiple range calibration points of the reference total range, the first reference output value of the first range calibration point and the first moving measurement output value of the first range calibration point detected by the magnetic encoder are used as starting coordinates;
[0011] Taking the second reference output value of the second range calibration point and the second moving output value of the second range calibration point detected by the magnetic encoder as the end point coordinates;
[0012] Based on the starting coordinates and the end coordinates, a linear relationship between the first range calibration point and the second range calibration point is determined.
[0013] In a possible implementation, determining the target movement output value of the magnetic encoder at the detection point based on the target error, the target reference output value, and the linear relationship corresponding to two range calibration points adjacent to and before the detection point includes:
[0014] Determine the difference between the target reference output value and the target error as the actual reference output value;
[0015] The target movement output value is determined according to the linear relationship between the actual reference output value and two range calibration points adjacent to and before the detection point.
[0016] In a possible implementation, obtaining the difference corresponding to each range calibration point of the moving part includes:
[0017] The sum of the reference output value of the calibration starting point among the multiple range calibration points and the configured increase value is determined as the theoretical value of the second range calibration point;
[0018] When the moving member moves to the second range calibration point, obtaining a target reference output value of the reference sensor detecting the second range calibration point;
[0019] Determine the difference between the target reference output value of the second range calibration point and the theoretical value of the second range calibration point as the difference value of the second range calibration point;
[0020] Determine the second range calibration point as a new calibration starting point, and return to the execution step: sum the reference output value of the calibration starting point among the multiple range calibration points and the added value to determine the theoretical value of the third range calibration point until the difference between the range calibration points is obtained.
[0021] In a possible implementation, the reference total range of the movement of the moving part determined by the reference sensor includes:
[0022] The reference output value of the reference sensor when detecting that the moving part is at the lowest position of the stroke is set to 0;
[0023] When the moving member moves to the highest position of the travel, obtaining the highest reference output value of the moving member at this position detected by the reference sensor;
[0024] The highest reference output value is determined as the reference total range.
[0025] In a possible implementation, the preset algorithm is:
[0026]
[0027] Among them, Q is the target reference output value, A1 is the first reference output value, A2 is the second reference output value, B1 is the first error value, B2 is the second error value, and E is the target error.
[0028] In a second aspect, a precision compensation device for a magnetic encoder based on linear displacement detection is provided, and the device may include:
[0029] A division unit, used for dividing the reference total range of the moving part movement determined by the reference sensor into equal intervals to obtain a preset number of range calibration points and a reference output value of each range calibration point;
[0030] An acquisition unit, used for acquiring the difference value corresponding to each range calibration point of the moving part;
[0031] A calculation unit, for calculating, by using a preset algorithm, a target reference output value of any detection point where the moving part is located, a first reference output value, a second reference output value, a first difference, and a second difference corresponding to two range calibration points adjacent to and before the detection point, to obtain a target error;
[0032] A determination unit is used to determine the target movement output value of the magnetic encoder at the detection point based on the target error, the target reference output value and the linear relationship corresponding to the two adjacent range calibration points before and after the detection point; wherein the linear relationship is determined based on the reference output values corresponding to the two adjacent range calibration points and the displacement output values detected by the magnetic encoder at the two adjacent range calibration points.
[0033] In a possible implementation, the determining unit is further configured to determine the linear relationship, including:
[0034] For any two adjacent first range calibration points and second range calibration points among the multiple range calibration points of the reference total range, the first reference output value of the first range calibration point and the first moving measurement output value of the first range calibration point detected by the magnetic encoder are used as starting coordinates;
[0035] Taking the second reference output value of the second range calibration point and the second moving output value of the second range calibration point detected by the magnetic encoder as the end point coordinates;
[0036] Based on the starting coordinates and the end coordinates, a linear relationship between the first range calibration point and the second range calibration point is determined.
[0037] In a third aspect, an electronic device is provided, the electronic device comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;
[0038] Memory, used to store computer programs;
[0039] The processor is used to implement any method step described in the first aspect when executing the program stored in the memory.
[0040] In a fourth aspect, a computer-readable storage medium is provided, wherein a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, any method step described in the first aspect is implemented.
[0041] The present application provides a method for compensating the accuracy of a magnetic encoder based on linear displacement detection, the method comprising: dividing the reference total range of the movement of a moving part determined by a reference sensor into equal intervals to obtain a preset number of range calibration points and a reference output value of each range calibration point; obtaining the difference corresponding to the moving part at each range calibration point; using a preset algorithm, calculating the target reference output value of any detection point where the moving part is located, the first reference output value, the second reference output value, the first difference and the second difference corresponding to two range calibration points adjacent to and before the detection point, to obtain a target error; based on the target error, the target reference output value and the linear relationship corresponding to the two range calibration points adjacent to and before the detection point, determining the target movement output value of the magnetic encoder at the detection point; the method can calibrate the magnetic encoder used for the first time through the reference sensor to perform accuracy compensation on the magnetic encoder, so that the movement output value of the magnetic encoder in the subsequent independent application process is more accurate. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments of the present application will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0043] Figure 1A system architecture diagram of an accuracy compensation method for a magnetic encoder based on linear displacement detection provided in an embodiment of the present application;
[0044] Figure 2 A schematic flow chart of a method for compensating the accuracy of a magnetic encoder based on linear displacement detection provided in an embodiment of the present application;
[0045] Figure 3 A schematic diagram of a linear relationship provided in an embodiment of the present application;
[0046] Figure 4 A schematic diagram of the error between the target movement output value and the actual reference output value of the detection point provided in the embodiment of the present application;
[0047] Figure 5 A schematic structural diagram of a precision compensation device of a magnetic encoder based on linear displacement detection provided in an embodiment of the present application;
[0048] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0049] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments of the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0050] The precision compensation method of the magnetic encoder based on linear displacement detection provided in the embodiment of the present application can be applied in Figure 1 In the system architecture shown in Figure 1 As shown, the system may include: a server in the enterprise background, a reference sensor, a magnetic encoder to be compensated, and a terminal. The server may be a physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN), as well as basic cloud computing services such as big data and artificial intelligence platforms. The reference sensor, the magnetic encoder to be compensated, and the terminal may be directly or indirectly connected to the server through wired or wireless communication methods, which is not limited in this application.
[0051] The reference sensor is used to detect the reference total range of the moving part and the reference output value of each range calibration point, and send the reference total range and the reference output value of each range calibration point to the server.
[0052] The magnetic encoder to be compensated is used to detect the total displacement range of the moving part and send the total displacement range to the server.
[0053] The terminal is used for the staff to input the target reference output value of the detection point where the moving part is located, and send the target reference output value to the server.
[0054] The server is used to receive the reference total range, the reference output value of each range calibration point, the target reference output value of the detection point where the moving part is located, and the total displacement range, so as to execute the accuracy compensation method of the magnetic encoder for linear displacement detection provided in this application.
[0055] For ease of understanding, the terms involved in the embodiments of the present application are explained below:
[0056] A magnetic encoder (magnetic encoder chip) is a sensor that uses changes in magnetic field to detect the position of linear motion. It can be used to measure changes in linear position and provide accurate position feedback. Due to its advantages of high resolution and high data output rate, it is widely used in high-precision control fields such as servo systems and robotics, industrial equipment, automobiles, medical equipment, and consumer electronics.
[0057] Magnetic encoders usually contain magnetic sensors and signal processing circuits. These sensors can detect changes in magnetic field strength and direction related to position and convert these changes into electrical signals. The signal processing circuit is responsible for receiving these signals and performing operations such as analog-to-digital conversion, filtering, amplification, and digital signal processing to provide accurate position information. With the continuous development of industrial automation and intelligent manufacturing, magnetic encoder technology is also constantly improving. Magnetic encoder chips on the market are developing towards high resolution, high precision, miniaturization, integration, and higher efficiency.
[0058] During the manufacturing process, the magnetic encoder may have manufacturing errors such as uneven magnetic field distribution and inconsistent pole spacing, as well as improper installation position and method. There may be relative displacement, which will lead to measurement errors. The positioning accuracy and alignment errors during the installation process will also affect the measurement results.
[0059] Therefore, the present application actually provides a method for compensating the accuracy of a magnetic encoder based on linear displacement detection, which is used to solve the above-mentioned problems existing in the prior art and can improve the accuracy of the detection results.
[0060] The preferred embodiments of the present application are described below in conjunction with the drawings in the specification. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present application, and are not used to limit the present application. In addition, the embodiments and features in the embodiments of the present application may be combined with each other if there is no conflict.
[0061] Figure 2 The present invention provides a flowchart of a method for compensating the accuracy of a magnetic encoder based on linear displacement detection. Figure 2 As shown, the method may include:
[0062] Step S210, obtaining a reference total range detected by a reference sensor and a displacement total range detected by a magnetic encoder.
[0063] The reference sensor is a GT2-H12K high-precision displacement sensor, and the output value of the reference sensor is the actual moving distance of the moving part, in micrometers.
[0064] The reference sensor includes a shell and a probe connected to the lower surface of the shell; the shell of the reference sensor is fixed on the calibration device. During the calibration of the moving part on the workbench of the calibration device, one end of the moving part presses against the probe of the reference sensor, and the probe of the reference sensor moves up and down with the moving part, thereby detecting the position of the moving part in the calibration device.
[0065] The magnetic encoder and magnetic grating strip can detect the displacement of the linear position. The magnetic grating strip is also fixed on the moving part. When the moving part moves in a straight line, it will produce a magnetic field change relative to the magnetic encoder. According to the change in the magnetic field, the output value of the magnetic encoder is read to determine the position of the moving part.
[0066] Specifically, the reference sensor cooperates with the moving part to perform linear position calibration.
[0067] First, the reference output value of the reference sensor when the moving part is at the lowest position of the stroke is set (reset) to 0; at the same time, the lowest displacement output value X of the magnetic encoder when the moving part is at the lowest position of the stroke is obtained, and this position is determined as the calibration starting point.
[0068] Afterwards, the moving part is moved to the highest position of the stroke, and the highest displacement output value Y1 detected by the magnetic encoder when the moving part is at the highest position of the stroke is obtained; at the same time, the highest reference output value Y2 detected by the reference sensor when the moving part is at this position is obtained.
[0069] Based on the lowest displacement output value and the highest displacement output value, the total displacement range S1 is determined, where S1 = |Y1-X|.
[0070] Based on the highest reference output value, the reference total range S2 is determined, where S2=|Y2|.
[0071] For example: the lowest displacement output value X=53045; Y1=26613; Y2=4102.6; S1=|Y1-X|=26432, S2=|Y2|=4102.6.
[0072] Step S220, dividing the reference total range into equal intervals to obtain a preset number of range calibration points and a reference output value of each range calibration point.
[0073] Specifically, first, the preset number N of range calibration points is determined according to the size of the reference total range.
[0074] Afterwards, according to the preset number N of range calibration points and the total displacement range, the distance ds1 between two adjacent range calibration points is determined, ds1=S1 / N, ds is an integer; for example: set N to 240, ds1=S1 / N=110 (an integer).
[0075] It should be noted that in the actual process of controlling the movement of the moving part, the movement output value of the magnetic encoder needs to be set to control the movement of the moving part, that is, the movement output value of the magnetic encoder is used as the target value of the moving part position closed loop.
[0076] Afterwards, the moving output value of the magnetic encoder is used as the target value of the moving part position closed loop, starting from the calibration starting point of the range calibration point, the target value of the moving part position closed loop increases by ds1 each time a range calibration point is calibrated; when the moving part moves to each range calibration point, the reference output value of the reference sensor detecting any range calibration point is obtained, denoted as Ai, where i=0...240, to obtain an array A, A{A1, A2...A240} composed of the arrangement order of each range calibration point and the reference output value corresponding to each range calibration point.
[0077] Step S230: Determine the linear relationship between any two adjacent range calibration points according to the reference output value and the shift output value corresponding to each range calibration point.
[0078] Specifically, for any two adjacent first range calibration points W1 and second range calibration points W2 among the multiple range calibration points of the reference total range, the first reference output value X1 of the first range calibration point and the first moving measurement output value Y1 of the first range calibration point detected by the magnetic encoder are used as the starting coordinates;
[0079] The second reference output value X2 of the second range calibration point and the second moving output value Y2 of the second range calibration point detected by the magnetic encoder are used as the end point coordinates;
[0080] Based on the line connecting the first range calibration point W1, ie, the starting coordinate (X1, Y1) and the second range calibration point W2, ie, the end coordinate W2 (X2, Y2), the linear relationship between the first range calibration point and the second range calibration point is determined.
[0081] In the same way, the linear relationship between two adjacent range calibration points can be determined, that is, multiple (N-1) linear relationships are obtained.
[0082] Step S240, obtaining the difference corresponding to each range calibration point of the moving part.
[0083] Specifically, the sum of the reference output value of the calibration starting point among multiple range calibration points and the configured increase value is determined as the theoretical value of the second range calibration point; wherein the configured increase value ds2 is determined based on the number of range calibration points and the reference total range, ds2=S2 / N.
[0084] When the moving member moves to the second range calibration point, obtaining a target reference output value of the reference sensor detecting the second range calibration point;
[0085] The difference between the target reference output value of the second range calibration point and the theoretical value of the second range calibration point is determined as the difference value of the second range calibration point;
[0086] The second range calibration point is determined as a new calibration starting point, and the execution step is returned: the reference output value of the calibration starting point among the multiple range calibration points is summed with the added value to determine the theoretical value of the second range calibration point, until the difference between the range calibration points is obtained.
[0087] In short, the moving part is controlled to move to the calibration starting point, and then the displacement value of the moving part is set to Q. After each detection point is determined, Q increases by ds2, which means that the theoretical value of each range calibration point is determined.
[0088] Since the moving output value of the magnetic encoder needs to be set to control the movement of the moving part during the process of controlling the movement of the moving part: the binary search method is used to determine whether the Q corresponding to the range calibration point at this time is between two adjacent elements Aj and Aj+1 of the array A. Afterwards, the moving output value of the range calibration point is determined according to the linear relationship corresponding to Aj and Aj+1, so as to control the moving part to move to the range calibration point. Afterwards, the reference sensor detects the target reference output value of the range calibration point.
[0089] After determining the target reference output value and theoretical value of the range calibration point, the difference between the two is determined, that is, the difference value of the range calibration point is determined (which can also be understood as the detection error of the target reference output value output by the reference sensor at the range calibration point).
[0090] In the same way, the difference between the range calibration points can be determined to determine an array B, B{B1, B2...BN-1}, which is composed of the order of the range calibration points and the difference between the range calibration points.
[0091] Step S250, process the target reference output value of any detection point where the moving part is located, the first reference output value corresponding to the two adjacent range calibration points before and after the detection point, the second reference output value, the first difference, the second difference and the linear relationship corresponding to the two adjacent range calibration points before and after the detection point to obtain the target movement output value of the magnetic encoder to be compensated at the detection point.
[0092] Specifically, first, a preset algorithm is used to calculate the target reference output value of any detection point where the moving part is located, the first reference output value, the second reference output value, the first difference and the second difference corresponding to two adjacent range calibration points before and after the detection point to obtain the target error.
[0093] Specifically, the staff inputs the Q of the detection point corresponding to the target moving position of the moving part through the terminal. The Q is between Aj and Aj+1. Assuming j=1, at this time, A1 <Q<A2;
[0094] Obtaining a first reference output value and a second reference output value corresponding to two range calibration points adjacent to and before the detection point where the moving part is located, and a first difference value and a second difference value corresponding to two range calibration points adjacent to and before the detection point;
[0095] It can be understood that the subscript of the first difference value of the detection point in array B is the same as the subscript of the previous adjacent first range calibration point of the detection point; the subscript of the second difference value of the detection point in array B is the same as the subscript of the next adjacent second range calibration point of the detection point; therefore, the first difference is B1, and similarly the second difference is B2.
[0096] The default algorithm is:
[0097]
[0098] Among them, Q is the target reference output value, A1 is the first reference output value, A2 is the second reference output value, B1 is the first error value, B2 is the second error value, and E is the target error.
[0099] Afterwards, based on the target error, the target reference output value and the linear relationship corresponding to the two adjacent range calibration points before and after the detection point, the target movement output value of the magnetic encoder to be compensated at the detection point is determined;
[0100] Specifically, the difference between the target reference output value and the target error is determined as the actual reference output value F; the actual reference output value can be understood as the accuracy compensation value: F=QE.
[0101] The target moving output value is determined according to the linear relationship between the actual reference output value F and the two range calibration points adjacent to and before the detection point. That is, the moving output value corresponding to the actual reference output value F is found in the linear relationship between the two range calibration points adjacent to and before the detection point, and the moving output value is determined as the target moving output value.
[0102] In some embodiments, in combination Figure 4 As shown, after the accuracy compensation is done on the 240 range calibration points, the accuracy test is performed again. The reference total range S2 (take 4 mm) is divided by the number of test points M, M = 40. Each time a test point is tested, the difference between the actual reference output value output by the reference sensor and the target movement output value is recorded. Figure 4 As shown, the error is within 1 micron for every 100 micron step.
[0103] It can be understood that the above scheme is the accuracy compensation process of the magnetic encoder. In the subsequent practical application process, there is no need to use a reference sensor; the staff only needs to input the Q of the detection point corresponding to the target moving position of the moving part through the terminal. The server stores the data sent by the reference sensor, the reference total range calibration points of each range and multiple linear relationships, and then uses the preset algorithm to obtain the target error and further obtain the target movement output value of the magnetic encoder.
[0104] The present application provides a method for compensating the accuracy of a magnetic encoder based on linear displacement detection, the method comprising: dividing the reference total range of the movement of a moving part determined by a reference sensor into equal intervals to obtain a preset number of range calibration points and a reference output value of each range calibration point; obtaining the difference corresponding to the moving part at each range calibration point; using a preset algorithm, calculating the target reference output value of any detection point where the moving part is located, the first reference output value, the second reference output value, the first difference and the second difference corresponding to two range calibration points adjacent to and before the detection point, to obtain a target error; based on the target error, the target reference output value and the linear relationship corresponding to the two range calibration points adjacent to and before the detection point, determining the target movement output value of the magnetic encoder at the detection point; the method can calibrate the magnetic encoder used for the first time through the reference sensor to perform accuracy compensation on the magnetic encoder, so that the movement output value of the magnetic encoder in the subsequent independent application process is more accurate.
[0105] Corresponding to the above method, the embodiment of the present application also provides an accuracy compensation of a magnetic encoder based on linear displacement detection, such as Figure 5 As shown, the device comprises:
[0106] A division unit 510 is used to divide the reference total range of the moving part movement determined by the reference sensor into equal intervals to obtain a preset number of range calibration points and a reference output value of each range calibration point;
[0107] An acquisition unit 520 is used to acquire the difference corresponding to each range calibration point of the moving part;
[0108] The calculation unit 530 is used to calculate the target reference output value of any detection point where the moving part is located, the first reference output value, the second reference output value, the first difference and the second difference corresponding to two adjacent range calibration points before and after the detection point by using a preset algorithm to obtain a target error;
[0109] The determination unit 540 is used to determine the target movement output value of the magnetic encoder at the detection point based on the target error, the target reference output value and the linear relationship corresponding to the two adjacent range calibration points before and after the detection point; wherein the linear relationship is determined based on the reference output values corresponding to the two adjacent range calibration points and the displacement output values detected by the magnetic encoder at the two adjacent range calibration points.
[0110] The functions of the various functional units of the precision compensation device of the magnetic encoder based on linear displacement detection provided in the above-mentioned embodiments of the present application can be realized through the above-mentioned method steps. Therefore, the specific working process and beneficial effects of each unit in the precision compensation device of the magnetic encoder based on linear displacement detection provided in the embodiments of the present application will not be repeated here.
[0111] The present application also provides an electronic device, such as Figure 6 As shown, it includes a processor 610 , a communication interface 620 , a memory 630 and a communication bus 640 , wherein the processor 610 , the communication interface 620 , and the memory 630 communicate with each other via the communication bus 640 .
[0112] Memory 630, for storing computer programs;
[0113] The processor 610 is used to implement the following steps when executing the program stored in the memory 630:
[0114] The reference total range of the moving part movement determined by the reference sensor is divided into equal intervals to obtain a preset number of range calibration points and a reference output value of each range calibration point;
[0115] Obtain the difference value corresponding to each range calibration point of the moving part;
[0116] Using a preset algorithm, the target reference output value of any detection point where the moving part is located, the first reference output value, the second reference output value, the first difference and the second difference corresponding to two adjacent range calibration points before and after the detection point are calculated to obtain a target error;
[0117] Based on the target error, the target reference output value and the linear relationship corresponding to the two adjacent range calibration points before and after the detection point, the target movement output value of the magnetic encoder at the detection point is determined; wherein the linear relationship is determined based on the reference output values corresponding to the two adjacent range calibration points and the displacement output values detected by the magnetic encoder at the two adjacent range calibration points.
[0118] The communication bus mentioned above can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0119] The communication interface is used for communication between the above electronic device and other devices.
[0120] The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0121] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0122] The implementation methods and beneficial effects of the components of the electronic device in the above embodiments to solve the problems can be seen in Figure 2 The various steps in the illustrated embodiment are implemented, therefore, the specific working process and beneficial effects of the electronic device provided by the embodiment of the present application are not repeated here.
[0123] In another embodiment provided in the present application, a computer-readable storage medium is also provided, in which instructions are stored. When the computer-readable storage medium is run on a computer, the computer executes the accuracy compensation method of a magnetic encoder based on linear displacement detection described in any of the above embodiments.
[0124] In another embodiment provided in the present application, a computer program product comprising instructions is also provided, which, when executed on a computer, enables the computer to execute the accuracy compensation method of a magnetic encoder based on linear displacement detection as described in any of the above embodiments.
[0125] Those skilled in the art will appreciate that the embodiments in the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt a complete hardware embodiment, a complete software embodiment, or a form of an embodiment combining software and hardware. Moreover, the present application may adopt a form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0126] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0127] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0128] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0129] Unless otherwise defined, the technical terms or scientific terms used in this application should be understood by people with ordinary skills in the field to which the present invention belongs. "First", "second" and similar words used in this application do not indicate any order, quantity or importance, but are only used to distinguish different components. "Include" or "comprise" and similar words mean that the elements or objects appearing before the word cover the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connect", "couple" or "connected" and similar words are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the described object changes, the relative positional relationship may also change accordingly.
[0130] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they are aware of the basic creative concepts. Therefore, the present application embodiments are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present application embodiments.
[0131] Obviously, those skilled in the art can make various changes and modifications to the embodiments in the present application without departing from the spirit and scope of the embodiments in the present application. Thus, if these modifications and variations of the embodiments in the present application are within the scope of the embodiments in the present application and their equivalents, the embodiments in the present application are also intended to include these modifications and variations.
Claims
1. A method for compensating the accuracy of a magnetic encoder based on linear displacement detection, characterized in that: The method comprises: The reference total range of the moving part movement determined by the reference sensor is divided into equal intervals to obtain a preset number of range calibration points and a reference output value of each range calibration point; Obtain the difference value corresponding to each range calibration point of the moving part; Using a preset algorithm, the target reference output value of any detection point where the moving part is located, the first reference output value, the second reference output value, the first difference and the second difference corresponding to two adjacent range calibration points before and after the detection point are calculated to obtain a target error; Based on the target error, the target reference output value and the linear relationship corresponding to the two adjacent range calibration points before and after the detection point, the target movement output value of the magnetic encoder at the detection point is determined; wherein the linear relationship is determined based on the reference output values corresponding to the two adjacent range calibration points and the displacement output values detected by the magnetic encoder at the two adjacent range calibration points.
2. The method according to claim 1, characterized in that The linear relationship is determined based on reference output values corresponding to two adjacent range calibration points and displacement output values detected by the magnetic encoder for the two adjacent range calibration points, including: For any two adjacent first range calibration points and second range calibration points among the multiple range calibration points of the reference total range, the first reference output value of the first range calibration point and the first moving measurement output value of the first range calibration point detected by the magnetic encoder are used as starting coordinates; Taking the second reference output value of the second range calibration point and the second moving output value of the second range calibration point detected by the magnetic encoder as the end point coordinates; Based on the starting coordinates and the end coordinates, a linear relationship between the first range calibration point and the second range calibration point is determined.
3. The method according to claim 2, characterized in that Determining the target movement output value of the magnetic encoder at the detection point based on the target error, the target reference output value and the linear relationship corresponding to two range calibration points adjacent to and before the detection point includes: Determine the difference between the target reference output value and the target error as the actual reference output value; The target movement output value is determined according to the linear relationship between the actual reference output value and two range calibration points adjacent to and before the detection point.
4. The method according to claim 1, characterized in that Get the difference value corresponding to each range calibration point of the moving part, including: The sum of the reference output value of the calibration starting point among the multiple range calibration points and the configured increase value is determined as the theoretical value of the second range calibration point; When the moving member moves to the second range calibration point, obtaining a target reference output value of the reference sensor detecting the second range calibration point; Determine the difference between the target reference output value of the second range calibration point and the theoretical value of the second range calibration point as the difference value of the second range calibration point; Determine the second range calibration point as a new calibration starting point, and return to the execution step: sum the reference output value of the calibration starting point among the multiple range calibration points and the added value to determine the theoretical value of the third range calibration point until the difference between the range calibration points is obtained.
5. The method according to claim 1, characterized in that The reference total range of the moving part movement determined by the reference sensor includes: The reference output value of the reference sensor when detecting that the moving part is at the lowest position of the stroke is set to 0; When the moving member moves to the highest position of the travel, obtaining the highest reference output value of the moving member at this position detected by the reference sensor; The highest reference output value is determined as the reference total range.
6. The method according to claim 1, characterized in that The preset algorithm is: Among them, Q is the target reference output value, A1 is the first reference output value, A2 is the second reference output value, B1 is the first error value, B2 is the second error value, and E is the target error.
7. A precision compensation device for a magnetic encoder based on linear displacement detection, characterized in that: The device comprises: A division unit, used for dividing the reference total range of the moving part movement determined by the reference sensor into equal intervals to obtain a preset number of range calibration points and a reference output value of each range calibration point; An acquisition unit, used to acquire the difference corresponding to each range calibration point of the moving part; A calculation unit, for calculating, by using a preset algorithm, a target reference output value of any detection point where the moving part is located, a first reference output value, a second reference output value, a first difference, and a second difference corresponding to two range calibration points adjacent to and before the detection point, to obtain a target error; A determination unit is used to determine the target movement output value of the magnetic encoder at the detection point based on the target error, the target reference output value and the linear relationship corresponding to the two adjacent range calibration points before and after the detection point; wherein the linear relationship is determined based on the reference output values corresponding to the two adjacent range calibration points and the displacement output values detected by the magnetic encoder at the two adjacent range calibration points.
8. The device according to claim 7, characterized in that The determining unit is further used to determine the linear relationship, including: For any two adjacent first range calibration points and second range calibration points among the multiple range calibration points of the reference total range, the first reference output value of the first range calibration point and the first moving measurement output value of the first range calibration point detected by the magnetic encoder are used as starting coordinates; Taking the second reference output value of the second range calibration point and the second moving output value of the second range calibration point detected by the magnetic encoder as the end point coordinates; Based on the starting coordinates and the end coordinates, a linear relationship between the first range calibration point and the second range calibration point is determined.
9. An electronic device, characterized in that: The electronic device comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus; Memory, used to store computer programs; A processor, for implementing the method steps described in any one of claims 1 to 6 when executing a program stored in a memory.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method steps described in any one of claims 1 to 6 are implemented.
Citation Information
Cited By
Error compensation method based on laser ranging equipment and related equipment
CN121028033A
Error compensation method based on laser ranging device and related device
CN121028033B