Numerical control program control fault diagnosis method and system

By constructing a program feature matrix and a spiking neural network model for CNC program fault diagnosis, the problems of insufficient multi-source data fusion capability and low causal reasoning efficiency are solved, enabling accurate detection of high-frequency anomalies and root cause tracing, thus improving the stability and efficiency of CNC machining.

CN120848463APending Publication Date: 2025-10-28YANCHENG CHIANGMAI INFORMATION TECH CO LTD +1

Patent Information

Application Number
CN202511062340.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-31
Publication Date
2025-10-28

AI Technical Summary

Technical Problem

In the existing CNC program fault diagnosis methods, the dynamic feature extraction and fusion capabilities driven by multi-source data are insufficient, making it difficult to comprehensively characterize the timing characteristics and abnormal patterns of program control. In addition, the quantitative accuracy of causal reasoning and the closed-loop verification efficiency of optimization schemes are low, resulting in limited interpretability and engineering practicality of the diagnostic results.

Method used

Multi-source data is collected and preprocessed to construct a program feature matrix. A spiking neural model is used for instruction mode conversion and dynamic anomaly detection to generate an anomaly diagnosis report. Root cause tracing and correlation strength quantification are performed through a probabilistic causal graph. Parameters are adjusted to optimize the CNC program, and physical simulation is conducted to verify and generate fault diagnosis results.

Benefits of technology

It enables precise detection of high-frequency anomalies in CNC programs, provides a high-precision data foundation, and allows for accurate tracing from abnormal phenomena to their root causes, thereby improving the stability and efficiency of CNC machining.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120848463A_ABST
    Figure CN120848463A_ABST
Patent Text Reader

Abstract

The invention discloses a numerical control program control fault diagnosis method and system, and relates to the technical field of fault diagnosis, and the method comprises the steps: inputting a program feature matrix into a pulse neural model, carrying out instruction mode conversion on a space-time coding layer, carrying out dynamic anomaly detection on a pulse issuing layer, and generating an anomaly diagnosis report; performing root cause tracing on the abnormal diagnosis report, constructing a probability causal graph, performing association intensity quantification, and generating a causal analysis conclusion report; adjusting associated parameters of the causal analysis conclusion report, obtaining a correction arc instruction, and performing cutter location file format conversion and G code post-processing according to the correction arc instruction to obtain a program optimization scheme; and performing physical simulation verification on the program optimization scheme, obtaining performance improvement data, performing real-time monitoring and data verification on the performance improvement data, and generating a numerical control program control fault diagnosis result. According to the invention, the stability and efficiency of numerical control processing are improved through the spiking neural model and the construction of the probability causal diagram.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of fault diagnosis technology, and in particular to a method and system for diagnosing faults in numerical control program control. Background Art

[0002] As global manufacturing transforms towards intelligence and precision, the stability and reliability of CNC program control systems directly impact machining quality and production efficiency. Research on CNC program fault diagnosis methods has always been a key focus in industrial automation. Early CNC program fault diagnosis relied primarily on human experience and static rule bases, using preset alarm thresholds for simple anomaly identification. In recent years, the rapid development of deep learning networks has further propelled progress in industrial automation. Recurrent neural networks and convolutional neural networks have been used to mine the temporal series features and spatial structure correlations of CNC programs, achieving a leap from single-parameter monitoring to multi-modal data fusion diagnosis.

[0003] However, existing technologies still have some shortcomings. On the one hand, the ability to extract and fuse dynamic features driven by multi-source data is insufficient, making it difficult to fully characterize the temporal characteristics and abnormal patterns of program control. On the other hand, the quantification accuracy of causal reasoning and the closed-loop verification efficiency of optimization schemes are low, which limits the interpretability and engineering applicability of diagnostic results. Summary of the Invention

[0004] In view of the aforementioned existing problems, the present invention is proposed.

[0005] Therefore, this invention provides a method for diagnosing faults in CNC program control to solve the problems of insufficient sensitivity in high-frequency anomaly detection and poor interpretability in tracing the root cause of faults.

[0006] To solve the above-mentioned technical problems, the present invention provides the following technical solution:

[0007] In a first aspect, the present invention provides a method for diagnosing faults in CNC program control, comprising,

[0008] Collect and preprocess multi-source data, and perform static feature extraction and dynamic characteristic prediction based on the preprocessed multi-source data to construct the program feature matrix;

[0009] The program feature matrix is ​​input into the spiking neural model. The spatiotemporal coding layer performs instruction mode conversion, the spiking firing layer performs dynamic anomaly detection, and an anomaly diagnosis report is generated.

[0010] The root cause of abnormal diagnostic reports is traced, a probabilistic causal graph is constructed, the correlation strength is quantified, and a causal analysis conclusion report is generated.

[0011] Adjust the correlation parameters in the causal analysis conclusion report, obtain the correction arc command, and perform tool position file format conversion and G-code post-processing based on the correction arc command to obtain the program optimization scheme;

[0012] Physical simulation is used to verify the program optimization scheme, performance improvement data is obtained, the performance improvement data is monitored and verified in real time, and CNC program control fault diagnosis results are generated.

