A motor fault diagnosis method based on digital twinning and improved random forest
By improving the sparrow search algorithm to optimize random forest, the problem of difficulty in determining forest size and the number of node features was solved, thereby improving the accuracy of motor fault diagnosis and achieving more efficient fault judgment.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ANHUI UNIV OF SCI & TECH
- Filing Date
- 2022-08-23
- Publication Date
- 2026-04-14
AI Technical Summary
In existing technologies, it is difficult to determine the forest size and the number of features per node in random forests for motor fault diagnosis, resulting in insufficient diagnostic accuracy.
An improved sparrow search algorithm is used to optimize random forests. By employing Tent chaotic mapping, genetic crossover mutation, T-distribution, and simulated annealing strategies, the number of decision trees and node features in the random forest are optimized, thus constructing a better fault diagnosis model.
It improved the accuracy of motor fault diagnosis, with a test set verification result of 98.2143%, thus enhancing the effectiveness of daily motor maintenance and fault diagnosis.
Smart Images

Figure CN115481756B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of motor fault diagnosis methods, specifically a motor fault diagnosis method based on digital twins and improved random forests. Background Technology
[0002] Currently, with the advancement of digital twin technology, its application in equipment fault diagnosis is becoming increasingly widespread. For example, permanent magnet synchronous motors used in coal mines can be diagnosed using digital twins. In digital twins, the permanent magnet synchronous motor and its operating parameters are digitized, thereby establishing a corresponding digital twin virtual model. This model is then combined with machine learning methods for fault diagnosis. Specifically, machine learning methods are used to obtain fault diagnosis results, and the consistency of these results is then verified using the digital twin model, thus achieving accurate fault diagnosis.
[0003] In existing technologies, machine learning methods used for fault diagnosis in digital twins include random forests, support vector machines, long short-term memory networks, and backpropagation networks. Among these, random forests are widely used in fault diagnosis due to their high accuracy, resistance to overfitting, and fast training speed. However, existing random forests suffer from the problem of difficulty in determining the forest size and the number of features per node. This invention addresses this issue by optimizing random forests using an improved sparrow search algorithm, thereby improving the accuracy of fault diagnosis. Summary of the Invention
[0004] The purpose of this invention is to provide a motor fault diagnosis method based on digital twins and improved random forests, so as to solve the problem that it is not easy to determine the forest size and the number of features of each node in the fault diagnosis of random forests in the prior art.
[0005] To achieve the above objectives, the technical solution adopted by the present invention is as follows:
[0006] A motor fault diagnosis method based on digital twins and improved random forests includes the following steps:
[0007] Step 1: Obtain the real-time operating parameters and historical data of the permanent magnet synchronous motor as the raw dataset;
[0008] Step 2: Construct a random forest fault diagnosis model, and improve the random forest fault diagnosis model using an improved sparrow search algorithm to obtain an improved random forest fault diagnosis model.
[0009] Step 3: Divide the original dataset from Step 1 into a test set and a training set. Use the training set to train the improved random forest fault diagnosis model and use the test set to verify the accuracy of the improved random forest, thus obtaining the permanent magnet synchronous motor fault diagnosis model.
[0010] Step 4: Use the permanent magnet synchronous motor fault diagnosis model obtained in Step 3 to diagnose the faults of the permanent magnet synchronous motor.
[0011] In a further step 2, the random forest fault diagnosis model includes a data acquisition module, a data processing module, and a diagnosis module. The acquisition module acquires the stator current of the permanent magnet synchronous motor and transmits it to the data processing module. The data processing module performs VMD decomposition on the input data to obtain the fault characteristics of the stator current and then inputs them to the diagnosis module. The diagnosis module judges the health status of the permanent magnet synchronous motor based on the characteristics of the stator current decomposition.
[0012] In further step 2, an improved sparrow search algorithm is used in the diagnosis module of the random forest. The error rate of the random forest fault diagnosis is used as the fitness function of the improved sparrow search algorithm. The improved sparrow search algorithm finds the global optimum and outputs two parameters: the number of decision trees (ntree) and the number of features at each node (mtry). Based on the optimal parameters of ntree and mtry, the optimal random forest fault diagnosis model is obtained as the improved random forest fault diagnosis model. The improved sparrow search algorithm process is as follows:
[0013] S21. Set the initial parameters of the algorithm: population size, proportion of discoverers, proportion of scouts and early warnings, and number of iterations;
[0014] S22. Initialize the sparrow population by introducing the Tent chaotic map, which is characterized by the Tent chaotic map, as shown in formulas (1) and (2):
[0015]
[0016] In formula (1), x t and x t+1 These represent the sparrow's position at the current moment and the position at the next moment, respectively.
[0017] x new =lb+(ub-lb)x d (2),
[0018] In formula (2), x new For the new population obtained using the Tent chaotic mapping, ub and lb are the upper and lower bounds of the variable x, x d It is a Tent chaotic sequence;
[0019] S23. Update the sparrow's position according to the position update formula of the sparrow joiner, discoverer and scout, use the error rate of random forest as the fitness function, calculate the fitness function, and obtain the optimal population X;
[0020] S24. Based on the improved strategy of genetics, crossover and mutation are used to obtain population pop1, where the crossover probability Pc = 0.8 and the mutation probability Pm = 0.1.
[0021] S25. Obtain the population pop2 according to the improved strategy T distribution, as shown in formula (3):
[0022] x i (new) = x i (old)+x i (old)t iter (3),
[0023] In formula (3), x i (new), x i (old) represents the new position of the i-th sparrow after the mutation and its original position before the mutation, respectively. t iter The T-distribution represents the relationship between the number of iterations;
[0024] S26. Based on the improved strategy, simulated annealing is used to obtain population pop3, as shown in formula (4):
[0025] T x+1 =λT x (4),
[0026] In formula (4), T represents the annealing temperature, which determines the probability that the sparrow will accept the new position, and λ is the annealing coefficient and λ∈[0.9,1]; when the fitness value f of the new position... new Better than the current optimal fitness value f o When the fitness value is positive, it will directly replace the original fitness value; otherwise, it needs to follow the Metropolis criterion and be judged according to formula (5):
[0027]
[0028] If formula (5) is true, then the new position is accepted; otherwise, it is not accepted.
[0029] S27. Sort the population [X pop1 pop2 pop3] according to fitness, retain the better individuals, obtain the optimal position and its fitness value, and then perform iterative operation to find the global optimal solution.
[0030] Compared with the prior art, the advantages of the present invention are:
[0031] 1. This invention improves the Sparrow Search algorithm by introducing four strategies: Tent chaotic mapping, crossover mutation based on genetics, T-distribution, and simulated annealing. Compared with the previous version, the Sparrow Search algorithm enhances the global search capability, convergence speed, and ability to escape local optima. It can better optimize the two variables ntree and mtry in the random forest and construct a better random forest fault diagnosis model.
[0032] 2. This invention uses an improved sparrow search algorithm to optimize random forest, which achieves a higher accuracy rate in fault diagnosis of permanent magnet synchronous motors, reaching 98.2143% in the test set verification, thus achieving better results in the daily maintenance and fault diagnosis of permanent magnet synchronous motors. Attached Figure Description
[0033] Figure 1 This is a diagram illustrating the fault diagnosis effect of the permanent magnet synchronous motor of the coal mine belt conveyor according to the present invention.
[0034] Figure 2 This is a flowchart of the fault diagnosis process for permanent magnet synchronous motors using the improved sparrow search algorithm of this invention.
[0035] Figure 3 This invention presents a block diagram for fault diagnosis of permanent magnet synchronous motors using an improved sparrow search algorithm, optimized random forest, and digital twin.
[0036] Figure 4 These are the test results of the improved sparrow search algorithm and optimized random forest algorithm proposed in this invention. Detailed Implementation
[0037] The technical solutions of the embodiments of the present invention will be further described in detail below with reference to the accompanying drawings. Obviously, the embodiments described below are some embodiments of the present invention, but not all embodiments. These embodiments are provided so that the present invention can be more thoroughly understood and the scope of the present invention can be fully conveyed to those skilled in the art.
[0038] like Figure 1 As shown, this invention provides an embodiment for fault diagnosis of permanent magnet synchronous motors in coal mine belt conveyors by using an improved random forest algorithm combined with a digital twin mountain model.
[0039] Among them, the fault diagnosis method for permanent magnet synchronous motors based on improved random forests is as follows: Figure 2 As shown, it includes the following steps:
[0040] Step 1: Obtain the real-time operating parameters and historical data of the permanent magnet synchronous motor as the raw dataset;
[0041] Step 2: Construct a random forest fault diagnosis model. The random forest fault diagnosis model includes a data acquisition module, a data processing module, and a diagnosis module. The acquisition module collects the stator current of the permanent magnet synchronous motor and transmits it to the data processing module. The data processing module performs VMD decomposition on the input data to obtain the fault characteristics of the stator current and then inputs them to the diagnosis module. The diagnosis module judges the health status of the permanent magnet synchronous motor based on the characteristics of the stator current decomposition.
[0042] Using the error rate of random forest fault diagnosis as the fitness function of the improved sparrow search algorithm, the global optimum is found using the improved sparrow search algorithm, outputting two parameters: the number of decision trees (ntree) and the number of features at each node (mtry). Then, based on the optimal parameters (ntree and mtry) of the random forest, the optimal random forest fault diagnosis model is obtained as the improved random forest fault diagnosis model. The improved sparrow search algorithm process is as follows:
[0043] S21. Set the initial parameters of the algorithm: population size, discoverer ratio, scout / warning ratio, and number of iterations.
[0044] S22. Initialize the sparrow population by introducing the Tent chaotic map, which is characterized by the Tent chaotic map, as shown in formulas (1) and (2):
[0045]
[0046] In formula (1), x t and x t+1 These represent the sparrow's position at the current moment and the position at the next moment, respectively.
[0047] x new =lb+(ub-lb)x d (2),
[0048] In formula (2), x new For the new population obtained using the Tent chaotic mapping, ub and lb are the upper and lower bounds of the variable x, x d It is a Tent chaotic sequence.
[0049] S23. Update the sparrow's position according to the position update formula of the sparrow joiner, discoverer and scout, calculate the fitness function with the error rate of random forest as the fitness function, and obtain the optimal population X.
[0050] S24. Based on the improved genetic strategy of crossover and mutation, the population pop1 is obtained, where the crossover probability Pc = 0.8 and the mutation probability Pm = 0.1.
[0051] S25. Obtain the population pop2 according to the improved strategy T distribution, as shown in formula (3):
[0052] x i (new) = x i (old)+x i (old)t iter (3),
[0053] In formula (1), x i (new), x i (old) represents the new position of the i-th sparrow after the mutation and its original position before the mutation, respectively. t iter This represents the T-distribution related to the number of iterations.
[0054] S26. Based on the improved strategy, simulated annealing is used to obtain population pop3, as shown in formula (4):
[0055] T x+1 =λT x (4),
[0056] In formula (4), T represents the annealing temperature, which determines the probability that the sparrow will accept the new position, and λ is the annealing coefficient and λ∈[0.9,1].
[0057] The fitness value f of the new position new Better than the current optimal fitness value f o When the fitness value is positive, it will directly replace the original fitness value; otherwise, it needs to follow the Metropolis criterion and be judged according to formula (5):
[0058]
[0059] If formula (5) is true, the new position is accepted; otherwise, it is not accepted.
[0060] S27. Sort the population [X pop1 pop2 pop3] according to fitness, retain the better individuals, and obtain the optimal position and its fitness value. Then perform iterative operation to find the global optimum.
[0061] Step 3: Divide the original dataset from Step 1 into a test set and a training set. Use the training set to train the improved random forest model, and use the test set to verify the accuracy of the improved random forest, thus obtaining the permanent magnet synchronous motor fault diagnosis model. The test set verification results are as follows: Figure 3 As shown;
[0062] Step 4: Use the optimal model obtained in Step 3 to diagnose the faults of the permanent magnet synchronous motor.
[0063] Among them, the improved random forest algorithm combined with the digital twin mountain model is used to study the permanent magnet synchronous motor of the coal mine belt conveyor, which includes a sensing layer, a transmission layer, a model layer, and a service layer, such as... Figure 4As shown. The specific fault diagnosis steps are as follows:
[0064] (1) Construct a digital twin model of the belt conveyor.
[0065] (2) Real-time data of permanent magnet synchronous motors are collected through voltage sensors, current sensors, vibration sensors, acceleration sensors and other sensors in the sensing layer.
[0066] (3) Use the OPCUA communication protocol to transmit the collected data to the model layer (ISSA-RF fault diagnosis model and digital twin model), and also store the data in MySQL data so as to continuously expand the machine learning dataset and dynamically increase its diagnostic accuracy.
[0067] (4) The model layer outputs the fault type and fault degree, and determines the fault location in the digital twin model.
[0068] (5) Perform three-dimensional visualization monitoring of the equipment at the service layer, display the fault diagnosis results, and generate optimization decision-making schemes to be fed back to the physical entity.
[0069] The embodiments described herein are merely preferred embodiments of the invention and are not intended to limit the concept and scope of the invention. Any modifications and improvements made by those skilled in the art to the technical solutions of the invention without departing from the design concept of the invention should fall within the protection scope of the invention. The technical content for which protection is sought in this invention has been fully described in the claims.
Claims
1. A method for motor fault diagnosis based on digital twins and improved random forests, characterized in that, Includes the following steps: Step 1: Obtain the real-time operating parameters and historical data of the permanent magnet synchronous motor as the raw dataset; Step 2: Construct a random forest fault diagnosis model, and improve the random forest fault diagnosis model using an improved sparrow search algorithm to obtain an improved random forest fault diagnosis model. Step 3: Divide the original dataset from Step 1 into a test set and a training set. Use the training set to train the improved random forest fault diagnosis model and use the test set to verify the accuracy of the improved random forest, thus obtaining the permanent magnet synchronous motor fault diagnosis model. Step 4: Use the permanent magnet synchronous motor fault diagnosis model obtained in Step 3 to diagnose the faults of the permanent magnet synchronous motor. In step 2, the random forest fault diagnosis model includes a data acquisition module, a data processing module, and a diagnosis module. The acquisition module acquires the stator current of the permanent magnet synchronous motor and transmits it to the data processing module. The data processing module performs VMD decomposition on the input data to obtain the fault characteristics of the stator current and then inputs them into the diagnosis module. The diagnosis module judges the health status of the permanent magnet synchronous motor based on the characteristics of the stator current decomposition. In step 2, an improved sparrow search algorithm is used in the diagnosis module of the random forest. The error rate of the random forest fault diagnosis is used as the fitness function of the improved sparrow search algorithm. The improved sparrow search algorithm finds the global optimum and outputs two parameters: the number of decision trees (ntree) and the number of features at each node (mtry). Based on the optimal parameters of ntree and mtry, the optimal random forest fault diagnosis model is obtained as the improved random forest fault diagnosis model. The improved sparrow search algorithm process is as follows: S21. Set the initial parameters of the algorithm: population size, proportion of discoverers, proportion of scouts and early warnings, and number of iterations; S22. Introduce Tent chaotic mapping to initialize the sparrow population. Its characteristic is the Tent chaotic mapping, as shown in formulas (1) and (2): (1), In formula (1), x t and x t+1 These represent the sparrow's position at the current moment and the position at the next moment, respectively. (2), In formula (2), x new For the new population obtained using the Tent chaotic mapping, ub and lb are the upper and lower bounds of the variable x, x d It is a Tent chaotic sequence; S23. Update the sparrow's position according to the position update formula of the sparrow joiner, discoverer and scout, use the error rate of random forest as the fitness function, calculate the fitness function, and obtain the optimal population X; S24. Based on the improved strategy of genetics, crossover and mutation are used to obtain population pop1, where the crossover probability Pc = 0.8 and the mutation probability Pm = 0.
1. S25. Obtain the population pop2 according to the improved strategy T distribution, as shown in formula (3): (3), In formula (3), x i (new), x i (old) represents the new position of the i-th sparrow after the mutation and its original position before the mutation, respectively. t iter The T-distribution represents the relationship between the number of iterations; S26. Based on the improved strategy, simulated annealing is used to obtain population pop3, as shown in formula (4): (4), In formula (4), T represents the annealing temperature, which determines the probability that the sparrow will accept the new position, and λ is the annealing coefficient. When the fitness value f of the new location new Better than the current optimal fitness value f o When the fitness value is positive, it will directly replace the original fitness value; otherwise, it needs to follow the Metropolis criterion and be judged according to formula (5): (5), If formula (5) is true, then the new position is accepted; otherwise, it is not accepted. S27. Sort the population [X pop1 pop2 pop3] according to fitness, retain the better individuals, obtain the optimal position and its fitness value, and then perform iterative operation to find the global optimal solution.
Citation Information
Patent Citations
Training method of transformer fault diagnosis model and transformer fault diagnosis method
CN120046050A