Permanent magnet synchronous motor fault detection method based on attention and graph neural network
By using the attention and graph neural network method in the fault detection of permanent magnet synchronous motor, combining Transformer and graph attention network, integrating spatiotemporal and spatial information and dynamically adjusting the relationship between nodes, the problem of inability to consider both time domain and space domain characteristics in the existing technology is solved, and the accuracy of fault detection is improved.
Patent Information
- Application Number
- CN202510177355.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-18
- Publication Date
- 2025-06-10
AI Technical Summary
The existing permanent magnet synchronous motor fault detection methods cannot consider the time domain and airspace characteristics at the same time, and cannot dynamically adjust the relationship between nodes, resulting in low detection accuracy.
Using an attention and graph neural network method, the problem is realized by combining Transformer and graph attention network, the spatiotemporal and spatial information is integrated, and the relationship between nodes is dynamically adjusted to achieve fault detection.
It improves the accuracy of fault detection of permanent magnet synchronous motors, can effectively identify potential faults in time and airspace characteristics, and reduces the impact of errors on prediction.
Smart Images

Figure CN120123675A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a permanent magnet synchronous motor fault detection method based on attention and graph neural network. Background Art
[0002] In recent years, due to its excellent characteristics such as high efficiency, high reliability, wide range of speed control, and low rotor inertia, permanent magnet synchronous motors have been widely used in industrial automatic control fields such as traction trains, gradually replacing induction motors. However, with the development of technology, the integration degree and complexity of train systems are constantly increasing. In the face of complex environments, how to detect faults in a timely manner and evaluate system performance is an important problem that urgently needs to be solved. As a data-driven method, the neural network based on deep learning has powerful nonlinear fitting capabilities, can achieve end-to-end learning, avoid manual feature extraction and feature selection, and accurately classify faults. Graph neural networks, by introducing graph structures to obtain the relationships between data, use association graphs to represent potential complex relationships in data samples and improve model performance. Therefore, they have received a lot of attention.
[0003] Currently, existing deep learning fault detection methods for permanent magnet synchronous motors based on graph neural networks only consider time-domain features or spatial-domain features, without considering combining the two. Secondly, many methods use unweighted graphs and equally consider the importance of neighbors. However, the influence degree of fault propagation and the interaction between adjacent components is dynamically changing, and the importance of a certain node and its surrounding neighbor nodes is also dynamically changing. To sum up, there is an urgent need to develop a detection scheme that simultaneously considers the time domain and the spatial domain and can dynamically adjust the relationships between nodes, so as to improve the accuracy of its detection. Summary of the Invention
[0004] The purpose of the present invention is to solve the problem that existing permanent magnet synchronous motor fault detection methods cannot simultaneously consider the time domain and the spatial domain and cannot dynamically adjust the relationships between nodes, resulting in low detection accuracy, and to propose a permanent magnet synchronous motor fault detection method based on attention and graph neural network.
[0005] The specific process of a permanent magnet synchronous motor fault detection method based on attention and graph neural network is as follows:
[0006] Offline training:
[0007] Step 1: Collect normal data, fault data, and latent fault data of the permanent magnet synchronous motor;
[0008] Step 2: Preprocess the normal data, fault data, and latent fault data of the permanent magnet synchronous motor collected in Step 1 to obtain preprocessed normal data, fault data, and latent fault data;
[0009] Use the preprocessed normal data, fault data, and latent fault data as the training set:
[0010] Step 3: Build a neural network model;
[0011] Step 4: Based on the training set Π obtained in Step 2 train Train the neural network model to obtain a trained neural network model;
[0012] Step 5: Save the parameters of the trained neural network model;
[0013] Online detection:
[0014] Step 6: Obtain N sets of original signal data X of current or voltage with a length of L to be measured through N sensors;
[0015] Step 7: Preprocess the N sets of original signal data X of current or voltage with a length of L to be measured obtained in Step 6 to obtain N sets of preprocessed permanent magnet synchronous motor data;
[0016] Step 8: Input the preprocessed permanent magnet synchronous motor data into the trained neural network model, and the trained neural network model outputs the data type of the preprocessed permanent magnet synchronous motor data;
[0017] The data type of the preprocessed permanent magnet synchronous motor data output by the trained neural network model is:
[0018] Normal data, fault data, or latent fault data.
[0019] Preferably, the normal data, fault data, and latent fault data of the permanent magnet synchronous motor in Step 1 are specifically:
[0020] Normal data is:
[0021] The current value is within the specified current value range;
[0022] The voltage value is within the specified voltage value range;
[0023] Fault data is:
[0024] The current value is not within the specified current value range;
[0025] The voltage value is not within the specified voltage value range;
[0026] Latent fault data includes offset type faults and periodic type faults;
[0027] Latent fault data is:
[0028] The value of the current is within the specified current value range, but there are abnormalities in the waveform, which is an offset type fault;
[0029] The value of the current is within the specified current value range, but there are periodic distortions in the waveform, which is a periodic type of fault;
[0030] The value of the voltage is within the specified voltage value range, but there are abnormalities in the waveform, which is an offset type of fault.
[0031] The value of the voltage is within the specified voltage value range, but there are periodic distortions in the waveform, which is a periodic type of fault;
[0032] The labels of normal data, fault data, and latent fault data refer to the types of normal data, fault data, and latent fault data, the positions of the injected faults and latent fault data, and the types of injected latent faults.
[0033] Preferably, in step 1, normal data, fault data, and latent fault data of the permanent magnet synchronous motor are collected; the specific process is as follows:
[0034] Step 11: Through a single sensor, obtain a set of current or voltage raw signal data with a length of L, denoted as X ∈ R L , and regard the current or voltage raw signal data with a length of L obtained by a single sensor as a feature;
[0035] Through N sensors, obtain N sets of current or voltage raw signal data with a length of L, denoted as X ∈ R N×L ;
[0036] Step 12: Split each set of current or voltage raw signal data with a length of L into sub-samples with a length of d in chronological order, without overlap between each sub-sample, and assign corresponding labels to each sub-sample; denoted as:
[0037] X = [x 1 , x 2 , …, x i , …, x n (1)
[0038] Π = [(x 1 , y 1 ), (x 2 , y 2 ), …, (x i , y i ), …, (x n , y n )] (2)
[0039]
[0040] Among them, Π represents the set of sub-samples, x 1 represents the first sub-sample with a length of d after splitting, y1 Denote the first subsample \(x\) of length \(d\) after splitting 1 The corresponding label, \(x\) 2 Denote the second subsample, \(y\), of length \(d\) after splitting 2 Denote the second subsample \(x\) of length \(d\) after splitting 2 The corresponding label, \(x\) i Denote the second subsample, \(y\), of length \(d\) after splitting i Denote the second subsample \(x\) of length \(d\) after splitting 2 The corresponding label, \(x\) n Denote the \(n\)th subsample, \(y\), of length \(d\) after splitting n Denote the \(n\)th subsample \(x\) of length \(d\) after splitting n The corresponding label, where \(n\) represents the number of subsamples.
[0041] Preferably, in step 2, the normal data, fault data, and latent fault data of the permanent magnet synchronous motor collected in step 1 are preprocessed to obtain the preprocessed normal data, fault data, and latent fault data;
[0042] Use the preprocessed normal data, fault data, and latent fault data as the training set:
[0043] The specific process is as follows:
[0044] Step 21: For each data \(x\) in each subsample set \(\Pi\) in formula (2) i Perform the following processing to obtain the processed data \(x'\) i ; Denote as
[0045] \(x'\) i \(=\mathbf{W}\) e \(x\) i +\mathbf{b}\) e (4)
[0046] where \(\mathbf{W}\) e and \(\mathbf{b}\) e are learnable parameter matrices and bias vectors;
[0047] Based on all the processed data \(x'\) corresponding to each subsample set \(\Pi\) i ; Obtain the current or voltage signal data \(X'\) of each group with length \(L\);
[0048] Step 22: Perform input embedding on the current or voltage signal data \(X'\) of each group with length \(L\) to obtain the data after input embedding Denote as:
[0049]
[0050] Among them, IE represents the input embedding;
[0051] Step 23: The positional encoding (PE) based on the sine function and cosine function is expressed as
[0052]
[0053] where t is the time step, i is the dimension of the subsequence, and d′ is the dimension of the embedding vector, with a value of 512;
[0054] Step 24: According to Equation (5) and Equation (6), after input embedding and positional encoding of Equation (1), the latent fault data of the permanent magnet synchronous motor after preprocessing is obtained which is expressed as
[0055]
[0056] Step 25: Take the data in (7) as the training set without labels, then there is
[0057]
[0058] where X train is the training set without labels;
[0059] Step 26: Divide ∏ into a training set according to (8); it is expressed as:
[0060] ∏ = ∏ train (9)
[0061] where ∏ train is the training set with labels.
[0062] Preferably, in step 3, a neural network model is built; the specific process is as follows:
[0063] The neural network model successively includes a first Transformer encoder layer, a second Transformer encoder layer, a global average pooling layer, a first fully connected layer, a first graph attention layer, a second graph attention layer, and a second fully connected layer.
[0064] Preferably, in step 4, based on the training set ∏ obtained in step 2 train train the neural network model to obtain a trained neural network model; the specific process is as follows:
[0065] The training set ∏ with labels train is input into the neural network model for training;
[0066] The neural network model sequentially includes a first Transformer encoder layer, a second Transformer encoder layer, a global average pooling layer, a first fully connected layer, a first graph attention layer, a second graph attention layer, and a second fully connected layer;
[0067] The Adam optimizer is adopted, the loss function is the cross-entropy loss, the learning rate is 0.00001, the sample batch size is set to 64, and the training stops when the number of iterations reaches 20;
[0068] Obtain the trained neural network model.
[0069] Preferably, in step 5, the parameters of the trained neural network model are saved; the specific process is as follows:
[0070] Save the parameter data of the trained neural network model in a file with the.pth format.
[0071] Preferably, in step 7, the original current or voltage signal data X of N groups with a length of L obtained in step 6 is preprocessed to obtain the data of the permanent magnet synchronous motor after preprocessing for N groups; the specific process is as follows:
[0072] Step 71: Split each group of original current or voltage signal data with a length of L into sub-samples with a length of d in chronological order, and there is no overlap between each sub-sample; expressed as:
[0073] X = [x 1 , x 2 , …, x i , …, x n (1)
[0074] Step 72: Perform the following processing on each data x i in each group to obtain the processed data x′ i ; expressed as
[0075] x′ i = W e x i + b e (4)
[0076] where W e and b e are learnable parameter matrices and bias vectors;
[0077] Step 73: Based on the processed data x′ i ; obtain the current or voltage signal data X′ of each group with a length of L;
[0078] Step 74: Perform Input Embedding on each group of current or voltage signal data X′ with length L to obtain the data after input embedding It is expressed as:
[0079]
[0080] where IE represents input embedding;
[0081] Step 75: The Positional Encoding PE based on sine function and cosine function is expressed as
[0082]
[0083] where t is the time step, i is the dimension of the subsequence, and d′ is the dimension of the embedding vector, with a value of 512;
[0084] Step 76: According to Equation (5) and Equation (6), after input embedding and positional encoding of Equation (1), the latent fault data of the permanent magnet synchronous motor after preprocessing is obtained It is expressed as
[0085]
[0086] The latent fault data of N permanent magnet synchronous motors corresponds to N latent fault data of the permanent magnet synchronous motor after preprocessing
[0087] Preferably, in step 8, the data of the permanent magnet synchronous motor after preprocessing is input into the trained neural network model, and the trained neural network model outputs the data type of the permanent magnet synchronous motor after preprocessing;
[0088] The data type of the permanent magnet synchronous motor after preprocessing output by the trained neural network model is:
[0089] Normal data, fault data or latent fault data;
[0090] The specific process is as follows:
[0091] Step 81: The latent fault data of the permanent magnet synchronous motor after preprocessing is sequentially input into the first Transformer encoder layer and the second Transformer encoder layer, and the second Transformer encoder layer outputs the time feature X″; It is expressed as:
[0092]
[0093] Among them, X″ is the output time feature of the second Transformer encoder layer; Encoder is the first Transformer encoder layer and the second Transformer encoder layer;
[0094] Step 82: The time feature X″ output by the second Transformer encoder layer is sequentially input into the global average pooling layer and the first fully connected layer, and the first fully connected layer outputs the feature X′"; expressed as:
[0095] X′" = FCN(AdaptiveAvgPool(X")) (11)
[0096] Among them, AdaptiveAvgPool is the global average pooling layer, and FCN is the fully connected layer;
[0097] Step 83: Construct a graph structure based on the physical positions of the sensors; each independent sensor is regarded as a node, and those with connections between nodes are regarded as edges, and the graph structure is converted into an adjacency matrix A;
[0098] Step 84: The adjacency matrix A and the output feature X′" of the first fully connected layer are sequentially input into the first graph attention layer and the second graph attention layer, and the second graph attention layer outputs the spatio-temporal feature Expressed as:
[0099]
[0100] Among them, GAT is the first graph attention layer and the second graph attention layer;
[0101] Step 85: The spatio-temporal feature output by the second graph attention layer is input into the second fully connected layer, and the second fully connected layer outputs the classification result Y.
[0102] Preferably, in step 85, the spatio-temporal feature output by the second graph attention layer is input into the second fully connected layer, and the second fully connected layer outputs the classification result Y; expressed as:
[0103]
[0104] Among them, FCN is the fully connected layer; Y represents the detection result output by the neural network model.
[0105] The beneficial effects of the present invention are:
[0106] The present invention relates to a data-driven hidden fault detection method for permanent magnet synchronous motors based on an attention mechanism. The method uses a general soft sensor model, constructs a spatial identification method based on the measurement space, and realizes the parameter identification of the target dynamic system, the soft sensor model, and the interference term. In view of the cumulative error problem in the iterative process, orthogonal design is realized to reduce the influence of the error on the prediction of latent variables and improve the accuracy of hidden fault detection of permanent magnet synchronous motors.
[0107] First, a model framework that fuses spatio-temporal information and spatial information is proposed. From the physical structure of the permanent magnet synchronous motor, the transformed graph structure is intuitively represented. By connecting the time series data and the physical topology information, a model with higher performance is constructed. Second, for spatio-temporal information fusion, the device sensor data not only changes over time but also there are mutual influences between different components of the device. By combining the Transformer and the graph attention network, both time series and spatial structure information can be captured simultaneously. Third, for enhanced feature extraction, the Transformer is good at processing time series data, while the graph attention network is good at processing graph structure data. The Transformer can expand the receptive field of the graph attention network. Conversely, the graph attention network can also help the Transformer capture complex graph topology information and efficiently aggregate relevant nodes from adjacent regions.
[0108] The purpose of the present invention is to design a robust latent variable prediction scheme and solve the problem of the influence of cumulative error on prediction to achieve the optimal prediction result. Description of the Drawings
[0109] Figure 1 It is the flow chart of the proposed fault detection method;
[0110] Figure 2 It is the graph of the fault detection prediction result. Detailed Embodiments
[0111] Detailed Embodiment 1: The specific process of a fault detection method for permanent magnet synchronous motors based on attention and graph neural networks in this embodiment is as follows:
[0112] Offline training:
[0113] Step 1: Collect the normal data, fault data, and hidden fault data of the permanent magnet synchronous motor;
[0114] Step 2: Preprocess the normal data, fault data, and hidden fault data of the permanent magnet synchronous motor collected in Step 1 to obtain the preprocessed normal data, fault data, and hidden fault data;
[0115] Use the preprocessed normal data, fault data, and hidden fault data as the training set:
[0116] Step 3: Build a neural network model;
[0117] Step 4: Based on the training set Π obtained in Step 2 train Train the neural network model to obtain a trained neural network model;
[0118] Step 5: Save the parameters of the trained neural network model for online detection;
[0119] The manifestation forms of faults include:
[0120] If the current value is not within the specified current value range, it is a fault;
[0121] If the voltage value is not within the specified voltage value range, it is a fault;
[0122] The label of a fault refers to the location where the fault is injected;
[0123] When a permanent magnet synchronous motor is operating normally, the current value is within the specified current value range, the voltage value is within the specified voltage value range, and the normal waveform of the current or voltage signal data is a sine wave;
[0124] A latent fault refers to a fault that will not appear under normal operating conditions but will cause the equipment to malfunction after long-term operation; Latent faults include two types, namely offset type faults and periodic type faults;
[0125] The manifestation forms of latent faults include:
[0126] If the current value is within the specified current value range but there are abnormalities in the waveform, it is an offset type fault;
[0127] If the current value is within the specified current value range but there are periodic distortions in the waveform, it is a periodic type fault;
[0128] If the voltage value is within the specified voltage value range but there are abnormalities in the waveform, it is an offset type fault.
[0129] If the voltage value is within the specified voltage value range but there are periodic distortions in the waveform, it is a periodic type fault;
[0130] The label of a latent fault refers to the location where the latent fault is injected and the type of the injected latent fault;
[0131] The location where the latent fault is injected is inside the permanent magnet synchronous motor, the injected latent fault is a sensor fault, and the injected latent fault includes two types, namely offset type faults and periodic type faults;
[0132] The offset type fault is a common type of hidden fault. The normal waveform of the current or voltage signal data is a sine wave. After the hidden fault occurs, there are abnormalities in the waveform of the current or voltage signal data;
[0133] The periodic type fault is a rare type of hidden fault. The normal waveform of the current or voltage signal data is a sine wave. After the hidden fault occurs, there are periodic distortions in the waveform of the current or voltage signal data;
[0134] Online detection:
[0135] Step 6: Obtain N groups of original current or voltage signal data X with a length of L to be measured through N sensors;
[0136] Step 7: Preprocess the N groups of original current or voltage signal data X with a length of L to be measured obtained in Step 6 to obtain N groups of preprocessed permanent magnet synchronous motor data;
[0137] Step 8: Input the preprocessed permanent magnet synchronous motor data into the trained neural network model, and the trained neural network model outputs the data type of the preprocessed permanent magnet synchronous motor;
[0138] The data type of the preprocessed permanent magnet synchronous motor output by the trained neural network model is:
[0139] Normal data, fault data or hidden fault data.
[0140] Specific Embodiment 2: The difference between this embodiment and Specific Embodiment 1 is that the normal data, fault data and hidden fault data of the permanent magnet synchronous motor in Step 1 are specifically:
[0141] Normal data is:
[0142] The current value is within the specified current value range;
[0143] The voltage value is within the specified voltage value range;
[0144] Fault data is:
[0145] The current value is not within the specified current value range;
[0146] The voltage value is not within the specified voltage value range;
[0147] Hidden fault data includes offset type faults and periodic type faults;
[0148] Hidden fault data is:
[0149] The value of the current is within the specified current value range, but there are abnormalities in the waveform, which is an offset type fault;
[0150] The value of the current is within the specified current value range, but there are periodic distortions in the waveform, which is a periodic type of fault;
[0151] The value of the voltage is within the specified voltage value range, but there are abnormalities in the waveform, which is an offset type of fault.
[0152] The value of the voltage is within the specified voltage value range, but there are periodic distortions in the waveform, which is a periodic type of fault;
[0153] The labels of normal data, fault data, and latent fault data refer to the types of normal data, fault data, and latent fault data, the positions of the injected faults and latent fault data, and the types of injected latent faults.
[0154] Other steps and parameters are the same as those in the first specific implementation manner.
[0155] The third specific implementation manner: The difference between this implementation manner and the first or second specific implementation manner is that in step 1, normal data, fault data, and latent fault data of the permanent magnet synchronous motor are collected;
[0156] Latent faults usually do not cause obvious damage to the system and are not easily detected immediately, but may have a negative impact on the long-term performance and reliability of the motor;
[0157] The specific process is as follows:
[0158] Step 11: Through a single sensor, obtain a set of original signal data of current or voltage with a length of L, denoted as X ∈ R L , and regard the original signal data of current or voltage with a length of L obtained by a single sensor as a feature;
[0159] Through N sensors, obtain N sets of original signal data of current or voltage with a length of L, denoted as X ∈ R N×L ;
[0160] The sensors are integrated on the permanent magnet synchronous motor;
[0161] Step 12: Split each set of original signal data of current or voltage with a length of L into sub-samples with a length of d in chronological order, without overlap between each sub-sample, and assign corresponding labels to each sub-sample; denoted as:
[0162] X = [x 1 , x 2 , …, x i , …, x n (1)
[0163] Π = [(x 1 , y 1 ), (x 2 , y2 ),…,(x i ,y i ),…,(x n ,y n )] (2)
[0164]
[0165] Among them, Π represents the set of subsamples, x 1 represents the first subsample of length d after splitting, y 1 represents the label corresponding to the first subsample x 1 of length d after splitting, x 2 represents the second subsample of length d after splitting, y 2 represents the label corresponding to the second subsample x 2 of length d after splitting, x i represents the second subsample of length d after splitting, y i represents the label corresponding to the second subsample x 2 of length d after splitting, x n represents the nth subsample of length d after splitting, y n represents the label corresponding to the nth subsample x n of length d after splitting, and n represents the number of subsamples.
[0166] Other steps and parameters are the same as those in the first or second specific implementation manners.
[0167] Specific implementation manner four: The difference between this implementation manner and one of the first to third specific implementation manners is that in step 2, the normal data, fault data, and latent fault data of the permanent magnet synchronous motor collected in step 1 are preprocessed to obtain the preprocessed normal data, fault data, and latent fault data;
[0168] The preprocessed normal data, fault data, and latent fault data are used as the training set:
[0169] The specific process is as follows:
[0170] Step 21: Each data x i in each subsample set Π in formula (2) is processed as follows to obtain the processed data x′ i ; expressed as
[0171] x′ i = W e x i + b e (4)
[0172] Among them, W e and be are learnable parameter matrices and bias vectors;
[0173] Based on all the processed data x′ corresponding to each subset collection Π i ; obtain current or voltage signal data X′ of each group with a length of L;
[0174] Step 22: Perform Input Embedding on the current or voltage signal data X′ of each group with a length of L to obtain the data after input embedding which is expressed as:
[0175]
[0176] where IE represents Input Embedding (the English abbreviation of Input Embedding);
[0177] Step 23: The Positional Encoding PE based on the sine function and cosine function is expressed as
[0178]
[0179] where t is the time step, i is the dimension of the subsequence, and d′ is the dimension of the embedding vector, with a value of 512;
[0180] Step 24: According to Equation (5) and Equation (6), Equation (1) undergoes input embedding and positional encoding to obtain the preprocessed implicit fault data of the permanent magnet synchronous motor which is expressed as
[0181]
[0182] Step 25: Take the data in (7) as the training set without labels, then there is
[0183]
[0184] where X train is the training set without labels;
[0185] Step 26: Divide Π into a training set according to (8); which is expressed as:
[0186] Π = Π train (9)
[0187] where Π train is the training set with labels.
[0188] Other steps and parameters are the same as those in any one of the specific embodiments one to three.
[0189] Specific Embodiment 5: The difference between this embodiment and any one of Embodiments 1 to 4 is that in step 3, a neural network model is built; the specific process is as follows:
[0190] The neural network model sequentially includes a first Transformer encoder layer, a second Transformer encoder layer, a global average pooling layer, a first fully connected layer, a first graph attention layer, a second graph attention layer, and a second fully connected layer.
[0191] Other steps and parameters are the same as those in any one of Embodiments 1 to 4.
[0192] Specific Embodiment 6: The difference between this embodiment and any one of Embodiments 1 to 5 is that in step 4, based on the training set Π obtained in step 2 train train the neural network model to obtain a trained neural network model; the specific process is as follows:
[0193] The training set Π containing labels train is input into the neural network model for training;
[0194] The neural network model sequentially includes a first Transformer encoder layer, a second Transformer encoder layer, a global average pooling layer, a first fully connected layer, a first graph attention layer, a second graph attention layer, and a second fully connected layer;
[0195] The Adam optimizer is used, the loss function is the cross-entropy loss, the learning rate is 0.00001, the sample batch size is set to 64, and training stops when the number of iterations is 20;
[0196] Obtain a trained neural network model;
[0197] The test set is a dataset for evaluating the model performance, and the accuracy rate and F1 score are used as evaluation metrics. The validation set is used to adjust the model parameters.
[0198] Other steps and parameters are the same as those in any one of Embodiments 1 to 5.
[0199] Specific Embodiment 7: The difference between this embodiment and any one of Embodiments 1 to 6 is that in step 5, save the parameters of the trained neural network model for online detection; the specific process is as follows:
[0200] Save the parameter data of the trained neural network model in a file with the.pth format.
[0201] Other steps and parameters are the same as those in any one of Embodiments 1 to 6.
[0202] Embodiment 8: The difference between this embodiment and any one of Embodiments 1 to 7 is that in step 7, the N groups of original current or voltage signal data X with a length of L obtained in step 6 are preprocessed to obtain N groups of preprocessed permanent magnet synchronous motor data; the specific process is as follows:
[0203] Step 71: Split each group of original current or voltage signal data with a length of L into sub-samples with a length of d in chronological order, and there is no overlap between each sub-sample; expressed as:
[0204] X = [x 1 , x 2 , …, x i , …, x n (1)
[0205] Step 72: Perform the following processing on each data x i in each group to obtain the processed data x′ i ; expressed as
[0206] x′ i = W e x i + b e (4)
[0207] where W e and b e are learnable parameter matrices and bias vectors;
[0208] Step 73: Based on the processed data x′ i ; obtain each group of current or voltage signal data X′ with a length of L;
[0209] Step 74: Perform input embedding on each group of current or voltage signal data X′ with a length of L to obtain the input-embedded expressed as:
[0210]
[0211] where IE represents input embedding (the English abbreviation of Input Embedding);
[0212] Step 75: The positional encoding (Positional Encoding) PE based on the sine function and cosine function is expressed as
[0213]
[0214] where t is the time step, i is the dimension of the subsequence, and d′ is the dimension of the embedding vector, with a value of 512;
[0215] Step 76: According to Equation (5) and Equation (6), after input embedding and positional encoding of Equation (1), the latent fault data of the permanent magnet synchronous motor after preprocessing is obtained It is expressed as
[0216]
[0217] The latent fault data of N permanent magnet synchronous motors corresponds to N pieces of latent fault data of the permanent magnet synchronous motor after preprocessing
[0218] Other steps and parameters are the same as those in any one of the first to seventh specific embodiments
[0219] Specific Embodiment Nine: The difference between this embodiment and any one of the first to eighth specific embodiments is that in step 8: the data of the permanent magnet synchronous motor after preprocessing is input into the trained neural network model, and the trained neural network model outputs the data type of the permanent magnet synchronous motor after preprocessing
[0220] The data type of the permanent magnet synchronous motor after preprocessing output by the trained neural network model is
[0221] Normal data, fault data or latent fault data
[0222] The specific process is
[0223] Step 81: The latent fault data of the permanent magnet synchronous motor after preprocessing is sequentially input into the first Transformer encoder layer and the second Transformer encoder layer, and the second Transformer encoder layer outputs the time feature X″; It is expressed as
[0224]
[0225] Among them, X″ is the time feature output by the second Transformer encoder layer; Encoder is the first Transformer encoder layer and the second Transformer encoder layer
[0226] Step 82: The time feature X″ output by the second Transformer encoder layer is sequentially input into the global average pooling layer and the first fully connected layer, and the first fully connected layer outputs the feature X″′; It is expressed as
[0227] X″′ = FCN(AdaptiveAvgPool(X″)) (11)
[0228] Among them, AdaptiveAvgPool is the global average pooling layer, and FCN is the fully connected layer
[0229] Step 83: Based on the structure of the permanent magnet synchronous motor as prior knowledge, construct a graph structure based on the physical positions of the sensors; according to graph theory, regard each independent sensor as a node, and those with connections between nodes as edges, and convert the graph structure into an adjacency matrix A;
[0230] Step 84: Input the adjacency matrix A and the output feature X″′ of the first fully connected layer into the first graph attention layer and the second graph attention layer in sequence. The second graph attention layer outputs spatio-temporal features It is expressed as:
[0231]
[0232] where GAT is the first graph attention layer and the second graph attention layer;
[0233] Step 85: Input the spatio-temporal features output by the second graph attention layer into the second fully connected layer, and the second fully connected layer outputs the classification result Y.
[0234] Other steps and parameters are the same as those in any one of the first to eighth specific embodiments.
[0235] Specific Embodiment Ten: The difference between this embodiment and any one of the first to ninth specific embodiments is that in the said Step 85, the spatio-temporal features output by the second graph attention layer are input into the second fully connected layer, and the second fully connected layer outputs the classification result Y; it is expressed as:
[0236]
[0237] where FCN is the fully connected layer; Y represents the detection result output by the neural network model.
[0238] Other steps and parameters are the same as those in any one of the first to ninth specific embodiments.
[0239] The present invention can also have many other embodiments. Without departing from the spirit and essence of the present invention, those skilled in the art can make various corresponding changes and deformations according to the present invention, but these corresponding changes and deformations should all fall within the protection scope of the appended claims of the present invention.
Claims
1. A permanent magnet synchronous motor fault detection method based on attention and graph neural network, characterized in that: The specific process of the method is: Offline training: Step 1: Collect normal data, fault data and hidden fault data of the permanent magnet synchronous motor; Step 2: preprocessing the normal data, fault data and hidden fault data of the permanent magnet synchronous motor collected in step 1 to obtain the preprocessed normal data, fault data and hidden fault data; The preprocessed normal data, fault data and hidden fault data are used as training sets: Step 3: Build a neural network model; Step 4: Based on the training set Π obtained in step 2 train Train the neural network model to obtain a trained neural network model; Step 5: Save the trained neural network model parameters; Online detection: Step 6: Obtain N groups of current or voltage raw signal data X with a length of L to be measured through N sensors; Step 7: preprocessing the N groups of current or voltage original signal data X with a length of L to be tested obtained in step 6 to obtain N groups of preprocessed permanent magnet synchronous motor data; Step 8: input the preprocessed data of the permanent magnet synchronous motor into the trained neural network model, and the trained neural network model outputs the data type of the preprocessed permanent magnet synchronous motor; The data type of the permanent magnet synchronous motor after preprocessing output by the trained neural network model is: Normal data, fault data or hidden fault data.
2. A permanent magnet synchronous motor fault detection method based on attention and graph neural network according to claim 1, characterized in that: The normal data, fault data and hidden fault data of the permanent magnet synchronous motor in step 1 are specifically: Normal data is: The current value is within the specified current value range; The voltage value is within the specified voltage value range; The fault data is: The current value is not within the specified current value range; The voltage value is not within the specified voltage value range; Hidden fault data include bias type faults and cycle type faults; Hidden fault data is: The current value is within the specified current value range, but there is an abnormality in the waveform, which is a bias type fault; The current value is within the specified current value range, but there is periodic distortion in the waveform, which is a periodic type fault; The voltage value is within the specified voltage value range, but there is an abnormality in the waveform, which is a bias type fault. The voltage value is within the specified voltage value range, but there is periodic distortion in the waveform, which is a periodic type fault; The labels of normal data, fault data and hidden fault data refer to the types of normal data, fault data and hidden fault data, the locations of injected fault and hidden fault data and the types of injected hidden faults.
3. A permanent magnet synchronous motor fault detection method based on attention and graph neural network according to claim 2, characterized in that: In step 1, normal data, fault data and hidden fault data of the permanent magnet synchronous motor are collected; the specific process is: Step 11: Through a single sensor, obtain a set of current or voltage raw signal data with a length of L, represented by X∈R L , the raw signal data of current or voltage obtained by a single sensor with a length of L is regarded as a feature; Through N sensors, N groups of current or voltage raw signal data with a length of L are obtained, expressed as X∈R N×L ; Step 12: Split each set of current or voltage raw signal data of length L into sub-samples of length d in chronological order, with no overlap between each sub-sample, and assign a corresponding label to each sub-sample; expressed as: X=[x1,x2,…,x i ,…,x n ] (1) Π=[(x1,y1),(x2,y2),…,(x i ,and i ),…,(x n ,and n )] (2) Where Π represents the subsample set, x1 represents the first subsample with a length of d after splitting, y1 represents the label corresponding to the first subsample x1 with a length of d after splitting, x2 represents the second subsample with a length of d after splitting, y2 represents the label corresponding to the second subsample x2 with a length of d after splitting, and x i It represents the second subsample of length d after splitting, y i Indicates the label corresponding to the second subsample x2 of length d after splitting, x n represents the nth subsample of length d after splitting, y n Represents the nth subsample x of length d after splitting n The corresponding label, n represents the number of sub-samples.
4. A permanent magnet synchronous motor fault detection method based on attention and graph neural network according to claim 3, characterized in that: In the step 2, the normal data, fault data and hidden fault data of the permanent magnet synchronous motor collected in the step 1 are preprocessed to obtain the preprocessed normal data, fault data and hidden fault data; The preprocessed normal data, fault data and hidden fault data are used as training sets: The specific process is: Step 21: For each data x of each sub-sample set Π in equation (2) i Perform the following processing to obtain the processed data x′ i ; denoted as x′ i =W e x i +b e (4) Among them, W e and b e is the learnable parameter matrix and bias vector; Based on all processed data x′ corresponding to each sub-sample set Π i ; Obtain each set of current or voltage signal data X′ with a length of L; Step 22: Perform input embedding on each set of current or voltage signal data X′ of length L to obtain the embedded input It is expressed as: Among them, IE means input embedding; Step 23: Positional Encoding PE based on sine and cosine functions is expressed as Where t is the time step, i is the dimension of the subsequence, and d′ is the dimension of the embedding vector, which is 512; Step 24: According to equations (5) and (6), equation (1) is input embedded and position encoded to obtain the preprocessed hidden fault data of the permanent magnet synchronous motor: Expressed as Step 25: Place (7) As a training set without labels, we have Among them, X train is a training set without labels; Step 26: Divide Π into a training set according to (8); expressed as: ∏=∏ train (9) Among them, train is the training set containing labels.
5. A permanent magnet synchronous motor fault detection method based on attention and graph neural network according to claim 4, characterized in that: In step 3, a neural network model is constructed; the specific process is as follows: The neural network model includes the first Transformer encoder layer, the second Transformer encoder layer, the global average pooling layer, the first fully connected layer, the first graph attention layer, the second graph attention layer, and the second fully connected layer in sequence.
6. A permanent magnet synchronous motor fault detection method based on attention and graph neural network according to claim 5, characterized in that: The step 4 is based on the training set ∏ obtained in step 2 train Train the neural network model to obtain a trained neural network model; the specific process is: The training set Π containing labels train Input into the neural network model for training; The neural network model includes the first Transformer encoder layer, the second Transformer encoder layer, the global average pooling layer, the first fully connected layer, the first graph attention layer, the second graph attention layer, and the second fully connected layer in sequence; The Adam optimizer was used, the loss function was cross entropy loss, the learning rate was 0.00001, the sample batch was set to 64, and the training was stopped when the number of iterations was 20; Get the trained neural network model.
7. A permanent magnet synchronous motor fault detection method based on attention and graph neural network according to claim 6, characterized in that: In step 5, the trained neural network model parameters are saved; the specific process is: Save the parameter data of the trained neural network model in a .pth format file.
8. A permanent magnet synchronous motor fault detection method based on attention and graph neural network according to claim 7, characterized in that: In the step 7, the N groups of current or voltage original signal data X with a length of L to be tested obtained in step 6 are preprocessed to obtain N groups of preprocessed permanent magnet synchronous motor data; The specific process is: Step 71: Split each group of current or voltage original signal data of length L into sub-samples of length d in time sequence, and each sub-sample does not overlap; expressed as: X=[x1,x2,…,x i ,…,x n ] (1) Step 72: For each data x in each group i Perform the following processing to obtain the processed data x′ i ; expressed as x′ i =W e x i +b e (4)W e and b e is the learnable parameter matrix and bias vector; Step 73: Based on the processed data x′ i ; Obtain each set of current or voltage signal data X′ with a length of L; Step 74: Perform input embedding on each set of current or voltage signal data X′ of length L to obtain the embedded input data. It is expressed as: Among them, IE means input embedding; Step 75: Positional Encoding PE based on sine and cosine functions is expressed as Where t is the time step, i is the dimension of the subsequence, and d′ is the dimension of the embedding vector, which is 512; Step 76: According to equations (5) and (6), equation (1) is input embedded and position encoded to obtain the preprocessed hidden fault data of the permanent magnet synchronous motor. Expressed as N groups of hidden fault data of permanent magnet synchronous motors correspond to N pre-processed hidden fault data of permanent magnet synchronous motors 9. A permanent magnet synchronous motor fault detection method based on attention and graph neural network according to claim 8, characterized in that: In the step 8, the pre-processed data of the permanent magnet synchronous motor is input into the trained neural network model, and the trained neural network model outputs the data type of the pre-processed permanent magnet synchronous motor; The data type of the permanent magnet synchronous motor after preprocessing output by the trained neural network model is: Normal data, fault data or hidden fault data; The specific process is: Step 81: The pre-processed hidden fault data of the permanent magnet synchronous motor is sequentially input into the first Transformer encoder layer and the second Transformer encoder layer, and the second Transformer encoder layer outputs the time feature X″; which is expressed as: Among them, X″ is the output time feature of the second Transformer encoder layer; Encoder is the first Transformer encoder layer and the second Transformer encoder layer; Step 82: The temporal feature X″ output by the second Transformer encoder layer is sequentially input into the global average pooling layer and the first fully connected layer, and the first fully connected layer outputs the feature X″′; it is expressed as: X″′=FCN(AdaptiveAvgPool(X″)) (11) Among them, AdaptiveAvgPool is the global average pooling layer, and FCN is the fully connected layer; Step 83: construct a graph structure based on the physical location of the sensor; regard each independent sensor as a node, and regard the connections between nodes as edges, and convert the graph structure into an adjacency matrix A; Step 84: Input the adjacency matrix A and the first fully connected layer output feature X″′ into the first graph attention layer, the second graph attention layer, and the second graph attention layer outputs the spatiotemporal feature It is expressed as: Among them, GAT is the first image attention layer and the second image attention layer; Step 85: The spatiotemporal features output by the second graph attention layer are input into the second fully connected layer, and the second fully connected layer outputs the classification result Y.
10. A permanent magnet synchronous motor fault detection method based on attention and graph neural network according to claim 9, characterized in that: The spatiotemporal features output by the second graph attention layer in step 85 are input to the second fully connected layer, and the second fully connected layer outputs the classification result Y; it is expressed as: Among them, FCN is a fully connected layer; Y represents the detection result output by the neural network model.
Citation Information
Cited By
Generator motor insulation state prediction method and system
CN122109755A
A method and system for predicting the insulation condition of a generator motor
CN122109755B