[0013] As a preferred embodiment of the CNC program control fault diagnosis method of the present invention, the multi-source data includes operation codes, numerical parameters and position information in the CNC program source code;

[0014] The preprocessing includes data cleaning, format conversion, deduplication, normalization, and outlier handling.

[0015] In a preferred embodiment of the CNC program control fault diagnosis method of the present invention, the specific steps for constructing the program feature matrix are as follows:

[0016] Extract instruction type distribution, parameter statistical characteristics, and structural complexity from preprocessed multi-source data, and integrate them to generate static feature vectors;

[0017] Dynamic characteristic prediction is performed on the preprocessed multi-source data to generate dynamic characteristic data;

[0018] Based on static feature vectors and dynamic characteristic data, static-dynamic feature fusion is performed to obtain a comprehensive feature set. The comprehensive feature set is then dimension-unified to construct a program feature matrix.

[0019] In a preferred embodiment of the CNC program control fault diagnosis method of the present invention, the specific steps for generating the abnormality diagnosis report are as follows:

[0020] A pulse neural model is constructed by using multi-scale pulse coding to perform multi-resolution feature fusion and cross-layer pulse propagation on the spatiotemporal coding layer and the pulse firing layer.

[0021] The program feature matrix is ​​input into the spiking neural model, and the spatiotemporal coding layer performs instruction mode conversion through delay coding to form a time-delayed pulse sequence.

[0022] The pulse firing layer uses pulse frequency statistical analysis to perform dynamic anomaly detection and generate anomaly time point markers.

[0023] The time-delayed pulse sequence and abnormal time point markers are integrated through a feature fusion channel to generate an abnormality diagnosis report.

[0024] In a preferred embodiment of the CNC program control fault diagnosis method of the present invention, the specific steps for generating the causal analysis conclusion report are as follows:

[0025] Analyze the temporal correlation patterns and impact of abnormal diagnostic reports and program feature matrices to obtain coupling strength indicators. Based on the obtained coupling strength indicators, trace the root causes and construct a probabilistic causal graph.

[0026] The correlation strength of nodes and edge causal strength in the probabilistic causal graph is quantified, and a causal analysis conclusion report is generated.

[0027] In a preferred embodiment of the CNC program control fault diagnosis method of the present invention, the specific steps for obtaining the program optimization scheme are as follows:

[0028] Perform critical root cause analysis on the causal analysis conclusion report, obtain correlation parameters, perform constraint optimization screening on the correlation parameters, and generate a list of parameters to be adjusted;

[0029] Adjust the associated parameters in the list of parameters to be adjusted, optimize the order of conflicting instructions, and generate the corrected arc instructions;

[0030] The modified arc command is converted to a toolpath file format to obtain toolpath trajectory data. The obtained toolpath trajectory data is then post-processed using G-code to obtain program optimization solutions.

[0031] In a preferred embodiment of the CNC program control fault diagnosis method of the present invention, the specific steps for generating CNC program control fault diagnosis results are as follows:

[0032] The program optimization scheme is virtually processed, and performance indicators are measured to generate performance improvement data;

[0033] Based on performance improvement data, processing status verification and multi-parameter joint verification are performed to generate a quantitative verification report.

[0034] Based on the quantitative verification report, perform composite fault diagnosis, identify potential fault sources, perform association rule mining and fault mode matching on the potential fault sources, and generate a CNC program control fault diagnosis report.

[0035] In a second aspect, the present invention provides a numerical control program control fault diagnosis system, including a data acquisition module, an anomaly diagnosis module, a cause-effect analysis module, a program optimization module, and a simulation verification module;

[0036] The data acquisition module is used to collect multi-source data and preprocess it. Based on the preprocessed multi-source data, it performs static feature extraction and dynamic characteristic prediction to construct the program feature matrix.

[0037] The anomaly diagnosis module is used to input the program feature matrix into the spiking neural model, the spatiotemporal coding layer performs instruction mode conversion, the spiking firing layer performs dynamic anomaly detection, and generates an anomaly diagnosis report.

[0038] The causal analysis module is used to trace the root causes of abnormal diagnostic reports, construct probabilistic causal graphs, quantify the correlation strength, and generate causal analysis conclusion reports.

[0039] The program optimization module is used to adjust the correlation parameters of the causal analysis conclusion report, obtain the correction arc command, and perform tool position file format conversion and G-code post-processing based on the correction arc command to obtain the program optimization scheme.

[0040] The simulation verification module is used to perform physical simulation verification of the program optimization scheme, obtain performance improvement data, monitor and verify the performance improvement data in real time, and generate CNC program control fault diagnosis results.

[0041] Thirdly, the present invention provides a computer device including a memory and a processor, wherein the memory stores a computer program, wherein when the computer program is executed by the processor, it implements any step of the numerical control program control fault diagnosis method as described in the first aspect of the present invention.

[0042] Fourthly, the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein: when the computer program is executed by a processor, it implements any step of the numerical control program control fault diagnosis method as described in the first aspect of the present invention.

