A gantry machining center spindle dynamic error compensation method and system
By using multi-source data fusion and federated learning technology, real-time risk field strength and optimal compensation strategies are generated, solving the real-time and comprehensive problems of dynamic error compensation for CNC machine tool spindles, and improving machining accuracy and production efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-30
- Publication Date
- 2026-03-27
AI Technical Summary
Existing CNC machine tool spindle dynamic error compensation methods fail to fully consider the interaction and influence of multiple error factors, lack real-time and dynamic capabilities, and are difficult to meet the needs of modern high-precision machining.
Employing multi-source data fusion, federated learning, dynamic risk assessment, and strategy optimization techniques, the system collects real-time sensor data from multiple sources, generates prediction error vectors and uncertainty metrics, utilizes a federated network to generate a globally shared model, calculates real-time risk field strength, synthesizes the optimal compensation strategy, and sends it to the machine tool CNC system for execution.
It achieves real-time and precise compensation for spindle dynamic errors, improves machining accuracy and stability, reduces scrap rate, and increases production efficiency.
Smart Images

Figure CN121028678B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of machine tool machining, and in particular to a gantry machining center spindle dynamic error compensation method and system. BACKGROUND
[0002] With the rapid development of manufacturing industry, numerical control machine tools, as the key equipment for precision machining, play an irreplaceable role in many industrial fields, and their performance directly affects the quality and production efficiency of machined parts. Among the various components of numerical control machine tools, the spindle as the core component, its running state and precision play a decisive role in the machining capacity of the whole machine tool.
[0003] The size of the dynamic error of the spindle of the numerical control machine tool is directly related to the machining precision and stability of the machine tool. The dynamic error of the spindle refers to the error caused by the combined action of various complex factors, such as mechanical vibration, bearing wear, thermal deformation, etc., which causes the spindle rotation axis to deviate from the ideal position during the operation of the machine tool. This error will have many adverse effects on the machined parts, specifically manifested as a decrease in dimensional accuracy, distortion of shape accuracy, and deviation of position accuracy, etc., which will seriously affect the overall machining quality, reduce the product qualification rate, and increase the production cost.
[0004] The dynamic error of the spindle of the numerical control machine tool mainly includes radial error and axial error. Radial error refers to the error caused by the movement of the spindle rotation center line in the radial direction, which will cause the machined parts to deviate in the radial dimension, resulting in the roundness, cylindricity, and other shape accuracy of the parts not meeting the requirements. Axial error refers to the error caused by the movement of the spindle rotation center line along the axis direction, which will affect the axial dimensional accuracy of the parts and the perpendicularity of the end face and other position accuracy.
[0005] At present, although there have been some researches on the compensation method for the dynamic error of the spindle of the numerical control machine tool, most of them have limitations. Some traditional methods only compensate for errors based on a single factor, without considering the interaction and influence of multiple error factors, resulting in unsatisfactory compensation effect. Some other methods lack real-time and dynamic, and cannot adjust the compensation strategy in time according to the real-time state changes during the operation of the spindle, making it difficult to meet the needs of modern high-precision machining.
[0006] Therefore, it is necessary to provide a gantry machining center spindle dynamic error compensation method and system to solve the above technical problems. SUMMARY
[0007] To solve the above technical problems, the present application provides a gantry machining center spindle dynamic error compensation method and system, which realizes real-time and dynamic compensation for the dynamic error of the spindle through multi-source data fusion, federated learning, dynamic risk assessment and strategy optimization, etc. innovative technologies, and improves the machining precision and production efficiency of the machine tool.
[0008] The application provides a gantry machining center spindle dynamic error compensation method, the compensation method comprising the following steps:
[0009] Collecting multi-source real-time sensing data of the spindle system of the current machine tool node and inputting the data into a pre-constructed local uncertainty quantification model to generate a first uncertainty feature tuple containing a prediction error vector and an uncertainty measure;
[0010] Receiving a second uncertainty feature tuple from other machine tool nodes in the federal network and its corresponding measured error label, and generating a global shared model through federal aggregation optimization;
[0011] Based on the uncertainty measure of the current machine tool node and the statistical features of the obtained historical uncertainty data sequence, calculating a real-time risk field strength;
[0012] Inputting the real-time risk field strength and historical compensation performance data read from a local database into a dynamic strategy generator to synthesize an optimal compensation strategy;
[0013] According to the prediction error vector, the optimal compensation strategy is synergistically optimized to generate a compensation instruction, and the compensation instruction is sent to the machine tool numerical control system of the current machine tool node for execution to compensate for the spindle dynamic error.
[0014] Preferably, the collecting multi-source real-time sensing data of the spindle system of the current machine tool node and inputting the data into a pre-constructed local uncertainty quantification model to generate a first uncertainty feature tuple containing a prediction error vector and an uncertainty measure comprises:
[0015] Collecting real-time data measured by an eddy current displacement sensor, a spindle servo driver, a temperature sensor and a vibration sensor to constitute the multi-source real-time sensing data;
[0016] Inputting the multi-source real-time sensing data into the pre-constructed local uncertainty quantification model for uncertainty quantification processing;
[0017] The local uncertainty quantification model outputs the prediction error vector containing radial prediction error and axial prediction error, and outputs the corresponding uncertainty measure, which together constitute the first uncertainty feature tuple.
[0018] Preferably, the receiving a second uncertainty feature tuple from other machine tool nodes in the federal network and its corresponding measured error label, and generating a global shared model through federal aggregation optimization comprises:
[0019] Extracting the prediction error vector and uncertainty measure contained in each second uncertainty feature tuple and forming a training sample set with the corresponding measured error label;
[0020] updating the weight parameters of the pre-trained global shared model by federated averaging algorithm aggregation processing based on the training sample set, wherein the federated averaging algorithm aggregation processing comprises: calculating the weighted average of the weight parameters of each machine tool node local model, wherein the weight coefficients are dynamically allocated according to the size of the uncertainty metric of each node;
[0021] outputting the global shared model after updating the weight parameters.
[0022] Preferably, the real-time risk field strength is calculated based on the uncertainty metric of the current machine tool node and the statistical features of the obtained historical uncertainty data sequence, comprising:
[0023] obtaining the uncertainty metric of the current machine tool node and the historical uncertainty data sequence;
[0024] calculating the moving average and the moving standard deviation of the historical uncertainty data sequence;
[0025] generating a risk sensitivity coefficient in real time by a preset adaptive mapping function according to the ratio of the moving standard deviation to the moving average;
[0026] calculating the real-time risk field strength based on the uncertainty metric of the current machine tool node, the moving average and the risk sensitivity coefficient, wherein the calculation formula of the real-time risk field strength is:
[0027]
[0028] wherein represents the real-time risk field strength, represents the risk sensitivity coefficient, represents the uncertainty metric of the current machine tool node, represents the moving standard deviation.
[0029] Preferably, the real-time risk field strength and the historical compensation efficiency data read from the local database are input into the dynamic strategy generator to synthesize the optimal compensation strategy, comprising:
[0030] reading historical compensation efficiency data from the local database, wherein each piece of historical compensation efficiency data comprises historical risk field strength, historical compensation strategy and compensation efficiency index;
[0031] calculating the similarity weight of each piece of historical compensation efficiency data based on the real-time risk field strength and each historical risk field strength, wherein the calculation formula of the similarity weight is:
[0032]
[0033] wherein represents the similarity weight of the i-th piece of historical compensation efficiency data, a similarity weight of the historical compensation energy efficiency data, a risk field strength of the historical compensation energy efficiency data, a risk field strength of the historical compensation energy efficiency data, a preset bandwidth parameter, an exponential function,
[0034] a preferred degree score of each historical compensation energy efficiency data is calculated according to the compensation energy efficiency index, wherein the calculation formula of the preferred degree score is:
[0035]
[0036] wherein and respectively represent the preferred degree score and the compensation energy efficiency index of the historical compensation energy efficiency data, and respectively represent the maximum value and the minimum value of all historical compensation energy efficiency data; a fusion weight of each historical compensation strategy is calculated based on the similarity weight and the preferred degree score, wherein the calculation formula of the fusion weight is:
[0037]
[0038]
[0039] wherein represents the fusion weight of the historical compensation energy efficiency data; each historical compensation strategy is weighted and averaged according to the fusion weight to synthesize an optimal compensation strategy, wherein the synthesis formula of the optimal compensation strategy is:
[0040]
[0041]
[0042] wherein represents the optimal compensation strategy.
[0043] Preferably, the optimal compensation strategy is synergistically optimized according to the prediction error vector to generate a compensation instruction, and the compensation instruction is sent to the machine tool numerical control system of the current machine tool node for execution to compensate for the spindle dynamic error, comprising:
[0044] The radial prediction error and the axial prediction error in the prediction error vector are respectively associated with the corresponding compensation components in the optimal compensation strategy for correlation analysis to determine the potential influence coefficient of each prediction error component on the compensation effect;
[0045] The compensation components in the optimal compensation strategy are dynamically adjusted based on the potential influence coefficient to generate a preliminary optimized compensation strategy;
[0046] Extract the change characteristics of each error component in the prediction error vector, combine the preliminary optimization compensation strategy, and generate a final optimization compensation strategy through a preset compensation strategy fine-tuning model;
[0047] The final optimization compensation strategy is converted into a compensation instruction format recognizable by the numerical control system of the machine tool, a compensation instruction is generated, and the compensation instruction is sent to the numerical control system of the current machine tool node for execution, so as to compensate for the dynamic error of the spindle.
[0048] The application also provides a gantry machining center spindle dynamic error compensation system for executing a gantry machining center spindle dynamic error compensation method, and the compensation system comprises:
[0049] A data acquisition modeling module is configured to acquire multi-source real-time sensing data of the spindle system of the current machine tool node and input the data into a pre-constructed local uncertainty quantification model to generate a first uncertainty feature tuple containing a prediction error vector and an uncertainty measure;
[0050] A federal aggregation optimization module is configured to receive second uncertainty feature tuples and corresponding measured error labels from other machine tool nodes in the federal network, and generate a global shared model through federal aggregation optimization;
[0051] A risk field strength calculation module is configured to calculate a real-time risk field strength based on the uncertainty measure of the current machine tool node and statistical characteristics of a historical uncertainty data sequence;
[0052] A strategy synthesis generation module is configured to input the real-time risk field strength and historical compensation performance data read from a local database into a dynamic strategy generator to synthesize an optimal compensation strategy;
[0053] A strategy optimization execution module is configured to perform cooperative optimization on the optimal compensation strategy according to the prediction error vector, generate a compensation instruction, and send the compensation instruction to the numerical control system of the current machine tool node for execution, so as to compensate for the dynamic error of the spindle.
[0054] Compared with the related art, the gantry machining center spindle dynamic error compensation method and system provided by the application have the following beneficial effects:
[0055] Firstly, by collecting the multi-source real-time sensing data of the current machine tool node spindle system and inputting it into the pre-constructed local uncertainty quantification model, various information in the spindle running process can be comprehensively and accurately obtained, and the first uncertainty feature tuple containing the prediction error vector and the uncertainty measure is generated, providing an accurate data basis for subsequent error compensation. Secondly, the data of other machine tool nodes is received by using the federal network, and the global shared model is generated by federal aggregation optimization, realizing data sharing and collaborative optimization among multiple machine tool nodes, fully utilizing the wisdom of the group, and improving the generalization ability and accuracy of the model. Thirdly, the real-time risk field strength is calculated based on the uncertainty measure of the current machine tool node and the historical data, and the optimal compensation strategy is synthesized combined with the historical compensation effectiveness data, which can dynamically adjust the compensation strategy according to the real-time running state of the spindle, and enhance the pertinence and effectiveness of the compensation. Finally, the optimal compensation strategy is optimized according to the prediction error vector, the compensation instruction is generated and sent to the machine tool numerical control system for execution, realizing real-time and accurate compensation of the spindle dynamic error, effectively improving the machining precision and stability of the gantry machining center, reducing the scrap rate and improving the production efficiency. BRIEF DESCRIPTION OF DRAWINGS
[0056] Figure 1 A flow chart of a gantry machining center spindle dynamic error compensation method provided by the present application is shown in the figure.
[0057] Figure 2 A module structure schematic diagram of a gantry machining center spindle dynamic error compensation system provided by the present application is shown in the figure. DETAILED DESCRIPTION
[0058] The present application will be further described below in conjunction with the drawings and examples. It should be understood that the specific examples described herein are only intended to explain the present application, but not to limit the present application. In addition, it should be noted that only the parts related to the present application are shown in the drawings for convenience of description, but not all the structures. Furthermore, the examples in the present application and the features in the examples can be combined with each other without conflict.
[0059] In addition, it should be noted that only the parts related to the present application are shown in the drawings for convenience of description, but not all the contents. Before discussing the exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flow charts. Although the flow chart describes each operation (or step) as a sequential process, many of the operations can be implemented in parallel, concurrently or simultaneously. In addition, the order of the operations can be rearranged. The process can be terminated when its operations are completed, but can also have additional steps not included in the drawings. The process can correspond to a method, function, procedure, subroutine, subprogram, etc.
[0060] Embodiment one
[0061] The application provides a gantry machining center spindle dynamic error compensation method, referring to Figure 1 as shown, the compensation method comprises the following steps:
[0062] S1: collect the multi-source real-time sensing data of the current machine tool node spindle system, and input it to the pre-constructed local uncertainty quantification model to generate a first uncertainty feature tuple containing a prediction error vector and an uncertainty measure.
[0063] Specifically, step S1 comprises the following steps:
[0064] S11: collect real-time data measured by an eddy current displacement sensor, a spindle servo driver, a temperature sensor and a vibration sensor to form the multi-source real-time sensing data.
[0065] In specific implementation, one eddy current displacement sensor is installed in each of the X and Y directions perpendicular to each other in the radial direction of the spindle front end bearing seat to measure the radial displacement of the spindle; one eddy current displacement sensor is installed in the Z direction of the spindle end face in the axial direction to measure the axial displacement of the spindle; the torque current percentage and the actual speed data of the spindle servo driver are read in real time through the OPCUA interface of the machine tool numerical control system; PT100 temperature sensors are installed on the outer walls of the front and rear bearing housings of the spindle to collect bearing temperature rise data; an ICP type vibration acceleration sensor is installed at the joint surface between the spindle box and the column to collect spindle vibration frequency spectrum data. All sensor data is collected through a distributed IO module, time synchronization is performed using the IEEE1588 precision time protocol, and real-time transmission is performed to an industrial computer at a sampling frequency of 1 kHz to form a multi-source real-time sensing data stream containing multiple physical quantities such as displacement, force, heat and vibration.
[0066] S12: input the multi-source real-time sensing data to the pre-constructed local uncertainty quantification model for uncertainty quantification processing.
[0067] In specific implementation, the local uncertainty quantification model is constructed using a Bayesian neural network based on Monte Carlo Dropout, the input layer of which contains 6 neurons corresponding to X / Y / Z direction displacement, spindle torque, bearing temperature and vibration acceleration data, the hidden layer uses a 3-layer fully connected structure with 128 neurons per layer and sets a Dropout rate of 0.2, and the output layer contains 4 neurons. During data processing, first, the input data is standardized for preprocessing to eliminate the dimension effect; then the processed data is input to the Bayesian neural network for forward propagation calculation, the probability distribution of the prediction result is obtained by repeatedly executing 500 times of forward propagation and activating Dropout; finally, the confidence interval of the prediction value is calculated based on the distribution to complete the conversion from deterministic prediction to uncertainty quantification.
[0068] S13: Output the prediction error vector containing radial prediction error, axial prediction error, and the corresponding uncertainty metric from the local uncertainty quantification model, which together constitute the first uncertainty feature tuple.
[0069] In implementation, the first two neurons of the model output layer output the prediction error values in radial X and Y directions respectively, and the third neuron outputs the prediction error value in axial Z direction. These three values together constitute the prediction error vector. The fourth neuron outputs the comprehensive uncertainty metric value , which is obtained by calculating the standard deviation of 500 forward propagation results and represents the confidence level of the current prediction. Finally, the prediction error vector and the uncertainty metric are packaged into a JSON-formatted data tuple, which contains a timestamp, a device ID, and a data validity flag, and constitutes a complete second uncertainty feature tuple that is transmitted to the federated learning aggregation server.
[0070] S2: Receive the second uncertainty feature tuples and their corresponding measured error labels from other machine tool nodes in the federated network, and generate a globally shared model through federated aggregation optimization.
[0071] Specifically, step S2 includes the following steps:
[0072] S21: Extract the prediction error vector and the uncertainty metric contained in each second uncertainty feature tuple, and construct a training sample set with the corresponding measured error label.
[0073] In implementation, the second uncertainty feature tuples from other machine tool nodes are received through the encrypted communication channel of the federated learning platform, and each tuple is transmitted and protected using the AES-256 encryption algorithm. After receiving the data, the private key of the node is used for decryption verification, and the prediction error vector and the uncertainty metric value contained therein are extracted. At the same time, the laser interferometer measured error data of the corresponding time period is obtained from the local quality detection system as a label, including radial error value and axial error value . The three components of the prediction error vector are used as input features, and the measured error values are used as output labels to construct a training sample pair in the form of Finally, all node data is collected to form a distributed training sample set containing multiple devices and multiple working conditions, which is used for subsequent model aggregation optimization.
[0074] S22: Based on the training sample set, update the weight parameters of the pre-trained global shared model through federated averaging algorithm aggregation processing, wherein the federated averaging algorithm aggregation processing includes: calculating the weighted average of the local model weight parameters of each machine tool node, wherein the weight coefficients are dynamically allocated according to the magnitude of the uncertainty metric of each node.
[0075] In practice, the global shared model is architecturally identical to the local uncertainty quantification model constructed in step S12, i.e., it also uses a Bayesian neural network based on Monte Carlo Dropout, with the same neuron structure and number in its input, hidden, and output layers. The federated aggregation process does not change the model architecture, but rather performs weighted fusion of the weight parameters of the local models at each node to generate a better next-generation global model weight.
[0076] The implementation employs a federated averaging algorithm with uncertainty weighting. First, a global model with the same structure as the local uncertainty quantification model is initialized. Then, the aggregation weight is calculated for each participating node, using the following formula: ,in For the first The uncertainty metric of each node is used, and this weighting strategy ensures that nodes with lower uncertainty (more reliable predictions) have a larger weight in the aggregation. Then, based on the local model weights of each node and the calculated aggregation weights, the weighted average of the global model is calculated. Finally, a moving average strategy is used to update the global model parameters, with the update formula as follows:
[0077]
[0078] in The momentum factor was set to 0.9 to ensure the stability of model updates. This represents the total number of nodes participating in the aggregation. Indicates the number of update iterations. Indicates the first The node at the th Local model parameters for the next iteration Indicates the global model at the 1st The parameters for the next iteration Indicates the global model at the 1st The parameters are updated in the next iteration.
[0079] S23: Output the globally shared model after updating the weight parameters.
[0080] In specific implementation, the updated global model parameters are serialized in binary format, a model fingerprint is generated using SHA-256 algorithm for integrity verification, and the updated model parameter package is distributed to all machine tool nodes in the network through the distribution mechanism of the federated learning platform. After each node receives the new global model, it first verifies the legality of the model fingerprint, then loads it locally to replace the original model, while retaining the last version of the model as a rollback backup. After the model update is completed, the node sends a confirmation signal to the federated learning platform, which records the version number, update time node, and node information participating in the aggregation of this model, completing a complete federated learning aggregation cycle.
[0081] S3: Calculate the real-time risk field strength based on the uncertainty metric of the current machine tool node and the statistical features of the historical uncertainty data sequence obtained.
[0082] Specifically, step S3 includes the following steps:
[0083] S31: Obtain the uncertainty metric of the current machine tool node and the historical uncertainty data sequence.
[0084] In specific implementation, the latest uncertainty metric value generated in step S13 is read in real time through the local data management interface , which is stored in the memory shared area as a floating-point number; at the same time, the historical uncertainty metric data sequence of the node in the last 24 hours is queried from the time series database (using InfluxDB), with a sampling interval of 1 second to obtain a total of 86400 data points, forming the historical uncertainty data sequence. During data acquisition, CRC32 check is used to ensure data integrity and accuracy, and abnormal values (such as data points exceeding ±3 ) are removed and completed by linear interpolation to form a complete and continuous historical data sequence for subsequent statistical analysis.
[0085] S32: Calculate the moving average and moving standard deviation of the historical uncertainty data sequence.
[0086] In specific implementation, the sliding window method is used to calculate the statistical features, with a window size of 3600 data points (i.e. 1 hour of data). First, the historical data sequence is smoothed, and the exponential weighted moving average (EWMA) algorithm is used to calculate the moving average μ_hist, with the calculation formula as follows:
[0087]
[0088] where is the smoothing factor, taking 0.2, controlling the weight distribution of the current data and the historical data, and the smaller the value, the greater the weight of the historical data; denotes the moving average value of the current time, representing the trend center of the historical uncertainty metric, and is calculated based on exponential weighting; denotes the uncertainty metric value of the current time, which is real-time uncertainty data read from the time series database; denotes the moving average value of the previous time;
[0089] Then, the moving standard deviation is calculated based on the moving average value , the Welford online algorithm is used to update the standard deviation in real time, and the calculation formula is , wherein SSD is the weighted sum of squared deviations, is the number of valid data points in the window.
[0090] S33: According to the ratio of the moving standard deviation to the moving average value, a risk sensitivity coefficient is generated in real time by a preset adaptive mapping function.
[0091] In specific implementation, first, the ratio of the moving standard deviation to the moving average value is calculated , which represents the relative volatility degree of the historical uncertainty; then, the risk sensitivity coefficient is generated by a piecewise linear mapping function , and the mapping rule is: when ≤0.1, =1.0; when 0.1 ≤0.3, =1.0+2.5×( -0.1); when >0.3, =1.5+1.0×(η-0.3). The mapping function ensures that a conservative strategy is adopted when the volatility is small ( ≈1), the risk sensitivity is appropriately improved when the volatility increases ( increases), and an aggressive strategy is adopted when the volatility is extreme ( >2.5), and the mapping output result is limited in the range of .
[0092] S34: Real-time risk field strength is calculated based on the uncertainty metric of the current machine tool node, the moving average value, and the risk sensitivity coefficient, and the calculation formula of the real-time risk field strength is:
[0093]
[0094] , wherein denotes the real-time risk field strength, denotes the risk sensitivity coefficient, denotes the uncertainty metric of the current machine tool node, denotes the moving standard deviation.
[0095] In implementation, firstly, the current uncertainty metric is read and the moving average value calculated in step S32 , the relative uncertainty ratio is calculated ; then the risk sensitivity coefficient generated in step S33 is taken as the exponential term, and the real-time risk field strength R is calculated by the exponential function. The calculation process uses the mathematical operation library of IEEE 754 standard, and uses the fast exponential algorithm (such as Schraudolph algorithm) to optimize the calculation efficiency, ensuring that all operations are completed within 1 ms. The final output risk field strength R is a dimensionless index, and the value range is , the larger the value, the higher the current risk level of the system.
[0096] In addition, the formula uses the relative ratio instead of the absolute value, and the reason is to eliminate the baseline difference under different equipment and working conditions. The current uncertainty metric can only reflect the predicted instantaneous absolute error, and dividing by the historical moving average value converts it into the deviation degree relative to the historical normal level of the equipment itself. This makes a high-performance new machine tool and an old machine tool obtain comparable risk evaluation at the same ratio, realizing the standardization of risk assessment.
[0097] Secondly, the formula introduces the exponential term in order to capture the nonlinear characteristics of risk growth. In actual industrial scenarios, the deterioration of system performance is often not linear: when the uncertainty slightly exceeds the normal range, the risk increases slowly; when it deviates significantly, it often means the occurrence of failure or severe disturbance, and the risk should rise sharply. The exponential function can exactly describe this "accelerated deterioration" effect. When >1, any ratio greater than 1 will be amplified, making the R value significantly increase, thus sending a strong signal for high-risk state.
[0098] Most importantly, the dynamic adaptive ability of the formula is realized through the linkage of and the previous step S33. The risk sensitivity coefficient is not a fixed value, but is adjusted in real time according to the volatility of the historical uncertainty sequence. When the historical data is stable ( small), the system is in a high-precision state, and even a small increase in uncertainty may mean the beginning of an anomaly, so a larger value is given to improve sensitivity and achieve early warning. Conversely, when the historical data fluctuates greatly ( large), it means that the equipment itself is in an unstable state, and larger uncertainty fluctuations have become the "new normal", so a smaller This design reduces sensitivity and avoids false alarms. It enables the system to intelligently distinguish between "minor anomalies in precision equipment" and "normal fluctuations in older equipment," significantly improving alarm accuracy.
[0099] S4: Input the real-time risk field strength and the historical compensation effectiveness data read from the local database into the dynamic strategy generator to synthesize the optimal compensation strategy.
[0100] Specifically, step S4 includes the following steps:
[0101] S41: Read historical compensation energy efficiency data from the local database, where each piece of historical compensation energy efficiency data includes historical risk field strength, historical compensation strategy and compensation energy efficiency index.
[0102] In practice, historical compensation records are retrieved from the local MySQL database via an SQL query interface. The query criteria are historical data within ±100 rpm of the current spindle speed, and the time range is the most recent 30 days. Each record contains three core fields: historical risk field strength (FLOAT type, from the historical calculation results in step S34), historical compensation strategy (BLOB type, stored as a set of compensation parameters in JSON format, including radial compensation gain and axial compensation gain), and compensation effectiveness index (FLOAT type, calculated based on the contour accuracy measurement value of the workpiece after this compensation; the higher the accuracy, the larger the value). After data retrieval, the Protobuf protocol is used for serialization and transmission to ensure the integrity of the data structure and transmission efficiency.
[0103] S42: Calculate the similarity weight of each historical compensation energy efficiency data based on the real-time risk field strength and each historical risk field strength. The formula for calculating the similarity weight is as follows:
[0104]
[0105] in Indicates the first Similarity weights of historical compensation energy efficiency data Indicates the first The risk field strength of historical energy efficiency compensation data This indicates the preset bandwidth parameter. This represents an exponential function.
[0106] In practice, the real-time risk field strength R calculated in step S34 is first read, along with the risk field strengths of each historical record obtained from the database. Then, similarity weights are calculated based on the Gaussian kernel function, where the bandwidth parameter... The standard deviation of historical risk field strength is dynamically set to 0.15, which controls the tolerance of similarity judgment. During calculation, the current risk field strength is calculated for each historical record. With historical risk field strength The squared Euclidean distance is substituted into the formula, and the similarity weight between 0 and 1 is obtained through the exp function. The closer the weight value is to 1, the more similar the risk situation of that historical record is to the current situation.
[0107] S43: Calculate the optimization score for each historical optimization energy efficiency data based on the aforementioned optimization energy efficiency index, wherein the optimization score is calculated using the following formula:
[0108]
[0109] in and They represent the first The optimality score and compensation efficiency index of historical compensation energy efficiency data. and These represent the maximum and minimum values of all historical compensation energy efficiency data, respectively.
[0110] In practice, the first step is to iterate through all retrieved historical records and find the maximum value of the compensation efficiency index Ei. and minimum value Then, the compensation performance index for each historical record. Perform min-max normalization to linearly map it to... The interval. The preference score. It intuitively reflects the effectiveness level of historical compensation strategies. =1 indicates that the historical strategy achieved the best compensation effect at that time. =0 indicates the worst performance. Normalization eliminates the dimensional differences in performance indicators under different operating conditions, making the strategy effects at different times comparable.
[0111] S44: Calculate the fusion weight of each historical compensation strategy based on the similarity weight and the preference score, wherein the formula for calculating the fusion weight is:
[0112]
[0113] in Indicates the first The fusion weight of historical compensation energy efficiency data.
[0114] In practice, for each historical record, its similarity weight is calculated. With preference score The original fusion weight of the record is obtained by multiplication. Then the original weights of all records are summed up, and the original weight of each record is normalized to ensure that the sum of all fusion weights is 1. This calculation method considers both the situational similarity of the strategy and the absolute performance level of the strategy , so that the final comprehensive weight can balance the two dimensions of “current applicability” and “historical effectiveness”.
[0115] S45: Weighting and averaging each historical compensation strategy according to the fusion weight to synthesize the optimal compensation strategy, wherein the synthesis formula of the optimal compensation strategy is:
[0116]
[0117] wherein represents the optimal compensation strategy.
[0118] In specific implementation, first, the specific parameters of each historical compensation strategy (including radial compensation gain , and axial compensation gain ) are parsed. Then the corresponding parameters of all historical strategies are weighted and summed according to the calculated fusion weight :
[0119]
[0120] The optimal compensation strategy obtained contains a set of optimized compensation parameters , which integrates the advantages of multiple historical strategies, adapts to the current risk situation, and incorporates historical best practices to provide accurate parameter basis for continuous real-time compensation.
[0121] S5: According to the prediction error vector, the optimal compensation strategy is synergistically optimized to generate a compensation instruction, which is sent to the machine tool numerical control system of the current machine tool node for execution to compensate for the spindle dynamic error.
[0122] Specifically, step S5 includes the following steps:
[0123] S51: Associate and analyze the radial prediction error and axial prediction error in the prediction error vector with the corresponding compensation components in the optimal compensation strategy respectively to determine the potential influence coefficient of each prediction error component on the compensation effect.
[0124] In specific implementation, Pearson correlation coefficient analysis method is used to establish the correlation between the prediction error component and the optimal compensation strategy parameter The correlation model of the error components and the residual error after compensation is calculated to determine the influence coefficient vector wherein the calculation formula of each influence coefficient vector is:
[0125]
[0126] wherein, , and represent the influence coefficients of the radial ( ) and axial (z) error components, respectively, , and represent the predicted errors in the radial and axial directions, respectively, represents the covariance calculation, is the residual error after compensation, , and represent the variances of the error components, respectively. The calculation process uses a sliding window method, and the window size is the last 1000 groups of data, to ensure the timeliness of the influence coefficients.
[0127] S52: dynamically adjusting the compensation components in the optimal compensation strategy based on the potential influence coefficients to generate a preliminary optimized compensation strategy.
[0128] In this embodiment, in specific implementation, a weighted adjustment algorithm is used to dynamically scale each compensation gain parameter according to the influence coefficient vector:
[0129]
[0130] wherein , and represent the adjusted compensation gains, is the adjustment sensitivity coefficient, which is set to 0.5 by default. Parameter boundary constraints are set during the adjustment process to ensure that the adjusted gain parameters remain within a reasonable range . A momentum term is also introduced to retain 20% weight of the previous adjustment direction, avoiding drastic fluctuations in the parameters and ensuring system stability.
[0131] S53: extracting the variation characteristics of each error component in the predicted error vector, combining the preliminary optimized compensation strategy, and generating a final optimized compensation strategy through a preset compensation strategy fine-tuning model.
[0132] In implementation, first, the time domain features (mean, variance, peak) and frequency domain features (main frequency component, energy distribution) of the prediction error vector are extracted, and then input into a pre-trained deep reinforcement learning fine-tuning model. The model adopts an Actor-Critic architecture, the Actor network takes the feature vector and the preliminary policy parameter as input, and outputs the policy adjustment amount The Critic network evaluates the performance of the adjusted policy. Through iterative optimization of the policy gradient algorithm, the final fine-tuned compensation parameter is output:
[0133]
[0134] The final optimized compensation strategy is formed by
[0135] S54: Convert the final optimized compensation strategy into a compensation instruction format recognizable by the machine tool numerical control system, generate a compensation instruction, and send the compensation instruction to the machine tool numerical control system of the current machine tool node for execution to compensate for the spindle dynamic error.
[0136] In implementation, first, the optimized compensation parameter is encoded according to the custom G code format of the FANUC numerical control system to generate an instruction sequence. Then, a secure connection with the numerical control system is established through the OPC UA protocol, and SHA-256 digital signature is used to ensure the integrity of the instruction. The instruction sending adopts a real-time priority data transmission channel to ensure that the compensation instruction reaches the numerical control system kernel for execution within 1ms. The system also monitors the instruction execution status, and if an execution exception is found, it immediately starts the rollback mechanism to restore to the last stable configuration, ensuring the safety and reliability of the machining process.
[0137] Embodiment two
[0138] The application also provides a gantry machining center spindle dynamic error compensation system for executing a gantry machining center spindle dynamic error compensation method, as shown in Figure 2 The compensation system comprises:
[0139] The data acquisition and modeling module 100 is used to collect multi-source real-time sensing data of the spindle system of the current machine tool node, and input the data into a pre-constructed local uncertainty quantification model to generate a first uncertainty feature tuple containing a prediction error vector and an uncertainty measure.
[0140] The federal aggregation optimization module 200 is used to receive second uncertainty feature tuples and their corresponding measured error labels from other machine tool nodes in the federal network, and generate a global shared model through federal aggregation optimization.
[0141] The risk field strength calculation module 300 is configured to calculate a real-time risk field strength based on the uncertainty metric of the current machine tool node and the statistical features of the obtained historical uncertainty data sequence.
[0142] The strategy synthesis generation module 400 is configured to input the real-time risk field strength and the historical compensation performance data read from the local database into a dynamic strategy generator to synthesize an optimal compensation strategy.
[0143] The strategy optimization execution module 500 is configured to perform cooperative optimization on the optimal compensation strategy according to the prediction error vector, generate a compensation instruction, and send the compensation instruction to the machine tool numerical control system of the current machine tool node for execution to compensate for the spindle dynamic error.
[0144] The present application is described with reference to flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to embodiments of the present application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams can be implemented by computer program instructions, and the combination of the flows and / or blocks in the flowcharts and / or block diagrams. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device realize a function specified in one or more flows and / or blocks in the flowcharts and / or block diagrams. Figure 1 The device for realizing the function specified in one flow or multiple flows and / or blocks Figure 1 The device for realizing the function specified in one flow or multiple flows and / or blocks
[0145] Those skilled in the art can understand that all or part of the steps of various methods in the above embodiments can be instructed by programs to relevant hardware, and the programs can be stored in a computer readable storage medium, including Read-Only Memory (ROM), Random Access Memory (RAM), Programmable Read-Only Memory (PROM), Erasable Programmable Read-Only Memory (EPROM), One-time Programmable Read-Only Memory (OTPROM), Electrically-Erasable Programmable Read-Only Memory (EEPROM), Compact Disc Read-Only Memory (CD-ROM) or other optical disk storage, magnetic disk storage, magnetic tape storage, or any other medium that can be used to carry or store data in a computer readable manner.
[0146] It should also be noted that the terms "comprising", "containing", or any other variant thereof are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements in the list, but can also include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the statement "comprising a" does not exclude the existence of additional identical elements in the process, method, article, or apparatus that includes the element.
Claims
1. A method for dynamic error compensation of a gantry machining center spindle, characterized in that, The compensation method includes the following steps: Collect multi-source real-time sensor data of the current machine tool node spindle system and input it into the pre-built local uncertainty quantification model to generate the first uncertainty feature tuple containing the prediction error vector and uncertainty measure; Receive the second uncertainty feature tuple and its corresponding measured error label from other machine tool nodes in the federated network, and generate a globally shared model through federated aggregation optimization; Based on the uncertainty measure of the current machine tool node and the statistical characteristics of the acquired historical uncertainty data sequence, the real-time risk field strength is calculated. The calculation of real-time risk field strength specifically includes the following steps: Obtain the uncertainty measure and historical uncertainty data sequence of the current machine tool node; Calculate the moving average and moving standard deviation of the historical uncertainty data series; Based on the ratio of the moving standard deviation to the moving average, a risk sensitivity coefficient is generated in real time using a preset adaptive mapping function; The real-time risk field strength is calculated based on the uncertainty metric of the current machine tool node, the moving average value, and the risk sensitivity coefficient, wherein the formula for calculating the real-time risk field strength is: in Indicates the real-time risk field strength. Indicates the risk sensitivity coefficient. This represents a measure of the uncertainty at the current machine tool node. Indicates the moving standard deviation; The real-time risk field strength and the historical compensation effectiveness data read from the local database are input into the dynamic strategy generator to synthesize the optimal compensation strategy. The synthesis of the optimal compensation strategy specifically includes the following steps: Historical compensation energy efficiency data is read from the local database, where each historical compensation energy efficiency data includes historical risk field strength, historical compensation strategy and compensation energy efficiency index; The similarity weights of each historical compensation energy efficiency data are calculated based on the real-time risk field strength and each historical risk field strength. The formula for calculating the similarity weights is as follows: in Indicates the first Similarity weights of historical compensation energy efficiency data Indicates the first The risk field strength of historical energy efficiency compensation data This indicates the preset bandwidth parameter. Represents an exponential function; The optimization score of each historical energy efficiency data point is calculated based on the aforementioned energy efficiency compensation index, wherein the formula for calculating the optimization score is as follows: in and They represent the first The optimality score and compensation efficiency index of historical compensation energy efficiency data. and These represent the maximum and minimum values of all historical energy efficiency compensation data, respectively. The fusion weight of each historical compensation strategy is calculated based on the similarity weight and the preference score, wherein the formula for calculating the fusion weight is: in Indicates the first The fusion weight of historical compensation energy efficiency data; The historical compensation strategies are weighted and averaged according to the aforementioned fusion weights to synthesize the optimal compensation strategy. The synthesis formula for the optimal compensation strategy is as follows: in This represents the optimal compensation strategy; The optimal compensation strategy is collaboratively optimized based on the predicted error vector to generate a compensation instruction, which is then sent to the CNC system of the current machine tool node for execution to compensate for the spindle dynamic error.
2. The method for dynamic error compensation of a gantry machining center spindle according to claim 1, characterized in that, The process involves acquiring multi-source real-time sensor data from the current machine tool node spindle system and inputting it into a pre-built local uncertainty quantification model to generate a first uncertainty feature tuple containing a prediction error vector and uncertainty measurement, including: The multi-source real-time sensing data is composed of real-time data collected from eddy current displacement sensors, spindle servo drives, temperature sensors, and vibration sensors. The multi-source real-time sensing data is input into the pre-built local uncertainty quantification model for uncertainty quantification processing; The prediction error vector, which includes radial prediction error and axial prediction error, and the corresponding uncertainty metric output by the local uncertainty quantification model together constitute the first uncertainty feature tuple.
3. The method for dynamic error compensation of a gantry machining center spindle according to claim 2, characterized in that, The step of receiving the second uncertainty feature tuple and its corresponding measured error label from other machine tool nodes in the federated network, and generating a globally shared model through federated aggregation optimization, includes: Extract the prediction error vector and uncertainty measure contained in each second uncertainty feature tuple, and form a training sample set with the corresponding measured error label; Based on the training sample set, the weight parameters of the pre-trained global shared model are updated by the federated averaging algorithm aggregation process, wherein the federated averaging algorithm aggregation process includes: calculating the weighted average of the local model weight parameters of each machine tool node, wherein the weight coefficients are dynamically allocated according to the magnitude of the uncertainty metric of each node. Output the globally shared model with updated weight parameters.
4. The method for dynamic error compensation of a gantry machining center spindle according to claim 3, characterized in that, The step of collaboratively optimizing the optimal compensation strategy based on the predicted error vector, generating compensation instructions, and sending the compensation instructions to the machine tool CNC system of the current machine tool node for execution to compensate for the spindle dynamic error includes: The radial prediction error and axial prediction error in the prediction error vector are respectively correlated with the corresponding compensation components in the optimal compensation strategy to determine the potential influence coefficient of each prediction error component on the compensation effect. Based on the potential impact coefficient, the compensation component in the optimal compensation strategy is dynamically adjusted to generate a preliminary optimized compensation strategy. Extract the variation characteristics of each error component in the prediction error vector, combine them with the preliminary optimization compensation strategy, and fine-tune the model through the preset compensation strategy to generate the final optimization compensation strategy. The final optimized compensation strategy is converted into a compensation instruction format that can be recognized by the machine tool CNC system, a compensation instruction is generated, and the compensation instruction is sent to the machine tool CNC system of the current machine tool node for execution to compensate for the spindle dynamic error.
5. A dynamic error compensation system for a gantry machining center spindle, used to execute the dynamic error compensation method for a gantry machining center spindle as described in any one of claims 1 to 4, characterized in that, The compensation system includes: The data acquisition and modeling module is used to acquire multi-source real-time sensor data of the current machine tool node spindle system and input it into the pre-built local uncertainty quantification model to generate the first uncertainty feature tuple containing the prediction error vector and uncertainty measure. The federated aggregation optimization module is used to receive the second uncertainty feature tuple and its corresponding measured error label from other machine tool nodes in the federated network, and generate a globally shared model through federated aggregation optimization. The risk field strength calculation module is used to calculate the real-time risk field strength based on the uncertainty measure of the current machine tool node and the statistical characteristics of the acquired historical uncertainty data sequence. The strategy synthesis and generation module is used to input the real-time risk field strength and the historical compensation effectiveness data read from the local database into the dynamic strategy generator to synthesize the optimal compensation strategy. The strategy optimization execution module is used to perform collaborative optimization of the optimal compensation strategy based on the predicted error vector, generate compensation instructions, and send the compensation instructions to the machine tool CNC system of the current machine tool node for execution to compensate for the spindle dynamic error.
Citation Information
Patent Citations
Portal frame milling machine error compensation system and method for achieving high-precision machining
CN120134064A
Track optimization method based on multi-source heterogeneous positioning data fusion algorithm
CN120521598A