Motor compensation calibration method and motor control system
Patent Information
- Application Number
- CN202611419002.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-14
- Publication Date
- 2026-10-27
AI Technical Summary
现有技术大多依赖编码器进行位置反馈,但编码器本身存在零点漂移、非线性及安装偏差,导致高精度应用难以实现
本发明实施例提供了电机的补偿标定方法及电机控制系统,首先控制电机在检测行程内运动,并根据编码器反馈的位置数据和采集设备采集的实际位置数据确定位置偏差数据集;然后将检测行程分为多个误差评判区间,并根据位置偏差数据集和多个误差评判区间确定目标误差评判区间;最后控制电机运行至目标误差评判区间,根据目标误差评判区间对应的位置偏差数据调整采集设备的采集点数,并重新计算位置偏差数据集,直至多个误差评判区间均满足精度条件,得到误差补偿表。上述补偿标定方式,通过控制电机在检测行程内运动,并通过采集设备进行高精度采集,以确定误差补偿表,保证了电机在检测行程内位置偏差数据完整性和准确性,提高了误差补偿表的精度;此外,通过将检测行程分为多个误差评判区间,并确定目标误差评判区间,根据目标误差评判区间的位置偏差数据对采集点数进行迭代调整,不仅提高了迭代效率,还提高了整体定位精度在各个误差评判区间的均衡性,进一步提高了误差补偿表的精度,进而提高了电机的控制精度。
Smart Images

