Magnetic encoder calibration method and system based on dynamic interval point sampling

The magnetic encoder calibration method using dynamic interval sampling and a bidirectional calibration table solves the problems of low efficiency and poor accuracy in existing technologies, achieving efficient and accurate magnetic encoder calibration, and is applicable to various control systems.

CN121430701APending Publication Date: 2026-01-30江淮前沿技术协同创新中心
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202511688398.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-18
Publication Date
2026-01-30

AI Technical Summary

Technical Problem

Existing magnetic encoder calibration methods are inefficient, inaccurate, and have poor engineering adaptability. They rely on physical index points and reciprocating motion, and cannot achieve high-density sampling during dynamic rotation.

Method used

A magnetic encoder calibration method based on dynamic interval sampling is adopted. High-density data sampling is carried out by continuous unidirectional rotation of the motor. By utilizing open-loop control and non-sequential point acquisition mechanism, combined with bidirectional calibration table and bisection interpolation, efficient and accurate calibration without physical index points and reciprocating motion is achieved.

Benefits of technology

It achieves efficient and accurate magnetic encoder calibration without physical index points or reciprocating motion, shortening calibration time, improving engineering adaptability and calibration accuracy, and is suitable for various control systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121430701A_ABST
    Figure CN121430701A_ABST
Patent Text Reader

Abstract

The invention provides a magnetic encoder calibration method and system based on dynamic interval point sampling, and the method comprises the steps: setting the rotation direction and constant rotation speed of a motor, driving the motor to carry out one-way continuous rotation, carrying out the forward data collection step after stabilization, and stopping the motor after the collection is completed; reversely setting rotation of the motor, driving the motor to perform unidirectional continuous rotation, after the motor is stable, executing a reverse data acquisition step, and stopping the motor after acquisition is completed; sorting the forward calibration data and the reverse calibration data in an ascending order or a descending order according to the angle value of the magnetic encoder, and adding virtual points at the tail ends of the two calibration tables to complete a data processing flow; in the compensation stage, a corresponding calibration table is selected according to the motion direction, and the calibrated accurate angle is calculated according to dichotomy search and interpolation coefficients. The technical problems that starting operation depends on physical index points, reciprocating motion is achieved, starting is limited by position factors, and magnetic encoder calibration efficiency, accuracy and engineering adaptability are low are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of robot control, and more specifically to a magnetic encoder calibration method and system based on dynamic interval sampling. Background Technology

[0002] Magnetic encoders, due to their small size, simple structure, compact packaging, and strong resistance to environmental interference, have become important position feedback components in space-constrained, interface-critical servo drives, micro-joint modules, and biomimetic robots. However, dimensional or shape errors are inevitably introduced during the processing and magnetization of magnets, and the magnetic field distribution often exhibits non-uniformity. Simultaneously, eccentricity, tilting, or looseness during sensor packaging and installation introduces additional errors, causing significant non-linear deviations in the magnetic encoder across its 0–360° cycle, making it difficult to directly meet the stringent accuracy requirements of high-performance servo control and repeatable positioning. To eliminate these errors, engineering practice typically utilizes near-ideal high-precision photoelectric encoders or other equivalent angle reference sources to calibrate the magnetic encoder, establishing a high-density mapping relationship between its output angle and the true angle. During actual operation, accuracy compensation is then performed on the measurement results through table lookup or online interpolation to improve consistency and stability throughout the cycle. Therefore, developing a magnetic encoder calibration scheme that is simple in structure, highly efficient in execution, covers a dense range of angles, and is applicable to various control systems has significant application value and engineering significance in precision control and complex integrated environments.

[0003] Existing magnetic encoders typically require calibration in engineering applications to improve angle measurement accuracy. However, current mainstream calibration methods generally suffer from low efficiency, sparse sampling points, and poor adaptability. Most solutions establish a mapping relationship between the magnetic encoder and a high-precision encoder or other near-ideal angle measurement devices using a "stepping-stopping-sampling" approach. Among these, the common open-loop stepping method is limited by the number of motor pole pairs, resulting in a large electrical angle step interval, leading to sparse sampling point distribution and difficulty in guaranteeing interpolation accuracy. Furthermore, each step requires acceleration, deceleration, and stabilization, significantly increasing the overall calibration time. Moreover, these methods often rely on physical zero points or index points as starting positions. Some solutions employing closed-loop position control may experience overshoot or brief commutation adjustments during the approach to the target angle, introducing consistency errors due to mechanical hysteresis or system delay.

[0004] Currently, most mainstream technologies for magnetic encoder calibration are based on the "stepping-stopping-sampling" approach. One method is the SVPWM stepping open-loop method, as exemplified by existing invention patent applications CN109655083A ("Magnetic Encoder and its Calibration Method and Device, Motor and Unmanned Aerial Vehicle") and CN106679710A ("A Magnetic Encoder Calibration Method and System"). This method uses a host computer or DSP to control the motor to stop and stabilize at fixed electrical angle increments, collecting high-precision reference and magnetic encoder data, and then uses interpolation algorithms to construct a mapping table. However, because the stepping angle is limited by the number of pole pairs of the motor, the mapping points are sparse, and frequent acceleration, deceleration, and stopping severely slow down the calibration speed. Another method is the closed-loop position control sampling method, as exemplified by existing invention patent application CN111076761A ("Magnetic Encoder Calibration Method and System"). This method collects data after the preset angle point has completely stopped, but because each point needs to re-enter a stable state, it is not only time-consuming but also susceptible to mechanical hysteresis, introducing consistency errors.

[0005] Other calibration approaches integrate the calibration logic into the encoder or driver, using feedback from the motor's uniform rotation to update calibration parameters in real time, achieving self-calibration without the need for a host computer. While this approach reduces external dependence, it demands sophisticated integrated hardware design and still requires stable, uniform speed conditions to execute. Other approaches reduce reliance on external devices by integrating a self-calibration module. For example, patent application CN118739939A, "A Calibration System and Method for Open-Loop Self-Calibration of a Motor," proposes automatically updating angle correction parameters through a built-in trigger mechanism during uniform motor rotation. Patent application CN118739954A, "A Calibration System and Method for Closed-Loop Self-Calibration of a Motor," utilizes closed-loop feedback signals to adjust output parameters in real time, achieving online calibration without the need for a host computer. Although these approaches reduce the need for external devices, they are still limited by uniform rotation or closed-loop control and cannot achieve high-density sampling during dynamic rotation.

[0006] None of the existing solutions mentioned above can achieve high-density sampling and efficient calibration during dynamic continuous rotation without requiring a stop and at any starting angle.

[0007] In summary, existing technologies suffer from technical problems such as reliance on physical index points and reciprocating motion for startup, startup being constrained by positional factors, and low efficiency, accuracy, and engineering adaptability of magnetic encoder calibration. Summary of the Invention

[0008] The technical problem to be solved by this invention is: how to solve the technical problems in the prior art where the start-up operation depends on physical index points and reciprocating motion, the start-up is constrained by position factors, and the magnetic encoder calibration efficiency, accuracy and engineering adaptability are low.

[0009] This invention solves the above-mentioned technical problems by employing the following technical solution: A magnetic encoder calibration method based on dynamic interval point sampling includes: S1. Set the motor rotation direction and constant rotation speed, drive the motor to rotate continuously in one direction, and collect positive data when the motor is in a stable state. Stop the motor when the data collection is completed to obtain positive calibration data. S2. Set the motor rotation direction to be opposite to S1, drive the motor to rotate continuously in one direction, and when the motor is in a stable state, perform reverse data acquisition. When the acquisition is completed, stop the motor to obtain reverse calibration data. S3. Sort the forward and reverse calibration data in ascending and descending order according to the magnetic encoder angle value, add virtual points at the end of the two calibration tables, perform calibration data processing operations, and obtain the correction data. S4. During the compensation phase, select the appropriate calibration table according to the direction of motion, and calculate the accurate angle after calibration based on the correction data using the bisection search and interpolation coefficients.

[0010] This invention uses online sampling at dynamic intervals based on open-loop control to automatically calibrate magnetic encoders. Through continuous unidirectional rotation, high-density sampling, and a strategy that eliminates the need for stabilization, it achieves a highly efficient, accurate, and engineering-adaptable magnetic encoder calibration scheme that requires no physical index points, has no reciprocating motion, and can be quickly started from any position.

[0011] This invention proposes a continuous unidirectional high-density online sampling and calibration scheme based on open-loop approximately constant speed dragging, in order to overcome the traditional limitations of sparse sampling, reliance on stationary state, reliance on zero position, and difficulty in balancing efficiency and accuracy.