[0043] The beneficial effects of this invention are as follows: By using a pulse neural model for instruction mode conversion and dynamic anomaly detection, it achieves accurate detection of high-frequency anomalies in CNC programs, providing a high-precision data foundation for real-time fault diagnosis of CNC programs. Simultaneously, it constructs a probabilistic causal graph to quantify the correlation strength between anomalies and feature parameters, enabling accurate tracing from abnormal phenomena to root causes, and improving the stability and efficiency of CNC machining. Attached Figure Description

[0044] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0045] Figure 1 This is a flowchart of a method for diagnosing faults in CNC program control.

[0046] Figure 2 This is a schematic diagram of a CNC program control fault diagnosis system.

[0047] Figure 3 A flowchart for generating a causal analysis conclusion report.

[0048] Figure 4 A flowchart generated for program optimization schemes. Detailed Implementation

[0049] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings.

[0050] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of the invention. Therefore, the invention is not limited to the specific embodiments disclosed below.

[0051] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The phrase "in one embodiment" appearing in different places in this specification does not necessarily refer to the same embodiment, nor is it a single or selective embodiment that is mutually exclusive with other embodiments.

[0052] Reference Figures 1-4 As one embodiment of the present invention, this embodiment provides a method for diagnosing faults in CNC program control, comprising the following steps:

[0053] S1. Collect multi-source data and preprocess it. Based on the preprocessed multi-source data, perform static feature extraction and dynamic characteristic prediction to construct the program feature matrix.

[0054] S1.1 Multi-source data includes opcodes, numerical parameters, and position information in the CNC program source code;

[0055] It should be noted that a CNC program parser is used to perform lexical analysis and syntax parsing on the CNC program source code, identify the operation codes according to the G-code standard format, and pair adjacent operation codes with numerical parameters according to the syntax rules to extract the numerical parameters associated with each operation code. The physical displacement of each motion axis is measured by a position sensor and converted into electrical signals. The electrical signals are then decoded and converted into digital coordinates. The digital coordinates are then corrected by a motion compensation algorithm, and the corrected digital coordinates are converted into position information in the workpiece coordinate system using a coordinate transformation algorithm.

[0056] It should also be noted that the syntax rules are explicitly defined by the syntax specification of the CNC program, which is derived from the underlying programming logic framework followed during CNC program development.

[0057] Decoding the electrical signal and converting it into digital coordinates requires amplifying the signal to enhance its strength. Then, a filtering circuit is used to filter out high-frequency noise interference. Finally, an analog-to-digital converter converts the processed electrical signal into discrete digital quantities, which correspond to the physical displacement of each motion axis, thus forming digital coordinates.

[0058] S1.2 Preprocessing includes data cleaning, format conversion, deduplication, normalization, and outlier handling;

[0059] It should be noted that, firstly, the collected multi-source data, including operation codes, numerical parameters, and positional information from the CNC program source code, undergoes data cleaning to remove incomplete, erroneous, or irrelevant data records. Next, format conversion is performed to ensure all data sources adhere to a unified format standard for subsequent processing. Then, deduplication is performed to eliminate duplicate data entries, ensuring the uniqueness of the dataset. A normalization step maps data values ​​from different sources to the same scale, preventing certain features from unduly affecting the results due to excessively large differences in magnitude. Finally, outlier handling identifies and corrects data points that deviate from the normal range, ensuring the accuracy and reliability of the dataset.

[0060] S1.3. Extract the instruction type distribution, parameter statistical characteristics and structural complexity of the preprocessed multi-source data through statistical analysis, and integrate them to generate a static feature vector;

[0061] It should be noted that the preprocessed multi-source data is structured and organized, with opcodes and associated numerical parameters linked in execution order to form an ordered instruction sequence. All instruction sequences are traversed, and the frequency and proportion of each opcode are statistically analyzed to form an instruction type distribution for opcode types. The mean, variance, maximum, minimum, and distribution range of the numerical parameters associated with each opcode are obtained to capture the statistical characteristics of the numerical parameters. Then, the structural complexity of the program is quantified by statistically analyzing the total number of CNC instructions, the number of different opcode types, the repetition patterns of instruction sequences, and the nesting structure. Finally, the instruction type distribution, the statistical characteristics of the numerical parameters, and the structural complexity of the program are concatenated dimensionally and integrated into a unified static feature vector after normalization.

[0062] S1.4. Kinematic simulation is used to predict the dynamic characteristics of the preprocessed multi-source data to generate dynamic characteristic data.

[0063] It should be noted that the operation codes and numerical parameters in the multi-source data are aligned with the location information by timestamp to form a multi-dimensional time series dataset. The instantaneous velocity and acceleration of each motion axis are obtained from the multi-dimensional time series dataset, and statistical analysis is performed to extract the distribution characteristics and change patterns including mean, variance, maximum and minimum values. Finally, through statistical interpolation, dynamic characteristic data including predicted velocity curves, acceleration range and error fluctuation range are generated.

[0064] It should also be noted that the timestamp of the operation code is the time when the instruction is issued, the timestamp of the numerical parameter is bound to the effective time of the corresponding operation code, and the timestamp of the position information is the time when the sensor actually collects the displacement of each motion axis.

