Summary of the invention:
Method for diagnosing faults based on neural network embeds in DSP by the present invention first, accomplishes real-time detection and fault diagnosis by the output voltage of DSP online acquisition seven electrical level inverter.
First object of the present invention is to provide a kind of seven electrical level inverters of tape jam diagnostic function, and its technical scheme is as follows:
Seven electrical level inverters of tape jam diagnostic function, comprise direct supply, H bridge main circuit, DSP, voltage variator, ohmic load and display device.Direct supply is made up of three 24v direct supplys, and DSP produces SPWM and drives H bridge main circuit by the converting direct-current power into alternating-current power from direct supply, and its voltage-drop loading of this alternating current to the ohmic load two ends of 20 ohm, and is detected by voltage transmitter.Voltage transmitter gives DSP by within proportional for the voltage signal the detected scope being reduced to 0 ~ 3v.
H bridge main circuit is made up of three H bridges, four of first H bridge switching tubes are labeled as H1S1, H1S2, H1S3 and H1S4 respectively, four switching tubes of second H bridge are labeled as H2S1, H2S2, H2S3 and H2S4 respectively, four switching tubes of the 3rd H bridge are labeled as H3S1, H3S2, H3S3 and H3S4 respectively, and switching tube is chosen as IGBT.Vo1, Vo2 and Vo3 represent the output voltage of three H bridges respectively, and Vo is the final output voltage of this circuit, after the output terminal cascade of three H bridges, makes Vo=Vo1+Vo2+Vo3.Due to Vo1, Vo2, Vo3=0V or ± E.The voltage of three direct supplys is V1, V2 and V3, and V1=V2=V3=E.Like this, at any time, Vo can equal ± 3E, ± 2E, ± E or 0V, and namely this inverter can export seven kinds of different level.
The fault type of the circuit state of H bridge main circuit and seven electrical level inverters is corresponding 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 work-fault 0.
Real-time detection and fault diagnosis is accomplished by the output voltage of DSP online acquisition seven electrical level inverter.The method for diagnosing faults of seven electrical level inverters based on neural network is embedded in described DSP.Described method for diagnosing faults is through data prediction and neural metwork training.
An embodiment of seven electrical level inverters of tape jam diagnostic function of the present invention, also comprise charactron, DSP shows the state of inverter in real time by charactron.
Another embodiment of seven electrical level inverters of tape jam diagnostic function of the present invention, DSP comprises data prediction and neural metwork training module, based on the fault diagnosis module of neural network and data memory module
The data prediction step of the described seven electrical level inverter method for diagnosing faults based on neural network is as follows:
Step 1 gathers fault sample data:
First output voltage during collection fault of converter is as fault sample data, and the method for collection is the discrete voltage equally spaced gathering 512 moment in the output voltage one-period of inverter, each voltage sequence gathered
represent.Each value in sequence equals the magnitude of voltage in corresponding moment.
Corresponding relation according to the circuit state of H bridge main circuit and the fault type of seven electrical level inverters: 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 work-fault 0, artificially open fault is set, gathers the voltage waveform that inverter exports under ten kinds of failure conditions, and the voltage waveform under normal operation.The fault data gathered in this step is The more the better.One embodiment of the present of invention are chosen collection and are often planted each 100 groups of voltage waveform.
Step 2FFT converts:
By sequence
carry out FFT conversion, FFT transformation for mula:
here W
b=e
-j2 π/b, k=0,1 ..., b/2-1;
The imaginary number sequence that number is one by one 512 is obtained after FFT conversion
get front 10 data of this sequence
and the data of this sequence are carried out delivery, by the sequence after delivery
next step calculating is carried out as sample data.
Step 3PCA dimensionality reduction:
After above-mentioned FFT converts and intercepts, the characteristic of primary voltage signal has become 10 from 512, next carries out PCA dimensionality reduction.Concrete grammar is as follows:
First the fault sample data of all kinds are gathered:
Then covariance matrix R is asked
xeigenvalue λ and feature value vector P:
Covariance matrix: R
x=E{ [X-E (X)] [X-E (X)]
t.
By solving | λ I-R
x|=0 He | λ
ii-R
x| p
i=0, i=1,2 ..., b tries to achieve λ and P, wherein, and λ
ifor R
xi-th eigenwert, and meet λ
1>=λ
2>=...>=λ
b, p
icorresponding to eigenvalue λ
iproper vector, P=[p
1, p
2..., p
b]
t.Here the value of b is 11.Choose front 3 row of front P, obtain P1=[p
1, p
2, p
3], and P1 is the matrix of 10 × 3.More than work and only need off-line to do once, then retain P1.
Finally calculate the list entries of BP neural network
x
into be number be 4 data sequence, first data is phase places of the first-harmonic of original signal, and latter three is data sequence after PCA dimensionality reduction.
The neural metwork training step of the described seven electrical level inverter method for diagnosing faults based on neural network is as follows:
Step 4 builds and trains BP neural network
The BP neural network that the present invention builds is three-layer neural network, because original signal obtains the characteristic x that number is 4 after FFT conversion and PCA dimensionality reduction
in, then input layer number is decided to be 4, and owing to always having 11 kinds of fault types, then output layer neuron number is 11, and hidden neuron number is rule of thumb chosen for 15.
If the neuron of input layer is
the neuron of hidden layer is
the neuron of output layer is
activation function is Sigmoid function, if
with
matrix of coefficients be xw
4 × 15,
with
matrix of coefficients be xw
15 × 11, then input/output relation is:
(formula 2-1)
(formula 2-2)
After building BP neural network, need to train original network.
First the 11 kinds of fault-signals (containing normal signal) will be collected in step 1, obtain training sample after FFT and PCA:
Due in step 1 often kind of a fault acquire 100 groups of signals, so 100 X_Sample now can be obtained, by the theory of each X_Sample export all be set to:
Adopt momentum gradient descent algorithm BP network, training error threshold value is set to 0.0001, learning rate α=0.5, obtains two matrix of coefficients xw_end ∈ R after training
4 × 15with xw_end ∈ R
15 × 11, these two matrixes contain all information of the neural network trained, and therefore, neural network only needs off-line training once, just no longer need trained after obtaining these two matrixes.
The step that the described seven electrical level inverter method for diagnosing faults based on neural network embed DSP is as follows:
Algorithm embeds in DSP by step 5
First initialization DSP.The clock of initialization DSP, phaselocked loop, interrupt vector table, the A0 mouth of definition DSP is that AD acquisition port gathers voltage, and GPIO16, GPIO17, GPIO18, GPIO19 of definition DSP are charactron communication port, are used for controlling the numeral of numeral method.The Timer0 module of configuration DSP, make DSP produce cycle interruption, the frequency of interruption is 25.6KHz.Set up the xw_end ∈ R in array xw [4] [15] and wy [15] [11] difference storing step 4 simultaneously
4 × 15with wy_end ∈ R
15 × 11, set up the magnitude of voltage that array ad_value [512] stores DSP collection.
Then fault diagnosis subfunction program is write, called after " diagnosis () ".The input of this subfunction is 512 magnitudes of voltage
Sequence ad_value [512]; The output of this subfunction is the value of a digital quantity k, k is exactly the type of fault, and such as diagnosis () function finally exports k=1, then show that DSP diagnoses out the fault of inverter to be kind 1, i.e. H1S1 open fault.The content of described fault diagnosis subfunction program is as follows:
Ad_value [512] storage of array completely after, trigger primary fault diagnosis, according to the content in step 2 and step 3,512 the data ad_value [512] be collected are carried out pre-service, four data after obtaining pre-service
then result xw [4] [15] and wy [15] [11] in these data and step 4 are brought into formula formula (2-1) and formula (2-2) carries out Neural Network Diagnosis; Finally, neural network output sequence y is obtained
k, this sequence is made up of 11 data, comprises diagnostic result; DSP uses bubble sort method to find y
kin the subscript k of maximal value, the value of k is exactly the failure mode shown in table 1, and this value is presented on charactron by DSP in real time; Then, empty array ad_value [512], restart the output voltage values gathering inverter, carry out the fault diagnosis of a new round
Finally, write principal function program " main () ", in principal function, programming is infinite loop pattern, whenever DSP enters interruption, then trigger AD sampling, and be stored in ad_value [512] array, when collection 512 times, diagnosis () function is called in main () function, carry out fault diagnosis, after diagnosis terminates, the result data of diagnosis is presented on charactron.
Invention also provides a kind of seven electrical level inverter method for diagnosing faults based on neural network, the described method for diagnosing faults based on neural network is through data prediction step and neural metwork training step, embed in DSP, the described method for diagnosing faults based on neural network is by DSP automatic data collection, carry out fault diagnosis, and show the state of inverter in real time by charactron.
Described data prediction step and neural metwork training step as follows:
Step 1 gathers fault sample data:
First output voltage during collection fault of converter is as fault sample data, and the method for collection is the discrete voltage equally spaced gathering 512 moment in the output voltage one-period of inverter, each voltage sequence gathered
represent, each value in sequence equals the magnitude of voltage in corresponding moment;
Corresponding relation according to the circuit state of H bridge main circuit and the fault type of seven electrical level inverters: 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 work-fault 0, artificially open fault is set, gathers the voltage waveform that inverter exports under ten kinds of failure conditions, and the voltage waveform under normal operation; Gather each 100 groups of often kind of voltage waveform;
Step 2FFT converts:
By sequence
carry out FFT conversion, FFT transformation for mula:
here W
b=e
-j2 π/b, k=0,1 ..., b/2-1;
The imaginary number sequence that number is one by one 512 is obtained after FFT conversion
get front 10 data of this sequence
and the data of this sequence are carried out delivery, by the sequence after delivery
next step calculating is carried out as sample data;
Step 3PCA dimensionality reduction:
After above-mentioned FFT converts and intercepts, the characteristic of primary voltage signal has become 10 from 512, next carries out PCA dimensionality reduction; Concrete grammar is as follows:
First the fault sample data of all kinds are gathered:
Then covariance matrix R is asked
xeigenvalue λ and feature value vector P:
Covariance matrix: R
x=E{ [X-E (X)] [X-E (X)]
t;
By solving | λ I-R
x|=0 He | λ
ii-R
x| p
i=0, i=1,2 ..., b tries to achieve λ and P, wherein, and λ
ifor R
xi-th eigenwert, and meet λ
1>=λ
2>=...>=λ
b, p
icorresponding to eigenvalue λ
iproper vector, P=[p
1, p
2..., p
b]
t, the value of b is 11 here; Choose front 3 row of P, obtain P1=[p
1, p
2, p
3], P1 is the matrix of 10 × 3; More than work and only need off-line to do once, then retain P1;
Finally calculate the list entries of BP neural network
x
into be number be 4 data sequence, first data is phase places of the first-harmonic of original signal, and latter three is data sequence after PCA dimensionality reduction;
Step 4 builds and trains BP neural network
BP neural network is three-layer neural network, because original signal obtains the characteristic x that number is 4 after FFT conversion and PCA dimensionality reduction
in, then input layer number is decided to be 4, and owing to always having 11 kinds of fault types, then output layer neuron number is 11, and hidden neuron number is rule of thumb chosen for 15;
If the neuron of input layer is
the neuron of hidden layer is
the neuron of output layer is
activation function is Sigmoid function, if
with
matrix of coefficients be xw
4 × 15,
with
matrix of coefficients be xw
15 × 11, then input/output relation is:
(formula 2-1)
(formula 2-2)
After building BP neural network, original network is trained;
First the 11 kinds of fault-signals (containing normal signal) will be collected in step 1, obtain training sample after FFT and PCA:
Due in step 1 often kind of a fault acquire 100 groups of signals, so 100 X_Sample now can be obtained, by the theory of each X_Sample export all be set to:
Adopt momentum gradient descent algorithm BP network, training error threshold value is set to 0.0001, learning rate α=0.5, obtains two matrix of coefficients xw_end ∈ R after training
4 × 15with xw_end ∈ R
15 × 11, these two matrixes contain all information of the neural network trained, and therefore, neural network only needs off-line training once, just no longer need training after obtaining these two matrixes;
Method for diagnosing faults based on neural network embeds in DSP according to following steps:
Algorithm embeds in DSP by step 5
First initialization DSP; The clock of initialization DSP, phaselocked loop, interrupt vector table, the A0 mouth of definition DSP is that AD acquisition port gathers voltage, and GPIO16, GPIO17, GPIO18, GPIO19 of definition DSP are charactron communication port, are used for controlling the numeral of numeral method; The Timer0 module of configuration DSP, make DSP produce cycle interruption, the frequency of interruption is 25.6KHz; Set up the xw_end ∈ R in array xw [4] [15] and wy [15] [11] difference storing step 4 simultaneously
4 × 15with wy_end ∈ R
15 × 11, set up the magnitude of voltage that array ad_value [512] stores DSP collection;
Then fault diagnosis subfunction program is write, called after " diagnosis () "; The input of described fault diagnosis subfunction is 512 magnitude of voltage sequence ad_value [512]; The output of described fault diagnosis subfunction is the value of a digital quantity k, k is the type of fault; The content of described fault diagnosis subfunction program is as follows:
Ad_value [512] storage of array completely after, trigger primary fault diagnosis, according to the content in step 2 and step 3,512 the data ad_value [512] be collected are carried out pre-service, four data after obtaining pre-service
then bring result xw [4] [15] and wy [15] [11] in these data and step 4 into formula formula (2-1) and formula (2-2) carries out Neural Network Diagnosis, obtain neural network output sequence y
k, this sequence is made up of 11 data, comprises diagnostic result; DSP uses bubble sort method to find y
kin the subscript k of maximal value, the value of k is exactly the failure mode shown in table 1, and this value is presented on charactron by DSP in real time; Then, empty array ad_value [512], restart the output voltage values gathering inverter, carry out the fault diagnosis of a new round;
Finally, write principal function program " main () ", in principal function, programming is infinite loop pattern, whenever DSP enters interruption, then triggers an AD sampling, and be stored in ad_value [512] array, when collection 512 times, in main () function, call diagnosis () function, carry out fault diagnosis.
The present invention has following effect:
1. the present invention is made up of seven level inverter circuits and DSP checkout and diagnosis circuit, can realize the line real time diagnosis of fault.
2. the present invention is used for carrying out fault diagnosis using the output voltage of seven electrical level inverters as unique detection signal.
3. voltage signal is carried out FFT conversion by the present invention, then PCA dimensionality reduction is carried out, the characteristic of the data fault-signal the most after the voltage fundamental phase signal then after being converted by FFT adds PCA dimensionality reduction, finally by the BP neural network that characteristic input trains, carries out fault diagnosis.
4. this inverter carries fault diagnosis functions, line real time diagnosis can have 10 kinds of faults and by numeral method out.
Below in conjunction with drawings and Examples, the present invention is further described.
specific implementation method:
As a kind of in Fig. 1 seven electrical level inverters of tape jam diagnostic function, comprise direct supply 3, H bridge main circuit 9, DSP1, voltage transmitter 6, ohmic load 5 and fault detector 8.Direct supply 3 is made up of three 24v direct supplys, and DSP1 produces SPWM and drives H bridge main circuit 9, and by the converting direct-current power into alternating-current power from direct supply 3, its voltage-drop loading of this alternating current to ohmic load 5 two ends of 20 ohm, and is detected by voltage transmitter 6.Voltage transmitter 6 gives DSP1 by within proportional for the voltage signal the detected scope being reduced to 0 ~ 3v.
Shown in Fig. 2, H bridge main circuit is made up of three H bridges, four of first H bridge switching tubes are labeled as H1S1, H1S2, H1S3 and H1S4 respectively, four switching tubes of second H bridge are labeled as H2S1, H2S2, H2S3 and H2S4 respectively, four switching tubes of the 3rd H bridge are labeled as H3S1, H3S2, H3S3 and H3S4 respectively, and switching tube is chosen as IGBT.Vo1, Vo2 and Vo3 represent the output voltage of three H bridges respectively, and Vo is the final output voltage of this circuit, after the output terminal cascade of three H bridges, makes Vo=Vo1+Vo2+Vo3.Due to Vo1, Vo2, Vo3=0V or ± E.The voltage of three direct supplys is V1, V2 and V3, and V1=V2=V3=E.Like this, at any time, Vo can equal ± 3E, ± 2E, ± E or 0V, and namely this inverter can export seven kinds of different level.
The voltage waveform (resistive load) exported during seven electrical level inverter nominal situations as shown in Figure 3, in this figure, horizontal ordinate is the time, ordinate is voltage, with 0v voltage 11 be, there is the level 33 above 3 seven electrical level inverter output waveform 0v above, have the level 66 below 3 seven electrical level inverter output waveform 0v below.This voltage waveform equals sinusoidal wave in weber meaning.When inverter breaks down, the output voltage waveforms of inverter will change, and according to the difference of output voltage waveforms, can distinguish different failure modes.Therefore the fault diagnosis algorithm of the present invention's proposition is using this voltage signal as exclusive diagnosis foundation.
All single tube open fault condition by analysis, except H3S1 with H3S4 and H3S2 with H3S3 two pairs of pipes separately fault time output voltage waveforms consistent time, during other tube failure, output voltage waveforms is different between two.Therefore H3S1 or H3S4 open circuit is temporarily classified as a class fault by the present invention, and same H3S2 or H3S3 open circuit row are also classified as a class fault.Therefore this inverter has 10 kinds of open faults and a kind of normal operating conditions, and they are classified as following table:
The failure modes of table 1 seven electrical level inverter
Circuit state |
Failure definition kind |
H1S1 opens a way |
Fault 1 |
H1S2 opens a way |
Fault 2 |
H1S3 opens a way |
Fault 3 |
H1S4 opens a way |
Fault 4 |
H2S1 opens a way |
Fault 5 |
H2S2 opens a way |
Fault 6 |
H2S3 opens a way |
Fault 7 |
H2S4 opens a way |
Fault 8 |
H3S1 or H3S4 opens a way |
Fault 9 |
H3S2 or H3S3 opens a way |
Fault 10 |
Normal work |
Fault 0 |
Table 1 is enumerated all failure modes that this inverter can carry out self diagnosis, amounts to 10 kinds, and simultaneously in order to unification, add state when inverter normally works, this inverter always has 11 kinds of states and can be detected and show.Such as numeral method is 0, then represent that inverter normally works, if numeral method is 6, then and corresponding 6th class fault, i.e. H2S2 open circuit.
The fault type of the circuit state of H bridge main circuit and seven electrical level inverters is corresponding 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 work-fault 0.
The seven electrical level inverter method for diagnosing faults based on neural network embed in DSP, accomplish real-time detection and fault diagnosis by the output voltage of DSP online acquisition seven electrical level inverter.
Fig. 9 is DSP internal processes module map of the present invention.DSP comprises data prediction and neural metwork training module 111, based on the fault diagnosis module 222 of neural network, and data memory module 333.The input signal of inverter carries out data prediction and neural metwork training through data prediction and neural metwork training module 111, and result is stored in data memory module 333.Fault diagnosis module 222 based on neural network receives the inverter drive signal processed through data prediction and neural metwork training module 111, and utilizes the storage data of data memory module 333, carries out fault diagnosis to inverter.
The described method for diagnosing faults based on neural network is as follows:
System electrification is run, and DSP starts automatic data collection, gathers the output voltage values of an inverter at interval of 39 microseconds, and is automatically stored in array ad_value [512] by magnitude of voltage; After this storage of array completely, DSP calls its fault diagnosis subfunction diagnosis () and carries out primary fault diagnosis, and by the output valve k of this function by numeral method out, this diagnoses end; Then array ad_value [512] is emptied, restart the output voltage values gathering inverter, carry out the fault diagnosis of a new round, so repeatedly carry out the circulation of " gathering-diagnosis-display ", a cycle period is 39 microseconds, and charactron shows the state of inverter simultaneously in real time.The content of barrier diagnosis subfunction diagnosis () is as follows:
Ad_value [512] storage of array completely after, trigger primary fault diagnosis, according to the content in step 2 and step 3,512 the data ad_value [512] be collected are carried out pre-service, four data after obtaining pre-service
then bring result xw [4] [15] and wy [15] [11] in these data and step 4 into formula formula (2-1) and formula (2-2) carries out Neural Network Diagnosis, obtain neural network output sequence y
k, this sequence is made up of 11 data, comprises diagnostic result; DSP uses bubble sort method to find y
kin the subscript k of maximal value, the value of k is exactly the failure mode shown in table 1, and this value is presented on charactron by DSP in real time; Then, empty array ad_value [512], restart the output voltage values gathering inverter, carry out the fault diagnosis of a new round;
Finally, write principal function program " main () ", in principal function, programming is infinite loop pattern, whenever DSP enters interruption, then trigger AD sampling, and be stored in ad_value [512] array, when collection 512 times, diagnosis () function is called in main () function, carry out fault diagnosis, after diagnosis terminates, the result data of diagnosis is presented on charactron.
Based on the method for diagnosing faults of neural network concrete steps as shown in Figure 5.
Described data prediction step and neural metwork training step as follows:
Step 1 gathers fault sample data:
First output voltage during collection fault of converter is as fault sample data, and the method for collection is the discrete voltage equally spaced gathering 512 moment in the output voltage one-period of inverter, each voltage sequence gathered
represent.Each value in sequence equals the magnitude of voltage in corresponding moment.
Corresponding relation according to the circuit state of H bridge main circuit and the fault type of seven electrical level inverters: 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 work-fault 0, artificially open fault is set, gathers the voltage waveform that inverter exports under ten kinds of failure conditions, and the voltage waveform under normal operation.The fault data gathered in this step is The more the better.One embodiment of the present of invention are chosen collection and are often planted each 100 groups of voltage waveform.
Step 2FFT converts:
By sequence
carry out FFT conversion, FFT transformation for mula:
here W
b=e
-j2 π/b, k=0,1 ..., b/2-1;
The imaginary number sequence that number is one by one 512 is obtained after FFT conversion
get front 10 data of this sequence
and the data of this sequence are carried out delivery, by the sequence after delivery
next step calculating is carried out as sample data.
Step 3PCA dimensionality reduction:
After above-mentioned FFT converts and intercepts, the characteristic of primary voltage signal has become 10 from 512, next carries out PCA dimensionality reduction.Concrete grammar is as follows:
First the fault sample data of all kinds are gathered:
Then covariance matrix R is asked
xeigenvalue λ and feature value vector P:
Covariance matrix: R
x=E{ [X-E (X)] [X-E (X)]
t.
By solving | λ I-R
x|=0 He | λ
ii-R
x| p
i=0, i=1,2 ..., b tries to achieve λ and P, wherein, and λ
ifor R
xi-th eigenwert, and meet λ
1>=λ
2>=...>=λ
b, p
icorresponding to eigenvalue λ
iproper vector, P=[p
1, p
2..., p
b]
t.Here the value of b is 11.Choose front 3 row of front P, obtain P1=[p
1, p
2, p
3], and P1 is the matrix of 10 × 3.More than work and only need off-line to do once, then retain P1.
Finally calculate the list entries of BP neural network
x
into be number be 4 data sequence, first data is phase places of the first-harmonic of original signal, and latter three is data sequence after PCA dimensionality reduction.
Step 4 builds and trains BP neural network
The BP neural network that the present invention builds is three-layer neural network, because original signal obtains the characteristic x that number is 4 after FFT conversion and PCA dimensionality reduction
in, then input layer number is decided to be 4, and owing to always having 11 kinds of fault types, then output layer neuron number is 11, and hidden neuron number is rule of thumb chosen for 15.BP neural network structure figure as shown in Figure 4.
If the neuron of input layer is
the neuron of hidden layer is
the neuron of output layer is
activation function is Sigmoid function, if
with
matrix of coefficients be xw
4 × 15,
with
matrix of coefficients be xw
15 × 11, then input/output relation is:
(formula 2-1)
(formula 2-2)
After building BP neural network, need to train original network.
First the 11 kinds of fault-signals (containing normal signal) will be collected in step 1, obtain training sample after FFT and PCA:
Due in step 1 often kind of a fault acquire 100 groups of signals, so 100 X_Sample now can be obtained, by the theory of each X_Sample export all be set to:
Adopt momentum gradient descent algorithm BP network, training error threshold value is set to 0.0001, learning rate α=0.5, obtains two matrix of coefficients xw_end ∈ R after training
4 × 15with xw_end ∈ R
15 × 11, these two matrixes contain all information of the neural network trained, and therefore, neural network only needs off-line training once, just no longer need trained after obtaining these two matrixes.
Method for diagnosing faults based on neural network embeds in DSP according to following steps:
Algorithm embeds in DSP by step 5
First initialization DSP.The clock of initialization DSP, phaselocked loop, interrupt vector table, the A0 mouth of definition DSP is that AD acquisition port gathers voltage, and GPIO16, GPIO17, GPIO18, GPIO19 of definition DSP are charactron communication port, are used for controlling the numeral of numeral method.The Timer0 module of configuration DSP, make DSP produce cycle interruption, the frequency of interruption is 25.6KHz.Set up the xw_end ∈ R in array xw [4] [15] and wy [15] [11] difference storing step 4 simultaneously
4 × 15with wy_end ∈ R
15 × 11, set up the magnitude of voltage that array ad_value [512] stores DSP collection.
Then fault diagnosis subfunction program is write, called after " diagnosis () ".The input of this subfunction is 512 magnitude of voltage sequence ad_value [512]; The output of this subfunction is the value of a digital quantity k, k is exactly the type of fault, and such as diagnosis () function finally exports k=1, then show that DSP diagnoses out the fault of inverter to be kind 1, i.e. H1S1 open fault.The content of described fault diagnosis subfunction program is as follows:
Ad_value [512] storage of array completely after, trigger primary fault diagnosis, according to the content in step 2 and step 3,512 the data ad_value [512] be collected are carried out pre-service, four data after obtaining pre-service
then bring result xw [4] [15] and wy [15] [11] in these data and step 4 into formula formula (2-1) and formula (2-2) carries out Neural Network Diagnosis, obtain neural network output sequence y
k, this sequence is made up of 11 data, comprises diagnostic result; DSP uses bubble sort method to find y
kin the subscript k of maximal value, the value of k is exactly the failure mode shown in table 1, and this value is presented on charactron by DSP in real time; Then, empty array ad_value [512], restart the output voltage values gathering inverter, carry out the fault diagnosis of a new round.
Finally, write principal function program " main () ", in principal function, programming is infinite loop pattern, whenever DSP enters interruption, then trigger AD sampling, and be stored in ad_value [512] array, when collection 512 times, diagnosis () function is called in main () function, carry out fault diagnosis, after diagnosis terminates, the result data of diagnosis is presented on charactron.
Actual diagnosis effect is shown
Here circuit output waveform and diagnostic result when only displaying is opened a way with H1S1 under normal circumstances.Under other failure conditions, through actual measurement, all can be diagnosed completely.
Under normal condition and H1S1 open circuit time circuit output voltage waveform as shown in Figure 3 and Figure 6 shown in.Fig. 3 is under normal condition, the output voltage wave figure of Cascade H bridge type seven electrical level inverter, has the level above 3 33 7 electrical level inverter output waveform 0v above this waveform, has the level 66 below 3 seven electrical level inverter output waveform 0v below this waveform.
When open fault occurs H1S1, seven level output voltage waveforms become the level 22 of two seven level output voltage fault waveforms on 0v on 0v.Different by the shape of this output voltage waveforms, this two states can be made a distinction.Because this method is that fault waveform and failure mode are set up relation one to one, so study without the need to this waveform caused which kind of reason.During other faults, can there is other changes in the shape of output voltage, the present invention carries out fault diagnosis according to this change.
Under Fig. 7 and Fig. 8 respectively show normal condition and H1S1 open circuit time DSP diagnosis situation.They are effect plays figure of the present invention, and this inverter is made up of DSP1, direct supply 3, accessory power supply 4, ohmic load 5, Hall voltage sensor, voltage transmitter 6, and each parts all mark in the drawings.What wherein charactron shows is the result diagnosed, and in Fig. 7, circuit working is in normal condition, then numeral method is in 0, Fig. 8, and because H1S1 there occurs open fault, then DSP detects and determines this fault, is 1 by numeral method.
Empirical tests, if the malfunction in any one table 1 occurs, the present invention all can quickly detect and be presented on charactron.
More than show and describe the ultimate principle of invention, principal character and advantage.The claimed scope of this patent is defined by appending claims and equivalent thereof.