A solenoid valve fault diagnosis method and device based on similarity distance
Through the solenoid valve fault diagnosis method based on similarity distance, the similarity distance is calculated using the Marshallow distance and cosine similarity to generate an SVM decision tree, which solves the problems of high hardware requirements, poor flexibility and low accuracy of solenoid valve fault diagnosis in the prior art, and realizes accurate diagnosis and rapid fault warning for various types of faults.
Patent Information
- Application Number
- CN202111511617.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-06
- Publication Date
- 2025-03-04
- Estimated Expiration
- 2041-12-06
AI Technical Summary
The prior art has problems such as high hardware requirements, poor flexibility, difficulty in extracting data features, low diagnostic accuracy and low efficiency in solenoid valve fault diagnosis.
A fault diagnosis method based on similarity distance is adopted, by collecting the solenoid valve drive current, first-order and second-order derivatives are calculated, and normalized processing is performed to construct three-dimensional matrix features. The similarity distance is calculated using Marbanese distance and cosine similarity, and an SVM decision tree is generated, and a classification model is trained and diagnosed.
It realizes accurate diagnosis of various solenoid valve fault types, reduces hardware requirements, improves diagnosis flexibility and accuracy, and has fast fault warning and protection functions.
Smart Images

Figure CN114358138B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of electromagnetic valve fault detection, and in particular relates to an electromagnetic valve fault diagnosis method and device based on similarity distance. Background Art
[0002] Solenoid valves are automation components used to control the flow of media in industry. They are used as actuators to adjust the flow rate, direction and other factors of the media, and are widely used in industrial control systems. However, solenoid valves will inevitably cause various problems during operation, and it is not easy to detect the early stage of the failure. If the solenoid valve is repaired or replaced when a failure occurs, it may cause a safety accident. Therefore, a method is needed to diagnose the fault of the solenoid valve, provide safety warnings in advance, and reduce the occurrence of safety accidents.
[0003] At present, there are four methods for fault diagnosis of solenoid valves: hardware-based fault diagnosis, signal processing-based fault diagnosis, model-based fault diagnosis, and data-driven fault diagnosis. The hardware-based fault diagnosis method is to use hardware to simulate a specific processing circuit to perform fault diagnosis of the solenoid valve. Although this is a fast-response diagnosis method, it can only adapt to specific solenoid valves, thus losing flexibility, and the hardware circuit requirements are high and the design cycle is long. The signal processing-based fault diagnosis method is to perform some analysis or processing operations on the measurement data of the solenoid valve. For solenoid valves with a large amount of collected data, it is difficult to extract useful features, thereby reducing the accuracy of fault diagnosis. The model-based fault diagnosis method is to establish a mathematical model for fault diagnosis of the solenoid valve. Its efficiency in performing complex calculations is very low, and it is difficult to provide rapid fault warning and protection. Summary of the invention
[0004] The purpose of the present invention is to address the deficiencies in the prior art and provide a solenoid valve fault diagnosis method and device based on similarity distance, which has low hardware requirements, can diagnose more solenoid valve fault types, and still has a high classification accuracy for state types with higher similarity.
[0005] The objective of the present invention is achieved through the following technical solutions:
[0006] On the one hand, the present invention provides a solenoid valve fault diagnosis method based on similarity distance, the method comprising the following steps:
[0007] Step 1, collecting the solenoid valve drive current of a known state type, performing multiple independent solenoid valve drive current sampling under each known state type, constructing a sample set corresponding to the state type, calculating the first-order derivative and the second-order derivative of each solenoid valve drive current sample, and performing normalization processing, forming a three-dimensional matrix with the normalized current and its first-order derivative and second-order derivative, and taking the center of gravity of the three-dimensional matrix as the feature of the solenoid valve drive current sample;
[0008] Step 2: All the features extracted under each known state type are combined into a feature sample set. After removing the deviation points, the mean of the feature sample set of each state type is calculated as the centroid of the feature sample set. The Mahalanobis distance between the centroids of the feature sample sets of different state types i and j is calculated. And cosine similarity Construct the similarity distance d between feature sample sets of different state types ij , the formula is as follows:
[0009]
[0010] Calculating the inter-class separability value based on the similarity distance, and dividing the feature sample set of each state type into a positive class and a negative class according to the similarity of the inter-class separability values of each state type, and if the number of state types under the divided positive class or negative class is greater than one, continue to perform secondary positive and negative class division on the positive class or negative class until the number of state types under the positive class or negative class is one;
[0011] Step 3, generate an SVM decision tree according to the path of positive and negative classification in step 2, and input the feature sample set corresponding to the state type into the SVM decision tree classification model for training according to the positive and negative classification results; in the optimization of the SVM kernel function parameters, first use the grid search method to roughly find the optimal combination of the penalty parameter C and the kernel function parameter g. If the SVM classification accuracy under the optimal combination is less than the set threshold T, then select the first M optimal combinations in the grid search method as the initial position of the fruit fly population in the LFOA algorithm, and then use the LFOA algorithm to search for the optimal combination; use the trained SVM decision tree classification model as the solenoid valve fault diagnosis model;
[0012] Step 4, collecting the driving current of the electromagnetic valve to be diagnosed, extracting the characteristics of the electromagnetic valve driving current according to step 1, inputting the extracted characteristics into the electromagnetic valve fault diagnosis model, and obtaining the electromagnetic valve fault diagnosis result.
[0013] Furthermore, in step 1, the state type of the solenoid valve is divided into a normal type and a fault type, and the fault types include stuck, spring breakage, stuck 20%, stuck 40%, stuck 60%, stuck 80%, and liquid intrusion; the liquid intrusion fault refers to the fluid in the pipeline entering the upper chamber of the solenoid valve main valve, causing the solenoid valve to operate for a longer time.
[0014] Furthermore, in step 2, the step of removing the deviation points includes: for each sample point in the feature sample set of the i-th state type, calculating the sum of the distances between the sample point and all other sample points in the feature sample set, denoted as D i ={d1,d2,…,d n}, d k , k=1,…,n is the sum of the distances between the kth sample point and all other sample points in the same feature sample set, and calculate D i The mean μ i and variance σ i , if D i A distance d in k ≥|μ i +3σ i |, the sample point k corresponding to the distance is considered as a deviation point and is removed from the feature sample set.
[0015] Furthermore, in step 2, the sum of the similarity distances between a state type sample set and all other state type feature sample sets is taken as the inter-class separability value of the state type.
[0016] Furthermore, in step 2, the criterion for dividing each state type into positive and negative classes should be to minimize the sum of the intra-class distances of the positive and negative classes, and the intra-class distance is the mean square distance of the inter-class separability values of each state type under the positive or negative class.
[0017] Another aspect of the present invention provides a solenoid valve fault diagnosis device based on similarity distance, the device comprising a data acquisition module, a wireless communication module, a cloud and a PC;
[0018] The data acquisition module is connected to the solenoid valve, the wireless communication module is connected to the data acquisition module, and the cloud is connected to the wireless communication module and the PC respectively;
[0019] The data acquisition module is used to collect the driving current of the solenoid valve and convert the collected analog quantity into a digital quantity;
[0020] The wireless communication module is used to send the driving current data collected by the data collection module to the cloud;
[0021] The cloud is used to store and forward the received driving current data;
[0022] The PC is used to process the received driving current data and diagnose the solenoid valve fault based on the solenoid valve fault diagnosis method.
[0023] The beneficial effects of the present invention are as follows: the present invention constructs a similarity distance through Mahalanobis distance and cosine similarity, comprehensively considers the scale consistency problem of each dimension of the sample point and the angle information; establishes a positive and negative class division standard according to the similarity of the inter-class separability values of each state type, and is used to generate an SVM decision tree path. The SVM decision tree path generated by this method can be changed accordingly according to the different types of input drive current state types, and has good applicability; the parameter optimization process of the SVM decision tree classification model has the characteristics of high efficiency and high accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] Figure 1 A schematic diagram of the structure of a solenoid valve fault diagnosis device based on similarity distance provided in an embodiment of the present invention.
[0025] Figure 2 A flow chart of a solenoid valve fault diagnosis method based on similarity distance provided by an embodiment of the present invention;
[0026] Figure 3 A schematic diagram of a solenoid valve driving current feature extraction process provided by an embodiment of the present invention;
[0027] Figure 4 A schematic diagram of the SVM decision tree classification model training process provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0028] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the specific embodiments of the present invention are described in detail below with reference to the accompanying drawings.
[0029] In the following description, many specific details are set forth to facilitate a full understanding of the present invention, but the present invention may also be implemented in other ways different from those described herein, and those skilled in the art may make similar generalizations without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.
[0030] like Figure 1 As shown, an embodiment of the present invention provides a solenoid valve fault diagnosis device based on similarity distance, including a data acquisition module, a wireless communication module, a cloud and a PC.
[0031] When it is detected that the solenoid valve drive current reaches 5% of the steady state, and the drive current change rate exceeds the set threshold, it is determined that the solenoid valve is in action. At this time, the data acquisition module starts to collect the drive current of the solenoid valve until the current is stable. The analog signal is converted into a digital signal, and the data acquisition module transmits the processed drive current data to the wireless communication module, and then sends the drive current data to the cloud through the wireless communication module. The cloud stores the received drive current data and forwards it to the PC. The PC downloads the data forwarded by the cloud, and performs first-order and second-order derivatives on the received drive current data. The original data and its first-order and second-order derivatives are normalized and formed into a three-dimensional matrix. The center of gravity of the three-dimensional matrix is calculated and used as the feature of the drive current sample. The feature is input into the established solenoid valve fault diagnosis model, and the solenoid valve state type is obtained according to the classification result.
[0032] like Figure 2 As shown, an embodiment of the present invention further provides a solenoid valve fault diagnosis method based on similarity distance, which can be based on the above-mentioned solenoid valve fault diagnosis device, and the method includes the following steps:
[0033] Step 1: If Figure 3 As shown in the figure, for N solenoid valve drive current samples of known state types, the first-order derivative and second-order derivative are calculated. The maximum-minimum normalization is selected to normalize the original data and its first-order and second-order derivatives to [0,1]. Normalization can eliminate the dimensions of different indicators, improve the efficiency of program operation and the accuracy of results. The three sets of data after normalization are formed into a three-dimensional matrix. Among them, the state type is divided into normal and fault, and the fault type includes stuck, spring breakage, partial jam (20%, 40%, 60%, 80%), and liquid intrusion. Here, the liquid intrusion fault refers to the fluid in the pipeline entering the upper chamber of the solenoid valve main valve, causing the solenoid valve to take longer to operate.
[0034] Step 2: Group the features of the same state type into a feature sample set and calculate the distance D between each sample point and the same type of sample points i ={d1,d2,…,d n} and D i The mean μ i and variance σ i If D i A distance d in i ≥|μ i +3σ i |, the sample point corresponding to the distance is considered an outlier and is removed from the feature sample set. After removing the deviating points, the mean of the feature sample sets of the eight state types is calculated as μ = (μ1, μ2, μ3, …, μ8) T , and use its mean as the centroid of each state type feature sample set. Calculate the Mahalanobis distance of the centroid of each state feature sample set And cosine similarity Combine the two to construct the similarity distance d ij . Calculate the covariance matrix ∑ and Mahalanobis distance between the centroids of various samples And cosine similarity Taking into account the consistency of scales in all dimensions of sample points and the angle information, the similarity distance is constructed by combining the Mahalanobis distance and cosine similarity:
[0035]
[0036] Calculate the similarity distance between the centroids of each state feature sample set and get {d 12 ,d 13 ,d 14 ,…,d 67 ,d 68 ,d 78 There are 28 similarity distances in total. The similarity distance here is regarded as the similarity distance between sample sets. According to the formula of inter-class separability value Calculate the value of each type and sort the state types in descending order according to the value. In order to generate the SVM decision tree path, establish the decision tree node judgment standard, that is, establish the standard for dividing the feature sample sets of each state type into positive and negative classes. This standard is to minimize the sum of the intra-class distances of the positive and negative classes. The intra-class distance calculated here is the mean square distance of the inter-class separability values of each state type under the positive or negative class. According to this standard, generate the path of the SVM decision tree, divide the feature sample sets of 8 state types into positive or negative classes, and if the number of state types under the divided positive or negative class is greater than one, continue to perform secondary positive and negative class division on the positive or negative class until the number of state types under the positive or negative class is one.
[0037] Step 3: If Figure 4 As shown, the SVM decision tree classification model is divided into three layers, with one SVM in the first layer, two SVMs in the second layer, and four SVMs in the third layer, and each SVM is independent of each other. According to the descending order of the sequence number and the positive and negative classification criteria in step 2, the state types with sequence numbers 1 to 4 are marked as positive classes, and the state types with sequence numbers 5 to 8 are marked as negative classes for SVM training, and the first-layer SVM training model is obtained.
[0038] Continue to arrange the sequence numbers and positive and negative classification standards in descending order in step 2, mark the state types with sequence numbers 1 to 2 as positive classes, and the state types with sequence numbers 3 to 4 as negative classes for SVM training. At the same time, mark the state types with sequence numbers 5 to 6 as positive classes, and the state types with sequence numbers 7 to 8 as negative classes for training another SVM, so as to obtain two trained SVMs in the second layer.
[0039] Continue to arrange the sequence numbers and positive and negative classification standards in descending order according to step 2, mark the state types with sequence numbers 1, 3, 5, and 7 as positive classes, and the state types with sequence numbers 2, 4, 6, and 8 as negative classes, and then put the state types with sequence numbers {1, 2}, {3, 4}, {5, 6}, and {7, 8} into four SVM models for training, and obtain four trained SVMs in the third layer. If the training accuracy of the SVM decision tree classification model is less than the set threshold, repeat step 3, and stop training when the number of repetitions reaches the set value.
[0040] There are two very important parameters in the SVM model: the penalty factor C and the kernel function parameter g. The penalty factor C refers to the tolerance to errors. The larger the C, the less tolerant the model is to errors, and the more prone it is to overfitting. On the contrary, the smaller the C, the more prone it is to underfitting. C that is too large or too small will reduce the generalization ability of the model. The kernel function parameter g is the width of the kernel function. The size of g will affect the range of action of each support vector, thereby affecting the generalization performance. The present invention first uses the grid search method to roughly find the optimal combination of C and g for the optimization process of these two parameters. The search range of C and g is [10 -a ,10 a ], a∈[-8,8], the step length of a is 1. Perform 5-fold cross validation for different parameter combinations. If the SVM classification accuracy under the optimal combination is greater than the set T, then use this parameter combination as the best parameter of the model. If the SVM classification accuracy under the optimal combination is less than the set T, then select M optimal parameter combinations in the grid search method. Use these M combinations as the initial position X of the fruit fly population in the LFOA algorithm. a ={x a1 ,x a2 ,…,x am} and Y a ={y a1 ,y a2 ,…,y am}, and then the LFOA algorithm is used to search for the optimal parameter combination.
[0041] Step 4: After the PC obtains the data to be tested of the solenoid valve drive current, it calculates the first-order derivative and the second-order derivative of the data, and normalizes the original data and its first-order and second-order derivatives to the interval [0,1]. The normalized original data and its first-order and second-order derivatives form a three-dimensional matrix, calculate the center of gravity of the three-dimensional matrix, and then input the center of gravity into the first-layer SVM decision tree classification model. According to the output result of the first-layer SVM decision tree classification model, the feature vector is placed in the corresponding SVM decision tree classification model of the second layer. According to the output result of the second-layer SVM decision tree classification model, the feature vector is placed in the corresponding SVM decision tree classification model of the third layer. Finally, according to the output result of the third-layer SVM decision tree classification model, the solenoid valve fault diagnosis result is obtained.
[0042] The above is only a preferred embodiment of the present invention. Although the present invention has been disclosed as a preferred embodiment, it is not intended to limit the present invention. Any technician familiar with the art can make many possible changes and modifications to the technical solution of the present invention by using the above disclosed methods and technical contents without departing from the scope of the technical solution of the present invention, or modify it into an equivalent embodiment of equivalent changes. Therefore, any simple modification, equivalent change and modification made to the above embodiments according to the technical essence of the present invention without departing from the content of the technical solution of the present invention still falls within the scope of protection of the technical solution of the present invention.
Claims
1. A solenoid valve fault diagnosis method based on similarity distance, characterized in that: The following steps are involved: Step 1, collecting the solenoid valve drive current of a known state type, performing multiple independent solenoid valve drive current sampling under each known state type, constructing a sample set corresponding to the state type, calculating the first-order derivative and the second-order derivative of each solenoid valve drive current sample, and performing normalization processing, forming a three-dimensional matrix with the normalized current and its first-order derivative and second-order derivative, and taking the center of gravity of the three-dimensional matrix as the feature of the solenoid valve drive current sample; Step 2: All features extracted under each known state type are combined into a feature sample set. After removing the deviation points, the mean of the feature sample set of each state type is calculated as the centroid of the feature sample set. According to the Mahalanobis distance between the centroids of feature sample sets of different state types i and j And cosine similarity Construct the similarity distance d between feature sample sets of different state types ij , the formula is as follows: Calculating the inter-class separability value based on the similarity distance, and dividing the feature sample set of each state type into a positive class and a negative class according to the similarity of the inter-class separability values of each state type, and if the number of state types under the divided positive class or negative class is greater than one, continue to perform secondary positive and negative class division on the positive class or negative class until the number of state types under the positive class or negative class is one; Step 3, generate an SVM decision tree according to the path of positive and negative classification in step 2, and input the feature sample set corresponding to the state type into the SVM decision tree classification model for training according to the positive and negative classification results; in the optimization of the SVM kernel function parameters, first use the grid search method to roughly find the optimal combination of the penalty parameter C and the kernel function parameter g. If the SVM classification accuracy under the optimal combination is less than the set threshold T, then select the first M optimal combinations in the grid search method as the initial position of the fruit fly population in the LFOA algorithm, and then use the LFOA algorithm to search for the optimal combination; use the trained SVM decision tree classification model as the solenoid valve fault diagnosis model; Step 4, collecting the driving current of the electromagnetic valve to be diagnosed, extracting the characteristics of the electromagnetic valve driving current according to step 1, inputting the extracted characteristics into the electromagnetic valve fault diagnosis model, and obtaining the electromagnetic valve fault diagnosis result.
2. The method according to claim 1, characterized in that: In step 1, the state types of the solenoid valve are divided into normal type and fault type, and the fault types include stuck, spring breakage, stuck 20%, stuck 40%, stuck 60%, stuck 80%, and liquid intrusion; the liquid intrusion fault refers to the fluid in the pipeline entering the upper chamber of the solenoid valve main valve, causing the solenoid valve to operate for a longer time.
3. The method according to claim 1, characterized in that In step 2, the elimination of deviation points includes: for each sample point in the feature sample set of the i-th state type, calculating the sum of the distances between the sample point and all other sample points in the feature sample set, denoted as D i ={d1,d2,…,d n }, d k , k=1,…,n is the sum of the distances between the kth sample point and all other sample points in the same feature sample set, and calculate D i The mean μ i and variance σ i , if D i A distance d in k ≥|μ i +3σ i |, the sample point k corresponding to the distance is considered as a deviation point and is removed from the feature sample set.
4. The method according to claim 1, characterized in that: In step 2, the sum of the similarity distances between a certain state type feature sample set and all other state type feature sample sets is taken as the inter-class separability value of the state type.
5. The method according to claim 1, characterized in that In step 2, the criterion for dividing each state type into positive and negative classes should be to minimize the sum of the intra-class distances of the positive and negative classes, where the intra-class distance is the mean square distance of the inter-class separability values of each state type under the positive or negative class.
6. A solenoid valve fault diagnosis device based on similarity distance, characterized in that: Includes data acquisition module, wireless communication module, cloud and PC; The data acquisition module is connected to the solenoid valve, the wireless communication module is connected to the data acquisition module, and the cloud is connected to the wireless communication module and the PC respectively; The data acquisition module is used to collect the driving current of the solenoid valve and convert the collected analog quantity into a digital quantity; The wireless communication module is used to send the driving current data collected by the data collection module to the cloud; The cloud is used to store and forward the received driving current data; The PC is used to process the received driving current data and diagnose the solenoid valve fault based on the method described in any one of claims 1-5.
Citation Information
Patent Citations
Multi-scale binary tree blast furnace fault diagnosis method based on sample segmentation
CN105550426A
Industrial big data early failure detection method based on image semi-supervising cost-sensitive
CN107918379A