Nonlinear error calibration method and system of magnetic encoder, magnetic encoder and motor
By setting multiple sampling points in the magnetic encoder, using parabolic interpolation method and error offset mechanism, the problem of insufficient calibration accuracy of the magnetic encoder is solved, and higher calibration accuracy and less storage space requirements are achieved.
Patent Information
- Application Number
- CN202511041678.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-28
- Publication Date
- 2025-09-02
- Estimated Expiration
- 2045-07-28
AI Technical Summary
The nonlinear error calibration method of existing magnetic encoders cannot meet the accuracy requirements in the BCT calibration method provided by the magnetic encoder chip, and the calibration table has limited storage space, resulting in insufficient calibration accuracy.
By controlling the motor rotation through open-loop control, multiple sampling points are set up to establish an error calibration table, the parabolic interpolation method is used for curve fitting calibration, and through the double judgment mechanism and the offset reduction mechanism of the error offset value, the storage space is reduced and the calibration accuracy is improved.
The calibration accuracy and fitting accuracy of the magnetic encoder are improved, and the storage space requirement is reduced, especially in areas with severe changes in magnetic pole edge errors.
Smart Images

Figure CN120576809A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of motor control technology, and in particular to a nonlinear error calibration method and system for a magnetic encoder, a magnetic encoder, and a motor. Background Art
[0002] In pan / tilt motor control systems, magnetic encoders are used to measure rotor angles in real time. However, the use of side-mounted encoders to save space increases their nonlinearity and reduces measurement accuracy. The encoder chip's built-in BCT calibration method, which adjusts the ETX or ETY axis gain, no longer meets the required accuracy.
[0003] Existing solutions typically use a table lookup calibration method combined with linear interpolation to correct errors. Using the magnetic encoder angle as a reference, the motor is controlled to rotate to a specific encoder angle. The error between the encoder angle and the electrical angle is recorded, and the error data from multiple sampling points is stored in a calibration table. This table is then written to the encoder's internal flash memory. The calibration table is then searched for two adjacent error points using the encoder's original value, and the correction value is calculated using a linear formula. However, linear interpolation, which fits a straight line between two adjacent points, has limited ability to fit nonlinear errors. This is particularly true in areas of drastic error variation, such as at the edges of the encoder's magnetic poles, where correction accuracy is insufficient. Furthermore, the accuracy of the calibration table is proportional to the number of error points written. Due to the limited internal flash memory of the encoder's internal flash memory, the calibration table cannot store too many error points, thus affecting its accuracy.
[0004] In view of this, there is an urgent need to provide a calibration algorithm that reduces storage space without affecting calibration accuracy. Summary of the Invention
[0005] In order to solve the technical problems of insufficient fitting accuracy and large storage space requirements in the conventional magnetic encoder nonlinear error calibration method, the present application proposes a magnetic encoder nonlinear error calibration method, system, magnetic encoder and motor.
[0006] According to a first aspect of the present application, a method for calibrating a nonlinear error of a magnetic encoder is proposed, comprising: Open loop control of motor rotation; Set multiple sampling points in the range of 0-360°, collect the magnetic encoder angle and open-loop angle at each sampling point, and establish an error calibration table based on the error between the magnetic encoder angle and the open-loop angle at each sampling point; Determine whether the error between the maximum calibration value and the minimum calibration value in the error calibration table is within a first preset threshold value A1, and whether the error between the calibration values of two adjacent sampling points is within a second preset threshold value A2. If so, determine that the calibration is successful and save the error calibration table; Obtain a real-time magnetic encoder angle, find calibration values of n nearest sampling points from the saved error calibration table according to the real-time magnetic encoder angle, and perform curve fitting calibration on the real-time magnetic encoder angle by parabolic interpolation based on the calibration values of the n nearest sampling points, where n ≥ 3.
[0007] Preferably, the method further comprises: Taking the absolute average of the maximum calibration value and the minimum calibration value in the error calibration table to obtain an error offset value; The calibration value of each sampling point in the error calibration table is offset according to the error offset value, so that the maximum calibration value after the offset is ≤A1 / 2 and the minimum calibration value after the offset is ≥-A1 / 2.
[0008] Preferably, the first preset threshold value A1 is 22.5°, corresponding to the original value unit of the magnetic encoder being 255, corresponding to a one-byte integer data size.
[0009] Preferably, the calibration of the real-time magnetic encoder angle by curve fitting based on the calibration values of the n nearest sampling points by parabolic interpolation method includes: Performing offset restoration on the calibration values of the n nearest sampling points according to the error offset value; Based on the restored calibration values of the n nearest sampling points, curve fitting is performed by parabolic interpolation to calculate the fitting calibration value corresponding to the real-time magnetic encoder angle; The real-time magnetic encoder angle is calibrated according to the fitting calibration value.
[0010] Preferably, the calibration value after offset of each sampling point in the error calibration table and the error offset value are respectively saved in the MCU built-in Flash of the magnetic encoder as a one-byte integer data type.
[0011] Preferably, the collecting of the magnetic encoder angle and the open-loop angle at each sampling point and the establishment of an error calibration table according to the error between the magnetic encoder angle and the open-loop angle at each sampling point comprises the following steps: Step a: Open-loop control the motor rotation and continuously read the first magnetic encoder angle. When it is determined that the first error between the first magnetic encoder angle and the current sampling point angle is less than a third preset threshold, proceed to step b. Step b: Open-loop controlling the motor to continue rotating based on the first error, and continuously reading the second magnetic encoder angle. When it is determined that the second error between the second magnetic encoder angle and the current sampling point angle is less than a fourth preset threshold, using the third error between the second magnetic encoder angle and the open-loop angle as a calibration value for the current sampling point and saving it to the error calibration table, and then proceeding to step c. Step c: Go to the next sampling point and repeat steps a and b.
[0012] Preferably, before the open-loop control motor rotates, a zero point calibration is also included, including: The open-loop control motor rotates clockwise from the open-loop angle 0° to the open-loop angle L, and the open-loop control motor rotates counterclockwise from the open-loop angle L to the open-loop angle 0°. The magnetic encoder angle of the current position is collected and saved as the zero point to the right, where 0<L<360°; The open-loop control motor rotates counterclockwise from the open-loop angle 0° to the open-loop angle -L, and then clockwise from the open-loop angle -L to the open-loop angle 0°. The magnetic encoder angle at the current position is collected and saved as zero point left. The zero point position after calibration is obtained by taking an average of the zero point rightward and the zero point leftward.
[0013] According to a second aspect of the present application, a nonlinear error calibration system for a magnetic encoder is proposed, comprising: a control unit configured to open-loop control the rotation of the motor; a table building unit configured to set a plurality of sampling points in the range of 0-360 degrees, collect the magnetic encoder angle and the open-loop angle of each sampling point, and build an error calibration table according to the error between the magnetic encoder angle and the open-loop angle of each sampling point; a judgment unit configured to judge whether the error between the maximum calibration value and the minimum calibration value in the error calibration table is within a first preset threshold value A1, and whether the error between the calibration values of two adjacent sampling points is within a second preset threshold value A2; if so, judge that the calibration is successful and save the error calibration table; An angle calibration unit is configured to obtain a real-time magnetic encoder angle, find calibration values of the n nearest sampling points from the stored error calibration table according to the real-time magnetic encoder angle, and perform curve fitting calibration on the real-time magnetic encoder angle by parabolic interpolation based on the calibration values of the n nearest sampling points, where n ≥ 3.
[0014] According to a third aspect of the present application, a magnetic encoder is proposed, comprising a controller, wherein the controller is configured to execute a nonlinear error calibration method for a magnetic encoder as provided in any one of the embodiments of the first aspect above.
[0015] According to a fourth aspect of the present application, a motor is provided, wherein the motor is equipped with a magnetic encoder as provided in any embodiment of the third aspect above.
[0016] This application proposes a nonlinear error calibration method, system, magnetic encoder, and motor for a magnetic encoder. Error point sampling is performed based on the magnetic encoder's angle value. An error calibration table is established through a dual judgment mechanism to improve calibration accuracy. The storage structure of the error calibration table is improved, and an offset restoration mechanism for the error offset value is added. This allows both the error offset value and the calibration value of each sampling point to be stored as a one-byte integer. This reduces storage space by four times compared to the traditional method of sampling four-byte floating-point calibration values. Fitting the calibration values through parabolic interpolation further improves fitting accuracy, making the calibration values closer to the actual error. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The accompanying drawings are included to provide a further understanding of the embodiments and are incorporated into and constitute a part of this specification. The accompanying drawings illustrate the embodiments and, together with the description, serve to explain the principles of the present invention. Other embodiments and many of the expected advantages of the embodiments will be readily apparent as they become better understood by reference to the following detailed description. The elements of the drawings are not necessarily to scale with respect to each other. Like reference numerals designate corresponding similar parts.
[0018] Figure 1 is a flow chart of a nonlinear error calibration method for a magnetic encoder according to a specific embodiment of the present application; Figure 2 is a schematic diagram of a nonlinear error calibration system for a magnetic encoder according to an embodiment of the present application. DETAILED DESCRIPTION
[0019] The features and exemplary embodiments of various aspects of the present invention will be described in detail below. In order to make the objects, technical solutions and advantages of the present invention more clearly understood, the present invention will be further described in detail below in conjunction with the accompanying drawings and Examples. It should be understood that the specific embodiments described herein are only configured to explain the present invention and are not configured to limit the present invention. For those skilled in the art, the present invention can be implemented without the need for some of these specific details. The following description of the embodiments is merely to provide a better understanding of the present invention by illustrating examples of the present invention.
[0020] It should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, the elements defined by the phrase "comprising..." do not exclude the presence of additional identical elements in the process, method, article, or device comprising the elements.
[0021] This application proposes a nonlinear error calibration method for a magnetic encoder. Figure 1 FIG. 4 shows a flow chart of a nonlinear error calibration method for a magnetic encoder according to a specific embodiment of the present application. Figure 1 As shown, the method includes the following steps: Step S101: performing zero point calibration on the magnetic encoder.
[0022] Specifically, step S101 includes the following steps: Step S101a: Open-loop control the motor to rotate clockwise from the open-loop angle 0° to the open-loop angle L, and open-loop control the motor to rotate counterclockwise from the open-loop angle L to the open-loop angle 0°. The magnetic encoder angle at the current position is collected and saved as zero point right, where 0<L<360°.
[0023] In this embodiment, the magnetic encoder angles at the current position are collected multiple times, and the average value is taken and saved as the position to the right of the zero point.
[0024] In this embodiment, L is set to 10°. In other implementations, L can be set to a corresponding value according to actual needs.
[0025] Step S101b: The open-loop control motor rotates counterclockwise from the open-loop angle 0° to the open-loop angle -L, and the open-loop control motor rotates clockwise from the open-loop angle -L to the open-loop angle 0°, and the magnetic encoder angle of the current position is collected and saved as zero point left.
[0026] In this embodiment, the magnetic encoder angles at the current position are also collected multiple times, and the average value is taken and saved as the position to the left of the zero point.
[0027] Step S101c: taking the average of the zero point right deviation and the zero point left deviation to obtain the calibrated zero point position.
[0028] The final zero point position obtained through zero point calibration is written into the chip of the magnetic encoder to eliminate the rotation error caused by open-loop rotation and motor resistance.
[0029] Step S102: Open-loop control of motor rotation.
[0030] Step S103: multiple sampling points are set in the range of 0-360 degrees, the magnetic encoder angle and open-loop angle of each sampling point are collected, and an error calibration table is established according to the error between the magnetic encoder angle and the open-loop angle of each sampling point.
[0031] Specifically, step S103 includes the following steps: Step S103a: open-loop control the motor rotation and continuously read the first magnetic encoder angle. When it is determined that the first error between the first magnetic encoder angle and the current sampling point angle is less than a third preset threshold, proceed to step S103b.
[0032] Step S103b: The motor continues to rotate under open-loop control according to the first error, and the second magnetic encoder angle is continuously read. When it is determined that the second error between the second magnetic encoder angle and the current sampling point angle is less than a fourth preset threshold, the third error between the second magnetic encoder angle and the open-loop angle is used as the calibration value of the current sampling point and saved in the error calibration table, and then the process proceeds to step S103c.
[0033] Step S103c: Go to the next sampling point and repeat steps S103a and S103b.
[0034] In one specific embodiment, 360 sampling points are set within a range of 0-360°. For example, the first sampling point has a sampling angle of 1°. First, the motor rotates clockwise in an open-loop control mode from zero. During this process, the first magnetic encoder angle is continuously read. When the first error of 1° between the read first magnetic encoder angle and the current sampling point angle is less than a third preset threshold, the motor is subjected to open-loop control to continue rotating clockwise or counterclockwise (depending on the positive or negative value of the first error) using the first error as feedback. Simultaneously, the second magnetic encoder angle is continuously read. When the second error of 1° between the read second magnetic encoder angle and the current sampling point angle is less than a fourth preset threshold, the third error between the second magnetic encoder angle and the actual open-loop angle at this point is used as the calibration value for the first sampling point and saved in the error calibration table. In this manner, all sampling points are traversed to establish a complete error calibration table.
[0035] In this embodiment, the third preset threshold is set to 0.5°, and the fourth preset threshold is set to 0.1°. In other embodiments, the third preset threshold and the fourth preset threshold can be set to different values according to actual needs, which is not limited here.
[0036] Through the above method, sampling is performed based on the read magnetic encoder angle value as the error point, and the calibration value of the error calibration table is subsequently read based on the magnetic encoder angle as the index, which is closer to the actual error. In addition, the error calibration table is established through a double judgment mechanism, which can control the motor to rotate more accurately to the position where the magnetic encoder is the sampling point angle, and the calibration value of each sampling point is more accurate.
[0037] Step S104: Determine whether the error between the maximum calibration value and the minimum calibration value in the error calibration table is within a first preset threshold A1, and whether the error between the calibration values of two adjacent sampling points is within a second preset threshold A2. If so, determine that the calibration is successful and save the error calibration table.
[0038] In this embodiment, the first preset threshold value A1 is set to 22.5°, and the corresponding original value unit of the magnetic encoder is 255, which just corresponds to the size of a one-byte integer data.
[0039] In this embodiment, the second preset threshold value A2 is set to 1°. In other implementations, the second preset threshold value can be set to different values according to actual needs, which is not limited here.
[0040] In a preferred embodiment, step S104 further includes: Take the absolute average of the maximum calibration value and the minimum calibration value in the error calibration table to obtain the error offset value; The calibration value of each sampling point in the error calibration table is offset according to the error offset value, so that the maximum calibration value after the offset is ≤A1 / 2 and the minimum calibration value after the offset is ≥-A1 / 2.
[0041] The calibration value and error offset value of each sampling point after offset in the error calibration table are respectively saved in the MCU built-in Flash of the magnetic encoder as a one-byte integer data type.
[0042] In traditional calibration methods, the calibration value for each sampling point in the error calibration table is typically stored as four-byte floating-point data (for example, 11.25°). The accuracy of the error calibration table is proportional to the number of sampling points written. Once the number of sampling points is large enough, the storage space requirement will be relatively high. However, due to the limited built-in Flash storage space of the magnetic encoder MCU, the storage space reserved for the error calibration table is even more limited. This makes it impossible to store too many error points in the error calibration table, thus affecting the accuracy of the calibration table.
[0043] Therefore, this embodiment improves the storage structure of the error calibration table and adds an offset restoration mechanism for the error offset value. By offsetting each calibration value in the error calibration table, the offset calibration value and the error offset value can be stored in a one-byte integer data size. Compared with the traditional method of sampling four-byte floating-point type to store the calibration value, the storage space is reduced by 4 times. Under the same storage space, the sampling points can be increased by 4 times to improve the accuracy of the error calibration table.
[0044] In a specific embodiment, assuming the maximum calibration value is 22.6° and the minimum calibration value is 0.1°, satisfying 22.6°-0.1°≤22.5°, but the magnetic encoder raw value unit corresponding to the maximum calibration value of 22.6° exceeds 255 and cannot be stored in 1 byte, requiring 2 bytes. In this case, the calculated error offset value is 11.35°, the maximum calibration value after offset is 11.25°, and the minimum calibration value is -11.25°. The calibration values after offset in the entire error calibration table can all be stored using 1-byte integer data.
[0045] Step S105: Obtain the real-time magnetic encoder angle, find the calibration values of the n nearest sampling points from the saved error calibration table according to the real-time magnetic encoder angle, and perform curve fitting calibration on the real-time magnetic encoder angle by parabolic interpolation method based on the calibration values of the n nearest sampling points, where n≥3.
[0046] In a specific embodiment, after obtaining the real-time magnetic encoder angle, the calibration values of the n nearest sampling points are found from the saved error calibration table according to the real-time magnetic encoder angle, and then the calibration values of the n nearest sampling points are offset and restored according to the error offset value. Then, based on the restored calibration values of the n nearest sampling points, curve fitting is performed by parabolic interpolation method to calculate the fitting calibration value corresponding to the real-time magnetic encoder angle, and finally, the real-time magnetic encoder angle is calibrated according to the fitting calibration value.
[0047] In this embodiment, n is set to 3. The calibration values of the three nearest sampling points after restoration are obtained according to the real-time magnetic encoder angle, and are recorded as the front point calibration value, the middle point calibration value, and the back point calibration value respectively. The fitting formula of the parabolic interpolation method is: Where y is the fitted calibration value, x is the real-time magnetic encoder angle, a1 is the front-point calibration value, a2 is the front-point magnetic encoder angle corresponding to the front-point calibration value, b1 is the mid-point calibration value, b2 is the mid-point magnetic encoder angle corresponding to the mid-point calibration value, c1 is the back-point calibration value, and c2 is the back-point magnetic encoder angle corresponding to the back-point calibration value.
[0048] Through the above method, the calibration value is fitted by parabolic interpolation, which further improves the fitting accuracy, especially in the area where the error changes drastically, such as the edge of the magnetic pole of the magnetic encoder, so that the calibration value can be closer to the actual error.
[0049] In summary, the nonlinear error calibration method of a magnetic encoder provided by this application achieves the following beneficial effects: This application samples error points based on the angle value of the magnetic encoder and establishes an error calibration table through a dual judgment mechanism to improve calibration accuracy. The storage structure of the error calibration table is improved, and an offset restoration mechanism for the error offset value is added. This allows the error offset value and the calibration value of each sampling point to be stored as a one-byte integer data type. Compared with the traditional method of sampling four-byte floating-point data for calibration value storage, the storage space is reduced by 4 times. The calibration value is further fitted using parabolic interpolation, which improves fitting accuracy and makes the calibration value closer to the actual error in areas with drastic error changes, such as the magnetic encoder pole edges.
[0050] According to the above-mentioned nonlinear error calibration method of the magnetic encoder, based on the same inventive concept, the present application also proposes a nonlinear error calibration system for the magnetic encoder. Figure 2 FIG. 4 is a schematic diagram showing a nonlinear error calibration system for a magnetic encoder according to an embodiment of the present application. Figure 2 As shown, the system includes: The zero point calibration unit 201 is configured to perform zero point calibration on the magnetic encoder.
[0051] The control unit 202 is configured to open-loop control the rotation of the motor.
[0052] The table building unit 203 is configured to set multiple sampling points in the range of 0-360 degrees, collect the magnetic encoder angle and open-loop angle of each sampling point, and build an error calibration table according to the error between the magnetic encoder angle and the open-loop angle of each sampling point.
[0053] The judgment unit 204 is configured to judge whether the error between the maximum calibration value and the minimum calibration value in the error calibration table is within a first preset threshold A1, and whether the error between the calibration values of two adjacent sampling points is within a second preset threshold A2. If so, the calibration is determined to be successful and the error calibration table is saved.
[0054] The angle calibration unit 205 is configured to obtain the real-time magnetic encoder angle, find the calibration values of the n nearest sampling points from the stored error calibration table according to the real-time magnetic encoder angle, and perform curve fitting calibration on the real-time magnetic encoder angle based on the calibration values of the n nearest sampling points by parabolic interpolation method, where n ≥ 3.
[0055] According to the above-mentioned nonlinear error calibration method of the magnetic encoder, based on the same inventive concept, the present application also proposes a magnetic encoder, which includes a controller MCU, the controller MCU has a built-in Flash, and one or more programs are stored in the Flash. When the one or more programs are executed, the magnetic encoder implements the nonlinear error calibration method of the magnetic encoder provided in any of the above-mentioned embodiments.
[0056] According to the above-mentioned magnetic encoder, based on the same inventive concept, the present application also proposes a motor, on which is mounted the magnetic encoder provided by any of the above-mentioned embodiments, so that the motor executes the nonlinear error calibration method of the magnetic encoder provided by any of the above-mentioned embodiments.
[0057] In the embodiments of the present application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device / system / method embodiments described above are merely schematic. For example, the division of the units can be a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0058] The units described as separate components may or may not be physically separate, and 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 units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0059] In addition, the functional units in the various embodiments of the present invention may be integrated into a single processing unit, each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0060] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, 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. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk, etc. Various media that can store program codes.
[0061] Obviously, those skilled in the art can make various modifications and changes to the embodiments of the present invention without departing from the spirit and scope of the present invention. In this way, if these modifications and changes are within the scope of the claims of the present invention and their equivalents, the present invention is also intended to cover these modifications and changes. The word "comprising" does not exclude the presence of other elements or steps not listed in the claims. The simple fact that certain measures are recited in mutually different dependent claims does not indicate that a combination of these measures cannot be used to advantage. Any reference signs in the claims should not be considered as limiting the scope.
Claims
1. A method for calibrating the nonlinear error of a magnetic encoder, characterized in that: include: Open loop control of motor rotation; Set multiple sampling points in the range of 0-360°, collect the magnetic encoder angle and open-loop angle at each sampling point, and establish an error calibration table based on the error between the magnetic encoder angle and the open-loop angle at each sampling point; Determine whether the error between the maximum calibration value and the minimum calibration value in the error calibration table is within a first preset threshold value A1, and whether the error between the calibration values of two adjacent sampling points is within a second preset threshold value A2. If so, determine that the calibration is successful and save the error calibration table; Obtain a real-time magnetic encoder angle, find calibration values of n nearest sampling points from the saved error calibration table according to the real-time magnetic encoder angle, and perform curve fitting calibration on the real-time magnetic encoder angle by parabolic interpolation based on the calibration values of the n nearest sampling points, where n ≥ 3.
2. The method according to claim 1, characterized in that The method further comprises: Taking the absolute average of the maximum calibration value and the minimum calibration value in the error calibration table to obtain an error offset value; The calibration value of each sampling point in the error calibration table is offset according to the error offset value, so that the maximum calibration value after the offset is ≤A1 / 2 and the minimum calibration value after the offset is ≥-A1 / 2.
3. The method according to claim 2, characterized in that The first preset threshold value A1 is 22.5°, corresponding to the original value unit of the magnetic encoder being 255, which corresponds to a one-byte integer data size.
4. The method according to claim 2, characterized in that The method of performing curve fitting calibration on the real-time magnetic encoder angle based on the calibration values of the n nearest sampling points by parabolic interpolation method includes: Performing offset restoration on the calibration values of the n nearest sampling points according to the error offset value; Based on the restored calibration values of the n nearest sampling points, curve fitting is performed by parabolic interpolation to calculate the fitting calibration value corresponding to the real-time magnetic encoder angle; The real-time magnetic encoder angle is calibrated according to the fitting calibration value.
5. The method according to claim 3, characterized in that The calibration value after the offset of each sampling point in the error calibration table and the error offset value are respectively saved in the MCU built-in Flash of the magnetic encoder as a one-byte integer data type.
6. The method according to claim 1, characterized in that The method of collecting the magnetic encoder angle and the open-loop angle of each sampling point and establishing an error calibration table according to the error between the magnetic encoder angle and the open-loop angle of each sampling point comprises the following steps: Step a: Open-loop control the motor rotation and continuously read the first magnetic encoder angle. When it is determined that the first error between the first magnetic encoder angle and the current sampling point angle is less than a third preset threshold, proceed to step b. Step b: Open-loop controlling the motor to continue rotating based on the first error, and continuously reading the second magnetic encoder angle. When it is determined that the second error between the second magnetic encoder angle and the current sampling point angle is less than a fourth preset threshold, using the third error between the second magnetic encoder angle and the open-loop angle as a calibration value for the current sampling point and saving it to the error calibration table, and then proceeding to step c. Step c: Go to the next sampling point and repeat steps a and b.
7. The method according to claim 1, characterized in that Before the open-loop control motor rotates, a zero-point calibration is also included, including: The open-loop control motor rotates clockwise from the open-loop angle 0° to the open-loop angle L, and the open-loop control motor rotates counterclockwise from the open-loop angle L to the open-loop angle 0°. The magnetic encoder angle of the current position is collected and saved as the zero point to the right, where 0<L<360°; The open-loop control motor rotates counterclockwise from the open-loop angle 0° to the open-loop angle -L, and then clockwise from the open-loop angle -L to the open-loop angle 0°. The magnetic encoder angle at the current position is collected and saved as zero point left. The zero point position after calibration is obtained by taking an average of the zero point rightward and the zero point leftward.
8. A nonlinear error calibration system for a magnetic encoder, characterized in that: include: a control unit configured to open-loop control the rotation of the motor; a table building unit configured to set a plurality of sampling points in the range of 0-360 degrees, collect the magnetic encoder angle and the open-loop angle of each sampling point, and build an error calibration table according to the error between the magnetic encoder angle and the open-loop angle of each sampling point; a judgment unit configured to judge whether the error between the maximum calibration value and the minimum calibration value in the error calibration table is within a first preset threshold value A1, and whether the error between the calibration values of two adjacent sampling points is within a second preset threshold value A2; if so, judge that the calibration is successful and save the error calibration table; An angle calibration unit is configured to obtain a real-time magnetic encoder angle, find calibration values of the n nearest sampling points from the stored error calibration table according to the real-time magnetic encoder angle, and perform curve fitting calibration on the real-time magnetic encoder angle by parabolic interpolation based on the calibration values of the n nearest sampling points, where n ≥ 3.
9. A magnetic encoder, comprising a controller, characterized in that: The controller is configured to execute the method according to any one of claims 1 to 7.
10. A motor, characterized in that: The motor is equipped with the magnetic encoder according to claim 9.
Citation Information
Patent Citations
Encoder calibration method and device
CN109708681A
Magnetic encoder calibration method and system
CN111076761A
Magnetic encoder position positioning method and device, electronic equipment and computer readable storage medium
CN111146986A
Magnetic encoder correction system and method, control terminal and readable storage medium
CN111521212A
Cited By
Magnetic encoder angle calibration method, encoder, storage medium and product
CN121384119A
Magnetic encoder calibration method and system
CN121783231A