Mechanical part machining quality online prediction control method and system
Patent Information
- Application Number
- CN202611211471.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-11
- Publication Date
- 2026-10-30
AI Technical Summary
[0005]针对现有技术中零件质量预测滞后于加工完成、缺乏实时闭环控制能力的技术问题,本发明提供了机械零件加工质量在线预测控制方法及系统
[0013]本发明的有益效果在于:通过建立过程参数与质量特性之间的因果映射网络,实现了加工过程中质量特性的实时在线预测,将质量管控从事后检测前移至加工过程中,从根本上改变了传统加工质量管控的被动模式;通过超差风险概率评估与自适应参数补偿闭环控制,在质量偏差尚未形成之前即予以主动纠正,显著降低加工质量波动与废品率;通过因果注意力机制替代传统的统计相关分析,能够更准确地刻画过程参数波动与质量响应之间的非线性传递规律,为参数补偿提供了物理可解释的调控路径;通过质量追溯数据库与异常归因评分机制,实现了从加工过程到质量结果的全链路可追溯,为异常原因分析提供了量化数据支撑,显著提升了异常处置的效率和准确性。
Smart Images

Figure CN123010602A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent control technology for machining quality, and in particular to an online predictive control method and system for machining quality of mechanical parts. Background Technology
[0002] In modern manufacturing, the machining quality of mechanical parts directly determines the performance and reliability of products. With the ever-increasing precision requirements of parts in aerospace, automotive manufacturing, and precision instruments, traditional machining quality control methods face increasingly severe challenges. In current industrial practice, parts quality inspection is usually conducted after machining is completed. This post-production inspection model inherently has a lag; by the time quality deviations are detected, the machining process for that batch has already ended, resulting in batch scrap losses that are often irreversible. Industry statistics show that in the precision machining field, scrap losses due to delayed quality inspection can account for 5% to 15% of total production costs. Especially in multi-variety, small-batch production models, the interplay and coupling of various factors such as fluctuations in process parameters, gradual tool wear, changes in cooling conditions, and environmental temperature and humidity disturbances make consistent parts quality control extremely difficult. How to solve the problem of lag in quality control at its source and establish real-time quality prediction and proactive intervention capabilities during the machining process has become a core technical challenge that must be overcome in the intelligent transformation of the manufacturing industry.
[0003] Chinese patent application CN111931307A proposes a quality prediction scheme that integrates cutting mechanism and inspection data. This scheme establishes a response surface empirical model based on the mechanistic functions of cutting force, cutting temperature, and cutting displacement of typical materials. It uses the Pearson correlation coefficient to calculate the weights of key parameters such as depth of cut, feed rate, and cutting speed, and integrates this weight matrix into the Gaussian kernel function of a support vector regression model. Then, it uses a particle swarm optimization algorithm combined with cross-validation to train the prediction model. For quality assessment, the scheme employs a hierarchical fuzzy comprehensive evaluation method to classify and determine the quality of parts. For parts that do not meet the requirements, the key process parameters are further optimized using the particle swarm optimization algorithm. This scheme achieves intelligent prediction and parameter optimization of part quality to a certain extent.
[0004] However, the technical solutions disclosed in the above methods still have the following shortcomings: First, the solution is essentially an offline prediction and post-optimization framework. The input data of the prediction model comes from the historical sample set that has already been collected. It cannot output quality prediction results in real time during the processing, nor can it provide early warning of impending quality deviations during processing. Second, the Pearson correlation coefficient used in this solution can only characterize the linear correlation between process parameters and quality characteristics. It is difficult to capture the nonlinear causal transmission law that is widely present in the processing process, especially the complex nonlinear characteristics of quality response under the cross-coupling of multiple parameters. Third, the process parameter optimization results of this solution require manual intervention before they can be applied to subsequent processing. There is a significant time delay between optimization calculation and parameter implementation. Fourth, this solution does not establish a full data recording and traceability mechanism for the processing process. Once a quality anomaly occurs, it is difficult to effectively trace back and locate the root cause of the problem. The attribution of anomalies heavily relies on the experience judgment of technical personnel and lacks quantitative analysis methods. Furthermore, regarding data utilization, while the aforementioned technical solutions collect mechanistic data such as cutting force, cutting temperature, and cutting displacement, they only use this data as independent variables in constructing response surface regression models, failing to fully explore the dynamic evolution characteristics of multi-channel process parameters over time. In actual machining processes, factors such as the gradual development of tool wear, the slow deterioration of coolant performance, and the cumulative effect of machine tool thermal deformation all exhibit significant time-series dependence characteristics. Relying solely on static parameter snapshots at a single moment is insufficient to capture these gradual trends. Simultaneously, existing technical solutions generally lack full data recording and quality traceability mechanisms for the machining process. Once a batch of quality anomalies occurs, it is difficult to quickly locate the source of process parameter fluctuations corresponding to the root cause of the anomaly from massive machining records, leading to anomaly attribution analysis heavily relying on the experience and judgment of technical personnel. Therefore, how to achieve real-time online prediction of quality characteristics during machining, early warning of out-of-tolerance risks, and adaptive closed-loop compensation of process parameters, while establishing a complete quality traceability and anomaly attribution system, are urgent technical problems to be solved in the field of intelligent quality control in machining. Summary of the Invention
[0005] To address the technical problems in existing technologies where part quality prediction lags behind processing completion and lacks real-time closed-loop control capabilities, this invention provides an online predictive control method and system for the processing quality of mechanical parts.
[0006] This invention discloses an online predictive control method for the machining quality of mechanical parts, comprising the following steps:
[0007] Step S1, Real-time Acquisition of Multi-Source Process Data and Construction of Time Series Matrix: During the machining process, the spindle speed and feed rate are acquired through the internal interface of the CNC system, the cutting force signal and vibration acceleration signal are acquired through external sensors, and the ambient temperature and humidity are acquired through the environmental monitoring device. The data from each channel are aligned according to a unified sampling timestamp to construct a multi-dimensional process data time series matrix.
[0008] Step S2, Construction of the causal mapping network between process parameters and quality characteristics: Based on the historical processing dataset, the process parameter channel is used as the input node, and the part size accuracy deviation, surface roughness value and geometric tolerance deviation are used as the output node. The causal attention mechanism is used to learn the influence weight of each process parameter fluctuation on each quality characteristic and the nonlinear transmission path to obtain the causal mapping network model.
[0009] Step S3, Real-time Quality Prediction and Out-of-Tolerance Risk Assessment: During the processing, the time series matrix constructed in real time in step S1 is input into the causal mapping network model, which continuously outputs the predicted values of each quality characteristic, and calculates the out-of-tolerance risk probability based on the distance between the predicted value and the tolerance boundary. When the out-of-tolerance risk probability exceeds the preset risk threshold, an early warning signal is generated.
[0010] Step S4, Adaptive process parameter compensation and closed-loop control: In response to the early warning signal, the compensation amount of each adjustable process parameter is calculated based on the causal weight matrix in the causal mapping network model. The compensation amount is written in real time through the CNC system interface to adjust the cutting parameters, thereby realizing adaptive closed-loop control of the machining process. The compensated parameters re-enter step S1 to form closed-loop feedback.
[0011] Step S5, Quality Traceability Database Construction and Anomaly Backtracking Analysis: Synchronously record the time-series matrix data, quality prediction curve, out-of-tolerance risk probability trajectory, and parameter compensation log for each part throughout the entire process to construct a quality traceability database. When subsequent inspections discover quality anomalies, the database is used to backtrack and locate the abnormal time nodes and process parameter fluctuation sources.
[0012] This invention also provides an online predictive control system for the machining quality of mechanical parts, comprising: a multi-source data acquisition and time-series matrix construction module for real-time acquisition of process data from each channel and construction of a time-series matrix; a causal mapping network construction module for learning the causal mapping relationship between process parameters and quality characteristics based on historical data; a real-time quality prediction and risk assessment module for continuously outputting quality prediction values and calculating the probability of exceeding tolerances during machining; an adaptive compensation and closed-loop control module for calculating the compensation amount of process parameters and adjusting cutting parameters in real-time through the CNC system interface; and a quality traceability and anomaly backtracking module for recording data throughout the entire process and supporting backtracking analysis of anomaly causes.
[0013] The beneficial effects of this invention are as follows: By establishing a causal mapping network between process parameters and quality characteristics, real-time online prediction of quality characteristics during processing is achieved, shifting quality control from post-processing inspection to the processing stage, fundamentally changing the passive mode of traditional processing quality control; through out-of-tolerance risk probability assessment and adaptive parameter compensation closed-loop control, proactive correction is achieved before quality deviations are formed, significantly reducing processing quality fluctuations and scrap rates; by replacing traditional statistical correlation analysis with a causal attention mechanism, the nonlinear transmission law between process parameter fluctuations and quality responses can be more accurately characterized, providing a physically interpretable control path for parameter compensation; through a quality traceability database and anomaly attribution scoring mechanism, full-link traceability from the processing process to the quality result is achieved, providing quantitative data support for anomaly cause analysis and significantly improving the efficiency and accuracy of anomaly handling. Attached Figure Description
[0014] Figure 1 This is a flowchart illustrating the online prediction and control method for machining quality of mechanical parts provided in an embodiment of the present invention.
[0015] Figure 2 This is a schematic diagram of the architecture of the online predictive control system for machining quality of mechanical parts provided in an embodiment of the present invention. Detailed Implementation
[0016] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.
[0017] Reference Figure 1 As shown in the embodiments of the present invention, the core idea of the online predictive control method for machining quality of mechanical parts is to transform the traditional post-machining detection mode into a real-time prediction and active control mode during machining. This method uses multi-source heterogeneous sensors to collect machining process parameters in real time, continuously predicts the quality characteristics of the parts using a causal mapping network model, and automatically calculates and executes process parameter compensation when a quality deviation risk is detected, thereby achieving closed-loop adaptive control of machining quality. The following provides a detailed description of each step.
[0018] Step S1: Real-time acquisition of multi-source process data and construction of time-series matrix. During the machining of mechanical parts, the final quality of the parts is influenced by multiple process factors. In this embodiment of the invention, the data acquisition system includes three types of data sources, covering internal parameters of the CNC system, external physical sensor signals, and environmental status information.
[0019] Regarding the internal parameters of the CNC system, the actual spindle speed can be read in real time through the OPC UA communication interface or MTConnect protocol interface provided by the CNC system. (Unit: r / min) Feed rate of each axis (Unit: mm / min) Cutting depth setting value (Unit: mm) and tool position coordinate information. Preferably, the spindle speed acquisition frequency is set to 1000Hz and the feed rate acquisition frequency is set to 500Hz to ensure that high-frequency disturbance characteristics during machining can be captured. In one embodiment of the present invention, the CNC system is a FANUC 0i-MF Plus controller, which reads real-time parameters through its FOCAS2 library function interface.
[0020] Regarding external sensing signals, a triaxial accelerometer is installed near the tool spindle to collect vibration acceleration signals in the X, Y, and Z directions. , , (Unit: m / s²), the sampling frequency was set to 5000 Hz to cover the typical frequency range of machining chatter. A piezoelectric cutting force sensor was installed at the tool holder location to collect the main cutting force. Feeding force and back force (Unit: N), the sampling frequency is set to 2000Hz. A Pt100 resistance temperature sensor is installed in the coolant circulation pipeline to collect the coolant inlet temperature. (Unit: °C), the sampling frequency is set to 10 Hz. Preferably, the vibration sensor is an IEPE type accelerometer with a frequency response range of 0.5 Hz to 10 kHz and a sensitivity of 100 mV / g.
[0021] Regarding environmental status information, a temperature and humidity sensor is installed above the processing area to collect ambient temperature data. (Unit: °C) and relative humidity (Unit: %RH), the sampling frequency is set to 1Hz. In one embodiment of the present invention, the ambient temperature range is 18°C to 28°C, and the relative humidity range is 30%RH to 70%RH, which covers the environmental fluctuation range of a typical machining workshop.
[0022] Since the sampling frequencies of each sensor channel are different, timestamp alignment is required to construct a unified multidimensional timing matrix. This embodiment of the invention employs the following alignment strategy: the sampling time of the lowest sampling frequency channel (i.e., 1Hz of ambient temperature and humidity) is used as the reference time grid. For high-frequency channel signals, within each reference time window... Statistical feature extraction is performed internally. Specifically, the root mean square value within the vibration acceleration signal extraction window is extracted. Peak and kurtosis value As a feature quantity; the mean value within the window of the cutting force signal is extracted. and standard deviation The mean values of spindle speed and feed rate within a window are extracted. After this processing, the mean values are obtained at each time step of the reference time grid. You can get one 3D feature vector ,in This represents the total number of all feature channels. In one embodiment of the present invention, the features include: 1-dimensional average spindle speed, 3-dimensional average feed rate of each axis, 1-dimensional depth of cut, 9-dimensional features of 3 features each of the three axes vibration, 3-dimensional average cutting force, 1-dimensional coolant temperature, 1-dimensional ambient temperature, and 1-dimensional ambient humidity (some channels have expanded dimensions after feature extraction, and the final configuration shall prevail).
[0023] Continuous The feature vectors at each time point are arranged in chronological order to form the time series matrix of the process data. The time series matrix is continuously updated using a sliding window method: data is collected at each new time point. Remove the oldest row from the matrix and append a new row to the end, so that the time series matrix always reflects the most recent data. The processing status at each moment. In one embodiment of the present invention, the timing window length... The value is set to 100, corresponding to a 100-second machining time window. The selection of this window length is based on the following: In precision turning, typical tool feed rates are 0.05 mm / r to 0.2 mm / r, spindle speeds are 1000 r / min to 3000 r / min, and a complete cutting stroke (e.g., turning a 50 mm external diameter) takes approximately 10 to 60 seconds. Therefore, a 100-second window length can cover data from at least 1.5 complete cutting strokes, ensuring that the timing matrix contains sufficient process dynamics information. Preferably, the window length... Adjustments can be made according to the characteristics of the specific processing steps, for steps with shorter processing times (such as drilling). It can be shortened to 50; for processes with long processing times (such as large curved surface milling). It can be extended to 200.
[0024] It is worth noting that the construction of the time series matrix also includes an outlier filtering mechanism. For each newly arrived feature vector... The system calculates its comparison with the previous one. The Mahalanobis distance between the mean feature vectors at each time step is used to determine an outlier when the Mahalanobis distance exceeds a preset threshold (3.5 in one embodiment of the invention). The feature vector from the previous time step is then used to fill the outlier, and the outlier event is recorded in the log. This mechanism effectively suppresses the interference of data spikes caused by sensor malfunctions or communication interruptions on subsequent quality prediction models.
[0025] Step S2: Constructing a Causal Mapping Network Between Process Parameters and Quality Characteristics. The core objective of this step is to learn the causal mapping relationship between each process parameter channel and part quality characteristic indicators from historical processing data, rather than simply learning statistical correlations. This distinction is crucial; correlation describes the trend of two variables changing together, while causality reveals how a change in one variable causes a response in the other. In the scenario of processing quality prediction, establishing causal mapping relationships can provide a physically interpretable control path for parameter compensation in the subsequent step S4.
[0026] The training data for the causal mapping network model comes from a historical processing dataset. In one embodiment of the present invention, the historical dataset contains at least 500 samples of parts that have been processed and undergone quality inspection. Each sample includes time-series matrix data of the entire processing of that part (i.e., the data described in step S1). The quality characteristics include dimensional accuracy deviations and the measured quality characteristic values after processing. (unit: m is the absolute value of the difference between the measured size and the target size, and the surface roughness value. (unit: m) and geometric tolerances and deviations (unit: m, including indicators such as roundness, cylindricity, and coaxiality.
[0027] Before model training, the raw data needs to be preprocessed. Zero-mean, unit-variance standardization is performed on each channel of the process parameters:
[0028] ,
[0029] in, For the first The original values of each process parameter channel. This is the mean of the channel in the historical dataset. Standard deviation These are the standardized values. This standardization operation eliminates the influence of different units and numerical ranges, making each channel comparable during model training. Preferably, the standardized parameters... and The model is kept fixed after deployment and is not updated with new data to ensure consistency during the model inference phase.
[0030] Tolerance ratio normalization is applied to the quality characteristic indicators:
[0031] ,
[0032] in, For the first Measured values of each quality characteristic Its target value (usually the center of the tolerance zone). This is the tolerance band width for this quality characteristic. This is the normalized deviation value. When... When the part has fully reached the target value, When indicates that the part is exactly at the tolerance boundary, This indicates that the part is out of tolerance. This normalization method makes the degree of deviation of different quality characteristic indicators have a uniform and comparable scale.
[0033] The core structure of the causal mapping network consists of two parts: a causal weight learning layer and a nonlinear mapping layer. The role of the causal weight learning layer is to identify the causal influence strength of each process parameter channel on each quality characteristic index. In this embodiment of the invention, a hybrid method integrating Granger causality testing and self-attention mechanism is used to learn the causal weights.
[0034] First, for each pair of process parameter channels in the historical dataset With quality characteristic indicators A Granger causality test is performed between time series data. The core idea of the Granger causality test is: if the prediction quality characteristics... When adding process parameters If historical values can significantly reduce prediction error, then the parameter is considered to be... Quality Granger causality exists. Test statistic. The result was obtained through an F-test, with the statistical significance level set to [value missing]. Normalize all Granger causality statistics that passed the significance test to The interval is used as the initial causal weight matrix. ,in For the number of process parameter channels, This represents the number of quality characteristic indicators. For parameter-quality pairs that fail the significance test, the initial weight is set to 0.
[0035] Next, a nonlinear enhancement mapping is applied to the initial causal weights using a self-attention encoder. The input to the self-attention encoder is a time series matrix. Feature vector after time-dimensional pooling The encoder employs a multi-head attention structure, with a large number of heads. Set to 4. For each attention head Calculate the query vector Key vector Sum value vector :
[0036] ,
[0037] in, The dimension of each attention head (equal to the total embedding dimension divided by the number of heads). ), This represents element-wise multiplication. This is the initial causal weight matrix mentioned above. The key innovation of this design lies in: using the Granger causal weights... The introduction of a masking factor as a part of the attention score into self-attention computation allows parameter-quality pairs with insignificant causal relationships to be naturally attenuated in the attention weights, while parameter-quality pairs with strong causal relationships receive higher attention scores. This masking operation implements the guiding constraint of causal prior knowledge on data-driven attention weights.
[0038] The outputs of each attention head are concatenated and then fed into a feedforward neural network (containing two fully connected layers, with a hidden layer dimension of 128 and an activation function of GELU) to obtain the final causal attention weight matrix. The first [item] in this matrix Line 1 Column elements Indicates process parameter channel Quality characteristic indicators The strength of the causal influence.
[0039] The nonlinear mapping layer receives the process parameter features weighted by causal weights and outputs predicted values for each quality characteristic index. In this embodiment of the invention, a two-layer gated recurrent unit (GRU) network is used as the nonlinear mapper. The hidden dimension of the first GRU layer is set to 64, the hidden dimension of the second GRU layer is set to 32, and finally, a fully connected layer maps the hidden state to... The quality prediction output is then calculated. Preferably, the input to the GRU network is a causal weighted feature sequence. Instead of the original feature vectors, the model's input space incorporates prior causal relationships.
[0040] The model training uses the mean squared error loss function, the Adam optimizer, a learning rate of 0.001, a batch size of 32, and 200 training epochs. Training and validation data are divided in an 8:2 ratio, and an early stopping strategy (patience set to 20 epochs) is employed to prevent overfitting. Preferably, a sparsity regularization term for causal weights is also added to the loss function. ,in Set to 0.001. This sparse regularization term encourages most elements in the causal weight matrix to tend towards zero, retaining only the weights of truly causal parameter-quality pairs as non-zero values. This sparsity constraint not only improves the model's interpretability (non-zero elements in the final causal weight matrix directly indicate key causal paths) but also enhances the model's generalization ability, avoiding overfitting to spurious correlations in the training data.
[0041] Regarding model deployment, after training, the model weights are exported in ONNX format and inference is performed on the edge computing terminal using the ONNX Runtime. The use of the ONNX format decouples the hardware platforms for model training and inference; training is performed on a GPU server, while inference is executed on a lightweight edge device. In one embodiment of this invention, the exported ONNX model file is approximately 1.2MB in size, occupies approximately 8MB after being loaded into memory, and the peak memory usage for model inference is approximately 32MB, which is well within the hardware resource limits of the edge computing terminal.
[0042] In one embodiment of the present invention, after training on a dataset containing 500 part samples, the root mean square error (RMSE) of quality prediction on the validation set is the dimensional accuracy deviation. The RMSE is 2.3. m, surface roughness The RMSE is 0.08. m, geometric tolerance deviation The RMSE is 1.5. Compared to the baseline model that does not use causal weight constraints (i.e., directly uses the standard self-attention mechanism), the causal attention mechanism of this invention reduces the average RMSE by 18%, indicating that the introduction of causal prior knowledge effectively improves prediction accuracy.
[0043] Step S3: Real-time quality prediction and out-of-tolerance risk assessment. During the processing, the time-series matrix continuously output in step S1... The data is fed in real-time into the causal mapping network model trained in step S2. The model performs inference using a sliding window approach: each time the time-series matrix is updated (i.e., a new sampling time arrives), the model performs a forward inference and outputs the predicted values of each quality characteristic corresponding to the current time. Inference latency must be controlled within the sampling interval. In one embodiment of the present invention, the baseline sampling interval is 1 second, and the time for a single model inference is approximately 15 ms (measured on the NVIDIA Jetson AGX Xavier edge computing platform), which fully meets the real-time requirements.
[0044] While the quality prediction itself provides a point estimate of the current quality state, relying solely on this point estimate is insufficient for decision-making during actual processing; it is also necessary to assess the risk of quality deviation. In this embodiment of the invention, the calculation of the deviation risk probability employs a Monte Carlo Dropout method based on model uncertainty. Specifically, during the inference phase, some Dropout layers in the network are kept active, and the same input is processed... Sub-forward reasoning ( (Set to 500 times), get A set of slightly different predicted values This set reflects the distribution of uncertainty in the model's predictions. (Excess risk probability) The calculation method is as follows:
[0045] ,
[0046] in, For the first The first reasoning yielded the... The normalized prediction deviation of each quality characteristic (calculated according to the tolerance ratio normalization method in step S2). This is an indicator function; it takes the value 1 when the condition within the parentheses is true, and 0 otherwise. Therefore, The physical meaning is: under model uncertainty, the first Probability estimate of a quality characteristic exceeding the tolerance boundary. The closer to 1, the higher the risk of deviation; when A value close to 0 indicates that the quality is within a safe range.
[0047] A comprehensive deviation risk index is defined by considering the deviation risk of various quality characteristic indicators:
[0048] ,
[0049] in, This represents the total number of quality characteristic indicators. The reason for adopting the maximum value strategy is that as long as any quality characteristic faces the risk of exceeding tolerance, an early warning and control intervention should be triggered. This reflects the "weakest link" effect in quality control, where the overall quality of a part is determined by its weakest quality indicator.
[0050] The trigger mechanism for the early warning signal is designed as follows: when the comprehensive deviation risk index... In continuous The risk threshold was exceeded in each sampling period. At that time, an early warning signal is generated. In one embodiment of the present invention, Set to 0.7, Set to 3. The purpose of setting continuous multi-cycle judgment conditions is to filter out false warnings caused by sensor noise or transient disturbances. Preferably, It can be adjusted according to the quality grade requirements of different parts, for high-precision parts (such as IT6 grade). It can be reduced to 0.5 to improve early warning sensitivity; for parts with general precision levels (such as IT8 and above). It can be increased to 0.8 to reduce unnecessary intervention.
[0051] Furthermore, this embodiment of the invention also introduces a trend early warning mechanism as a supplement to the point early warning mechanism. Even if the probability of exceeding the tolerance threshold has not yet been reached at the current moment... However, if the system detects a continuous upward trend in the probability of exceeding tolerances, a trend warning should also be issued. The specific implementation method is: for the most recent... Perform linear regression fitting on the out-of-range risk probability sequence for each sampling period and calculate the regression slope. .when Exceeding the preset trend slope threshold (In one embodiment of the present invention) Set to 20, When set to 0.02 / s, a trend warning signal is generated. The trend warning signal has a lower priority than the point warning signal. The system displays the trend warning signal in yellow and the point warning signal in red.
[0052] Regarding inference performance optimization, to reduce the computational load caused by Monte Carlo Dropout sampling, this embodiment of the invention employs an asynchronous inference strategy: within each baseline sampling period, deterministic forward inference is first performed once (with the Dropout layer disabled) to obtain the point estimate of the quality prediction. Simultaneously, Monte Carlo Dropout sampling is performed in a background asynchronous thread to update the out-of-tolerance risk probability estimate. Since the execution frequency of Monte Carlo sampling can be lower than that of deterministic inference, in one embodiment of the invention, the execution frequency of Monte Carlo sampling is set to once every 5 baseline sampling periods (i.e., the out-of-tolerance risk probability is updated every 5 seconds), and the most recent estimate is used as an approximation of the current risk probability between two samplings. This asynchronous strategy reduces the computational load by approximately 80% while ensuring the real-time performance of quality prediction.
[0053] Step S4: Adaptive Process Parameter Compensation and Closed-Loop Control. After the warning signal is output in Step S3, the closed-loop control module immediately starts the parameter compensation calculation process. The compensation amount is calculated based on the gradient backpropagation principle of the causal mapping network model. The sensitivity of the quality prediction deviation to each adjustable process parameter is calculated along the backpropagation path of the model, thereby determining the optimal parameter adjustment direction and magnitude.
[0054] Define the compensation objective function. Let the current time be... The normalized prediction bias for each quality characteristic is The compensation objective is to find a set of process parameter adjustment amounts. (These correspond to the compensation increments for spindle speed, feed rate, and depth of cut, respectively), minimizing the quality prediction deviation after compensation. The compensation objective function is defined as:
[0055] ,
[0056] in, For the first The weighting coefficient of each quality characteristic reflects the importance of that quality characteristic and satisfies... ; In order to adjust process parameters Normalized quality bias in post-model predictions; This is the regularization coefficient, set to 0.01, used to constrain the magnitude of the compensation amount and prevent over-adjustment; It is an L2 norm.
[0057] In practical engineering implementation, directly solving the above optimization problem can be computationally expensive. In this embodiment of the invention, a first-order Taylor expansion is used to approximate and simplify the calculation. The quality prediction deviation is then approximated within the current process parameters. Perform a first-order expansion at this point:
[0058] ,
[0059] in, For quality characteristics The Jacobian vector of the process parameter vector is calculated using the automatic differentiation mechanism of the causal mapping network model. Substituting the above linear approximation into the objective function and... Differentiating and setting it to zero yields a closed-form solution:
[0060] ,
[0061] in, Let be a 3x3 identity matrix. The calculation of this closed-form solution involves only the inversion of a 3x3 matrix, which requires very little computation and can be completed in milliseconds.
[0062] Preferably, the compensation amount also needs to be modulated with an adaptive step size. Define the adaptive step size factor. :
[0063] ,
[0064] in, Set the base step size factor to 0.5; The risk sensitivity coefficient is set to 1.0. This represents the overall deviation risk index at the current moment. When the deviation risk is high, the step size factor increases, and the compensation is stronger; when the deviation risk is low, the step size factor decreases, and the compensation tends to be more conservative. The final compensation amount is... .
[0065] Before writing the compensation values into the CNC system, a safety constraint check is required. Each adjustable process parameter has an allowable adjustment range: the spindle speed adjustment range is the currently set value. The feed rate can be adjusted within the range of the current set value. The depth of cut can be adjusted within the range of the current set value. When the calculated compensation amount exceeds the above range, it is truncated to the boundary value, and a parameter out-of-bounds alarm signal is generated. In one embodiment of the present invention, the compensation amount is written in real time through the external machine coordinate offset interface of the CNC system. This interface supports dynamic modification of parameters during machining without pausing program execution.
[0066] The closed-loop feedback mechanism is manifested in the following ways: the compensated process parameters are immediately reflected in the actual execution state of the CNC system. The data acquisition system in step S1 will collect the new compensated parameter values (e.g., adjusted spindle speed and feed rate) at the next sampling moment. This new data, after entering the timing matrix, is used by the quality prediction model in step S3 to update the quality prediction value and the probability of out-of-tolerance risk, thus forming a complete closed-loop feedback control path. If the probability of out-of-tolerance risk after compensation has dropped below the threshold, the closed-loop control module switches to monitoring mode and stops compensation. If the probability of out-of-tolerance risk still has not dropped below the threshold after five consecutive compensations, a machining pause command is triggered, and an abnormal intervention request is pushed to the operator.
[0067] It is worth further explaining that the closed-loop control in this embodiment of the invention also considers the coupling effect between parameter compensations. In scenarios where multiple parameters are adjusted simultaneously, the compensation amounts of each parameter are not completely independent. For example, an increase in spindle speed will simultaneously affect cutting force and vibration amplitude, which may offset the quality improvement effect brought about by feed rate compensation. To solve this problem, the Jacobian matrix in the compensation objective function... The natural form contains information about the cross-influence between parameters; closed-form solution In the process of solving the matrix The off-diagonal elements precisely reflect the cross-partial derivatives of the parameter coupling effect. Therefore, the compensation strategy of this invention can automatically consider the coupling relationship between multiple parameters and provide the globally optimal compensation direction, rather than the local oscillations that may be caused by independent adjustment of each parameter.
[0068] Preferably, the execution of the compensation amount also incorporates a smooth transition mechanism. To avoid transient impacts on the surface quality caused by abrupt parameter changes (e.g., a sudden change in feed rate may leave tool marks on the part surface), the compensation amount is written in a linear gradient mode in this embodiment of the invention: Within each sampling period (in one embodiment of the present invention) (Set to 5), the compensation amount is increased linearly from zero to the target value. This gradual writing method makes the parameter change curve smoother and effectively suppresses the adverse effects of compensation transients on the surface quality of the machined surface.
[0069] Step S5: Quality Traceability Database Construction and Anomaly Backtracking Analysis
[0070] During the execution of steps S1 to S4 above, step S5 runs synchronously, continuously recording the data generated at each stage into the quality traceability database. This database creates a complete quality traceability record for each processed part, and the record structure includes the following fields:
[0071] A unique part number (generated from a combination of machining date, machine tool number, operation number, and part number), with an example format of 20260402-CNC03-OP20-0156. The machining start and end time fields are accurate to milliseconds for subsequent time-range queries. The process parameter timing data fields store the complete timing matrix indexed by timestamps. In one embodiment of this invention, the Apache Parquet columnar storage format is employed to improve compression ratio and query efficiency. The time-series data storage size for a single part is approximately 2MB to 10MB (depending on processing time and number of channels). The quality prediction value sequence field records the real-time prediction value trajectory of each quality characteristic throughout the entire processing process. The deviation risk probability sequence field records the trajectory of the comprehensive deviation risk index throughout the entire processing process. The parameter compensation event list field records detailed information for each compensation operation, including the trigger time, the probability value of the out-of-tolerance risk at the time of triggering, the process parameter value before compensation, the calculated compensation amount, and the process parameter value after compensation.
[0072] Preferably, the quality traceability database also incorporates a data lifecycle management strategy to balance storage space usage with the need to retain historical data. In one embodiment of the invention, data from the most recent 30 days retains its full original precision; data from 30 to 180 days undergoes downsampling compression (downsampling the original 1Hz time-series data to 0.1Hz); and data older than 180 days retains only statistical summary information (mean, standard deviation, maximum, and minimum values for each channel) and key event records (compensation events and abnormal events). This hierarchical storage strategy allows the system to maintain long-term traceability capabilities while keeping the storage space growth rate within an acceptable range. In one embodiment of the invention, a single CNC machine tool generates approximately 50GB of traceability data per month (full precision stage), and after lifecycle management, the long-term average storage growth rate is approximately 5GB per month.
[0073] The anomaly backtracking analysis function is invoked when a part fails subsequent quality inspection. The operator enters the part number, and the system retrieves the complete record of that part from the quality traceability database and executes the following analysis process.
[0074] First, plot the quality prediction curve and the out-of-tolerance risk probability curve for the entire machining process of this part, and pinpoint the time point at which the quality prediction value begins to deteriorate. Secondly, extract One time window before and after (e.g.) The process parameter time-series data within the specified range is used to perform abrupt change detection on each channel. The CUSUM (Cumulative Sum Control Chart) algorithm is employed to identify channels and times where significant shifts in process parameters occur. In this embodiment of the invention, the sensitivity parameter of the CUSUM algorithm is... Set to 0.5 times the standard deviation, decision threshold Set to 5 times the standard deviation.
[0075] Furthermore, define the attribution relevance scoring function for anomalies:
[0076] ,
[0077] in, This is the number for the abnormal quality characteristic index. For process parameter channels in causal mapping networks Quality characteristics Causal weights For channel Offset at abnormal moments This represents the historical standard deviation of the channel. The physical meaning is: process parameter channel The overall contribution of this quality anomaly event takes into account both the causal influence of this parameter on the quality characteristics. Furthermore, the actual degree of deviation of this parameter at abnormal times was also considered. All process parameter channels are set to... Arranged in descending order, the top 3 channels are the most likely root causes of the anomalies.
[0078] This invention further provides an anomaly pattern matching function. The system stores the feature vector of each anomaly event (including anomaly quality characteristic type, attribution channel ranking, offset magnitude, and duration) in an anomaly pattern library. When a new anomaly event occurs, the system automatically retrieves the historical case with the highest similarity from the historical anomaly pattern library and recommends the root cause analysis conclusions and handling measures of the historical case to the operators, thereby realizing the accumulation and reuse of anomaly handling experience. The similarity calculation uses weighted Euclidean distance, and the weight of each feature dimension is dynamically adjusted according to the success rate of handling historical cases.
[0079] In one embodiment of the present invention, regarding surface roughness... A backtracking analysis was performed on the out-of-tolerance anomaly, and the results showed that the vibration acceleration in the Y direction... The highest value (4.2) corresponds to a sudden increase in the spindle vibration acceleration RMS value from a steady-state 2.1 m / s² to 5.8 m / s². Further analysis of tool usage records confirmed that this anomaly was caused by tool wear reaching a critical state. The system also matched three similar historical cases in the anomaly pattern library, all of which involved surface roughness deterioration due to tool wear. The recommended action was to replace the tool and adjust the tool life warning threshold from the current 180 pieces / tool to 160 pieces / tool. This anomaly backtracking capability, combining quantitative attribution based on causal weights with historical pattern matching, is difficult to achieve with traditional qualitative analysis methods.
[0080] Reference Figure 2 As shown, this embodiment of the invention also provides an online predictive control system for the machining quality of mechanical parts. This system is deployed at the machining site at the hardware level and runs all the processes described in the above-described method embodiments at the software level. The system includes the following five functional modules:
[0081] The multi-source data acquisition and time-series matrix construction module corresponds to step S1 in the method embodiment. The hardware of this module includes: a data acquisition gateway connected to the CNC system via an OPC UA communication interface; a three-axis accelerometer and cutting force sensor installed near the spindle and tool; a temperature sensor installed in the coolant lines; and an ambient temperature and humidity sensor installed above the machining area. Sensor signals are collected to the edge computing terminal via an industrial-grade data acquisition card (16-bit sampling accuracy). The software runs data alignment and feature extraction algorithms to construct a multi-dimensional process data time-series matrix in real time and continuously update it using a sliding window method. Preferably, the data acquisition gateway supports multi-protocol adaptation, being compatible with FANUC FOCAS, Siemens PROFINET, and Mitsubishi MC Protocol in addition to OPC UA, to meet the access requirements of different CNC systems.
[0082] The causal mapping network construction module corresponds to step S2 in the method embodiment. This module includes a model training submodule and a model inference submodule. The model training submodule runs on a server with GPU acceleration capabilities (an NVIDIA RTX 4090 graphics card is used in one embodiment of the present invention), and is responsible for training the causal mapping network model based on historical processing datasets. The training process includes the complete process described in the method embodiment, including data preprocessing, Granger causality testing, causal attention weight learning, and GRU network training. The model training submodule also supports online incremental learning. When new part quality inspection data accumulates in the quality traceability database, the new data is automatically added to the training set and the model parameters are updated, so that the model can adaptively adjust as processing conditions slowly drift. The model inference submodule runs on an edge computing terminal (an NVIDIA Jetson AGX Xavier is used in one embodiment of the present invention), and is responsible for loading the trained model weights and performing real-time inference.
[0083] The real-time quality prediction and risk assessment module corresponds to step S3 in the method embodiment. This module receives the real-time time series matrix output by the time series matrix construction module and calls the inference submodule of the causal mapping network model to perform quality prediction and Monte Carlo Dropout out-of-tolerance risk probability calculation. This module is also responsible for the logic of generating early warning signals, including risk threshold comparison and continuous multi-cycle judgment. The prediction results are displayed in real-time on the operation panel in the form of a quality trend graph, allowing operators to intuitively observe the changing trends of the predicted values of each quality characteristic and the fluctuations in the out-of-tolerance risk probability. Preferably, the trend graph uses green to represent the safe area (…). Yellow indicates the area to pay attention to ( Red indicates the warning area ( It also uses audible and visual alarms to assist operators in reminding them.
[0084] The adaptive compensation and closed-loop control module corresponds to step S4 in the method embodiment. Upon receiving a warning signal, this module automatically initiates the compensation calculation process, obtaining the process parameter compensation amount through Jacobian matrix calculation and closed-loop solution. After safety constraint checks, the compensation amount is written in real-time through the external offset interface of the CNC system. The communication delay between this module and the CNC system is controlled within 10ms to ensure that the compensation amount takes effect within the current cutting segment. In one embodiment of the invention, this module also integrates a manual / automatic switching function: in automatic mode, the compensation amount is automatically calculated and written by the system; in manual mode, the system only outputs a compensation suggestion value, which is then executed after confirmation by the operator. Preferably, in automatic mode, the system also maintains a compensation history buffer, recording the parameter values and effect evaluation results of the most recent 20 compensation operations. When a decaying trend in the compensation effect is detected (e.g., the quality improvement decreases successively after three consecutive compensations), an online incremental update request for the causal mapping network model is automatically triggered to adapt to the drift changes in processing conditions.
[0085] The quality traceability and anomaly backtracking module corresponds to step S5 in the method embodiment. This module continuously runs a data recording service in the background, writing the data generated by each module into the quality traceability database. The database uses a time-series database (such as InfluxDB or TimescaleDB) to store time-series data of process parameters and quality predictions, and a relational database (such as PostgreSQL) to store part metadata and a list of compensation events. This module provides a web-based anomaly backtracking analysis tool, which allows operators to input the abnormal part number and automatically generate anomaly analysis reports. The report content includes quality prediction curves, process parameter fluctuation graphs, CUSUM mutation detection results, and anomaly attribution correlation rankings. Preferably, this module also supports batch anomaly analysis. When multiple parts in the same batch exhibit similar quality anomalies, the system automatically cross-compares the traceability records of these parts, extracts common abnormal process parameter channels and time windows, and assists technicians in quickly identifying the difference between systemic anomalies (such as overall tool wear, coolant concentration decrease, etc.) and sporadic anomalies (such as single chip entanglement, workpiece clamping offset, etc.).
[0086] The data flow and control flow among the five modules form a deeply coupled closed-loop collaborative architecture: the output of the multi-source data acquisition module serves as the input for the causal mapping network inference; the early warning signal from the quality prediction module triggers the execution of the compensation control module; and the adjusted parameters from the compensation control module are reflected back to the input of the data acquisition module via the CNC system, forming a positive closed loop of S1→S2→S3→S4→S1. Simultaneously, the quality traceability module provides new sample data for the online incremental learning of the causal mapping network, forming a feedback path of S5→S2. This multi-loop nested closed-loop collaborative architecture enables the system to possess continuous self-optimization capabilities. In one embodiment of this invention, during the six months of system deployment, the causal mapping network model performed 12 parameter updates through online incremental learning, and the model's prediction accuracy on the validation set increased from the initial RMSE of 2.3. m gradually increased to 1.8 m represents the system's ability to continuously self-optimize as its runtime increases.
[0087] To verify the effectiveness of the method of this invention, a comparative experiment was conducted in a precision machining workshop. The experimental object was a cylindrical part made of aluminum alloy 6061-T6, and the machining process was precision external turning. The CNC machine tool was a MAZAK QuickTurn 250 turning center, equipped with a FANUC series controller. The machining requirements were: outer diameter tolerance ±0.015mm (IT7 grade), surface roughness... m, cylindricity ≤ 0.01mm.
[0088] The experiment was divided into a control group and an experimental group, with 200 parts processed in each group. The control group used a traditional fixed-parameter machining + post-processing inspection mode, with cutting parameters of: spindle speed 2000 r / min, feed rate 0.1 mm / r, and depth of cut 0.3 mm. The experimental group used the method of this invention, with the same initial cutting parameters as the control group. During machining, the system automatically performed quality prediction and parameter compensation. The causal mapping network model was trained based on 500 previously accumulated part samples, with Monte Carlo Dropout sampling set to 500 times and a risk threshold. Set to 0.7, continuous judgment period Set to 3. Both sets of experiments were conducted sequentially on the same machine tool using the same batch of cutting tools and blanks to minimize the impact of equipment and material differences on the experimental results.
[0089] Experimental results show that in the control group of 200 parts, 12 parts had dimensional defects (6.0% scrap rate), 8 parts had surface roughness defects (4.0% scrap rate), and 5 parts had cylindricity defects (2.5% scrap rate), resulting in an overall scrap rate of 11.5% (some parts had multiple defects simultaneously). In the experimental group of 200 parts, 2 parts had dimensional defects (1.0% scrap rate), 1 part had surface roughness defects (0.5% scrap rate), and 1 part had cylindricity defects (0.5% scrap rate), resulting in an overall scrap rate of 1.5%. The method of this invention reduces the overall scrap rate from 11.5% to 1.5%, a reduction of 87%.
[0090] Regarding quality fluctuations, the standard deviation of the outer diameter of the control group was 0.0082 mm, while that of the experimental group was 0.0031 mm, a reduction of 62%. The surface roughness of the control group... The standard deviation is 0.12. m, the experimental group was 0.05 The cylindricity of the control group was 0.0043 mm, while that of the experimental group was 0.0018 mm, a reduction of 58%. This indicates that the method of the present invention not only reduces the scrap rate but also significantly improves the consistency and stability of processing quality.
[0091] In terms of response speed, the system's average response time from detecting out-of-tolerance risk to completing parameter compensation writing is 85ms, of which quality prediction inference takes about 15ms, compensation calculation takes about 5ms, and CNC system communication and writing takes about 65ms. This response speed allows parameter adjustment to be completed within the current tool cutting stroke under most cutting conditions. During the machining of 200 parts, the experimental group triggered parameter compensation operations 47 times. After 42 compensations, the probability of out-of-tolerance risk decreased to below the threshold within 1 to 2 sampling periods, with a first-time compensation success rate of 89.4%. The remaining 5 compensations successfully reduced the risk probability after secondary compensation, without requiring manual intervention.
[0092] Regarding anomaly backtracking, anomaly backtracking analysis was performed on the four out-of-tolerance parts found in the experimental group using a quality traceability database. The analysis results showed that the anomalies of two out-of-tolerance parts were attributed to the cumulative effect of tool wear. After machining the 180th part, the tool flank wear (VB value) exceeded 0.15mm, resulting in a smaller actual depth of cut. The anomaly attribution correlation scoring function was used to analyze the cutting force path... The value ranked first (5.1), providing operators with clear suggestions on when to change tools. The anomaly attribution for one part with out-of-tolerance surface roughness was an abnormal rise in coolant temperature. During the machining period, the coolant temperature increased from the normal 22°C to 28°C, causing thermal expansion of the workpiece and affecting surface finish. These retrospective analysis results validate the effectiveness and practical value of the quality traceability and anomaly attribution mechanism of this invention.
[0093] Based on the above experimental results, the online predictive control method and system for machining quality of mechanical parts provided by this invention, through modeling the causal mapping relationship between process parameters and quality characteristics, assessing the probability of out-of-tolerance risks, and adaptive parameter compensation closed-loop control, can transform the traditional post-processing detection mode into a real-time active control mode during the machining process, achieving significant technical improvements in scrap rate, quality consistency, and anomaly attribution ability.
[0094] It should be noted that the specific parameter values listed in the above embodiments (such as acquisition frequency, window length, network structure parameters, risk threshold, etc.) are preferred embodiments of the present invention and do not constitute a limitation on the scope of protection of the present invention. Those skilled in the art can adaptively adjust the above parameters according to specific processing steps, part accuracy requirements, machine tool models, and sensor configurations, without departing from the core technical concept of the present invention. For example, for milling processes, the number of channels of the cutting force sensor can be increased to adapt to the mechanical characteristics of multi-tooth cutting; for grinding processes, the upper limit of the frequency response of the vibration sensor can be increased to 20kHz to cover the high-frequency vibration characteristics of grinding; for the processing of large workpieces, the time window length can be appropriately extended to cover a longer processing time range. Furthermore, the specific structure of the causal mapping network model can also be replaced as needed with other neural network architectures with temporal modeling capabilities, such as long short-term memory networks or temporal convolutional networks, as long as the causal attention weight mechanism is retained as the core innovative feature. The method and system of this invention are not limited to turning machining scenarios, but are also applicable to various cutting machining processes such as milling, drilling, boring, and grinding, as well as non-traditional machining methods such as electrical discharge machining and laser machining. They have good applicability to various precision machining scenarios that require real-time quality monitoring and adaptive parameter adjustment.
[0095] The embodiments of the present invention are not limited to the specific embodiments described above. Those skilled in the art can make various equivalent changes or substitutions based on the technical solutions of the present invention, and all such changes or substitutions should be included within the protection scope of the present invention.
Claims
1. A method for online predictive control of machining quality of mechanical parts, characterized in that, Includes the following steps: Step S1, Real-time Acquisition of Multi-Source Process Data and Construction of Time Series Matrix: During the machining process, the spindle speed and feed rate are acquired through the internal interface of the CNC system, the cutting force signal and vibration acceleration signal are acquired through the external sensor, and the ambient temperature and humidity are acquired through the environmental monitoring device. The data from each channel are aligned according to a unified sampling timestamp to construct a multi-dimensional process data time series matrix. Step S2, Construction of the causal mapping network between process parameters and quality characteristics: Based on the historical processing dataset, a causal attention mechanism is used to learn the influence weights of fluctuations in each process parameter on each quality characteristic and the nonlinear propagation path, thus obtaining the causal mapping network model; Step S3, Real-time quality prediction and out-of-tolerance risk assessment: During the processing, the time series matrix constructed in real time in step S1 is input into the causal mapping network model, and the predicted values of each quality characteristic are continuously output. The out-of-tolerance risk probability is calculated based on the distance between the predicted value and the tolerance boundary. When the out-of-tolerance risk probability exceeds the preset risk threshold, an early warning signal is generated. Step S4, Adaptive process parameter compensation and closed-loop control: In response to the warning signal, the compensation amount of each adjustable process parameter is calculated based on the causal weight matrix in the causal mapping network model to realize adaptive closed-loop control of the processing process. The compensated parameters re-enter step S1 to form closed-loop feedback. Step S5, Quality Traceability Database Construction and Anomaly Backtracking Analysis: Synchronously record the time-series matrix data, quality prediction curve, out-of-tolerance risk probability trajectory, and parameter compensation log for each part throughout the entire process to construct a quality traceability database. When subsequent inspections discover quality anomalies, the database is used to backtrack and locate the abnormal time nodes and process parameter fluctuation sources.
2. The online predictive control method for machining quality of mechanical parts according to claim 1, characterized in that, In step S1, the acquisition frequency of the spindle speed is not less than 1000Hz, the acquisition frequency of the vibration acceleration signal is not less than 5000Hz, the acquisition frequency of the coolant temperature is not less than 10Hz, and the acquisition frequency of the ambient temperature and ambient humidity is not less than 1Hz; the alignment method of the unified sampling timestamp is based on the sampling time of the lowest acquisition frequency channel, and the high-frequency channel signal is subjected to mean downsampling processing within the corresponding time window.
3. The online predictive control method for machining quality of mechanical parts according to claim 1, characterized in that, In step S2, before constructing the causal mapping network model, the process parameter channels in the historical processing dataset are standardized with zero mean and unit variance, and the quality characteristic indicators are normalized with tolerance ratio, so that the deviation values of each quality characteristic are uniformly mapped to the range of 0 to 1.
4. The online predictive control method for machining quality of mechanical parts according to claim 1, characterized in that, In step S3, the preset risk threshold is 0.
7. The warning signal is triggered only when the probability of the same part exceeding the risk threshold exceeds the risk threshold in three consecutive sampling periods, so as to avoid false warnings caused by instantaneous fluctuations.
5. The online predictive control method for machining quality of mechanical parts according to claim 1, characterized in that, In step S2, the weight calculation process of the causal attention mechanism includes: performing Granger causality tests on each pair of process parameter channels and quality characteristic indicators in the historical processing dataset, using the Granger causality statistic as the initial causal weight, and then performing nonlinear mapping on the initial causal weight through a self-attention encoder to obtain the final causal attention weight matrix, wherein the self-attention encoder adopts a multi-head attention structure with the number of heads set to 4 to 8.
6. The online predictive control method for machining quality of mechanical parts according to claim 1, characterized in that, In step S3, the real-time quality prediction adopts a sliding window mechanism, using the time series matrix data of the most recent L sampling times as input each time, where L ranges from 50 to 200 sampling points; the calculation of the out-of-tolerance risk probability adopts the Monte Carlo sampling method, randomly sampling the probability distribution of the quality prediction value N times, and statistically analyzing the proportion of samples falling into the tolerance out-of-tolerance region as the out-of-tolerance risk probability, where N is not less than 500 times.
7. The online predictive control method for machining quality of mechanical parts according to claim 1, characterized in that, In step S4, the compensation amount is calculated based on the gradient backpropagation method: the partial derivatives of the quality prediction deviation with respect to each adjustable process parameter are calculated along the backpropagation path of the causal mapping network model, and the partial derivatives are multiplied by the compensation step size factor as the compensation increment of each parameter. The compensation step size factor is adaptively adjusted according to the current out-of-tolerance risk probability. When the out-of-tolerance risk probability is higher, the compensation step size factor is larger.
8. The online predictive control method for machining quality of mechanical parts according to claim 1, characterized in that, In step S5, the record structure of the quality traceability database includes: a unique part number field, a processing start and end time field, a process parameter time series data field indexed by timestamps, a quality prediction value sequence field indexed by timestamps, a deviation risk probability sequence field indexed by timestamps, and a parameter compensation event list field, wherein the parameter compensation event list field records the trigger time of each compensation, the parameter value before compensation, the compensation amount, and the parameter value after compensation.
9. The online predictive control method for machining quality of mechanical parts according to claim 1, characterized in that, In step S4, the closed-loop control also includes a safety constraint mechanism: when the calculated compensation amount exceeds the allowable adjustment range of each adjustable process parameter, the compensation amount is truncated to the boundary value of the allowable range, and a parameter over-limit alarm signal is generated at the same time. If the probability of exceeding the tolerance risk still does not drop below the risk threshold after continuous compensation, a processing pause command is triggered and an abnormal intervention request is sent to the operator.
10. An online predictive control system for the machining quality of mechanical parts, used to implement the online predictive control method for the machining quality of mechanical parts as described in any one of claims 1-9, characterized in that, include: The multi-source data acquisition and time series matrix construction module is used to acquire spindle speed and feed rate through the internal interface of the CNC system during machining, acquire cutting force signal, vibration acceleration signal and coolant temperature signal through external sensors, and acquire ambient temperature and humidity through an environmental monitoring device. The data acquired from each channel are aligned according to a unified sampling timestamp to construct a multi-dimensional process data time series matrix. The causal mapping network building module is used to generate causal mapping network models based on historical processing datasets. The real-time quality prediction and risk assessment module is used to input the time series matrix constructed in real time into the causal mapping network model during the processing, and calculate the probability of exceeding the tolerance risk. When the probability of exceeding the tolerance risk exceeds the preset risk threshold, an early warning signal is generated. An adaptive compensation and closed-loop control module is used to respond to the warning signal, calculate the compensation amount of the adjustable process parameters based on the causal weight matrix, and write it into the CNC system through the real-time control interface of the CNC system to realize adaptive closed-loop control of the machining process. The quality traceability and anomaly backtracking module is used to synchronously record the time-series matrix data, quality prediction curves, out-of-tolerance risk probability change trajectory, and parameter compensation operation logs for each part throughout the entire process, and to build a quality traceability database to support the backtracking analysis of anomaly causes.
Citation Information
Patent Citations
Part quality prediction and evaluation optimization method and system
CN111931307A