[0012] In a more specific technical solution, in S1, when the motor is in a stable state, NUM_SAMPLES target sampling points are uniformly set within a preset angle range according to a preset sampling interval. During the continuous rotation of the motor, when the current position is detected to be close to the target point, a stability check is performed, and high-precision reference encoder and magnetic encoder angle data are collected simultaneously to mark the collection status. Repeat the stability check, synchronization acquisition, and acquisition status marking until data acquisition of all target points in the motor's rotation direction is completed, then stop the motor.

[0013] This invention employs a non-sequential point acquisition mechanism, which detects and acquires any unacquired target points in real time, eliminating the need for sequential scanning. During calibration, the non-sequential point acquisition mechanism does not simply check the next point sequentially; data is acquired as the motor approaches any unacquired target point during rotation. Even if some target points are missed due to the low update frequency of the reference encoder, subsequent reachable points can still be acquired, avoiding the need for an idle rotation to reach missed points and shortening calibration time.

[0014] In a more specific technical solution, during the dynamic interval point acquisition process of the magnetic encoder of S1, the current position of the motor is continuously detected; Determine if there are any uncollected points approaching the target; if not, continue monitoring the current position of the motor. If so, perform a brief stability check; Determine whether the brief stability check has passed; if not, continue monitoring the motor's current position. If so, then collect data from both encoders simultaneously; Mark the target point as collected; Determine if all target points have been collected; if not, continue monitoring the current position of the motor. If so, then stop the motor.

[0015] In a more specific technical solution, in S2, the desired rotation speed is set, the motor is started to rotate continuously in one direction, and when the motor is in a stable state, NUM_SAMPLES target sampling points are evenly set within a preset angle range according to the preset sampling interval.

[0016] This invention performs dynamic interval sampling and unidirectional continuous rotation without requiring complete stabilization; a brief stability check is only performed when approaching the target point. This invention allows for starting from any position, eliminating the need for a physical zero point to begin calibration. This invention eliminates the need for a physical index and can start at any position: since calibration points can be generated from random locations, the system can initiate calibration from any position, improving the flexibility and convenience of the calibration process and solving the problem that traditional methods typically rely on physical zero points or index points as starting points.

[0017] In the dynamic interval sampling technology adopted in this invention, the motor does not need to come to a complete stop during continuous unidirectional rotation. A brief stability check is only performed when approaching the target point. This solves the problem of the significant increase in overall calibration time caused by the need for acceleration, deceleration and stabilization processes at each step in traditional methods. At the same time, it avoids the consistency error problem that may be introduced by overshoot or small commutation adjustments during the approach to the target angle in traditional methods.

[0018] In a more specific technical solution, in S2, when the current position is detected to be close to the target point during the continuous rotation of the motor, a stability check is performed, and high-precision reference encoder and magnetic encoder angle data are collected simultaneously to mark the collection status.

[0019] This invention employs high-density interval point setting, unrestricted by the number of motor pole pairs, theoretically capable of generating any number of sampling points within a 360° range. Furthermore, the hardware implementation is simple, eliminating the need for closed-loop position feedback and broadening its applicability. During the high-density interval point setting process, this invention utilizes SVPWM to achieve open-loop strong drag, subdividing the angle of each rotation. This allows for the uniform setting of multiple target sampling points within a 360° range at fixed intervals, unrestricted by the number of motor pole pairs. This solves the problem of sparse sampling point distribution and difficulty in guaranteeing interpolation accuracy caused by the traditional open-loop stepping method's limitation on the number of motor pole pairs.

[0020] This invention features system simplicity and high portability. It can be implemented with only a main control MCU and its built-in resources in conjunction with a three-phase inverter. There is no need for position feedback from a closed-loop control system. It is applicable to various types of motors. The determination of whether the sampling point has been reached is made by comparing the encoder data used for reference with the preset calibration point, rather than relying on the angle feedback from the motor itself. The angle is accurate, and the system implementation threshold is greatly reduced, improving the versatility and portability of the solution.

[0021] In a more specific technical solution, in S3, the forward calibration data is sorted in ascending order according to the magnetic encoder angle value in the main control board, and the reverse calibration data is sorted in descending order according to the magnetic encoder angle value.

[0022] In a more specific technical solution, in S3, virtual points are added to the ends of the two calibration tables to complete the data acquisition and processing flow.