[0065] S1.5 Based on static feature vectors and dynamic characteristic data, static-dynamic feature fusion is performed through spatiotemporal alignment to obtain a comprehensive feature set, and time series interpolation is used to unify the dimensions of the comprehensive feature set to construct the program feature matrix;

[0066] It should be noted that the time base of static feature vectors and dynamic characteristic data is aligned through a unified timestamp correction mechanism. Then, for each time base point, the static feature vector and dynamic characteristic data are associated based on a unified timestamp to form a comprehensive feature vector of "time point - static feature - dynamic feature". Next, linear interpolation is used to interpolate and fill the comprehensive feature vector with inconsistent time intervals, adjusting the time interval to a unified scale to ensure that the feature dimensions of all time points are consistent. Finally, the interpolated and filled comprehensive feature vectors are arranged in chronological order to construct a program feature matrix in which rows represent continuous time points and columns represent the fused static-dynamic feature dimensions.

[0067] S2. Input the program feature matrix into the spiking neural model, the spatiotemporal coding layer performs instruction mode conversion, the pulse firing layer performs dynamic anomaly detection, and generates an anomaly diagnosis report.

[0068] S2.1. Multi-scale pulse coding is used to perform multi-resolution feature fusion and cross-layer pulse transmission on the spatiotemporal coding layer and pulse firing layer to construct a pulse neural model;

[0069] It should be noted that in the PyTorch deep learning framework, the spiking neural architecture is invoked through the `nn.Module` instruction, and a two-level structure is constructed for the spiking neural architecture. The spatiotemporal coding layer adopts a time window sliding aggregation mechanism, setting a short time window of 10ms to capture high-frequency features and a long time window of 100ms to extract trend features. At the same time, 3×3 small convolutional kernels are configured to process local spatial features, and 7×7 large convolutional kernels are configured to model global spatial dependencies. The spiking firing layer adopts a membrane potential dynamic update mechanism, integrates input signals through synaptic weights, generates spiking time sequences based on dynamic firing rules, and accurately records the timestamps of each spiking neural model, thus completing the basic architecture construction of the spiking neural model.

[0070] Multi-scale pulse coding is used to integrate features from the spatiotemporal coding layer and the pulse firing layer. A temporal attention mechanism is used to aggregate pulse features at different time scales. At the same time, spatial convolutional kernels (configured with 3×3 small kernels to capture local pulse patterns and 7×7 large kernels to model global pulse distribution) are applied to achieve feature fusion across spatial locations, generating a multi-resolution pulse feature matrix. The multi-resolution pulse feature matrix is ​​calibrated in the temporal dimension using a pulse time alignment algorithm, and features are scaled using a pulse frequency normalization method. A gated pulse network is used simultaneously to realize cross-layer pulse information transmission, ensuring the pulse transmission efficiency between the spatiotemporal coding layer and the pulse firing layer. Finally, a complete pulse neural model is constructed.

[0071] Next, the constructed spiking neural model is trained. Specifically, the multimodal spiking dataset is first divided into a sample set, a training set, and a validation set in a 6:2:2 ratio. On the sample set, the pulse time intervals are normalized using pulse feature standardization, and time-series cross-validation is used to balance data samples with different pulse frequency distributions, generating standardized training samples. On the training set, an adaptive moment estimation optimizer is used to backpropagate the standardized training samples, and the spiking neural model parameters are optimized using the pulse time reconstruction loss function. A gradient pruning strategy is applied to prevent gradient explosion. On the validation set, the spiking neural model performance is evaluated by calculating the pulse prediction accuracy through forward propagation. Training is stopped when the validation loss does not decrease for five consecutive epochs, and the trained spiking neural model is serialized and saved using torch.jit.script, completing the training of the spiking neural model.

[0072] S2.2 Input the program feature matrix into the spiking neural model. The spatiotemporal coding layer performs instruction mode conversion through delay coding to form a time-delayed pulse sequence.

[0073] It should be noted that after the program feature matrix is ​​input into the spiking neural model, the spatiotemporal coding layer first parses the input program feature matrix, extracts the frequency and proportion of each opcode in the instruction type distribution, and obtains the mean, variance, and other statistical quantities of key parameters such as the feed rate F value associated with the instruction from the parameter statistical characteristics. Then, based on the preset instruction-delay mapping rules, a basic delay time is assigned to each instruction type, and the basic delay is dynamically adjusted according to the F value in the parameter statistical characteristics. Next, through the time dimension delay coding mechanism, the adjusted basic delay time is converted into pulse emission time points. Finally, all pulse emission time points are arranged in chronological order to form a time-delayed pulse sequence that precisely corresponds to the program execution timing.

[0074] It should also be noted that the preset instruction-delay mapping rules are based on the functional characteristics of different instruction types in the CNC program, the influence of associated parameters on motion time, and the actual needs of machine tool motion control.

[0075] S2.3 The pulse firing layer uses pulse frequency statistical analysis to perform dynamic anomaly detection and generate anomaly time point markers;

[0076] It should be noted that after receiving the time-delayed pulse sequence from the spatiotemporal coding layer, the pulse firing layer first performs sliding window statistics on the time-delayed pulse sequence with a fixed time window to obtain the pulse firing frequency within each time window; then, it sets the normal frequency range based on the historical pulse firing frequency data during normal operation of the CNC program; next, it compares the actual statistical pulse firing frequency with the normal frequency range to identify abnormal time windows with frequency deviations; finally, it marks the start and end times of the abnormal time windows as abnormal time points.

[0077] S2.4 Integrate the time-delayed pulse sequence and abnormal time point markers through the feature fusion channel to generate an abnormality diagnosis report;

[0078] It should be noted that, through a timestamp alignment mechanism, the time axes of the time-delayed pulse sequence and the abnormal time point markers are unified to the same benchmark; then, pulse time distribution features are extracted from the time-delayed pulse sequence, and abnormal features are extracted from the abnormal time point markers; next, a multi-scale feature fusion method is used to weight and concatenate the pulse time distribution features and abnormal features to form a comprehensive feature vector that includes time dimension, pulse behavior dimension, and abnormality degree dimension; finally, the feature vector is integrated to generate an abnormal diagnosis report.

[0079] It should also be noted that, based on the pulse firing frequency of the time-delayed pulse sequence, the mean and standard deviation of adjacent time-delayed pulse sequences are statistically analyzed to characterize the pulse time distribution features.

[0080] The duration of the anomaly is obtained based on the start / end time of the anomaly point, the deviation amplitude is obtained by combining the difference between the actual frequency and the average value of the normal range, and the number of anomalies occurring per unit time is counted to quantify the anomaly frequency. These are then integrated to generate anomaly features.

[0081] S3. Root cause analysis of abnormal diagnostic reports, construct a probabilistic causal graph, quantify the correlation strength, and generate a causal analysis conclusion report.

[0082] S3.1 Analyze the temporal correlation patterns and impact of the abnormal diagnosis report and the program feature matrix to obtain the coupling strength index. Based on the obtained coupling strength index, perform root cause tracing through temporal coupling analysis and construct a probabilistic causal graph.

[0083] It should be noted that a timestamp alignment mechanism is used to unify the timeline of the program feature matrix and the anomaly diagnosis report to the same benchmark. Centered on each anomaly time point, program features containing static feature vectors and dynamic characteristic data within the time window before and after the anomaly occurrence are extracted from the program feature matrix. At the same time, anomaly data including anomaly type, anomaly duration, and associated instruction segments within the same time window are extracted from the anomaly diagnosis report. Subsequently, the temporal correlation patterns such as the time sequence and fluctuation synchronization of each program feature and anomaly data within the program feature window are analyzed. Then, by obtaining the Pearson correlation coefficient, mutual information, and co-occurrence frequency, the coupling strength index between each program feature and anomaly data is comprehensively obtained. Finally, based on the coupling strength index, the causal probability between program features and anomaly data is obtained by combining a Bayesian network. Finally, all data are integrated into a probabilistic causal graph, where nodes represent program features and anomaly data, and edges represent causal probabilities.

[0084] S3.2 Quantify the correlation strength of the probability causal graph through co-occurrence frequency statistics and generate a causal analysis conclusion report;

[0085] It should be noted that all node pairs and their corresponding causal probabilities are extracted from the constructed probabilistic causal graph; then, the co-occurrence frequency of each pair of nodes in historical anomalous events is calculated, and weighted normalization is performed in combination with the initial causal probabilities to obtain the comprehensive correlation strength index of each pair of nodes; the comprehensive correlation strength index is then sorted from high to low, and the causal analysis conclusion report is compiled and output.

[0086] S4. Adjust the correlation parameters of the causal analysis conclusion report, obtain the correction arc command, and perform tool position file format conversion and G-code post-processing based on the correction arc command to obtain the program optimization scheme.

[0087] S4.1. Perform key root cause analysis on the causal analysis conclusion report using statistical analysis methods, and use Pearson correlation coefficient to obtain correlation parameters. Perform constraint optimization screening on the correlation parameters to generate a list of parameters to be adjusted.

[0088] It should be noted that, through statistical analysis, feature pairs with high overall correlation strength are selected from the causal analysis conclusion report as potential key root cause candidates. Subsequently, the Pearson correlation coefficient is used to measure the degree of linear correlation between potential key root cause candidates and abnormal indicators, obtaining correlation parameters that reflect the tightness of the correlation. Then, constraint optimization screening is performed on the correlation parameters, using "correlation parameters reaching a preset correlation threshold" as a constraint condition to exclude parameters that are not adjustable or exceed the equipment's capabilities. Finally, the selected adjustable parameters, along with their current status, adjustment direction, and expected effects, are compiled into a list of parameters to be adjusted.

[0089] It should also be noted that the preset correlation threshold is based on the safe operation capability of the CNC program, the process parameter specifications, and the historical normal operation statistics definition, and the exemplary value range is (0.7,1].

