Machine tool spindle fault prediction method and related device
The LSTM model optimized by the CNN and sparrow search algorithm combined with the normal analysis of residual data, solves the problem of low accuracy in machine tool spindle fault prediction, and achieves efficient and accurate fault prediction.
Patent Information
- Application Number
- CN202510627174.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-15
- Publication Date
- 2025-08-15
AI Technical Summary
The existing machine tool spindle fault prediction methods have insufficient prediction accuracy, relying on empirical thresholds and single sensor data, making it difficult to capture timing and local features, strong parameter dependence, and severe prediction hysteresis.
The CNN model is used to extract feature information, combine the sparrow search algorithm to optimize the hyperparameters of the LSTM model, and divide the time window through the standardized vibration and temperature data, and use normal analysis of residual data to judge the fault, reducing the probability of misjudgment.
It improves the accuracy and accuracy of machine tool spindle fault prediction, can detect potential faults 30 minutes in advance, reduces the probability of misjudgment, and has high calculation efficiency.
Smart Images

Figure CN120493129A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of machine tool fault prediction, and in particular relates to a machine tool spindle fault prediction method and related devices. Background Art
[0002] As the core component of CNC machine tools, the operating status of the machine tool spindle will directly affect the processing accuracy and equipment life.
[0003] Most existing fault prediction methods rely on empirical thresholds or single sensor data, which may lead to the following problems: 1. Insufficient prediction accuracy Existing LSTM (Long Short-Term Memory) models or CNN (Convolutional Neural Network) models have difficulty capturing both temporal and local features, resulting in large prediction errors. 2. Strong parameter dependence LSTM model hyperparameters (such as learning rate and number of hidden layer nodes) are usually adjusted based on manual experience and are prone to falling into local optimality. 3. Prediction lag Most existing methods are based on fixed thresholds (e.g., thresholds set artificially based on experience) and cannot achieve early prediction based on residual changes. Summary of the Invention
[0004] The object of the present invention is to provide a method and related device for predicting machine tool spindle faults, so as to solve the problem of low accuracy in predicting machine tool spindle faults in the prior art.
[0005] In order to achieve the above object, the present invention adopts the following technical solutions: In a first aspect, the present invention provides a method for predicting a machine tool spindle fault, comprising the following steps: Acquire vibration data near the spindle bearing and temperature data on the spindle surface, and perform standardization on all acquired data to obtain standardized data; Divide the standardized data into time windows to obtain standardized data in several time windows; Use the standardized data of several time windows to construct training sets and test sets; The CNN model is used to extract feature information from the standardized data of several time windows, and the sparrow search algorithm is used to optimize the hyperparameters of the LSTM model to obtain the optimized LSTM model. The optimized LSTM model is trained based on the training set, and the training results of the optimized LSTM model are tested based on the test set to obtain the trained optimized LSTM model; The feature information from the standardized data of several time windows is input into the optimized LSTM model for prediction, and the vibration data and temperature data prediction results for the future time are obtained; Subtract the predicted results of the vibration data and temperature data at the future moment from the actual values in the test set to obtain residual data, and perform normal analysis on the residual data to obtain a standard normal distribution interval; According to the size relationship between the standard normal distribution interval and the set fault threshold, it is judged whether the machine tool spindle has a fault, and the machine tool spindle fault prediction result is obtained.
[0006] A further improvement of the present invention is that the calculation formula for the normalization process is:
[0007] in, The vibration data near the spindle bearing and the temperature data on the spindle surface after normalization are: are the original vibration data near the spindle bearing and the temperature data on the spindle surface, is the minimum value of the original vibration data near the spindle bearing and the temperature data on the spindle surface, It is the maximum value of the original vibration data near the spindle bearing and the temperature data on the spindle surface.
[0008] A further improvement of the present invention is that, in the step of dividing the standardized data into time windows to obtain standardized data in several time windows, a sliding window method is specifically used to divide the standardized data into time windows to obtain standardized data in several time windows.
[0009] A further improvement of the present invention is that the hyperparameters include a learning rate, a regularization coefficient and the number of hidden layer nodes.
[0010] A further improvement of the present invention is that, in the step of inputting the characteristic information in the standardized data of several time windows into the optimized LSTM model for prediction to obtain the prediction results of vibration data and temperature data at future moments, the mean absolute error, mean square error, root mean square error, remaining prediction residual and fit are also used to evaluate the prediction results of vibration data and temperature data at future moments.
[0011] A further improvement of the present invention is that the calculation formula of the mean absolute error is:
[0012] in, is the mean absolute error, express i The actual value at the moment, express i The average value of the actual value at the moment, i Indicates the moment, is the number of data sets; The formula for calculating the mean square error is:
[0013] in, is the mean square error, express i The actual value at the moment, express i The average value of the actual value at the moment, i Indicates the moment, is the number of data sets; The formula for calculating the root mean square error is:
[0014] in, is the root mean square error, t Indicates starting from the first value. express i The actual value at the moment, express i The average value of the actual value at the moment, i Indicates the moment, is the number of data sets; The remaining prediction residuals are calculated as:
[0015] in, is the remaining prediction residual, y max is the maximum value of the vibration data and temperature data, y min is the minimum value of the vibration data and temperature data, is the root mean square error; The calculation formula for the goodness of fit is:
[0016] in, is the fit, express i The actual value at the moment, express i The average value of the actual value at the moment, i Indicates the moment, is the number of data sets.
[0017] A further improvement of the present invention is that the method of determining whether a machine tool spindle has failed based on the size relationship between the standard normal distribution interval and the set fault threshold value, and obtaining a machine tool spindle failure prediction result, specifically includes: When the standard normal distribution interval is set several times in a row Outside the range, it means that the machine tool spindle has a fault, represents the mean of the residual data, Represents standard deviation.
[0018] In a second aspect, the present invention provides a machine tool spindle fault prediction system, comprising a data acquisition module, a time window division module, a data set construction module, a feature information extraction module, a model training module, a vibration data and temperature data prediction module, a residual data acquisition module, and a fault judgment module; The data acquisition module is used to acquire vibration data near the spindle bearing and temperature data on the spindle surface, and perform standardization processing on all acquired data to obtain standardized data; The time window division module is used to divide the standardized data into time windows to obtain standardized data of several time windows; The data set construction module is used to construct a training set and a test set using the standardized data of several time windows; The feature information extraction module is used to extract feature information from the standardized data of several time windows using a CNN model, and optimize the hyperparameters of the LSTM model using a sparrow search algorithm to obtain an optimized LSTM model; The model training module is used to train the optimized LSTM model based on the training set, and test the optimized LSTM model training results based on the test set to obtain a trained optimized LSTM model; The vibration data and temperature data prediction module is used to input the characteristic information of the standardized data of several time windows into the optimized LSTM model for prediction, and obtain the vibration data and temperature data prediction results at the future time; The residual data acquisition module is used to perform a subtraction between the predicted results of the vibration data and temperature data at a future moment and the actual values in the test set to obtain residual data, and perform a normal analysis on the residual data to obtain a standard normal distribution interval; The fault judgment module is used to judge whether a machine tool spindle has a fault based on the size relationship between the standard normal distribution interval and the set fault threshold, and obtain a machine tool spindle fault prediction result.
[0019] In a third aspect, the present invention provides an electronic device comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the machine tool spindle fault prediction method introduced above when executing the computer program.
[0020] In a fourth aspect, the present invention provides a storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the machine tool spindle fault prediction method introduced above.
[0021] Compared with the prior art, the present invention has the following beneficial effects: The present invention is an improved invention. Compared with the existing machine tool spindle fault prediction method, on the one hand, the present invention adopts a sparrow search algorithm to optimize the hyperparameters of the LSTM model to obtain an optimized LSTM model. The sparrow search algorithm can automatically search for the optimal parameter combination, thereby avoiding the limitations of manual parameter adjustment. On the other hand, the present invention subtracts the predicted results of vibration data and temperature data at future moments from the actual values in the test set to obtain residual data, and performs normal analysis on the residual data to obtain a standard normal distribution interval. It can be seen that the present invention only needs to obtain residual data based on the predicted results of vibration data and temperature data at future moments and the actual values in the test set, and compare it with the set fault threshold. There is no need for iteration of complex models, and the calculation efficiency is high. Moreover, the residual data can directly reflect the deviation between the predicted value and the true value. When a machine tool spindle fault occurs, the deviation increases significantly, avoiding random fluctuations from being misjudged as a fault, reducing the probability of misjudgment, and thereby improving the accuracy of fault prediction, thereby effectively solving the problem of low accuracy of machine tool spindle fault prediction in the prior art. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 This is a flow chart of the machine tool spindle fault prediction method of the present invention; Figure 2 Schematic diagram of a machine tool spindle fault prediction system according to the present invention; Figure 3 This is a flow chart of a machine tool spindle fault prediction method in Example 3 of the present invention; Figure 4 Flowchart of the SSA-CNN-LSTM model of the present invention; Figure 5 The iterative results of the three model trainings of the present invention are as follows; Figure 6 This is a comparison chart of the vibration prediction values and actual values of the three models of the present invention; Figure 7 A comparison diagram of vibration prediction errors of the three models of the present invention; Figure 8 This is a comparison chart of the temperature prediction values and actual values of the three models of the present invention; Figure 9 This is a comparison chart of temperature data prediction errors of the three models of the present invention; Figure 10 Schematic diagram of the normal distribution interval of the present invention; Figure 11 This is a schematic diagram of the vibration residual change of the present invention; Figure 12 This is a schematic diagram of the temperature residual change of the present invention; Figure 13 Schematic diagram of the structure of the electronic device of the present invention. DETAILED DESCRIPTION
[0023] In order to further understand the content of the present invention, the present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the embodiments are only for explaining the present invention and are not intended to limit it.
[0024] The proposed machine tool spindle fault prediction method subtracts predicted vibration and temperature data from the actual values in the test set to obtain residual data. This residual data is then subjected to normal analysis to determine a standard normal distribution interval. Based on the relationship between the standard normal distribution interval and a set fault threshold, the method determines whether the machine tool spindle has failed, resulting in a machine tool spindle fault prediction result. Compared to existing technologies, this method effectively addresses the low accuracy of machine tool spindle fault prediction in existing technologies.
[0025] Example 1: The flow chart of the machine tool spindle fault prediction method of the present invention is as follows: Figure 1 As shown, the machine tool spindle fault prediction method of the present invention includes the following steps: S1. Acquire vibration data near the spindle bearing and temperature data on the spindle surface, and perform standardization on all acquired data to obtain standardized data.
[0026] S2. Divide the standardized data into time windows to obtain standardized data in several time windows.
[0027] S3. Use the standardized data of several time windows to construct training sets and test sets.
[0028] S4. A CNN model is used to extract feature information from the standardized data of several time windows, and a sparrow search algorithm is used to optimize the hyperparameters of the LSTM model to obtain the optimized LSTM model.
[0029] S5. Train the optimized LSTM model based on the training set, and test the training results of the optimized LSTM model based on the test set to obtain a trained optimized LSTM model.
[0030] S6. Input the feature information of the standardized data of several time windows into the optimized LSTM model for prediction, and obtain the prediction results of vibration data and temperature data at future moments.
[0031] S7. Subtract the predicted results of the vibration data and temperature data at the future moment from the actual values in the test set to obtain residual data, and perform normal analysis on the residual data to obtain a standard normal distribution interval.
[0032] S8. Determine whether a machine tool spindle fault occurs based on the size relationship between the standard normal distribution interval and the set fault threshold, and obtain a machine tool spindle fault prediction result.
[0033] Example 2: The schematic diagram of the machine tool spindle fault prediction system of the present invention is as follows Figure 2 As shown, the machine tool spindle fault prediction system of the present invention includes a data acquisition module, a time window division module, a data set construction module, a feature information extraction module, a model training module, a vibration data and temperature data prediction module, a residual data acquisition module and a fault judgment module.
[0034] The data acquisition module is used to acquire vibration data near the spindle bearing and temperature data on the spindle surface, and perform standardization on all acquired data to obtain standardized data.
[0035] The time window division module is used to divide the standardized data into time windows to obtain standardized data of several time windows.
[0036] The dataset construction module is used to construct training sets and test sets using standardized data from several time windows.
[0037] The feature information extraction module is used to extract feature information from the standardized data of several time windows using the CNN model, and optimize the hyperparameters of the LSTM model using the sparrow search algorithm to obtain the optimized LSTM model.
[0038] The model training module is used to train the optimized LSTM model based on the training set, and test the training results of the optimized LSTM model based on the test set to obtain a trained optimized LSTM model.
[0039] The vibration data and temperature data prediction module is used to input the feature information of the standardized data of several time windows into the optimized LSTM model for prediction, and obtain the prediction results of vibration data and temperature data at future moments.
[0040] The residual data acquisition module is used to perform a difference between the predicted results of the vibration data and temperature data at a future moment and the actual values in the test set to obtain residual data, and perform a normal analysis on the residual data to obtain a standard normal distribution interval.
[0041] The fault judgment module is used to judge whether the machine tool spindle has a fault based on the size relationship between the standard normal distribution interval and the set fault threshold, and obtain the machine tool spindle fault prediction result.
[0042] Example 3: The flow chart of the machine tool spindle fault prediction method of the present invention is as follows: Figure 3 As shown, the machine tool spindle fault prediction method of the present invention includes the following steps: S1. Acquire vibration data near the spindle bearing and temperature data on the spindle surface, and perform standardization on all acquired data to obtain standardized data.
[0043] First, the vibration data near the spindle bearing and the temperature data of the spindle surface are obtained. Specifically, an acceleration sensor (sampling frequency of 1kHz, range of ±10g) is used to obtain the vibration data near the spindle bearing, and a non-contact infrared sensor (sampling frequency of 1Hz, range of 0℃~150℃) is used to obtain the temperature data of the spindle surface.
[0044] This example begins measuring vibration and temperature data every three seconds from the moment the machine tool is powered on and operating normally. From 0:05:00 AM on April 6, 2024, to 9:14:06 AM on April 8, 2024, a total of 1,145 vibration and temperature data points are collected. Table 1 shows some of the collected data.
[0045] Table 1 Partial vibration and temperature data
[0046] The calculation formula for normalization is:
[0047] in, The vibration data near the spindle bearing and the temperature data on the spindle surface after normalization are: are the original vibration data near the spindle bearing and the temperature data on the spindle surface, is the minimum value of the original vibration data near the spindle bearing and the temperature data on the spindle surface, It is the maximum value of the original vibration data near the spindle bearing and the temperature data on the spindle surface.
[0048] The vibration data near the spindle bearing (also called the vibration data of the machine tool spindle) and the temperature data on the spindle surface (also called the temperature data of the machine tool spindle) after normalization are shown in Table 2.
[0049] Table 2 Vibration data near the spindle bearing and temperature data on the spindle surface after normalization
[0050] S2. Divide the standardized data into time windows to obtain standardized data in several time windows.
[0051] In this step, the sliding window method is used to divide the standardized data into time windows to obtain standardized data of several time windows.
[0052] Specifically, this embodiment uses a sliding window approach to divide the original time series data (normalized data) into multiple input-output windows, forming multiple data samples. Assuming the window length is T, each sample contains input features from T consecutive time points and outputs the target value at the next time point.
[0053] S3. Use the standardized data of several time windows to construct training sets and test sets.
[0054] The training set and test set are constructed using the standardized data of several time windows, and 70% of the standardized data of several time windows are used as the training set and 30% as the test set.
[0055] S4. A CNN model is used to extract feature information from the standardized data of several time windows, and a sparrow search algorithm is used to optimize the hyperparameters of the LSTM model to obtain the optimized LSTM model.
[0056] A CNN model is used to extract feature information from the standardized data of several time windows, and the Sparrow Search Algorithm (SSA) is used to optimize the hyperparameters of the LSTM model (hyperparameters include learning rate, regularization coefficient, and number of hidden layer nodes) to obtain the optimized LSTM model.
[0057] The specific settings of the CNN model, SSA algorithm and LSTM model parameters are shown in Table 3.
[0058] Table 3 Model parameter settings
[0059] The specific steps for optimizing the hyperparameters of the LSTM model using the sparrow search algorithm are as follows: A. Setting key parameters: including population size, maximum number of iterations, warning threshold, percentage of discoverers, and proportion of sparrows that sense danger; B. Population initialization: Assign initial values to the initial learning rate, regularization coefficient, and optimal number of hidden layer nodes, set the optimization range, and randomly generate candidate solutions in the parameter space.
[0060] C. Set the fitness function: Calculate the mean square error of the prediction results of the LSTM model corresponding to each sparrow's position and use it as the fitness function; D. Fitness value sorting: select the sparrow with the highest fitness value as the optimal solution for the current iteration; E. Update global parameters based on the best performance: Compare the optimal solution of the current iteration with the optimal solution retained in the previous iteration. If the fitness function value of the current iteration is better, update the global optimal parameters. F. Determine whether the termination condition is met: If so, pass the current optimal solution to the LSTM model; otherwise, continue to update the sparrow's position information and enter the next iterative loop.
[0061] S5. Train the optimized LSTM model based on the training set, and test the training results of the optimized LSTM model based on the test set to obtain a trained optimized LSTM model.
[0062] S6. Input the feature information of the standardized data of several time windows into the optimized LSTM model for prediction, and obtain the prediction results of vibration data and temperature data at future moments.
[0063] In this step, the mean absolute error, mean square error, root mean square error, remaining prediction residual and goodness of fit are also used to evaluate the prediction results of vibration data and temperature data at the future moment (also called the next moment).
[0064] The formula for calculating the mean absolute error is:
[0065] in, is the mean absolute error, express i The actual value at the moment, express i The average value of the actual value at the moment, i Indicates the moment, is the number of data sets.
[0066] The formula for calculating the mean square error is:
[0067] in, is the mean square error, express i The actual value at the moment, express i The average value of the actual value at the moment, i Indicates the moment, is the number of data sets.
[0068] The formula for calculating the root mean square error is:
[0069] in, is the root mean square error, t means starting from the first value, express i The actual value at the moment, express i The average value of the actual value at the moment, i Indicates the moment, is the number of data sets.
[0070] The remaining prediction residuals are calculated as:
[0071] in, is the remaining prediction residual, y max is the maximum value of the vibration data and temperature data, y min is the minimum value of the vibration data and temperature data, is the root mean square error.
[0072] The calculation formula for the goodness of fit is:
[0073] in, is the fit, express i The actual value at the moment, express i The average value of the actual value at the moment, i Indicates the moment, is the number of data sets.
[0074] When the values of MAE, MSE, and RMSE are smaller, the value of RPD is larger, and the value of R2 is closer to 1, it means that the optimized LSTM model has better prediction effect.
[0075] This embodiment uses the data collected in the first 12 times (input samples) to predict the 13th data (output samples). For example, the 13th vibration data is predicted using the 1st to 12th vibration data, and then the 14th vibration data is predicted using the 2nd to 13th vibration data, and so on. The training set and test set are divided into 7:3 ratios, with the training set consisting of 802 data items and the test set consisting of 343 data items. This embodiment is simulated on MATLAB 2020a software, and the number of training rounds is 500.
[0076] In order to verify the superiority of the model of the present invention (SSA-CNN-LSTM model), the flow chart of the SSA-CNN-LSTM model is shown in Figure 4. The training iteration process of the model of the present invention is compared and analyzed with the LSTM model and the CNN-LSTM model. Figure 5 is the iterative process of the three models. Figure 6 Vibration data prediction results of three models, Figure 7 The vibration data prediction error results of the three models are: Figure 8 The temperature data prediction results of the three models are: Figure 9 The temperature data prediction error results of the three models.
[0077] The vibration errors and fitting results predicted by the three models are shown in Table 4, and the temperature errors and fitting results predicted by the three models are shown in Table 5.
[0078] Table 4 Vibration error and fitting results of three models
[0079] As can be seen from Table 4, compared with the LSTM model and the CNN-LSTM model, the SSA-CNN-LSTM model improves the fit by 9.0% and 3.0% respectively when predicting vibration data. The SSA-CNN-LSTM model performs better in terms of the four error indicators of MAE, MSE, RMSE, and RPD when predicting vibration data.
[0080] Table 5 Temperature errors and fitting results of three models
[0081] As can be seen from Table 5, compared with the LSTM model and the CNN-LSTM model, the SSA-CNN-LSTM model improves the fit of the temperature data by 9.6% and 3.6% respectively. The SSA-CNN-LSTM model performs better in terms of the four error indicators of MAE, MSE, RMSE, and RPD when predicting temperature data.
[0082] In summary, compared with the LSTM model and the CNN-LSTM model, the model of the present invention has higher prediction accuracy.
[0083] S7. Subtract the predicted results of the vibration data and temperature data at the future moment from the actual values in the test set to obtain the residual data, and perform normal analysis on the residual data to obtain the standard normal distribution interval (the standard normal distribution interval is also called the residual threshold, Figure 3 The threshold is used in the figure).
[0084] The predicted results of the vibration data and temperature data at the future moment are subtracted from the actual values in the test set to obtain residual data (vibration residual data and temperature residual data), and the residual data are subjected to normal analysis (normal analysis is also called normality test. In this embodiment, Minitab software is used to perform normal analysis on the residual data) to obtain a standard normal distribution interval. The standard normal distribution interval diagram is shown in FIG. Figure 10 shown.
[0085] In this paper, the vibration residual data outside the interval of (-0.322, 0.374) is regarded as the standard normal distribution interval of vibration data, and the temperature residual data outside the interval of (-1.146, 1.078) is regarded as the standard normal distribution interval of temperature data.
[0086] S8. Determine whether a machine tool spindle fault occurs based on the size relationship between the standard normal distribution interval and the set fault threshold, and obtain a machine tool spindle fault prediction result.
[0087] According to the relationship between the standard normal distribution interval and the set fault threshold, it is judged whether the machine tool spindle has a fault, and the machine tool spindle fault prediction result is obtained, which specifically includes: When the standard normal distribution interval is set several times in a row Outside the range, it means that the machine tool spindle has a fault, represents the mean of the residual data, Represents standard deviation.
[0088] In this embodiment, when the standard normal distribution interval is located at If it is outside the range, it means that the machine tool spindle has a fault. The set number of times (10 times) can be adjusted according to actual needs.
[0089] In order to verify whether the normal distribution residual interval (also called the standard normal distribution interval) can be used to predict in advance whether a machine tool spindle failure will occur, this example selects 3000 vibration data and temperature data before the machine tool spindle failure for analysis, with a sampling interval of 3 seconds. The vibration prediction residual of the SSA-CNN-LSTM model changes as shown in the following figure: Figure 11 As shown, the temperature prediction residual changes as Figure 12 shown.
[0090] from Figure 11 As can be seen from the figure, the vibration residual exceeds the threshold at 2400 sampling points and continues to exceed the threshold at the subsequent 600 sampling points. It can be judged that the vibration residual can detect potential faults of the machine tool spindle 30 minutes in advance.
[0091] Depend on Figure 12 It can be seen from the figure that the temperature residual exceeds the threshold at 2200 sampling points and continues to exceed the threshold for the subsequent 800 sampling points. It can be judged that the temperature residual can detect potential faults of the machine tool spindle 35 minutes in advance.
[0092] In summary, combined with the results of vibration residuals and temperature residuals, the method of the present invention can detect potential faults of the machine tool spindle at least 30 minutes in advance, verifying the feasibility of the prediction method of the present invention.
[0093] Example 5: See also Figure 13 As shown, the present invention also provides an electronic device 100 for a machine tool spindle fault prediction method; the electronic device 100 includes a memory 101, at least one processor 102, a computer program 103 stored in the memory 101 and executable on the at least one processor 102, and at least one communication bus 104.
[0094] The memory 101 can be used to store the computer program 103. The processor 102 implements the steps of the machine tool spindle fault prediction method described in Example 1 by running or executing the computer program stored in the memory 101 and calling the data stored in the memory 101. The memory 101 can mainly include a program storage area and a data storage area. The program storage area can store an operating system, at least one application required for a function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data (such as audio data) created based on the use of the electronic device 100. In addition, the memory 101 can include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device.
[0095] The at least one processor 102 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The processor 102 may be a microprocessor or any conventional processor, etc. The processor 102 is the control center of the electronic device 100 and connects various parts of the entire electronic device 100 using various interfaces and lines.
[0096] The memory 101 in the electronic device 100 stores a plurality of instructions to implement a method for predicting a machine tool spindle fault. The processor 102 can execute the plurality of instructions to implement: Acquire vibration data near the spindle bearing and temperature data on the spindle surface, and perform standardization on all acquired data to obtain standardized data; Divide the standardized data into time windows to obtain standardized data in several time windows; Use the standardized data of several time windows to construct training sets and test sets; The CNN model is used to extract feature information from the standardized data of several time windows, and the SSA algorithm is used to optimize the hyperparameters of the LSTM model to obtain the optimized LSTM model. The optimized LSTM model is trained based on the training set, and the training results of the optimized LSTM model are tested based on the test set to obtain the trained optimized LSTM model; The feature information from the standardized data of several time windows is input into the optimized LSTM model for prediction, and the vibration data and temperature data prediction results for the future time are obtained; Subtract the predicted results of the vibration data and temperature data at the future moment from the actual values in the test set to obtain residual data, and perform normal analysis on the residual data to obtain a standard normal distribution interval; According to the size relationship between the standard normal distribution interval and the set fault threshold, it is judged whether the machine tool spindle has a fault, and the machine tool spindle fault prediction result is obtained.
[0097] Example 5: If the module / unit integrated in the electronic device 100 is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the process in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device that can carry the computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory and read-only memory (ROM, Read-Only Memory).
[0098] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Thus, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0099] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowcharts and / or block diagrams. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0100] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0101] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0102] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents. Any modification or equivalent replacement that does not depart from the spirit and scope of the present invention should be covered by the scope of protection of the claims of the present invention.
Claims
1. A method for predicting a machine tool spindle fault, characterized in that: The following steps are involved: Acquire vibration data near the spindle bearing and temperature data on the spindle surface, and perform standardization on all acquired data to obtain standardized data; Divide the standardized data into time windows to obtain standardized data in several time windows; Use the standardized data of several time windows to construct training sets and test sets; The CNN model is used to extract feature information from the standardized data of several time windows, and the sparrow search algorithm is used to optimize the hyperparameters of the LSTM model to obtain the optimized LSTM model. The optimized LSTM model is trained based on the training set, and the training results of the optimized LSTM model are tested based on the test set to obtain the trained optimized LSTM model; The feature information from the standardized data of several time windows is input into the optimized LSTM model for prediction, and the vibration data and temperature data prediction results for the future time are obtained; Subtract the predicted results of the vibration data and temperature data at the future moment from the actual values in the test set to obtain residual data, and perform normal analysis on the residual data to obtain a standard normal distribution interval; According to the size relationship between the standard normal distribution interval and the set fault threshold, it is judged whether the machine tool spindle has a fault, and the machine tool spindle fault prediction result is obtained.
2. The machine tool spindle fault prediction method according to claim 1, characterized in that: The calculation formula for normalization is: in, The vibration data near the spindle bearing and the temperature data on the spindle surface after normalization are: are the original vibration data near the spindle bearing and the temperature data on the spindle surface, is the minimum value of the original vibration data near the spindle bearing and the temperature data on the spindle surface, It is the maximum value of the original vibration data near the spindle bearing and the temperature data on the spindle surface.
3. The machine tool spindle fault prediction method according to claim 1, characterized in that: In the step of dividing the standardized data into time windows to obtain standardized data in a plurality of time windows, a sliding window method is specifically used to divide the standardized data into time windows to obtain standardized data in a plurality of time windows.
4. The machine tool spindle fault prediction method according to claim 1, characterized in that: The hyperparameters include learning rate, regularization coefficient and number of hidden layer nodes.
5. The machine tool spindle fault prediction method according to claim 1, characterized in that: In the step of inputting the characteristic information of the standardized data of several time windows into the optimized LSTM model for prediction to obtain the prediction results of the vibration data and temperature data at the future time, the mean absolute error, mean square error, root mean square error, remaining prediction residual and fit are also used to evaluate the prediction results of the vibration data and temperature data at the future time.
6. The machine tool spindle fault prediction method according to claim 5, characterized in that: The formula for calculating the mean absolute error is: in, is the mean absolute error, express i The actual value at the moment, express i The average value of the actual value at the moment, i Indicates the moment, is the number of data sets; The formula for calculating the mean square error is: in, is the mean square error, express i The actual value at the moment, express i The average value of the actual value at the moment, i Indicates the moment, is the number of data sets; The formula for calculating the root mean square error is: in, is the root mean square error, t Indicates starting from the first value. express i The actual value at the moment, express i The average value of the actual value at the moment, i Indicates the moment, is the number of data sets; The remaining prediction residuals are calculated as: in, is the remaining prediction residual, y max is the maximum value of the vibration data and temperature data, y min is the minimum value of the vibration data and temperature data, is the root mean square error; The calculation formula for the goodness of fit is: in, is the fit, express i The actual value at the moment, express i The average value of the actual value at the moment, i represents the moment, is the number of data sets.
7. The machine tool spindle fault prediction method according to claim 1, characterized in that: The method of determining whether a machine tool spindle fails based on the size relationship between the standard normal distribution interval and the set fault threshold value and obtaining a machine tool spindle fault prediction result specifically includes: When the standard normal distribution interval is set several times in a row Outside the range, it means that the machine tool spindle has a fault, represents the mean of the residual data, Represents standard deviation.
8. A machine tool spindle fault prediction system, characterized in that: It includes data acquisition module, time window division module, data set construction module, feature information extraction module, model training module, vibration data and temperature data prediction module, residual data acquisition module and fault judgment module; The data acquisition module is used to acquire vibration data near the spindle bearing and temperature data on the spindle surface, and perform standardization processing on all acquired data to obtain standardized data; The time window division module is used to divide the standardized data into time windows to obtain standardized data of several time windows; The data set construction module is used to construct a training set and a test set using the standardized data of several time windows; The feature information extraction module is used to extract feature information from the standardized data of several time windows using a CNN model, and optimize the hyperparameters of the LSTM model using a sparrow search algorithm to obtain an optimized LSTM model; The model training module is used to train the optimized LSTM model based on the training set, and test the optimized LSTM model training results based on the test set to obtain a trained optimized LSTM model; The vibration data and temperature data prediction module is used to input the characteristic information of the standardized data of several time windows into the optimized LSTM model for prediction, and obtain the vibration data and temperature data prediction results at the future time; The residual data acquisition module is used to perform a subtraction between the predicted results of the vibration data and temperature data at a future moment and the actual values in the test set to obtain residual data, and perform a normal analysis on the residual data to obtain a standard normal distribution interval; The fault judgment module is used to judge whether a machine tool spindle has a fault based on the size relationship between the standard normal distribution interval and the set fault threshold, and obtain a machine tool spindle fault prediction result.
9. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the machine tool spindle fault prediction method according to any one of claims 1 to 7 are implemented.
10. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the machine tool spindle fault prediction method according to any one of claims 1 to 7 are implemented.