Miniature motor magnetic coding calibration method, system and device and storage medium
Through the coordinated work of machine vision equipment and drive controller, the calibration array is established and optimized and error compensation is performed, the problem of low calibration accuracy of micro motors is solved, and high-precision calibration is achieved, which is suitable for micro high-precision motors.
Patent Information
- Application Number
- CN202510454816.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-11
- Publication Date
- 2025-06-20
AI Technical Summary
The prior art is difficult to achieve high-precision micro motor magnetic braiding calibration, especially when micro motors are difficult to ensure coaxiality and couplings are difficult to select. The traditional servo tow platform scheme is costly and installation errors affect calibration accuracy.
The machine vision device detects the rotor angle of the motor to be calibrated and feeds the detection value back to the drive controller to establish an initial calibration array, conducts legality detection and correction, establishes a bias calibration array, performs error compensation, and finally calibrates the rotor angle according to the calibration array.
The high-precision micro motor magnetic braid calibration is realized, which avoids the dependence of servo on the drag platform, reduces costs, and improves calibration accuracy. It is suitable for micro high-precision motors.
Smart Images

Figure CN120185462A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of motor control, and particularly to a magnetic encoder calibration method, system, device and storage medium for a micro-motor. Background Art
[0002] High-precision motors are widely used in industries, medical treatment, aerospace, scientific research and other fields. In order to achieve high-precision motor control, high-precision sensor feedback is essential. For example, a position encoder is often used for the feedback of the motor rotor position and speed. Taking the most common magnetic encoder as an example, due to installation tolerances, uneven magnet magnetization or skew of the magnetic encoder chip mounting, if the magnetic encoder feedback signal is directly used, there are often large absolute position errors, and the position encoder needs to be calibrated to obtain higher absolute accuracy.
[0003] The current mainstream solution is to install the magnetic encoder on the shaft of the motor to be calibrated, and complete the calibration by the drag method using a servo motor with a higher-precision encoder. However, this solution relies on a servo drag platform, has high costs, and the installation error affects the calibration accuracy. Moreover, for micro-motors, it is difficult to ensure coaxiality and select a coupling, making this solution difficult to implement for micro-motors. Summary of the Invention
[0004] In view of this, the purpose of the present invention is to overcome the deficiencies in the prior art and provide a magnetic encoder calibration method, system, device and storage medium for a micro-motor.
[0005] The present invention provides the following technical solutions:
[0006] In a first aspect, the present invention provides a magnetic encoder calibration method for a micro-motor, which is applied to a magnetic encoder calibration system for a micro-motor. The magnetic encoder calibration system for a micro-motor includes a motor to be calibrated, a drive controller and a machine vision device. The method includes:
[0007] The machine vision device detects the rotor angle of the motor to be calibrated and feeds back the detected rotor angle detection value to the drive controller. The drive controller establishes an initial calibration array according to the rotor angle detection value;
[0008] The drive controller performs a legality detection on the rotor angle detection values in the initial calibration array, and corrects the detected abnormal rotor angle data to obtain an optimized calibration array;
[0009] The drive controller establishes a bias calibration array, and performs error compensation on the optimized calibration array through the bias calibration array to obtain a calibration array, and calibrates the rotor angle of the motor to be calibrated according to the calibration array.
[0010] In an alternative embodiment, the machine vision device detects the rotor angle of the motor to be calibrated and feeds back the detected rotor angle detection value to the drive controller. The drive controller establishes an initial calibration array based on the rotor angle detection value, including:
[0011] Determine whether the system initialization is completed. If so, the drive controller controls the rotor of the motor to be calibrated to be positioned at the absolute zero point;
[0012] Determine whether the rotor is positioned at the absolute zero point. If so, the drive controller sends a query instruction for a preset number of times to the machine vision device. The machine vision device samples the rotor angle of the motor to be calibrated at the i-th calibration point for a preset number of times according to the query instruction and feeds back each sampled rotor angle detection value to the drive controller. The drive controller calculates the range and average value of all received rotor angle detection values;
[0013] Determine whether the range exceeds a preset threshold. If not, the drive controller establishes a calibration array corresponding to the i-th calibration point and records the average value through the calibration array, where i is used as the index of the calibration array and increases in accordance with a preset step length starting from the absolute zero point;
[0014] The drive controller calculates the number of calibration points according to the preset step length and determines whether the index of the calibration array is greater than the number of calibration points. If so, stop the calibration and generate the initial calibration array based on all the calibration arrays.
[0015] In an alternative embodiment, after determining whether the system initialization is completed, it further includes:
[0016] If not, determine whether the initialization waiting time exceeds a first preset time threshold. If it exceeds, generate a first timeout fault message;
[0017] After determining whether the rotor is positioned at the absolute zero point, it further includes:
[0018] If not, determine whether the positioning waiting time exceeds a second preset time threshold. If it exceeds, generate a second timeout fault message;
[0019] After determining whether the range exceeds a preset threshold, it further includes:
[0020] If so, mark the calibration array corresponding to the i-th calibration point as an invalid array.
[0021] In an alternative embodiment, the drive controller performs a legality check on the rotor angle detection values in the initial calibration array and corrects the detected abnormal rotor angle data to obtain an optimized calibration array, including:
[0022] The drive controller checks whether two consecutive invalid arrays appear in the initial calibration array;
[0023] If so, for the invalid array, calculate the mean value of its adjacent non-invalid arrays, and use the mean value of its adjacent non-invalid arrays to replace the invalid array to obtain the optimized calibration array.
[0024] In an alternative embodiment, the error compensation of the optimized calibration array by the offset calibration array to obtain the calibration array includes:
[0025] Taking the absolute zero point as a reference, according to the first preset compensation value calculation formula and through the offset calibration array, calculate the offset compensation value of each calibration point position, and generate the calibration array according to the offset compensation value of each calibration point position;
[0026] Wherein, the first preset compensation value calculation formula is:
[0027]
[0028] Wherein,
[0029] B(n) = A(n) - A(0)
[0030]
[0031] In the formula, B(n) is the offset calibration array corresponding to the rotor at the nth calibration point position, A(n) is the calibration array corresponding to the rotor at the nth calibration point position, A(0) is the angle value sampled by the machine vision device when the rotor is at the absolute zero point, C(n) is the offset compensation value of the nth calibration point position, a is the per-unit value increment corresponding to the current calibration point position, is the preset step size, and num is the per-unit value.
[0032] In an alternative embodiment, the error compensation of the optimized calibration array by the offset calibration array to obtain the calibration array further includes:
[0033] Taking the linear interpolation result of the two positions before and after the calibration point position as a reference, according to the second preset compensation value calculation formula and through the offset calibration array, calculate the offset compensation value of each calibration point position, and generate the calibration array according to the offset compensation value of each calibration point position;
[0034] Wherein, the second preset compensation value calculation formula is:
[0035]
[0036] Wherein,
[0037]
[0038] Among them,
[0039] a = bn
[0040]
[0041] In the formula, D(n) is the linear interpolation result of the two positions before and after the nth calibration point position, B[m] and B[m - 1] are two adjacent offset calibration arrays where a is located determined by binary search, and b is the per-unit value increment corresponding to a single preset step.
[0042] In an alternative embodiment, calibrating the rotor angle of the motor to be calibrated according to the calibration array includes:
[0043] The drive controller generates a control instruction according to the offset compensation value of each calibration point position in the calibration array, and issues the control instruction to the motor to be calibrated;
[0044] The motor to be calibrated calibrates the rotor angle according to the offset compensation value in the control instruction.
[0045] In a second aspect, the present invention provides a micro-motor magnetic encoder calibration system, the system includes a motor to be calibrated, a drive controller and a machine vision device;
[0046] The machine vision device is used to detect the rotor angle of the motor to be calibrated, and feed back the detected rotor angle detection value to the drive controller;
[0047] The drive controller is used to establish an initial calibration array according to the rotor angle detection value;
[0048] The drive controller is further used to perform a legality check on the rotor angle detection values in the initial calibration array, and correct the detected abnormal rotor angle data to obtain an optimized calibration array;
[0049] The drive controller is further used to establish an offset calibration array, and perform error compensation on the optimized calibration array through the offset calibration array to obtain a calibration array, and calibrate the rotor angle of the motor to be calibrated according to the calibration array.
[0050] In a third aspect, an embodiment of the present disclosure provides a computer device, the computer device includes a memory and a processor, the memory stores a computer program, and when the processor executes the computer program, it implements the steps of the micro-motor magnetic encoder calibration method described in the first aspect.
[0051] Fourthly, an embodiment of the present disclosure provides a computer-readable storage medium storing a computer program, which when executed by a processor, implements the steps of the micro-motor magnetic encoder calibration method described in the first aspect.
[0052] Advantages of the present application:
[0053] In the micro-motor magnetic encoder calibration method provided by the embodiment of the present application, the rotor angle of the motor to be calibrated is detected by the machine vision device, and the detected rotor angle detection value is fed back to the drive controller. The drive controller establishes an initial calibration array according to the rotor angle detection value; the drive controller performs a legality detection on the rotor angle detection values in the initial calibration array, and corrects the detected abnormal rotor angle data to obtain an optimized calibration array; the drive controller establishes a bias calibration array, and performs error compensation on the optimized calibration array through the bias calibration array to obtain a calibration array, and calibrates the rotor angle of the motor to be calibrated according to the calibration array. The present application belongs to a reverse non-contact calibration scheme for calibration and positioning, improves the calibration accuracy through different interpolation methods, and is applicable to scenarios where calibration of micro high-precision motors and the like that cannot use a servo counter-dragging platform is required.
[0054] To make the above objects, features, and advantages of the present invention more obvious and understandable, the following specifically enumerates preferred embodiments and, in conjunction with the accompanying drawings, makes the following detailed description. Description of the Drawings
[0055] To more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required to be used in the embodiments. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as limiting the scope. For those of ordinary skill in the art, other related drawings can be obtained based on these drawings without creative efforts. In each drawing, similar components are numbered similarly.
[0056] Figure 1 Shows a flowchart of a micro-motor magnetic encoder calibration method provided by an embodiment of the present application;
[0057] Figure 2 Shows a flowchart of another micro-motor magnetic encoder calibration method provided by an embodiment of the present application;
[0058] Figure 3 Shows a schematic structural diagram of a micro-motor magnetic encoder calibration system provided by an embodiment of the present application;
[0059] Figure 4 Shows a schematic structural diagram of a computer device provided by an embodiment of the present application. Detailed implementation manners
[0060] The embodiments of the present invention will be described in detail below. Examples of the embodiments are shown in the accompanying drawings, where the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention and should not be construed as limiting the present invention.
[0061] It should be noted that the terms "first" and "second" are only used for descriptive purposes and cannot be construed as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features. Thus, the features defined with "first" and "second" may explicitly or implicitly include one or more of such features. In the description of the present invention, "a plurality of" means two or more unless otherwise specifically defined.
[0062] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the technical field to which this application belongs. The terms used in the description of the template herein are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The term "and / or" used herein includes any and all combinations of one or more of the related listed items.
[0063] Embodiment 1
[0064] As Figure 1 shown, it is a flowchart of a magnetic encoder calibration method for a micro motor in an embodiment of the present application. The magnetic encoder calibration method for a micro motor provided in the embodiment of the present application is applied to a magnetic encoder calibration system for a micro motor. The magnetic encoder calibration system for a micro motor includes a motor to be calibrated, a drive controller, and a machine vision device. The specific method includes the following steps:
[0065] Step S110, the machine vision device detects the rotor angle of the motor to be calibrated and feeds back the detected rotor angle detection value to the drive controller. The drive controller establishes an initial calibration array according to the rotor angle detection value.
[0066] It can be understood that the system of the present application mainly has three components: a motor to be calibrated, a drive controller, and a machine vision device. Different from the passive positioning method of servo counter-dragging, the present application requires the active movement of a dedicated drive controller for the motor. The active movement can cover the full-cycle angle (such as 360°), avoiding the positioning deviation caused by load changes or mechanical clearances in passive positioning. Then, the machine vision device captures the features at the shaft end of the motor to be calibrated and feeds back the corresponding real rotor angle change to the drive controller, and the calibration processing algorithm is completed inside the drive controller.
[0067] It should be noted that before starting the calibration, two preconditions need to be met. First, the drive controller has completed the initial position calibration of the motor rotor to be calibrated. Second, the system should have a stable position loop control function (no jitter can be achieved when reaching the position relative to the magnetic encoder feedback).
[0068] Before the calibration is completed, the position loop control is based on the magnetic encoder feedback position of the motor. Due to the non-linear error of the magnetic encoder itself and external environmental factors, there is a deviation between the magnetic encoder feedback position and the true rotor position at this time. For example, when the drive controller controls the rotor to position at the 5° position, in fact, the rotor may be at 4.8° or may have reached 5.3°, with a certain deviation. Therefore, in this embodiment, a machine vision device is combined to detect the rotor angle.
[0069] Specifically, as Figure 2 shown, first, start the data calibration process. The system enters the initialization stage, and at the same time, ensure that all hardware devices are correctly connected and powered on. Then, detect whether the system has completed the power-on initialization. If the system has not completed the power-on initialization yet, continue to wait and at the same time judge whether the initialization waiting time exceeds the first preset time threshold to prevent the system from getting stuck. If it exceeds, generate the first timeout fault information. At this time, it may indicate that a certain device has failed, and relevant personnel can perform maintenance in a timely manner according to the first timeout fault information. If the system has completed the power-on initialization, the drive controller controls the rotor of the motor to be calibrated to position at the absolute zero point (i.e., 0°). Here, the 0° is the rotor angle feedback by the magnetic encoder, and this position is also the absolute zero point of the calibration. It can be considered that the true angle at this point is 0°, and the subsequent angles are judged for deviation relative to this point.
[0070] Next, judge whether the rotor has been positioned at the absolute zero point. If the rotor has not reached the position yet, continue to wait and judge whether the positioning waiting time exceeds the second preset time threshold. If it exceeds, generate the second timeout fault information, and relevant personnel need to consider the retry mechanism to improve the system reliability. If the rotor has reached the position, the drive controller sends a query instruction with a preset number of times (such as 5 times) to the machine vision device. The machine vision device samples the rotor angle of the motor to be calibrated at the i-th calibration point position for the preset number of times according to the query instruction, and feeds back the detected value of the rotor angle sampled each time to the drive controller. The drive controller calculates the range and average value of all received rotor angle detection values. This is because the sampling of the machine vision device captures a certain physical feature at the end of the rotor shaft. Limited by the light and shadow effect and the limitations of the vision algorithm, the true angles feedback at some angle points may fluctuate greatly. Therefore, through multiple samplings, the range judgment and averaging process are increased to improve the accuracy of the feedback data.
[0071] It should be noted that when the transposition is at the absolute zero position, the real angle feedback by the machine vision device is not necessarily zero, because the zero degree defined inside the machine vision does not coincide with the zero point of the rotor position. Starting from the absolute zero point, it increases by a fixed preset step length to cover the entire mechanical cycle (360°), ensuring no dead angle in calibration. This preset step length determines the final accuracy and calibration efficiency of calibration. The larger the preset step length, the higher the efficiency, but the worse the calibration effect, and vice versa. Exemplarily, if the preset step length is 5°, the number of calibration points is 72, which is suitable for high-precision scenarios; if the step length is 20°, the number of calibration points is 18, which is suitable for rapid calibration. In addition, after each increase of the preset step length, it is necessary to judge whether it has reached the position to ensure that the rotor has been controlled in place.
[0072] After calculating the range corresponding to the i-th calibration point, it is judged whether the range exceeds the preset threshold. If it does not exceed, the drive controller establishes the calibration array A[i] corresponding to this calibration point, and records the corresponding average value through the calibration array A[i], uses i as the index of the calibration array A[i], initializes i to 0, and increments it after each loop.
[0073] It should be noted that if the range corresponding to the i-th calibration point exceeds the preset threshold, it indicates that a certain device may malfunction at this time. Then, the calibration array corresponding to this calibration point is marked as an invalid array, that is, A[i]=0xFFFF. By marking the abnormal invalid array as 0xFFFF, it is possible to quickly identify which data points have problems, avoid the negative impact of these data on subsequent calibration processing, and improve the robustness of the entire calibration process. In subsequent compensation calculations, special processing can be performed on these abnormal data to improve the calibration accuracy.
[0074] Furthermore, the drive controller calculates the number of calibration points N according to the preset step length, N = 360÷preset step length. For example, if the preset step length is 10°, 360° requires 360÷10 = 36 calibration points. It is judged whether the index i of the calibration array is greater than the number of calibration points N. When i increases to N, it means that the rotor has completed one mechanical cycle of rotation, and the calibration can be stopped. If it is necessary to verify the repeatability accuracy, several groups of data can be continued to be stepped and calibrated after returning to the absolute zero position.
[0075] After completing the data calibration of all calibration points, multiple groups of calibration arrays are obtained, and the multiple groups of calibration arrays are merged into an initial calibration array A.
[0076] The above method combines active motion control with machine vision to directly obtain the real angle of the rotor, avoid the non-linear error of magnetic encoding and environmental interference, and improve the initial calibration accuracy; multiple samplings combined with range processing enhance the data reliability and provide a high-quality benchmark for subsequent calibration.
[0077] Step S120: The drive controller performs a legality check on the rotor angle detection values in the initial calibration array, and corrects the detected abnormal rotor angle data to obtain an optimized calibration array.
[0078] After the data calibration is completed, a legality check is performed on the data in the initial calibration array A. If two consecutive invalid arrays 0xFFFF are found, it indicates that the vision detection device has experienced a large fluctuation at two consecutive calibration points, which may be due to equipment failure or dirt on the capture feature at the motor shaft end.
[0079] For the detected invalid arrays, calculate the mean of the two adjacent non-invalid arrays before and after it, and use this mean to replace the invalid array, that is, A[i] = (A[i - 1] + A[i + 1]) / 2, to ensure the integrity and continuity of the data, avoid overall calibration failure caused by local anomalies, and finally obtain an optimized calibration array.
[0080] It should be noted that the calibration array exceeding one mechanical cycle can be used for repeated precision checking. Calculate the range of the true angles fed back by the machine vision device at the same rotor angle. If it exceeds the preset threshold, it means that the repeated precision is exceeded. In fact, the repeated precision of general magnetic encoders is much higher than the absolute precision.
[0081] The above method effectively identifies and repairs vision detection anomalies (such as equipment failure or contamination) through the legality detection and abnormal data correction mechanism, ensuring the integrity of the calibration data.
[0082] Step S130: The drive controller establishes a bias calibration array, and performs error compensation on the optimized calibration array through the bias calibration array to obtain a calibration array, and calibrates the rotor angle of the motor to be calibrated according to the calibration array.
[0083] After passing the data legality check, calibration compensation begins, which is the most important link to ensure the final control accuracy. First, establish a bias calibration array B[N], align the feedback reference of the machine vision device with the absolute zero point, eliminate the inherent deviation between the vision and the absolute zero point, and the calculation method is as follows:
[0084] B(n) = A(n) - A(0)
[0085] In the formula, B(n) is the bias calibration array corresponding to the rotor at the nth calibration point, A(n) is the calibration array corresponding to the rotor at the nth calibration point, and A(0) is the angle value sampled by the machine vision device when the rotor is at the absolute zero point.
[0086] Based on the above bias calibration array, this embodiment proposes two compensation value calculation schemes: a linear error compensation algorithm based on the absolute zero point and a piecewise error compensation algorithm based on the calibration points. The specific process is as follows:
[0087] (1) Linear error compensation algorithm based on the absolute zero point:
[0088] Taking the absolute zero point as the reference, according to the first preset compensation value calculation formula and through the bias calibration array, calculate the bias compensation value of each calibration point. The first preset compensation value calculation formula is as follows:
[0089]
[0090] Among them,
[0091]
[0092] In the formula, C(n) is the bias compensation value of the nth calibration point, a is the per-unit value increment corresponding to the current calibration point, is the preset step size, and num is the per-unit value.
[0093] It can be understood that based on the linear error compensation algorithm of the absolute zero point, the calculation of the bias compensation value of each calibration point is based on the absolute zero point. Assuming that the error changes linearly with the angle from the absolute zero point, through the square term a 2 the compensation weight of the far-distance point can be amplified to enhance the linear fitting effect. This method is simple to calculate, but if there is a large accuracy deviation in the adjacent interval of the calibration point, the compensation value error may be large.
[0094] (2) Piecewise error compensation algorithm based on the calibration points:
[0095] Taking the linear interpolation result of the two positions before and after the calibration point as the reference, according to the second preset compensation value calculation formula and through the bias calibration array, calculate the bias compensation value of each calibration point. The second preset compensation value calculation formula is:
[0096]
[0097] Among them,
[0098]
[0099] Among them,
[0100] a = bn
[0101]
[0102] Where D(n) is the linear interpolation result of the two positions before and after the nth calibration point position, B[m] and B[m - 1] are two adjacent bias calibration arrays where a is determined by binary search, and b is the per-unit value increment corresponding to a single preset step size.
[0103] Understandably, based on the piecewise error compensation algorithm for calibration point positions, the bias compensation value for each calibration point position is calculated by linear interpolation between the two adjacent positions before and after, making the compensation curve more conform to the actual error distribution. The assumption is that the precision deviation within the calibration interval changes linearly. This method has relatively complex calculations and requires searching for the corresponding calibration point positions, but the calculation accuracy of the compensation value is higher and more stable.
[0104] It should be noted that different error compensation calculation schemes can be selected according to the actual application scenario, and only one of the above two compensation calculation schemes needs to be chosen. The embodiments of this application do not make any limitations in this regard. Similarly, interpolation calculation can be performed using the bias compensation values of two adjacent positions within the interval of the calibration point positions. In addition, the actual precision of the calibration scheme is also affected by the preset step size and the detection precision of the machine vision device. The smaller the step size, the denser the sampling points, and the higher the precision of the compensation table (but the efficiency decreases). Higher calibration precision can be obtained by reducing the preset step size, but the highest precision cannot exceed the detection precision of the machine vision device.
[0105] Finally, a calibration array is generated according to the bias compensation values of each calibration point position. The drive controller generates a control command based on the bias compensation values of each calibration point position in the calibration array and sends the control command to the motor to be calibrated. After receiving the control command, the motor to be calibrated calibrates the rotor angle according to the bias compensation value in the control command. For example, the original magnetic encoder value: 100°, compensation value query: C
[10] = 0.5° (assuming i = 10 corresponds to the 100° position), corrected position: 100° + 0.5° = 100.5°.
[0106] The above method establishes a bias calibration array to eliminate the visual reference deviation, provides two compensation algorithms (linear / piecewise), flexibly adapts to different error distribution scenarios, and significantly improves the calibration precision; the precision of the compensation table is guaranteed by both the step size and the visual detection precision, taking into account both efficiency and effect.
[0107] The micro-motor magnetic encoder calibration method provided by the embodiment of the present application detects the rotor angle of the motor to be calibrated through the machine vision device, and feeds the detected rotor angle detection value back to the drive controller. The drive controller establishes an initial calibration array according to the rotor angle detection value; the drive controller performs a legality detection on the rotor angle detection values in the initial calibration array, and corrects the detected abnormal rotor angle data to obtain an optimized calibration array; the drive controller establishes a bias calibration array, and performs error compensation on the optimized calibration array through the bias calibration array to obtain a calibration array, and calibrates the rotor angle of the motor to be calibrated according to the calibration array. The present application belongs to a reverse non-contact calibration scheme for calibration and positioning, improves the calibration accuracy through different interpolation methods, and is applicable to scenarios where calibration of micro high-precision motors and the like that cannot use a servo counter-rotating platform is required.
[0108] Embodiment 2
[0109] As Figure 3 shown, it is a schematic structural diagram of a micro-motor magnetic encoder calibration system 300 in the embodiment of the present application. The system includes a motor 310 to be calibrated, a drive controller 320, and a machine vision device 330;
[0110] The machine vision device 330 is configured to detect the rotor angle of the motor 310 to be calibrated, and feed the detected rotor angle detection value back to the drive controller 320;
[0111] The drive controller 320 is configured to establish an initial calibration array according to the rotor angle detection value;
[0112] The drive controller 320 is further configured to perform a legality detection on the rotor angle detection values in the initial calibration array, and correct the detected abnormal rotor angle data to obtain an optimized calibration array;
[0113] The drive controller 320 is further configured to establish a bias calibration array, and perform error compensation on the optimized calibration array through the bias calibration array to obtain a calibration array, and calibrate the rotor angle of the motor 310 to be calibrated according to the calibration array.
[0114] The micro-motor magnetic encoder calibration system provided by the embodiment of the present application can implement each process of the micro-motor magnetic encoder calibration method corresponding to Embodiment 1, and can achieve the same technical effects. To avoid repetition, it will not be elaborated here.
[0115] The micro-motor magnetic encoder calibration system provided by the embodiment of the present application improves the calibration accuracy through different interpolation methods, and is applicable to scenarios where calibration of micro high-precision motors and the like that cannot use a servo counter-rotating platform is required.
[0116] Embodiment 3
[0117] The embodiment of the present application also provides a computer device. Specifically, please refer to Figure 4 , Figure 4 , which is the basic structural block diagram of the computer device in this embodiment.
[0118] The computer device 4 includes a memory 41, a processor 42, and a network interface 43 that are communicatively connected to each other through a system bus. It should be noted that only the computer device 4 with the memory 41, the processor 42, and the network interface 43 is shown in the figure. However, it should be understood that it is not required to implement all the shown components, and more or fewer components can be alternatively implemented. Among them, those skilled in the art of the present technology can understand that the computer device here is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), digital signal processors (DSPs), embedded devices, etc.
[0119] The computer device can be a desktop computer, a notebook, a palm computer, a cloud server, and other computing devices. The computer device can perform human-computer interaction with the user through a keyboard, a mouse, a remote control, a touchpad, a voice control device, or other means.
[0120] The memory 41 includes at least one type of readable storage medium, which includes flash memory, hard disk, multimedia card, card-type memory (such as SD or D-slot compatibility test memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory 41 may be an internal storage unit of the computer device 4, such as the hard disk or memory of the computer device 4. In other embodiments, the memory 41 may also be an external storage device of the computer device 4, such as a plug-in hard disk, Smart Media Card (SMC), Secure Digital (SD) card, Flash Card, etc. equipped on the computer device 4. Of course, the memory 41 may also include both the internal storage unit and the external storage device of the computer device 4. In this embodiment, the memory 41 is generally used to store the operating system and various application software installed on the computer device 4, such as computer-readable instructions of the slot compatibility test method, etc. In addition, the memory 41 may also be used to temporarily store various data that have been output or will be output.
[0121] In some embodiments, the processor 42 may be a central processing unit (CPU), controller, microcontroller, microprocessor, or other micro motor magnetic encoder calibration chip. The processor 42 is generally used to control the overall operation of the computer device 4. In this embodiment, the processor 42 is used to run the computer-readable instructions stored in the memory 41 or process data, such as running the computer-readable instructions of the slot compatibility test method.
[0122] The network interface 43 may include a wireless network interface or a wired network interface, and the network interface 43 is generally used to establish a communication connection between the computer device 4 and other electronic devices.
[0123] The computer device provided in this embodiment can execute the above-mentioned micro motor magnetic encoder calibration method. Here, the micro motor magnetic encoder calibration method may be the micro motor magnetic encoder calibration method of the above various embodiments.
[0124] Embodiment 4
[0125] This embodiment also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the micro motor magnetic encoder calibration method in the embodiment are implemented.
[0126] In this embodiment, the computer-readable storage medium includes flash memory, hard disks, multimedia cards, card-type memories (e.g., SD or DX memories, etc.), random access memories (RAM), static random access memories (SRAM), read-only memories (ROM), electrically erasable programmable read-only memories (EEPROM), programmable read-only memories (PROM), magnetic memories, magnetic disks, optical disks, etc. In some embodiments, the computer-readable storage medium may be an internal storage unit of a computer device, such as the hard disk or memory of the computer device. In other embodiments, the computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a Smart Media Card (SMC for short), a Secure Digital (SD for short) card, a Flash Card, etc., equipped on the computer device. Of course, the computer-readable storage medium may also include both the internal storage unit and the external storage device of the computer device. In this embodiment, the computer-readable storage medium is generally used to store the operating system and various application software installed on the computer device. In addition, the computer-readable storage medium may also be used to temporarily store various data that have been output or are to be output.
[0127] In several embodiments provided by the present application, it should be understood that the disclosed systems and methods may also be implemented in other ways. The system embodiments described above are merely illustrative. For example, the flowcharts and structure diagrams in the accompanying drawings show the possible architectures, functions, and operations of systems, methods, and computer program products according to multiple embodiments of the present invention. In this regard, each block in the flowchart or block diagram may represent a module, a program segment, or a part of code, and the module, program segment, or part of code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in an alternative implementation, the functions marked in the blocks may occur in a different order than marked in the accompanying drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the structure diagram and / or flowchart, as well as the combination of blocks in the structure diagram and / or flowchart, may be implemented by a dedicated hardware-based system for performing the specified functions or actions, or may be implemented by a combination of dedicated hardware and computer instructions.
[0128] In addition, in each embodiment of the present invention, the various functional modules or units may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
[0129] When the above-mentioned functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to enable a computer device (which can be a smart phone, a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium can be a non-volatile storage medium or a volatile storage medium. For example, the storage medium can be: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disc, etc., which are all media that can store program codes.
[0130] The above is only the specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present invention can easily think of changes or substitutions, which should all be covered by the protection scope of the present invention.
Claims
1. A micro motor magnetic engraving calibration method, characterized in that: Applied to a micro motor magnetic engraving calibration system, the micro motor magnetic engraving calibration system includes a motor to be calibrated, a drive controller and a machine vision device, the method includes: The machine vision device detects the rotor angle of the motor to be calibrated, and feeds back the detected rotor angle detection value to the drive controller, and the drive controller establishes an initial calibration array according to the rotor angle detection value; The drive controller performs a legitimacy check on the rotor angle detection values in the initial calibration array, and corrects the detected abnormal rotor angle data to obtain an optimized calibration array; The drive controller establishes an offset calibration array, and performs error compensation on the optimized calibration array through the offset calibration array to obtain a calibration array, and calibrates the rotor angle of the motor to be calibrated according to the calibration array.
2. The micromotor magnetic engraving calibration method according to claim 1, characterized in that: The machine vision device detects the rotor angle of the motor to be calibrated, and feeds back the detected rotor angle detection value to the drive controller, and the drive controller establishes an initial calibration array according to the rotor angle detection value, including: Determine whether the system initialization is completed, and if so, the drive controller controls the rotor of the motor to be calibrated to be positioned to an absolute zero point; Determine whether the rotor is positioned at the absolute zero point. If so, the drive controller sends a preset number of query instructions to the machine vision device. The machine vision device samples the rotor angle of the motor to be calibrated at the i-th calibration point a preset number of times according to the query instruction, and feeds back the rotor angle detection value sampled each time to the drive controller. The drive controller calculates the range and average value of all received rotor angle detection values. Determine whether the range exceeds a preset threshold value. If not, the drive controller establishes a calibration array corresponding to the i-th calibration point, and records the average value through the calibration array, wherein i is used as the index of the calibration array, and increases according to a preset step length starting from the absolute zero point; The drive controller calculates the number of calibration points according to the preset step size, and determines whether the index of the calibration array is greater than the number of calibration points. If so, the calibration is stopped, and the initial calibration array is generated according to all the calibration arrays.
3. The micromotor magnetic engraving calibration method according to claim 2, characterized in that: After determining whether the system initialization is completed, the method further includes: If not, determining whether the initialization waiting time exceeds a first preset time threshold, and if so, generating first timeout fault information; After determining whether the rotor is positioned at the absolute zero point, the method further includes: If not, determining whether the positioning waiting time exceeds a second preset time threshold, and if so, generating second timeout fault information; After determining whether the range exceeds a preset threshold, the method further includes: If so, the calibration array corresponding to the i-th calibration point is marked as an invalid array.
4. The micromotor magnetic engraving calibration method according to claim 3, characterized in that: The drive controller performs a legitimacy check on the rotor angle detection values in the initial calibration array, and corrects the detected abnormal rotor angle data to obtain an optimized calibration array, including: The drive controller checks whether two invalid arrays appear consecutively in the initial calibration array; If so, for the invalid array, the mean of its adjacent non-invalid arrays is calculated, and the invalid array is replaced by the mean of its adjacent non-invalid arrays to obtain the optimized calibration array.
5. The micromotor magnetic engraving calibration method according to claim 2, characterized in that: The error compensation of the optimized calibration array by using the offset calibration array to obtain a calibration array includes: Taking the absolute zero point as a reference, calculating the offset compensation value of each calibration point according to a first preset compensation value calculation formula and through the offset calibration array, and generating the calibration array according to the offset compensation value of each calibration point; Wherein, the calculation formula of the first preset compensation value is: in, B(n)=A(n)-A(0) Wherein, B(n) is the offset calibration array corresponding to the rotor at the nth calibration point, A(n) is the calibration array corresponding to the rotor at the nth calibration point, A(0) is the angle value sampled by the machine vision device when the rotor is at the absolute zero point, C(n) is the offset compensation value of the nth calibration point, a is the per-unit value increment corresponding to the current calibration point, is the preset step size, and num is the per-unit value.
6. The micromotor magnetic engraving calibration method according to claim 5, characterized in that: The error compensation of the optimized calibration array is performed by the offset calibration array to obtain a calibration array, and further includes: Taking the linear interpolation results of the two positions before and after the calibration point as a reference, according to the second preset compensation value calculation formula and through the offset calibration array, the offset compensation value of each calibration point is calculated, and the calibration array is generated according to the offset compensation value of each calibration point; Wherein, the second preset compensation value calculation formula is: in, in, a=bn Where D(n) is the linear interpolation result of the two positions before and after the nth calibration point, B[m] and B[m-1] are the two adjacent bias calibration arrays where a is located determined by binary search, and b is the per-unit value increment corresponding to a single preset step size.
7. The micromotor magnetic engraving calibration method according to claim 6, characterized in that: The step of calibrating the rotor angle of the motor to be calibrated according to the calibration array comprises: The drive controller generates a control instruction according to the offset compensation value of each calibration point in the calibration array, and sends the control instruction to the motor to be calibrated; The motor to be calibrated calibrates the rotor angle according to the offset compensation value in the control instruction.
8. A micro motor magnetic engraving calibration system, characterized in that: The system includes a motor to be calibrated, a drive controller and a machine vision device; The machine vision device is used to detect the rotor angle of the motor to be calibrated and feed back the detected rotor angle detection value to the drive controller; The drive controller is used to establish an initial calibration array according to the rotor angle detection value; The drive controller is further used to perform a legitimacy check on the rotor angle detection values in the initial calibration array, and to correct the detected abnormal rotor angle data to obtain an optimized calibration array; The drive controller is further used to establish an offset calibration array, and perform error compensation on the optimized calibration array through the offset calibration array to obtain a calibration array, and calibrate the rotor angle of the motor to be calibrated according to the calibration array.
9. A computer device, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the micro-motor magnetic encoder calibration method according to any one of claims 1 to 7 when executing the computer program.
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 steps of the micro-motor magnetic encoder calibration method according to any one of claims 1 to 7 are implemented.
Citation Information
Cited By
Magnetic encoder angle calibration method, encoder, storage medium and product
CN121384119A