CN105044624A - Seven-electric level inverter with fault diagnosis function and fault diagnosis method - Google Patents

Seven-electric level inverter with fault diagnosis function and fault diagnosis method Download PDF

Info

Publication number
CN105044624A
CN105044624A CN201510489538.8A CN201510489538A CN105044624A CN 105044624 A CN105044624 A CN 105044624A CN 201510489538 A CN201510489538 A CN 201510489538A CN 105044624 A CN105044624 A CN 105044624A
Authority
CN
China
Prior art keywords
fault
diagnosis
neural network
data
dsp
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.)
Granted
Application number
CN201510489538.8A
Other languages
Chinese (zh)
Other versions
CN105044624B (en
Inventor
张震
王天真
韩金刚
张米露
耿超
董晶晶
刘要辉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Maritime University
Original Assignee
Shanghai Maritime University
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Shanghai Maritime University filed Critical Shanghai Maritime University
Priority to CN201510489538.8A priority Critical patent/CN105044624B/en
Publication of CN105044624A publication Critical patent/CN105044624A/en
Application granted granted Critical
Publication of CN105044624B publication Critical patent/CN105044624B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Inverter Devices (AREA)
  • Other Investigation Or Analysis Of Materials By Electrical Means (AREA)

Abstract

本发明公开了一种带故障诊断功能的七电平逆变器以及相应的基于神经网络的故障诊断方法。所述方法包括六个步骤:采集故障样本数据、FFT变换、PCA降维、构建并训练BP神经网络、将算法嵌入DSP中、以及故障诊断。本发明用于电力故障诊断,能够实现七电平逆变器故障的在线实时诊断;以七电平逆变器的输出电压作为唯一检测信号用来进行故障诊断;本逆变器自带有故障诊断功能,能够在线实时诊断出10种故障并通过数码管显示出来。

The invention discloses a seven-level inverter with a fault diagnosis function and a corresponding fault diagnosis method based on a neural network. The method includes six steps: collecting fault sample data, FFT transformation, PCA dimension reduction, constructing and training BP neural network, embedding algorithm into DSP, and fault diagnosis. The invention is used for power fault diagnosis, and can realize online real-time diagnosis of seven-level inverter faults; the output voltage of the seven-level inverter is used as the only detection signal for fault diagnosis; the inverter has its own fault The diagnosis function can diagnose 10 kinds of faults online in real time and display them through the digital tube.

Description

带故障诊断功能的七电平逆变器及故障诊断方法Seven-level inverter with fault diagnosis function and fault diagnosis method

技术领域:Technical field:

本发明涉及电力故障诊断,具体涉及一种带故障诊断功能的七电平逆变器以及相应的故障诊断方法。The invention relates to power fault diagnosis, in particular to a seven-level inverter with fault diagnosis function and a corresponding fault diagnosis method.

背景技术:Background technique:

随着电力电子技术的发展和电力电子器件生产成本的降低,高压大功率变换器被广泛应用于各种电气设备中,例如大功率交流电机传动、有源电力滤波和新能源并网等。而为了满足日益提高的电力系统发展需求,多电平逆变器应运而生。和普通的二电平逆变器相比,级联H桥型逆多电平逆变器具有诸多优异的性能,比如谐波少,输出波形更加接近于正弦,开关管两端电压低,由于随着开关管耐压的增高,其价格按照指数型增加,所以通过用廉价的低耐压开关管代替昂贵的高耐压开关管,能够极大的降低逆变器的设计成本与维修费用,在高压大功率场合尤为明显。With the development of power electronic technology and the reduction of production cost of power electronic devices, high-voltage high-power converters are widely used in various electrical equipment, such as high-power AC motor drive, active power filter and new energy grid connection, etc. In order to meet the increasing demand for power system development, multi-level inverters emerged as the times require. Compared with the ordinary two-level inverter, the cascaded H-bridge inverse multi-level inverter has many excellent performances, such as less harmonics, the output waveform is closer to sinusoidal, and the voltage at both ends of the switching tube is low. As the withstand voltage of the switch tube increases, its price increases exponentially. Therefore, by replacing the expensive high withstand voltage switch tube with a cheap low withstand voltage switch tube, the design cost and maintenance cost of the inverter can be greatly reduced. Especially in high voltage and high power occasions.

尽管多电平逆变器有诸多优点,但是它也有着一些不可避免的缺陷。随着输出电平数的增多,它所需要的开关器件数将会大量增加,这将会大大地提高系统发生故障的概率。级联H桥型多电平逆变器的产生虽然为电力电子技术在高压、大功率场合的应用提供了很多便利,但一旦发生故障,轻则造成企业停产,重则会造成灾难性事故,给社会带来巨大的损失。Although multilevel inverter has many advantages, it also has some unavoidable defects. As the number of output levels increases, the number of switching devices it requires will increase significantly, which will greatly increase the probability of system failure. Although the generation of cascaded H-bridge multi-level inverters provides a lot of convenience for the application of power electronics technology in high-voltage and high-power occasions, once a failure occurs, it will cause the enterprise to stop production, and it will cause catastrophic accidents. bring huge losses to the society.

发明内容:Invention content:

本发明首次将基于神经网络的故障诊断方法嵌入DSP内,通过DSP在线采集七电平逆变器的输出电压做到实时的检测与故障诊断。The invention embeds the neural network-based fault diagnosis method into the DSP for the first time, and realizes real-time detection and fault diagnosis by collecting the output voltage of the seven-level inverter online through the DSP.

本发明的第一个目的是提供一种带故障诊断功能的七电平逆变器,其技术方案如下:The first object of the present invention is to provide a seven-level inverter with fault diagnosis function, and its technical scheme is as follows:

一种带故障诊断功能的七电平逆变器,包括直流电源、H桥主电路、DSP、电压变速器、电阻负载、以及显示装置。直流电源由三个24v直流电源组成,DSP产生SPWM驱动H桥主电路将来自直流电源的直流电转换成交流电,该交流电其电压加载到20欧姆的电阻负载两端,并且被电压变送器检测。电压变送器将检测到的电压信号成比例降低到0~3v的范围之内送给DSP。A seven-level inverter with a fault diagnosis function, including a DC power supply, an H-bridge main circuit, a DSP, a voltage changer, a resistance load, and a display device. The DC power supply consists of three 24v DC power supplies. The DSP generates SPWM to drive the H-bridge main circuit to convert the DC power from the DC power supply into AC power. The voltage of the AC power is applied to both ends of the 20-ohm resistive load and detected by the voltage transmitter. The voltage transmitter reduces the detected voltage signal proportionally to the range of 0-3v and sends it to DSP.

H桥主电路由三个H桥组成,将第一个H桥的四个开关管分别标记为H1S1、H1S2、H1S3和H1S4,第二个H桥的四个开关管分别标记为H2S1、H2S2、H2S3和H2S4,将第三个H桥的四个开关管分别标记为H3S1、H3S2、H3S3和H3S4,开关管选择为IGBT。Vo1、Vo2和Vo3分别表示三个H桥的输出电压,Vo是该电路最终的输出电压,将三个H桥的输出端级联后,使得Vo=Vo1+Vo2+Vo3。由于Vo1、Vo2、Vo3=0V或±E。三个直流电源的电压为V1、V2和V3,并且V1=V2=V3=E。这样,在任意时刻,Vo可以等于±3E、±2E、±E或0V,即本逆变器可以输出七种不同的电平。The H-bridge main circuit is composed of three H-bridges. The four switching tubes of the first H-bridge are marked as H1S1, H1S2, H1S3 and H1S4 respectively, and the four switching tubes of the second H-bridge are marked as H2S1, H2S2, H2S3 and H2S4, mark the four switch tubes of the third H bridge as H3S1, H3S2, H3S3 and H3S4 respectively, and select the switch tube as IGBT. Vo1, Vo2 and Vo3 represent the output voltages of the three H-bridges respectively, and Vo is the final output voltage of the circuit. After the output ends of the three H-bridges are cascaded, Vo=Vo1+Vo2+Vo3. Because Vo1, Vo2, Vo3=0V or ±E. The voltages of the three DC power sources are V1, V2 and V3, and V1=V2=V3=E. In this way, at any moment, Vo can be equal to ±3E, ±2E, ±E or 0V, that is, the inverter can output seven different levels.

H桥主电路的电路状态和七电平逆变器的故障类型对应如下:H1S1开路-故障1,H1S2开路-故障2,H1S3开路-故障3,H1S4开路-故障4,H2S1开路-故障5,H2S1开路-故障6,H2S3开路-故障7,H2S4开路-故障8,H3S1或者H3S4开路-故障9,H3S2或者H3S3开路-故障10,正常工作-故障0。The circuit state of the H-bridge main circuit and the fault type of the seven-level inverter correspond as follows: H1S1 open circuit-fault 1, H1S2 open circuit-fault 2, H1S3 open circuit-fault 3, H1S4 open circuit-fault 4, H2S1 open circuit-fault 5, H2S1 open circuit - fault 6, H2S3 open circuit - fault 7, H2S4 open circuit - fault 8, H3S1 or H3S4 open circuit - fault 9, H3S2 or H3S3 open circuit - fault 10, normal operation - fault 0.

通过DSP在线采集七电平逆变器的输出电压做到实时的检测与故障诊断。所述DSP中嵌入基于神经网络的七电平逆变器的故障诊断方法。所述故障诊断方法经过数据预处理和神经网络训练。The output voltage of the seven-level inverter is collected online by DSP to achieve real-time detection and fault diagnosis. A fault diagnosis method for a seven-level inverter based on a neural network embedded in the DSP. The fault diagnosis method is through data preprocessing and neural network training.

本发明带故障诊断功能的七电平逆变器的一个实施例,还包括数码管,DSP通过数码管实时显示逆变器的状态。An embodiment of the seven-level inverter with fault diagnosis function of the present invention also includes a digital tube, and the DSP displays the state of the inverter in real time through the digital tube.

本发明带故障诊断功能的七电平逆变器的另一个实施例,DSP包括数据预处理和神经网络训练模块、基于神经网络的故障诊断模块、以及数据存储模块Another embodiment of the seven-level inverter with fault diagnosis function of the present invention, DSP includes data preprocessing and neural network training module, fault diagnosis module based on neural network, and data storage module

所述基于神经网络的七电平逆变器故障诊断方法的数据预处理步骤如下:The data preprocessing steps of the neural network-based seven-level inverter fault diagnosis method are as follows:

步骤1采集故障样本数据:Step 1 collect fault sample data:

首先采集逆变器故障时的输出电压作为故障样本数据,采集的方法为在逆变器的输出电压一个周期内等间隔地采集512个时刻的离散电压值,每次采集的电压用序列表示。序列中的每个值等于对应时刻的电压值。First, the output voltage when the inverter fails is collected as the fault sample data. The collection method is to collect discrete voltage values at 512 moments at equal intervals within one cycle of the output voltage of the inverter. The voltage collected each time uses a sequence express. Each value in the sequence is equal to the voltage value at the corresponding moment.

根据H桥主电路的电路状态和七电平逆变器的故障类型的对应关系:H1S1开路-故障1,H1S2开路-故障2,H1S3开路-故障3,H1S4开路-故障4,H2S1开路-故障5,H2S1开路-故障6,H2S3开路-故障7,H2S4开路-故障8,H3S1或者H3S4开路-故障9,H3S2或者H3S3开路-故障10,正常工作-故障0,人为设置开路故障,采集逆变器在十种故障情况下输出的电压波形,以及正常工作情况下的电压波形。本步骤中采集的故障数据越多越好。本发明的一个实施例选取采集每种电压波形各100组。According to the corresponding relationship between the circuit state of the H-bridge main circuit and the fault type of the seven-level inverter: H1S1 open circuit-fault 1, H1S2 open circuit-fault 2, H1S3 open circuit-fault 3, H1S4 open circuit-fault 4, H2S1 open circuit-fault 4 5. H2S1 open circuit - fault 6, H2S3 open circuit - fault 7, H2S4 open circuit - fault 8, H3S1 or H3S4 open circuit - fault 9, H3S2 or H3S3 open circuit - fault 10, normal operation - fault 0, artificially set open circuit fault, collect inverter The voltage waveforms output by the converter under ten fault conditions, and the voltage waveforms under normal working conditions. The more fault data collected in this step, the better. In one embodiment of the present invention, 100 groups of each voltage waveform are collected.

步骤2FFT变换:Step 2FFT transformation:

将序列进行FFT变换,FFT变换公式:这里Wb=e-j2π/b,k=0,1,...,b/2-1;will sequence Carry out FFT transformation, FFT transformation formula: Here W b =e -j2π/b , k=0,1,...,b/2-1;

GG kk == ΣΣ nno == 00 bb 22 -- 11 xx 22 nno WW bb // 22 nno kk ;;

Hh kk == ΣΣ nno == 00 bb 22 -- 11 xx 22 nno ++ 11 WW bb // 22 nno kk ..

经过FFT变换后得到了一个个数为512的虚数序列取该序列的前10个数据并且将该序列的数据进行取模,将取模后的序列作为样本数据进行下一步的计算。After FFT transformation, an imaginary number sequence with a number of 512 is obtained Get the first 10 data of the sequence And the data of the sequence is moduloed, and the sequence after the modulus is As a sample data for the next calculation.

步骤3PCA降维:Step 3PCA dimensionality reduction:

经过上述的FFT变换及截取后,原电压信号的特征数据由512个变为了10个,接下来进行PCA降维。具体方法如下:After the above-mentioned FFT transformation and interception, the characteristic data of the original voltage signal changed from 512 to 10, and then PCA dimension reduction was performed. The specific method is as follows:

首先采集所有种类的故障样本数据:First collect all kinds of failure sample data:

Xx 1111 ×× 1010 == {{ || Ff 11 kk || }} 00 99 {{ || Ff 22 kk || }} 00 99 .. .. .. {{ || Ff 1111 kk || }} 00 99 ,,

接着求协方差矩阵RX的特征值λ与特征值向量P:Then find the eigenvalue λ and eigenvalue vector P of the covariance matrix R X :

协方差矩阵:RX=E{[X-E(X)][X-E(X)]T}。Covariance matrix: R X =E{[XE(X)][XE(X)] T }.

通过求解|λI-RX|=0和|λiI-RX|pi=0,i=1,2,…,b求得λ和P,其中,λi为RX的第i个特征值,并且满足λ1≥λ2≥…≥λb,pi是相应于特征值λi的特征向量,P=[p1,p2,…,pb]T。这里b的值为11。选取前P的前3列,得到P1=[p1,p2,p3],且P1为10×3的矩阵。以上工作只需要离线做一次,然后保留P1。Obtain λ and P by solving |λI-R X |=0 and |λ i IR X |p i =0,i=1,2,...,b, where λ i is the ith eigenvalue of R X , and satisfy λ 1 ≥λ 2 ≥...≥λ b , p i is the eigenvector corresponding to the eigenvalue λ i , P=[p 1 ,p 2 ,...,p b ] T . Here the value of b is 11. Select the first 3 columns of the first P to obtain P1 = [p 1 , p 2 , p 3 ], and P1 is a 10×3 matrix. The above work only needs to be done once offline, and then keep P1.

最后计算出BP神经网络的输入序列xin是个数为4的数据序列,第一个数据是原信号的基波的相位,后三个是PCA降维后的数据序列。Finally, the input sequence of the BP neural network is calculated x in is a data sequence with a number of 4. The first data is the phase of the fundamental wave of the original signal, and the last three are the data sequences after PCA dimensionality reduction.

所述基于神经网络的七电平逆变器故障诊断方法的神经网络训练步骤如下:The neural network training steps of the neural network-based seven-level inverter fault diagnosis method are as follows:

步骤4构建并训练BP神经网络Step 4 Build and train the BP neural network

本发明构建的BP神经网络为三层神经网络,由于原始信号经过FFT变换以及PCA降维后得到了个数为4的特征数据xin,则输入层神经元个数定为4个,由于总共有11种故障类型,则输出层神经元个数为11,隐层神经元个数根据经验选取为15。The BP neural network constructed by the present invention is a three-layer neural network. Since the original signal has obtained 4 feature data x in after FFT transformation and PCA dimension reduction, the number of neurons in the input layer is set to 4. Since the total There are 11 types of faults, the number of neurons in the output layer is 11, and the number of neurons in the hidden layer is selected as 15 based on experience.

设输入层的神经元为隐层的神经元为输出层的神经元为激活函数为Sigmoid函数,设的系数矩阵为xw4×15的系数矩阵为xw15×11,则输入输出关系为:Let the neurons of the input layer be The neurons in the hidden layer are The neurons in the output layer are The activation function is the Sigmoid function, set and The coefficient matrix of is xw 4×15 , and The coefficient matrix of is xw 15×11 , then the input-output relationship is:

y k = Σ i = 0 14 1 1 + e - w i × wy i k , k = 1 , 2 , ... , 10 (式2-1) the y k = Σ i = 0 14 1 1 + e - w i × wy i k , k = 1 , 2 , ... , 10 (Formula 2-1)

w k = Σ i = 0 3 1 1 + e - x i n i × xw i k , k = 1 , 2 , ... , 14 (式2-2) w k = Σ i = 0 3 1 1 + e - x i no i × w i k , k = 1 , 2 , ... , 14 (Formula 2-2)

构建好BP神经网络之后,需要对原始的网络进行训练。After building the BP neural network, the original network needs to be trained.

首先将步骤1中采集好的11种故障信号(含正常信号),经过FFT和PCA后得到训练样本:First, the 11 kinds of fault signals (including normal signals) collected in step 1 are obtained through FFT and PCA to obtain training samples:

Xx __ SS aa mm pp ll ee == {{ xx ii nno 11 kk }} 00 33 {{ xx ii nno 22 kk }} 00 33 .. .. .. {{ xx ii nno 1010 kk }} 00 33 ,,

由于步骤1中每种故障各采集了100组信号,所以此时可以得到100个X_Sample,将每个X_Sample的理论输出均设置为:Since 100 sets of signals were collected for each fault in step 1, 100 X_Samples can be obtained at this time, and the theoretical output of each X_Sample is set as:

YY == 11 00 00 00 00 00 00 00 00 00 00 00 11 00 00 00 00 00 00 00 00 00 00 00 11 00 00 00 00 00 00 00 00 .. .. .. 00 00 00 00 00 00 00 00 00 00 11 ,,

采用动量梯度下降算法训练BP网络,训练误差阈值设为0.0001,学习率α=0.5,训练后得到两个系数矩阵xw_end∈R4×15和xw_end∈R15×11,这两个矩阵包含了训练好的神经网路所有信息,因此,神经网络只需要离线训练一次,得到这两个矩阵后便不再需要训练了。The momentum gradient descent algorithm is used to train the BP network, the training error threshold is set to 0.0001, and the learning rate α=0.5. After training, two coefficient matrices xw_end∈R 4×15 and xw_end∈R 15×11 are obtained. These two matrices contain the training A good neural network has all the information. Therefore, the neural network only needs to be trained offline once, and after obtaining these two matrices, it no longer needs to be trained.

所述基于神经网络的七电平逆变器故障诊断方法嵌入DSP的步骤如下:The steps of embedding DSP in the neural network-based seven-level inverter fault diagnosis method are as follows:

步骤5将算法嵌入DSP中Step 5 Embed the algorithm in DSP

首先初始化DSP。初始化DSP的时钟、锁相环、中断向量表,定义DSP的A0口为AD采集口采集电压,定义DSP的GPIO16、GPIO17、GPIO18、GPIO19为数码管通讯口,用来控制数码管显示的数字。配置DSP的Timer0模块,使DSP产生周期中断,中断的频率为25.6KHz。同时建立数组xw[4][15]和wy[15][11]分别储存步骤4中的xw_end∈R4×15和wy_end∈R15×11,建立数组ad_value[512]存储DSP采集的电压值。Initialize the DSP first. Initialize the clock, phase-locked loop, and interrupt vector table of the DSP, define the A0 port of the DSP as the AD acquisition port to collect voltage, and define the GPIO16, GPIO17, GPIO18, and GPIO19 of the DSP as the digital tube communication ports to control the numbers displayed by the digital tube. Configure the Timer0 module of the DSP to make the DSP generate periodic interrupts with a frequency of 25.6KHz. At the same time, create arrays xw[4][15] and wy[15][11] to store xw_end∈R 4×15 and wy_end∈R 15×11 in step 4 respectively, and create array ad_value[512] to store the voltage value collected by DSP .

然后编写故障诊断子函数程序,命名为“diagnosis()”。该子函数的输入是512个电压值Then write a fault diagnosis sub-function program, named "diagnosis ()". The input of this subfunction is 512 voltage values

序列ad_value[512];该子函数的输出是一个数字量k,k的值就是故障的类型,比如diagnosis()函数最终输出k=1,则表明DSP诊断出逆变器的故障为种类1,即H1S1开路故障。所述故障诊断子函数程序的内容如下:Sequence ad_value[512]; the output of this sub-function is a digital quantity k, and the value of k is the type of fault. For example, the final output of the diagnosis () function k=1 indicates that the fault of the inverter diagnosed by the DSP is type 1. That is, H1S1 open circuit fault. The content of the fault diagnosis sub-function program is as follows:

ad_value[512]数组存储满之后,触发一次故障诊断,根据步骤2和步骤3中的内容,将采集好的512个数据ad_value[512]进行预处理,得到预处理之后的四个数据接着将该数据和步骤4中的结果xw[4][15]和wy[15][11]带入公式公式(2-1)和式(2-2)进行神经网络诊断;最后,得到神经网络输出序列yk,该序列由11个数据组成,包含诊断结果;DSP使用冒泡排序法找到yk中的最大值的下标k,k的值就是表1中所示的故障种类,DSP将该值实时显示在数码管上;然后,清空数组ad_value[512],重新开始采集逆变器的输出电压值,进行新一轮的故障诊断After the ad_value[512] array is full, a fault diagnosis is triggered. According to the content in step 2 and step 3, the collected 512 data ad_value[512] are preprocessed to obtain four preprocessed data Then bring the data and the results xw[4][15] and wy[15][11] in step 4 into formula (2-1) and formula (2-2) for neural network diagnosis; finally, get the neural network The network output sequence y k , which is composed of 11 data, including diagnosis results; DSP uses the bubble sorting method to find the subscript k of the maximum value in y k , the value of k is the fault type shown in Table 1, DSP Display the value on the digital tube in real time; then, clear the array ad_value[512], restart collecting the output voltage value of the inverter, and carry out a new round of fault diagnosis

最后,编写主函数程序“main()”,在主函数中,程序设置为无限循环模式,每当DSP进入中断,则触发一次AD采样,并存储在ad_value[512]数组中,当采集512次时,在main()函数中调用一次diagnosis()函数,进行故障诊断,诊断结束后,将诊断的结果数据显示在数码管上。Finally, write the main function program "main()". In the main function, the program is set to an infinite loop mode. Whenever the DSP enters an interrupt, an AD sampling is triggered and stored in the ad_value[512] array. When the acquisition is 512 times , call the diagnosis() function once in the main() function to perform fault diagnosis. After the diagnosis is completed, the diagnosis result data will be displayed on the digital tube.

本发明同时提供了一种基于神经网络的七电平逆变器故障诊断方法,所述基于神经网络的故障诊断方法经过数据预处理步骤和神经网络训练步骤,嵌入DSP中,所述基于神经网络的故障诊断方法由DSP自动采集数据,进行故障诊断,并通过数码管实时显示逆变器的状态。The present invention also provides a neural network-based fault diagnosis method for a seven-level inverter, the neural network-based fault diagnosis method is embedded in a DSP through a data preprocessing step and a neural network training step, and the neural network-based The advanced fault diagnosis method uses DSP to automatically collect data, perform fault diagnosis, and display the status of the inverter in real time through the digital tube.

所述数据预处理步骤和神经网络训练步骤如下:Described data preprocessing step and neural network training step are as follows:

步骤1采集故障样本数据:Step 1 collect fault sample data:

首先采集逆变器故障时的输出电压作为故障样本数据,采集的方法为在逆变器的输出电压一个周期内等间隔地采集512个时刻的离散电压值,每次采集的电压用序列表示,序列中的每个值等于对应时刻的电压值;First, the output voltage when the inverter fails is collected as the fault sample data. The collection method is to collect discrete voltage values at 512 moments at equal intervals within one cycle of the output voltage of the inverter. The voltage collected each time uses a sequence Indicates that each value in the sequence is equal to the voltage value at the corresponding moment;

根据H桥主电路的电路状态和七电平逆变器的故障类型的对应关系:H1S1开路-故障1,H1S2开路-故障2,H1S3开路-故障3,H1S4开路-故障4,H2S1开路-故障5,H2S1开路-故障6,H2S3开路-故障7,H2S4开路-故障8,H3S1或者H3S4开路-故障9,H3S2或者H3S3开路-故障10,正常工作-故障0,人为设置开路故障,采集逆变器在十种故障情况下输出的电压波形,以及正常工作情况下的电压波形;采集每种电压波形各100组;According to the corresponding relationship between the circuit state of the H-bridge main circuit and the fault type of the seven-level inverter: H1S1 open circuit-fault 1, H1S2 open circuit-fault 2, H1S3 open circuit-fault 3, H1S4 open circuit-fault 4, H2S1 open circuit-fault 4 5. H2S1 open circuit - fault 6, H2S3 open circuit - fault 7, H2S4 open circuit - fault 8, H3S1 or H3S4 open circuit - fault 9, H3S2 or H3S3 open circuit - fault 10, normal operation - fault 0, artificially set open circuit fault, collect inverter The voltage waveform output by the device under ten kinds of fault conditions, and the voltage waveform under normal working conditions; collect 100 groups of each voltage waveform;

步骤2FFT变换:Step 2FFT transformation:

将序列进行FFT变换,FFT变换公式:这里Wb=e-j2π/b,k=0,1,...,b/2-1;will sequence Carry out FFT transformation, FFT transformation formula: Here W b =e -j2π/b , k=0,1,...,b/2-1;

GG kk == ΣΣ nno == 00 bb 22 -- 11 xx 22 nno WW bb // 22 nno kk ;;

Hh kk == ΣΣ nno == 00 bb 22 -- 11 xx 22 nno ++ 11 WW bb // 22 nno kk ;;

经过FFT变换后得到了一个个数为512的虚数序列取该序列的前10个数据并且将该序列的数据进行取模,将取模后的序列作为样本数据进行下一步的计算;After FFT transformation, an imaginary number sequence with a number of 512 is obtained Get the first 10 data of the sequence And the data of the sequence is moduloed, and the sequence after the modulus is As the sample data for the next calculation;

步骤3PCA降维:Step 3PCA dimensionality reduction:

经过上述的FFT变换及截取后,原电压信号的特征数据由512个变为了10个,接下来进行PCA降维;具体方法如下:After the above-mentioned FFT transformation and interception, the characteristic data of the original voltage signal changed from 512 to 10, and then PCA dimensionality reduction was performed; the specific method is as follows:

首先采集所有种类的故障样本数据:First collect all kinds of failure sample data:

Xx 1111 ×× 1010 == {{ || Ff 11 kk || }} 00 99 {{ || Ff 22 kk || }} 00 99 .. .. .. {{ || Ff 1111 kk || }} 00 99 ,,

接着求协方差矩阵RX的特征值λ与特征值向量P:Then find the eigenvalue λ and eigenvalue vector P of the covariance matrix R X :

协方差矩阵:RX=E{[X-E(X)][X-E(X)]T};Covariance matrix: R X = E{[XE(X)][XE(X)] T };

通过求解|λI-RX|=0和|λiI-RX|pi=0,i=1,2,…,b求得λ和P,其中,λi为RX的第i个特征值,并且满足λ1≥λ2≥…≥λb,pi是相应于特征值λi的特征向量,P=[p1,p2,…,pb]T,这里b的值为11;选取P的前3列,得到P1=[p1,p2,p3],P1为10×3的矩阵;以上工作只需要离线做一次,然后保留P1;Obtain λ and P by solving |λI-R X |=0 and |λ i IR X |p i =0,i=1,2,...,b, where λ i is the ith eigenvalue of R X , and satisfy λ 1 ≥λ 2 ≥…≥λ b , p i is the eigenvector corresponding to the eigenvalue λ i , P=[p 1 ,p 2 ,…,p b ] T , where the value of b is 11; Select the first 3 columns of P to get P1=[p 1 ,p 2 ,p 3 ], P1 is a 10×3 matrix; the above work only needs to be done once offline, and then keep P1;

最后计算出BP神经网络的输入序列xin是个数为4的数据序列,第一个数据是原信号的基波的相位,后三个是PCA降维后的数据序列;Finally, the input sequence of the BP neural network is calculated x in is a data sequence with a number of 4, the first data is the phase of the fundamental wave of the original signal, and the last three are the data sequences after PCA dimensionality reduction;

步骤4构建并训练BP神经网络Step 4 Build and train the BP neural network

BP神经网络为三层神经网络,由于原始信号经过FFT变换以及PCA降维后得到了个数为4的特征数据xin,则输入层神经元个数定为4个,由于总共有11种故障类型,则输出层神经元个数为11,隐层神经元个数根据经验选取为15;The BP neural network is a three-layer neural network. Since the original signal has undergone FFT transformation and PCA dimensionality reduction, the number of characteristic data x in is 4, so the number of neurons in the input layer is set to 4. Since there are 11 types of faults in total type, the number of neurons in the output layer is 11, and the number of neurons in the hidden layer is selected as 15 based on experience;

设输入层的神经元为隐层的神经元为输出层的神经元为激活函数为Sigmoid函数,设的系数矩阵为xw4×15的系数矩阵为xw15×11,则输入输出关系为:Let the neurons of the input layer be The neurons in the hidden layer are The neurons in the output layer are The activation function is the Sigmoid function, set and The coefficient matrix of is xw 4×15 , and The coefficient matrix of is xw 15×11 , then the input-output relationship is:

y k = Σ i = 0 14 1 1 + e - w i × wy i k , k = 1 , 2 , ... , 10 (式2-1) the y k = Σ i = 0 14 1 1 + e - w i × wy i k , k = 1 , 2 , ... , 10 (Formula 2-1)

w k = Σ i = 0 3 1 1 + e - x i n i × xw i k , k = 1 , 2 , ... , 14 (式2-2) w k = Σ i = 0 3 1 1 + e - x i no i × w i k , k = 1 , 2 , ... , 14 (Formula 2-2)

构建好BP神经网络之后,对原始的网络进行训练;After building the BP neural network, train the original network;

首先将步骤1中采集好的11种故障信号(含正常信号),经过FFT和PCA后得到训练样本:First, the 11 kinds of fault signals (including normal signals) collected in step 1 are obtained through FFT and PCA to obtain training samples:

Xx __ SS aa mm pp ll ee == {{ xx ii nno 11 kk }} 00 33 {{ xx ii nno 22 kk }} 00 33 .. .. .. {{ xx ii nno 1010 kk }} 00 33 ,,

由于步骤1中每种故障各采集了100组信号,所以此时可以得到100个X_Sample,将每个X_Sample的理论输出均设置为:Since 100 sets of signals were collected for each fault in step 1, 100 X_Samples can be obtained at this time, and the theoretical output of each X_Sample is set as:

YY == 11 00 00 00 00 00 00 00 00 00 00 00 11 00 00 00 00 00 00 00 00 00 00 00 11 00 00 00 00 00 00 00 00 .. .. .. 00 00 00 00 00 00 00 00 00 00 11 ,,

采用动量梯度下降算法训练BP网络,训练误差阈值设为0.0001,学习率α=0.5,训练后得到两个系数矩阵xw_end∈R4×15和xw_end∈R15×11,这两个矩阵包含了训练好的神经网路所有信息,因此,神经网络只需要离线训练一次,得到这两个矩阵后便不再需要训练;The momentum gradient descent algorithm is used to train the BP network, the training error threshold is set to 0.0001, and the learning rate α=0.5. After training, two coefficient matrices xw_end∈R 4×15 and xw_end∈R 15×11 are obtained. These two matrices contain the training All the information of a good neural network, therefore, the neural network only needs to be trained offline once, and no training is required after obtaining these two matrices;

基于神经网络的故障诊断方法依如下步骤嵌入DSP中:The fault diagnosis method based on neural network is embedded in DSP according to the following steps:

步骤5将算法嵌入DSP中Step 5 Embed the algorithm in DSP

首先初始化DSP;初始化DSP的时钟、锁相环、中断向量表,定义DSP的A0口为AD采集口采集电压,定义DSP的GPIO16、GPIO17、GPIO18、GPIO19为数码管通讯口,用来控制数码管显示的数字;配置DSP的Timer0模块,使DSP产生周期中断,中断的频率为25.6KHz;同时建立数组xw[4][15]和wy[15][11]分别储存步骤4中的xw_end∈R4×15和wy_end∈R15×11,建立数组ad_value[512]存储DSP采集的电压值;First initialize the DSP; initialize the clock, phase-locked loop, and interrupt vector table of the DSP, define the A0 port of the DSP as the AD acquisition port to collect voltage, and define the GPIO16, GPIO17, GPIO18, and GPIO19 of the DSP as the digital tube communication ports to control the digital tube Displayed numbers; configure the Timer0 module of the DSP to make the DSP generate periodic interrupts, and the interrupt frequency is 25.6KHz; at the same time, create arrays xw[4][15] and wy[15][11] to store xw_end∈R in step 4 respectively 4×15 and wy_end∈R 15×11 , set up an array ad_value[512] to store the voltage value collected by DSP;

然后编写故障诊断子函数程序,命名为“diagnosis()”;所述故障诊断子函数的输入是512个电压值序列ad_value[512];所述故障诊断子函数的输出是一个数字量k,k的值是故障的类型;所述故障诊断子函数程序的内容如下:Then write the fault diagnosis subfunction program, named as "diagnosis ()"; the input of the fault diagnosis subfunction is 512 voltage value sequences ad_value[512]; the output of the fault diagnosis subfunction is a digital quantity k, k The value of is the type of fault; the content of the fault diagnosis sub-function program is as follows:

ad_value[512]数组存储满之后,触发一次故障诊断,根据步骤2和步骤3中的内容,将采集好的512个数据ad_value[512]进行预处理,得到预处理之后的四个数据接着将该数据和步骤4中的结果xw[4][15]和wy[15][11]带入公式公式(2-1)和式(2-2)进行神经网络诊断,得到神经网络输出序列yk,该序列由11个数据组成,包含诊断结果;DSP使用冒泡排序法找到yk中的最大值的下标k,k的值就是表1中所示的故障种类,DSP将该值实时显示在数码管上;然后,清空数组ad_value[512],重新开始采集逆变器的输出电压值,进行新一轮的故障诊断;After the ad_value[512] array is full, a fault diagnosis is triggered. According to the content in step 2 and step 3, the collected 512 data ad_value[512] are preprocessed to obtain four preprocessed data Then bring this data and the results xw[4][15] and wy[15][11] in step 4 into formula (2-1) and formula (2-2) for neural network diagnosis, and obtain the neural network output Sequence y k , the sequence is composed of 11 data, including diagnosis results; DSP uses bubble sorting method to find the subscript k of the maximum value in y k , the value of k is the fault type shown in Table 1, DSP will The value is displayed on the digital tube in real time; then, the array ad_value[512] is cleared, and the output voltage value of the inverter is collected again for a new round of fault diagnosis;

最后,编写主函数程序“main()”,在主函数中,程序设置为无限循环模式,每当DSP进入中断,则触发一次AD采样,并存储在ad_value[512]数组中,当采集512次时,在main()函数中调用一次diagnosis()函数,进行故障诊断。Finally, write the main function program "main()". In the main function, the program is set to an infinite loop mode. Whenever the DSP enters an interrupt, an AD sampling is triggered and stored in the ad_value[512] array. When the acquisition is 512 times , call the diagnosis() function once in the main() function to diagnose the fault.

本发明具有以下效果:The present invention has the following effects:

1.本发明由七电平逆变电路和DSP检测诊断电路组成,能够实现故障的在线实时诊断。1. The present invention is composed of a seven-level inverter circuit and a DSP detection and diagnosis circuit, which can realize online real-time diagnosis of faults.

2.本发明以七电平逆变器的输出电压作为唯一检测信号用来进行故障诊断。2. The present invention uses the output voltage of the seven-level inverter as the only detection signal for fault diagnosis.

3.本发明将电压信号进行FFT变换,然后进行PCA降维,接着在将FFT变换后的电压基波相位信号加入PCA降维后的数据最为故障信号的特征数据,最后将特征数据输入训练好的BP神经网络,进行故障诊断。3. The present invention performs FFT transformation on the voltage signal, then performs PCA dimension reduction, and then adds the FFT-transformed voltage fundamental wave phase signal to the PCA dimension reduction data as the characteristic data of the fault signal, and finally inputs the characteristic data for training BP neural network for fault diagnosis.

4.本逆变器自带有故障诊断功能,能够在线实时诊断出10种故障并通过数码管显示出来。4. The inverter has its own fault diagnosis function, which can diagnose 10 kinds of faults online in real time and display them through the digital tube.

下面结合附图和实施例对本发明进一步说明。The present invention will be further described below in conjunction with the accompanying drawings and embodiments.

附图说明:Description of drawings:

图1本发明带有自诊断功能的七电平逆变器的硬件结构图;Fig. 1 present invention has the hardware structural diagram of the seven-level inverter of self-diagnosis function;

图2本发明级联H桥型七电平逆变器的主电路拓扑图;Fig. 2 main circuit topological diagram of cascaded H-bridge type seven-level inverter of the present invention;

图3本发明七电平逆变器输出电压波形图;Fig. 3 seven-level inverter output voltage waveform diagram of the present invention;

图4本发明BP神经网络结构图;Fig. 4 BP neural network structural diagram of the present invention;

图5本发明DSP故障诊断程序流程图;Fig. 5 flow chart of DSP fault diagnosis program of the present invention;

图6本发明H1S1开路故障时输出的电压波形图;The voltage wave diagram of output when Fig. 6 H1S1 open circuit fault of the present invention;

图7本发明正常工况下DSP的诊断情况;Diagnosis situation of DSP under the normal working condition of Fig. 7 of the present invention;

图8本发明H1S1开路故障时DSP的诊断情况;Diagnosis situation of DSP when Fig. 8 H1S1 open circuit fault of the present invention;

图9是本发明DSP内部程序模块图。Fig. 9 is a block diagram of the DSP internal program of the present invention.

图中,1是DSP,3是直流电源,9是H桥主电路,4是辅助电源,5是电阻负载,6是电压变送器,8是故障显示器,11是0v电压,33是七电平逆变器输出波形0v上面的电平,66是七电平逆变器输出波形0v下面的电平,22是七电平输出电压故障波形在0v之上的电平。H1S1、H1S2、H1S3和H1S4分别是第一个H桥的四个开关管,分别标记为H2S1、H2S2、H2S3和H2S4分别是第二个H桥的四个开关管,H3S1、H3S2、H3S3和H3S4分别标是第三个H桥的四个开关管;Vo1、Vo2和Vo3分别是三个H桥的输出电压,Vo是该电路最终的输出电压。111是数据预处理和神经网络训练模块,222是基于神经网络的故障诊断模块,333是数据存储模块。In the figure, 1 is DSP, 3 is DC power supply, 9 is H bridge main circuit, 4 is auxiliary power supply, 5 is resistance load, 6 is voltage transmitter, 8 is fault display, 11 is 0v voltage, 33 is seven power supply 66 is the level below the output waveform of the seven-level inverter 0v, and 22 is the level above the fault waveform of the seven-level inverter output voltage above 0v. H1S1, H1S2, H1S3 and H1S4 are the four switch tubes of the first H-bridge respectively, marked as H2S1, H2S2, H2S3 and H2S4 respectively are the four switch tubes of the second H-bridge, H3S1, H3S2, H3S3 and H3S4 The four switching tubes of the third H-bridge are marked respectively; Vo1, Vo2 and Vo3 are the output voltages of the three H-bridges, and Vo is the final output voltage of the circuit. 111 is a data preprocessing and neural network training module, 222 is a fault diagnosis module based on neural network, and 333 is a data storage module.

具体实施方法:Specific implementation method:

如图1一种带故障诊断功能的七电平逆变器,包括直流电源3、H桥主电路9、DSP1、电压变送器6、电阻负载5、以及故障显示器8。直流电源3由三个24v直流电源组成,DSP1产生SPWM驱动H桥主电路9,将来自直流电源3的直流电转换成交流电,该交流电其电压加载到20欧姆的电阻负载5两端,并且被电压变送器6检测。电压变送器6将检测到的电压信号成比例降低到0~3v的范围之内送给DSP1。As shown in Figure 1, a seven-level inverter with fault diagnosis function includes a DC power supply 3 , an H-bridge main circuit 9 , DSP1 , a voltage transmitter 6 , a resistive load 5 , and a fault display 8 . The DC power supply 3 is composed of three 24v DC power supplies. The DSP1 generates SPWM to drive the H-bridge main circuit 9, and converts the DC power from the DC power supply 3 into AC power. Transmitter 6 detection. The voltage transmitter 6 reduces the detected voltage signal proportionally to the range of 0-3v and sends it to DSP1.

图2所示,H桥主电路由三个H桥组成,将第一个H桥的四个开关管分别标记为H1S1、H1S2、H1S3和H1S4,第二个H桥的四个开关管分别标记为H2S1、H2S2、H2S3和H2S4,将第三个H桥的四个开关管分别标记为H3S1、H3S2、H3S3和H3S4,开关管选择为IGBT。Vo1、Vo2和Vo3分别表示三个H桥的输出电压,Vo是该电路最终的输出电压,将三个H桥的输出端级联后,使得Vo=Vo1+Vo2+Vo3。由于Vo1、Vo2、Vo3=0V或±E。三个直流电源的电压为V1、V2和V3,并且V1=V2=V3=E。这样,在任意时刻,Vo可以等于±3E、±2E、±E或0V,即本逆变器可以输出七种不同的电平。As shown in Figure 2, the H-bridge main circuit is composed of three H-bridges. The four switching tubes of the first H-bridge are marked as H1S1, H1S2, H1S3 and H1S4 respectively, and the four switching tubes of the second H-bridge are respectively marked as For H2S1, H2S2, H2S3 and H2S4, mark the four switch tubes of the third H bridge as H3S1, H3S2, H3S3 and H3S4 respectively, and select the switch tube as IGBT. Vo1, Vo2 and Vo3 represent the output voltages of the three H-bridges respectively, and Vo is the final output voltage of the circuit. After the output ends of the three H-bridges are cascaded, Vo=Vo1+Vo2+Vo3. Because Vo1, Vo2, Vo3=0V or ±E. The voltages of the three DC power sources are V1, V2 and V3, and V1=V2=V3=E. In this way, at any moment, Vo can be equal to ±3E, ±2E, ±E or 0V, that is, the inverter can output seven different levels.

七电平逆变器正常工况时输出的电压波形(电阻性负载)如图3所示,该图中,横坐标为时间,纵坐标是电压,以0v电压11为,上面有3个七电平逆变器输出波形0v上面的电平33,下面有3个七电平逆变器输出波形0v下面的电平66。这种电压波形在伏秒意义上等于正弦波。当逆变器发生故障时,逆变器的输出电压波形将会发生变化,根据输出电压波形的不同,能够区别出不同的故障种类。因此本发明提出的故障诊断算法以该电压信号作为唯一诊断依据。The voltage waveform (resistive load) output by the seven-level inverter under normal working conditions is shown in Figure 3. In this figure, the abscissa is time, and the ordinate is voltage. The 0v voltage is 11, and there are three seven The level inverter outputs the level 33 above the waveform 0v, and there are three seven-level inverters outputting the level 66 below the waveform 0v. This voltage waveform is equal to a sine wave in the volt-second sense. When the inverter fails, the output voltage waveform of the inverter will change, and different fault types can be distinguished according to the difference in the output voltage waveform. Therefore, the fault diagnosis algorithm proposed by the present invention takes the voltage signal as the only diagnosis basis.

经过分析所有单管开路故障情况,除了H3S1和H3S4以及H3S2和H3S3两对管子各自故障时输出电压波形一致时,其他的管子故障时输出电压波形两两各不相同。因此本发明暂时将H3S1或者H3S4开路列为一类故障,同样H3S2或者H3S3开路列也列为一类故障。因此本逆变器共有10种开路故障和一种正常工作状态,将它们列为下表:After analyzing all single-tube open-circuit faults, except that the output voltage waveforms of the two pairs of tubes H3S1 and H3S4 and H3S2 and H3S3 are consistent when they fail, the output voltage waveforms of other tubes are different in pairs. Therefore, the present invention temporarily classifies the open circuit of H3S1 or H3S4 as a type of fault, and the open circuit of H3S2 or H3S3 is also classified as a type of fault. Therefore, there are 10 kinds of open-circuit faults and one normal working state in this inverter, and they are listed in the following table:

表1七电平逆变器的故障分类Table 1 Fault classification of seven-level inverter

电路状态circuit status 定义故障种类Define the type of failure H1S1开路H1S1 open circuit 故障1Fault 1 H1S2开路H1S2 open circuit 故障2failure 2 H1S3开路H1S3 open circuit 故障3failure 3 H1S4开路H1S4 open circuit 故障4Fault 4 H2S1开路H2S1 open circuit 故障5Fault 5 H2S2开路H2S2 open circuit 故障6Fault 6 H2S3开路H2S3 open circuit 故障7Fault 7 H2S4开路H2S4 open circuit 故障8Fault 8 H3S1或者H3S4开路H3S1 or H3S4 open circuit 故障9Fault 9

H3S2或者H3S3开路H3S2 or H3S3 open circuit 故障10Fault 10 正常工作normal work 故障0Fault 0

表1列举出了本逆变器能够进行自诊断的所有故障种类,共计10种,同时为了统一,加上逆变器正常工作时的状态,本逆变器总共有11种状态能被检测并显示出来。比如数码管显示为0,则表示逆变器正常工作,如果数码管显示为6,则对应第6类故障,即H2S2开路。Table 1 lists all the types of faults that the inverter can self-diagnose, a total of 10 types. At the same time, in order to unify, plus the state of the inverter when it is working normally, the inverter has a total of 11 states that can be detected and analyzed. display. For example, if the digital tube displays 0, it means the inverter is working normally. If the digital tube displays 6, it corresponds to the sixth type of fault, that is, H2S2 open circuit.

H桥主电路的电路状态和七电平逆变器的故障类型对应如下:H1S1开路-故障1,H1S2开路-故障2,H1S3开路-故障3,H1S4开路-故障4,H2S1开路-故障5,H2S1开路-故障6,H2S3开路-故障7,H2S4开路-故障8,H3S1或者H3S4开路-故障9,H3S2或者H3S3开路-故障10,正常工作-故障0。The circuit state of the H-bridge main circuit and the fault type of the seven-level inverter correspond as follows: H1S1 open circuit-fault 1, H1S2 open circuit-fault 2, H1S3 open circuit-fault 3, H1S4 open circuit-fault 4, H2S1 open circuit-fault 5, H2S1 open circuit - fault 6, H2S3 open circuit - fault 7, H2S4 open circuit - fault 8, H3S1 or H3S4 open circuit - fault 9, H3S2 or H3S3 open circuit - fault 10, normal operation - fault 0.

基于神经网络的七电平逆变器故障诊断方法嵌入DSP内,通过DSP在线采集七电平逆变器的输出电压做到实时的检测与故障诊断。The neural network-based seven-level inverter fault diagnosis method is embedded in the DSP, and the output voltage of the seven-level inverter is collected online through the DSP to achieve real-time detection and fault diagnosis.

图9是是本发明DSP内部程序模块图。DSP包括数据预处理和神经网络训练模块111,基于神经网络的故障诊断模块222,以及数据存储模块333。逆变器的输入信号经过数据预处理和神经网络训练模块111进行数据预处理和神经网络训练,结果存储于数据存储模块333。基于神经网络的故障诊断模块222接收经过数据预处理和神经网络训练模块111处理过的逆变器信号,并利用数据存储模块333的存储数据,对逆变器进行故障诊断。Fig. 9 is a block diagram of the internal program of the DSP of the present invention. The DSP includes a data preprocessing and neural network training module 111 , a neural network-based fault diagnosis module 222 , and a data storage module 333 . The input signal of the inverter is processed by the data preprocessing and neural network training module 111 for data preprocessing and neural network training, and the result is stored in the data storage module 333 . The neural network-based fault diagnosis module 222 receives the inverter signal processed by the data preprocessing and neural network training module 111 , and uses the stored data of the data storage module 333 to diagnose the inverter fault.

所述基于神经网络的故障诊断方法如下:The fault diagnosis method based on neural network is as follows:

系统上电运行,DSP开始自动采集数据,每间隔39微秒采集一次逆变器的输出电压值,并且自动将电压值存储在数组ad_value[512]中;当该数组存储满之后,DSP调用其故障诊断子函数diagnosis()进行一次故障诊断,并将该函数的输出值k通过数码管显示出来,本次诊断结束;然后清空数组ad_value[512],重新开始采集逆变器的输出电压值,进行新一轮的故障诊断,如此反复进行“采集-诊断-显示”的循环,一个循环周期为39微秒,数码管同时实时显示逆变器的状态。障诊断子函数diagnosis()的内容如下:When the system is powered on and running, the DSP starts to automatically collect data, collects the output voltage value of the inverter every 39 microseconds, and automatically stores the voltage value in the array ad_value[512]; when the array is full, the DSP calls its The fault diagnosis sub-function diagnosis() performs a fault diagnosis, and displays the output value k of this function through the digital tube, and this diagnosis ends; then clear the array ad_value[512], and start collecting the output voltage value of the inverter again, Carry out a new round of fault diagnosis, and repeat the cycle of "acquisition-diagnosis-display". One cycle is 39 microseconds, and the digital tube displays the status of the inverter in real time at the same time. The content of the fault diagnosis sub-function diagnosis() is as follows:

ad_value[512]数组存储满之后,触发一次故障诊断,根据步骤2和步骤3中的内容,将采集好的512个数据ad_value[512]进行预处理,得到预处理之后的四个数据接着将该数据和步骤4中的结果xw[4][15]和wy[15][11]带入公式公式(2-1)和式(2-2)进行神经网络诊断,得到神经网络输出序列yk,该序列由11个数据组成,包含诊断结果;DSP使用冒泡排序法找到yk中的最大值的下标k,k的值就是表1中所示的故障种类,DSP将该值实时显示在数码管上;然后,清空数组ad_value[512],重新开始采集逆变器的输出电压值,进行新一轮的故障诊断;After the ad_value[512] array is full, a fault diagnosis is triggered. According to the content in step 2 and step 3, the collected 512 data ad_value[512] are preprocessed to obtain four preprocessed data Then bring this data and the results xw[4][15] and wy[15][11] in step 4 into formula (2-1) and formula (2-2) for neural network diagnosis, and obtain the neural network output Sequence y k , the sequence is composed of 11 data, including diagnosis results; DSP uses bubble sorting method to find the subscript k of the maximum value in y k , the value of k is the fault type shown in Table 1, DSP will The value is displayed on the digital tube in real time; then, the array ad_value[512] is cleared, and the output voltage value of the inverter is collected again for a new round of fault diagnosis;

最后,编写主函数程序“main()”,在主函数中,程序设置为无限循环模式,每当DSP进入中断,则触发一次AD采样,并存储在ad_value[512]数组中,当采集512次时,在main()函数中调用一次diagnosis()函数,进行故障诊断,诊断结束后,将诊断的结果数据显示在数码管上。Finally, write the main function program "main()". In the main function, the program is set to an infinite loop mode. Whenever the DSP enters an interrupt, an AD sampling is triggered and stored in the ad_value[512] array. When the acquisition is 512 times , call the diagnosis() function once in the main() function to perform fault diagnosis. After the diagnosis is completed, the diagnosis result data will be displayed on the digital tube.

基于神经网络的故障诊断方法的具体步骤如图5所示。The specific steps of the neural network-based fault diagnosis method are shown in Figure 5.

所述数据预处理步骤和神经网络训练步骤如下:Described data preprocessing step and neural network training step are as follows:

步骤1采集故障样本数据:Step 1 collect fault sample data:

首先采集逆变器故障时的输出电压作为故障样本数据,采集的方法为在逆变器的输出电压一个周期内等间隔地采集512个时刻的离散电压值,每次采集的电压用序列表示。序列中的每个值等于对应时刻的电压值。First, the output voltage when the inverter fails is collected as the fault sample data. The collection method is to collect discrete voltage values at 512 moments at equal intervals within one cycle of the output voltage of the inverter. The voltage collected each time uses a sequence express. Each value in the sequence is equal to the voltage value at the corresponding moment.

根据H桥主电路的电路状态和七电平逆变器的故障类型的对应关系:H1S1开路-故障1,H1S2开路-故障2,H1S3开路-故障3,H1S4开路-故障4,H2S1开路-故障5,H2S1开路-故障6,H2S3开路-故障7,H2S4开路-故障8,H3S1或者H3S4开路-故障9,H3S2或者H3S3开路-故障10,正常工作-故障0,人为设置开路故障,采集逆变器在十种故障情况下输出的电压波形,以及正常工作情况下的电压波形。本步骤中采集的故障数据越多越好。本发明的一个实施例选取采集每种电压波形各100组。According to the corresponding relationship between the circuit state of the H-bridge main circuit and the fault type of the seven-level inverter: H1S1 open circuit-fault 1, H1S2 open circuit-fault 2, H1S3 open circuit-fault 3, H1S4 open circuit-fault 4, H2S1 open circuit-fault 4 5. H2S1 open circuit - fault 6, H2S3 open circuit - fault 7, H2S4 open circuit - fault 8, H3S1 or H3S4 open circuit - fault 9, H3S2 or H3S3 open circuit - fault 10, normal operation - fault 0, artificially set open circuit fault, collect inverter The voltage waveforms output by the converter under ten fault conditions, and the voltage waveforms under normal working conditions. The more fault data collected in this step, the better. In one embodiment of the present invention, 100 groups of each voltage waveform are collected.

步骤2FFT变换:Step 2FFT transformation:

将序列进行FFT变换,FFT变换公式:这里Wb=e-j2π/b,k=0,1,...,b/2-1;will sequence Carry out FFT transformation, FFT transformation formula: Here W b =e -j2π/b , k=0,1,...,b/2-1;

GG kk == ΣΣ nno == 00 bb 22 -- 11 xx 22 nno WW bb // 22 nno kk ;;

Hh kk == ΣΣ nno == 00 bb 22 -- 11 xx 22 nno ++ 11 WW bb // 22 nno kk ..

经过FFT变换后得到了一个个数为512的虚数序列取该序列的前10个数据并且将该序列的数据进行取模,将取模后的序列作为样本数据进行下一步的计算。After FFT transformation, an imaginary number sequence with a number of 512 is obtained Get the first 10 data of the sequence And the data of the sequence is moduloed, and the sequence after the modulus is As a sample data for the next calculation.

步骤3PCA降维:Step 3PCA dimensionality reduction:

经过上述的FFT变换及截取后,原电压信号的特征数据由512个变为了10个,接下来进行PCA降维。具体方法如下:After the above-mentioned FFT transformation and interception, the characteristic data of the original voltage signal changed from 512 to 10, and then PCA dimension reduction was performed. The specific method is as follows:

首先采集所有种类的故障样本数据:First collect all kinds of failure sample data:

Xx 1111 ×× 1010 == {{ || Ff 11 kk || }} 00 99 {{ || Ff 22 kk || }} 00 99 .. .. .. {{ || Ff 1111 kk || }} 00 99 ,,

接着求协方差矩阵RX的特征值λ与特征值向量P:Then find the eigenvalue λ and eigenvalue vector P of the covariance matrix R X :

协方差矩阵:RX=E{[X-E(X)][X-E(X)]T}。Covariance matrix: R X =E{[XE(X)][XE(X)] T }.

通过求解|λI-RX|=0和|λiI-RX|pi=0,i=1,2,…,b求得λ和P,其中,λi为RX的第i个特征值,并且满足λ1≥λ2≥…≥λb,pi是相应于特征值λi的特征向量,P=[p1,p2,…,pb]T。这里b的值为11。选取前P的前3列,得到P1=[p1,p2,p3],且P1为10×3的矩阵。以上工作只需要离线做一次,然后保留P1。Obtain λ and P by solving |λI-R X |=0 and |λ i IR X |p i =0,i=1,2,...,b, where λ i is the ith eigenvalue of R X , and satisfy λ 1 ≥λ 2 ≥...≥λ b , p i is the eigenvector corresponding to the eigenvalue λ i , P=[p 1 ,p 2 ,...,p b ] T . Here the value of b is 11. Select the first 3 columns of the first P to obtain P1 = [p 1 , p 2 , p 3 ], and P1 is a 10×3 matrix. The above work only needs to be done once offline, and then keep P1.

最后计算出BP神经网络的输入序列xin是个数为4的数据序列,第一个数据是原信号的基波的相位,后三个是PCA降维后的数据序列。Finally, the input sequence of the BP neural network is calculated x in is a data sequence with a number of 4. The first data is the phase of the fundamental wave of the original signal, and the last three are the data sequences after PCA dimensionality reduction.

步骤4构建并训练BP神经网络Step 4 Build and train the BP neural network

本发明构建的BP神经网络为三层神经网络,由于原始信号经过FFT变换以及PCA降维后得到了个数为4的特征数据xin,则输入层神经元个数定为4个,由于总共有11种故障类型,则输出层神经元个数为11,隐层神经元个数根据经验选取为15。BP神经网络结构图如图4所示。The BP neural network constructed by the present invention is a three-layer neural network. Since the original signal has obtained 4 feature data x in after FFT transformation and PCA dimension reduction, the number of neurons in the input layer is set to 4. Since the total There are 11 types of faults, the number of neurons in the output layer is 11, and the number of neurons in the hidden layer is selected as 15 based on experience. The structure diagram of BP neural network is shown in Fig.4.

设输入层的神经元为隐层的神经元为输出层的神经元为激活函数为Sigmoid函数,设的系数矩阵为xw4×15的系数矩阵为xw15×11,则输入输出关系为:Let the neurons of the input layer be The neurons in the hidden layer are The neurons in the output layer are The activation function is the Sigmoid function, set and The coefficient matrix of is xw 4×15 , and The coefficient matrix of is xw 15×11 , then the input-output relationship is:

y k = Σ i = 0 14 1 1 + e - w i × wy i k , k = 1 , 2 , ... , 10 (式2-1) the y k = Σ i = 0 14 1 1 + e - w i × wy i k , k = 1 , 2 , ... , 10 (Formula 2-1)

w k = Σ i = 0 3 1 1 + e - x i n i × xw i k , k = 1 , 2 , ... , 14 (式2-2) w k = Σ i = 0 3 1 1 + e - x i no i × w i k , k = 1 , 2 , ... , 14 (Formula 2-2)

构建好BP神经网络之后,需要对原始的网络进行训练。After building the BP neural network, the original network needs to be trained.

首先将步骤1中采集好的11种故障信号(含正常信号),经过FFT和PCA后得到训练样本:First, the 11 kinds of fault signals (including normal signals) collected in step 1 are obtained through FFT and PCA to obtain training samples:

Xx __ SS aa mm pp ll ee == {{ xx ii nno 11 kk }} 00 33 {{ xx ii nno 22 kk }} 00 33 .. .. .. {{ xx ii nno 1010 kk }} 00 33 ,,

由于步骤1中每种故障各采集了100组信号,所以此时可以得到100个X_Sample,将每个X_Sample的理论输出均设置为:Since 100 sets of signals were collected for each fault in step 1, 100 X_Samples can be obtained at this time, and the theoretical output of each X_Sample is set as:

YY == 11 00 00 00 00 00 00 00 00 00 00 00 11 00 00 00 00 00 00 00 00 00 00 00 11 00 00 00 00 00 00 00 00 .. .. .. 00 00 00 00 00 00 00 00 00 00 11 ,,

采用动量梯度下降算法训练BP网络,训练误差阈值设为0.0001,学习率α=0.5,训练后得到两个系数矩阵xw_end∈R4×15和xw_end∈R15×11,这两个矩阵包含了训练好的神经网路所有信息,因此,神经网络只需要离线训练一次,得到这两个矩阵后便不再需要训练了。The momentum gradient descent algorithm is used to train the BP network, the training error threshold is set to 0.0001, and the learning rate α=0.5. After training, two coefficient matrices xw_end∈R 4×15 and xw_end∈R 15×11 are obtained. These two matrices contain the training A good neural network has all the information. Therefore, the neural network only needs to be trained offline once, and after obtaining these two matrices, it no longer needs to be trained.

基于神经网络的故障诊断方法依如下步骤嵌入DSP中:The fault diagnosis method based on neural network is embedded in DSP according to the following steps:

步骤5将算法嵌入DSP中Step 5 Embed the algorithm in DSP

首先初始化DSP。初始化DSP的时钟、锁相环、中断向量表,定义DSP的A0口为AD采集口采集电压,定义DSP的GPIO16、GPIO17、GPIO18、GPIO19为数码管通讯口,用来控制数码管显示的数字。配置DSP的Timer0模块,使DSP产生周期中断,中断的频率为25.6KHz。同时建立数组xw[4][15]和wy[15][11]分别储存步骤4中的xw_end∈R4×15和wy_end∈R15×11,建立数组ad_value[512]存储DSP采集的电压值。Initialize the DSP first. Initialize the clock, phase-locked loop, and interrupt vector table of the DSP, define the A0 port of the DSP as the AD acquisition port to collect voltage, and define the GPIO16, GPIO17, GPIO18, and GPIO19 of the DSP as the digital tube communication ports to control the numbers displayed by the digital tube. Configure the Timer0 module of the DSP to make the DSP generate periodic interrupts with a frequency of 25.6KHz. At the same time, create arrays xw[4][15] and wy[15][11] to store xw_end∈R 4×15 and wy_end∈R 15×11 in step 4 respectively, and create array ad_value[512] to store the voltage value collected by DSP .

然后编写故障诊断子函数程序,命名为“diagnosis()”。该子函数的输入是512个电压值序列ad_value[512];该子函数的输出是一个数字量k,k的值就是故障的类型,比如diagnosis()函数最终输出k=1,则表明DSP诊断出逆变器的故障为种类1,即H1S1开路故障。所述故障诊断子函数程序的内容如下:Then write a fault diagnosis sub-function program, named "diagnosis ()". The input of this sub-function is 512 voltage value sequences ad_value[512]; the output of this sub-function is a digital quantity k, and the value of k is the type of fault. For example, the final output of the diagnosis () function k=1 indicates DSP diagnosis The inverter fault is type 1, that is, H1S1 open circuit fault. The content of the fault diagnosis sub-function program is as follows:

ad_value[512]数组存储满之后,触发一次故障诊断,根据步骤2和步骤3中的内容,将采集好的512个数据ad_value[512]进行预处理,得到预处理之后的四个数据接着将该数据和步骤4中的结果xw[4][15]和wy[15][11]带入公式公式(2-1)和式(2-2)进行神经网络诊断,得到神经网络输出序列yk,该序列由11个数据组成,包含诊断结果;DSP使用冒泡排序法找到yk中的最大值的下标k,k的值就是表1中所示的故障种类,DSP将该值实时显示在数码管上;然后,清空数组ad_value[512],重新开始采集逆变器的输出电压值,进行新一轮的故障诊断。After the ad_value[512] array is full, a fault diagnosis is triggered. According to the content in step 2 and step 3, the collected 512 data ad_value[512] are preprocessed to obtain four preprocessed data Then bring this data and the results xw[4][15] and wy[15][11] in step 4 into formula (2-1) and formula (2-2) for neural network diagnosis, and obtain the neural network output Sequence y k , the sequence is composed of 11 data, including diagnosis results; DSP uses bubble sorting method to find the subscript k of the maximum value in y k , the value of k is the fault type shown in Table 1, DSP will The value is displayed on the digital tube in real time; then, the array ad_value[512] is cleared, and the output voltage value of the inverter is collected again for a new round of fault diagnosis.

最后,编写主函数程序“main()”,在主函数中,程序设置为无限循环模式,每当DSP进入中断,则触发一次AD采样,并存储在ad_value[512]数组中,当采集512次时,在main()函数中调用一次diagnosis()函数,进行故障诊断,诊断结束后,将诊断的结果数据显示在数码管上。Finally, write the main function program "main()". In the main function, the program is set to an infinite loop mode. Whenever the DSP enters an interrupt, an AD sampling is triggered and stored in the ad_value[512] array. When the acquisition is 512 times , call the diagnosis() function once in the main() function to perform fault diagnosis. After the diagnosis is completed, the diagnosis result data will be displayed on the digital tube.

实际诊断效果展示Actual diagnosis effect display

这里只展示正常情况下和H1S1开路时电路输出波形和诊断结果。其他故障情况下,经过实测,均能完全诊断出来。Here we only show the circuit output waveform and diagnostic results under normal conditions and when H1S1 is open. In the case of other faults, they can be completely diagnosed after actual measurement.

正常状态下以及H1S1开路时电路的输出电压波形图如图3和图6所示所示。图3为正常状态下,级联H桥型七电平逆变器的电压输出波形图,该波形上面有3个33七电平逆变器输出波形0v上面的电平,该波形下面有3个七电平逆变器输出波形0v下面的电平66。The output voltage waveforms of the circuit under normal conditions and when H1S1 is open are shown in Figure 3 and Figure 6. Figure 3 is the voltage output waveform diagram of the cascaded H-bridge seven-level inverter under normal conditions. There are three 33 levels above the waveform of the seven-level inverter output waveform 0v on the waveform, and there are three levels below the waveform. A seven-level inverter outputs a level 66 below the waveform 0v.

当H1S1发生开路故障时,七电平输出电压波形在0v之上变为两个七电平输出电压故障波形在0v之上的电平22。通过这种输出电压波形的形状不同,可以将这两种状态区分开来。由于本方法是将故障波形与故障种类建立一一对应的关系,所以无需对何种原因导致的这种波形进行研究。其他故障时,输出电压的形状会发生其他变化,本发明就是依据这种变化来进行故障诊断的。When an open-circuit fault occurs in H1S1, the seven-level output voltage waveform above 0v becomes two levels 22 where the seven-level output voltage fault waveform is above 0v. These two states can be distinguished by the shape difference of the output voltage waveform. Since this method establishes a one-to-one correspondence between fault waveforms and fault types, there is no need to study what causes this waveform. In case of other faults, the shape of the output voltage will undergo other changes, and the present invention performs fault diagnosis based on such changes.

图7和图8分别展示了正常状态下以及H1S1开路时DSP的诊断情况。它们为本发明的效果展示图,该逆变器由DSP1、直流电源3、辅助电源4、电阻负载5、霍尔电压传感器、电压变送器6组成,每个部件均已在图中标出。其中数码管上显示的是诊断的结果,图7中,电路工作在正常状态,则数码管显示为0,图8中,由于H1S1发生了开路故障,则DSP检测并确定该故障,将数码管显示为1。Figure 7 and Figure 8 show the diagnosis of DSP under normal conditions and when H1S1 is open. They are the effect display diagrams of the present invention. The inverter is composed of DSP1, DC power supply 3, auxiliary power supply 4, resistance load 5, Hall voltage sensor, and voltage transmitter 6. Each component has been marked in the figure. The digital tube displays the diagnostic result. In Figure 7, the digital tube displays 0 when the circuit is working in a normal state. Displayed as 1.

经验证,如果任意一种表1中的故障状态发生,本发明均能非常快的检测出来并显示在数码管上。It has been verified that if any fault state in Table 1 occurs, the present invention can detect it very quickly and display it on the digital tube.

以上显示和描述了发明的基本原理、主要特征和优点。本专利要求保护范围由所附的权利要求书及其等效物界定。The foregoing shows and describes the basic principles, main features and advantages of the invention. The scope of protection required by this patent is defined by the appended claims and their equivalents.

Claims (8)

1.一种带故障诊断功能的七电平逆变器,包括直流电源、H桥主电路、DSP、电压变速器、电阻负载、以及显示装置;直流电源由三个24v直流电源组成,DSP产生SPWM驱动H桥主电路将来自直流电源的直流电转换成交流电,该交流电其电压加载到20欧姆的电阻负载两端,并且被电压变送器检测;电压变送器将检测到的电压信号成比例降低到0~3v的范围之内送给DSP;H桥主电路由三个H桥组成,将第一个H桥的四个开关管分别标记为H1S1、H1S2、H1S3和H1S4,第二个H桥的四个开关管分别标记为H2S1、H2S2、H2S3和H2S4,第三个H桥的四个开关管分别标记为H3S1、H3S2、H3S3和H3S4;Vo1、Vo2和Vo3分别表示三个H桥的输出电压,Vo是该电路最终的输出电压,将三个H桥的输出端级联后,使得Vo=Vo1+Vo2+Vo3;三个直流电源的电压为V1、V2和V3,并且V1=V2=V3=E,Vo1、Vo2、Vo3=0V或±E,在任意时刻,Vo等于±3E、±2E、±E或0V,即逆变器输出七种不同的电平;H桥主电路的电路状态和七电平逆变器的故障类型对应如下:H1S1开路-故障1,H1S2开路-故障2,H1S3开路-故障3,H1S4开路-故障4,H2S1开路-故障5,H2S1开路-故障6,H2S3开路-故障7,H2S4开路-故障8,H3S1或者H3S4开路-故障9,H3S2或者H3S3开路-故障10,正常工作-故障0;其特征在于:DSP中嵌入基于神经网络的故障诊断方法,DSP自动采集数据,进行故障诊断。1. A seven-level inverter with fault diagnosis function, including DC power supply, H-bridge main circuit, DSP, voltage transmission, resistance load, and display device; the DC power supply is composed of three 24v DC power supplies, and the DSP generates SPWM The main circuit of the driving H-bridge converts the DC power from the DC power supply into AC power, and the voltage of the AC power is loaded on both ends of the 20-ohm resistive load, and is detected by the voltage transmitter; the voltage transmitter reduces the detected voltage signal proportionally The main circuit of the H bridge is composed of three H bridges, and the four switches of the first H bridge are respectively marked as H1S1, H1S2, H1S3 and H1S4, and the second H bridge The four switches of the first H-bridge are marked as H2S1, H2S2, H2S3 and H2S4 respectively, and the four switches of the third H-bridge are respectively marked as H3S1, H3S2, H3S3 and H3S4; Vo1, Vo2 and Vo3 represent the outputs of the three H-bridges respectively Voltage, Vo is the final output voltage of the circuit. After cascading the output terminals of the three H bridges, Vo=Vo1+Vo2+Vo3; the voltages of the three DC power supplies are V1, V2 and V3, and V1=V2= V3=E, Vo1, Vo2, Vo3=0V or ±E, at any time, Vo is equal to ±3E, ±2E, ±E or 0V, that is, the inverter outputs seven different levels; the circuit of the H-bridge main circuit The state and the fault type of the seven-level inverter correspond as follows: H1S1 open circuit - fault 1, H1S2 open circuit - fault 2, H1S3 open circuit - fault 3, H1S4 open circuit - fault 4, H2S1 open circuit - fault 5, H2S1 open circuit - fault 6, H2S3 open circuit-fault 7, H2S4 open circuit-fault 8, H3S1 or H3S4 open circuit-fault 9, H3S2 or H3S3 open circuit-fault 10, normal operation-fault 0; it is characterized in that: the fault diagnosis method based on neural network is embedded in DSP, DSP Automatic data collection for fault diagnosis. 2.如权利要求1所述的带故障诊断功能的七电平逆变器,其特征在于,还包括数码管,DSP通过数码管实时显示逆变器的状态。2. The seven-level inverter with fault diagnosis function as claimed in claim 1, further comprising a digital tube, and the DSP displays the state of the inverter in real time through the digital tube. 3.如权利要求1所述的带故障诊断功能的七电平逆变器,其特征在于,H桥的开关管为IGBT。3. The seven-level inverter with fault diagnosis function as claimed in claim 1, wherein the switch tube of the H bridge is an IGBT. 4.如权利要求1-3任一权利要求所述的带故障诊断功能的七电平逆变器,其特征在于,DSP包括数据预处理和神经网络训练模块、基于神经网络的故障诊断模块、以及数据存储模块。4. The seven-level inverter with a fault diagnosis function as claimed in any one of claims 1-3, wherein the DSP includes a data preprocessing and neural network training module, a neural network-based fault diagnosis module, and a data storage module. 5.如权利要求4所述的带故障诊断功能的七电平逆变器,其特征在于,数据预处理和神经网络训练模块的数据预处理步骤和神经网络训练步骤如下:5. the seven-level inverter with fault diagnosis function as claimed in claim 4, is characterized in that, the data preprocessing step and the neural network training step of data preprocessing and neural network training module are as follows: 步骤1采集故障样本数据:Step 1 collect fault sample data: 首先采集逆变器故障时的输出电压作为故障样本数据,采集的方法为在逆变器的输出电压一个周期内等间隔地采集512个时刻的离散电压值,每次采集的电压用序列表示,序列中的每个值等于对应时刻的电压值;First, the output voltage when the inverter fails is collected as the fault sample data. The collection method is to collect discrete voltage values at 512 moments at equal intervals within one cycle of the output voltage of the inverter. The voltage collected each time uses a sequence Indicates that each value in the sequence is equal to the voltage value at the corresponding moment; 根据H桥主电路的电路状态和七电平逆变器的故障类型的对应关系:H1S1开路-故障1,H1S2开路-故障2,H1S3开路-故障3,H1S4开路-故障4,H2S1开路-故障5,H2S1开路-故障6,H2S3开路-故障7,H2S4开路-故障8,H3S1或者H3S4开路-故障9,H3S2或者H3S3开路-故障10,正常工作-故障0,人为设置开路故障,采集逆变器在十种故障情况下输出的电压波形,以及正常工作情况下的电压波形;采集每种电压波形各100组;According to the corresponding relationship between the circuit state of the H bridge main circuit and the fault type of the seven-level inverter: H1S1 open circuit-fault 1, H1S2 open circuit-fault 2, H1S3 open circuit-fault 3, H1S4 open circuit-fault 4, H2S1 open circuit-fault 4 5. H2S1 open circuit - fault 6, H2S3 open circuit - fault 7, H2S4 open circuit - fault 8, H3S1 or H3S4 open circuit - fault 9, H3S2 or H3S3 open circuit - fault 10, normal operation - fault 0, artificially set open circuit fault, collect inverter The voltage waveform output by the device under ten kinds of fault conditions, and the voltage waveform under normal working conditions; collect 100 groups of each voltage waveform; 步骤2FFT变换:Step 2FFT transformation: 将序列进行FFT变换,FFT变换公式: F k = G k + W b k H k , F k + b / 2 = G k - W b k H k , 这里will sequence Carry out FFT transformation, FFT transformation formula: f k = G k + W b k h k , f k + b / 2 = G k - W b k h k , here Wb=e-j2π/b,k=0,1,...,b/2-1;W b =e -j2π/b , k=0,1,...,b/2-1; GG kk == ΣΣ nno == 00 bb 22 -- 11 xx nno 22 WW bb // 22 nno kk ;; Hh kk == ΣΣ nno == 00 bb 22 -- 11 xx 22 nno ++ 11 WW bb // 22 nno kk .. 经过FFT变换后得到了一个个数为512的虚数序列取该序列的前10个数据并且将该序列的数据进行取模,将取模后的序列作为样本数据进行下一步的计算;After FFT transformation, an imaginary number sequence with a number of 512 is obtained Get the first 10 data of the sequence And the data of the sequence is moduloed, and the sequence after the modulus is As the sample data for the next calculation; 步骤3PCA降维:Step 3PCA dimensionality reduction: 经过上述的FFT变换及截取后,原电压信号的特征数据由512个变为了10个,接下来进行PCA降维;具体方法如下:After the above-mentioned FFT transformation and interception, the characteristic data of the original voltage signal changed from 512 to 10, and then PCA dimensionality reduction was performed; the specific method is as follows: 首先采集所有种类的故障样本数据:First collect all kinds of failure sample data: Xx 1111 ×× 1010 == {{ || Ff 11 kk || }} 00 99 {{ || Ff 22 kk || }} 00 99 .. .. .. {{ || Ff 1111 kk || }} 00 99 ,, 接着求协方差矩阵RX的特征值λ与特征值向量P:Then find the eigenvalue λ and eigenvalue vector P of the covariance matrix R X : 协方差矩阵:RX=E{[X-E(X)][X-E(X)]T};Covariance matrix: R X = E{[XE(X)][XE(X)] T }; 通过求解|λI-RX|=0和|λiI-RX|pi=0,i=1,2,…,b求得λ和P,其中,λi为RX的第i个特征值,并且满足λ1≥λ2≥…≥λb,pi是相应于特征值λi的特征向量,P=[p1,p2,…,pb]T,这里b的值为11;选取P的前3列,得到P1=[p1,p2,p3],P1为10×3的矩阵;以上工作只需要离线做一次,然后保留P1;Obtain λ and P by solving |λI-R X |=0 and |λ i IR X |p i =0,i=1,2,...,b, where λ i is the ith eigenvalue of R X , and satisfy λ 1 ≥λ 2 ≥…≥λ b , p i is the eigenvector corresponding to the eigenvalue λ i , P=[p 1 ,p 2 ,…,p b ] T , where the value of b is 11; Select the first 3 columns of P to get P1=[p 1 ,p 2 ,p 3 ], P1 is a 10×3 matrix; the above work only needs to be done once offline, and then keep P1; 最后计算出BP神经网络的输入序列xin是个数为4的数据序列,第一个数据是原信号的基波的相位,后三个是PCA降维后的数据序列;Finally, the input sequence of the BP neural network is calculated x in is a data sequence with a number of 4, the first data is the phase of the fundamental wave of the original signal, and the last three are the data sequences after PCA dimensionality reduction; 步骤4构建并训练BP神经网络Step 4 Build and train the BP neural network BP神经网络为三层神经网络,由于原始信号经过FFT变换以及PCA降维后得到了个数为4的特征数据xin,则输入层神经元个数定为4个,由于总共有11种故障类型,则输出层神经元个数为11,隐层神经元个数根据经验选取为15;The BP neural network is a three-layer neural network. Since the original signal has undergone FFT transformation and PCA dimensionality reduction, the number of characteristic data x in is 4, so the number of neurons in the input layer is set to 4. Since there are 11 types of faults in total type, the number of neurons in the output layer is 11, and the number of neurons in the hidden layer is selected as 15 based on experience; 设输入层的神经元为隐层的神经元为输出层的神经元为激活函数为Sigmoid函数,设的系数矩阵为xw4×15的系数矩阵为xw15×11,则输入输出关系为:Let the neurons of the input layer be The neurons in the hidden layer are The neurons in the output layer are The activation function is the Sigmoid function, set and The coefficient matrix of is xw 4×15 , and The coefficient matrix of is xw 15×11 , then the input-output relationship is: y k = Σ i = 0 14 1 1 + e - w i × wy i k , k = 1 , 2 , ... , 10 (式2-1) the y k = Σ i = 0 14 1 1 + e - w i × wy i k , k = 1 , 2 , ... , 10 (Formula 2-1) w k = Σ i = 0 3 1 1 + e - x i n i × xw i k , k = 1 , 2 , ... , 14 (式2-2) w k = Σ i = 0 3 1 1 + e - x i no i × w i k , k = 1 , 2 , ... , 14 (Formula 2-2) 构建好BP神经网络之后,对原始的网络进行训练;After building the BP neural network, train the original network; 首先将步骤1中采集好的11种故障信号(含正常信号),经过FFT和PCA后得到训练样本:First, the 11 kinds of fault signals (including normal signals) collected in step 1 are obtained through FFT and PCA to obtain training samples: Xx __ SS aa mm pp ll ee == {{ xx ii nno 11 kk }} 00 33 {{ xx ii nno 22 kk }} 00 33 .. .. .. {{ xx ii nno 1010 kk }} 00 33 ,, 由于步骤1中每种故障各采集了100组信号,所以此时可以得到100个X_Sample,将每个X_Sample的理论输出均设置为:Since 100 sets of signals were collected for each fault in step 1, 100 X_Samples can be obtained at this time, and the theoretical output of each X_Sample is set as: YY == 11 00 00 00 00 00 00 00 00 00 00 00 11 00 00 00 00 00 00 00 00 00 00 00 11 00 00 00 00 00 00 00 00 .. .. .. 00 00 00 00 00 00 00 00 00 00 11 ,, 采用动量梯度下降算法训练BP网络,训练误差阈值设为0.0001,学习率α=0.5,训练后得到两个系数矩阵xw_end∈R4×15和xw_end∈R15×11,这两个矩阵包含了训练好的神经网路所有信息,神经网络只需要离线训练一次,得到这两个矩阵后便不再需要训练。The momentum gradient descent algorithm is used to train the BP network, the training error threshold is set to 0.0001, and the learning rate α=0.5. After training, two coefficient matrices xw_end∈R 4×15 and xw_end∈R 15×11 are obtained. These two matrices contain the training With all the information of a good neural network, the neural network only needs to be trained offline once, and no training is required after obtaining these two matrices. 6.如权利要求5所述的带故障诊断功能的七电平逆变器,其特征在于,数据存储模块包括数组xw[4][15]和wy[15][11],分别储存步骤4中的xw_end∈R4×15和wy_end∈R15×11,也包括数组ad_value[512],存储DSP采集的电压值;基于神经网络的故障诊断模块的基于神经网络的故障诊断方法依如下步骤对七电平逆变器进行诊断:6. The seven-level inverter with fault diagnosis function as claimed in claim 5, wherein the data storage module includes arrays xw[4][15] and wy[15][11], which are stored in step 4 respectively xw_end∈R 4×15 and wy_end∈R 15×11 in it also include the array ad_value[512], which stores the voltage value collected by DSP; the neural network-based fault diagnosis method of the neural network-based fault diagnosis module follows the steps below Diagnostics for seven-level inverters: ad_value[512]数组存储满之后,触发一次故障诊断,根据步骤2和步骤3中的内容,将采集好的512个数据ad_value[512]进行预处理,得到预处理之后的四个数据接着将该数据和步骤4中的结果xw[4][15]和wy[15][11]带入公式公式(2-1)和式(2-2)进行神经网络诊断,得到神经网络输出序列yk,该序列由11个数据组成,包含诊断结果;DSP使用冒泡排序法找到yk中的最大值的下标k,k的值表示的故障种类:H1S1开路-故障1,H1S2开路-故障2,H1S3开路-故障3,H1S4开路-故障4,H2S1开路-故障5,H2S1开路-故障6,H2S3开路-故障7,H2S4开路-故障8,H3S1或者H3S4开路-故障9,H3S2或者H3S3开路-故障10,正常工作-故障0;DSP将该值实时显示在数码管上;然后,清空数组ad_value[512],重新开始采集逆变器的输出电压值,进行新一轮的故障诊断。After the ad_value[512] array is full, a fault diagnosis is triggered. According to the content in step 2 and step 3, the collected 512 data ad_value[512] are preprocessed to obtain four preprocessed data Then bring this data and the results xw[4][15] and wy[15][11] in step 4 into formula (2-1) and formula (2-2) for neural network diagnosis, and obtain the neural network output Sequence y k , which consists of 11 data, including diagnosis results; DSP uses bubble sorting method to find the subscript k of the maximum value in y k , and the value of k indicates the type of fault: H1S1 open circuit - fault 1, H1S2 open circuit - Fault 2, H1S3 Open - Fault 3, H1S4 Open - Fault 4, H2S1 Open - Fault 5, H2S1 Open - Fault 6, H2S3 Open - Fault 7, H2S4 Open - Fault 8, H3S1 or H3S4 Open - Fault 9, H3S2 or H3S3 open circuit - fault 10, normal operation - fault 0; DSP displays the value on the digital tube in real time; then, clear the array ad_value[512], start collecting the output voltage value of the inverter again, and carry out a new round of fault diagnosis . 7.如权利要求6所述的带故障诊断功能的七电平逆变器,其特征在于,基于神经网络的故障诊断模块依如下步骤嵌入DSP中:7. The seven-level inverter with fault diagnosis function as claimed in claim 6, is characterized in that, the fault diagnosis module based on neural network is embedded in the DSP according to the following steps: 步骤5将算法嵌入DSP中Step 5 Embed the algorithm in DSP 首先初始化DSP;初始化DSP的时钟、锁相环、中断向量表,定义DSP的A0口为AD采集口采集电压,定义DSP的GPIO16、GPIO17、GPIO18、GPIO19为数码管通讯口,用来控制数码管显示的数字;配置DSP的Timer0模块,使DSP产生周期中断,中断的频率为25.6KHz;First initialize the DSP; initialize the clock, phase-locked loop, and interrupt vector table of the DSP, define the A0 port of the DSP as the AD acquisition port to collect voltage, and define the GPIO16, GPIO17, GPIO18, and GPIO19 of the DSP as the digital tube communication ports to control the digital tube The displayed number; configure the Timer0 module of the DSP to make the DSP generate a periodic interrupt, and the interrupt frequency is 25.6KHz; 然后编写故障诊断子函数程序,命名为“diagnosis()”;所述故障诊断子函数的输入是512个电压值序列ad_value[512];所述故障诊断子函数的输出是一个数字量k,k的值是故障的类型;所述故障诊断子函数程序的内容为所述基于神经网络的故障诊断方法;Then write the fault diagnosis subfunction program, named as "diagnosis ()"; the input of the fault diagnosis subfunction is 512 voltage value sequences ad_value[512]; the output of the fault diagnosis subfunction is a digital quantity k, k The value of is the type of fault; the content of the fault diagnosis sub-function program is the fault diagnosis method based on the neural network; 最后,编写主函数程序“main()”,在主函数中,程序设置为无限循环模式,每当DSP进入中断,则触发一次AD采样,并存储在ad_value[512]数组中,当采集512次时,在main()函数中调用一次diagnosis()函数,进行故障诊断,诊断结束后,将诊断的结果数据显示在数码管上。Finally, write the main function program "main()". In the main function, the program is set to an infinite loop mode. Whenever the DSP enters an interrupt, an AD sampling is triggered and stored in the ad_value[512] array. When the acquisition is 512 times , call the diagnosis() function once in the main() function to perform fault diagnosis. After the diagnosis is completed, the diagnosis result data will be displayed on the digital tube. 8.一种基于神经网络的故障诊断方法,用于如权利要求1-3任一权利要求所述的带故障诊断功能的七电平逆变器,其特征在于,所述基于神经网络的故障诊断方法经过数据预处理步骤和神经网络训练步骤,所述基于神经网络的故障诊断方法由DSP自动采集数据,进行故障诊断,并通过数码管实时显示逆变器的状态;8. A fault diagnosis method based on a neural network, used for the seven-level inverter with a fault diagnosis function according to any one of claims 1-3, characterized in that, the fault diagnosis based on the neural network The diagnosis method is through the data preprocessing step and the neural network training step, and the fault diagnosis method based on the neural network automatically collects data by DSP, performs fault diagnosis, and displays the status of the inverter in real time through the digital tube; 所述数据预处理步骤和神经网络训练步骤如下:Described data preprocessing step and neural network training step are as follows: 步骤1采集故障样本数据:Step 1 collect fault sample data: 首先采集逆变器故障时的输出电压作为故障样本数据,采集的方法为在逆变器的输出电压一个周期内等间隔地采集512个时刻的离散电压值,每次采集的电压用序列 { x n } 0 511 = { x 0 , x 2 , ... , x 511 } 表示,序列中的每个值等于对应时刻的电压值;First, the output voltage when the inverter fails is collected as the fault sample data. The collection method is to collect discrete voltage values at 512 moments at equal intervals within one cycle of the output voltage of the inverter. The voltage collected each time uses a sequence { x no } 0 511 = { x 0 , x 2 , ... , x 511 } Indicates that each value in the sequence is equal to the voltage value at the corresponding moment; 根据H桥主电路的电路状态和七电平逆变器的故障类型的对应关系:H1S1开路-故障1,H1S2开路-故障2,H1S3开路-故障3,H1S4开路-故障4,H2S1开路-故障5,H2S1开路-故障6,H2S3开路-故障7,H2S4开路-故障8,H3S1或者H3S4开路-故障9,H3S2或者H3S3开路-故障10,正常工作-故障0;人为设置开路故障,采集逆变器在十种故障情况下输出的电压波形,以及正常工作情况下的电压波形;采集每种电压波形各100组;According to the corresponding relationship between the circuit state of the H-bridge main circuit and the fault type of the seven-level inverter: H1S1 open circuit-fault 1, H1S2 open circuit-fault 2, H1S3 open circuit-fault 3, H1S4 open circuit-fault 4, H2S1 open circuit-fault 4 5. H2S1 open circuit - fault 6, H2S3 open circuit - fault 7, H2S4 open circuit - fault 8, H3S1 or H3S4 open circuit - fault 9, H3S2 or H3S3 open circuit - fault 10, normal operation - fault 0; artificially set open circuit fault, collect inverter The voltage waveform output by the device under ten kinds of fault conditions, and the voltage waveform under normal working conditions; collect 100 groups of each voltage waveform; 步骤2FFT变换:Step 2FFT transformation: 将序列进行FFT变换,FFT变换公式: F k = G k + W b k H k , F k + b / 2 = G k - W b k H k , 这里Wb=e-j2π/b,k=0,1,...,b/2-1;will sequence Carry out FFT transformation, FFT transformation formula: f k = G k + W b k h k , f k + b / 2 = G k - W b k h k , Here W b =e -j2π/b , k=0,1,...,b/2-1; GG kk == ΣΣ nno == 00 bb 22 -- 11 xx 22 nno WW bb // 22 nno kk ;; Hh kk == ΣΣ nno == 00 bb 22 -- 11 xx 22 nno ++ 11 WW bb // 22 nno kk ;; 经过FFT变换后得到了一个个数为512的虚数序列取该序列的前10个数据并且将该序列的数据进行取模,将取模后的序列作为样本数据进行下一步的计算;After FFT transformation, an imaginary number sequence with a number of 512 is obtained Get the first 10 data of the sequence And the data of the sequence is moduloed, and the sequence after the modulus is As the sample data for the next calculation; 步骤3PCA降维:Step 3PCA dimensionality reduction: 经过上述的FFT变换及截取后,原电压信号的特征数据由512个变为了10个,接下来进行PCA降维;具体方法如下:After the above-mentioned FFT transformation and interception, the characteristic data of the original voltage signal changed from 512 to 10, and then PCA dimensionality reduction was performed; the specific method is as follows: 首先采集所有种类的故障样本数据:First collect all kinds of failure sample data: Xx 1111 ×× 1010 == {{ || Ff 11 kk || }} 00 99 {{ || Ff 22 kk || }} 00 99 .. .. .. {{ || Ff 1111 kk || }} 00 99 ,, 接着求协方差矩阵RX的特征值λ与特征值向量P:Then find the eigenvalue λ and eigenvalue vector P of the covariance matrix R X : 协方差矩阵:RX=E{[X-E(X)][X-E(X)]T};Covariance matrix: R X = E{[XE(X)][XE(X)] T }; 通过求解|λI-RX|=0和|λiI-RX|pi=0,i=1,2,…,b求得λ和P,其中,λi为RX的第i个特征值,并且满足λ1≥λ2≥…≥λb,pi是相应于特征值λi的特征向量,P=[p1,p2,…,pb]T,这里b的值为11;选取P的前3列,得到P1=[p1,p2,p3],P1为10×3的矩阵;以上工作只需要离线做一次,然后保留P1;Obtain λ and P by solving |λI-R X |=0 and |λ i IR X |p i =0,i=1,2,...,b, where λ i is the ith eigenvalue of R X , and satisfy λ 1 ≥λ 2 ≥…≥λ b , p i is the eigenvector corresponding to the eigenvalue λ i , P=[p 1 ,p 2 ,…,p b ] T , where the value of b is 11; Select the first 3 columns of P to get P1=[p 1 ,p 2 ,p 3 ], P1 is a 10×3 matrix; the above work only needs to be done once offline, and then keep P1; 最后计算出BP神经网络的输入序列xin是个数为4的数据序列,第一个数据是原信号的基波的相位,后三个是PCA降维后的数据序列;Finally, the input sequence of the BP neural network is calculated x in is a data sequence with a number of 4, the first data is the phase of the fundamental wave of the original signal, and the last three are the data sequences after PCA dimensionality reduction; 步骤4构建并训练BP神经网络Step 4 Build and train the BP neural network BP神经网络为三层神经网络,由于原始信号经过FFT变换以及PCA降维后得到了个数为4的特征数据xin,则输入层神经元个数定为4个,由于总共有11种故障类型,则输出层神经元个数为11,隐层神经元个数根据经验选取为15;The BP neural network is a three-layer neural network. Since the original signal has undergone FFT transformation and PCA dimensionality reduction, the number of characteristic data x in is 4, so the number of neurons in the input layer is set to 4. Since there are 11 types of faults in total type, the number of neurons in the output layer is 11, and the number of neurons in the hidden layer is selected as 15 based on experience; 设输入层的神经元为隐层的神经元为输出层的神经元为激活函数为Sigmoid函数,设的系数矩阵为xw4×15的系数矩阵为xw15×11,则输入输出关系为:Let the neurons of the input layer be The neurons in the hidden layer are The neurons in the output layer are The activation function is the Sigmoid function, set and The coefficient matrix of is xw 4×15 , and The coefficient matrix of is xw 15×11 , then the input-output relationship is: y k = Σ i = 0 14 1 1 + e - w i × wy i k , k = 1 , 2 , ... , 10 (式2-1) the y k = Σ i = 0 14 1 1 + e - w i × wy i k , k = 1 , 2 , ... , 10 (Formula 2-1) w k = Σ i = 0 3 1 1 + e - x i n i × xw i k , k = 1 , 2 , ... , 14 (式2-2) w k = Σ i = 0 3 1 1 + e - x i no i × w i k , k = 1 , 2 , ... , 14 (Formula 2-2) 构建好BP神经网络之后,对原始的网络进行训练;After building the BP neural network, train the original network; 首先将步骤1中采集好的11种故障信号(含正常信号),经过FFT和PCA后得到训练样本:First, the 11 kinds of fault signals (including normal signals) collected in step 1 are obtained through FFT and PCA to obtain training samples: Xx __ SS aa mm pp ll ee == {{ xx ii nno 11 kk }} 00 33 {{ xx ii nno 22 kk }} 00 33 .. .. .. {{ xx ii nno 1010 kk }} 00 33 ,, 由于步骤1中每种故障各采集了100组信号,所以此时可以得到100个X_Sample,将每个X_Sample的理论输出均设置为:Since 100 sets of signals were collected for each fault in step 1, 100 X_Samples can be obtained at this time, and the theoretical output of each X_Sample is set as: YY == 11 00 00 00 00 00 00 00 00 00 00 00 11 00 00 00 00 00 00 00 00 00 00 00 11 00 00 00 00 00 00 00 00 .. .. .. 00 00 00 00 00 00 00 00 00 00 11 ,, 采用动量梯度下降算法训练BP网络,训练误差阈值设为0.0001,学习率α=0.5,训练后得到两个系数矩阵xw_end∈R4×15和xw_end∈R15×11,这两个矩阵包含了训练好的神经网路所有信息,因此,神经网络只需要离线训练一次,得到这两个矩阵后便不再需要训练;The momentum gradient descent algorithm is used to train the BP network, the training error threshold is set to 0.0001, and the learning rate α=0.5. After training, two coefficient matrices xw_end∈R 4×15 and xw_end∈R 15×11 are obtained. These two matrices contain the training All the information of a good neural network, therefore, the neural network only needs to be trained offline once, and no training is required after obtaining these two matrices; 基于神经网络的故障诊断方法依如下步骤嵌入DSP中:The fault diagnosis method based on neural network is embedded in DSP according to the following steps: 步骤5将算法嵌入DSP中Step 5 Embed the algorithm in DSP 首先初始化DSP;初始化DSP的时钟、锁相环、中断向量表,定义DSP的A0口为AD采集口采集电压,定义DSP的GPIO16、GPIO17、GPIO18、GPIO19为数码管通讯口,用来控制数码管显示的数字;配置DSP的Timer0模块,使DSP产生周期中断,中断的频率为25.6KHz;同时建立数组xw[4][15]和wy[15][11]分别储存步骤4中的xw_end∈R4×15和wy_end∈R15×11,建立数组ad_value[512]存储DSP采集的电压值;First initialize the DSP; initialize the clock, phase-locked loop, and interrupt vector table of the DSP, define the A0 port of the DSP as the AD acquisition port to collect voltage, and define the GPIO16, GPIO17, GPIO18, and GPIO19 of the DSP as the digital tube communication ports to control the digital tube Displayed numbers; configure the Timer0 module of the DSP to make the DSP generate periodic interrupts, and the interrupt frequency is 25.6KHz; at the same time, create arrays xw[4][15] and wy[15][11] to store xw_end∈R in step 4 respectively 4×15 and wy_end∈R 15×11 , set up an array ad_value[512] to store the voltage value collected by DSP; 然后编写故障诊断子函数程序,命名为“diagnosis()”;所述故障诊断子函数的输入是512个电压值序列ad_value[512];所述故障诊断子函数的输出是一个数字量k,k的值是故障的类型;所述故障诊断子函数程序的内容如下:Then write the fault diagnosis subfunction program, named as "diagnosis ()"; the input of the fault diagnosis subfunction is 512 voltage value sequences ad_value[512]; the output of the fault diagnosis subfunction is a digital quantity k, k The value of is the type of fault; the content of the fault diagnosis sub-function program is as follows: ad_value[512]数组存储满之后,触发一次故障诊断,根据步骤2和步骤3中的内容,将采集好的512个数据ad_value[512]进行预处理,得到预处理之后的四个数据接着将该数据和步骤4中的结果xw[4][15]和wy[15][11]带入公式公式(2-1)和式(2-2)进行神经网络诊断,得到神经网络输出序列yk,该序列由11个数据组成,包含诊断结果;DSP使用冒泡排序法找到yk中的最大值的下标k,k的值表示的故障种类如下:H1S1开路-故障1,H1S2开路-故障2,H1S3开路-故障3,H1S4开路-故障4,H2S1开路-故障5,H2S1开路-故障6,H2S3开路-故障7,H2S4开路-故障8,H3S1或者H3S4开路-故障9,H3S2或者H3S3开路-故障10,正常工作-故障0;DSP将该值实时显示在数码管上;然后,清空数组ad_value[512],重新开始采集逆变器的输出电压值,进行新一轮的故障诊断;After the ad_value[512] array is full, a fault diagnosis is triggered. According to the content in step 2 and step 3, the collected 512 data ad_value[512] are preprocessed to obtain four preprocessed data Then bring this data and the results xw[4][15] and wy[15][11] in step 4 into formula (2-1) and formula (2-2) for neural network diagnosis, and obtain the neural network output Sequence y k , the sequence is composed of 11 data, including diagnosis results; DSP uses bubble sorting method to find the subscript k of the maximum value in y k , and the fault type represented by the value of k is as follows: H1S1 open circuit-fault 1, H1S2 Open - fault 2, H1S3 open - fault 3, H1S4 open - fault 4, H2S1 open - fault 5, H2S1 open - fault 6, H2S3 open - fault 7, H2S4 open - fault 8, H3S1 or H3S4 open - fault 9, H3S2 Or H3S3 open circuit - fault 10, normal operation - fault 0; DSP displays the value on the digital tube in real time; then, clear the array ad_value[512], start collecting the output voltage value of the inverter again, and perform a new round of faults diagnosis; 最后,编写主函数程序“main()”,在主函数中,程序设置为无限循环模式,每当DSP进入中断,则触发一次AD采样,并存储在ad_value[512]数组中,当采集512次时,在main()函数中调用一次diagnosis()函数,进行故障诊断,诊断结束后,将诊断的结果数据显示在数码管上;Finally, write the main function program "main()". In the main function, the program is set to an infinite loop mode. Whenever the DSP enters an interrupt, an AD sampling is triggered and stored in the ad_value[512] array. When the acquisition is 512 times , call the diagnosis() function once in the main() function to perform fault diagnosis, and display the diagnosis result data on the digital tube after the diagnosis is completed; 所述基于神经网络的故障诊断方法如下:The fault diagnosis method based on neural network is as follows: ad_value[512]数组存储满之后,触发一次故障诊断,根据步骤2和步骤3中的内容,将采集好的512个数据ad_value[512]进行预处理,得到预处理之后的四个数据接着将该数据和步骤4中的结果xw[4][15]和wy[15][11]带入公式公式(2-1)和式(2-2)进行神经网络诊断,得到神经网络输出序列yk,该序列由11个数据组成,包含诊断结果;DSP使用冒泡排序法找到yk中的最大值的下标k,k的值表示的故障种类如下:H1S1开路-故障1,H1S2开路-故障2,H1S3开路-故障3,H1S4开路-故障4,H2S1开路-故障5,H2S1开路-故障6,H2S3开路-故障7,H2S4开路-故障8,H3S1或者H3S4开路-故障9,H3S2或者H3S3开路-故障10,正常工作-故障0;DSP将该值实时显示在数码管上;然后,清空数组ad_value[512],重新开始采集逆变器的输出电压值,进行新一轮的故障诊断。After the ad_value[512] array is full, a fault diagnosis is triggered. According to the content in step 2 and step 3, the collected 512 data ad_value[512] are preprocessed to obtain four preprocessed data Then bring this data and the results xw[4][15] and wy[15][11] in step 4 into formula (2-1) and formula (2-2) for neural network diagnosis, and obtain the neural network output Sequence y k , the sequence is composed of 11 data, including diagnosis results; DSP uses bubble sorting method to find the subscript k of the maximum value in y k , and the fault type represented by the value of k is as follows: H1S1 open circuit-fault 1, H1S2 Open - fault 2, H1S3 open - fault 3, H1S4 open - fault 4, H2S1 open - fault 5, H2S1 open - fault 6, H2S3 open - fault 7, H2S4 open - fault 8, H3S1 or H3S4 open - fault 9, H3S2 Or H3S3 open circuit - fault 10, normal operation - fault 0; DSP displays the value on the digital tube in real time; then, clear the array ad_value[512], start collecting the output voltage value of the inverter again, and perform a new round of faults diagnosis.
CN201510489538.8A 2015-08-11 2015-08-11 Seven electrical level inverters and method for diagnosing faults of tape jam diagnostic function Active CN105044624B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510489538.8A CN105044624B (en) 2015-08-11 2015-08-11 Seven electrical level inverters and method for diagnosing faults of tape jam diagnostic function

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510489538.8A CN105044624B (en) 2015-08-11 2015-08-11 Seven electrical level inverters and method for diagnosing faults of tape jam diagnostic function

Publications (2)

Publication Number Publication Date
CN105044624A true CN105044624A (en) 2015-11-11
CN105044624B CN105044624B (en) 2018-02-23

Family

ID=54451306

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510489538.8A Active CN105044624B (en) 2015-08-11 2015-08-11 Seven electrical level inverters and method for diagnosing faults of tape jam diagnostic function

Country Status (1)

Country Link
CN (1) CN105044624B (en)

Cited By (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105589037A (en) * 2016-03-16 2016-05-18 合肥工业大学 Ensemble learning-based electric power electronic switch device network fault diagnosis method
CN106053988A (en) * 2016-06-18 2016-10-26 安徽工程大学 Inverter fault diagnosis system and method based on intelligent analysis
CN107271925A (en) * 2017-06-26 2017-10-20 湘潭大学 The level converter Fault Locating Method of modularization five based on depth convolutional network
CN108649825A (en) * 2018-04-25 2018-10-12 上海海事大学 A kind of multiple faults partition method of cascade multilevel inverter
CN109116150A (en) * 2018-08-03 2019-01-01 福州大学 A kind of converters method for diagnosing faults based on Cerebellar Model Articulation Controller
CN109884449A (en) * 2019-02-26 2019-06-14 广东省智能机器人研究院 Real-time detection method for open-circuit fault of three-phase inverter bridge arm of motor driving system
CN110308341A (en) * 2019-05-09 2019-10-08 阳光电源股份有限公司 Inverter module detection method in energy conversion system, apparatus and system
CN110361625A (en) * 2019-07-23 2019-10-22 中南大学 A kind of method and electronic equipment for the diagnosis of inverter open-circuit fault
CN111678679A (en) * 2020-05-06 2020-09-18 内蒙古电力(集团)有限责任公司电力调度控制分公司 Circuit breaker fault diagnosis method based on PCA-BPNN
CN111948573A (en) * 2020-07-13 2020-11-17 华中科技大学 A method and system for identifying and locating open-circuit faults of cascaded multilevel inverters
WO2021097642A1 (en) * 2019-11-19 2021-05-27 深圳市大疆创新科技有限公司 Steering gear self-inspection method, steering gear self-inspection apparatus, controller, steering gear, movable platform and computer-readable storage medium
WO2022022659A1 (en) * 2020-07-31 2022-02-03 科华数据股份有限公司 Photovoltaic module diagnosis method, apparatus, and device, and readable storage medium
CN115085571A (en) * 2022-08-18 2022-09-20 深圳戴普森新能源技术有限公司 Inverter system control method and protection circuit
CN116995889A (en) * 2023-06-20 2023-11-03 三峡科技有限责任公司 Frequency converter data transmission method and device based on neural network
CN117572137A (en) * 2024-01-17 2024-02-20 山东海纳智能装备科技股份有限公司 Seven-level ANPC high-voltage frequency converter remote monitoring system

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN201937492U (en) * 2011-01-14 2011-08-17 南京师范大学 Low-voltage seven-level inverter
US20120242365A1 (en) * 2011-03-21 2012-09-27 Singh Brij N System for detecting a failure associated with an inverter or associated machine
CN103761372A (en) * 2014-01-06 2014-04-30 上海海事大学 Multilevel inverter fault diagnosis strategy based on principal component analysis and multi-classification related vector machine(PCA-mRVM)

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN201937492U (en) * 2011-01-14 2011-08-17 南京师范大学 Low-voltage seven-level inverter
US20120242365A1 (en) * 2011-03-21 2012-09-27 Singh Brij N System for detecting a failure associated with an inverter or associated machine
CN103761372A (en) * 2014-01-06 2014-04-30 上海海事大学 Multilevel inverter fault diagnosis strategy based on principal component analysis and multi-classification related vector machine(PCA-mRVM)

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
卫三民等: "串联H桥多电平变频器单元故障时的控制方法", 《清华大学学报(自然科学版)》 *
姜立昌: "多电平逆变器IGBT故障诊断方法的研究", 《中国优秀硕士学位论文全文数据库(电子期刊)》 *

Cited By (22)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105589037A (en) * 2016-03-16 2016-05-18 合肥工业大学 Ensemble learning-based electric power electronic switch device network fault diagnosis method
CN106053988A (en) * 2016-06-18 2016-10-26 安徽工程大学 Inverter fault diagnosis system and method based on intelligent analysis
CN107271925A (en) * 2017-06-26 2017-10-20 湘潭大学 The level converter Fault Locating Method of modularization five based on depth convolutional network
CN107271925B (en) * 2017-06-26 2019-11-05 湘潭大学 Five level converter Fault Locating Method of modularization based on depth convolutional network
CN108649825A (en) * 2018-04-25 2018-10-12 上海海事大学 A kind of multiple faults partition method of cascade multilevel inverter
CN108649825B (en) * 2018-04-25 2020-03-27 上海海事大学 A Multi-Fault Isolation Method for Cascaded Multilevel Inverters
CN109116150A (en) * 2018-08-03 2019-01-01 福州大学 A kind of converters method for diagnosing faults based on Cerebellar Model Articulation Controller
CN109884449B (en) * 2019-02-26 2021-07-16 广东省智能机器人研究院 Real-time detection method for open-circuit fault of three-phase inverter bridge arm of motor drive system
CN109884449A (en) * 2019-02-26 2019-06-14 广东省智能机器人研究院 Real-time detection method for open-circuit fault of three-phase inverter bridge arm of motor driving system
CN110308341A (en) * 2019-05-09 2019-10-08 阳光电源股份有限公司 Inverter module detection method in energy conversion system, apparatus and system
CN110308341B (en) * 2019-05-09 2021-09-03 阳光电源股份有限公司 Inversion module detection method, device and system in energy conversion system
CN110361625B (en) * 2019-07-23 2022-01-28 中南大学 Method for diagnosing open-circuit fault of inverter and electronic equipment
CN110361625A (en) * 2019-07-23 2019-10-22 中南大学 A kind of method and electronic equipment for the diagnosis of inverter open-circuit fault
WO2021097642A1 (en) * 2019-11-19 2021-05-27 深圳市大疆创新科技有限公司 Steering gear self-inspection method, steering gear self-inspection apparatus, controller, steering gear, movable platform and computer-readable storage medium
CN111678679A (en) * 2020-05-06 2020-09-18 内蒙古电力(集团)有限责任公司电力调度控制分公司 Circuit breaker fault diagnosis method based on PCA-BPNN
CN111948573A (en) * 2020-07-13 2020-11-17 华中科技大学 A method and system for identifying and locating open-circuit faults of cascaded multilevel inverters
WO2022022659A1 (en) * 2020-07-31 2022-02-03 科华数据股份有限公司 Photovoltaic module diagnosis method, apparatus, and device, and readable storage medium
CN115085571A (en) * 2022-08-18 2022-09-20 深圳戴普森新能源技术有限公司 Inverter system control method and protection circuit
CN115085571B (en) * 2022-08-18 2023-02-03 深圳戴普森新能源技术有限公司 Inverter system control method and protection circuit
CN116995889A (en) * 2023-06-20 2023-11-03 三峡科技有限责任公司 Frequency converter data transmission method and device based on neural network
CN117572137A (en) * 2024-01-17 2024-02-20 山东海纳智能装备科技股份有限公司 Seven-level ANPC high-voltage frequency converter remote monitoring system
CN117572137B (en) * 2024-01-17 2024-03-29 山东海纳智能装备科技股份有限公司 Seven-level ANPC high-voltage frequency converter remote monitoring system

Also Published As

Publication number Publication date
CN105044624B (en) 2018-02-23

Similar Documents

Publication Publication Date Title
CN105044624A (en) Seven-electric level inverter with fault diagnosis function and fault diagnosis method
CN110208721B (en) Fault diagnosis method and device for cascaded three-level inverter
CN106443297B (en) The decision tree SVM method for diagnosing faults of photovoltaic diode Clamp three-level inverter
CN112348071B (en) Open-circuit fault diagnosis method for switching tube of submodule of modular multilevel converter
CN104698397B (en) A kind of multi-electrical level inverter method for diagnosing faults
WO2017190480A1 (en) Fault-tolerant control method for reference voltage signal reconstruction of multi-level inverter
CN106019058B (en) A kind of three-phase full-bridge inverter open fault diagnostic method based on phase current analysis
CN109782091B (en) Multilevel inverter fault diagnosis method based on deep wavelet extreme learning machine
CN103837791A (en) Three-level inverter multi-mode fault diagnosis circuit and diagnosis method thereof
CN109375029A (en) A method and system for diagnosing open circuit faults of switching devices in a two-level converter system
CN110133538A (en) A ANPC three-level inverter open-circuit fault diagnosis method and experimental platform
CN110133423A (en) A Fault Diagnosis Method for Switch Tube Open Circuit of Single-phase Cascaded H-bridge Rectifier
CN108872751A (en) A kind of method for diagnosing faults of three level Cascade H-Bridge Inverter neural network based
CN110516742A (en) A method and system for discriminating faults of power distribution terminals based on a combined neural network model
CN109085436A (en) Non-intrusion type three-phase full-bridge inverter combined failure diagnostic method
CN113358993B (en) On-line fault diagnosis method and system for multilevel converter IGBT
CN108872882A (en) A kind of trouble-shooter and its diagnostic method of three level Cascade H-Bridge Inverters
CN113159119A (en) Fault diagnosis method for medium-voltage modular multilevel converter
CN112234576B (en) Fault Diagnosis Method of Modular Multilevel Converter Based on Sliding Window Feature Extraction
CN116702060A (en) A Fault Diagnosis Method for Multilevel Inverter Power Devices
CN115951268A (en) Convolutional neural network converter fault diagnosis method based on Incepton
Bessam et al. A novel method for induction motors stator inter-turn short circuit fault diagnosis based on wavelet energy and neural network
CN113610119B (en) Method for identifying developmental faults in transmission lines based on convolutional neural network
Fang et al. Circulating current-based open-circuit fault diagnosis for parallel inverters
Bhuiyan et al. A reliable open-switch fault diagnosis strategy for grid-tied photovoltaic inverter topology

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
CB03 Change of inventor or designer information

Inventor after: Zhang Zhen

Inventor after: Wang Tianzhen

Inventor after: Han Jingang

Inventor after: Liu Lei

Inventor after: Qiao Daoji

Inventor after: Geng Chao

Inventor after: Dong Jingjing

Inventor after: Duan Xiaopai

Inventor before: Zhang Zhen

Inventor before: Wang Tianzhen

Inventor before: Han Jingang

Inventor before: Zhang Milu

Inventor before: Geng Chao

Inventor before: Dong Jingjing

Inventor before: Liu Yaohui

COR Change of bibliographic data
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant