Motor speed abnormity fault diagnosis method based on simulation data and CNN-GAP-CBAM model
Through the motor speed abnormality fault diagnosis method based on simulation data and CNN-GAP-CBAM model, the CBAM attention mechanism and CNN-GAP neural network are used to solve the problem of high data set requirements in the existing technology and difficult to collect fault data, which improves the accuracy and reliability of fault diagnosis, especially the feature capture capability in high-dimensional data environments.
Patent Information
- Application Number
- CN202510583118.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-07
- Publication Date
- 2025-08-08
AI Technical Summary
The existing motor fault diagnosis methods based on deep learning have high requirements for data sets, but fault data is difficult to effectively collect in actual production, resulting in poor diagnostic effects and insufficient reliability, especially under the complex characteristics of high-dimensional data, which cannot fully capture key feature information.
The motor speed abnormality fault diagnosis method based on simulation data and CNN-GAP-CBAM model is adopted. By constructing a fault diagnosis model including CBAM attention mechanism and CNN-GAP neural network, simulation data generation and preprocessing technology are used, combined with wavelet threshold denoising, data segmentation and enhancement, feature extraction capabilities are improved.
It significantly improves the accuracy and reliability of fault diagnosis, solves the problem of high data set requirements, can effectively deal with the complex characteristics of high-dimensional data, and improves the ability to capture fault characteristics and comprehensive diagnosis results.
Smart Images