[0023] In a more specific technical solution, during the compensation phase of S4, the corresponding calibration table is selected according to the direction of motion, and the position of the original angle of the current magnetic encoder in the calibration table is determined by binary search. Based on the position of the original angle of the current magnetic encoder in the calibration table, calculate the interpolation coefficient between two adjacent points, and calculate the accurate angle after calibration based on the interpolation coefficient.

[0024] A formula for calculating linear interpolation coefficients is as follows: Based on the aforementioned steps, a complete calibration table has been established, which can be represented as the calibration table. L The expression is:

[0025] in N This refers to the number of data collection points in the calibration table. i r,i It is to reach a certain sampling pointi Within the specified position range, the ideal angle value output by the high-precision encoder coaxially connected to the magnetic encoder is recorded. i m,i It is the actual output angle of the magnetic encoder at the same moment.

[0026] In actual operation, the system uses encoder angles obtained through real-time sampling. i m The binary search method is used to locate the interval in the lookup table. i m,i , i m,i+1 ] Calculate the interpolation coefficients between two adjacent points. k The calculation formula is as follows:

[0027] This invention employs a bidirectional independent calibration table, establishing separate forward and reverse calibration tables. Compensation is switched according to the direction of motion, avoiding hysteresis or similar phenomena that reduce calibration accuracy. This invention uses a bidirectional calibration strategy, establishing independent forward and reverse calibration tables. The appropriate calibration table is selected for angle compensation based on the current direction of motion of the magnetic encoder, effectively compensating for potential mechanical hysteresis and system delay, thus improving the accuracy of angle calibration.

[0028] In a more specific technical solution, the precise angle after calibration is calculated using the following logic: In actual operation, the system uses encoder angles obtained through real-time sampling. i m The binary search method is used to locate the interval in the lookup table. i m,i , i m,i+1 ] Calculate the interpolation coefficients between two adjacent points. k Combined with the difference between two adjacent points S Difference S During calculation, if the target's true angle is near zero, a cyclic offset constraint needs to be introduced into the angle difference to ensure the interpolation domain is continuous and follows the shortest angle path. The calibrated angle is calculated using the formula below. i mc : .

[0030] In a more specific technical solution, the magnetic encoder calibration system based on dynamic interval point sampling includes: The forward acquisition module is used to set the motor rotation direction and constant rotation speed, drive the motor to rotate continuously in one direction, and perform forward data acquisition when the motor is in a stable state. When the acquisition is completed, the motor is stopped and forward calibration data is obtained. The reverse acquisition module is used to set the motor rotation direction to be opposite to S1, drive the motor to rotate continuously in one direction, and perform reverse data acquisition when the motor is in a stable state. When the acquisition is completed, the motor is stopped and reverse calibration data is obtained. The calibration module sorts the forward and reverse calibration data in ascending and descending order according to the magnetic encoder angle values, adds virtual points at the ends of the two calibration tables, performs calibration data processing operations, and obtains calibration data. The calibration module is connected to the forward acquisition module and the reverse acquisition module. The supplementary module is used during the compensation phase to select the appropriate calibration table based on the direction of motion, and calculates the accurate angle after calibration based on the correction data using the bisection search and interpolation coefficients. The supplementary module is connected to the correction module.

[0031] The present invention has the following advantages over the prior art: This invention uses online sampling at dynamic intervals based on open-loop control to automatically calibrate magnetic encoders. Through continuous unidirectional rotation, high-density sampling, and a strategy that eliminates the need for stabilization, it achieves a highly efficient, accurate, and engineering-adaptable magnetic encoder calibration scheme that requires no physical index points, has no reciprocating motion, and can be quickly started from any position.

[0032] This invention proposes a continuous unidirectional high-density online sampling and calibration scheme based on open-loop approximately constant speed dragging, in order to overcome the traditional limitations of sparse sampling, reliance on stationary state, reliance on zero position, and difficulty in balancing efficiency and accuracy.

[0033] This invention employs a non-sequential point acquisition mechanism, which detects and acquires any unacquired target points in real time, eliminating the need for sequential scanning. During calibration, the non-sequential point acquisition mechanism does not simply check the next point sequentially; data is acquired as the motor approaches any unacquired target point during rotation. Even if some target points are missed due to the low update frequency of the reference encoder, subsequent reachable points can still be acquired, avoiding the need for an idle rotation to reach missed points and shortening calibration time.