[0090] The Pearson correlation coefficient is used to measure the degree of linear correlation between potential critical root cause candidates and anomalous indicators. Specifically, it involves analyzing whether the changing trends of potential root cause candidates and anomalous indicators are consistent, quantifying the strength of the linear correlation. If the changing trends of potential root cause candidates and anomalous indicators are highly synchronized (e.g., when the "G02 circular interpolation command ratio" increases, the "circular radius error" increases synchronously), it indicates a strong linear correlation. If the changing trends show no obvious correlation (e.g., when the "tool compensation parameter" is adjusted, the "tool trajectory deviation" does not change synchronously), the correlation is weak. Finally, critical root cause candidates with a strong linear correlation to anomalous indicators are selected as correlation parameters.

[0091] S4.2 Based on the list of parameters to be adjusted, the parameters are adjusted by a constraint optimization algorithm, and the sequence of conflicting instructions is optimized by a trajectory planning algorithm to generate the corrected arc instructions.

[0092] It should be noted that a multi-objective optimization objective function is constructed with the dual objectives of suppressing anomalies and maintaining processing quality. The decision variables are defined as adjustable related parameters in the parameter list to be adjusted. A set of constraints including equipment physical limitations, process specifications, and historical normal operating conditions is defined. The optimal combination of related parameters that satisfies all the constraints is iteratively searched, and the adjusted related parameter values ​​are output and the constraint satisfaction status is recorded. Then, using the adjusted related parameters as input, combined with the program feature matrix and anomaly diagnosis report, an arc command is generated. A trajectory planning algorithm is used to perform conflict detection and optimization on the arc command, and finally, the corrected arc command is generated.

[0093] It should also be noted that using trajectory planning algorithms to perform conflict detection and optimization on arc commands requires detecting, based on motion parameters such as speed, acceleration, and execution time of each arc command, whether there are conflicts such as the start time of a later arc command being earlier than the end time of the previous arc command, causing overlapping execution times. Subsequently, for the detected conflicts, different arcs are smoothly connected by inserting transition straight line segments G01 to alleviate abrupt acceleration changes, and the start time of subsequent arcs is adjusted to eliminate time overlap, finally generating the corrected arc commands.

[0094] S4.3. Convert the toolpath file format of the corrected arc command to obtain toolpath trajectory data. Perform G-code post-processing on the obtained toolpath trajectory data to obtain program optimization scheme.

[0095] It should be noted that the correction instructions in G-code form are converted into a preliminary toolpath file according to the standard toolpath file format. Then, the discrete toolpath points in the preliminary toolpath file are processed into a continuous one using a trajectory interpolation algorithm to obtain the X / Y / Z axis coordinates and rotation axis angles at each sampling time, forming toolpath trajectory data. Next, based on the axis travel, maximum feed rate, and arc radius limit extracted from the program feature matrix, the toolpath trajectory data is post-processed with G-code, the arc instruction format is adjusted and the arc instruction sequence is optimized to generate executable G-code. Finally, the executable G-code is compared and verified with the anomaly diagnosis report to obtain the program optimization scheme.

[0096] S5. Perform physical simulation verification on the program optimization scheme, obtain performance improvement data, monitor and verify the performance improvement data in real time, and generate CNC program control fault diagnosis results.

[0097] S5.1. The optimized program scheme is virtually machined using CNC machining simulation, and performance indicators are measured to generate performance improvement data.

[0098] It should be noted that the corrected circular arc command sequence and associated parameters are input into the virtual machining environment. Simultaneously, the machine tool motion parameters stored in the program feature matrix, including axis travel, maximum feed rate, and servo response time, are loaded and combined with the anomaly diagnosis report to construct a virtual machining scenario. Subsequently, machining is performed according to the optimized circular arc command based on the actual motion logic of the CNC program. The deviation between the actual trajectory and the theoretical trajectory, the speed / acceleration change curves of each motion axis, and the number of anomaly triggers are recorded simultaneously. Then, performance indicators such as machining accuracy, motion smoothness, and anomaly suppression effect are extracted, and the measurement results are integrated into performance improvement data.

[0099] S5.2 Based on performance improvement data, the processing status is verified through multi-channel high-frequency data acquisition and dynamic threshold verification, and multi-parameter joint verification is performed using tolerance band analysis and trend fitting algorithms to generate a quantitative verification report.

[0100] It should be noted that key parameters such as the speed and acceleration of each motion axis, tool trajectory deviation, and abnormal frequency are collected during the CNC program operation. Then, based on the standard threshold, the collected key parameters are dynamically verified, and abnormal points exceeding the threshold are marked. Next, tolerance band analysis is performed on the key parameters to obtain the deviation of each key parameter. At the same time, a trend fitting algorithm is used to analyze the changing trend of key parameters with time and machining steps to identify potential abnormal patterns. Finally, the verification results, including parameter deviation values, standard threshold compliance, and trend analysis conclusions, are integrated to generate a quantitative verification report.

[0101] It should also be noted that the standard thresholds are based on the process specification definition, and the exemplary value ranges are: speed fluctuation ≤5%, acceleration change ≤2m / s³, and high-frequency abnormal frequency ≤10Hz.

