Servo motor fault diagnosis method and device and storage medium
Through compound neural network and metric learning technology, the problem of poor generalization ability of the servo motor fault diagnosis model is solved, high-accuracy fault diagnosis in a small sample environment is achieved, and the generalization ability and computing efficiency of the model are improved.
Patent Information
- Application Number
- CN202411273111.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-12
- Publication Date
- 2024-10-18
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing servo motor fault diagnosis models have poor generalization capabilities, resulting in inaccurate diagnosis results. Especially in environments with a small number of samples, insufficient model training leads to underfitting.
Using a compound neural network, integrating convolutional neural network and long-short-term memory neural network, combined with the weight sharing mechanism and metric learning technology of the twin network, feature extraction and similarity calculation are performed through paired time-frequency images to form a servo based on metric learning Motor fault diagnosis model.
Effectively learning sample features in a small sample environment improves the model's generalization ability and fault diagnosis accuracy, avoids the deep learning model's dependence on massive data, and improves computing speed and feature extraction capabilities.
Smart Images

Figure CN118799654A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of motor fault diagnosis, and in particular to a servo motor fault diagnosis method, device and storage medium. Background Art
[0002] Servo motors, as the main power source for mechanical equipment, can provide precise motion control for various types of equipment. Due to long-term operation, improper use, or workmanship defects, servo motors can cause various faults. Algorithm models based on deep learning have gradually become an important means of mechanical equipment fault diagnosis, but deep learning algorithms rely on a large amount of sample data. Fault data collection for mechanical equipment is particularly difficult due to the complex operating environment of the equipment, long-term operation in a faulty state, and the unrealistic frequent shutdown to collect fault signals. The existing servo motor fault diagnosis model has poor generalization ability and inaccurate diagnostic results.
[0003] Therefore, how to improve the generalization ability of the model to ensure diagnostic accuracy has become a technical problem that needs to be solved urgently. Summary of the invention
[0004] The present invention aims to solve at least one of the technical problems existing in the prior art or related technology, and discloses a servo motor fault diagnosis method, device and storage medium, which can effectively learn sample features in a small sample environment, improve the generalization ability of the model, and thus improve the accuracy of fault diagnosis.
[0005] The first aspect of the present invention discloses a servo motor fault diagnosis method, including: fusing a convolutional neural network and a long short-term memory neural network to form a composite neural network, based on the weight sharing mechanism of the twin network, two identical composite neural networks are combined into a feature extraction network to extract features of the time-frequency image of the input servo motor vibration signal to obtain a first feature map and a second feature map; calculating the similarity between the first feature map and the second feature map based on a distance formula; converting the similarity calculation result into a probability distribution of multiple categories through a Softmax classifier to classify the samples, thereby forming a servo motor fault diagnosis model based on metric learning; using paired time-frequency images as a training set to train the model; inputting the time-frequency image to be detected into the trained model to obtain a fault type result.
[0006] In this technical solution, based on the weight sharing mechanism and metric learning technology of the twin network, samples are sent to the network in pairs, and the similarity between the two samples is calculated to determine whether they are samples of the same type, completing the training of the model. This mechanism can effectively solve the problems of underfitting and poor generalization ability caused by insufficient model training due to the small number of samples. The composite neural network is a feature extraction model after the fusion of the convolutional neural network and the long short-term memory neural network, so that the limited model features can be fully utilized. The effective combination of the convolutional neural network and the long short-term memory neural network can make full use of their respective advantages. After the initial feature extraction of the convolutional neural network, the long short-term memory neural network further learns the temporal correlation characteristics of the data, so that the model improves the accuracy while ensuring the calculation speed.
[0007] According to the servo motor fault diagnosis method disclosed in the present invention, preferably, it also includes: sampling the original vibration signal through a sensor installed on the motor housing to obtain a sampling signal; standardizing the sampling signal; and obtaining a time-frequency image of the sampling signal through continuous wavelet transform.
[0008] According to the servo motor fault diagnosis method disclosed in the present invention, preferably, the feature extraction network specifically includes a first convolutional layer, a first normalization layer, a first pooling layer, a first long short-term memory layer, a second convolutional layer, a second normalization layer, a second pooling layer, a second long short-term memory layer and a fully connected layer; the first feature map is obtained via the first convolutional layer, the first normalization layer, the first pooling layer, the first long short-term memory layer and the fully connected layer; the second feature map is obtained via the second convolutional layer, the second normalization layer, the second pooling layer, the second long short-term memory layer and the fully connected layer.
[0009] According to the servo motor fault diagnosis method disclosed in the present invention, preferably, the calculation process of the feature extraction network includes: inputting paired time-frequency images into two composite neural networks; extracting the spatial features of the time-frequency images through a convolutional layer to obtain two sets of different feature maps; using batch normalization to calculate the mean and variance of the feature maps, and standardizing the feature maps; performing downsampling operations through a pooling layer, and using the output of the pooling layer as the input of a long short-term memory layer to further extract timing features.
[0010] In this technical solution, after the time-frequency images are input into the twin network in pairs, the spatial features of the data are first extracted through the convolution layer to obtain two different sets of feature maps. The mean and variance of the feature maps are calculated using batch normalization, and the formula Normalize the feature map, where x is the input signal, is the mean, is the variance, It is a very small number to ensure that the denominator is not zero, and then the downsampling operation is performed through the pooling layer. The output of the pooling layer is used as the input of the long short-term memory layer to further extract the time series characteristics of the data.
[0011] According to the servo motor fault diagnosis method disclosed in the present invention, preferably, the calculation process of the long short-term memory network layer of the composite neural network specifically includes: selectively forgetting the input data through a forget gate: ; Calculate the input gate result: , ; Update the long-term memory unit according to the forget gate, input gate and candidate memory cells: ; Calculate the value of the output gate: ; Update the hidden state according to the updated values of the long-term memory unit and the output gate: ; In the above formula, , , , , and They represent the forget gate, input gate, candidate memory cell, long memory unit, output gate and hidden unit respectively; t and t-1 represent the current moment and the previous moment respectively; and Represent the output at the current moment and the previous moment respectively; is the input at the current moment; Sigmoid and tanh are activation functions; , , and are the weights of the forget gate, input gate, candidate memory cell, and output gate respectively; , , and They are the bias items of the forget gate, input gate, candidate memory cells and output gate respectively.
[0012] According to the servo motor fault diagnosis method disclosed in the present invention, preferably, the step of calculating the similarity between the first feature map and the second feature map based on the distance formula specifically includes: calculating the Euclidean distance between the two feature maps corresponding to the first feature map and the second feature map; reducing the Euclidean distance to between (0,1] by the Euclidean distance reduction formula; calculating the cosine similarity of the two feature maps; using the calculation result after the Euclidean distance reduction as the weight coefficient of the cosine similarity and multiplying it with the calculation result of the cosine similarity to obtain the similarity between the first feature map and the second feature map.
[0013] According to the servo motor fault diagnosis method disclosed in the present invention, preferably, it also includes: using contrast loss as the loss function of the servo motor fault diagnosis model, calculating the error, and minimizing the contrast loss function through a back propagation algorithm.
[0014] According to the servo motor fault diagnosis method disclosed in the present invention, preferably, the original vibration signal of the servo motor is a one-dimensional vibration signal, and several groups of different types of one-dimensional vibration signals are converted into time-frequency images by continuous wavelet transform with morlet as the wavelet basis with 1024 data points as one sample; different samples in the same group constitute positive sample pairs, and sample pairs composed of samples from different groups are negative sample pairs; the constructed sample pairs are divided into training sets and test sets in a ratio of 8:2.
[0015] The second aspect of the present invention discloses a servo motor fault diagnosis device, comprising: a memory for storing program instructions; a processor for calling the program instructions stored in the memory to implement a servo motor fault diagnosis method as any of the above technical solutions.
[0016] A third aspect of the present invention discloses a computer-readable storage medium, which stores program codes, and the program codes are used to implement a servo motor fault diagnosis method as described in any of the above technical solutions.
[0017] The beneficial effects of the present invention include at least: the present invention avoids the limitation of deep learning models relying on massive training data based on metric learning and the weight sharing mechanism of twin networks, and makes the similarity calculation no longer affected by the dimension by combining Euclidean distance with cosine similarity, while ensuring the model calculation speed, it improves the model's feature extraction and classification capabilities under limited data. The feature extraction network of the present invention adopts a composite structure of convolutional neural network and long short-term memory neural network, so that the model can fully extract features from limited samples and complete fault identification under a small number of samples and similar sample features. The method provided by the present invention can effectively learn sample features in a small number of sample environments, improve the generalization ability of the model, and thus improve the accuracy of fault diagnosis. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 A schematic flow chart of a servo motor fault diagnosis method according to an embodiment of the present invention is shown.
[0019] Figure 2 The overall architecture diagram of a servo motor fault diagnosis model according to an embodiment of the present invention is shown.
[0020] Figure 3 A schematic diagram of a feature extraction network according to an embodiment of the present invention is shown.
[0021] Figure 4A diagram showing the internal structure of a long short-term memory neural network according to an embodiment of the present invention is shown.
[0022] Figure 5 A schematic block diagram of a servo motor fault diagnosis device according to an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0023] In order to more clearly understand the above-mentioned objects, features and advantages of the present invention, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0024] In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention may also be implemented in other ways different from those described herein. Therefore, the present invention is not limited to the specific embodiments disclosed below.
[0025] like Figure 1 As shown, according to one embodiment of the present invention, the servo motor fault diagnosis method disclosed in the present invention includes: Step S101, feature extraction: a convolutional neural network and a long short-term memory neural network are integrated to form a composite neural network. Based on the weight sharing mechanism of the twin network, two identical composite neural networks are combined into a feature extraction network to extract features from the time-frequency image of the input servo motor vibration signal to obtain a first feature map and a second feature map. Step S102, similarity calculation: calculating the similarity between the first feature map and the second feature map based on a distance formula; Step S103, sample classification: converting the similarity calculation results into probability distributions of multiple categories through a Softmax classifier to classify the samples, thereby forming a servo motor fault diagnosis model based on metric learning; Step S104, model training: using paired time-frequency images as training sets to train the model; Step S105, fault detection: input the time-frequency image to be detected into the trained model to obtain the fault type result.
[0026] In this embodiment, based on the fusion of convolutional neural network and long short-term memory neural network, the network model can not only capture the spatial characteristics of the servo motor vibration signal, but also learn the potential temporal correlation in the signal. The twin network is used as the main architecture, and the composite neural network (convolutional neural network + long short-term memory neural network) is used as a sub-network of the twin network. Through the weight sharing mechanism and metric learning mechanism of the twin network, the model can effectively learn the sample characteristics in an environment with a small number of samples. Metric learning allows the model to pay more attention to the similarities between samples, greatly reducing the dependence on the number of samples.
[0027] According to the above embodiment, preferably, it also includes: sampling the original vibration signal through a sensor installed on the motor housing to obtain a sampled signal; standardizing the sampled signal; and acquiring a time-frequency image of the sampled signal through continuous wavelet transform.
[0028] According to the above embodiment, preferably, the feature extraction network specifically includes a first convolutional layer, a first normalization layer, a first pooling layer, a first long short-term memory layer, a second convolutional layer, a second normalization layer, a second pooling layer, a second long short-term memory layer and a fully connected layer; the first feature map is obtained via the first convolutional layer, the first normalization layer, the first pooling layer, the first long short-term memory layer and the fully connected layer; the second feature map is obtained via the second convolutional layer, the second batch normalization layer, the second pooling layer, the second long short-term memory layer and the fully connected layer.
[0029] According to the above embodiment, preferably, the calculation process of the feature extraction network includes: inputting paired time-frequency images into two composite neural networks; extracting the spatial features of the time-frequency images through a convolutional layer to obtain two sets of different feature maps; using batch normalization to calculate the mean and variance of the feature maps, and standardizing the feature maps; performing downsampling operations through a pooling layer, and using the output of the pooling layer as the input of the long short-term memory layer to further extract temporal features.
[0030] According to the above embodiment, preferably, the calculation process of the long short-term memory network layer of the composite neural network specifically includes: selectively forgetting the input data through the forget gate; calculating the input gate result; updating the long-term memory unit according to the forget gate, the input gate and the candidate memory cell; calculating the value of the output gate; updating the hidden state according to the updated long-term memory unit and the value of the output gate; According to the above embodiment, preferably, the similarity calculation step specifically includes: calculating the Euclidean distance between the two feature maps corresponding to the first feature map and the second feature map; reducing the Euclidean distance to between (0,1] by the Euclidean distance reduction formula; calculating the cosine similarity of the two feature maps; using the calculation result after the Euclidean distance reduction as the weight coefficient of the cosine similarity and multiplying it with the calculation result of the cosine similarity to obtain the similarity between the first feature map and the second feature map.
[0031] According to the above embodiment, preferably, it also includes: using contrast loss as the loss function of the servo motor fault diagnosis model, calculating the error, and minimizing the contrast loss function through a back propagation algorithm.
[0032] like Figure 2 , Figure 3 and Figure 4 According to another embodiment of the present invention, a specific implementation process of a servo motor fault diagnosis method is also disclosed, including: Step 1, sampling the original vibration signal through the sensor installed on the motor housing.
[0033] Step 2: normalize the original signal and convert it into a time-frequency image through continuous wavelet transform with Morlet as the wavelet basis, and divide the time-frequency image into a training set and a test set in proportion.
[0034] Step 2 specifically includes: 1) Take n groups of different types of one-dimensional vibration signals and take 1024 data points as one sample, and transform them into time-frequency images through continuous wavelet transform with Morlet as wavelet basis; 2) Assume that the samples are divided into n groups, each group contains m samples, and the n groups of time-frequency images of each group of m samples are combined in pairs to construct data sample pairs, where the sample pairs constructed by the same group of samples are positive samples, and the sample pairs constructed by different groups of samples are negative sample pairs; The number of positive samples is: The number of negative samples is: ; 3) Divide the constructed sample pairs into training set and test set in a ratio of 8:2.
[0035] Step 3, construct a servo motor fault diagnosis model based on metric learning: the feature extraction part of the model architecture is a composite neural network composed of a convolutional neural network and a long short-term memory network, and the similarity measurement part is a composite operation of Euclidean distance and cosine similarity, where the composite neural network is a feature extraction model after the convolutional neural network and the long short-term memory neural network are fused.
[0036] Step 3 specifically includes: 1) If Figure 2 As shown in the figure, the servo motor fault diagnosis model based on metric learning includes three parts: feature extraction, similarity calculation and sample classification. The data input is a paired time-frequency image. 2) The network structure of the convolutional long-term and short-term composite feature extraction network is as follows Figure 3 As shown, it includes convolution layer 1, batch normalization layer 1, pooling layer 1, convolution layer 2, batch normalization layer 2, pooling layer 2, LSTM layer 1, LSTM layer 2 and a fully connected layer; two samples are input into the network in pairs, and the first feature map is obtained after the convolution operation. The feature map is normalized by Batch Normalization, and the batch normalized data is input into the ReLU activation function to alleviate the output of the activation function from falling into the gradient saturation area, and nonlinear factors are introduced into the feature map. The feature map is downsampled after pooling, and the spatial feature extraction of the data is completed again through the same calculation.
[0037] 3) The output of the convolutional neural network is used as the input of the long short-term memory neural network. The internal structure of the long short-term memory neural network is as follows: Figure 4 As shown in the figure, the long short-term memory module is used to complete the temporal association of data and further extract the temporal characteristics of the data. The calculation process of the long short-term memory neural network includes: Selectively forget the input data through the forget gate: ; Calculate the input gate result: ; Update candidate memory cell status: ; Update the long-term memory unit according to the forget gate, input gate and candidate memory cells: ; Calculate the value of the output gate: ; Update the hidden state according to the updated values of the long-term memory unit and the output gate: ; In the above formula, , , , , and They represent the forget gate, input gate, candidate memory cell, long memory unit, output gate and hidden unit respectively; t and t-1 represent the current moment and the previous moment respectively; and Represent the output at the current moment and the previous moment respectively; is the input at the current moment; Sigmoid and tanh are activation functions; , , and are the weights of the forget gate, input gate, candidate memory cell, and output gate respectively; , , and They are the bias items of the forget gate, input gate, candidate memory cells and output gate respectively.
[0038] 4) Through the idea of metric learning, the similarity of two feature maps is calculated by combining Euclidean distance with cosine similarity. The calculation process includes: Assume that the feature points between two samples are , , calculate the Euclidean distance between two feature maps : ; Use the Euclidean distance reduction formula to reduce it to between (0,1]: ; Calculate the cosine similarity cosβ of two feature maps: ; The calculation result after Euclidean distance reduction Multiply as the weight coefficient of cosine similarity: , Get the final similarity calculation result.
[0039] 5) Select contrast loss as the loss function of the network model, calculate the error, and minimize the contrast loss function through the back propagation algorithm. The formula is:
[0040] in, is the input sample, is the similarity label, is the set threshold, is the Euclidean distance (two-norm) between two samples in the feature space, is the calculation result of the contrast loss function. When , it means that the two samples are similar. Similarly, when , it means the two samples are not similar.
[0041] Step 4: Use 80% of all data as training samples to train the algorithm model.
[0042] Step 5: After the model training is completed, the remaining 20% is used as the test sample to complete the model testing.
[0043] like Figure 5 As shown, according to another embodiment of the present invention, a servo motor fault diagnosis device 500 is also disclosed, including: a memory 501, used to store program instructions; a processor 502, used to call the program instructions stored in the memory to implement the servo motor fault diagnosis method as described in the above embodiment.
[0044] According to another embodiment of the present invention, a computer-readable storage medium is disclosed. The computer-readable storage medium stores program codes. The program codes are used to implement the servo motor fault diagnosis method as described in the above embodiment.
[0045] According to the above embodiments, the architecture adopted by the fault diagnosis model proposed by the present invention avoids the limitation of deep learning models relying on a large amount of data through the weight sharing mechanism and the metric learning idea. The feature extraction network adopts the composite structure of convolutional neural network and long short-term memory neural network, so that the model can fully extract features from limited samples and complete fault identification under a small number of samples and similar sample features. The advantages of convolutional neural network and long short-term memory neural network are comprehensively utilized, and the similarity calculation is no longer affected by the dimension by combining Euclidean distance with cosine similarity. While ensuring the model calculation speed, the model's feature extraction and classification capabilities under limited data are improved.
[0046] All or part of the steps in the various methods of the above embodiments can be completed by controlling the relevant hardware through a program, and the program can be stored in a readable storage medium, and the storage medium includes a read-only memory (ROM), a random access memory (RAM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), a one-time programmable read-only memory (OTPROM), an electronically erasable programmable read-only memory (EEPROM), a compact disc (CD-ROM) or other optical disc storage, magnetic disk storage, magnetic tape storage, or any other readable medium that can be used to carry or store data.
[0047] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A servo motor fault diagnosis method, characterized in that: include: A convolutional neural network and a long short-term memory neural network are integrated to form a composite neural network. Based on the weight sharing mechanism of the twin network, two identical composite neural networks are combined into a feature extraction network to extract features from the time-frequency image of the input servo motor vibration signal to obtain a first feature map and a second feature map. Calculating the similarity between the first feature map and the second feature map based on a distance formula; The similarity calculation results are converted into probability distributions of multiple categories through the Softmax classifier to classify the samples, thus forming a servo motor fault diagnosis model based on metric learning; Paired time-frequency images are used as training sets to train the model; The time-frequency image to be detected is input into the trained model to obtain the fault type result.
2. The servo motor fault diagnosis method according to claim 1, characterized in that: Also includes: The original vibration signal is sampled by a sensor installed on the motor housing to obtain a sampling signal; Performing standardization processing on the sampled signal; The time-frequency image of the sampling signal is obtained through continuous wavelet transform.
3. The servo motor fault diagnosis method according to claim 1, characterized in that: The feature extraction network specifically includes a first convolutional layer, a first normalization layer, a first pooling layer, a first long short-term memory layer, a second convolutional layer, a second normalization layer, a second pooling layer, a second long short-term memory layer and a fully connected layer; the first feature map is obtained via the first convolutional layer, the first normalization layer, the first pooling layer, the first long short-term memory layer and the fully connected layer; The second feature map is obtained via the second convolutional layer, the second batch normalization layer, the second pooling layer, the second long short-term memory layer and the fully connected layer.
4. The servo motor fault diagnosis method according to claim 1, characterized in that: The calculation process of the feature extraction network includes: Paired time-frequency images are input into two composite neural networks; The spatial features of the time-frequency image are extracted through a convolutional layer to obtain two sets of different feature maps; Use batch normalization to calculate the mean and variance of the feature map and standardize the feature map; The downsampling operation is performed through the pooling layer, and the output of the pooling layer is used as the input of the long short-term memory layer to further extract the temporal features.
5. The servo motor fault diagnosis method according to claim 4, characterized in that: The calculation process of the long short-term memory network layer of the composite neural network specifically includes: Selectively forget the input data through the forget gate: ; Calculate the input gate result: ; ; Update the long-term memory unit according to the forget gate, input gate and candidate memory cells: ; Calculate the value of the output gate: ; Update the hidden state according to the updated values of the long-term memory unit and the output gate: ; In the above formula, , , , , and They represent the forget gate, input gate, candidate memory cell, long memory unit, output gate and hidden unit respectively; t and t-1 represent the current moment and the previous moment respectively; and Represent the output at the current moment and the previous moment respectively; is the input at the current moment; Sigmoid and tanh are activation functions; , , and are the weights of the forget gate, input gate, candidate memory cell, and output gate respectively; , , and They are the bias items of the forget gate, input gate, candidate memory cells and output gate respectively.
6. The servo motor fault diagnosis method according to claim 1, characterized in that: The step of calculating the similarity between the first feature map and the second feature map based on the distance formula specifically includes: Calculating the Euclidean distance between two feature maps corresponding to the first feature map and the second feature map; The Euclidean distance reduction formula is used to reduce the Euclidean distance to between (0,1]; Calculate the cosine similarity of two feature maps; The calculation result after the Euclidean distance reduction is used as the weight coefficient of the cosine similarity and multiplied by the calculation result of the cosine similarity to obtain the similarity between the first feature map and the second feature map.
7. The servo motor fault diagnosis method according to any one of claims 1 to 6, characterized in that: It also includes: using contrast loss as the loss function of the servo motor fault diagnosis model, calculating the error, and minimizing the contrast loss function through a back propagation algorithm.
8. The servo motor fault diagnosis method according to claim 2, characterized in that: The original vibration signal of the servo motor is a one-dimensional vibration signal. Several groups of different types of one-dimensional vibration signals are converted into time-frequency images through continuous wavelet transform with morlet as the wavelet basis, with 1024 data points as one sample. Different samples in the same group constitute positive sample pairs, and sample pairs composed of samples from different groups are negative sample pairs. The constructed sample pairs are divided into training set and test set in a ratio of 8:
2.
9. A servo motor fault diagnosis device, characterized in that: include: A memory for storing program instructions; A processor, configured to call the program instructions stored in the memory to implement the servo motor fault diagnosis method according to any one of claims 1 to 8.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a program code, and the program code is used to implement the servo motor fault diagnosis method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Rolling bearing fault diagnosis method fusing attention mechanism and twin network structure
CN113191215A
Analog circuit fault diagnosis method based on one-dimensional convolution long short-term memory network
CN114818579A
Mechanical vibration fault diagnosis method based on deep learning
CN116592993A
Hypersonic flight vehicle executing mechanism fault diagnosis method based on twin neural network
CN116756652A
Cited By
Motor fault diagnosis method and system based on Chladni feature matching
CN121391726A