[0034] This invention performs dynamic interval sampling and unidirectional continuous rotation without requiring complete stabilization; a brief stability check is only performed when approaching the target point. This invention allows for starting from any position, eliminating the need for a physical zero point to begin calibration. This invention eliminates the need for a physical index and can start at any position: since calibration points can be generated from random locations, the system can initiate calibration from any position, improving the flexibility and convenience of the calibration process and solving the problem that traditional methods typically rely on physical zero points or index points as starting points.

[0035] In the dynamic interval sampling technology adopted in this invention, the motor does not need to come to a complete stop during continuous unidirectional rotation. A brief stability check is only performed when approaching the target point. This solves the problem of the significant increase in overall calibration time caused by the need for acceleration, deceleration and stabilization processes at each step in traditional methods. At the same time, it avoids the consistency error problem that may be introduced by overshoot or small commutation adjustments during the approach to the target angle in traditional methods.

[0036] This invention employs high-density interval point setting, unrestricted by the number of motor pole pairs, theoretically capable of generating any number of sampling points within a 360° range. Furthermore, the hardware implementation is simple, eliminating the need for closed-loop position feedback and broadening its applicability. During the high-density interval point setting process, this invention utilizes SVPWM to achieve open-loop strong drag, subdividing the angle of each rotation. This allows for the uniform setting of multiple target sampling points within a 360° range at fixed intervals, unrestricted by the number of motor pole pairs. This solves the problem of sparse sampling point distribution and difficulty in guaranteeing interpolation accuracy caused by the traditional open-loop stepping method's limitation on the number of motor pole pairs.

[0037] This invention features system simplicity and high portability. It can be implemented with only a main control MCU and its built-in resources in conjunction with a three-phase inverter. There is no need for position feedback from a closed-loop control system. It is applicable to various types of motors. The determination of whether the sampling point has been reached is made by comparing the encoder data used for reference with the preset calibration point, rather than relying on the angle feedback from the motor itself. The angle is accurate, and the system implementation threshold is greatly reduced, improving the versatility and portability of the solution.

[0038] This invention employs a bidirectional independent calibration table, establishing separate forward and reverse calibration tables. Compensation is switched according to the direction of motion, avoiding hysteresis or similar phenomena that reduce calibration accuracy. This invention uses a bidirectional calibration strategy, establishing independent forward and reverse calibration tables. The appropriate calibration table is selected for angle compensation based on the current direction of motion of the magnetic encoder, effectively compensating for potential mechanical hysteresis and system delay, thus improving the accuracy of angle calibration.

[0039] This invention solves the technical problems existing in the prior art, such as the reliance on physical index points and reciprocating motion for startup operations, the limitation of startup by position factors, and the low efficiency, accuracy, and engineering adaptability of magnetic encoder calibration. Attached Figure Description

[0040] Figure 1 This is a schematic diagram of the basic steps of the magnetic encoder calibration method based on dynamic interval point sampling according to Embodiment 1 of the present invention; Figure 2 This is a schematic diagram of an exemplary structure of a magnetic encoder calibration system according to Embodiment 1 of the present invention; Figure 3This is a schematic diagram illustrating the specific steps of the dynamic interval point acquisition operation of the magnetic encoder in Embodiment 1 of the present invention. Detailed Implementation

[0041] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below in conjunction with the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0042] Example 1 like Figure 1 and Figure 2 As shown, the magnetic encoder calibration method based on dynamic interval point sampling provided by the present invention includes the following basic steps: S1. Set the motor rotation direction and constant rotation speed, drive the motor to rotate continuously in one direction, wait for it to stabilize, execute the forward data acquisition step, and stop the motor after the acquisition is completed. In this embodiment, the motor rotation direction and desired rotation speed are set, and the motor is started to rotate continuously in one direction to prevent sudden start-up from introducing errors at the first sampling point. After stabilization, NUM_SAMPLES target sampling points are evenly set within a 360° range according to a preset sampling interval. During the continuous rotation of the motor, when the current position is detected to be close to the target point, a stability check is performed and the angle data of the high-precision reference encoder and magnetic encoder are collected simultaneously, and the collection status is marked. The above process is repeated until the data collection of all target points in this direction is completed, and then the motor is stopped. like Figure 3 As shown, in this embodiment, the dynamic interval point acquisition operation of the magnetic encoder further includes the following specific steps: S11, Start the motor to rotate in one direction; S12. Wait for the motor to reach a stable rotation state; S13. Set NUM SAMPLES target sampling points; S14. Continuously monitor the current position of the motor; S15. Determine if there are any uncollected points close to the target; if not, proceed to step S14. S16. If so, perform a brief stability check; S17. Determine whether the stability check has passed; if not, proceed to step S14. S18. If so, then collect data from both encoders simultaneously. S19. Mark the target point as collected; S110. Determine whether all target points have been collected; if not, proceed to step S14. S111. If so, then stop the motor.

