一种基于机器学习的光伏系统直流故障电弧检测方法A DC fault arc detection method for photovoltaic system based on machine learning
技术领域Technical field
本发明属于光伏电气故障检测技术领域,具体涉及一种基于机器学习的光伏系统直流故障电弧检测方法。The invention belongs to the technical field of photovoltaic electrical fault detection, and in particular relates to a method for detecting a DC fault arc of a photovoltaic system based on machine learning.
背景技术Background technique
电弧是一种气体放电现象,指电流通过某些绝缘介质(例如空气)所产生的瞬间火花,是一种气体放电现象。弧光放电是一种自持放电,区别于其他类型放电的特征是弧光放电的维持电压很低。目前很难给弧光放电下一个严格的定义,单纯从放电的电特性来说,弧光放电是一种阴极位降低,电流密度大的放电,一般来说具有负的伏安特性。Arc is a kind of gas discharge phenomenon, which refers to the instant spark produced by some insulating medium (such as air) when current passes through. It is a kind of gas discharge phenomenon. Arc discharge is a self-sustaining discharge, which is distinguished from other types of discharge in that the sustaining voltage of arc discharge is very low. At present, it is difficult to give a strict definition to arc discharge. Simply speaking from the electrical characteristics of the discharge, arc discharge is a discharge with a reduced cathode position and a large current density. Generally speaking, it has negative volt-ampere characteristics.
在光伏系统中,故障电弧一旦产生,若不采取及时有效的防护措施,持续的直流电弧会产生3000℃以上的高温,进而引发火灾。近年来欧美陆续发生多起由故障电弧引发的火灾事故,造成程度不一的设备损坏。2011年美国电工法规(NEC)规定光伏系统中应配备检测故障电弧的检测装置与断路器。美国保险商实验室(UL)也推出相应的开发测试方法与机制。In the photovoltaic system, once a fault arc is generated, if timely and effective protective measures are not taken, the continuous DC arc will generate a high temperature of more than 3000 ℃, which will cause a fire. In recent years, many fire accidents caused by fault arcs have occurred in Europe and America, causing equipment damages of varying degrees. In 2011, the National Electrical Code (NEC) stipulates that photovoltaic systems should be equipped with detection devices and circuit breakers to detect arc faults. The Underwriters Laboratories (UL) also introduced corresponding development test methods and mechanisms.
目前多数研究者提出的检测方法针对电弧的特性进行被动检测,其缺点在于在一些大电流情况下,电弧特征表现不是很明显,容易造成误检。误检一旦出现就会造成整个光伏系统的停运,带来不必要的损失。At present, most of the detection methods proposed by researchers conduct passive detection for the characteristics of the arc. The disadvantage is that in some large current situations, the performance of the arc characteristics is not very obvious, and it is easy to cause false detection. Once the false detection occurs, it will cause the shutdown of the entire photovoltaic system and cause unnecessary losses.
发明内容Summary of the invention
本发明是为了解决上述技术问题而进行的,目的在于提供一种电弧特征表现明显,不易造成误检的基于机器学习的光伏系统直流故障电弧检测方法。The present invention is made to solve the above technical problems, and aims to provide a machine learning-based photovoltaic system DC fault arc detection method that has obvious arc characteristics and is not easy to cause false detection.
为了实现上述目的,本发明采用了如下技术方案:In order to achieve the above objectives, the present invention adopts the following technical solutions:
本发明提供一种基于机器学习的光伏系统直流故障电弧检测方法,具有这样的特征,检测方法通过光伏系统实现,该光伏系统包括依次相互连接的光伏阵列、汇流箱、逆变器以及交流电网,汇流箱和逆变器所连电路之间设有电流采集装置,光伏阵列和汇流箱之间设有开关,检测方法包括以下步骤:The present invention provides a photovoltaic system DC fault arc detection method based on machine learning. It has the feature that the detection method is realized by a photovoltaic system, and the photovoltaic system includes a photovoltaic array, a combiner box, an inverter, and an AC power grid that are sequentially connected to each other. There is a current collecting device between the combiner box and the circuit connected to the inverter, and a switch is provided between the photovoltaic array and the combiner box. The detection method includes the following steps:
步骤S1,分别构建随机森林模型、支持向量机模型以及决策树模型,设定正常工作状态和故障电弧状态的状态标签值分别为0和1,并分别对随机森林模型、支持向量机模型以及决策树模型进行训练,得到训练后的随机森林模型、支持向量机模型以及决策树模型;Step S1: Build a random forest model, a support vector machine model, and a decision tree model respectively, set the state label values of the normal working state and the fault arc state to 0 and 1, respectively, and compare the random forest model, the support vector machine model, and the decision tree model. The tree model is trained, and the trained random forest model, support vector machine model and decision tree model are obtained;
步骤S2,利用电流采集装置并按照预定采样时间和预定采样间隔采集光伏系统直流侧的光伏阵列所得到的实时电流信号;Step S2, collecting the real-time current signal obtained by the photovoltaic array on the DC side of the photovoltaic system by using the current collecting device and according to the predetermined sampling time and the predetermined sampling interval;
步骤S3,对步骤S2采集得到的实时电流信号进行分析处理,得到该实时电流信号的时域特征和频域特征,Step S3: Analyze and process the real-time current signal collected in step S2 to obtain the time-domain and frequency-domain characteristics of the real-time current signal.
时域特征包含电流平均值a1和电流方差a2,The time domain features include current average value a1 and current variance a2,
N为采样个数,A
i为第i个电流采样值,
N is the number of samples, A i is the i-th current sampled value,
频域特征包含特定频段下的小波系数方差a3、小波系数能量a4以及小波系数波动程度a5,Frequency domain features include wavelet coefficient variance a3, wavelet coefficient energy a4, and wavelet coefficient fluctuation degree a5 in a specific frequency band,
a4=d
2
a4=d 2
d
i为第i个采样电流信号小波分解后的系数,
为N个电流信号小波分解后的系数的平均值,d为在特定频段下电流信号小波分解后的系数,d
max为在特定频段下电流信号小波分解系数的极大值;
d i is the coefficient after wavelet decomposition of the i-th sampled current signal, Is the average value of the coefficients after wavelet decomposition of N current signals, d is the coefficient after wavelet decomposition of the current signal in a specific frequency band, and d max is the maximum value of the wavelet decomposition coefficient of the current signal in a specific frequency band;
步骤S4,将步骤S3得到的时域特征和频域特征分别输入步骤S1中训练后的随机森林模型、支持向量机模型以及决策树模型,得到各自的状态标签值;Step S4, input the time domain features and frequency domain features obtained in step S3 into the random forest model, support vector machine model, and decision tree model trained in step S1, respectively, to obtain respective state label values;
步骤S5,将步骤S4中得到的所有的状态标签值之和设定为总状态标签值, 并判断该总状态标签值是否大于等于2,当判断结果为否时,进入步骤S6,当判断结果为是时,进入步骤S7;Step S5: Set the sum of all status tag values obtained in step S4 as the total status tag value, and determine whether the total status tag value is greater than or equal to 2. When the determination result is no, go to step S6, when the determination result If yes, go to step S7;
步骤S6,进一步判断总状态标签值是否等于1,如果总状态标签值等于1,则减小预定采样间隔后重复执行步骤S2;否则,重复执行步骤S2;Step S6, further determine whether the total status tag value is equal to 1, if the total status tag value is equal to 1, then repeat step S2 after reducing the predetermined sampling interval; otherwise, repeat step S2;
步骤S7,将判定次数计数器的判定次数值递增1,并进一步判断递增后的判定次数值是否等于预定判定次数值,如果递增后的判定次数值等于预定判定次数值,进入步骤S8;否则,减小预定采样间隔后重复执行步骤S2;Step S7: Increment the determination times value of the determination times counter by 1, and further determine whether the incremented determination times value is equal to the predetermined determination times value. If the incremented determination times value is equal to the predetermined determination times value, go to step S8; otherwise, decrease Repeat step S2 after a small predetermined sampling interval;
步骤S8,断路器动作使开关断开,并发出警报信息。In step S8, the circuit breaker operates to open the switch, and an alarm message is issued.
在本发明提供的基于机器学习的光伏系统直流故障电弧检测方法中,还可以具有这样的特征:其中,步骤S1包括以下步骤:In the method for detecting the DC fault arc of a photovoltaic system based on machine learning provided by the present invention, it may also have the following characteristics: wherein, step S1 includes the following steps:
步骤S1-1,利用电流采集装置并按照预定采样时间和预定采样间隔采集光伏系统直流侧的光伏阵列所得到的多组电流信号,每组电流信号包含处于正常工作状态下的正常电流信号和处于发生故障电弧状态下的故障电流信号;Step S1-1: Use the current acquisition device to collect multiple sets of current signals obtained by the photovoltaic array on the DC side of the photovoltaic system according to the predetermined sampling time and predetermined sampling interval. Each set of current signals includes a normal current signal in a normal working state and a Fault current signal in the state of fault arc;
步骤S1-2,对每组电流信号中的正常电流信号和故障电流信号分别进行分析处理,得到各自的时域特征和频域特征,Step S1-2, the normal current signal and the fault current signal in each group of current signals are analyzed and processed separately to obtain their respective time domain characteristics and frequency domain characteristics,
正常电流信号的时域特征包含电流平均值a11和电流方差a21,The time domain characteristics of the normal current signal include the current average value a11 and the current variance a21,
A
1i为第i个正常电流采样值,
A 1i is the i-th normal current sampling value,
故障电流信号的时域特征包含电流平均值a12和电流方差a22,The time domain characteristics of the fault current signal include the current average value a12 and the current variance a22,
A
2i为第i个故障电流采样值,
A 2i is the i-th fault current sampling value,
正常电流信号的频域特征包含特定频段下的小波系数方差a31、小波系数能量a41以及小波系数波动程度a51,The frequency domain characteristics of the normal current signal include the wavelet coefficient variance a31, the wavelet coefficient energy a41, and the wavelet coefficient fluctuation degree a51 in a specific frequency band.
d
1i为第i个正常电流信号小波分解后的系数,
为N个正常电流信号小波分解后的系数的平均值,d
1为在特定频段下正常电流信号小波分解后的系数,d
1max为在特定频段下正常电流信号小波分解系数的极大值,
d 1i is the coefficient after wavelet decomposition of the i-th normal current signal, Is the average value of the coefficients after wavelet decomposition of N normal current signals, d 1 is the coefficient after wavelet decomposition of normal current signals in a specific frequency band, d 1max is the maximum value of the wavelet decomposition coefficients of normal current signals in a specific frequency band,
故障电流信号的频域特征包含特定频段下的小波系数方差a32、小波系数能量a42以及小波系数波动程度a52,The frequency domain characteristics of the fault current signal include the wavelet coefficient variance a32, the wavelet coefficient energy a42, and the wavelet coefficient fluctuation degree a52 in a specific frequency band.
d
2i为第i个故障电流信号小波分解后的系数,
为N个故障电流信号小波分解后的系数的平均值,d
2为在特定频段下故障电流信号小波分解后的系数,d
2max为在特定频段下故障电流信号小波分解系数的极大值;
d 2i is the coefficient after wavelet decomposition of the i-th fault current signal, Is the average value of the coefficients after wavelet decomposition of N fault current signals, d 2 is the coefficient after wavelet decomposition of the fault current signal in a specific frequency band, and d 2max is the maximum value of the wavelet decomposition coefficient of the fault current signal in a specific frequency band;
步骤S1-3,分别构建随机森林模型、支持向量机模型以及决策树模型,设定正常工作状态和故障电弧状态的状态标签值分别为0和1;Step S1-3, construct a random forest model, a support vector machine model, and a decision tree model respectively, and set the state label values of the normal working state and the faulty arc state to 0 and 1, respectively;
步骤S1-4,将步骤S1-2得到的正常电流信号的时域特征和频域特征、以及故障电流信息的时域特征和频域特征作为训练集分别对随机森林模型、支持向量机模型以及决策树模型进行训练,从而得到训练后的随机森林模型、支持向量机模型以及决策树模型。Step S1-4, using the time-domain and frequency-domain features of the normal current signal obtained in step S1-2, and the time-domain and frequency-domain features of the fault current information as the training set, respectively, to the random forest model, support vector machine model, and The decision tree model is trained to obtain the trained random forest model, support vector machine model, and decision tree model.
在本发明提供的基于机器学习的光伏系统直流故障电弧检测方法中,还可以具有这样的特征:其中,随机森林模型所采用的最大深度为2,子模型数量为10。In the method for detecting DC arc faults of photovoltaic systems based on machine learning provided by the present invention, it may also have the following characteristics: wherein the maximum depth adopted by the random forest model is 2, and the number of sub-models is 10.
在本发明提供的基于机器学习的光伏系统直流故障电弧检测方法中,还可以具有这样的特征:其中,支持向量机模型所采用的核函数为径向基函数,正则化权重为10。In the method for detecting DC arc faults of photovoltaic systems based on machine learning provided by the present invention, it may also have the following characteristics: wherein the kernel function adopted by the support vector machine model is a radial basis function, and the regularization weight is 10.
在本发明提供的基于机器学习的光伏系统直流故障电弧检测方法中,还可以具有这样的特征:其中,决策树模型所采用的的正则化参数为11,正则化权重为1。In the method for detecting DC arc faults of photovoltaic systems based on machine learning provided by the present invention, it may also have the following characteristics: wherein the regularization parameter adopted by the decision tree model is 11, and the regularization weight is 1.
在本发明提供的基于机器学习的光伏系统直流故障电弧检测方法中,还可以具有这样的特征:其中,预定采样时间为0.1s,预定采样间隔的初始值为0.5s,预定采样间隔减小后的值为0.1-0.3s。In the DC fault arc detection method of photovoltaic system based on machine learning provided by the present invention, it may also have the following characteristics: wherein, the predetermined sampling time is 0.1s, the initial value of the predetermined sampling interval is 0.5s, and the predetermined sampling interval is reduced. The value is 0.1-0.3s.
在本发明提供的基于机器学习的光伏系统直流故障电弧检测方法中,还可以具有这样的特征:其中,特定频段为40kHz-80kHz。In the method for detecting DC fault arc of photovoltaic system based on machine learning provided by the present invention, it may also have the characteristic that the specific frequency band is 40kHz-80kHz.
在本发明提供的基于机器学习的光伏系统直流故障电弧检测方法中,还可以具有这样的特征:其中,预定识别次数值为2或3。In the method for detecting DC fault arc of photovoltaic system based on machine learning provided by the present invention, it may also have the feature: wherein the value of the predetermined number of times of identification is 2 or 3.
在本发明提供的基于机器学习的光伏系统直流故障电弧检测方法中,还可以具有这样的特征:其中,在步骤S3中,小波分解所采用的最优小波基为db10小波。In the method for detecting DC arc faults of photovoltaic systems based on machine learning provided by the present invention, it may also have the following characteristics: wherein, in step S3, the optimal wavelet base adopted by the wavelet decomposition is a db10 wavelet.
在本发明提供的基于机器学习的光伏系统直流故障电弧检测方法中,还可以具有这样的特征:其中,电流采集装置为串入线圈感应式实时电流采集装置。In the method for detecting DC fault arc of photovoltaic system based on machine learning provided by the present invention, it may also have the following characteristics: wherein the current collecting device is a series-in-coil induction type real-time current collecting device.
发明的作用与效果The role and effect of the invention
根据本发明所涉及的基于机器学习的光伏系统直流故障电弧检测方法,因为分别构建随机森林模型、支持向量机模型以及决策树模型,设定正常工作状态和故障电弧状态的状态标签值分别为0和1,并分别对随机森林模型、支持向量机模型以及决策树模型进行训练,得到训练后的随机森林模型、支持向量机模型以及决策树模型;利用电流采集装置并按照预定采样时间和预定采样间隔采集光伏系统直流侧的光伏阵列所得到的实时电流信号;对采集得到的实时电流信号进行分析处理,得到该实时电流信号的时域特征和频域特征;将得到的时域特征和频域特征分别输入训练后的随机森林模型、支持向量机模型以及决策树模型,得到各自的状态标签值;将得到的所有的状态标签值之和设定为总状态标签值,并判 断该总状态标签值是否大于等于2,当判断结果为是时,将判定次数计数器的判定次数值递增1,并进一步判断递增后的判定次数值是否等于预定判定次数值,如果递增后的判定次数值等于预定判定次数值,断路器动作使开关断开,并发出警报信息,所以,本发明中的检测方法采用基于机器学习的检测算法,能够提高直流故障电弧检测的准确性,小电流和大电流情况下均实用,也能够避免阈值设定不能适应所有情况带来的误检操作,有效降低误检率。According to the machine learning-based DC fault arc detection method for photovoltaic systems according to the present invention, the random forest model, support vector machine model, and decision tree model are constructed separately, and the state label values of the normal working state and the fault arc state are set to 0 respectively. And 1, and train the random forest model, support vector machine model, and decision tree model respectively to obtain the trained random forest model, support vector machine model, and decision tree model; use the current collection device and follow the scheduled sampling time and scheduled sampling Collect the real-time current signal obtained by the photovoltaic array on the DC side of the photovoltaic system at intervals; analyze and process the collected real-time current signal to obtain the time-domain and frequency-domain characteristics of the real-time current signal; and obtain the time-domain and frequency-domain characteristics The features are respectively input into the trained random forest model, support vector machine model and decision tree model to obtain their respective state label values; the sum of all state label values obtained is set as the total state label value, and the total state label is judged If the value is greater than or equal to 2, when the judgment result is yes, the judgment times value of the judgment times counter is incremented by 1, and it is further judged whether the incremented judgment times value is equal to the predetermined judgment times value, if the incremented judgment times value is equal to the predetermined judgment The value of the number of times, the circuit breaker action causes the switch to open, and an alarm message is issued. Therefore, the detection method in the present invention adopts a detection algorithm based on machine learning, which can improve the accuracy of DC fault arc detection. Practical, it can also avoid the false detection operation caused by the threshold setting can not adapt to all situations, and effectively reduce the false detection rate.
附图说明Description of the drawings
图1是本发明的实施例中检测光伏系统直流故障电弧的实时电流采集位置示意图;Fig. 1 is a schematic diagram of a real-time current collection position for detecting a DC fault arc of a photovoltaic system in an embodiment of the present invention;
图2是本发明的实施例中基于机器学习检测的光伏系统直流故障电弧检测方法的动作流程图;以及2 is an action flow chart of a method for detecting DC fault arcs of a photovoltaic system based on machine learning detection in an embodiment of the present invention; and
图3是本发明的实施例中构建并训练随机森林模型、支持向量机模型以及决策树模型的动作流程图。Fig. 3 is an action flow chart of constructing and training a random forest model, a support vector machine model, and a decision tree model in an embodiment of the present invention.
图中,1为光伏阵列,2为汇流箱,3为逆变器,4为交流电网,5为实时电流采集装置。In the figure, 1 is a photovoltaic array, 2 is a combiner box, 3 is an inverter, 4 is an AC power grid, and 5 is a real-time current acquisition device.
具体实施方式detailed description
以下将结合附图对本发明的构思、具体结构及产生的技术效果作进一步说明,以充分地了解本发明的基于机器学习的光伏系统直流故障电弧检测方法的目的、特征和效果。In the following, the concept, specific structure and technical effects of the present invention will be further described in conjunction with the accompanying drawings to fully understand the purpose, features and effects of the machine learning-based photovoltaic system DC fault arc detection method of the present invention.
<实施例><Example>
在本实施例中,以某10kW屋顶光伏电站的实验数据为例来进行光伏系统直流故障电弧检测。In this embodiment, the experimental data of a 10kW rooftop photovoltaic power station is taken as an example to detect the DC fault arc of the photovoltaic system.
图1是检测光伏系统直流故障电弧的实时电流采集位置示意图。Figure 1 is a schematic diagram of the real-time current collection location for detecting the DC fault arc of the photovoltaic system.
如图1所示,本实施例中的光伏系统包括依次相互连接的光伏阵列1、汇流箱2、逆变器3以及交流电网4,光伏阵列1和汇流箱2之间设有开关S1,汇流箱2和逆变器3所连电路之间设有电流采集装置5。光伏阵列1输出直流电流,多条直流支路在汇流箱2中并联汇流,将总的直流电流输入逆变器3中,逆变器 3将直流电转变为交流电输送至交流电网4,同时由逆变器3控制发出检测信号。在本实施例中,电流采集装置5为串入线圈感应式实时电流采集装置。As shown in Figure 1, the photovoltaic system in this embodiment includes a photovoltaic array 1, a combiner box 2, an inverter 3, and an AC power grid 4 that are connected to each other in sequence. A switch S1 is provided between the photovoltaic array 1 and the combiner box 2, and A current collecting device 5 is provided between the circuit connected to the box 2 and the inverter 3. Photovoltaic array 1 outputs DC current, and multiple DC branches are connected in parallel in combiner box 2, and the total DC current is input into inverter 3. Inverter 3 converts DC power to AC power and transmits it to AC power grid 4. Inverter 3 controls to send out a detection signal. In this embodiment, the current collecting device 5 is a real-time current collecting device of a series-in-coil induction type.
图2是基于机器学习检测的光伏系统直流故障电弧检测方法的动作流程图。Fig. 2 is an action flow chart of a method for detecting a DC fault arc of a photovoltaic system based on machine learning detection.
如图2所示,本实施例中的基于机器学习检测的光伏系统直流故障电弧检测方法,用来检测光伏系统是否存在直流故障电弧,包括以下步骤:As shown in Figure 2, the photovoltaic system DC fault arc detection method based on machine learning detection in this embodiment is used to detect whether the photovoltaic system has a DC fault arc, including the following steps:
步骤S1,分别构建随机森林模型、支持向量机模型以及决策树模型,设定正常工作状态和故障电弧状态的状态标签值分别为0和1,并分别对随机森林模型、支持向量机模型以及决策树模型进行训练,得到训练后的随机森林模型、支持向量机模型以及决策树模型。Step S1: Build a random forest model, a support vector machine model, and a decision tree model respectively, set the state label values of the normal working state and the fault arc state to 0 and 1, respectively, and compare the random forest model, the support vector machine model, and the decision tree model. The tree model is trained, and the trained random forest model, support vector machine model and decision tree model are obtained.
步骤S2,利用电流采集装置并按照预定采样时间和预定采样间隔采集光伏系统直流侧的光伏阵列所得到的实时电流信号。在本实施例中,预定采样时间为0.1s,预定采样间隔的初始值为0.5s。Step S2: Collect the real-time current signal obtained by the photovoltaic array on the DC side of the photovoltaic system by using the current collecting device and according to the predetermined sampling time and the predetermined sampling interval. In this embodiment, the predetermined sampling time is 0.1s, and the initial value of the predetermined sampling interval is 0.5s.
步骤S3,对步骤S2采集得到的实时电流信号进行分析处理,得到该实时电流信号的时域特征和频域特征。In step S3, the real-time current signal collected in step S2 is analyzed and processed to obtain the time-domain and frequency-domain characteristics of the real-time current signal.
时域特征包含电流平均值a1和电流方差a2,The time domain features include current average value a1 and current variance a2,
其中,N为采样个数,本实施例中,N为10000;A
i为第i个电流采样值。
Among them, N is the number of samples. In this embodiment, N is 10000; A i is the i-th current sampled value.
频域特征包含特定频段下的小波系数方差a3、小波系数能量a4以及小波系数波动程度a5,Frequency domain features include wavelet coefficient variance a3, wavelet coefficient energy a4, and wavelet coefficient fluctuation degree a5 in a specific frequency band,
a4=d
2
a4=d 2
其中,d
i为第i个采样电流信号小波分解后的系数,
为N个电流信号小波 分解后的系数的平均值,d为在特定频段下电流信号小波分解后的系数,d
max为在特定频段下电流信号小波分解系数的极大值。在本实施例中,特定频段为40kHz-80kHz;小波分解所采用的最优小波基为db10小波。
Wherein, D i is the i-th coefficients of the sampled current signal wavelet decomposition, Is the average value of the coefficients after wavelet decomposition of N current signals, d is the coefficient after wavelet decomposition of the current signal in a specific frequency band, and d max is the maximum value of the wavelet decomposition coefficient of the current signal in a specific frequency band. In this embodiment, the specific frequency band is 40kHz-80kHz; the optimal wavelet base used in wavelet decomposition is db10 wavelet.
步骤S4,将步骤S3得到的时域特征和频域特征分别输入步骤S1中训练后的随机森林模型、支持向量机模型以及决策树模型,得到各自的状态标签值。Step S4, input the time domain features and frequency domain features obtained in step S3 into the random forest model, support vector machine model, and decision tree model trained in step S1, respectively, to obtain respective state label values.
步骤S5,将步骤S4中得到的所有的状态标签值之和设定为总状态标签值,并判断该总状态标签值是否大于等于2,当判断结果为否时,进入步骤S6,当判断结果为是时,进入步骤S7。Step S5: Set the sum of all the state tag values obtained in step S4 as the total state tag value, and determine whether the total state tag value is greater than or equal to 2. When the judgment result is no, go to step S6, when the judgment result If yes, go to step S7.
步骤S6,进一步判断总状态标签值是否等于1,如果总状态标签值等于1,则减小预定采样间隔后重复执行步骤S2;否则,重复执行步骤S2。预定采样间隔减小后的值为0.1-0.3s,本实施例中,预定采样间隔减小后的值为0.2s。Step S6: It is further judged whether the total status tag value is equal to 1. If the total status tag value is equal to 1, step S2 is repeated after reducing the predetermined sampling interval; otherwise, step S2 is repeated. The reduced value of the predetermined sampling interval is 0.1-0.3s. In this embodiment, the reduced value of the predetermined sampling interval is 0.2s.
步骤S7,将判定次数计数器的判定次数值递增1,并进一步判断递增后的判定次数值是否等于预定判定次数值;如果递增后的判定次数值等于预定判定次数值,进入步骤S8;否则,减小预定采样间隔后重复执行步骤S2。在本实施例中,用户识别次数值为2或3;总状态标签值的初始值为0。Step S7: Increment the determination times value of the determination times counter by 1, and further determine whether the incremented determination times value is equal to the predetermined determination times value; if the incremented determination times value is equal to the predetermined determination times value, go to step S8; otherwise, decrement Step S2 is repeated after the predetermined sampling interval is small. In this embodiment, the value of the number of times of user identification is 2 or 3; the initial value of the total status tag value is 0.
步骤S8,断路器动作使开关S1断开,并发出警报信息。In step S8, the circuit breaker operates to open the switch S1, and an alarm message is issued.
图3是本发明的实施例中构建并训练随机森林模型、支持向量机模型以及决策树模型的动作流程图。Fig. 3 is an action flow chart of constructing and training a random forest model, a support vector machine model, and a decision tree model in an embodiment of the present invention.
如图3所示,在本实施例中,上述步骤S1是根据以下步骤实现:As shown in Figure 3, in this embodiment, the above step S1 is implemented according to the following steps:
步骤S1-1,利用电流采集装置并按照预定采样时间和预定采样间隔采集光伏系统直流侧的光伏阵列所得到的多组电流信号,每组电流信号包含处于正常工作状态下的正常电流信号和处于发生故障电弧状态下的故障电流信号。Step S1-1: Use the current acquisition device to collect multiple sets of current signals obtained by the photovoltaic array on the DC side of the photovoltaic system according to the predetermined sampling time and predetermined sampling interval. Each set of current signals includes a normal current signal in a normal working state and a The fault current signal in a fault arc state.
步骤S1-2,对每组电流信号中的正常电流信号和故障电流信号分别进行分析处理,得到各自的时域特征和频域特征。In step S1-2, the normal current signal and the fault current signal in each group of current signals are analyzed and processed separately to obtain respective time-domain characteristics and frequency-domain characteristics.
正常电流信号的时域特征包含电流平均值a11和电流方差a21,The time domain characteristics of the normal current signal include the current average value a11 and the current variance a21,
A
1i为第i个正常电流采样值,
A 1i is the i-th normal current sampling value,
故障电流信号的时域特征包含电流平均值a12和电流方差a22,The time domain characteristics of the fault current signal include the current average value a12 and the current variance a22,
A
2i为第i个故障电流采样值,
A 2i is the i-th fault current sampling value,
正常电流信号的频域特征包含特定频段下的小波系数方差a31、小波系数能量a41以及小波系数波动程度a51,The frequency domain characteristics of the normal current signal include the wavelet coefficient variance a31, the wavelet coefficient energy a41, and the wavelet coefficient fluctuation degree a51 in a specific frequency band.
d
1i为第i个正常电流信号小波分解后的系数,
为N个正常电流信号小波分解后的系数的平均值,d
1为在特定频段下正常电流信号小波分解后的系数,d
1max为在特定频段下正常电流信号小波分解系数的极大值,
d 1i is the coefficient after wavelet decomposition of the i-th normal current signal, Is the average value of the coefficients after wavelet decomposition of N normal current signals, d 1 is the coefficient after wavelet decomposition of normal current signals in a specific frequency band, d 1max is the maximum value of the wavelet decomposition coefficients of normal current signals in a specific frequency band,
故障电流信号的频域特征包含特定频段下的小波系数方差a32、小波系数能量a42以及小波系数波动程度a52,The frequency domain characteristics of the fault current signal include the wavelet coefficient variance a32, the wavelet coefficient energy a42, and the wavelet coefficient fluctuation degree a52 in a specific frequency band.
d
2i为第i个故障电流信号小波分解后的系数,
为N个故障电流信号小波分解后的系数的平均值,d
2为在特定频段下故障电流信号小波分解后的系数,d
2max为在特定频段下故障电流信号小波分解系数的极大值。
d 2i is the coefficient after wavelet decomposition of the i-th fault current signal, Is the average value of the coefficients after wavelet decomposition of N fault current signals, d 2 is the coefficient after wavelet decomposition of the fault current signal in a specific frequency band, and d 2max is the maximum value of the wavelet decomposition coefficient of the fault current signal in a specific frequency band.
表1列出了一组故障电流信号和一个正常电流信号的计算结果。Table 1 lists the calculation results of a group of fault current signals and a normal current signal.
表1 故障电流和正常电流实例计算结果Table 1 Example calculation results of fault current and normal current
To
|
故障电流Fault current
|
正常电流Normal current
|
电流平均值Average current
|
4.08914.0891
|
4.42714.4271
|
电流方差Current variance
|
0.00240.0024
|
0.00150.0015
|
小波系数方差Wavelet coefficient variance
|
2.98E-042.98E-04
|
2.78E-042.78E-04
|
小波系数能量Wavelet coefficient energy
|
0.37680.3768
|
0.35210.3521
|
小波系数波动程度Wavelet coefficient fluctuation degree
|
0.07760.0776
|
0.05430.0543
|
从表1中可知,当发生直流故障电弧时,光伏系统的电流平均值会突然减少,电流方差、小波系数方差、小波系数能量以及小波系数波动程度分别会突然增大,各个特征发生突变的程度由光伏系统的具体功率水平决定。It can be seen from Table 1 that when a DC fault arc occurs, the average current of the photovoltaic system will suddenly decrease, and the current variance, wavelet coefficient variance, wavelet coefficient energy, and wavelet coefficient fluctuation degree will suddenly increase, and the degree of sudden change in each feature Determined by the specific power level of the photovoltaic system.
步骤S1-3,分别构建随机森林模型、支持向量机模型以及决策树模型,设定正常工作状态和故障电弧状态的状态标签值分别为0和1。In step S1-3, a random forest model, a support vector machine model, and a decision tree model are constructed respectively, and the state label values of the normal working state and the faulted arc state are set to 0 and 1, respectively.
步骤S1-4,将步骤S1-2得到的正常电流信号的时域特征和频域特征、以及故障电流信息的时域特征和频域特征作为训练集分别对随机森林模型、支持向量机模型以及决策树模型进行训练,从而得到训练后的随机森林模型、支持向量机模型以及决策树模型。Step S1-4, using the time-domain and frequency-domain features of the normal current signal obtained in step S1-2, and the time-domain and frequency-domain features of the fault current information as the training set, respectively, to the random forest model, support vector machine model, and The decision tree model is trained to obtain the trained random forest model, support vector machine model, and decision tree model.
在本实施例中,随机森林模型所采用的最大深度为2,子模型数量为10;支持向量机模型所采用的核函数为径向基函数,正则化权重为10;决策树模型所采用的的正则化参数为11,正则化权重为1。In this embodiment, the maximum depth used by the random forest model is 2, and the number of sub-models is 10; the kernel function used by the support vector machine model is the radial basis function, and the regularization weight is 10; The regularization parameter is 11, and the regularization weight is 1.
实施例的作用与效果The function and effect of the embodiment
根据本实施例所涉及的基于机器学习的光伏系统直流故障电弧检测方法,因为分别构建随机森林模型、支持向量机模型以及决策树模型,设定正常工作状态和故障电弧状态的状态标签值分别为0和1,并分别对随机森林模型、支持向量机模型以及决策树模型进行训练,得到训练后的随机森林模型、支持向量机模型 以及决策树模型;利用电流采集装置并按照预定采样时间和预定采样间隔采集光伏系统直流侧的光伏阵列所得到的实时电流信号;对采集得到的实时电流信号进行分析处理,得到该实时电流信号的时域特征和频域特征;将得到的时域特征和频域特征分别输入训练后的随机森林模型、支持向量机模型以及决策树模型,得到各自的状态标签值;将得到的所有的状态标签值之和设定为总状态标签值,并判断该总状态标签值是否大于等于2,当判断结果为是时,将判定次数计数器的判定次数值递增1,并进一步判断递增后的判定次数值是否等于预定判定次数值,如果递增后的判定次数值等于预定判定次数值,断路器动作使开关断开,并发出警报信息,所以,本实施例中的检测方法采用基于机器学习的检测算法,能够提高直流故障电弧检测的准确性,小电流和大电流情况下均实用,也能够避免阈值设定不能适应所有情况带来的误检操作,有效降低误检率。According to the DC fault arc detection method of photovoltaic system based on machine learning involved in this embodiment, because the random forest model, support vector machine model, and decision tree model are constructed separately, the state label values of the normal working state and the fault arc state are set as 0 and 1, and train the random forest model, support vector machine model, and decision tree model respectively to obtain the trained random forest model, support vector machine model, and decision tree model; use the current collection device and follow the scheduled sampling time and schedule The real-time current signal obtained by the photovoltaic array on the DC side of the photovoltaic system is collected at sampling intervals; the real-time current signal obtained is analyzed and processed to obtain the time-domain and frequency-domain characteristics of the real-time current signal; the time-domain characteristics and frequency are obtained The domain features are respectively input into the trained random forest model, support vector machine model and decision tree model to obtain their respective state label values; set the sum of all state label values obtained as the total state label value, and judge the total state Whether the tag value is greater than or equal to 2, when the judgment result is yes, increment the judgment times value of the judgment times counter by 1, and further judge whether the incremented judgment times value is equal to the predetermined judgment times value, if the incremented judgment times value is equal to the predetermined Determine the value of the number of times, the circuit breaker action causes the switch to open, and an alarm message is issued. Therefore, the detection method in this embodiment adopts a detection algorithm based on machine learning, which can improve the accuracy of DC fault arc detection, low current and high current situations The following are practical, and it can also avoid the false detection operation caused by the threshold setting cannot adapt to all situations, and effectively reduce the false detection rate.
上述实施方式为本发明的优选案例,并不用来限制本发明的保护范围。The foregoing embodiments are preferred cases of the present invention, and are not used to limit the protection scope of the present invention.