[0102] Collect historical normal processing data and combine it with trend fitting algorithms to obtain the regular change pattern of key parameters over time; then, plot the actual change curves of key parameter values ​​collected in real time at each time point during the current CNC program operation, according to the same dimension; finally, by comparing the actual change curves with the regular change patterns, if the direction of change of key parameters (e.g., speed should increase but decreases), rate (e.g., acceleration should be stable but fluctuates violently), or range (e.g., trajectory deviation should be within ±0.03mm but continues to expand) deviates from the regular change patterns, it is determined to be a potential abnormal mode.

[0103] S5.3. Based on the quantitative verification report, perform composite fault diagnosis through joint time-frequency domain analysis and kinematic feature correlation method, and use wavelet packet transform to extract vibration spectrum features, identify potential fault sources, and generate a CNC program control fault diagnosis report based on the potential fault sources.

[0104] It should be noted that abnormal feature data such as processing time periods with excessive speed fluctuations and process segments with concentrated abnormal frequencies are extracted from the quantitative verification report. Simultaneously, machine tool vibration signals for the corresponding time periods are collected. Time-frequency domain joint analysis is then performed, using short-time Fourier transform to decompose the machine tool vibration signal into a two-dimensional time-frequency matrix to locate the spatiotemporal correspondence between abnormal features and CNC program execution. Next, the spatiotemporal correspondence is associated with motion parameters such as axis speed, acceleration, and radius of arc in the CNC program to establish a "vibration feature-motion state" mapping table. Simultaneously, wavelet packet transform is used to perform multi-scale decomposition of the machine tool vibration signal to extract spectral features such as the energy proportion of each frequency band and the main harmonic frequency, and to identify potential fault sources. Finally, the analysis results are integrated to generate a CNC program control fault diagnosis report.

[0105] This embodiment also provides a CNC program control fault diagnosis system, including: a data acquisition module, an anomaly diagnosis module, a cause-effect analysis module, a program optimization module, and a simulation verification module;

[0106] The data acquisition module is used to collect multi-source data and preprocess it. Based on the preprocessed multi-source data, it performs static feature extraction and dynamic characteristic prediction to construct the program feature matrix.

[0107] The anomaly diagnosis module is used to input the program feature matrix into the spiking neural model, the spatiotemporal coding layer performs instruction mode conversion, the spiking firing layer performs dynamic anomaly detection, and generates an anomaly diagnosis report.

[0108] The causal analysis module is used to trace the root causes of abnormal diagnostic reports, construct probabilistic causal graphs, quantify the correlation strength, and generate causal analysis conclusion reports.

[0109] The program optimization module is used to adjust the correlation parameters of the causal analysis conclusion report, obtain the correction arc command, and perform tool position file format conversion and G-code post-processing based on the correction arc command to obtain the program optimization scheme.

[0110] The simulation verification module is used to perform physical simulation verification of the program optimization scheme, obtain performance improvement data, monitor and verify the performance improvement data in real time, and generate CNC program control fault diagnosis results.

[0111] This embodiment also provides a computer device applicable to the CNC program control fault diagnosis method, including: a memory and a processor; the memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to implement the CNC program control fault diagnosis method proposed in the above embodiment.

[0112] The computer device can be a terminal, comprising a processor, memory, communication interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, carrier networks, NFC (Near Field Communication), or other technologies. The display screen can be an LCD screen or an e-ink screen. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad on the computer device's casing, or an external keyboard, touchpad, or mouse.

[0113] This embodiment also provides a storage medium storing a computer program, which, when executed by a processor, implements the numerical control program control fault diagnosis method proposed in the above embodiments. The storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read Only Memory (EPROM), Programmable Red-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.

[0114] In summary, this invention achieves accurate detection of high-frequency anomalies in CNC programs through: using a pulse neural model for instruction mode conversion and dynamic anomaly detection, providing a high-precision data foundation for real-time fault diagnosis of CNC programs; and simultaneously constructing a probabilistic causal graph to quantify the correlation strength between anomalies and feature parameters, enabling accurate tracing from abnormal phenomena to root causes, thereby improving the stability and efficiency of CNC machining.

[0115] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.

Claims

1. A method for diagnosing faults in CNC program control, characterized in that: include, Collect and preprocess multi-source data, and perform static feature extraction and dynamic characteristic prediction based on the preprocessed multi-source data to construct the program feature matrix; The program feature matrix is ​​input into the spiking neural model. The spatiotemporal coding layer performs instruction mode conversion, the spiking firing layer performs dynamic anomaly detection, and an anomaly diagnosis report is generated. The root cause of abnormal diagnostic reports is traced, a probabilistic causal graph is constructed, the correlation strength is quantified, and a causal analysis conclusion report is generated. Adjust the correlation parameters in the causal analysis conclusion report, obtain the correction arc command, and perform tool position file format conversion and G-code post-processing based on the correction arc command to obtain the program optimization scheme; Physical simulation is used to verify the program optimization scheme, performance improvement data is obtained, the performance improvement data is monitored and verified in real time, and CNC program control fault diagnosis results are generated.