[0043] S2. Set the motor rotation direction to be opposite to the previous step, drive the motor to rotate continuously in one direction, wait for it to stabilize, and then execute the reverse data acquisition step. After the acquisition is completed, stop the motor. In this embodiment, the motor rotation direction is set to be opposite to that in step S1, the desired rotation speed is set, and the motor is started to rotate continuously in one direction. After stabilization, NUM_SAMPLES target sampling points are evenly set within a 360° range according to the preset sampling interval. During the continuous rotation of the motor, when the current position is detected to be close to the target point, a stability check is performed and the angle data of the high-precision reference encoder and magnetic encoder are collected simultaneously, and the collection status is marked. The above process is repeated until the data collection of all target points in this direction is completed, and the motor is stopped. S3. Sort the forward and reverse calibration data in ascending or descending order according to the magnetic encoder angle value, and add virtual points at the end of the two calibration tables to solve the 360° boundary problem and complete the data processing flow. In this embodiment, the forward calibration data is sorted in ascending order according to the magnetic encoder angle value in the main control board, and the reverse calibration data is sorted in descending order according to the magnetic encoder angle value; virtual points are added at the ends of the two calibration tables to solve the 360° boundary problem and complete the data acquisition and processing flow. S4. During the compensation phase, select the appropriate calibration table according to the direction of motion, and calculate the accurate angle after calibration based on the bisection search and interpolation coefficients. In this embodiment, during the compensation phase, the corresponding calibration table is selected according to the direction of motion, and then the position of the original angle of the current magnetic encoder in the calibration table is determined by binary search; the interpolation coefficient between two adjacent points is calculated, and the accurate angle after calibration is calculated based on the interpolation coefficient.

[0044] Example 2 In the alternative hardware solution adopted in this embodiment, other types of angle feedback references are used; specifically, the current solution relies on an angle encoder to provide an angle reference. To improve system adaptability and reduce hardware costs, other types of high-precision angle feedback devices can be considered, such as high-precision turntables, pan-tilt units, and inertial measurement units (IMUs). These devices only need to provide sufficiently accurate angle feedback to serve as a reference source to replace the high-precision angle encoder. Selecting appropriate reference devices in different application scenarios can reduce hardware investment while ensuring calibration accuracy.

[0045] In this embodiment, other main control schemes and drivers are used instead of the current scheme; the current scheme uses a main control board and a control board to drive the motor rotation. Many commercial drivers can also achieve similar calibration schemes, as long as they have the function of acquiring and processing reference angles and magnetic encoder angles. In addition, these two angle signals can also be transmitted to a host computer for processing via serial port or other communication methods, and the host computer only needs to control the speed of the commercial driver. Therefore, the hardware combination of commercial drivers, common host computer equipment, etc. can also implement this scheme, which lowers the implementation threshold of the system and improves its universality.

[0046] In this embodiment, an adaptive sampling point generation method is used instead of the calibration point generation method. Specifically, the current solution uses uniformly distributed sampling points because this method is simple and effective, but it can be further optimized. For example, the operating conditions of the magnetic encoder can be determined before calibration. For instance, if the encoder operates under dynamic load and changing motion states, an adaptive algorithm can be used to dynamically adjust the density and distribution of sampling points based on the motor's load, speed, and other motion parameters. Different sampling point distribution methods can also be designed according to other characteristic requirements.

[0047] In summary, this invention performs automatic magnetic encoder calibration based on online sampling of dynamic interval points using open-loop control. Through continuous unidirectional rotation, high-density sampling, and a strategy that eliminates the need for stabilization, it achieves a highly efficient, accurate, and engineering-adaptable magnetic encoder calibration scheme that requires no physical index points, has no reciprocating motion, and can be quickly started from any position.

[0048] This invention proposes a continuous unidirectional high-density online sampling and calibration scheme based on open-loop approximately constant speed dragging, in order to overcome the traditional limitations of sparse sampling, reliance on stationary state, reliance on zero position, and difficulty in balancing efficiency and accuracy.

