The present disclosure relates to the technical field of fault diagnosis for electromagnetic flowmeters, and in particular to a method and system for detecting dirt on an electrode of an electromagnetic flowmeter.
If a medium to be measured is relatively dirty for a long term, dirt will be generated on an electrode of an electromagnetic flowmeter after the electromagnetic flowmeter has been working on the medium for a period of time. When the electrical conductivity of the dirt substance is different from that of the measured medium, measurement errors will occur. Moreover, sludge and oil may be attached to the electrode, which will also cause an output of the meter swing and drift. However, to date, there is still no method for efficiently detecting the attachment on the electrode, and such attachment can only be manually detected when the electromagnetic flowmeter is offline, making it impossible to timely recognize any problems during the working period of the electromagnetic flowmeter.
An objective of the present disclosure is to provide a method and system detecting for dirt on an electrode of an electromagnetic flowmeter, so as to achieve online rapid detection of dirt on the electrode of the electromagnetic flowmeter.
In order to achieve the above objective, the present disclosure provides the following technical solutions.
A method for detecting dirt on the electrode of the electromagnetic flowmeter includes:
Optionally, extracting the first feature matrix corresponding to each sample batch in the first dataset specifically includes:
where Ωi denotes an i th sample batch in the first dataset, Ωi=[σi(1),σi(2), . . . , σi(n)]∈Rm×n, and σi(n) denotes nth resistance value data in Ωi; n denotes a data sampling size of each sample batch, m denotes a dimensionality of resistance value data, and Rm×n denotes a vector space of m×n; and Pi denotes a first feature matrix corresponding to the i th sample batch Ωi in the first dataset.
Optionally, calculating the first Riemann center of all first feature matrices corresponding to all sample batches in the first dataset specifically includes:
where Pj denotes a first feature matrix corresponding to a j th sample batch Ωj in the first dataset; dR(Pi,Pj) denotes a Riemann distance between Pi and Pj; and N denotes the number of sample batches in the first dataset.
Optionally, respectively calculating the similarity index between the sample feature matrix and each of the first feature matrices and the second feature matrices specifically includes:
where Pz denotes a zth feature matrix in a set of the first feature matrices and the second feature matrices; and λa(Qc,Pz) denotes a feature value of Qc−1Pz.
Optionally, calculating the proximity between the local Riemann center and the first Riemann center and the proximity between the local Riemann center and the second Riemann center specifically includes:
A system for detecting dirt on the electrode of the electromagnetic flowmeter includes:
Optionally, the first feature matrix extraction module specifically includes:
where Ωi denotes an i th sample batch in the first dataset, Ωi=[σi(1),σi(2), . . . ,σi(n)]∈Rm×n, and σi(n) denotes nth resistance value data in Ω1; n denotes a data sampling size of each sample batch, m denotes a dimensionality of resistance value data, and Rm×n denotes a vector space of m×n; and Pi denotes a first feature matrix corresponding to the i th sample batch Ω1 in the first dataset.
Optionally, the first Riemann center calculation module specifically includes:
where Pj denotes a first feature matrix corresponding to a j th sample batch Ωj in the first dataset; dR(Pi,Pj) denotes a Riemann distance between Pi and Pj; and N denotes the number of sample batches in the first dataset.
Optionally, the similarity index calculation module specifically includes:
a similarity index calculation unit configured to respectively calculate the similarity index Soz between the sample feature matrix Qc and each of the first feature matrices and the second feature matrices according to
where Pz denotes a zth feature matrix in a set of the first feature matrices and the second feature matrices; and λa(Qc,Pz) denotes a feature value of Qc−1Pz.
Optionally, the proximity calculation module specifically includes:
According to the specific embodiments provided by the present disclosure, the present disclosure discloses the following technical effects:
The present disclosure provides a method and system for detecting dirt on an electrode of an electromagnetic flowmeter. The method includes: under the condition that the electromagnetic flowmeter is offline and there is no dirt on the electrode, acquiring resistance values between the electrode and the ground to form a first dataset; extracting a first feature matrix corresponding to each sample batch in the first dataset; calculating a first Riemann center of all first feature matrices corresponding to all sample batches in the first dataset; under the condition that the electromagnetic flowmeter is offline and there are different types of dirt attached to the electrode, acquiring the resistance values between the electrode and the ground to form a second datasets; extracting a second feature matrix corresponding to each sample batch in the second datasets corresponding to different types of dirt; calculating the second Riemann center of all second feature matrices corresponding to all sample batches in each of the second datasets; under the condition that the electromagnetic flowmeter works online, acquiring the resistance values between the electrode and the ground to form a sample to be tested, and extracting the sample feature matrix of the sample set to be tested; respectively calculating a similarity index between the sample feature matrix and each of the first feature matrices and the second feature matrices; extracting a preset number of feature matrices with the largest similarity index, and calculating a local Riemann center of the preset number of feature matrices; calculating proximity between the local Riemann center and the first Riemann center and proximity between the local Riemann center and the second Riemann center; and determining a dirt detection result of the electrode corresponding to the sample set to be tested according to the dataset corresponding to the Riemann center with the greatest proximity. The method can achieve an online rapid detection of dirt on the electrode of the electromagnetic flowmeter.
To describe the embodiments of the present disclosure or the technical solutions in the related art more clearly, the accompanying drawings required in the embodiments are briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present disclosure. A person of ordinary skill in the art may further obtain other accompanying drawings based on these accompanying drawings without creative effort.
The technical solutions in the embodiments of the present disclosure will be described below clearly and completely with reference to the accompanying drawings in the embodiments of the present disclosure. Apparently, the described embodiments are merely some rather than all of the embodiments of the present disclosure. All other examples obtained by a person of ordinary skill in the art based on the examples of the present disclosure without creative efforts shall fall within the protection scope of the present disclosure.
An objective of the present disclosure is to provide a method and system for detecting dirt on an electrode of an electromagnetic flowmeter, so as to achieve online rapid detection of dirt on the electrode of the electromagnetic flowmeter.
To make the above-mentioned objective, features, and advantages of the present disclosure clearer and more comprehensible, the present disclosure will be further described in detail below in conjunction with the accompanying drawings and specific embodiments.
Step 101: under a condition that the electromagnetic flowmeter is offline and there is no dirt on the electrode, resistance values between the electrode and ground are acquired to form a first dataset.
The method of the present disclosure includes detecting the resistance values of the electrode to the ground under three different conditions, and determining whether a fault occurs to the meter itself according to changes of the resistance values. Condition 1: the electromagnetic flowmeter is offline and there is no dirt on the electrode. Condition 2: the electromagnetic flowmeter is offline and different types of dirt are attached to the electrode. Condition 3: the electromagnetic flowmeter works online. Under each of the three different conditions above, the resistance values between the electrode and the ground are respectively acquired to form the first dataset, the second datasets and a sample set to be tested.
Specifically, under the condition that the electromagnetic flowmeter is offline and there is no dirt on the electrode, the resistance values between the electrode and the ground to form the first dataset Ωg={Ω1,Ω2, . . . ,ΩN}; where the first dataset Ωg includes N simple batches Ω1,Ω2, . . . ,ΩN. Ωi[σi(1),σi(2), . . . ,σi(n)]∈Rm×n denotes an i th sample batch in the first dataset Ωg; the subscript i denotes an ith batch of process data put on record, i=1, 2, . . . , N. n denotes a sampling size of a single sample batch, and m denotes a dimensionality of a measurement vector. σi(n) denotes nth sampling resistance value data in Qi.
Step 102: a first feature matrix corresponding to each sample batch in the first dataset is extracted.
A positive definite feature matrix extracted from each sample batch Ωi in the first dataset is calculated as the first feature matrix Pi:
where i=1, 2, . . . , N, and N denotes the number of samples as recorded, which is typically big enough to cover all circumstances that possibly occur under a normal condition.
The obtained positive definite feature matrix P, is encapsulated in a first database, which is named as a database under a normal condition.
Therefore, Step 102 of extracting the first feature matrix corresponding to each sample batch in the first dataset specifically includes:
where Ωi denotes the i th sample batch in the first dataset Ωg, and Ωi[σi(1),σi(2), . . . ,σi(n)]∈Rm×n, where σi(n) denotes nth resistance value data in Ωi; n denotes the data sampling size of each sample batch, m denotes the dimensionality of resistance value data, and Rm×n denotes a vector space of m×n; and Pi denotes a first feature matrix corresponding to the i th sample batch Ωi in the first dataset Ωg.
Step 103: A first Riemann center of all first feature matrices corresponding to all sample batches in the first dataset, is calculated.
All first feature matrices Pi corresponding to all Ωi in the first dataset Ωg are extracted and encapsulated in the first database, and the first Riemann center Pg corresponding to the first feature matrices is calculated:
Pg denotes a Riemann center of all positive definite feature matrices Pi in the database under the normal condition, where the Riemann center indicates a point on a Riemann manifold that minimizes a sum of squares of Riemann distances from the point to given positive definite matrices. arg min denotes a value of variable where the formula attains a minimum. dR(Pi,j) denotes a Riemann distance, which can be calculated by the following formula:
where L og(·) denotes a logarithm of a matrix; λa(Pi,Pj) , a=1, m denotes a feature value of Pi−1Pj.
Therefore, Step 103 of calculating the first Riemann center of all first feature matrices corresponding to all sample batches in the first dataset specifically includes:
where Pi denotes a first feature matrix corresponding to a j th sample batch Ωj in the first dataset; dR(Pi,Pj) denotes a Riemann distance between Pi and Pj; and N denotes the number of the sample batches in the first dataset.
Step 104: under the condition that the electromagnetic flowmeter is offline and there are different types of dirt attached to the electrode, resistance values between the electrode and the ground to form second datasets.
Similar to Condition 1 as described in Step 101, under the condition that the electromagnetic flowmeter is offline and there are different types of dirt attached to the electrode, resistance values between the electrode and the ground are respectively measured to form second datasets. Specifically, under the condition that the electromagnetic flowmeter is offline and a cth type of dirt is attached to the electrode, resistance values between the electrode and the ground are acquired to form a cth second dataset Ωgc{Ω1c,Ω2c, . . . , ΩMc}; where c=1, 2, . . . , C, and C denotes the number of types of dirt. That is, a second dataset corresponding to each type of dirt is acquired. The second dataset corresponding to the cth type of dirt is marked as Ωgc. C second datasets are acquired in total. Furthermore, different kinds or types of dirt refer to scale, oxide film, organic oil and inorganic pollutants which are easily attached to the electrode of the electromagnetic flowmeter.
The second dataset Ωgc corresponding to the cth type of dirt includes M sample batches Ω1c,Ω2c, . . . , ΩMc. Ωic{σic(1),σic(2), . . . , σic(n)}∈Rm×n denotes an ith sample batch in the second dataset Ωgc ; the subscript i denotes an ith batch of process data put on record, i=1, 2, . . . , M. n denotes a sampling size of a single sample batch, and m denotes a dimensionality of a measurement vector. σic(n) denotes an nth sampling resistance value data in Ωic.
Step 105: a second feature matrix corresponding to each sample batch in each of the second datasets corresponding to different types of dirt is extracted.
Regarding each sample batch Ωic in the second dataset Ωgc corresponding to the cth type of dirt, a corresponding positive definite feature matrix is extracted as a second feature matrix Pic:
where i=1, 2, . . . , M, and M denotes the number of samples as recorded, which is typically big enough. c=1, 2, . . . , C, which shall cover all possible types of dirt on the electrode.
All obtained second feature matrices Pic corresponding to each type of dirt are encapsulated in a second database, which is named as a database under a condition where dirt is attached. The second feature matrices Pic calculated based on the second datasets corresponding to different types of dirt, such as scale, oxide film, organic oil, inorganic pollutants and so on, are separately encapsulated to facilitate later monitoring of the type of dirt.
Step 106: a second Riemann center of all second feature matrices corresponding to all sample batches in each of the second datasets, is calculated.
All second feature matrices Pic corresponding to all sample batches Ωic in the second dataset Ωgc are extracted and encapsulated in the second database, and a Riemann center Pgc of datasets of various types of dirt is calculated:
where Pgc denotes a Riemann center of all second feature matrices corresponding to all sample batches in the second dataset Ωgc corresponding to the cth type of dirt, and for the purpose of distinguishing the Riemann center from the foregoing first Riemann center Pg, Pgc is denoted as the second Riemann center. c=1, 2, . . . , C, and C denotes the number of types of dirt. Pic denotes a second feature matrix corresponding to an ith sample batch Ωic in the second dataset Ωgc; Pjc denotes a second feature matrix corresponding to a j th sample batch Qjc in the second dataset Ωgc; dR(Pic,Pjc) denotes a Riemann distance between Pic and Pjc; and M denotes the number of sample batches in the second dataset Ωgc.
Step 107: under a condition that the electromagnetic flowmeter works online, resistance values between the electrode and the ground are acquired to form a sample set to be tested, and a sample feature matrix of the sample set to be tested is extracted.
Similar to the first two conditions described in Step 101 and Step 104, under the condition that the electromagnetic flowmeter works online, the resistance values between the electrode and the ground are acquired to form the sample set to be tested Ω=[Ω(1), . . . ,Ω(n)]∈Rm×n, where Ω(n) denotes nth sampling resistance value data in the sample set to be tested Ω, and the sample set to be tested Ω refers to a batch dataset with m-dimensional measurement vectors obtained by sampling per unit time.
Under the condition that the electromagnetic flowmeter works online, a new dataset is acquired as a sample set to be tested Ω, and the sample feature matrix Qc of the sample set to be tested Ω is extracted:
where n denotes a sampling size of this group of data, and Qc denotes the sample feature matrix of the sample set to be tested Ω.
Step 108: a similarity index between the sample feature matrix and each of the first feature matrices and the second feature matrices is calculated respectively.
A similarity index Soz, between the sample feature matrix Qc of the sample set to be tested Ω and each of the first feature matrices Pi and the second feature matrices Pic , is calculated, and the similarity index Soz being defined as:
where Pz denotes a zth feature matrix in a set of Pi and Pic; and z=1, 2, . . . , N+M×C; λa(Qc,Pz), with a=1, m, denotes a feature value of Qc−1Pz, and m denotes the quantity of the feature values; and Soz denotes a similarity index between Qc and Pz.
Therefore, Step 108 of calculating the similarity index between the sample feature matrix and each of the first feature matrices and the second feature matrices specifically includes:
where Pz denotes the zth feature matrix in the set of the first feature matrices and the second feature matrices; and λa(Qc,Pz) denotes the feature value of Qc−1Pz.
Step 109: a preset number of feature matrices with the largest similarity index are extracted, and a local Riemann center of the preset number of feature matrices is calculated.
l feature matrices Pz with the greatest similarity index S, between the sample feature matrix Qc and each of Pi and Pic are extracted, and the local Riemann center Pg0 of the l Pz with the greatest similarity index Soz is calculated:
where l denotes a preset number; Piz and Pjz denote an ith feature matrix and a j th feature matrix in the preset number of feature matrices, respectively; and dR(Piz,Pjz) denotes a Riemann distance between Piz and Pjz.
Step 110: proximity between the local Riemann center and the first Riemann center and proximity between the local Riemann center and the second Riemann center are calculated.
The proximity between the local Riemann center Pg0 and Pg and the proximity between the local Riemann center and Pgc are calculated, and the proximity is determined using a percentage α:
The proximity with the maximum a corresponds to the sample set to be tested.
Therefore, Step 110 of calculating the proximity between the local Riemann center and the first Riemann center and the proximity between the local Riemann center and the second Riemann center specifically includes:
Step 111: a dirt detection result of the electrode corresponding to the sample set to be tested is determined according to a dataset corresponding to a Riemann center with the greatest proximity.
The dirt detection result of the electrode corresponding to the sample set to be tested Ω is determined according to the dataset corresponding to the Riemann center with the greatest proximity α. For example, if the Riemann center with the greatest proximity α is Pg , it is determined that the dirt detection result of the electrode corresponding to the sample set to be tested Ω indicates that there is no dirt on the electrode. If the Riemann center with the greatest proximity α is Pgc, it is determined that there is dirt attached to the electrode, and the cth type of dirt attached to the electrode corresponding to the sample set to be tested Ω may be determined according to the dataset Ωgc corresponding to Pgc. For example, if the Riemann center with the greatest proximity α is Pg1, a first type of dirt corresponding to the second dataset Ωg1 corresponding to Pg1 is exactly the dirt detection result of the electrode corresponding to the sample set to be tested Ω. Different detergents are adopted for removing different types of dirt, such that dirt can be removed more efficiently.
The present disclosure provides the method for detecting dirt on the electrode of the electromagnetic flowmeter, including: under the condition that the electromagnetic flowmeter is offline and there is no dirt on the electrode, acquiring the resistance values between the electrode and the ground to form the first dataset Ωg={Ω1Ω2, . . . ,ΩN}, extracting positive definite feature matrices Pi corresponding to Ωi to be encapsulated in the first database, and calculating a Riemann center Pg of the positive definite feature matrices; under the condition that the electromagnetic flowmeter is offline and the cth type of dirt is attached to the electrode, measuring the resistance values between the electrode and the ground to form the second dataset Ωgc={Ω1cΩ2c, . . . ,ΩMc}, extracting positive definite feature matrices Pic corresponding to Ωic to be encapsulated in the second database, and meanwhile calculating the Riemann center Pgc of the positive definite feature matrices; under the condition that the electromagnetic flowmeter works online, acquiring the new dataset Ω=[Ω(1), . . . ,Ω(n)]∈Rm×n as the sample set to be tested, and extracting the feature matrix Qc of the sample set to be tested Ω; calculating the similarity index Soz between the sample feature matrix Qc of the new dataset and each of Pi and Pic; extracting l Pz with the greatest similarity index Soz against Qc; calculating a local Riemann center Pg0 of the l Pz; and calculating the proximity between the local Riemann center Pg0 and Pg and the proximity between the local Riemann center Pg0 and Pgc, and determining that the Riemann center with the greatest proximity indicates the corresponding condition for the electrode of the sample set to be tested. The method of the present disclosure can not only quickly determine whether there is dirt attached to the electrode or not, but also accurately analyze what type of dirt is attached to the electrode, both of which can be distinguished by different resistance values, thereby effectively improving the efficiency of detecting dirt on the electrode and the accuracy of detection results for the electromagnetic flowmeter.
Based on the method provided in the present disclosure, a system for detecting dirt on the electrode of the electromagnetic flowmeter is provided. Referring to
a first dataset acquisition module 301 configured to, under the condition that the electromagnetic flowmeter is offline and there is no dirt on the electrode, acquire resistance values between the electrode and the ground to form a first dataset;
The first feature matrix extraction module 302 specifically includes:
where Ωi, denotes the i th sample batch in the first dataset, Ωi=[σi(1),σi(2), . . . ,σi(n)]∈Rm×n, and σi(n) denotes nth resistance value data in Ωi; n denotes a data sampling size of each sample batch, m denotes dimensionality of resistance value data, and Rm×n denotes a vector space of m×n; and Pi denotes a first feature matrix corresponding to the i th sample batch Ωi in the first dataset.
The first Riemann center calculation module 303 specifically includes:
where Pj denotes a first feature matrix corresponding to the j th sample batch Ωj in the first dataset; dR(Pi,Pj) denotes a Riemann distance between Pi and Pj; and N denotes the number of sample batches in the first dataset.
The similarity index calculation module 308 specifically includes:
where Pz denotes the zth feature matrix in a set of the first feature matrices and the second feature matrices; and λa(Qc,Pz) denotes a feature value of Qc−1Pz.
The proximity calculation module 310 specifically includes:
Since the system disclosed in an embodiment corresponds to the method disclosed in another embodiment, the description is relatively simple, and reference can be made to the method description.
Specific examples are used herein to explain the principles and embodiments of the present disclosure. The foregoing description of the embodiments is merely intended to help understand the method of the present disclosure and core ideas thereof; besides, various modifications may be made by a person of ordinary skill in the art to specific embodiments and the scope of application in accordance with the ideas of the present disclosure. In conclusion, the content of the present description shall not be construed as limitations to the present disclosure.
Number | Date | Country | Kind |
---|---|---|---|
202210510275.4 | May 2022 | CN | national |