Figure CN120448918A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of motor fault diagnosis, and specifically provides a motor speed abnormality fault diagnosis method based on simulation data and a CNN-GAP-CBAM model. Background Art
[0002] In today's rapidly developing manufacturing environment, welding robots, as a vital component of industrial automation, have been widely used in a variety of fields, including automotive, aerospace, and shipbuilding. Welding robot joints are primarily driven by motors, and industrial robot manufacturers such as ABB, KUKA, and FANUC generally use permanent magnet synchronous motors (PMSMs) as joint drive motors. However, welding robot motors are inevitably susceptible to various faults during long-term operation, with overspeed being a significant factor, and in severe cases, even causing casualties. Therefore, timely diagnosis of overspeed faults is crucial for ensuring the safe operation of welding robots.
[0003] Against the backdrop of the rapid development of the Industrial Internet, computer technology, and artificial intelligence, traditional manual fault diagnosis is gradually being replaced by intelligent fault diagnosis. Data-driven fault diagnosis methods are becoming a key solution for fault diagnosis in rotating machinery, such as motors. By analyzing and modeling large amounts of historical fault data, data-driven fault diagnosis methods can automatically classify and diagnose faults. Traditional data-driven methods typically rely on feature extraction from raw data and then classify faults using algorithms such as support vector machines, multi-layer perceptrons, or decision trees.
[0004] Convolutional neural networks, due to their superior feature extraction capabilities, have become an indispensable research tool for data-driven fault diagnosis. However, existing deep learning-based fault diagnosis methods have high dataset requirements and require large amounts of data for model training. However, actual production fault data is scarce, making deep learning-based models prone to overfitting and limited generalization. Summary of the Invention
[0005] In view of this, the purpose of the present invention is to provide a motor speed abnormality fault diagnosis method based on simulation data and CNN-GAP-CBAM model, which can solve the problem that the existing deep learning-based fault diagnosis method has high requirements for the data set and the fault data may be difficult to collect effectively in actual production, and can effectively deal with the complex characteristics of high-dimensional data, the inability to fully capture the key feature information related to the fault, resulting in poor diagnostic effect, and poor comprehensiveness and reliability of the diagnostic results.
[0006] In order to achieve the above object, the present invention provides the following technical solutions:
[0007] A motor speed abnormality fault diagnosis method based on simulation data and CNN-GAP-CBAM model includes the following steps:
[0008] Step 1: Generate motor fault simulation data
[0009] A simulation model of a permanent magnet synchronous motor was established to simulate normal operating conditions and overspeed fault conditions. Simulation data containing voltage and current signals was generated through MATLAB / Simulink simulation and compared with the actual collected data to ensure the validity of the simulation model.
[0010] Step 2: Fault data preprocessing
[0011] After integrating the simulated data and the actual data using data alignment, the integrated data is preprocessed using denoising, segmentation, normalization, and data enhancement to obtain the training data set;
[0012] Step 3: Build a CNN-GAP-CBAM fault diagnosis model
[0013] The CNN-GAP-CBAM fault diagnosis model includes an input layer, a feature extraction layer, a global average pooling layer, and an output layer. The feature extraction layer contains at least three convolutional layers, each of which is sequentially connected to a CBAM attention module and a pooling layer. The CBAM module includes a channel attention submodule and a spatial attention submodule, which respectively generate channel and spatial weights through global pooling, a fully connected layer, and convolution operations, and perform channel-by-channel and pixel-by-pixel weighted fusion with the input feature map.
[0014] Step 4: Model training and fault classification
[0015] The preprocessed data is input into the CNN-GAP-CBAM fault diagnosis model for training, and features are compressed through the global average pooling layer to output the fault classification results;
[0016] Step 5: Diagnosis of abnormal motor speed fault
[0017] The motor operation data including voltage and current signals are collected, and the trained CNN-GAP-CBAM fault diagnosis model is used to perform real-time diagnosis of motor speed anomalies.
[0018] Furthermore, in step 1, the method for simulating the operating condition of the overspeed fault state is: adding a speed step signal to simulate the overspeed current signal under normal circumstances.
[0019] Furthermore, in step 2, the data denoising method steps are as follows:
[0020] 21) Using wavelet threshold denoising algorithm to denoise the original signal s=[s0,s1,…,sn―1 ] Perform L-layer discrete wavelet transform to obtain the approximate coefficient α of each layer L and detail coefficient
[0021] 22) Estimating the noise of the data:
[0022]
[0023] Where: σ is the estimated value of the noise standard deviation; median is the absolute median deviation; d1 is the detail coefficient of the first layer;
[0024] 23) Calculate the noise threshold:
[0025]
[0026] Where: N is the original signal length; T is the universal threshold of noise;
[0027] Get the soft and hard thresholds for noise:
[0028] Soft threshold: d′ j.k =sign(d j,k )·(|d j,k |―T) +
[0029] Hard Threshold:
[0030] Where: d j,k is the original detail coefficient of the jth layer and the kth position; d′ j.k is the original detail coefficient after threshold processing;
[0031] 24) Reconstruct the data signal using the approximate coefficient α L and the processed detail coefficient Perform inverse discrete wavelet transform to obtain the denoised signal s′.
[0032] Furthermore, in step 2, the data segmentation method is: segmentation is performed using a sliding window method according to a set length to facilitate model input; the data normalization method is: normalization is performed on the data using a global normalization algorithm, and the normalized data range is [0,1]; the data enhancement method is: increasing data diversity through methods including time series scaling and amplitude perturbation to improve the model generalization ability.
[0033] Furthermore, in step 3, the CNN-GAP-CBAM fault diagnosis model includes a CNN-GAP neural network, and the CNN-GAP neural network includes:
[0034] The input layer is used to reconstruct data and convert one-dimensional time series data into a two-dimensional feature matrix;
[0035] CNN feature extraction layer, used to extract features from two-dimensional matrices to obtain multi-dimensional feature maps;
[0036] GAP global average pooling layer, used to flatten the multi-dimensional feature map into a one-dimensional vector array;
[0037] The SOFTMAX output layer is used to reduce the dimension of the one-dimensional vector output by the GAP layer.
[0038] Furthermore, the CNN feature extraction layer includes a first convolutional layer, a first pooling layer, a first dropout layer, a second convolutional layer, a second pooling layer, a second dropout layer, and a third convolutional layer arranged in sequence; the first dropout layer and the second dropout layer set the output of the neuron to zero with a set probability to avoid excessive dependence of the model on specific neurons.
[0039] Furthermore, a CBAM attention mechanism module is added after the first convolutional layer, the second convolutional layer, and the third convolutional layer, respectively, to obtain a CNN-GAP-CBAM fault diagnosis model.
[0040] Furthermore, the CBAM attention mechanism module includes a feature input terminal, a channel attention module, a spatial attention module and a feature output terminal;
[0041] The feature input terminal generates an initial feature tensor and passes it to the channel attention module;
[0042] The channel attention module extracts channel statistical features through a global average operation and generates a channel weight matrix through a fully connected layer; after the channel weights are activated by Sigmoid, they are weightedly fused with the initial feature tensor in the channel dimension and the weights are passed to the first feature mapping node; the first feature mapping node multiplies the channel attention weights with the initial feature map channel by channel to generate a feature map after channel attention enhancement;
[0043] The spatial attention module processes the feature map after channel attention enhancement in the spatial domain and outputs the spatial attention weight to the second feature mapping node. The second feature mapping node multiplies the spatial attention weight with the feature map after channel attention enhancement pixel by pixel to generate the final feature map.
[0044] Furthermore, the CBAM attention mechanism module processes the feature matrix output by the convolutional layer as follows:
[0045] The initial feature tensor generated by the feature input is:
[0046] F∈R H×W×C
[0047] Where: H is the height, W is the width, and C is the number of channels;
[0048] The channel attention module calculates the global average pooling value and the global maximum pooling value for each channel c:
[0049]
[0050] in: is the global average pooling value; is the global maximum pooling value; F(i,j,c) is the eigenvalue of channel c at position (i,j);
[0051] Concatenate the global average pooling value and the global maximum pooling value to obtain a two-dimensional vector:
[0052] z=[F avg ,F max ]∈R 2c
[0053] Use a fully connected layer and Sigmoid activation function to generate the attention weight M for each channel C ∈[0,1]:
[0054] M C =σ(W2·(W1·z+b1)+b2)
[0055] Where: M C is the attention weight of channel c; W1 and W2 are the weight matrices of the global average pooling layer and the global maximum pooling layer respectively; b1 and b2 are the bias terms of the global average pooling layer and the global maximum pooling layer respectively;
[0056] The first feature mapping node takes the channel attention weight M C Multiply it channel by channel with the initial feature map F to generate the feature map F′ after channel attention enhancement:
[0057] The spatial attention module calculates global average pooling and global max pooling Generate two two-dimensional feature maps R H×W×1 , the expression of two two-dimensional feature maps at the (i, j) position is:
[0058]
[0059] in: is the global average pooling value; is the global maximum pooling value; F′(i,j,c) is the eigenvalue of channel c at position (i,j);
[0060] The spatial attention channel and Splice it into a two-dimensional vector, and then use a 7×7 filter to perform convolution operation to obtain the weight M of spatial attention. S :
[0061]
[0062] The obtained channel attention weight M S By multiplying the feature map F′ by channel-by-channel multiplication, the weighted feature map F″ is obtained:
[0063] Furthermore, in step 4, the model training adopts the Adam optimizer, the loss function is the categorical cross entropy, and the early stopping mechanism and learning rate adjustment strategy are configured to prevent overfitting and accelerate convergence.
[0064] The beneficial effects of the present invention are:
[0065] The present invention proposes a motor speed anomaly fault diagnosis method based on simulation data and a CNN-GAP-CBAM model. By reconstructing one-dimensional time-series fault data and then inputting it into a CBAM attention mechanism and a CNN-GAP neural network, the method significantly improves fault feature extraction and diagnosis capabilities. The CBAM mechanism optimizes the model's focus on key feature regions and channels through spatial and channel attention mechanisms, enhancing the feature representation of local anomalies and important channels, thereby improving fault diagnosis accuracy. The CNN-GAP extracts local fault features from motor fault signals using multi-layer convolution kernels, and then performs feature compression and dimensionality reduction through a global average pooling layer, retaining key fault information. This improves the model's fault diagnosis accuracy and addresses the problem of existing deep learning-based fault diagnosis methods having high dataset requirements and the difficulty in effectively collecting fault data in actual production. The method also effectively addresses the problems of poor diagnostic effectiveness caused by the complex characteristics of high-dimensional data, the inability to fully capture key fault-related feature information, and the lack of comprehensiveness and reliability of diagnostic results. BRIEF DESCRIPTION OF THE DRAWINGS
[0066] In order to make the purpose, technical solutions and beneficial effects of the present invention more clear, the present invention provides the following drawings for illustration:
[0067] Figure 1 Flowchart of the motor speed abnormality fault diagnosis method based on simulation data and CNN-GAP-CBAM model of the present invention;
[0068] Figure 2 Simulate the circuit diagram for the motor speed being too fast;
[0069] Figure 3This is the structural diagram of the CNN-GAP-CBAM fault diagnosis model;
[0070] Figure 4 This is the structural diagram of the CBAM attention mechanism module;
[0071] Figure 5 This is the training flow chart of the CNN-GAP-CBAM fault diagnosis model. DETAILED DESCRIPTION
[0072] The present invention will be further described below with reference to the accompanying drawings and specific embodiments so that those skilled in the art can better understand the present invention and implement it. However, the embodiments are not intended to limit the present invention.
[0073] like Figure 1 As shown, the motor speed abnormality fault diagnosis method based on simulation data and CNN-GAP-CBAM model in this embodiment includes the following steps:
[0074] Step 1: Generate motor fault simulation data
[0075] A simulation model of a permanent magnet synchronous motor was established to simulate normal and overspeed fault conditions. Simulation data, including voltage and current signals, was generated using MATLAB / Simulink. This data was then compared and verified with actual collected data to ensure the validity of the simulation model. Specifically, in this embodiment, the overspeed fault condition was simulated by adding a speed step signal to the normal state to simulate the overspeed current signal.
[0076] In this embodiment, the simulation model is a simulation model of a permanent magnet synchronous motor (PMSM), and the model simulation includes a normal state motor model and a fault state motor model. Specific motor failure modes include abnormal motor speed, motor overheating, and motor brake abnormality. This embodiment constructs a physical simulation model of the motor based on its operating principle and physical characteristics. MATLAB / Simulink is used to simulate the motor, defining the input signal and load conditions during motor operation, setting a simulation time range, and adding preset fault characteristics. Finally, simulated voltage and current data are obtained, that is, voltage and current data under normal and fault conditions are obtained. The simulation prediction results are compared and verified with the experimental measurement values to ensure the validity and reliability of the model.
[0077] For example, the sampling frequency of this embodiment is 500 Hz, and Simulink is used to simulate and model the permanent magnet synchronous motor PMSM in the normal operation state and the motor speed too fast state. The current signals of these two motor operation states are 0.5s each, and 500,000 simulation data are obtained for each state, as shown in Table 1.
[0078] Table 1 Number of two types of operating states of permanent magnet synchronous motors
[0079] Logo Motor operating status quantity 0 normal 500000 1 Motor speed is too fast 500000
[0080] The motor speed is too fast simulation circuit diagram is as follows Figure 2 As shown in the figure, motor parameters were set: load 105 kg, motor pole pair number set to 3. Based on the motor failure mechanism, a speed interference module was added to the motor overspeed condition, and the voltage and current data sampling frequency was set to 500 Hz. Finally, the constructed motor fault model was simulated to obtain current data for the overspeed condition, with a data acquisition time of 0.5 seconds.
[0081] Step 2: Fault data preprocessing
[0082] After integrating the simulated data and actual data using data alignment, the integrated data is preprocessed using denoising, segmentation, normalization and data enhancement to obtain the training data set.
[0083] Specifically, the steps of data denoising are as follows:
[0084] 21) Using wavelet threshold denoising algorithm to denoise the original signal s=[s0,s1,…,s n―1 ] Perform L-layer discrete wavelet transform to obtain the approximate coefficient α of each layer L and detail coefficient α L It is the approximate coefficient of the Lth layer (low frequency part), with a length of N / 2 L .d j It is the detail coefficient (high frequency part) of the jth layer, with a length of N / 2 j .
[0085] 22) Estimating the noise of the data:
[0086]
[0087] Where: σ is the estimate of the noise standard deviation; median is the absolute median deviation; d1 is the detail coefficient of the first layer.
[0088] 23) Calculate the noise threshold:
[0089]
[0090] Where: N is the length of the original signal; T is the universal threshold of noise.
[0091] Get the soft and hard thresholds for noise:
[0092] Soft threshold: d′ j.k =sign(d j,k )·(|d j,k|―T) +
[0093] Hard Threshold:
[0094] Where: d j,k is the original detail coefficient of the jth layer and the kth position; d′ j,k is the original detail coefficient after threshold processing.
[0095] 24) Reconstruct the data signal using the approximate coefficient α L and the processed detail coefficient Perform inverse discrete wavelet transform to obtain the denoised signal s′.
[0096] The data segmentation method is to use a sliding window method to segment according to a set length to facilitate model input. In this embodiment, the data is segmented according to a length of 600 using a sliding window method to facilitate model input. The data set is divided into training set, test set, and validation set in a ratio of 8:1:1.
[0097] The data normalization method is: use the global normalization algorithm to normalize the data, and the normalized data range is [0,1]. The normalization method is:
[0098]
[0099] Where: X is the original feature; X min is the global minimum; X max is the global maximum; X norm is the normalized value.
[0100] The data enhancement method is to increase the diversity of data and improve the generalization ability of the model through methods including time series scaling and amplitude perturbation.
[0101] Step 3: Build a CNN-GAP-CBAM fault diagnosis model
[0102] This embodiment designs a CNN-GAP neural network structure training for permanent magnet synchronous motor overspeed fault data, extracts fault data sample features from each convolution layer, obtains multiple feature maps through sampling operations and horizontal connections, and then combines the feature maps into a feature vector after global average pooling layer pooling. Specifically, Figure 3As shown in the figure, the CNN-GAP-CBAM fault diagnosis model includes an input layer, a feature extraction layer, a global average pooling layer, and an output layer; the feature extraction layer contains at least three convolutional layers, each of which is sequentially connected to a CBAM attention module and a pooling layer; the CBAM module includes a channel attention submodule and a spatial attention submodule, which generate channel and spatial weights through global pooling, a fully connected layer, and convolution operations, respectively, and perform channel-by-channel and pixel-by-pixel weighted fusion with the input feature map.
[0103] The CNN-GAP-CBAM fault diagnosis model includes a CNN-GAP neural network, which consists of an input layer, a CNN feature extraction layer, a GAP global average pooling layer, and a SOFTMAX output layer. Specifically, the input layer is used to reconstruct data, converting one-dimensional time series data into a two-dimensional feature matrix; the CNN feature extraction layer is used to extract features from the two-dimensional matrix to obtain a multidimensional feature map; the GAP global average pooling layer is used to flatten the multidimensional feature map into a one-dimensional vector array; and the SOFTMAX output layer is used to perform dimensionality reduction and classification on the one-dimensional vector output by the GAP layer.
[0104] In this example, the input matrix size is 20 × 30 × 1. Downsampling feature extraction is first performed through a convolutional layer with a 3 × 3 kernel, a stride of 1, the same padding, and 32 kernels. The output of this layer is 20 × 30 × 32. This initially extracts features from the feature matrix while preserving the spatial dimensionality.
[0105] The CNN feature extraction layer of this embodiment includes a first convolutional layer, a first pooling layer, a first dropout layer, a second convolutional layer, a second pooling layer, a second dropout layer, and a third convolutional layer arranged in sequence; the first dropout layer and the second dropout layer set the output of the neuron to zero with a set probability to avoid excessive dependence of the model on specific neurons.
[0106] In this example, a dropout layer is designed between the pooling layer and the convolutional layer. The dropout ratio of the first dropout layer is 0.4, and the dropout ratio of the second dropout layer is 0.5. That is, 40% and 50% of the neurons are randomly dropped during training, respectively, to prevent overfitting.
[0107] In this embodiment, the first convolution module includes a first convolution layer, a first pooling layer, and a first dropout layer. The first convolution layer uses 32 3×3 convolution kernels; the first pooling layer MaxPooling2D has a pooling window of 2×2, a stride of 2, and the feature map size is halved; the first dropout layer randomly drops 40% of the neurons to prevent overfitting without affecting the size. The second convolution module includes a second convolution layer, a second pooling layer, a second dropout layer, and a third convolution layer. The second convolution layer uses 64 3×3 convolution kernels; the second pooling layer has a pooling window of 2×2, a stride of 2, and the feature map size is halved; the second dropout layer randomly drops 50% of the neurons to prevent overfitting without affecting the size; the third convolution layer uses 128 convolution kernels.
[0108] The global average pooling layer averages the spatial dimensions of each channel into a single value, that is, one feature value per channel. The global average pooling layer replaces the traditional fully connected layer to reduce the number of parameters and prevent overfitting.
[0109] In the CNN-GAP-CBAM fault diagnosis model of this embodiment, the CBAM attention mechanism module is added after the first convolutional layer, the second convolutional layer, and the third convolutional layer, respectively. In this way, a CNN-GAP-CBAM fault diagnosis model can be constructed based on the CNN-GAP neural network, as shown in FIG. Figure 3 shown.
[0110] Specifically, such as Figure 4 As shown in the figure, the CBAM attention mechanism module includes a feature input terminal, a channel attention module, a spatial attention module and a feature output terminal.
[0111] The feature input generates the initial feature tensor and passes it to the channel attention module.
[0112] The channel attention module extracts channel statistical features through global averaging operation and generates a channel weight matrix through the fully connected layer; after the channel weight is activated by Sigmoid, it is weightedly fused with the initial feature tensor in the channel dimension, and the weight is passed to the first feature mapping node; the first feature mapping node multiplies the channel attention weight with the initial feature map channel by channel to generate a feature map after channel attention enhancement.
[0113] The spatial attention module processes the feature map after channel attention enhancement in the spatial domain and outputs the spatial attention weight to the second feature mapping node. The second feature mapping node multiplies the spatial attention weight with the feature map after channel attention enhancement pixel by pixel to generate the final feature map.
[0114] Table 2 The impact of different attention mechanism modules on experimental results
[0115]
[0116]
[0117] The table above shows experimental results comparing different attention mechanisms. CNN-GAP-CBAM surpasses CNN-GAP-SE net and CNN-GAP-SK net in all three metrics: F1 score, accuracy, and AUC. This demonstrates that the CBAM mechanism performs better than SE net and SK net in this task. This is due to the fact that CBAM can better combine channel-wise and spatial-wise attention mechanisms, enhancing feature representation and thus improving the overall performance of the model.
[0118] Specifically, the CBAM attention mechanism module processes the feature matrix output by the convolutional layer as follows.
[0119] The initial feature tensor generated by the feature input is:
[0120] F∈R H×W×C
[0121] Where: H is the height, W is the width, and C is the number of channels.
[0122] The channel attention module calculates the global average pooling value and the global maximum pooling value for each channel c:
[0123]
[0124] in: is the global average pooling value; is the global maximum pooling value; F(i,j,c) is the eigenvalue of channel c at position (i,j).
[0125] Concatenate the global average pooling value and the global maximum pooling value to obtain a two-dimensional vector:
[0126] z=[F avg ,F max ]∈R 2c
[0127] Use a fully connected layer and Sigmoid activation function to generate the attention weight M for each channel C ∈[0,1]:
[0128] M C =σ(W2·(W1·z+b1)+b2)
[0129] Where: M C is the attention weight of channel c; W1 and W2 are the weight matrices of the global average pooling layer and the global maximum pooling layer respectively; b1 and b2 are the bias terms of the global average pooling layer and the global maximum pooling layer respectively.
[0130] The first feature mapping node takes the channel attention weight M C Multiply it channel by channel with the initial feature map F to generate the feature map F′ after channel attention enhancement:
[0131] The spatial attention module calculates the global average pooling and global max pooling Generate two two-dimensional feature maps R H×W×1 , the expression of two two-dimensional feature maps at the (i, j) position is:
[0132]
[0133] in: is the global average pooling value; is the global maximum pooling value; F′(i,j,c) is the eigenvalue of channel c at position (i,j).
[0134] The spatial attention channel and Splice it into a two-dimensional vector, and then use a 7×7 filter to perform convolution operation to obtain the weight M of spatial attention. S :
[0135]
[0136] The obtained channel attention weight M S By multiplying the feature map F′ by channel-by-channel multiplication, the weighted feature map F″ is obtained:
[0137] Step 4: Model training and fault classification
[0138] The preprocessed data is fed into the CNN-GAP-CBAM fault diagnosis model for training. A global average pooling layer compresses features and outputs fault classification results, resulting in a motor overspeed classification and identification model. In this embodiment, the model is trained using the Adam optimizer, with the categorical cross entropy loss function. An early stopping mechanism and a learning rate adjustment strategy are implemented to prevent overfitting and accelerate convergence.
[0139] In this example, model training and fault classification include the following steps.
[0140] 41) Convert one-dimensional time series data into two-dimensional feature maps for data reconstruction.
[0141] The data obtained from the simulation is one-dimensional time series data, but the input to the CNN-GAP neural network is the two-dimensional feature matrix of its signal. In this embodiment, the process of converting one-dimensional time series data into a two-dimensional feature matrix adopts the "sliding window" method. By selecting a continuous subset of the time series (sliding window), it is converted into a matrix, where each row represents a subsequence and each column represents a feature of the subsequence.
[0142] Assume that the original one-dimensional time series is X=[x1,x2,…,x T ], where: T is the length of the time series, x i is the value of the time series at time i.
[0143] Assuming that the window size of the intercepted data is m and the step size is d (determine the interval of extracting adjacent subsequences from the time series), the time series is converted into a two-dimensional feature matrix by the sliding window method. Let m be the window size, d be the step size, and the time series is X=[x1,x2,…,x T ], then the reconstructed two-dimensional feature matrix X matrix for:
[0144]
[0145] Where: N is the number of subsequences extracted from the time series by the sliding window, and:
[0146]
[0147] 42) Input the simulated fault data to train the model until the parameters converge and the model training is completed. The flow chart of the model training is as follows: Figure 5 shown.
[0148] 43) In this embodiment, the input matrix size is 20 × 30 × 1. Downsampling feature extraction is first performed through a convolutional layer with a 3 × 3 kernel, a stride of 1, the same padding, and 32 kernels. The output of this layer is 20 × 30 × 32. This initially extracts the features of the feature matrix while maintaining the spatial dimensionality.
[0149] After passing through the first convolutional layer, the network passes through the first CBAM module, with the input and output resized unchanged at 20×30×32, a compression ratio of 8, and a spatial attention channel convolution kernel of 7×7. It then passes through the first pooling layer with a pooling kernel of 2×2 and a stride of 2, resulting in an output size of 10×15×32. It then passes through the first dropout layer, with the input and output resized unchanged at a dropout rate of 0.4. It then passes through the second convolutional module (consisting of the second convolutional layer, the second CBAM module, the second pooling layer, and the second dropout layer), with the output sizes of each layer being 10×15×64, 10×15×64, and 5×7×64, respectively. The dropout rate of the second dropout layer of the second convolutional module is 0.5. It then passes through the third convolutional layer and the third CABM module, with the output size being 5×7×128. Finally, it passes through the GAP global average pooling layer, compressing the output of the previous layer to 128×1, and then passes through the softmax function to output the classification result.
[0150] Step 5: Diagnosis of abnormal motor speed fault
[0151] The motor operation data including voltage and current signals are collected, and the trained CNN-GAP-CBAM fault diagnosis model is used to perform real-time diagnosis of motor speed anomalies.
[0152] In summary, the motor speed abnormality fault diagnosis method based on simulation data and the CNN-GAP-CBAM model of this embodiment uses the CBAM attention mechanism and the CNN-GAP neural network to build a model, significantly improving the fault feature extraction and diagnosis capabilities. The CBAM mechanism optimizes the model's focus on key feature areas and channels through spatial and channel attention mechanisms, improving the feature expression capabilities of local abnormalities and important channels, thereby improving the accuracy of fault diagnosis; CNN-GAP extracts local fault features of motor fault signals through multi-layer convolution kernels. After feature compression and dimensionality reduction through the global average pooling layer, key fault information is retained. This improves the fault diagnosis accuracy of the model. Finally, the effectiveness of the model improvement was demonstrated through various experimental comparisons, with a final accuracy rate of 99.8%.
[0153] The above embodiments are merely preferred embodiments for the purpose of fully illustrating the present invention, and the scope of protection of the present invention is not limited thereto. Equivalent substitutions or modifications made by those skilled in the art based on the present invention are within the scope of protection of the present invention. The scope of protection of the present invention shall be subject to the claims.
Claims
1. A motor speed abnormality fault diagnosis method based on simulation data and CNN-GAP-CBAM model, characterized by: The steps include: Step 1: Generate motor fault simulation data A simulation model of a permanent magnet synchronous motor was established to simulate normal operating conditions and overspeed fault conditions. Simulation data containing voltage and current signals was generated through MATLAB / Simulink simulation and compared with the actual collected data to ensure the validity of the simulation model. Step 2: Fault data preprocessing After integrating the simulated data and the actual data using data alignment, the integrated data is preprocessed using denoising, segmentation, normalization, and data enhancement to obtain the training data set; Step 3: Build a CNN-GAP-CBAM fault diagnosis model The CNN-GAP-CBAM fault diagnosis model includes an input layer, a feature extraction layer, a global average pooling layer, and an output layer. The feature extraction layer contains at least three convolutional layers, each of which is sequentially connected to a CBAM attention module and a pooling layer. The CBAM module includes a channel attention submodule and a spatial attention submodule, which respectively generate channel and spatial weights through global pooling, a fully connected layer, and convolution operations, and perform channel-by-channel and pixel-by-pixel weighted fusion with the input feature map. Step 4: Model training and fault classification The preprocessed data is input into the CNN-GAP-CBAM fault diagnosis model for training, and features are compressed through the global average pooling layer to output the fault classification results; Step 5: Diagnosis of abnormal motor speed fault Motor operating data, including voltage and current signals, was collected and the trained CNN-GAP-CBAM fault diagnosis model was used to perform real-time diagnosis of motor speed anomalies. Comparative experiments were conducted to verify the effectiveness of the model.
2. The motor speed abnormality fault diagnosis method based on simulation data and CNN-GAP-CBAM model according to claim 1 is characterized in that: In the step 1, the method for simulating the operating condition of the overspeed fault state is: adding a speed step signal to simulate the overspeed current signal under normal circumstances.
3. The motor speed abnormality fault diagnosis method based on simulation data and CNN-GAP-CBAM model according to claim 1 is characterized in that: In step 2, the data denoising method steps are as follows: 21) Using wavelet threshold denoising algorithm to denoise the original signal s=[s0,s1,…,s n―1 ] Perform L-layer discrete wavelet transform to obtain the approximate coefficient α of each layer L and detail coefficient 22) Estimating the noise of the data: Where: σ is the estimated value of the noise standard deviation; median is the absolute median deviation; d1 is the detail coefficient of the first layer; 23) Calculate the noise threshold: Where: N is the length of the original signal; T is the universal threshold of noise; Get the soft and hard thresholds for noise: Soft threshold: d′ j.k =sign(d j,k )·(|d j,k |―T) + Hard Threshold: Where: d j,k is the original detail coefficient of the jth layer and the kth position; d′ j.k is the original detail coefficient after threshold processing; 24) Reconstruct the data signal using the approximate coefficient α L and the processed detail coefficient Perform inverse discrete wavelet transform to obtain the denoised signal s′.
4. The motor speed abnormality fault diagnosis method based on simulation data and CNN-GAP-CBAM model according to claim 1 is characterized in that: In step 2, the data segmentation method is: segmentation is performed using a sliding window method according to a set length to facilitate model input; the data normalization method is: normalization is performed on the data using a global normalization algorithm, and the normalized data range is [0, 1]; The data enhancement method is to increase the diversity of data and improve the generalization ability of the model through methods including time series scaling and amplitude perturbation.
5. The motor speed abnormality fault diagnosis method based on simulation data and CNN-GAP-CBAM model according to claim 1 is characterized in that: In step 3, the CNN-GAP-CBAM fault diagnosis model includes a CNN-GAP neural network, and the CNN-GAP neural network includes: The input layer is used to reconstruct data and convert one-dimensional time series data into a two-dimensional feature matrix; CNN feature extraction layer, used to extract features from two-dimensional matrices to obtain multi-dimensional feature maps; GAP global average pooling layer, used to flatten the multi-dimensional feature map into a one-dimensional vector array; The SOFTMAX output layer is used to reduce the dimension of the one-dimensional vector output by the GAP layer.
6. The motor speed abnormality fault diagnosis method based on simulation data and CNN-GAP-CBAM model according to claim 5 is characterized in that: The CNN feature extraction layer includes a first convolutional layer, a first pooling layer, a first dropout layer, a second convolutional layer, a second pooling layer, a second dropout layer, and a third convolutional layer, which are arranged in sequence; the first dropout layer and the second dropout layer set the output of the neuron to zero with a set probability to avoid excessive dependence of the model on specific neurons.
7. The motor speed abnormality fault diagnosis method based on simulation data and CNN-GAP-CBAM model according to claim 6 is characterized in that: The CBAM attention mechanism module is added after the first convolutional layer, the second convolutional layer, and the third convolutional layer respectively to obtain the CNN-GAP-CBAM fault diagnosis model.
8. The motor speed abnormality fault diagnosis method based on simulation data and CNN-GAP-CBAM model according to claim 7 is characterized in that: The CBAM attention mechanism module includes a feature input terminal, a channel attention module, a spatial attention module and a feature output terminal; The feature input terminal generates an initial feature tensor and passes it to the channel attention module; The channel attention module extracts channel statistical features through global averaging operation and generates a channel weight matrix through the fully connected layer; after the channel weight is activated by Sigmoid, it is weightedly fused with the initial feature tensor in the channel dimension and the weight is passed to the first feature mapping node; The first feature mapping node multiplies the channel attention weight with the initial feature map channel by channel to generate a feature map after channel attention enhancement; The spatial attention module processes the feature map after channel attention enhancement in the spatial domain and outputs the spatial attention weight to the second feature mapping node. The second feature mapping node multiplies the spatial attention weight with the feature map after channel attention enhancement pixel by pixel to generate the final feature map.
9. The motor speed abnormality fault diagnosis method based on simulation data and CNN-GAP-CBAM model according to claim 8, characterized in that: The CBAM attention mechanism module processes the feature matrix output by the convolutional layer as follows: The initial feature tensor generated by the feature input is: F∈R H×W×C Where: H is the height, W is the width, and C is the number of channels; The channel attention module calculates the global average pooling value and the global maximum pooling value for each channel c: in: is the global average pooling value; is the global maximum pooling value; F(i,j,c) is the eigenvalue of channel c at position (i,j); Concatenate the global average pooling value and the global maximum pooling value to obtain a two-dimensional vector: z=[F avg ,F max ]∈R 2c Use a fully connected layer and Sigmoid activation function to generate the attention weight M for each channel C ∈[0,1]: M C =σ(W2·(W1·z+b1)+b2) Where: M C is the attention weight of channel c; W1 and W2 are the weight matrices of the global average pooling layer and the global maximum pooling layer respectively; b1 and b2 are the bias terms of the global average pooling layer and the global maximum pooling layer respectively; The first feature mapping node takes the channel attention weight M C Multiply it channel by channel with the initial feature map F to generate the feature map F′ after channel attention enhancement: The spatial attention module calculates global average pooling and global max pooling Generate two two-dimensional feature maps R H ×W×1 , the expression of two two-dimensional feature maps at the (i, j) position is: in: is the global average pooling value; is the global maximum pooling value; F′(i,j,c) is the eigenvalue of channel c at position (i,j); The spatial attention channel and Splice it into a two-dimensional vector, and then use a 7×7 filter to perform convolution operation to obtain the weight M of spatial attention. S : The obtained channel attention weight M S By multiplying the feature map F′ by channel-by-channel multiplication, the weighted feature map F″ is obtained:
10. The motor speed abnormality fault diagnosis method based on simulation data and CNN-GAP-CBAM model according to claim 1 is characterized in that: In step 4, the model training uses the Adam optimizer, the loss function is categorical cross entropy, and an early stopping mechanism and a learning rate adjustment strategy are configured to prevent overfitting and accelerate convergence.
Citation Information
Cited By
Welding quality diagnosis method and platform considering multi-sensing time sequence characteristics
CN120724291A
Electric spindle fault diagnosis method and system based on multi-scale dynamic convolution
CN120929816A
Multi-source data convolution fusion TBM electric drive system fault diagnosis method
CN121167123A
Intelligent elevator maintenance method and device based on DGConv and improved CBAM attention mechanism
CN121981711A