CN116106701A - KNN algorithm-based photovoltaic direct current fault arc detection method and system - Google Patents
KNN algorithm-based photovoltaic direct current fault arc detection method and system Download PDFInfo
- Publication number
- CN116106701A CN116106701A CN202310068119.1A CN202310068119A CN116106701A CN 116106701 A CN116106701 A CN 116106701A CN 202310068119 A CN202310068119 A CN 202310068119A CN 116106701 A CN116106701 A CN 116106701A
- Authority
- CN
- China
- Prior art keywords
- layer
- frequency band
- characteristic signal
- data
- pass filter
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000001514 detection method Methods 0.000 title claims abstract description 31
- 238000012360 testing method Methods 0.000 claims abstract description 51
- 238000000034 method Methods 0.000 claims abstract description 33
- 238000005070 sampling Methods 0.000 claims abstract description 16
- 238000001228 spectrum Methods 0.000 claims abstract description 10
- 238000010248 power generation Methods 0.000 claims abstract description 9
- 238000004364 calculation method Methods 0.000 claims description 17
- 101100257981 Arabidopsis thaliana S-ACP-DES3 gene Proteins 0.000 claims description 9
- 101150057677 DAD3 gene Proteins 0.000 claims description 9
- 102100034004 Gamma-adducin Human genes 0.000 claims description 9
- 101000799011 Homo sapiens Gamma-adducin Proteins 0.000 claims description 9
- 101001080624 Homo sapiens Proline/serine-rich coiled-coil protein 1 Proteins 0.000 claims description 9
- 101000652684 Homo sapiens Transcriptional adapter 3 Proteins 0.000 claims description 9
- 102100027427 Proline/serine-rich coiled-coil protein 1 Human genes 0.000 claims description 9
- 101100433696 Saccharomyces cerevisiae (strain ATCC 204508 / S288c) AAD3 gene Proteins 0.000 claims description 9
- 102100030836 Transcriptional adapter 3 Human genes 0.000 claims description 9
- 208000036552 dowling-degos disease 3 Diseases 0.000 claims description 9
- 208000002153 familial abdominal 3 aortic aneurysm Diseases 0.000 claims description 9
- 238000006243 chemical reaction Methods 0.000 claims description 7
- 230000009466 transformation Effects 0.000 claims description 7
- 238000000354 decomposition reaction Methods 0.000 claims description 4
- 238000010586 diagram Methods 0.000 description 3
- 230000032683 aging Effects 0.000 description 2
- OKTJSMMVPCPJKN-UHFFFAOYSA-N Carbon Chemical compound [C] OKTJSMMVPCPJKN-UHFFFAOYSA-N 0.000 description 1
- 208000033999 Device damage Diseases 0.000 description 1
- 238000004458 analytical method Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 229910052799 carbon Inorganic materials 0.000 description 1
- 239000003245 coal Substances 0.000 description 1
- 238000002485 combustion reaction Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000009413 insulation Methods 0.000 description 1
- 230000002265 prevention Effects 0.000 description 1
- 238000003672 processing method Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01R—MEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
- G01R31/00—Arrangements for testing electric properties; Arrangements for locating electric faults; Arrangements for electrical testing characterised by what is being tested not provided for elsewhere
- G01R31/12—Testing dielectric strength or breakdown voltage ; Testing or monitoring effectiveness or level of insulation, e.g. of a cable or of an apparatus, for example using partial discharge measurements; Electrostatic testing
- G01R31/1227—Testing dielectric strength or breakdown voltage ; Testing or monitoring effectiveness or level of insulation, e.g. of a cable or of an apparatus, for example using partial discharge measurements; Electrostatic testing of components, parts or materials
-
- H—ELECTRICITY
- H02—GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
- H02S—GENERATION OF ELECTRIC POWER BY CONVERSION OF INFRARED RADIATION, VISIBLE LIGHT OR ULTRAVIOLET LIGHT, e.g. USING PHOTOVOLTAIC [PV] MODULES
- H02S50/00—Monitoring or testing of PV systems, e.g. load balancing or fault identification
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02E—REDUCTION OF GREENHOUSE GAS [GHG] EMISSIONS, RELATED TO ENERGY GENERATION, TRANSMISSION OR DISTRIBUTION
- Y02E10/00—Energy generation through renewable energy sources
- Y02E10/50—Photovoltaic [PV] energy
Landscapes
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Testing Of Individual Semiconductor Devices (AREA)
- Photovoltaic Devices (AREA)
Abstract
The application provides a photovoltaic direct current fault arc detection method and system based on a KNN algorithm, wherein the method comprises the following steps: acquiring normal and fault current data; calculating characteristic values to generate a training set and a testing set; determining a k value and a characteristic weight; calculating the Euclidean distance; selecting k nearest data, and judging the data category of the input test set by a voting method; calculating an error rate; if the error rate is lower than a preset threshold value, an improved KNN classifier is obtained; and inputting the data to be detected into an improved KNN classifier to obtain a judging result. In the photovoltaic power generation system, normal and fault data are collected through a current sampling module, characteristic values are calculated, and the KNN classifier is trained and improved. The improved KNN classifier can timely judge whether the current signal in the loop has a fault arc or not, timely react, and loss is avoided. Comprehensively considers the factors such as the time-frequency domain of the signal, the energy normalized power spectrum and the like, comprehensively makes judgment, and improves the detection accuracy.
Description
Technical Field
The application relates to the technical field of photovoltaic power generation, in particular to a photovoltaic direct current fault arc detection method and system based on a KNN algorithm.
Background
The energy field has the contradiction of increasing energy demand, increasing exhaustion of traditional energy and taking coal as energy main power and zero carbon call, so the solar energy which is easy to obtain, clean and has huge potential is a key ring of energy transformation. As such, the photovoltaic power generation field develops rapidly, the installed amount rises year by year, and a plurality of hidden dangers of equipment aging, poor contact and possible arc faults caused by line and device damage are brought. Because the output of the photovoltaic power generation system is direct current, the generated direct current fault arc has the characteristics of large energy, continuous combustion and the like, and is extremely easy to cause large-scale electric fire and cause casualties of property loss fire. The arc prevention is urgent, and timely detection and measures are taken to avoid the loss caused by fire.
The general arc detection method mainly includes a detection method based on physical characteristics and a detection method based on time-frequency domain characteristics. The detection method based on the physical characteristics is to judge whether a fault arc occurs or not by detecting the properties such as the electromagnetic signal of the heat arc according to the property that the arc occurs at the moment; the detection method based on the time-frequency domain characteristics is to select proper criteria, collect data of normal and arc faults, obtain characteristic differences through a signal processing method, and set proper thresholds so as to judge the arc faults.
However, the detection method based on the physical characteristics needs to install the detection device at the position where the arc occurs, and is difficult to realize in actual engineering; the detection method based on the time-frequency domain characteristics has the problem of low accuracy and the like.
Disclosure of Invention
The application provides a photovoltaic direct current fault arc detection method and system based on a KNN algorithm, which are used for solving the problem that a detection device needs to be installed at an arc occurrence position in a detection method based on physical characteristics, and the detection device is difficult to realize in actual engineering; the detection method based on the time-frequency domain characteristics has the problem of low accuracy.
In a first aspect, the present application provides a method for detecting a photovoltaic direct current fault arc based on a KNN algorithm, including: constructing an improved KNN classifier; inputting data to be detected into the improved KNN classifier to obtain a judging result; the improved KNN classifier comprises: an acquisition module configured to acquire normal current data and arc fault current data; the calculation module is configured to calculate characteristic values according to the normal current data and the arc fault current data, and generate a training set and a testing set; the characteristic values include: current limit c 1 Standard deviation c 2 Component c of DC 3 And one to twenty harmonics c 4 -c 23 Three-layer wavelet packet transformation of eight frequency band energies c 24 -c 31 Normalized power spectrum c 32 The method comprises the steps of carrying out a first treatment on the surface of the The training module is configured to determine a k value and initialize a feature weight value to be 1; sequentially calculating Euclidean distance between each data in the test set and the data in the training set; selecting k nearest data, and judging the data category of the input test set by a voting method; the data category is that normal current data is classified into a first category, and arc fault current data is classified into a second category; calculating the overall error rate of the test set; if the error rate is lower than a preset threshold value, training is finished, and obtainingImproving the KNN classifier.
Optionally, the step of calculating the feature value includes: current limit c 1 The calculation formula of (2) is as follows:
c 1 =i max -i min
wherein ,imax I is the maximum current value in the sample min Is the minimum current value in the sample.
Optionally, the step of calculating the feature value includes: standard deviation c 2 The calculation formula of (2) is as follows:
wherein ,in The nth current value in the sample is A, which is the average value of the sample current, and N is the sample number value.
Optionally, the step of calculating the feature value includes: DC component c 3 And one to twenty harmonics c 4 -c 23 Extracting frequency domain information of signals through FFT, taking 5KHz as fundamental frequency, and calculating the formula as follows:
c j =|FFT(i 1 ,i 2 …i N )| 50*(j-3) ,3≤j≤23
wherein j is a positive integer, i 1 …i N N is the sample number value, which is the current value in the sample.
Optionally, the step of calculating the feature value includes: three-layer wavelet packet decomposition is used to obtain eight frequency band energy c of three-layer wavelet packet transformation 24 -c 31 The calculation formula is as follows:
c 24 =∫|AAA3| 2 dt
c 25 =∫|AAD3| 2 dt
c 26 =∫|ADA3| 2 dt
c 27 =∫|ADD3| 2 dt
c 28 =∫|DAA3| 2 dt
c 29 =∫|DAD3| 2 dt
c 30 =∫|DDA3| 2 dt
c 31 =∫|DDD3| 2 dt
wherein AAA3 is a characteristic signal of a frequency band of 0-12.5kHz, AAD3 is a characteristic signal of a frequency band of 12.5-25kHz, ADA3 is a characteristic signal of a frequency band of 25-37.5kHz, ADD3 is a characteristic signal of a frequency band of 37.5-50kHz, DAA3 is a characteristic signal of a frequency band of 50-62.5kHz, DAD3 is a characteristic signal of a frequency band of 62.5-75kHz, DDA3 is a characteristic signal of a frequency band of 75-87.5kHz, and DDD3 is a characteristic signal of a frequency band of 87.5-100 kHz.
Optionally, the step of decomposing the three-layer wavelet packet includes:
the original signal S is a characteristic signal of a frequency band of 0-100kHz, and after passing through a low-pass filter coefficient g (k), the characteristic signal of the frequency band of 0-50kHz of the first layer A1 is obtained; after the original signal S passes through a high-pass filter coefficient h (k), a characteristic signal of which the first layer D1 is a 50-100kHz frequency band is obtained; wherein g (k) and h (k) satisfy an orthogonal relationship:
g(k)=(-1) k h(1-k)
after the first layer A1 passes through the low-pass filter coefficient g (k), obtaining a characteristic signal of which the second layer AA2 is in a frequency band of 0-25 kHz; after the first layer A1 passes through a high-pass filter coefficient h (k), obtaining a characteristic signal of which the second layer AD2 is a frequency band of 25-50 kHz;
after the first layer D1 passes through the low-pass filter coefficient g (k), obtaining a characteristic signal of which the second layer DA2 is in a frequency band of 50-75 kHz; after the first layer D1 passes through a high-pass filter coefficient h (k), obtaining a characteristic signal of which the second layer DD2 is a 75-100kHz frequency band;
after the second layer AA2 passes through the low-pass filter coefficient g (k), a characteristic signal of the third layer AAA3 with the frequency band of 0-12.5kHz is obtained; after the second layer AA2 passes through a high-pass filter coefficient h (k), obtaining a characteristic signal of a third layer AAD3 with a frequency band of 12.5-25 kHz;
after the second layer AD2 passes through the low-pass filter coefficient g (k), a characteristic signal of the third layer ADA3 with the frequency band of 25-37.5kHz is obtained; after the second layer AD2 passes through a high-pass filter coefficient h (k), obtaining a characteristic signal of which the third layer ADD3 is 37.5-50 kHz;
after the second layer DA2 passes through the low-pass filter coefficient g (k), obtaining a characteristic signal of which the third layer DAA3 is in a frequency band of 50-62.5 kHz; after the second layer DA2 passes through the high-pass filter coefficient h (k), obtaining a characteristic signal of the third layer DAD3 with the frequency band of 62.5-75 kHz;
after the second layer DD2 passes through the low-pass filter coefficient g (k), a characteristic signal of which the third layer DDA3 is 75-87.5kHz frequency band is obtained; after the second layer DD2 passes through the high-pass filter coefficient h (k), the characteristic signal of the frequency band of 87.5-100kHz of the third layer DDD3 is obtained.
Optionally, the step of calculating the feature value includes: normalized power spectrum c 32 The calculation formula of (2) is as follows:
wherein T is time, and i is normalized current value.
Optionally, the step of sequentially calculating the euclidean distance between each data in the test set and the data in the training set includes:
the samples are characterized by c respectively 1 ,c 2 ,…,c 32 The Euclidean distance between the ith sample in the test set and the jth sample in the training set is:
wherein ,for the p-th eigenvalue of the i-th sample in the test set,/th sample in the test set>The p-th eigenvalue of the j-th sample in the training set, M is the number of samples in the training set.
Optionally, the step of calculating the error rate of the whole test set includes: giving an initial value of 0 to the error times; judging the types of the samples in the test set by using a voting method, and if errors are judged, increasing the error times by 1; and traversing the whole test set, comparing the error times with the number of samples, and calculating the whole error rate of the test set.
In a second aspect, the present application further provides a photovoltaic direct current fault arc detection system based on a KNN algorithm, including: the photovoltaic module is configured to generate direct current through photovoltaic power generation; a fault arc generator configured to simulate the generation of a fault arc phenomenon; the current sampling module is configured to collect normal current data and arc fault current data; an inverter, comprising: the photovoltaic direct current fault arc detection device comprises a control component and a conversion component, wherein the conversion component is configured to convert direct current generated by a photovoltaic component into alternating current, and the control component is configured to execute the photovoltaic direct current fault arc detection method based on the KNN algorithm; and a power grid configured as a system load.
Compared with the prior art, the application has the following beneficial effects:
the application provides a photovoltaic direct current fault arc detection method and system based on a KNN algorithm, wherein the method comprises the following steps: acquiring normal current data and arc fault current data; calculating characteristic values to generate a training set and a testing set; determining a k value and initializing a feature weight; sequentially calculating Euclidean distance between each data in the test set and the data in the training set; selecting k nearest data, and judging the data category of the input test set by a voting method; calculating the overall error rate of the test set; if the error rate is lower than a preset threshold, training is finished, and an improved KNN classifier is obtained; and inputting the data to be detected into the improved KNN classifier to obtain a judging result. In the photovoltaic power generation system, normal and fault data are collected through a current sampling module, characteristic values are calculated, and the KNN classifier is trained and improved. The improved KNN classifier can timely judge whether the current signal in the loop has a fault arc or not, can timely react, and avoids loss. Comprehensively considers the time-frequency domain characteristics of signals, the wavelet packet frequency band energy, the normalized power spectrum and other factors, comprehensively makes judgment, and improves the detection accuracy.
Drawings
In order to more clearly illustrate the technical solutions of the present application, the drawings that are needed in the embodiments will be briefly described below, and it will be obvious to those skilled in the art that other drawings can be obtained from these drawings without inventive effort.
Fig. 1 is a schematic flow chart of a method for detecting a photovoltaic direct current fault arc based on a KNN algorithm;
FIG. 2 is a schematic diagram of a three-layer wavelet packet decomposition according to the present application;
fig. 3 is a schematic structural diagram of a photovoltaic dc fault arc detection system based on KNN algorithm according to the present application;
fig. 4 is a block diagram of an improved KNN classifier as described herein.
Detailed Description
Reference will now be made in detail to the embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, the same numbers in different drawings refer to the same or similar elements, unless otherwise indicated. The embodiments described in the examples below do not represent all embodiments consistent with the present application. Merely as examples of systems and methods consistent with some aspects of the present application as detailed in the claims.
KNN (K-Nearest Neighbor) method, namely K Nearest Neighbor method, the idea of the method is as follows: if a sample belongs to a class for the majority of the K most similar (i.e., nearest neighbor) samples in the feature space, then the sample also belongs to that class. The method only determines the category to which the sample to be classified belongs according to the category of one or more samples which are nearest to each other in the classification decision.
The application provides a photovoltaic direct current fault arc detection method based on a KNN algorithm, as shown in fig. 1, comprising the following steps:
first, it is necessary to construct an improved KNN classifier, as shown in fig. 4, which includes: the system comprises an acquisition module, a calculation module and a training module. The method for constructing the improved KNN classifier comprises the following steps:
s100: normal current data and arc fault current data are obtained.
Simulating the occurrence of a fault arc phenomenon by using a fault arc generator; the current sampling module is used for collecting normal current data and arc fault current data. When the fault arc generator is not used, the current sampling module collects normal current data; when the fault arc generator is in use, the current sampling module collects arc fault current data. The sampling rate of the current sampling module is 200kHz, and according to the Nyquist law, current data with the frequency range of 0-100kHz can be acquired. The current sampling module takes 2000 data acquired every 10ms as one sample for standby.
S200: calculating characteristic values to generate a training set and a testing set; the characteristic values include: current limit c 1 Standard deviation c 2 Component c of DC 3 And one to twenty harmonics c 4 -c 23 Three-layer wavelet packet transformation of eight frequency band energies c 24 -c 31 Normalized power spectrum c 32 。
Processing the normal current data and arc fault current data samples collected by the current sampling module respectively, calculating the current range, standard deviation, direct current component, one to twenty harmonic wave, three-layer wavelet packet conversion eight frequency band energy and normalized power spectrum of each sample as characteristic values, and using c respectively 1 ,c 2 ,…,c 32 And (3) representing.
In an exemplary embodiment, the step of calculating the characteristic value includes: current limit c 1 The calculation formula of (2) is as follows:
c 1 =i max -i min
wherein ,imax I is the maximum current value in the sample min Is the minimum current value in the sample.
In an exemplary embodiment, the step of calculating the characteristic value includes: standard deviation c 2 The calculation formula of (2) is as follows:
wherein ,in The nth current value in the sample is A, which is the average value of the sample current, and N is the sample number value.
In an exemplary embodiment, the step of calculating the characteristic value includes: DC component c 3 And one to twenty harmonics c 4 -c 23 Extracting frequency domain information of signals through FFT, taking 5KHz as fundamental frequency, and calculating the formula as follows:
c j =|FFT(i 1 ,i 2 …i N )| 50*(j-3) ,3≤j≤23
wherein j is a positive integer, i 1 …i N N is the sample number value, which is the current value in the sample.
In an exemplary embodiment, the step of calculating the characteristic value includes: three-layer wavelet packet decomposition is used to obtain eight frequency band energy c of three-layer wavelet packet transformation 24 -c 31 The calculation formula is as follows:
c 24 =∫|AAA3| 2 dt
c 25 =∫|AAD3| 2 dt
c 26 =∫|ADA3| 2 dt
c 27 =∫|ADD3| 2 dt
c 28 =∫|DAA3| 2 dt
c 29 =∫|DAD3| 2 dt
c 30 =∫|DDA3| 2 dt
c 31 =∫|DDD3| 2 dt
wherein AAA3 is a characteristic signal of a frequency band of 0-12.5kHz, AAD3 is a characteristic signal of a frequency band of 12.5-25kHz, ADA3 is a characteristic signal of a frequency band of 25-37.5kHz, ADD3 is a characteristic signal of a frequency band of 37.5-50kHz, DAA3 is a characteristic signal of a frequency band of 50-62.5kHz, DAD3 is a characteristic signal of a frequency band of 62.5-75kHz, DDA3 is a characteristic signal of a frequency band of 75-87.5kHz, and DDD3 is a characteristic signal of a frequency band of 87.5-100 kHz.
As shown in fig. 2, the step of decomposing the three-layer wavelet packet includes:
the original signal S is a characteristic signal of a frequency band of 0-100kHz, and after passing through a low-pass filter coefficient g (k), the characteristic signal of the frequency band of 0-50kHz of the first layer A1 is obtained; after the original signal S passes through a high-pass filter coefficient h (k), a characteristic signal of which the first layer D1 is a 50-100kHz frequency band is obtained; wherein g (k) and h (k) satisfy an orthogonal relationship:
g(k)=(-1) k h(1-k)
after the first layer A1 passes through the low-pass filter coefficient g (k), obtaining a characteristic signal of which the second layer AA2 is in a frequency band of 0-25 kHz; after the first layer A1 passes through the high-pass filter coefficient h (k), a characteristic signal of the second layer AD2 with the frequency band of 25-50kHz is obtained.
After the first layer D1 passes through the low-pass filter coefficient g (k), obtaining a characteristic signal of which the second layer DA2 is in a frequency band of 50-75 kHz; after the first layer D1 passes through the high-pass filter coefficient h (k), a characteristic signal of which the second layer DD2 is a 75-100kHz frequency band is obtained.
After the second layer AA2 passes through the low-pass filter coefficient g (k), a characteristic signal of the third layer AAA3 with the frequency band of 0-12.5kHz is obtained; after the second layer AA2 passes through the high-pass filter coefficient h (k), the characteristic signal of the third layer AAD3 with the frequency band of 12.5-25kHz is obtained.
After the second layer AD2 passes through the low-pass filter coefficient g (k), a characteristic signal of the third layer ADA3 with the frequency band of 25-37.5kHz is obtained; after the second layer AD2 passes through the high-pass filter coefficient h (k), the characteristic signal of the third layer ADD3 with 37.5-50kHz frequency band is obtained.
After the second layer DA2 passes through the low-pass filter coefficient g (k), obtaining a characteristic signal of which the third layer DAA3 is in a frequency band of 50-62.5 kHz; after the second layer DA2 passes through the high-pass filter coefficient h (k), the characteristic signal of the frequency band of 62.5-75kHz of the third layer DAD3 is obtained.
After the second layer DD2 passes through the low-pass filter coefficient g (k), a characteristic signal of which the third layer DDA3 is 75-87.5kHz frequency band is obtained; after the second layer DD2 passes through the high-pass filter coefficient h (k), the characteristic signal of the frequency band of 87.5-100kHz of the third layer DDD3 is obtained.
In an exemplary embodiment, the step of calculating the characteristic value includes: normalized power spectrum c 32 The calculation formula of (2) is as follows:
wherein T is time, and i is normalized current value.
And obtaining all the characteristic values, and generating a training set and a testing set after adding the category.
S300: and determining a k value and initializing the characteristic weight value as 1.
The selection of the optimal k-value is a necessary condition for building a reasonable and accurate KNN model. If the k value is too low, the model becomes too specific and does not generalize well. It is also sensitive to noise. The model achieves high accuracy over the training set, but the model has poor predictive power for new, previously unseen data points. If k is chosen too large, the model becomes too generalized to accurately predict the data points in the training and testing set. This condition is known as under-fitting. Through a large number of theoretical analysis and calculation, the k value is determined to be 5-10, and a better effect can be obtained.
S400: and sequentially calculating the Euclidean distance between each datum in the test set and the datum in the training set.
In an exemplary embodiment, the step of sequentially calculating the euclidean distance of each data in the test set from the data in the training set includes:
the samples are characterized by c respectively 1 ,c 2 ,…,c 32 The Euclidean distance between the ith sample in the test set and the jth sample in the training set is:
wherein ,for the p-th eigenvalue of the i-th sample in the test set,/th sample in the test set>The p-th eigenvalue of the j-th sample in the training set, M is the number of samples in the training set.
S500: selecting k nearest data, and judging the data category of the input test set by a voting method; the data category is that normal current data is classified into a first category, and arc fault current data is classified into a second category.
Through the operation, the ith sample in the test set can obtain M d values, the M d values are arranged from small to large, k data with the first sequence, namely k data with the smallest distance, are selected, the categories of the k data are respectively read, and the category of the ith sample in the test set is judged by using a voting method.
S600: calculating the overall error rate of the test set;
in an exemplary embodiment, the step of calculating the error rate of the test set as a whole includes:
giving an initial value of 0 to the number of errors, namely T f =0。
Judging the types of the samples in the test set by using a voting method, and if the judgment is wrong, increasing the number of errors by 1, namely T f =T f +1。
Traversing the whole test set, comparing the number of errors with the number of samples, and calculating the overall error rate of the test set:
A f =T f /N
wherein ,Af For error rate, T f N is the number of samples of the test set for the number of errors.
S700: and if the error rate is lower than a preset threshold value, after training is finished, obtaining the improved KNN classifier.
If the error rate is lower than a preset threshold, the training is required, and the improved KNN classifier can be used for judging the data to be detected.
If the error rate is not lower than the preset threshold, the training is not required, the feature weight needs to be updated, and the step S400 is skipped for retraining.
After the improved KNN classifier is constructed, the improved KNN classifier can be used for analyzing and judging the data to be detected, so that fault arc judgment is realized.
S800: and inputting the data to be detected into the improved KNN classifier to obtain a judging result.
And inputting the data to be detected, namely current data to be judged in a loop acquired in real time, after the characteristic calculation is finished, into an improved KNN classifier to obtain a judging result so as to realize fault arc judgment.
Based on the method for detecting a photovoltaic direct current fault arc based on the KNN algorithm described in the foregoing embodiments, some embodiments of the present application further provide a system for detecting a photovoltaic direct current fault arc based on the KNN algorithm, as shown in fig. 3, including:
and the photovoltaic assembly is configured to generate direct current through photovoltaic power generation.
A fault arc generator configured to simulate the generation of a fault arc phenomenon. The fault arc generator consists of a fixed electrode and a movable electrode, and the circuit conditions such as insulation aging or connection looseness in the analog circuit are realized by the movement of the movable electrode, so that fault arc is generated, and the fault arc is conveniently researched.
And the current sampling module is configured to collect normal current data and arc fault current data. The sampling rate of the current sampling module is 200kHz, and according to the Nyquist law, current data with the frequency range of 0-100kHz can be acquired. The current sampling module takes 2000 data as one sample every 10ms and transmits the sample to the control component of the inverter.
An inverter, comprising: the photovoltaic direct current fault arc detection device comprises a control component and a conversion component, wherein the conversion component is configured to convert direct current generated by the photovoltaic component into alternating current, and the control component is configured to execute the photovoltaic direct current fault arc detection method based on the KNN algorithm.
And a power grid configured as a system load.
The application provides a photovoltaic direct current fault arc detection method and system based on a KNN algorithm, wherein the method comprises the following steps: acquiring normal current data and arc fault current data; calculating characteristic values to generate a training set and a testing set; determining a k value and initializing a feature weight; sequentially calculating Euclidean distance between each data in the test set and the data in the training set; selecting k nearest data, and judging the data category of the input test set by a voting method; calculating the overall error rate of the test set; if the error rate is lower than a preset threshold, training is finished, and an improved KNN classifier is obtained; and inputting the data to be detected into the improved KNN classifier to obtain a judging result. In the photovoltaic power generation system, normal and fault data are collected through a current sampling module, characteristic values are calculated, and the KNN classifier is trained and improved. The improved KNN classifier can timely judge whether the current signal in the loop has a fault arc or not, can timely react, and avoids loss. Comprehensively considers the time-frequency domain characteristics of signals, the wavelet packet frequency band energy, the normalized power spectrum and other factors, comprehensively makes judgment, and improves the detection accuracy.
The foregoing detailed description of the embodiments is merely illustrative of the general principles of the present application and should not be taken in any way as limiting the scope of the invention. Any other embodiments developed in accordance with the present application without inventive effort are within the scope of the present application for those skilled in the art.
Claims (10)
1. The method for detecting the photovoltaic direct current fault arc based on the KNN algorithm is characterized by comprising the following steps of:
constructing an improved KNN classifier;
inputting data to be detected into the improved KNN classifier to obtain a judging result;
the improved KNN classifier comprises:
an acquisition module configured to acquire normal current data and arc fault current data;
the calculation module is configured to calculate characteristic values according to the normal current data and the arc fault current data, and generate a training set and a testing set; the characteristic value packageThe method comprises the following steps: current limit c 1 Standard deviation c 2 Component c of DC 3 And one to twenty harmonics c 4 -c 23 Three-layer wavelet packet transformation of eight frequency band energies c 24 -c 31 Normalized power spectrum c 32 ;
The training module is configured to determine a k value and initialize a feature weight value to be 1;
sequentially calculating Euclidean distance between each data in the test set and the data in the training set;
selecting k nearest data, and judging the data category of the input test set by a voting method; the data category is that normal current data is classified into a first category, and arc fault current data is classified into a second category;
calculating the overall error rate of the test set;
and if the error rate is lower than a preset threshold value, after training is finished, obtaining the improved KNN classifier.
2. The method for detecting a photovoltaic direct current fault arc based on a KNN algorithm according to claim 1, wherein the step of calculating the eigenvalue comprises: current limit c 1 The calculation formula of (2) is as follows:
c 1 =i max -i min
wherein ,imax I is the maximum current value in the sample min Is the minimum current value in the sample.
3. The method for detecting a photovoltaic direct current fault arc based on a KNN algorithm according to claim 1, wherein the step of calculating the eigenvalue comprises: standard deviation c 2 The calculation formula of (2) is as follows:
wherein ,in The nth current value in the sample is A, which is the average value of the sample current, and N is the sample number value.
4. The method for detecting a photovoltaic direct current fault arc based on a KNN algorithm according to claim 1, wherein the step of calculating the eigenvalue comprises: DC component c 3 And one to twenty harmonics c 4 -c 23 Extracting frequency domain information of signals through FFT, taking 5KHz as fundamental frequency, and calculating the formula as follows:
c j =|FFT(i 1 ,i 2 …i N )| 50*(j-3) ,3≤j≤23
wherein j is a positive integer, i 1 …i N N is the sample number value, which is the current value in the sample.
5. The method for detecting a photovoltaic direct current fault arc based on a KNN algorithm according to claim 1, wherein the step of calculating the eigenvalue comprises: three-layer wavelet packet decomposition is used to obtain eight frequency band energy c of three-layer wavelet packet transformation 24 -c 31 The calculation formula is as follows:
c 24 =∫|AAA3| 2 dt
c 25 =∫|AAD3| 2 dt
c 26 =∫|ADA3| 2 dt
c 27 =∫|ADD3| 2 dt
c 28 =∫|DAA3| 2 dt
c 29 =∫|DAD3| 2 dt
c 30 =∫|DDA3| 2 dt
c 31 =∫|DDD3| 2 dt
wherein AAA3 is a characteristic signal of a frequency band of 0-12.5kHz, AAD3 is a characteristic signal of a frequency band of 12.5-25kHz, ADA3 is a characteristic signal of a frequency band of 25-37.5kHz, ADD3 is a characteristic signal of a frequency band of 37.5-50kHz, DAA3 is a characteristic signal of a frequency band of 50-62.5kHz, DAD3 is a characteristic signal of a frequency band of 62.5-75kHz, DDA3 is a characteristic signal of a frequency band of 75-87.5kHz, and DDD3 is a characteristic signal of a frequency band of 87.5-100 kHz.
6. The method for detecting a photovoltaic direct current fault arc based on a KNN algorithm according to claim 5, wherein the step of decomposing the three-layer wavelet packet comprises:
the original signal S is a characteristic signal of a frequency band of 0-100kHz, and after passing through a low-pass filter coefficient g (k), the characteristic signal of the frequency band of 0-50kHz of the first layer A1 is obtained; after the original signal S passes through a high-pass filter coefficient h (k), a characteristic signal of which the first layer D1 is a 50-100kHz frequency band is obtained; wherein g (k) and h (k) satisfy an orthogonal relationship:
g(k)=(-1) k h(1-k)
after the first layer A1 passes through the low-pass filter coefficient g (k), obtaining a characteristic signal of which the second layer AA2 is in a frequency band of 0-25 kHz; after the first layer A1 passes through a high-pass filter coefficient h (k), obtaining a characteristic signal of which the second layer AD2 is a frequency band of 25-50 kHz;
after the first layer D1 passes through the low-pass filter coefficient g (k), obtaining a characteristic signal of which the second layer DA2 is in a frequency band of 50-75 kHz;
after the first layer D1 passes through a high-pass filter coefficient h (k), obtaining a characteristic signal of which the second layer DD2 is a 75-100kHz frequency band;
after the second layer AA2 passes through the low-pass filter coefficient g (k), a characteristic signal of the third layer AAA3 with the frequency band of 0-12.5kHz is obtained; after the second layer AA2 passes through a high-pass filter coefficient h (k), obtaining a characteristic signal of a third layer AAD3 with a frequency band of 12.5-25 kHz;
after the second layer AD2 passes through the low-pass filter coefficient g (k), a characteristic signal of the third layer ADA3 with the frequency band of 25-37.5kHz is obtained; after the second layer AD2 passes through a high-pass filter coefficient h (k), obtaining a characteristic signal of which the third layer ADD3 is 37.5-50 kHz;
after the second layer DA2 passes through the low-pass filter coefficient g (k), obtaining a characteristic signal of which the third layer DAA3 is in a frequency band of 50-62.5 kHz; after the second layer DA2 passes through the high-pass filter coefficient h (k), obtaining a characteristic signal of the third layer DAD3 with the frequency band of 62.5-75 kHz;
after the second layer DD2 passes through the low-pass filter coefficient g (k), a characteristic signal of which the third layer DDA3 is 75-87.5kHz frequency band is obtained; after the second layer DD2 passes through the high-pass filter coefficient h (k), the characteristic signal of the frequency band of 87.5-100kHz of the third layer DDD3 is obtained.
7. The method for detecting a photovoltaic direct current fault arc based on a KNN algorithm according to claim 1, wherein the step of calculating the eigenvalue comprises: normalized power spectrum c 32 The calculation formula of (2) is as follows:
wherein T is time, and i is normalized current value.
8. The method for detecting a photovoltaic direct current fault arc based on a KNN algorithm according to claim 1, wherein the step of sequentially calculating the euclidean distance between each data in the test set and the data in the training set comprises:
the samples are characterized by c respectively 1 ,c 2 ,…,c 32 The Euclidean distance between the ith sample in the test set and the jth sample in the training set is:
9. The method for detecting a photovoltaic direct current fault arc based on a KNN algorithm according to claim 1, wherein the step of calculating the error rate of the whole test set comprises:
giving an initial value of 0 to the error times;
judging the types of the samples in the test set by using a voting method, and if errors are judged, increasing the error times by 1;
and traversing the whole test set, comparing the error times with the number of samples, and calculating the whole error rate of the test set.
10. The utility model provides a photovoltaic direct current fault arc detecting system based on KNN algorithm which characterized in that includes:
the photovoltaic module is configured to generate direct current through photovoltaic power generation;
a fault arc generator configured to simulate the generation of a fault arc phenomenon;
the current sampling module is configured to collect normal current data and arc fault current data;
an inverter, comprising: a control assembly and a conversion assembly, the conversion assembly being configured to convert direct current generated by the photovoltaic assembly into alternating current, the control assembly being configured to perform a KNN algorithm-based photovoltaic direct current fault arc detection method according to any one of claims 1-9;
and a power grid configured as a system load.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310068119.1A CN116106701A (en) | 2023-02-06 | 2023-02-06 | KNN algorithm-based photovoltaic direct current fault arc detection method and system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310068119.1A CN116106701A (en) | 2023-02-06 | 2023-02-06 | KNN algorithm-based photovoltaic direct current fault arc detection method and system |
Publications (1)
Publication Number | Publication Date |
---|---|
CN116106701A true CN116106701A (en) | 2023-05-12 |
Family
ID=86259355
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310068119.1A Pending CN116106701A (en) | 2023-02-06 | 2023-02-06 | KNN algorithm-based photovoltaic direct current fault arc detection method and system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116106701A (en) |
Citations (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104410360A (en) * | 2014-10-17 | 2015-03-11 | 广东易事特电源股份有限公司 | Safe operation method of photovoltaic power generation system, training method for artificial neural network and real-time detection method in safe operation method, and real-time detection device |
JP2015145847A (en) * | 2014-02-04 | 2015-08-13 | 三菱電機株式会社 | Direct current arc detection device and method |
JP2017161417A (en) * | 2016-03-10 | 2017-09-14 | オムロン株式会社 | Arc detection device |
CN107181460A (en) * | 2016-03-09 | 2017-09-19 | 上海英孚特电子技术有限公司 | A kind of photovoltaic system method for detecting arc |
US20170324236A1 (en) * | 2015-02-18 | 2017-11-09 | Omron Corporation | Arc detector and arc detection method |
CN108037422A (en) * | 2017-12-07 | 2018-05-15 | 国网冀北电力有限公司秦皇岛供电公司 | A kind of photovoltaic system direct current arc fault feature extraction and recognition methods and device |
CN110677125A (en) * | 2019-10-11 | 2020-01-10 | 国网冀北电力有限公司秦皇岛供电公司 | Arc fault detection method and device |
US20200076364A1 (en) * | 2018-08-28 | 2020-03-05 | Analog Devices Global Unlimited Company | Dc arc detection and photovoltaic plant profiling system |
CN112270614A (en) * | 2020-09-29 | 2021-01-26 | 广东工业大学 | Design resource big data modeling method for manufacturing enterprise whole system optimization design |
CN114169398A (en) * | 2022-01-28 | 2022-03-11 | 国网天津市电力公司 | Photovoltaic direct-current arc fault identification method and device based on random forest algorithm |
CN114584069A (en) * | 2022-05-05 | 2022-06-03 | 华中科技大学 | Photovoltaic direct-current arc detection method and system |
-
2023
- 2023-02-06 CN CN202310068119.1A patent/CN116106701A/en active Pending
Patent Citations (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2015145847A (en) * | 2014-02-04 | 2015-08-13 | 三菱電機株式会社 | Direct current arc detection device and method |
CN104410360A (en) * | 2014-10-17 | 2015-03-11 | 广东易事特电源股份有限公司 | Safe operation method of photovoltaic power generation system, training method for artificial neural network and real-time detection method in safe operation method, and real-time detection device |
US20170324236A1 (en) * | 2015-02-18 | 2017-11-09 | Omron Corporation | Arc detector and arc detection method |
CN107181460A (en) * | 2016-03-09 | 2017-09-19 | 上海英孚特电子技术有限公司 | A kind of photovoltaic system method for detecting arc |
JP2017161417A (en) * | 2016-03-10 | 2017-09-14 | オムロン株式会社 | Arc detection device |
CN108037422A (en) * | 2017-12-07 | 2018-05-15 | 国网冀北电力有限公司秦皇岛供电公司 | A kind of photovoltaic system direct current arc fault feature extraction and recognition methods and device |
US20200076364A1 (en) * | 2018-08-28 | 2020-03-05 | Analog Devices Global Unlimited Company | Dc arc detection and photovoltaic plant profiling system |
CN110677125A (en) * | 2019-10-11 | 2020-01-10 | 国网冀北电力有限公司秦皇岛供电公司 | Arc fault detection method and device |
CN112270614A (en) * | 2020-09-29 | 2021-01-26 | 广东工业大学 | Design resource big data modeling method for manufacturing enterprise whole system optimization design |
CN114169398A (en) * | 2022-01-28 | 2022-03-11 | 国网天津市电力公司 | Photovoltaic direct-current arc fault identification method and device based on random forest algorithm |
CN114584069A (en) * | 2022-05-05 | 2022-06-03 | 华中科技大学 | Photovoltaic direct-current arc detection method and system |
Non-Patent Citations (5)
Title |
---|
吴春华;徐文新;李智华;徐立娟;: "光伏系统直流侧故障电弧类型辨识及电路保护", 中国电机工程学报, vol. 37, no. 17, 30 September 2017 (2017-09-30), pages 5028 - 5034 * |
尹天文 等: "低压电器技术手册", 30 September 2014, 北京:机械工业出版社, pages: 496 - 498 * |
张俊: "基于量测数据分析的低压故障电弧检测技术研究", 中国优秀硕士学位论文全文数据库 工程科技Ⅱ辑, 30 September 2022 (2022-09-30), pages 19 - 35 * |
李华荣 等: "Python程序员面试笔试宝典", 30 April 2020, 北京:机械工业出版社, pages: 314 - 318 * |
赵晨时: "基于机器学习的直流电弧故障检测方法", 中国优秀硕士学位论文全文数据库 工程科技Ⅱ辑, 31 January 2019 (2019-01-31), pages 6 - 14 * |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112201260B (en) | Transformer running state online detection method based on voiceprint recognition | |
CN110985310A (en) | Wind driven generator blade fault monitoring method and device based on acoustic sensor array | |
CN113011481A (en) | Electric energy meter function abnormity evaluation method and system based on decision tree algorithm | |
CN111723684A (en) | Method for identifying transient overvoltage type in offshore wind farm | |
CN114397569A (en) | Circuit breaker fault arc detection method based on VMD parameter optimization and sample entropy | |
CN108594156B (en) | Improved current transformer saturation characteristic identification method | |
CN116702629B (en) | Power system transient stability evaluation method with migration capability | |
CN109635430A (en) | Grid power transmission route transient signal monitoring method and system | |
CN117235617A (en) | ML-RFKNN-based photovoltaic array fault diagnosis method in sand and dust weather | |
CN117609783A (en) | Photovoltaic micro-grid fault diagnosis method based on meta-learning | |
CN116106701A (en) | KNN algorithm-based photovoltaic direct current fault arc detection method and system | |
Wilson et al. | Uncertainty Quantification of Capacitor Switching Transient Location Using Machine Learning | |
CN115932435A (en) | Resident non-invasive load monitoring method based on low-frequency acquisition signals | |
CN115733258A (en) | Control method of all-indoor intelligent substation system based on Internet of things technology | |
CN114878118A (en) | Transformer sound and vibration signal fusion detection method and system | |
CN115270857A (en) | Transformer substation fault diagnosis method based on data fusion | |
CN114019310A (en) | Method, equipment and medium for prejudging open circuit fault of energy storage converter | |
Liu et al. | Power quality disturbance detection based on improved lifting Wavelet | |
CN112993977A (en) | HHT and RVM based active power distribution network electric energy quality disturbance identification method | |
Ali et al. | Detection of PQ Short Duration Variations using Wavelet Time Scattering with LSTM | |
CN112598163A (en) | Grounding grid trenchless corrosion prediction model based on comparison learning and measurement learning | |
CN118468091B (en) | Transformer fault diagnosis method and device and computer readable storage medium | |
Li et al. | Based on PSO-BP network algorithm for fault diagnosis of power transformer | |
Yong et al. | Prediction Model of Dissolved Gas in Transformer Oil Based on EMD and BiGRU | |
CN117639107B (en) | Power quality assessment method and system for power distribution network |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |