Direct current motor fault detection method and device based on two-stage contrast learning
Through the two-level comparison learning method, a health feature coding network and a motor feature coding network are built to extract the health features of DC motors, solving the problem of low fault detection accuracy, and achieving efficient fault detection under small sample conditions.
Patent Information
- Application Number
- CN202510281199.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-11
- Publication Date
- 2025-06-27
AI Technical Summary
DC motor failures are weak in the initial stage, and the fault signal is easily disturbed by noise. Deep learning methods face the problems of fewer fault samples and unbalanced samples, resulting in low fault detection accuracy.
The fault detection method based on two-level comparison learning is adopted. By building a health feature coding network and a motor feature coding network, two-level comparison learning training is carried out to extract motor health characteristics, reduce dependence on fault samples, and improve detection accuracy.
Through the two-stage comparison learning method, the accuracy and robustness of DC motor fault detection are improved, and fault detection can be effectively detected under small sample conditions and noise interference can be reduced.
Smart Images

Figure CN120214563A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of fault detection, and more specifically, to a DC motor fault detection method and device based on two-stage contrastive learning. Background Art
[0002] Currently, DC motors play an important role in many fields such as industry, transportation, and energy. They are widely used in automatic control systems and various electric equipment due to their good speed regulation performance and high efficiency; DC motors adjust speed and torque by controlling the current direction and are crucial in precision control systems; in addition, due to their high response speed and flexible driving method, DC motors have become the first choice in many high-precision scenarios.
[0003] Therefore, the safe and stable operation of DC motors plays a crucial role in practical applications.
[0004] Due to characteristics such as long-term and high-speed continuous operation, the wear of mechanical components such as the brushes, commutators, and motor bearings of DC motors is inevitable and will gradually evolve into faults over time. Detecting potential faults early helps to avoid equipment downtime and serious damage.
[0005] However, the faults of DC motors are extremely weak in the initial stage, and the fault signals are easily interfered by noise. In addition, deep learning-based fault detection methods face problems such as few fault samples and extremely unbalanced sample quantities.
[0006] Therefore, how to overcome the problems of noise interference and scarce fault samples in order to improve the accuracy of DC motor fault detection is an urgent problem to be solved by those skilled in the art. Summary of the Invention
[0007] In view of this, the present invention provides a DC motor fault detection method and device based on two-stage contrastive learning to solve the technical problems mentioned in the background art.
[0008] To achieve the above object, the present invention adopts the following technical solutions:
[0009] A DC motor fault detection method based on two-stage contrastive learning, comprising the following steps:
[0010] S1. Obtain a set of original data of current signals and voltage signals of a DC motor and perform normalization processing;
[0011] S2. Build a healthy feature encoding network as the first-stage network and build a motor feature encoding network as the second-stage network;
[0012] S3. Connect the first - level network in series with the second - level network, and use the current signal and voltage signal data of the DC motor after standardization to perform two - level contrastive learning training on the health feature encoding network and the motor feature encoding network;
[0013] S4. Input the current signal and voltage signal data of the DC motor to be detected into the trained health feature encoding network, output the health index, and complete the fault detection through threshold judgment to obtain the fault state of the DC motor.
[0014] Preferably, in step S1, the method of standardization is:
[0015]
[0016] where \(X\) is the original data of the current signal or voltage signal, \(\mu\) and \(\sigma\) are the mean and standard deviation of the original data respectively, and \(\hat{X}\) std is the data after standardization.
[0017] Preferably, the health feature encoding network includes a parallel current health feature encoding module and a voltage health feature encoding module, and the motor feature encoding network includes a parallel motor current feature encoding module and a motor voltage feature encoding module.
[0018] Preferably, the current health feature encoding module, the voltage health feature encoding module, the motor current feature encoding module, and the motor voltage feature encoding module all adopt the same network architecture, specifically including: a padding layer, a linear layer, a positional embedding layer, and two Transformer encoders. Among them, the Transformer encoder includes two - layer perceptrons, a normalization layer, and a multi - head attention layer.
[0019] Preferably, the specific content of step S3 includes:
[0020] S31. Connect the first - level network in series with the second - level network, and the output of the first - level network is used as the input of the second - level network;
[0021] S32. Construct a two - level contrastive learning loss function, including the loss function of the first - level network and the loss function of the second - level network. The loss function of the first - level network includes a current similarity loss and a voltage similarity loss, and the loss function of the second - level network is a contrastive fusion loss of the current signal and the voltage signal;
[0022] S33. Construct a reverse propagation path of the loss function gradient;
[0023] S34. Perform two - level contrastive learning training using the current signal and voltage signal data of the DC motor after standardization, that is, iteratively update the parameters of the two - level neural network through the mini - batch stochastic gradient descent method.
[0024] Preferably, the calculation method of the loss function gradient backpropagation path is as follows:
[0025]
[0026] where δ (l) is the error of the l-th layer during network backpropagation, (j > i) is the error propagation matrix from the j-th layer to the i-th layer of the network, d i and d j are the numbers of neurons in the i-th layer and the j-th layer respectively, is the extended identity matrix, L1 and L2 respectively represent the loss functions of the first-level network and the second-level network, y1 and y2 are the outputs of the first-level network and the second-level network respectively, and m and n are the numbers of layers of the first-level network and the second-level network respectively.
[0027] Preferably, in step S4, only the outputs of the current health feature encoding module and the voltage health feature encoding module in the first-level network are taken as the health index, and the second-level network does not participate in the fault detection process. The health index is specifically:
[0028]
[0029] where H I , H V respectively represent the current health index and the voltage health index of the DC motor, h I , h V respectively represent the outputs of the current health feature encoding module and the voltage health feature encoding module, and (·) T represents matrix transpose.
[0030] A DC motor fault detection system based on two-stage contrast learning, based on the above-mentioned DC motor fault detection method based on two-stage contrast learning, includes:
[0031] A data acquisition module, which is used to acquire the original data of the DC motor current signal and voltage signal and perform normalization processing;
[0032] A training module, which is used to perform two-stage contrast learning training on the built neural network based on the normalized data. The built neural network includes a health feature encoding network and a motor feature encoding network. The health feature encoding network is used as the first-level network, and the motor feature encoding network is used as the second-level network. The first-level network and the second-level network are connected in series;
[0033] A diagnosis module, which is used to input the data of the DC motor current signal and voltage signal to be detected into the trained health feature encoding network, output the health index, and complete the fault detection through threshold judgment to obtain the fault state of the DC motor.
[0034] A computer-readable storage medium stores a computer program thereon, and when the computer program is executed by a processor, it implements the described method for detecting DC motor faults based on two-level contrast learning.
[0035] A processing terminal includes a memory and a processor. A computer program that can run on the processor is stored in the memory, and when the processor executes the computer program, it implements the described method for detecting DC motor faults based on two-level contrast learning.
[0036] As can be seen from the above technical solutions, compared with the prior art, the present invention discloses a method and device for detecting DC motor faults based on two-level contrast learning. By calculating the similarity between DC motors through the contrast learning method, the healthy features of the motors are extracted, thereby reducing the dependence on fault samples and realizing fault detection under the condition of small fault samples. The present invention realizes the synchronous joint training of the two-level network by constructing a gradient backpropagation method for two-level contrast learning, improves the ability of the network to extract fault features by introducing more empirical knowledge, and improves the convergence speed of network training, thereby improving the accuracy and robustness of DC motor fault detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the following drawings are only the embodiments of the present invention, and those of ordinary skill in the art can also obtain other drawings according to the provided drawings without creative efforts.
[0038] Figure 1 It is a flowchart of a method for detecting DC motor faults based on two-level contrast learning provided by the present invention;
[0039] Figure 2 It is a schematic diagram of the overall structure of a two-level contrast learning network provided by the present invention;
[0040] Figure 3 It is a schematic diagram of the specific structures of a healthy feature encoding network and a motor feature encoding network provided by the present invention;
[0041] Figure 4 It is a schematic diagram of two-level contrast learning training of a neural network provided by the present invention;
[0042] Figure 5 It is a schematic diagram of the DC motor fault detection process provided by the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0043] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts belong to the scope of protection of the present invention.
[0044] An embodiment of the present invention discloses a DC motor fault detection method based on two-stage contrastive learning, including the following steps:
[0045] S1. Obtain the original data of the current signal and voltage signal of a group of DC motors and perform standardization processing;
[0046] S2. Build a healthy feature encoding network as the first-stage network and build a motor feature encoding network as the second-stage network;
[0047] S3. Connect the first-stage network and the second-stage network in series, and perform two-stage contrastive learning training on the healthy feature encoding network and the motor feature encoding network using the standardized current signal and voltage signal data of the DC motor;
[0048] S4. Input the current signal and voltage signal data of the DC motor to be detected into the trained healthy feature encoding network, output the health index, and complete the fault detection through threshold judgment to obtain the fault state of the DC motor.
[0049] To further implement the above technical solution, in step S1, the method of standardization processing is:
[0050]
[0051] where X is the original data of the current signal or voltage signal, μ and σ are the mean and standard deviation of the original data respectively, and X std is the data after standardization processing.
[0052] To further implement the above technical solution, as Figure 2 , the healthy feature encoding network includes a current healthy feature encoding module and a voltage healthy feature encoding module connected in parallel, and the motor feature encoding network includes a motor current feature encoding module and a motor voltage feature encoding module connected in parallel.
[0053] To further implement the above technical solution, as Figure 3, the current health feature encoding module, voltage health feature encoding module, motor current feature encoding module, and motor voltage feature encoding module all adopt the same network architecture, specifically including: a padding layer, a linear layer, a positional embedding layer, and two Transformer encoders. Among them, the Transformer encoder includes two layers of perceptrons, two layers of normalization layers, and a multi-head attention layer.
[0054] In this embodiment, the input variable shape of the padding layer is (4, 1024, 1), the input variable shape of the linear layer is (4, 8, 128), the positional embedding layer does not contain learnable parameters, and the input variable shape of the Transformer encoder is (4, 8, 128).
[0055] To further implement the above technical solution, as Figure 4 , the specific content of step S3 includes:
[0056] S31. Connect the first-level network in series with the second-level network, and the output of the first-level network is used as the input of the second-level network;
[0057] Specifically: input the DC motor voltage signal, and connect the voltage health feature encoding module of the health feature encoding network in series with the motor voltage feature encoding module of the motor feature encoding network; input the DC motor current signal, and connect the current health feature encoding module of the health feature encoding network in series with the motor current feature encoding module of the motor feature encoding network;
[0058] S32. Construct a two-level contrastive learning loss function, including the loss function of the first-level network and the loss function of the second-level network. The loss function of the first-level network includes the current similarity loss and the voltage similarity loss, and the loss function of the second-level network is the contrastive fusion loss of the current signal and the voltage signal;
[0059] S33. Construct the loss function gradient backpropagation path;
[0060] S34. Use the standardized DC motor current signal and voltage signal data for two-level contrastive learning training, that is, iteratively update the parameters of the two-level neural network by the mini-batch stochastic gradient descent method.
[0061] In this embodiment, the loss function of the first-level network is specifically:
[0062]
[0063] Among them, L1 represents the loss function of the first-level network, respectively represent the similarity loss of the current and the similarity loss of the voltage, N batch represents the sample batch size during training, i represents the sample batch serial number, (·) Tdenotes matrix transpose, h I , h V respectively denote the outputs of the current health feature encoding module and the voltage health feature encoding module, respectively denote the health degrees of the current signal and the voltage signal of the CMG;
[0064] The loss function of the second-level network is specifically:
[0065]
[0066] where, f I , f V respectively denote the outputs of the motor current feature encoding module and the motor voltage feature encoding module, C is the label matrix, the diagonal elements of which are the labels of each DC motor respectively, and the rest of the elements are 0, Tr(·) denotes the trace of the matrix, N motor is the number of DC motors, i denotes the sample batch serial number, (·) T denotes matrix transpose.
[0067] To further implement the above technical solution, the calculation method of the loss function gradient backpropagation path is:
[0068]
[0069] where, δ (l) is the error of the l-th layer during network backpropagation, (j > i) is the error propagation matrix from the j-th layer to the i-th layer of the network, d i , d j are the numbers of neurons in the i-th layer and the j-th layer respectively, is the extended identity matrix, L1 and L2 respectively denote the loss functions of the first-level network and the second-level network, y1 and y2 are the outputs of the first-level network and the second-level network respectively, and m and n are the numbers of layers of the first-level network and the second-level network respectively.
[0070] To further implement the above technical solution, as Figure 5 , in step S4, only the outputs of the current health feature encoding module and the voltage health feature encoding module in the first-level network are taken as the health degree indicators, and the second-level network does not participate in the fault detection process. The health degree indicators are specifically:
[0071]
[0072] where, H I , H V respectively denote the DC motor current health degree indicator and the voltage health degree indicator, h I , h Vrespectively represent the output of the current health feature encoding module and the output of the voltage health feature encoding module.
[0073] In practical applications, usually the mean value of the output of the current health feature encoding module and the output of the voltage health feature encoding module is taken as the comprehensive health index of the DC motor; the threshold reference value of the comprehensive health index is 0.85.
[0074] A DC motor fault detection system based on two-stage contrastive learning, based on a DC motor fault detection method based on two-stage contrastive learning, includes:
[0075] A data acquisition module, configured to acquire the original data of the current signal and voltage signal of the DC motor and perform normalization processing;
[0076] A training module, configured to perform two-stage contrastive learning training on the built neural network based on the data after normalization processing. The built neural network includes a health feature encoding network and a motor feature encoding network. The health feature encoding network serves as the first-stage network, and the motor feature encoding network serves as the second-stage network. The first-stage network and the second-stage network are connected in series;
[0077] A diagnosis module, configured to input the data of the current signal and voltage signal of the DC motor to be detected into the trained health feature encoding network, output the health index, and complete the fault detection through threshold judgment to obtain the fault state of the DC motor.
[0078] A computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, a DC motor fault detection method based on two-stage contrastive learning is implemented.
[0079] A processing terminal, including a memory and a processor. A computer program that can run on the processor is stored in the memory. When the processor executes the computer program, a DC motor fault detection method based on two-stage contrastive learning is implemented.
[0080] The processor can be a central processing unit CPU, or other general-purpose processors, digital signal processors DSP, application-specific integrated circuits ASIC, field programmable gate arrays FPGA, or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. chips, or a combination of the above types of chips.
[0081] In this specification, the various embodiments are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. The same or similar parts among the various embodiments can be referred to each other. For the devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple, and the relevant parts can be referred to the description of the method part.
[0082] The foregoing description of the disclosed embodiments enables those skilled in the art to implement or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A DC motor fault detection method based on two-level contrast learning, characterized in that: The following steps are involved: S1. Obtain a set of raw data of current signals and voltage signals of a DC motor and perform standardization processing; S2. Build a health feature encoding network as the first-level network and a motor feature encoding network as the second-level network; S3. Connecting the first-level network and the second-level network in series, and using the standardized current signal and voltage signal data of the DC motor to perform two-level comparative learning training on the health feature encoding network and the motor feature encoding network; S4. Input the current signal and voltage signal data of the DC motor to be detected into the trained health feature encoding network, output the health index and complete the fault detection through threshold judgment to obtain the fault status of the DC motor.
2. A DC motor fault detection method based on two-level contrast learning according to claim 1, characterized in that: In step S1, the method of standardization is: Among them, X is the original data of current signal or voltage signal, μ and σ are the mean and standard deviation of the original data respectively, and X std The data is processed after standardization.
3. A DC motor fault detection method based on two-level contrast learning according to claim 1, characterized in that: The health feature coding network includes a current health feature coding module and a voltage health feature coding module connected in parallel, and the motor feature coding network includes a motor current feature coding module and a motor voltage feature coding module connected in parallel.
4. A DC motor fault detection method based on two-level contrast learning according to claim 3, characterized in that: The current health feature encoding module, voltage health feature encoding module, motor current feature encoding module and motor voltage feature encoding module all adopt the same network architecture, including: padding layer, linear layer, position embedding layer and two-layer Transformer encoder, among which the Transformer encoder includes 2 layers of perceptron, normalization layer and multi-head attention layer.
5. A DC motor fault detection method based on two-level contrast learning according to claim 1, characterized in that: The specific contents of step S3 include: S31. Connect the first-level network and the second-level network in series, and use the output of the first-level network as the input of the second-level network; S32. Construct a two-level contrast learning loss function, including a loss function of a first-level network and a loss function of a second-level network, wherein the loss function of the first-level network includes a current similarity loss and a voltage similarity loss, and the loss function of the second-level network is a contrast fusion loss of a current signal and a voltage signal; S33. Construct the loss function gradient back propagation path; S34. Use the standardized DC motor current signal and voltage signal data to perform two-level comparative learning training, that is, iteratively update the parameters of the two-level neural network through the batch stochastic gradient descent method.
6. A DC motor fault detection method based on two-level contrast learning according to claim 5, characterized in that: The calculation method of the loss function gradient back propagation path is: Among them, δ (l) is the error of the lth layer during network back propagation, is the error propagation matrix from the jth layer to the ith layer of the network, d i d j are the number of neurons in the i-th layer and the j-th layer respectively, is the extended unit matrix, L1 and L2 represent the loss function of the first-level network and the loss function of the second-level network respectively, y1 and y2 are the output of the first-level network and the output of the second-level network respectively, m and n are the number of layers of the first-level network and the number of layers of the second-level network respectively.
7. A DC motor fault detection method based on two-level contrast learning according to claim 3, characterized in that: In step S4, only the outputs of the current health feature encoding module and the voltage health feature encoding module in the first-level network are taken as health indicators, and the second-level network does not participate in the fault detection process. The health indicator is specifically: Among them, H I ,H V They represent the DC motor current health index and voltage health index respectively, h I ,h V They represent the output of the current health feature encoding module and the output of the voltage health feature encoding module, respectively. T Represents matrix transpose.
8. A DC motor fault detection system based on two-level contrast learning, characterized in that: A DC motor fault detection method based on two-level contrast learning according to any one of claims 1 to 7, comprising: A data acquisition module is used to acquire the original data of the DC motor current signal and voltage signal and perform standardization processing; A training module is used to perform two-level comparative learning training on the constructed neural network based on the standardized data. The constructed neural network includes a health feature encoding network and a motor feature encoding network. The health feature encoding network is used as the first-level network, and the motor feature encoding network is used as the second-level network. The first-level network and the second-level network are connected in series. The diagnostic module is used to input the current signal and voltage signal data of the DC motor to be detected into the trained health feature encoding network, output the health index and complete the fault detection through threshold judgment to obtain the fault status of the DC motor.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for detecting a fault of a DC motor based on two-level contrast learning as described in any one of claims 1 to 7 is implemented.
10. A processing terminal, comprising a memory and a processor, wherein the memory stores a computer program that can be run on the processor, characterized in that: When the processor executes the computer program, a DC motor fault detection method based on two-level contrast learning as described in any one of claims 1 to 7 is implemented.