[0049] This invention employs a non-sequential point acquisition mechanism, which detects and acquires any unacquired target points in real time, eliminating the need for sequential scanning. During calibration, the non-sequential point acquisition mechanism does not simply check the next point sequentially; data is acquired as the motor approaches any unacquired target point during rotation. Even if some target points are missed due to the low update frequency of the reference encoder, subsequent reachable points can still be acquired, avoiding the need for an idle rotation to reach missed points and shortening calibration time.

[0050] This invention performs dynamic interval sampling and unidirectional continuous rotation without requiring complete stabilization; a brief stability check is only performed when approaching the target point. This invention allows for starting from any position, eliminating the need for a physical zero point to begin calibration. This invention eliminates the need for a physical index and can start at any position: since calibration points can be generated from random locations, the system can initiate calibration from any position, improving the flexibility and convenience of the calibration process and solving the problem that traditional methods typically rely on physical zero points or index points as starting points.

[0051] In the dynamic interval sampling technology adopted in this invention, the motor does not need to come to a complete stop during continuous unidirectional rotation. A brief stability check is only performed when approaching the target point. This solves the problem of the significant increase in overall calibration time caused by the need for acceleration, deceleration and stabilization processes at each step in traditional methods. At the same time, it avoids the consistency error problem that may be introduced by overshoot or small commutation adjustments during the approach to the target angle in traditional methods.

[0052] This invention employs high-density interval point setting, unrestricted by the number of motor pole pairs, theoretically capable of generating any number of sampling points within a 360° range. Furthermore, the hardware implementation is simple, eliminating the need for closed-loop position feedback and broadening its applicability. During the high-density interval point setting process, this invention utilizes SVPWM to achieve open-loop strong drag, subdividing the angle of each rotation. This allows for the uniform setting of multiple target sampling points within a 360° range at fixed intervals, unrestricted by the number of motor pole pairs. This solves the problem of sparse sampling point distribution and difficulty in guaranteeing interpolation accuracy caused by the traditional open-loop stepping method's limitation on the number of motor pole pairs.

[0053] This invention features system simplicity and high portability. It can be implemented with only a main control MCU and its built-in resources in conjunction with a three-phase inverter. There is no need for position feedback from a closed-loop control system. It is applicable to various types of motors. The determination of whether the sampling point has been reached is made by comparing the encoder data used for reference with the preset calibration point, rather than relying on the angle feedback from the motor itself. The angle is accurate, and the system implementation threshold is greatly reduced, improving the versatility and portability of the solution.

[0054] This invention employs a bidirectional independent calibration table, establishing separate forward and reverse calibration tables. Compensation is switched according to the direction of motion, avoiding hysteresis or similar phenomena that reduce calibration accuracy. This invention uses a bidirectional calibration strategy, establishing independent forward and reverse calibration tables. The appropriate calibration table is selected for angle compensation based on the current direction of motion of the magnetic encoder, effectively compensating for potential mechanical hysteresis and system delay, thus improving the accuracy of angle calibration.

[0055] This invention solves the technical problems existing in the prior art, such as the reliance on physical index points and reciprocating motion for startup operations, the limitation of startup by position factors, and the low efficiency, accuracy, and engineering adaptability of magnetic encoder calibration.

[0056] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method of calibrating a magnetic encoder based on dynamic interval point sampling, characterized in that, The method comprises: S1, setting the motor rotation direction and constant rotation speed, driving the motor to rotate continuously in one direction, when the motor is in a stable state, collecting forward data, stopping the motor when the collection is completed, and obtaining forward calibration data; S2, setting the motor rotation direction opposite to S1, driving the motor to rotate continuously in one direction, when the motor is in a stable state, collecting reverse data, stopping the motor when the collection is completed, and obtaining reverse calibration data; S3, sorting the forward calibration data and the reverse calibration data in ascending order and descending order according to the magnetic encoder angle value, adding virtual points at the ends of the two calibration tables, and performing calibration data processing operation to obtain correction data; S4, in the compensation stage, selecting the corresponding calibration table according to the motion direction, searching and interpolating the correction data according to the bisection method to calculate the calibrated accurate angle.

2. The dynamic gap point sampling based magnetic encoder calibration method of claim 1, wherein, In S1, when the motor is in a stable state, NUM_SAMPLES target sampling points are uniformly set in the preset angle range according to the preset sampling interval; During the continuous rotation of the motor, when it is detected that the current position is close to the target point, a stability check is performed, and high-precision reference encoder and magnetic encoder angle data are synchronously collected, and a collection state flag is marked; The stability check, the synchronous collection and the collection state flag are repeatedly executed until the data collection of all target points in the motor rotation direction is completed, and the motor is stopped.