2. The CNC program control fault diagnosis method as described in claim 1, characterized in that: The multi-source data includes opcodes, numerical parameters, and position information from the CNC program source code; The preprocessing includes data cleaning, format conversion, deduplication, normalization, and outlier handling.

3. The CNC program control fault diagnosis method as described in claim 2, characterized in that: The specific steps for constructing the program feature matrix are as follows: Extract instruction type distribution, parameter statistical characteristics, and structural complexity from preprocessed multi-source data, and integrate them to generate static feature vectors; Dynamic characteristic prediction is performed on the preprocessed multi-source data to generate dynamic characteristic data; Based on static feature vectors and dynamic characteristic data, static-dynamic feature fusion is performed to obtain a comprehensive feature set. The comprehensive feature set is then dimension-unified to construct a program feature matrix.

4. The CNC program control fault diagnosis method as described in claim 1, characterized in that: The specific steps for generating the abnormal diagnostic report are as follows: A pulse neural model is constructed by using multi-scale pulse coding to perform multi-resolution feature fusion and cross-layer pulse propagation on the spatiotemporal coding layer and the pulse firing layer. The program feature matrix is ​​input into the spiking neural model, and the spatiotemporal coding layer performs instruction mode conversion through delay coding to form a time-delayed pulse sequence. The pulse firing layer uses pulse frequency statistical analysis to perform dynamic anomaly detection and generate anomaly time point markers. The time-delayed pulse sequence and abnormal time point markers are integrated through a feature fusion channel to generate an abnormality diagnosis report.

5. The CNC program control fault diagnosis method as described in claim 1, characterized in that: The specific steps for generating the causal analysis conclusion report are as follows. Analyze the temporal correlation patterns and impact of abnormal diagnostic reports and program feature matrices to obtain coupling strength indices, trace root causes based on coupling strength indices, and construct a probabilistic causal graph. The correlation strength of nodes and edge causal strength in the probabilistic causal graph is quantified, and a causal analysis conclusion report is generated.

6. The CNC program control fault diagnosis method as described in claim 1, characterized in that: The specific steps for obtaining the program optimization scheme are as follows: Perform critical root cause analysis on the causal analysis conclusion report, obtain correlation parameters, perform constraint optimization screening on the correlation parameters, and generate a list of parameters to be adjusted; Adjust the associated parameters in the list of parameters to be adjusted, optimize the order of conflicting instructions, and generate the corrected arc instructions; The modified arc command is converted to a toolpath file format to obtain toolpath trajectory data. The obtained toolpath trajectory data is then post-processed using G-code to obtain program optimization solutions.

7. The CNC program control fault diagnosis method as described in claim 1, characterized in that: The specific steps for generating CNC program control fault diagnosis results are as follows: The program optimization scheme is virtually processed, and performance indicators are measured to generate performance improvement data; Based on performance improvement data, processing status verification and multi-parameter joint verification are performed to generate a quantitative verification report. Based on the quantitative verification report, perform composite fault diagnosis, identify potential fault sources, perform association rule mining and fault mode matching on the potential fault sources, and generate a CNC program control fault diagnosis report.

8. A CNC program control fault diagnosis system, based on the CNC program control fault diagnosis method according to any one of claims 1 to 7, characterized in that: It includes a data acquisition module, an anomaly diagnosis module, a causal analysis module, a program optimization module, and a simulation verification module; The data acquisition module is used to collect multi-source data and preprocess it. Based on the preprocessed multi-source data, it performs static feature extraction and dynamic characteristic prediction to construct the program feature matrix. The anomaly diagnosis module is used to input the program feature matrix into the spiking neural model, the spatiotemporal coding layer performs instruction mode conversion, the spiking firing layer performs dynamic anomaly detection, and generates an anomaly diagnosis report. The causal analysis module is used to trace the root causes of abnormal diagnostic reports, construct probabilistic causal graphs, quantify the correlation strength, and generate causal analysis conclusion reports. The program optimization module is used to adjust the correlation parameters of the causal analysis conclusion report, obtain the correction arc command, and perform tool position file format conversion and G-code post-processing based on the correction arc command to obtain the program optimization scheme. The simulation verification module is used to perform physical simulation verification of the program optimization scheme, obtain performance improvement data, monitor and verify the performance improvement data in real time, and generate CNC program control fault diagnosis results.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, it implements the steps of the numerical control program control fault diagnosis method according to any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by the processor, it implements the steps of the numerical control program control fault diagnosis method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Instruction field analysis-based dynamic optimization method for parameters of numerical control machining process

    CN104777785A

  • Numerical control programming method for optimizing CAM template based on knowledge graph

    CN114021482A

  • Fault diagnosis method and device

    CN118940806A

  • Numerical control program control operation method and system

    CN119847070A

  • Software integration evaluation method based on machine learning and static analysis

    CN119862479A

Cited By

  • Program error tracing method, electronic equipment, storage medium and program product

    CN121412024A

  • A program error tracing method, electronic device, storage medium and program product

    CN121412024B