Figure CN122993574A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of motor control technology, and in particular to a method for motor compensation calibration and a motor control system. Background Technology
[0002] In practical applications, the absolute position accuracy of electric motors (such as rotary or linear motors) is often lower than the theoretical value due to mechanical errors, cogging forces, electromagnetic non-uniformity, and sensor errors. Existing technologies mostly rely on encoders for position feedback, but encoders themselves suffer from zero drift, non-linearity, and installation deviations, making high-precision applications difficult to achieve. Current motor compensation methods typically employ single measurements or fixed-error lookup tables, which cannot accurately compensate for the non-uniform error distribution throughout the motor's entire stroke, thus reducing the motor's control accuracy. Summary of the Invention
[0003] In view of this, the purpose of the present invention is to provide a motor compensation calibration method and a motor control system to alleviate the above-mentioned technical problems.
[0004] In a first aspect, embodiments of the present invention provide a motor compensation calibration method, comprising: controlling the motor to move within a detection stroke, and determining a position deviation dataset based on position data fed back by the encoder and actual position data collected by the acquisition device; wherein the position deviation dataset includes multiple position deviation data; dividing the detection stroke into multiple error evaluation intervals, and determining a target error evaluation interval based on the position deviation dataset and the multiple error evaluation intervals; controlling the motor to run to the target error evaluation interval, adjusting the number of acquisition points of the acquisition device based on the position deviation data corresponding to the target error evaluation interval, and recalculating the position deviation dataset until all multiple error evaluation intervals meet the accuracy conditions, thereby obtaining an error compensation table.
[0005] Optionally, the target error evaluation interval is determined based on the position deviation dataset and multiple error evaluation intervals, including: determining the cumulative error value of each error evaluation interval based on the position deviation data of each error evaluation interval; and taking the error evaluation interval with the largest cumulative error value as the target error evaluation interval.
[0006] Optionally, the target error evaluation interval is determined based on the position deviation dataset and multiple error evaluation intervals, including: determining the index parameters for each error evaluation interval based on the position deviation data for each error evaluation interval; wherein the index parameters include at least one of the following indicators: amplitude index, fluctuation index, gradient index, fitting residual index, and spectral energy index; determining the comprehensive score for each error evaluation interval based on the index parameters for each error evaluation interval and the weight corresponding to each indicator; and taking the error evaluation interval with the highest comprehensive score as the target error evaluation interval.
[0007] Optionally, based on the position deviation data of each error evaluation interval, determine the index parameters for each error evaluation interval, including: determining the average error or absolute value integral based on the position deviation data of each error evaluation interval, and using the average error or absolute value integral as the amplitude index of the error evaluation interval; and / or, determining the standard deviation or peak-valley value of the error based on the position deviation data of each error evaluation interval, and using the standard deviation or peak-valley value as the fluctuation index of the error evaluation interval; and / or, determining the interval error curve based on the position deviation data of each error evaluation interval, and using the maximum gradient value or gradient variance of the interval error curve as the gradient index of the error evaluation interval; and / or, determining the reference curve based on the position deviation dataset of the detection stroke, and calculating the sum of squared residuals between the actual position data and the reference curve for each error evaluation interval, using the sum of squared residuals as the fitting residual index of the error evaluation interval; and / or, performing a fast Fourier transform on the position deviation data of each error evaluation interval to determine the energy density, and using the energy density as the spectral energy index of the error evaluation interval.
[0008] Optionally, multiple error evaluation intervals all meet the accuracy condition, including: using the mean of the position deviation data of each error evaluation interval as the accuracy of each error evaluation interval; if the accuracy of each error evaluation interval is less than or equal to the preset accuracy, then it is determined that multiple error evaluation intervals all meet the accuracy condition.
[0009] Optionally, the method further includes: if the number of times the number of acquisition points of the acquisition device is adjusted reaches a preset number, and multiple error evaluation intervals still do not meet the accuracy conditions, then an alarm message is generated.
[0010] Optionally, before controlling the motor to move within the detection stroke, the method further includes: controlling the motor to move forward to a positive hard limit and controlling the motor to move backward to a negative hard limit, and determining the detection stroke based on the positive hard limit and the negative hard limit.
[0011] Optionally, the method further includes: obtaining the target position deviation dataset corresponding to the error compensation table; determining the standard error feature model function based on the target position deviation dataset; selecting multiple key position points within the physical stroke range of the motor shaft and determining a sparse deviation dataset; wherein the sparse deviation dataset includes position deviation data of multiple key position points, and the number of key position points is less than the number of collection points; determining an optimization objective function based on the standard error feature model function and the sparse deviation dataset, and determining the target error compensation table based on the optimization objective function and the standard error feature model function; wherein the target error compensation table includes compensation data of the motor throughout its entire stroke.
[0012] Optionally, the standard error characteristic model function is determined based on the target position deviation dataset, including: performing frequency domain and time domain analysis on the target position deviation dataset to determine the trend component and periodic component; and determining the standard error characteristic model function based on the trend component and periodic component.
[0013] Optionally, the optimization objective function is determined based on the standard error feature model function and the sparse deviation dataset, including: mapping the standard error feature model function to the motor shaft and constructing a mapping equation; and determining the optimization objective function based on the mapping equation and the position deviation data of multiple key position points.
[0014] Optionally, the target error compensation table is determined based on the optimization objective function and the standard error characteristic model function, including: optimizing the optimization objective function to determine the target parameters; wherein the target parameters include: the optimal value of the gain ratio coefficient, the optimal value of the phase offset, and the optimal value of the zero drift; and determining the target error compensation table based on the target parameters, the standard error characteristic model function, and the preset step size; wherein the preset step size is the control resolution of the motor driver.
[0015] Optionally, the method further includes: after generating the target error compensation table, determining multiple verification position points; controlling the motor to move to the multiple verification position points, and determining the verification residual for each verification position point; wherein the verification residual is determined based on the actual deviation and predicted deviation of each verification position point; and performing anomaly diagnosis on the motor shaft based on the verification residual and a preset threshold.
[0016] Optionally, the preset threshold includes a first threshold and a second threshold. The abnormal diagnosis of the motor shaft is performed based on the verification residual and the preset threshold, including: if the verification residual of at least one verification location point is greater than the second threshold, it is determined that the motor shaft has an assembly abnormality fault.
[0017] Optionally, anomaly diagnosis of the motor shaft is performed based on the verification residual and a preset threshold, including: if the verification residual of at least one verification location point is greater than the first threshold and less than or equal to the second threshold, the target error compensation table is updated based on the position data of multiple verification location points; after the target error compensation table is updated, if there is still at least one verification location point with a verification residual greater than the first threshold and less than or equal to the second threshold, then it is determined that the motor shaft has an assembly abnormality fault.
[0018] Optionally, the method further includes: after the target error compensation table is updated, if the verification residuals of multiple verification location points are all less than or equal to the first threshold, then the motor calibration is determined to be successful.
[0019] Optionally, the method further includes: if the verification residuals of multiple verification location points are all less than or equal to a first threshold, then the motor calibration is determined to be successful.
[0020] Optionally, the method further includes: when an assembly abnormality fault occurs in the motor shaft, acquiring the measured full-range data of the motor shaft based on the number of acquisition points; constructing a single-axis error model based on the measured full-range data, and redetermining the optimization objective function based on the single-axis error model and the sparse deviation dataset; and redetermining the target error compensation table based on the redetermined optimization objective function and the single-axis error model, wherein the verification residuals of multiple verification location points are all less than or equal to a first threshold.
[0021] Secondly, embodiments of the present invention also provide a motor control system, including: a control device, a data acquisition device, and a motor; wherein, the data acquisition device is used to acquire actual position data of the motor during operation and send the actual position data to the control device; the control device is used to perform compensation calibration on the motor using the motor compensation calibration method of the first aspect described above, to obtain a target error compensation table for the motor.
[0022] Optionally, the system also includes a motor driver and an encoder; a control device, which is also used to acquire the feedback position collected by the encoder when the motor is running; compensate the feedback position based on the target error compensation table; and drive the motor driver according to the compensated feedback position to control the motor.
[0023] Thirdly, embodiments of the present invention also provide a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the steps of the motor compensation calibration method described in the first aspect.
[0024] The embodiments of the present invention bring the following beneficial effects: This invention provides a motor compensation calibration method and a motor control system. First, the motor is controlled to move within a detection stroke, and a position deviation dataset is determined based on position data fed back by the encoder and actual position data collected by the acquisition device. Then, the detection stroke is divided into multiple error evaluation intervals, and a target error evaluation interval is determined based on the position deviation dataset and the multiple error evaluation intervals. Finally, the motor is controlled to run to the target error evaluation interval, and the number of acquisition points of the acquisition device is adjusted according to the position deviation data corresponding to the target error evaluation interval. The position deviation dataset is then recalculated until all error evaluation intervals meet the accuracy requirements, resulting in an error compensation table. This compensation calibration method, by controlling the motor to move within the detection stroke and using high-precision acquisition devices to determine the error compensation table, ensures the integrity and accuracy of the position deviation data within the detection stroke, thus improving the accuracy of the error compensation table. Furthermore, by dividing the detection stroke into multiple error evaluation intervals and determining the target error evaluation interval, and iteratively adjusting the number of acquisition points based on the position deviation data of the target error evaluation interval, not only is the iteration efficiency improved, but the overall positioning accuracy is also improved in terms of the balance across the various error evaluation intervals, further enhancing the accuracy of the error compensation table and ultimately improving the control accuracy of the motor.
[0025] Other features and advantages of the invention will be set forth in the following description, and will be apparent in part from the description, or may be learned by practicing the invention. The objects and other advantages of the invention are realized and obtained through the structures particularly pointed out in the description and the drawings.
[0026] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description
[0027] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0028] Figure 1 A flowchart illustrating a motor compensation calibration method provided in an embodiment of the present invention; Figure 2 A flowchart of the reuse and adjustment of an error compensation table is provided for an embodiment of the present invention; Figure 3 A schematic diagram of a motor control system provided in an embodiment of the present invention; Figure 4This is a schematic diagram of the structure of a control device provided in an embodiment of the present invention. Detailed Implementation
[0029] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings. 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.
[0030] To facilitate understanding of this embodiment, the embodiments of the present invention will be described in detail below.
[0031] This invention provides a method for compensating and calibrating a motor, such as... Figure 1 As shown, the method includes the following steps: Step S102: Control the motor to move within the detection stroke, and determine the position deviation dataset based on the position data fed back by the encoder and the actual position data collected by the acquisition device.
[0032] Specifically, during the compensation calibration process, the motor is controlled to move within the detection stroke, while simultaneously acquiring the encoder's position data and the acquisition device's actual position data of the motor. Here, the position data refers to the motor's motion position / displacement data. For example, 500 to 1000 acquisition points are evenly distributed within the detection stroke. When the motor moves within the detection stroke, the encoder's position data and the acquisition device's actual position data are acquired at each acquisition point. Based on the position data and the actual position data, the position deviation data of the motor at that acquisition point is determined. Furthermore, a position deviation dataset is formed based on the position deviation data from multiple acquisition points. Therefore, the position deviation dataset includes multiple position deviation data points, the specific number of which is determined by the number of acquisition points.
[0033] The acquisition devices include, but are not limited to, CCD (Charge Coupled Device) cameras and laser rangefinders. In practical applications, if the motor is a rotary motor, the acquisition device is preferably a CCD camera; if the motor is a linear motor, the acquisition device is preferably a laser rangefinder. The specific acquisition device can be set according to the actual situation.
[0034] Specifically, the acquisition device communicates with the control equipment of the motor control system and sends the acquired actual position data to the control equipment via Ethernet control automation technology (EtherCAT), CANFD (CAN with Flexible Data-Rate), or RS485 bus, so that the control equipment can perform compensation calibration based on the actual position of the motor.
[0035] Therefore, by controlling the motor to move within the detection stroke and by using the acquisition device to achieve high-precision, multi-point acquisition of the motor's actual position data throughout the entire detection stroke, the integrity and accuracy of the motor's position deviation data within the detection stroke are ensured, thereby improving the accuracy of the error compensation table.
[0036] Step S104: Divide the detection range into multiple error evaluation intervals, and determine the target error evaluation interval based on the position deviation dataset and the multiple error evaluation intervals.
[0037] Specifically, in order to improve the efficiency of determining the error compensation table, this embodiment of the invention further divides the detection journey into multiple error evaluation intervals, and determines the target error evaluation interval based on the position deviation dataset and multiple error evaluation intervals, thereby realizing the interval processing of the detection journey. This allows for iterative adjustment of the number of collection points based on the position deviation data of the target error evaluation interval, which not only improves the iteration efficiency but also improves the balance of the overall positioning accuracy across the various error evaluation intervals, thereby further improving the accuracy of the error compensation table.
[0038] Step S106: Control the motor to run to the target error evaluation interval, adjust the number of acquisition points of the acquisition device according to the position deviation data corresponding to the target error evaluation interval, and recalculate the position deviation dataset until multiple error evaluation intervals meet the accuracy conditions, and obtain the error compensation table.
[0039] The motor compensation calibration method provided in this invention controls the motor to move within a detection stroke and performs high-precision data acquisition using a data acquisition device to determine an error compensation table. This ensures the integrity and accuracy of the motor's position deviation data within the detection stroke, thereby improving the accuracy of the error compensation table. Furthermore, by dividing the detection stroke into multiple error evaluation intervals and determining a target error evaluation interval, the number of acquisition points is iteratively adjusted based on the position deviation data of the target error evaluation interval. This not only improves the iteration efficiency but also enhances the balance of overall positioning accuracy across various error evaluation intervals, further improving the accuracy of the error compensation table and ultimately enhancing the motor's control accuracy.
[0040] In one embodiment, before controlling the motor to move within the detection stroke, the method further includes: controlling the motor to move forward to a positive hard limit and controlling the motor to move backward to a negative hard limit, and determining the detection stroke based on the positive hard limit and the negative hard limit.
[0041] Specifically, firstly, the motor is controlled to run forward to the positive hard limit. If the motor is a rotary motor, it is controlled to rotate 360° forward to the maximum positive position; if the motor is a linear motor, it is controlled to run forward to the maximum positive position, and this maximum positive position is used as the motor's positive hard limit. Next, the motor is controlled to run in the negative direction to the negative hard limit. Again, if the motor is a rotary motor, it is controlled to rotate 360° in the negative direction to the maximum negative position; if the motor is a linear motor, it is controlled to run in the negative direction to the maximum negative position, and this maximum negative position is used as the motor's negative hard limit. Finally, the detection stroke is determined based on the positive and negative hard limits to control the motor's operation within the detection stroke and determine the error compensation table. Since the detection stroke includes the maximum positional deviation between the motor's positive and negative hard limits, the integrity and accuracy of the positional deviation data throughout the motor's entire stroke are ensured, thereby improving the accuracy of the error compensation table.
[0042] In one implementation, the target error evaluation interval is determined based on the position deviation dataset and multiple error evaluation intervals, mainly including the following determination methods: (1) Determine the cumulative error value of each error judgment interval based on the position deviation data of each error judgment interval; take the error judgment interval with the largest cumulative error value as the target error judgment interval.
[0043] Specifically, for each error evaluation interval, the cumulative error value of that interval is determined based on the position deviation data of multiple collection points within that interval. Then, the cumulative error values of each interval are sorted, and the interval with the largest cumulative error value is selected as the target error evaluation interval. Therefore, by using position deviation data to segment the detection stroke and selecting the interval with the largest cumulative error value as the target error evaluation interval for subsequent iterations, the iteration efficiency is significantly improved compared to iterating over the entire detection stroke, thereby improving the motor's compensation calibration efficiency. Simultaneously, by adjusting the number of collection points during iteration, the overall positioning accuracy is improved across the various error evaluation intervals, thus enhancing the motor's compensation calibration accuracy.
[0044] (2) Determine the index parameters for each error evaluation interval based on the position deviation data of each error evaluation interval; wherein, the index parameters include at least one of the following indicators: amplitude index, fluctuation index, gradient index, fitting residual index and spectral energy index; determine the comprehensive score of each error evaluation interval based on the index parameters of each error evaluation interval and the weight corresponding to each indicator; take the error evaluation interval with the highest comprehensive score as the target error evaluation interval.
[0045] Specifically, the determination process for each indicator in the indicator parameters is as follows: ① For the amplitude index; determine the average or absolute value integral of the error based on the position deviation data of each error judgment interval, that is, determine the average or absolute value integral of the error corresponding to the error judgment interval based on the position deviation data of multiple collection points in each error judgment interval; and use the average or absolute value integral of the error as the amplitude index of the error judgment interval.
[0046] ② For fluctuation indicators; determine the standard deviation or peak-to-valley value of the error based on the positional deviation data of each error assessment interval, and use the standard deviation or peak-to-valley value of the error as the fluctuation indicator of the error assessment interval.
[0047] In practical applications, the stability of the motor's position deviation determines the vibration of the motion. For example, for position deviation data from multiple sampling points within a certain error evaluation interval, although the average value of the position deviation data from multiple sampling points is not zero (i.e., there is position deviation), it is very stable (small standard deviation). After one compensation, the position deviation is eliminated. Furthermore, if the position deviation data from multiple sampling points fluctuates greatly (large standard deviation), it indicates problems such as mechanical looseness, uneven friction, or high signal noise from the sampling equipment. Therefore, the standard deviation or peak-to-valley value of the error can be calculated for each error evaluation interval, and used as a fluctuation index for the error evaluation interval. This fluctuation index characterizes the degree of fluctuation of the position deviation data within the error evaluation interval.
[0048] Specifically, for each error evaluation interval, the error standard deviation or peak-valley value is determined based on the position deviation data of multiple collection points in the error evaluation interval, and the error standard deviation or peak-valley value is used as the fluctuation index of the error evaluation interval. The larger the fluctuation index, the more unstable the motor operation is in the error evaluation interval. Thus, the fluctuation index makes it easier to identify areas with poor assembly, bearing runout, or encoder signal interference.
[0049] In particular, in practical applications, areas with poor assembly, bearing runout, or encoder signal interference are difficult to resolve using error compensation tables alone, often indicating the need for mechanical rectification or processing through filtering algorithms. However, this invention determines fluctuation indicators through position deviation data and determines the target error judgment interval based on the fluctuation indicators. This allows for iterative adjustment of the number of collection points based on the position deviation data within the target error judgment interval to obtain an error compensation table. Thus, the position of the motor is compensated using the error compensation table without the need for mechanical rectification, further improving the control accuracy and efficiency of the motor.
[0050] ③ For the gradient index; determine the interval error curve based on the position deviation data of each error judgment interval, and use the maximum gradient value or gradient variance of the interval error curve as the gradient index of the error judgment interval.
[0051] In practical applications, during motor operation, the rate of change (slope) of position deviation data is more critical than the average value of position deviation data. For example, for position deviation data from multiple sampling points within a certain error evaluation interval, if the average value of the position deviation data from multiple sampling points is large but the change is gradual (such as linear error), the control device can eliminate it through feedforward compensation, and there is no need to focus on collecting position deviation data from this error evaluation interval. Conversely, if the average value of the position deviation data from multiple sampling points is small but the slope changes drastically (such as sudden jumps, backlash, etc.), this will cause the motor control system to experience tracking lag or vibration, thereby reducing the control accuracy of the motor.
[0052] Specifically, firstly, based on the positional deviation data of multiple sampling points within each error evaluation interval, an interval error curve for that interval is fitted. Then, the first derivative (i.e., gradient) of the interval error curve at each sampling point, or the gradient difference between adjacent sampling points, is calculated. Finally, the maximum gradient value or gradient variance of the interval error curve within that error evaluation interval is statistically analyzed, and this maximum gradient value or gradient variance is used as the gradient index of the error evaluation interval. Therefore, by using the gradient index of each error evaluation interval, it is possible to accurately locate "hard points" (i.e., local abnormal resistance points), guide rail unevenness points, or sudden changes in cogging force in mechanical transmission, further improving the smoothness of motor motion.
[0053] ④ For the fitting residual index; determine the baseline curve based on the position deviation dataset of the detection stroke, and calculate the sum of squared residuals between the actual position data and the baseline curve for each error evaluation interval, and use the sum of squared residuals as the fitting residual index for the error evaluation interval.
[0054] In practical applications, assuming that the overall position deviation data of the motor is described by a smooth reference curve (such as a polynomial curve), if the actual position data of the motor closely follows the reference curve, it indicates that the position deviation data is systematic and predictable; if some actual position data of the motor deviates significantly from the reference curve (large residuals), it indicates that there are local anomalies (nonlinear errors) in the position deviation data. Therefore, multiple error evaluation intervals can be screened from the perspective of data modeling.
[0055] Specifically, firstly, a low-order polynomial fitting or smoothing process is performed on the position deviation dataset of the motor during the detection stroke to obtain a reference curve. Then, the residual sum of squares (RSS) of the actual position data and the reference curve for each error evaluation interval is calculated, and the residual sum of squares is used as the fitting residual index for that error evaluation interval. Therefore, by determining the target error evaluation interval through the fitting residual index, conventional error evaluation intervals that conform to the overall trend can be filtered out, and the target error evaluation intervals with mechanical defects such as local abrupt changes or local distortions can be quickly identified. Based on the target error evaluation interval, an error compensation table is determined, further improving the compensation control accuracy of the motor.
[0056] ⑤ For the spectral energy index; perform a fast Fourier transform on the position deviation data of each error evaluation interval to determine the energy density, and use the energy density as the spectral energy index of the error evaluation interval.
[0057] In practical applications, for rotating motors, the cogging force or the marking error of the encoder usually has specific frequency characteristics. For example, for position deviation data of multiple sampling points in a certain error evaluation interval, if the position deviation data of multiple sampling points are relatively close in the time domain, but contain high-energy high-frequency oscillations in the frequency domain, it will cause the motor to whine or overheat. Therefore, for rotating motors, the spectral energy index of each error evaluation interval can be determined, and the target error evaluation interval can be selected based on the spectral energy index.
[0058] Specifically, for the position deviation data of multiple acquisition points in each error evaluation interval, a Fast Fourier Transform (FFT) is performed, and the energy density is obtained by calculating the energy integral of a specific frequency band (such as cogging force frequency and harmonic frequency). The energy density is then used as the spectral energy index of the error evaluation interval, and the target error evaluation interval is selected by using the spectral energy index. In order to determine the error compensation table based on the target error evaluation interval, targeted compensation for high-frequency errors caused by electromagnetic design or mechanical resonance is achieved, thereby improving the compensation calibration accuracy of the motor.
[0059] In summary, based on the position deviation data of each error evaluation interval, after determining the index parameters for each error evaluation interval, the multiple indicators in the index parameters are normalized and then weighted and summed to obtain the comprehensive score for each error evaluation interval. The error evaluation interval with the highest comprehensive score is then taken as the target error evaluation interval. Thus, the target error evaluation interval is determined through a multi-dimensional index evaluation system, which improves the accuracy of the error compensation table and thereby improves the compensation control accuracy of the motor.
[0060] In particular, the weights of each indicator in the indicator parameters can be set according to the application scenario. For example, the weight of the gradient indicator can be increased in high dynamic scenarios, and the weight of the amplitude indicator can be increased in precise positioning scenarios. This embodiment of the invention does not limit the description in this regard.
[0061] Furthermore, in some scenarios, after determining the comprehensive score of each error evaluation interval, the error evaluation interval with the highest comprehensive score can be used as the target error evaluation interval. Alternatively, multiple error evaluation intervals can be sorted according to the comprehensive score, and a specified number of error evaluation intervals can be used as target error evaluation intervals. For example, multiple error evaluation intervals can be sorted in descending order of comprehensive score, and a specified number of the first few can be used as target error evaluation intervals; or, multiple error evaluation intervals can be sorted in ascending order of comprehensive score, and a specified number of the last few can be used as target error evaluation intervals. This allows one or more target error evaluation intervals to be the focus of fine measurement, and the number of collection points can be iteratively adjusted. This not only improves the iteration efficiency but also improves the balance of overall positioning accuracy across various error evaluation intervals, further improving the accuracy of the error compensation table. For ease of explanation, this embodiment of the invention uses the target error evaluation interval with the highest comprehensive score as an example to illustrate the iterative adjustment process of the number of collection points. Other target error evaluation intervals can refer to this target error evaluation interval, and will not be described in detail here.
[0062] In one implementation, multiple error evaluation intervals all satisfy the accuracy condition, including: using the mean of the position deviation data of each error evaluation interval as the accuracy of each error evaluation interval; if the accuracy of each error evaluation interval is less than or equal to a preset accuracy, then it is determined that multiple error evaluation intervals all satisfy the accuracy condition.
[0063] Specifically, after the target error evaluation interval is determined, the motor is controlled to run within the target error evaluation interval, and the number of collection points of the acquisition device is adjusted according to the position deviation data corresponding to the target error evaluation interval. For example, if the position deviation data of the target error evaluation interval is large, such as the difference between the mean of the position deviation data of the target error evaluation interval and the preset precision being greater than or equal to the preset difference, then the position deviation data of the target error evaluation interval is determined to be large, and the number of collection points is increased; conversely, if the position deviation data of the target error evaluation interval is small, such as the difference between the mean of the position deviation data of the target error evaluation interval and the preset precision being less than the preset difference, then the position deviation data of the target error evaluation interval is determined to be small, and the number of collection points is decreased. The specific value of the preset difference can be set according to the actual situation, and will not be described in detail in this embodiment of the invention.
[0064] Furthermore, after adjusting the number of data collection points, the position deviation dataset is recalculated, and the error compensation table is updated. Additionally, the accuracy of each error evaluation interval is determined based on its position deviation data. Specifically, the mean of the position deviation data for each error evaluation interval is used as the accuracy of that interval. If the accuracy of all error evaluation intervals is less than or equal to a preset accuracy, then the interval is deemed to meet the accuracy requirements. The preset accuracy can be pre-set or determined based on the error evaluation intervals. Specifically, the preset accuracy is determined by using the mean of the position deviation data from the error evaluation interval with the lowest overall score.
[0065] Furthermore, after determining the accuracy of each error judgment interval based on the mean of the position deviation data of each error judgment interval, it is first determined whether the accuracy of each error judgment interval is less than or equal to the preset accuracy. If not, the number of acquisition points of the acquisition device is adjusted according to the position deviation data corresponding to the target error judgment interval, and the position deviation dataset is recalculated until multiple error judgment intervals meet the accuracy conditions.
[0066] Specifically, if the preset accuracy is the average of the position deviation data in the error evaluation interval with the lowest comprehensive score, then the accuracy of the target error evaluation interval will necessarily be greater than the preset accuracy. In other words, the target error evaluation interval will not meet the accuracy condition. Therefore, it is unnecessary to determine whether the accuracy of each error evaluation interval is less than or equal to the preset accuracy. Instead, the number of sampling points on the acquisition device is adjusted directly based on the position deviation data corresponding to the target error evaluation interval, and the position deviation dataset is recalculated. After each adjustment, it is determined whether the accuracy of each error evaluation interval is less than or equal to the preset accuracy, until multiple error evaluation intervals meet the accuracy condition. Therefore, after adjusting the number of sampling points, if the accuracy of multiple error evaluation intervals is less than or equal to the preset accuracy, then multiple error evaluation intervals are determined to meet the accuracy condition. Conversely, if after adjusting the number of sampling points, at least one error evaluation interval has an accuracy greater than the preset accuracy, then the number of sampling points on the acquisition device is readjusted based on the position deviation data corresponding to the target error evaluation interval, until multiple error evaluation intervals meet the accuracy condition, resulting in the error compensation table for the motor during the detection stroke. This iterative adjustment of the number of collection points based on the position deviation data of the target error evaluation interval not only improves the iteration efficiency, but also improves the balance of the overall positioning accuracy across various error evaluation intervals, thereby improving the accuracy of the error compensation table and ultimately improving the compensation control accuracy of the motor.
[0067] In one implementation, the method further includes: if the number of times the number of acquisition points of the acquisition device is adjusted reaches a preset number, and multiple error evaluation intervals still do not meet the accuracy conditions, then an alarm message is generated.
[0068] Specifically, to avoid frequent adjustments to the number of data collection points, a preset number of times (e.g., 10 times) is set. If the number of data collection points adjusted by the data collection device reaches the preset number of times, and multiple error evaluation intervals still do not meet the accuracy requirements, an alarm message will be generated to prompt the operator to maintain and repair the motor. This avoids the motor being unable to compensate due to mechanical assembly defects, and further ensures the control accuracy of the motor.
[0069] In summary, by controlling the motor's movement within the detection stroke and using a data acquisition device to collect high-precision data to determine the position deviation dataset, and by dividing the detection stroke into multiple error evaluation intervals and determining the target error evaluation interval, the number of acquisition points is iteratively adjusted based on the position deviation data of the target error evaluation interval to determine the error compensation table. This ensures the integrity and accuracy of the motor's position deviation data within the detection stroke, thereby improving not only the accuracy of the error compensation table but also the iteration efficiency, and realizing the rapid calibration and compensation of precise positioning for a single motor.
[0070] Furthermore, after the aforementioned error compensation table is determined, before performing compensation control on the motor or on other motors of the same type, the error compensation table needs to be reused and adjusted to obtain the compensation data of the motor or other motors of the same type throughout the entire stroke, i.e., the target error compensation table. This allows for compensation control of the motor or other motors of the same type to be performed based on the target error compensation table, further improving the control accuracy of the motor.
[0071] In practical applications, based on error decoupling theory, the full-stroke position error of the motor can be decomposed into: E total (x)=E system (x)+E random (x)+E assembly (x); where E system (x) represents systematic errors, typically determined by the motor's electromagnetic design and the geometric parameters of the lead screw / reducer. These errors are highly consistent within the same model and batch, exhibiting specific periodic harmonics and polynomial trends; E random (x) represents random error, usually caused by noise from the data acquisition equipment. It has a zero mean, is unpredictable but has a small impact; E assembly (x) represents assembly error, typically caused by differences in the installation of each motor (such as zero-point offset, coupling elasticity differences), manifesting as overall offset, linear scaling, or phase fine-tuning. Therefore, this embodiment of the invention extracts E offline. system (x) model, online solution for E only requires measuring a small number of key locations. assembly By using the (x) parameter, the target error compensation table for the motor throughout its entire stroke can be obtained.
[0072] Specifically, such as Figure 2 As shown, the process of reusing and adjusting the error compensation table includes the following steps: Step S202: Obtain the target position deviation dataset corresponding to the error compensation table, and determine the standard error feature model function based on the target position deviation dataset.
[0073] Specifically, a qualified motor is selected as the gold sample. First, the detection stroke of the gold sample is determined, and the sample is controlled to move within the detection stroke. The position deviation dataset is determined based on the position data fed back by the encoder and the actual position data collected by the acquisition device. It is assumed that the number of sampling points of the acquisition device is M, where M ≥ 500. Then, the detection stroke is divided into multiple error evaluation intervals, and a target error evaluation interval is determined based on the position deviation dataset and the multiple error evaluation intervals. Finally, the gold sample is controlled to run to the target error evaluation interval. The number of sampling points M of the acquisition device is adjusted according to the position deviation data corresponding to the target error evaluation interval, and the position deviation dataset is recalculated until all multiple error evaluation intervals meet the accuracy requirements. This process yields an error compensation table and the corresponding target position deviation dataset E.std (x), so as to be based on the target position deviation dataset E std (x) Determine the standard error characteristic model function.
[0074] Step S204: Select multiple key position points within the physical travel range of the motor shaft and determine the sparse deviation dataset.
[0075] Specifically, firstly, the motor is controlled to run to its maximum positive and negative strokes to determine the physical stroke range of the motor shaft, such as [0, L], where L represents the maximum value of the physical stroke range, thus confirming the stroke boundary of the motor shaft. Then, within the physical stroke range of the motor shaft, multiple key position points are selected, such as N key position points. Here, the number of key position points N is less than the number of collection points M, such as N ranging from 5 to 10. The specific values of M and N can be set according to the actual situation.
[0076] In addition, during the selection of key location points, the endpoints of the physical travel range (for calibration boundaries), the midpoint of the travel range, the 1 / 4 travel point, and the 3 / 4 travel point (for calibration of linearity and phase) are selected as multiple key location points. The specific positions of each key location point within the physical travel range can be adaptively adjusted according to the actual situation.
[0077] Furthermore, for each key location point, the position deviation data for that key location point is determined based on the position data fed back by the encoder and the actual position data collected by the acquisition device. This results in a sparse deviation dataset being constructed from the position deviation data of multiple key location points. For example, the sparse deviation dataset is... Where e1 represents the positional deviation data of the first critical location point, e2 represents the positional deviation data of the second critical location point, and so on, e N This represents the positional deviation data of the Nth critical location point.
[0078] It should be noted that, in addition to selecting multiple key position points within the physical travel range of the motor shaft, multiple key position points can also be set in the target error evaluation interval, or in the error evaluation interval where the mean of the position deviation data is greater than the preset deviation threshold, and a sparse deviation dataset can be determined based on the position deviation data of multiple key position points.
[0079] Step S206: Determine the optimization objective function based on the standard error characteristic model function and the sparse deviation dataset, and determine the target error compensation table based on the optimization objective function and the standard error characteristic model function; wherein, the target error compensation table includes the compensation data of the motor throughout its entire stroke.
[0080] Therefore, the motor compensation calibration method provided in this embodiment of the invention can not only realize the motor's factory compensation calibration, but also realize the motor's on-site maintenance, that is, reuse and adjust the error compensation table, thereby improving the motor's compensation control accuracy.
[0081] In one implementation, determining the standard error characteristic model function based on the target position deviation dataset includes: performing frequency domain and time domain analysis on the target position deviation dataset to determine trend components and periodic components; and determining the standard error characteristic model function based on the trend components and periodic components.
[0082] Specifically, the target position deviation dataset E std Once (x) is determined, mathematical processing tools such as MATLAB or embedded DSP (Digital Signal Processing) algorithms are used to process the target position deviation dataset E. std (x) Perform frequency and time domain analysis, for example, use the least squares method to analyze the target position deviation dataset E. std (x) Perform polynomial fitting (such as a 3rd or 5th order polynomial) to obtain the trend component T. std (x) is used to describe the cumulative error of the lead screw or the length error of the connecting rod; in addition, a fast Fourier transform is performed on the residual after removing the trend term to extract the first k major harmonic components with the largest amplitude (such as the cogging force frequency and the encoder marking frequency), and the periodic component C is obtained. std (x) is used to describe the cogging force and the periodic error of the encoder marking.
[0083] Determine the trend component T std (x) and periodic component C std After (x), based on the trend component T std (x) and periodic component C std (x) By constructing the model, the standard error characteristic model function F can be obtained. sys (x), where F sys (x)=T std (x)+C std (x). Wherein, the periodic component C std The expression for (x) is as follows: (1) Among them, A j This represents the amplitude of the j-th harmonic. Indicates the harmonic angular frequency. This represents the harmonic phase, and k is the selected major harmonic order.
[0084] Therefore, during the offline or R&D phase of the motor, the aforementioned standard error characteristic model function F can be constructed. sys (x), and the periodic component Cstd The polynomial coefficients of (x), the amplitude and phase of the harmonics, and all other characteristic parameters constitute the parameter set P. std It is stored in the non-volatile memory of the control device for reuse and adjustment of the subsequent error compensation table.
[0085] In one implementation, the objective function for optimization is determined based on the standard error feature model function and the sparse deviation dataset, including: mapping the standard error feature model function to the motor shaft to construct a mapping equation; and determining the objective function for optimization based on the mapping equation and the position deviation data of multiple key position points.
[0086] Specifically, firstly, the standard error characteristic model function F... sys Map (x) to the motor axis and construct the mapping equation. ;in, This represents the gain scaling factor. This indicates the phase offset. This represents the zero-point offset. Then, based on the mapping equation and the position deviation data of multiple key locations, the least squares method is used to determine the optimization objective function, which is expressed as follows: (2) Among them, e i This represents the positional deviation data of the i-th key location point. Let represent the value of the mapping equation at the i-th key position, i=1,2,3,…,N.
[0087] Therefore, by determining the optimization objective function through the standard error characteristic model function and the sparse deviation dataset, it is convenient to quickly reuse and calibrate the error compensation table according to the optimization objective function, thereby improving the compensation calibration efficiency of the motor.
[0088] In one implementation, determining the target error compensation table based on the optimization objective function and the standard error characteristic model function includes: optimizing the optimization objective function to determine target parameters; wherein the target parameters include: the optimal value of the gain ratio coefficient, the optimal value of the phase offset, and the optimal value of the zero drift; determining the target error compensation table based on the target parameters, the standard error characteristic model function, and a preset step size; wherein the preset step size is the control resolution of the motor driver.
[0089] Specifically, after the above-mentioned objective function is determined, the objective function is first optimized using numerical optimization algorithms such as the Levenberg-Marquardt algorithm or the Gauss-Newton method to obtain the objective parameters; among which, the objective parameters include: the optimal value of the gain ratio coefficient. Optimal value of phase offset Optimal value of zero-point drift Then, based on the target parameters and the standard error characteristic model function, and with the control resolution of the motor driver (e.g., 1µm or 0.01 degrees) as the preset step size, the target error compensation table is determined. Its expression is as follows: (3) Therefore, during the motor production stage or the online stage, for each motor or each motor shaft, the error compensation table is quickly reused and calibrated by optimizing the objective function to obtain the target error compensation table. This allows for compensation control of the motor based on the target error compensation table, thereby improving the motor's compensation calibration efficiency and compensation control accuracy.
[0090] In one embodiment, the method further includes: after generating the target error compensation table, determining multiple verification position points; controlling the motor to move to the multiple verification position points, and determining the verification residual for each verification position point; wherein the verification residual is determined based on the actual deviation and predicted deviation of each verification position point; and performing anomaly diagnosis on the motor shaft based on the verification residual and a preset threshold.
[0091] After determining the target error compensation table as described above, to ensure the quality stability of mass production of motors, this embodiment of the invention also sets up a verification and anomaly handling mechanism. Specifically, in the verification and anomaly handling mechanism, after the target error compensation table is generated, multiple verification location points are automatically planned. These multiple verification location points are different from the data collection points. For example, the standard error feature model function F is selected. sys (x) The location with the largest error gradient or the middle interpolation point of the detection stroke. If the sampling point is 0% detection stroke, 25% detection stroke, 50% detection stroke, 75% detection stroke, 100% detection stroke, then multiple verification location points can be selected as 12.5% detection stroke, 37.5% detection stroke, 62.5% detection stroke, 87.5% detection stroke to verify the accuracy of the standard error feature model function interpolation.
[0092] Then, the motor is controlled to move to multiple verification position points, and the verification residual at each verification position point is determined; wherein, the verification residual is determined based on the actual deviation and the predicted deviation at each verification position point. Specifically, the motor is controlled to move to multiple verification position points x test and at each verification location point x test The actual deviation e of the verification position point is determined based on the position data fed back by the encoder and the actual position data collected by the acquisition device. test Simultaneously, the prediction bias Epredict(x) at the verification location point is determined based on the mapping equation. test This allows for the determination of the verification residual at each verification location based on the actual and predicted deviations. ,Right now Finally, based on the verification residuals and preset thresholds, anomaly diagnosis of the motor shaft is performed, thereby improving the quality stability of mass production of motors.
[0093] In one implementation, the preset threshold includes a first threshold δ1 and a second threshold δ2. In practical applications, the first threshold δ1 can also be called the qualified threshold, such as the absolute position accuracy required by the user (e.g., ±0.05mm); the second threshold δ2 can also be called the alarm threshold, which is usually three times the qualified threshold, such as ±0.15mm. The specific values of the first threshold δ1 and the second threshold δ2 can be set according to the actual situation.
[0094] Based on the first threshold δ1 and the second threshold δ2 mentioned above, anomaly diagnosis of the motor shaft is performed according to the verification residual and the preset threshold, mainly including the following situations: (1) If the verification residuals of multiple verification locations are all less than or equal to the first threshold, then the motor calibration is confirmed to be successful.
[0095] Specifically, if the verification residuals at all verification locations satisfy... If the value is ≤δ1, the motor calibration is considered successful, and the target error compensation table is stored. This allows the motor to be compensated and controlled in subsequent operation based on the target error compensation table, thereby improving the accuracy of the motor's compensation control.
[0096] (2) If the verification residual at at least one verification location point is greater than the second threshold, it is determined that the motor shaft has an assembly abnormality fault.
[0097] Specifically, if there are verification residuals at verification location points If the value is greater than δ2, then the motor shaft is determined to have an assembly abnormality fault, such as mechanical loosening, severe deformation of the guide rail, loose screws, or foreign object jamming. Its error characteristics have deviated significantly from the standard error characteristic model function F. sys (x), at this point an abnormal alarm needs to be triggered.
[0098] (3) If the verification residual of at least one verification location point is greater than the first threshold and less than or equal to the second threshold, the target error compensation table is updated based on the location data of multiple verification location points; after the target error compensation table is updated, if there is still at least one verification location point with a verification residual greater than the first threshold and less than or equal to the second threshold, then it is determined that the motor shaft has an assembly abnormality fault.
[0099] Specifically, if there exists a verification residual δ1 < If the error is ≤δ2, it indicates a local standard error characteristic model function deviation, requiring fine-tuning and updating of the target error compensation table. This can be achieved by updating the optimization objective function based on the position data of multiple verification points, resolving the target parameters based on the updated objective function, and updating the target error compensation table based on the resolved target parameters. Furthermore, after updating the target error compensation table, verification is performed again based on multiple verification points. If the verification residual at at least one verification point is still greater than the first threshold and less than or equal to the second threshold, then an assembly abnormality fault has been determined in the motor shaft.
[0100] Furthermore, after updating the target error compensation table, if the verification residuals at multiple verification location points are all less than or equal to the first threshold, the motor calibration is considered successful. In some scenarios, the target error compensation table can be updated a specified number of times. If, after the specified number of updates, at least one verification location point still satisfies the required verification residual... If the value is greater than δ1, then the motor shaft is determined to have an assembly abnormality fault.
[0101] Therefore, multi-level precision verification of the motor is achieved through the first threshold δ1 and the second threshold δ2; in addition, assembly abnormalities are quickly identified by the verification residuals at multiple verification locations, thus playing the role of online quality inspection of the motor.
[0102] In one embodiment, the method further includes: when an assembly abnormality fault occurs in the motor shaft, acquiring measured full-range data of the motor shaft based on the number of acquisition points; constructing a single-axis error model based on the measured full-range data, and redetermining the optimization objective function based on the single-axis error model and the sparse deviation dataset; and redetermining the target error compensation table based on the redetermined optimization objective function and the single-axis error model, wherein the verification residuals of multiple verification location points are all less than or equal to a first threshold.
[0103] Specifically, when an assembly abnormality occurs on the motor shaft, the rapid compensation calibration process is stopped, and an alarm message is output to provide an alarm prompt; and the control equipment automatically switches to the calibration mode of the detection stroke, that is, the control equipment re-moves the motor within the detection stroke and obtains the measured full-range data of the motor shaft based on the number of acquisition points; then, a single-axis error model is constructed based on the measured full-range data (the above standard error characteristic model function is no longer reused), and the optimization objective function is re-determined based on the single-axis error model and the sparse deviation dataset; and the target error compensation table is re-iterated based on the re-determined optimization objective function and the single-axis error model until the verification residuals of multiple verification position points are all less than or equal to the first threshold.
[0104] In summary, the motor compensation calibration method provided in this invention can complete the calibration in seconds for over 90% of normally assembled shafts. Furthermore, for the very few abnormal shafts, a backtracking mechanism automatically switches to the calibration mode for the detection stroke, ensuring no quality issues are missed. Moreover, this method can be used not only for factory calibration but also for on-site maintenance. After the motor has been running for a period of time, a simple sparse deviation dataset is sufficient to determine if the accuracy has decreased, enabling predictive maintenance. Additionally, this method quickly identifies mechanical assembly defects in the motor through verification residuals at multiple verification points, thus serving as an online quality inspection mechanism and further ensuring the motor's compensation accuracy.
[0105] Based on the above method embodiments, this invention also provides a motor control system, such as... Figure 3 As shown, the motor control system 3 includes: a control device 31, a data acquisition device 32, and a motor 33; wherein, the data acquisition device 32 is used to acquire the actual position data of the motor 33 during operation and send the actual position data to the control device 31; the control device 31 is used to perform compensation calibration on the motor 33 using the above-mentioned motor compensation calibration method to obtain the target error compensation table of the motor 33.
[0106] The acquisition device 32 includes, but is not limited to, CCD cameras and laser rangefinders. In practical applications, if the motor 33 is a rotary motor, the acquisition device 32 is preferably a CCD camera; if the motor 33 is a linear motor, the acquisition device 32 is preferably a laser rangefinder. The specific acquisition device 32 can be set according to the actual situation.
[0107] In addition, the acquisition device 32 is connected to the control device 31 and sends the acquired actual position data to the control device 31 through Ethernet control automation technology (EtherCAT), CANFD or RS485 bus, so that the control device 31 can perform compensation calibration according to the actual position of the motor 33.
[0108] Furthermore, the system also includes a motor driver 34 and an encoder (not shown); the control device 31 is also used to acquire the feedback position collected by the encoder when the motor 33 is running; to compensate the feedback position based on the target error compensation table, and to drive the motor driver 34 according to the compensated feedback position to control the motor 33. The specific control process of the motor 33 can be referred to the prior art, and will not be described in detail here.
[0109] The motor control system provided in this embodiment of the invention has the same technical features as the motor compensation calibration method provided in the above embodiments, so it can also solve the same technical problems and achieve the same technical effects.
[0110] This invention also provides a control device, including a processor and a memory. The memory stores machine-executable instructions that can be executed by the processor, and the processor executes the machine-executable instructions to implement the above-described motor compensation calibration method.
[0111] See Figure 4 As shown, the control device includes a processor 100 and a memory 101. The memory 101 stores machine-executable instructions that can be executed by the processor 100. The processor 100 executes the machine-executable instructions to implement the above-described motor compensation calibration method.
[0112] Furthermore, Figure 4 The control device shown also includes a bus 102 and a communication interface 103. The processor 100, the communication interface 103 and the memory 101 are connected via the bus 102.
[0113] The memory 101 may include high-speed random access memory (RAM) and may also include non-volatile memory, such as at least one disk storage device. Communication between this system network element and at least one other network element is achieved through at least one communication interface 103 (which can be wired or wireless), such as the Internet, wide area network, local area network, metropolitan area network, etc. The bus 102 may be an ISA (Industrial Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, or an EISA (Enhanced Industry Standard Architecture) bus, etc. These buses can be categorized as address buses, data buses, control buses, etc. For ease of representation, Figure 4 The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.
[0114] Processor 100 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of processor 100 or by instructions in software form. Processor 100 may be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this invention. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this invention can be directly manifested as execution by a hardware decoding processor, or execution by a combination of hardware and software modules in the decoding processor. The software module can reside in a readily available storage medium in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory 101, and the processor 100 reads the information from memory 101 and, in conjunction with its hardware, completes the steps of the method described in the foregoing embodiments.
[0115] This invention also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the aforementioned motor compensation calibration method.
[0116] The motor compensation calibration method and motor control system computer program product provided in the embodiments of the present invention include a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the methods described in the preceding method embodiments. For specific implementation, please refer to the method embodiments, which will not be repeated here.
[0117] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the system and apparatus described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0118] Furthermore, in the description of the embodiments of the present invention, unless otherwise explicitly specified and limited, the terms "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art can understand the specific meaning of the above terms in the present invention based on the specific circumstances.
[0119] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a processor-executable, non-volatile, computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or a portion of the 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 cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0120] In the description of this invention, it should be noted that the terms "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," and "outer," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are used only for the convenience of describing the invention and for simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on the invention. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.
[0121] Finally, it should be noted that the above-described embodiments are merely specific implementations of the present invention, used to illustrate the technical solutions of the present invention, and not to limit it. The scope of protection of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments within the technical scope disclosed in the present invention, or make equivalent substitutions for some of the technical features; and these modifications, changes, 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, and should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A method for compensating and calibrating a motor, characterized in that, include: The motor is controlled to move within the detection stroke, and a position deviation dataset is determined based on the position data fed back by the encoder and the actual position data collected by the acquisition device; wherein, the position deviation dataset includes multiple position deviation data. The detection path is divided into multiple error evaluation intervals, and a target error evaluation interval is determined based on the position deviation dataset and the multiple error evaluation intervals. Specifically, based on the position deviation data of each error evaluation interval, index parameters for each error evaluation interval are determined. These index parameters include at least one of the following indicators: amplitude, fluctuation, gradient, fitting residual, and spectral energy. Based on the index parameters of each error evaluation interval and the weight corresponding to each indicator, a comprehensive score for each error evaluation interval is determined. The error evaluation interval with the highest comprehensive score is selected as the target error evaluation interval. The motor is controlled to run to the target error evaluation interval. The number of acquisition points of the acquisition device is adjusted according to the position deviation data corresponding to the target error evaluation interval, and the position deviation dataset is recalculated until multiple error evaluation intervals meet the accuracy conditions, thus obtaining an error compensation table.
2. The motor compensation calibration method according to claim 1, characterized in that, The step of determining the index parameters for each error evaluation interval based on the position deviation data for each error evaluation interval includes: The average error or the integral of absolute value is determined based on the position deviation data for each error evaluation interval, and the average error or the integral of absolute value is used as the amplitude index of the error evaluation interval; and / or, The error standard deviation or peak-to-trough value is determined based on the positional deviation data of each error evaluation interval, and the error standard deviation or the peak-to-trough value is used as the fluctuation index of the error evaluation interval; and / or, An interval error curve is determined based on the position deviation data for each of the error evaluation intervals, and the maximum gradient value or gradient variance of the interval error curve is used as the gradient index of the error evaluation interval; and / or, A baseline curve is determined based on the position deviation dataset of the detection stroke, and the sum of squared residuals between the actual position data and the baseline curve for each error evaluation interval is calculated. This sum of squared residuals is used as the fitting residual index for the error evaluation interval; and / or, The energy density is determined by performing a Fast Fourier Transform on the position deviation data of each error evaluation interval, and the energy density is used as the spectral energy index of the error evaluation interval.
3. The motor compensation calibration method according to any one of claims 1-2, characterized in that, The method further includes: Obtain the target position deviation dataset corresponding to the error compensation table, and determine the standard error feature model function based on the target position deviation dataset; Multiple key position points are selected within the physical travel range of the motor shaft, and a sparse deviation dataset is determined; wherein, the sparse deviation dataset includes position deviation data of multiple key position points, and the number of key position points is less than the number of collection points; An optimization objective function is determined based on the standard error feature model function and the sparse deviation dataset, and a target error compensation table is determined based on the optimization objective function and the standard error feature model function; wherein, the target error compensation table includes the compensation data of the motor throughout its entire stroke.
4. The motor compensation calibration method according to claim 3, characterized in that, The step of determining the target error compensation table based on the optimization objective function and the standard error characteristic model function includes: The objective function is optimized to determine the target parameters; wherein the target parameters include: the optimal value of the gain ratio coefficient, the optimal value of the phase offset, and the optimal value of the zero drift. The target error compensation table is determined based on the target parameters, the standard error characteristic model function, and the preset step size; wherein, the preset step size is the control resolution of the motor driver.
5. The motor compensation calibration method according to claim 3, characterized in that, The method further includes: After generating the target error compensation table, multiple verification location points are determined; The motor is controlled to move to multiple verification position points, and the verification residual for each verification position point is determined; wherein, the verification residual is determined based on the actual deviation and the predicted deviation for each verification position point; The motor shaft is diagnosed for anomalies based on the verification residual and the preset threshold.
6. The motor compensation calibration method according to claim 5, characterized in that, The preset threshold includes a first threshold and a second threshold. The step of performing anomaly diagnosis on the motor shaft based on the verification residual and the preset threshold includes: If the verification residual at at least one of the verification locations is greater than the second threshold, it is determined that the motor shaft has an assembly abnormality fault.
7. The motor compensation calibration method according to claim 6, characterized in that, The step of diagnosing anomalies in the motor shaft based on the verification residual and a preset threshold includes: If the verification residual of at least one of the verification location points is greater than the first threshold and less than or equal to the second threshold, the target error compensation table is updated based on the location data of the multiple verification location points. After the target error compensation table is updated, if there is still a verification residual at at least one of the verification location points that is greater than the first threshold and less than or equal to the second threshold, then it is determined that the motor shaft has an assembly abnormality fault.
8. The motor compensation calibration method according to claim 6, characterized in that, The method further includes: If the verification residuals of multiple verification location points are all less than or equal to the first threshold, then the motor calibration is determined to be successful.
9. The motor compensation calibration method according to claim 6 or 7, characterized in that, The method further includes: When an assembly abnormality occurs in the motor shaft, the actual measured full-range data of the motor shaft is obtained based on the number of collection points; A uniaxial error model is constructed based on the measured full-range data, and the optimization objective function is redefined based on the uniaxial error model and the sparse bias dataset; and, The target error compensation table is redefined based on the redefined optimization objective function and the single-axis error model, and the verification residuals of multiple verification location points are all less than or equal to the first threshold.
10. A motor control system, characterized in that, include: The system includes a control device, a data acquisition device, and a motor; wherein the data acquisition device is used to acquire actual position data of the motor during operation and send the actual position data to the control device. The control device is used to perform compensation calibration on the motor using the motor compensation calibration method according to any one of claims 1-9, and obtain the target error compensation table of the motor.
11. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, which, when executed by a processor, performs the steps of the motor compensation calibration method according to any one of claims 1-9.