3. The dynamic gap point sampling based magnetic encoder calibration method of claim 1, wherein, During the magnetic encoder dynamic interval point collection process of S1, the current position of the motor is continuously detected; It is judged whether there is an uncollected target point close to the target point; if not, the current position of the motor is continuously detected; If yes, a short-term stability check is performed; It is judged whether the short-term stability check is passed; if not, the current position of the motor is continuously detected; If yes, the double-encoder data is synchronously collected; The target point is marked as collected; It is judged whether all target points have been collected; if not, the current position of the motor is continuously detected; If yes, the motor is stopped.

4. The dynamic gap point sampling based magnetic encoder calibration method of claim 1, wherein, In S2, set the expected rotation speed, start the motor to rotate continuously in one direction, when the motor is in a stable state, uniformly set NUM_SAMPLES target sampling points in the preset angle range according to the preset sampling interval.

5. The dynamic gap point sampling based magnetic encoder calibration method of claim 1, wherein, In S2, during the continuous rotation of the motor, when it is detected that the current position is close to the target point, a stability check is performed, and high-precision reference encoder and magnetic encoder angle data are synchronously collected, and a collection state flag is marked.

6. The dynamic gap point sampling based magnetic encoder calibration method of claim 1, wherein, In S3, the forward calibration data is sorted in ascending order according to the magnetic encoder angle value in the main control board, and the reverse calibration data is sorted in descending order according to the magnetic encoder angle value.

7. The dynamic gap point sampling based magnetic encoder calibration method of claim 1, wherein, In S3, virtual points are added at the ends of the two calibration tables to complete the data collection and processing process.

8. The dynamic gap point sampling based magnetic encoder calibration method of claim 1, wherein, In the compensation stage of S4, the corresponding calibration table is selected according to the motion direction, and the current magnetic encoder original angle is determined in the calibration table by bisection search. According to the position of the current magnetic encoder original angle in the calibration table, interpolation coefficients between two adjacent points are calculated, and the calibrated accurate angle is calculated according to the interpolation coefficients.

9. The dynamic gap point sampling based magnetic encoder calibration method of claim 8, wherein, The calibrated accurate angle is calculated by using the following logic: The system obtains the encoder angle in real time during operation θ m The encoder angle is located in the interval in the lookup table through dichotomy θ m,i , θ m,i+1 The interpolation coefficient between the two adjacent points is calculated k The difference between the two adjacent points is combined S ; wherein, when calculating the difference S , if the target real angle meets the preset condition, the ring bias constraint is introduced to the angle difference, to ensure the continuity of the interpolation value range and follow the shortest angle path; wherein, the calibrated angle is calculated according to the following formula θ mc : 。 10. A magnetic encoder calibration system based on dynamic interval point sampling, characterized in that, The system comprises: A forward acquisition module is configured to set the rotating direction and constant rotating speed of the motor, drive the motor to rotate continuously in one direction, perform forward data acquisition when the motor is in a stable state, stop the motor when the acquisition is completed, and obtain forward calibration data. A reverse acquisition module is configured to set the rotating direction of the motor opposite to the S1, drive the motor to rotate continuously in one direction, perform reverse data acquisition when the motor is in a stable state, stop the motor when the acquisition is completed, and obtain reverse calibration data. A correction module is configured to sort the forward calibration data and the reverse calibration data in ascending order and descending order according to the angle value of the magnetic encoder, add virtual points at the ends of two calibration tables, perform calibration data processing operations, and obtain correction data. A supplementary module is configured to select a corresponding calibration table according to the motion direction in the compensation stage, calculate the calibrated accurate angle of the correction data according to the bisection method search and interpolation coefficients, and connect the supplementary module with the correction module.

Citation Information

Patent Citations

  • Magnetic encoder calibrating method and system

    CN106679710A

  • Magnetic encoder, calibration method and device for magnetic encoder, motor and unmanned aerial vehicle

    CN109655083A

  • Magnetic encoder calibration method and system

    CN111076761A

  • Calibration system and method for motor open-loop self-calibration

    CN118739939A

  • Calibration system and method for closed-loop self-calibration of motor

    CN118739954A