Sparse Representation and SVM Diagnosis Method for Inter-Turn Short-Circuit Fault in PMSM

: Permanent magnet synchronous motors (PMSM) has the advantages of simple structure, small size, high efﬁciency, and high power factor, and a key dynamic source and is widely used in industry, equipment and electric vehicle. Aiming at its inter-turn short-circuit fault, this paper proposes a fault diagnosis method based on sparse representation and support vector machine (SVM). Firstly, the sparse representation is used to extract the ﬁrst and second largest sparse coefﬁcients of both current signal and vibration signals, and then they are composed into four-dimensional feature vectors. Secondly, the feature vectors are input into the support vector machine for fault diagnosis, which is suitable for small sample. Experiments on a permanent magnet synchronous motor with artiﬁcially set inter-turn short-circuit fault and a normal one showed that the method is feasible and accurate.


Introduction
Permanent magnet synchronous motors (PMSM) has the advantages of simple structure, small size, high efficiency, and high power factor [1], and a key dynamic source and is widely used in industry, equipment and electric vehicle.Once some faults occur in the motor, it can cause serious damage of equipment and property.Therefore, it is important to research the diagnose methods of the faults in PMSM.Motor faults can be broadly classified into mechanical faults, magnetic faults and electrical faults.The inter-turn short-circuit is the most common electrical fault of the motor, whose major source is the insulation problem of the stator windings [2].
Signal processing is one of the commonly used fault diagnosis methods for motor, such as motor current signal analysis (MCSA) [3].Signal processing methods typically include time domain methods, frequency domain methods, and time-frequency analysis methods.The classical method of frequency domain analysis is fast Fourier transform (FFT) [4].It can clearly show the frequency distribution of the signal, where the harmonic component can be used as a feature of the fault.In order to overcome the shortcoming of FFT which loss time domain information, time-frequency analysis methods are proposed, such as short-time Fourier transform (STFT) [5], wavelet transform (WT) [6] etc.But the studies before often only process the single signal of current or vibration.
With the development of machine learning and artificial intelligence, lots of data-driven intelligent diagnostic methods have been proposed, such as fuzzy logic (FL), neural networks (NN), and support vector machines (SVM) [7].They can classify and identify the input data to determine the fault state of the motor.SVM is an algorithm suitable for small sample which was proposed in 1990s.S. Das et al. combined Park's transformation and continuous wavelet transform (CWT) to extract features, and then import them into SVM for classification [8].Chen F extracted features by using empirical mode decomposition (EMD), and then optimized the wavelet support vector machine to diagnose [9].H. Hassani et al. used fuzzy logic systems to combine different SVMs for bearing fault detection [10].Today, the application of SVM for PMSM fault diagnosis can still be explored.
Sparse representation is a new theory which is the most representative methodology of the linear representation methods [11], so it has been used in fields of image processing, signal processing, computer vision, and pattern recognition [12].In signal processing, it can compress signals and extract the essential characteristics of signals, so it has also been used for mechanical fault diagnosis in recent years.Sparse representation has been used in feature extraction, signal denoising, and fault classification in the field of fault diagnosis.N. Chai et al. used resonance-based sparse signal decomposition (RSSD) to remove the interference from the gear meshing-related components in the current signal [13].L. Ren et al. used a joint model based on sparse representation classification (SRC) [14] and SVM in the roller bearing fault diagnosis [15].Jing Hou et al. studied the feature extraction method of power electronic circuits based on sparse representation, which used matching pursuit (MP) algorithm to obtain the maximum sparse coefficient as the feature [16].Instead of the constructed dictionary, B. Yang used a dictionary learning algorithm to improve the application of sparse representation in diagnosis of wind turbine generator bearing fault [17].However, most studies used sparse representation to process vibration signals to diagnose the mechanical faults.There are few studies specifically researching the electrical faults of PMSM.
Aiming at the problem of inter-turn short circuit fault in PMSM, this paper proposes a fault diagnosis method based on sparse representation and SVM.The sparse representation is used to extract the first and second largest sparse coefficients of both current signal and vibration signals, and they are composed into four-dimensional feature vectors, which are input into the SVM for training.At last, the trained SVM model is used for fault diagnosis.Section 2 introduces the principle and solution algorithm of sparse representation used in this paper, as well as the features selected in this work.Section 3 introduces the principle of SVM.In Section 4, two PMSM were used in the experiment: one motor was manually set the inter-turn short-circuit fault and the other was normal.
The experiment results showed that the method is feasible.

Sparse Representation
The principle of sparse representation theory is to represent the original signal as a sparse linear combination of the dictionary atoms in an overcomplete dictionary matrix [11].Therefore, it can extract the basic information from the signal, and avoid the interference of small noise in the signal, such as additional vibration caused by rotor imbalance or distortion of the measurement process.The main idea of sparse representation theory is to concentrate the energy of feature information into a few elements [17].Therefore, in this paper, sparse representation is used to extract fault features.For an input signal where is the dictionary matrix, the column vector d i is a dictionary atom and ||d i = 1||.The dictionary is an overcomplete dictionary when m > n. α = [α 1 , α 2 , • • • , α m ] T is the solution to the sparse representation of the original signal, and α i is the sparse representation coefficient.
Use the l 0 norm to indicate the sparse degree of the sparse coefficients: Obviously, the l 0 norm is actually the number of non-zero elements in α.
The commonly used optimization algorithm based on l 0 norm is matching pursuit (MP) [18].Firstly, it chooses an atom that matches the input signal best from the dictionary matrix and calculates the residual.Then it continues to select the atom that matches the residual signal best, and iterates over and over like this until it meets the requirement.However, in MP, the residual signal is only orthogonal to the dictionary atom selected in this iteration, and does not necessarily have orthogonality with all dictionary atoms, which will increase the number of iterations, and the result may not be the optimal solution.In order to solve this problem, the orthogonal matching pursuit (OMP) algorithm was proposed.The workflow of OMP is shown in Table 1: Table 1.Workflow of orthogonal matching pursuit (OMP).
Input: signal x, dictionary matrix D, sparse degree K (2) Select the atom d t that best matches the residual signal in the dictionary.The selection condition is Update t = t + 1 and repeat steps 2-5 until t = K.

Output: sparse representation coefficients α
As for the choice of dictionary matrix, discrete cosine transform (DCT) is suitable for stationary signals and has higher computational efficiency than Fourier transform, so it is used to construct a dictionary matrix.The effective information of the result by DCT is mostly concentrated in the low frequency, which can remove the redundant information of the signal while retaining the basic information.
In this paper, the sparse coefficients of the current signal and the vibration signal are obtained by sparse representation respectively, and the first and second largest value in the respective sparse coefficients α are selected to be constructed into four-dimensional feature vectors, which will be input into the SVM.

SVM
SVM is a two-class model whose purpose is to find a hyperplane to segment the sample space.The principle of segmentation is to enable the hyperplane to classify the samples correctly and maximize the margin between the samples and the hyperplane.The samples closest to the hyperplane that determines the position of the hyperplane are support vectors.
Let the sample points for training be , and the output is y i ∈ {−1, 1}.If let w be the normal vector of the hyperplane and b be the displacement, the equation of the hyperplane is: The margin is equal to the projection of the difference between two different types of support vectors on w, which is 2 w .Maximizing the classification margin is equal to the following: Its Lagrange function is: where α i ≥ 0 is the Lagrange multiplier.Let the partial derivatives of L(w, b, α) with respect to w and b respectively equal to 0, and then the following equations can be obtained: Substitute the above equation into the original function, and the original question becomes: From this, the decision function corresponding to the segmentation hyperplane equation can be solved, which is: In this paper, the input vector of sample point is four-dimensional, which means x i ∈ R 4 .As for the output y i ∈ {−1, 1}, 1 represents the signal of the normal motor and -1 represents the signal of the inter-turn short circuit motor.First, the training sets where fault types are known are input into the SVM to solve the decision function.Then, input the test set to test the diagnosis effect of the inter-turn short-circuit fault in PMSM based on SVM.

Experiment Setup
The experimental platform for fault diagnosis of PMSM is shown in Figure 1.The current sensor and the vibration sensor collect signals from the motors, and data acquisition (DAQ) card uploads the signal data to the computer for the subsequent research on the algorithm.The experimental platform includes two low speed PMSMs (90TDY115-2B), current sensors (The experimental platform), piezoelectric accelerometer (CA-YD-186) and DAQ card (NI-PCI6225).One of them is a normal motor and the other one is artificially set to a 15% stator inter-turn fault.These current sensors acquire the stator current of the motors and transform the current signal into voltage signal that is convenience for the host computer to deal with.Piezoelectric accelerometer gets the vibration information and its output is amplified by signal conditioner (YE3832).In the host computer, A DAQ card, NI-PCI6225, was installed, to which a junction box, BNC-2110, was The experimental platform includes two low speed PMSMs (90TDY115-2B), current sensors (The experimental platform), piezoelectric accelerometer (CA-YD-186) and DAQ card (NI-PCI6225).One of them is a normal motor and the other one is artificially set to a 15% stator inter-turn fault.These current sensors acquire the stator current of the motors and transform the current signal into voltage signal that is convenience for the host computer to deal with.Piezoelectric accelerometer gets the vibration information and its output is amplified by signal conditioner (YE3832).In the host computer, A DAQ card, NI-PCI6225, was installed, to which a junction box, BNC-2110, was connected.They can upload the data from sensors to the host computer.After the data were saved, the algorithm in this paper was implemented in MATLAB (2015b, MathWorks, Natick, MA, USA., 1984).

Feature Extraction Based on Sparse Representation
In this work, 40 sets of single-phase current signals were collected from the motors, of which 20 sets were from normal motor and 20 sets were from the fault one.According to Nyquist's sampling law, the sampling frequency f s was set to 1024 Hz, and the number of sampling points N was 4096, which means the time of each set was 4 s.The same applied to the vibration signal.Among them, one of the collected normal currents and one of fault currents are shown in Figure 2.     Their spectrum diagrams obtained by FFT are shown in Figure 5. From Figures 3-5, It can be visually seen from the waveform diagram of the time domain that the amplitude of the fault signals is higher than that of the normal signals.In the spectrum diagrams, the amplitude of the fundamental frequency  = 50 of the fault current signal is also higher than the amplitude of the normal In addition, there is a tiny harmonic component at 3 in the fault current signal, and in the vibration signal, some harmonic components at 4 , 6 and so on can be found.It is in agreement with the previous study [19], which confirms the validity of the acquired signals.
Next, the OMP algorithm is used to obtain their sparse coefficients by DCT overcomplete dictionary.According to the length of the signal, the size of the overcomplete dictionary matrix is set  Their spectrum diagrams obtained by FFT are shown in Figure 5. From Figures 3-5, It can be visually seen from the waveform diagram of the time domain that the amplitude of the fault signals is higher than that of the normal signals.In the spectrum diagrams, the amplitude of the fundamental frequency  = 50 of the fault current signal is also higher than the amplitude of the normal In addition, there is a tiny harmonic component at 3 in the fault current signal, and in the vibration signal, some harmonic components at 4 , 6 and so on can be found.It is in agreement with the previous study [19], which confirms the validity of the acquired signals.
Next, the OMP algorithm is used to obtain their sparse coefficients by DCT overcomplete dictionary.According to the length of the signal, the size of the overcomplete dictionary matrix is set From Figures 2-4, It can be visually seen from the waveform diagram of the time domain that the amplitude of the fault signals is higher than that of the normal signals.In the spectrum diagrams, the amplitude of the fundamental frequency f s = 50 Hz of the fault current signal is also higher than the amplitude of the normal In addition, there is a tiny harmonic component at 3 f s in the fault current signal, and in the vibration signal, some harmonic components at 4 f s , 6 f s and so on can be found.It is in agreement with the previous study [19], which confirms the validity of the acquired signals.
Next, the OMP algorithm is used to obtain their sparse coefficients by DCT overcomplete dictionary.According to the length of the signal, the size of the overcomplete dictionary matrix is set to n × m = 4096 × 16384.The iterative process of the above normal current signal in OMP is shown in Figure 6. to   = 4096 16384.The iterative process of the above normal current signal in OMP is shown in Figure 6.It can be seen from the figure that the sparse coefficients obtained after the number of iterations is more than 100 times are too small, and should be regarded as noise that should be ignored.It can be seen from the figure that the sparse coefficients obtained after the number of iterations is more than 100 times are too small, and should be regarded as noise that should ignored.Therefore, let the target sparse degree K = 100.Next, take the above four sets of signals as examples.After the OMP, the sparse coefficients α = [α 1 , α 2 , • • • , α 16384 ] T obtained by the sparse representation of the two sets current signals are shown in Figure 7.
to   = 4096 16384.The iterative process of the above normal current signal in OMP is shown in Figure 6.As shown in the figure, the values of most small sparse coefficients of the fault signal and the normal signal is almost the same, but the difference between the large sparse coefficients is obvious.The amplitude of large sparse coefficients of fault signal are usually higher than them of the normal signal, especially the maximum sparse coefficient.Therefore, the maximum sparse coefficient can be taken as a feature.However, only using one feature which is the maximum sparse coefficient is As shown in the figure, the values of most small sparse coefficients of the fault signal and the normal signal is almost the same, but the difference between the large sparse coefficients is obvious.The amplitude of large sparse coefficients of fault signal are usually higher than them of the normal signal, especially the maximum sparse coefficient.Therefore, the maximum sparse coefficient can be taken as a feature.However, only using one feature which is the maximum sparse coefficient is inaccurate.For example, as for the sparse coefficients of another normal current signal which is shown in Figure 9, its maximum sparse coefficient is relatively large, which will confuse the diagnosis result.But even in this case, the second largest sparse coefficient of the signal is still smaller than the second largest sparse coefficient of the fault signal.For the sake of accuracy, the maximum sparse coefficient and the second largest sparse coefficient should be taken together as features.As shown in the figure, the values of most small sparse coefficients of the fault signal and the normal signal is almost the same, but the difference between the large sparse coefficients is obvious.The amplitude of large sparse coefficients of fault signal are usually higher than them of the normal signal, especially the maximum sparse coefficient.Therefore, the maximum sparse coefficient can be taken as a feature.However, only using one feature which is the maximum sparse coefficient is inaccurate.For example, as for the sparse coefficients of another normal current signal which is shown in Figure 9, its maximum sparse coefficient is relatively large, which will confuse the diagnosis result.But even in this case, the second largest sparse coefficient of the signal is still smaller than the second largest sparse coefficient of the fault signal.For the sake of accuracy, the maximum sparse coefficient and the second largest sparse coefficient should be taken together as features.As can be seen from the above figures, the feature values of signals of different fault types are also different.All the first features of fault vibration are higher than 0.4, while the normal features are lower.Besides, the second features of fault vibration are higher than 0.25, while the normal features are lower.Similar phenomena can also be found in the current signals, although not so obvious.The boundary value between the first features of the normal and fault current is about 50, and the boundary value of the second features is about 33.Therefore, combining the different features into one feature vector is suggested so that no information source will be ignored.Next, the SVM will be trained and tested with the feature vectors.As can be seen from the above figures, the feature values of signals of different fault types are also different.All the first features of fault vibration are higher than 0.4, while the normal features are lower.Besides, the second features of fault vibration are higher than 0.25, while the normal features are lower.Similar phenomena can also be found in the current signals, although not so obvious.The boundary value between the first features of the normal and fault current is about 50, and the boundary value of the second features is about 33.Therefore, combining the different features into one feature vector is suggested so that no information source will be ignored.Next, the SVM will be trained and tested with the feature vectors.So, the sample points for training SVM are (x i , y i ), and y i is their corresponding fault type, i = 1, 2, • • • , 34.Input them into the SVM to get the support vectors and hyperplane.The sample points and support vectors (SV) are shown in Figure 12 where the two features of current act as the coordinate axes.The sample points and support vectors (SV) are also shown in Figure 13 where the two features of vibration act as the coordinate axes.The sample points and support vectors (SV) are also shown in Figure 13 where the two features of vibration act as the coordinate axes.The sample points and support vectors (SV) are also shown in Figure 13 where the two features of vibration act as the coordinate axes.As can be seen, in the two figures, the sample points of the normal signals are concentrated in the lower left corner, and the sample points of the fault signal are scattered in the upper right corner.After the training is completed, input the 6 test sets to test.The results are shown in Table 2.The accuracy of the above test results is 100%, which proves the features extracted by sparse representations can be used for fault diagnosis of PMSM, and the method proposed in this paper is accurate.

Discussion
In this paper, a diagnosis method of inter-turn short-circuit fault in PMSM where sparse representation is used to extract features and SVM is used for classification is studied.Previous studies on sparse representation mostly used vibration signals to diagnose mechanical faults of induction motors or gearboxes.In this work, current signals and vibration signals are combined to diagnose electrical faults in PMSM by sparse representation and SVM.Experiments indicate that the chosen features and the proposed method are feasible.
However, among the features, as can be seen from the experimental results, compared with the features of vibration signal, the features of the current are not so obvious, and it is not powerful enough to distinguish between normal and fault signals just by them, which may be due to the selection of the dictionary or the optimization algorithm.Therefore, the result of current signal processed by sparse representation algorithm needs to be improved.In the future, dictionary learning algorithms should also be studied, in order to be more suitable for the feature extraction of motor signals.In addition, more complicated conditions and more PMSM faults need to be considered.

Conclusions
Aiming at the problem of inter-turn short circuit fault in PMSM, this paper proposes a fault diagnosis method based on sparse representation and SVM.The sparse representation is used to extract the first and second largest sparse coefficients of both current signal and vibration signals by OMP, and they are composed into four-dimensional feature vectors, which are input into the SVM for training and testing then.Two PMSMs were used in the experiment, one manually set the inter-turn short circuit and one normal.The experiment results showed that the method is feasible and accurate.More advanced sparse representation algorithms and more motor faults need to be researched in the future.

13 Figure 1 .
Figure 1.The experimental platform for fault diagnosis of permanent magnet synchronous motors (PMSM).

Figure 1 .
Figure 1.The experimental platform for fault diagnosis of permanent magnet synchronous motors (PMSM).

13 Figure 2 .
Figure 2. Two of the collected current signals.Their spectrum diagrams obtained by FFT are shown in Figure 3.

Figure 3 .
Figure 3. Spectrum diagrams of the collected current signals.Besides, one of the collected normal vibration signals and one of fault vibration signals are shown in Figure 4.

Figure 2 . 13 Figure 2 .
Figure 2. Two of the collected current signals.Their spectrum diagrams obtained by FFT are shown in Figure3.

Figure 3 .
Figure 3. Spectrum diagrams of the collected current signals.Besides, one of the collected normal vibration signals and one of fault vibration signals are shown in Figure 4.

Figure 5 .
Figure 5. Spectrum diagrams of the collected vibration signals.

Figure 4 .
Figure 4. Two of the collected vibration signals.Their spectrum diagrams obtained by FFT are shown in Figure5.

13 Figure 4 .
Figure 4. Two of the collected vibration signals.

Figure 5 .
Figure 5. Spectrum diagrams of the collected vibration signals.

Figure 5 .
Figure 5. Spectrum diagrams of the collected vibration signals.

Figure 6 .
Figure 6.Iterative process of one normal current signal.

Figure 7 .
Figure 7. Sparse coefficients of two current signals (a) Normal current; (b) Fault current.Besides, the sparse coefficients obtained by the sparse representation of the two sets of vibration signals are shown in Figure 8.

Figure 6 .
Figure 6.Iterative process of one normal current signal.

Figure 6 .Figure 7 .
Figure 6.Iterative process of one normal current signal.It can be seen from the figure that the sparse coefficients obtained after the number of iterations is more than 100 times are too small, and should be regarded as noise that should be ignored.Therefore, let the target sparse degree  = 100.Next, take the above four sets of signals as examples.After the OMP, the sparse coefficients  = [ ,  , ⋯ ,  ] obtained by the sparse representation of the two sets current signals are shown in Figure 7.

Figure 7 .Figure 8 .
Figure 7. Sparse coefficients of two current signals (a) Normal current; (b) Fault current.Besides, the sparse coefficients obtained by the sparse representation of the two sets of vibration signals are shown in Figure 8. Appl.Sci.2019, 9, x FOR PEER REVIEW 9 of 13

Figure 8 .
Figure 8. Sparse coefficients of two vibration signals (a) Normal current; (b) Fault current.

Figure 8 .
Figure 8. Sparse coefficients of two vibration signals (a) Normal current; (b) Fault current.

Figure 9 .
Figure 9. Sparse coefficients of a set of normal current signal.

Figure 9 .Figure 10 .
Figure 9. Sparse coefficients of a set of normal current signal.After the above-mentioned OMP algorithm is used to obtain the sparse coefficients of 40 sets current signals and the sparse coefficients of 40 sets vibration signals, select the largest and second largest sparse coefficients in them as features.The first and second features extracted from the 20 sets of normal current signals and 20 sets of fault current signals are shown in Figure 10.Appl.Sci.2019, 9, x FOR PEER REVIEW 10 of 13

Figure 10 .
Figure 10.Features extracted from the current signals (a) First feature of current; (b) Second feature of current.The first and second features extracted from the 20 sets of normal vibration signals and 20 sets of fault vibration signals are shown in Figure 11.

Figure 10 .Figure 11 .
Figure 10.Features extracted from the current signals (a) First feature of current; (b) Second feature of current.The first and second features extracted from the 20 sets of normal vibration signals and 20 sets of fault vibration signals are shown in Figure 11.

4. 3 .
Training and Testing Results of SVM Mark the features as F1, F2, F3, F4, where F1 means the first feature of current, F2 means the second feature of current, F3 means the first feature of vibration, and F4 means the second feature of vibration.Then the input become  = [1 2 3 4 ].The 40 feature vectors obtained

Figure 11 .
Figure 11.Features extracted from the vibration signals (a) First feature of vibration; (b) Second feature of vibration.

4. 3 .
Training and Testing Results of SVM Mark the extracted features as F1, F2, F3, F4, where F1 means the first feature of current, F2 means the second feature of current, F3 means the first feature of vibration, and F4 means the second feature of vibration.Then the input become x i = [F1 i F2 i F3 i F4 i ].The 40 feature vectors obtained above are divided into two sets, where 34 sets are training sets and 6 sets are test sets.The number of normal and fault feature vectors in each set is the same.
Appl.Sci.2019, 9, x FOR PEER REVIEW 11 of 13 above are divided into two sets, where 34 sets are training sets and 6 sets are test sets.The number of normal and fault feature vectors in each set is the same.So, the sample points for training SVM are ( ,  ), and  is their corresponding fault type,  = 1,2, ⋯ ,34.Input them into the SVM to get the support vectors and hyperplane.The sample points and support vectors (SV) are shown in Figure12where the two features of current act as the coordinate axes.

Figure 12 .
Figure 12.Sample points and support vectors by F1 and F2.

Figure 12 .
Figure 12.Sample points and support vectors by F1 and F2.

Figure 12 .
Figure 12.Sample points and support vectors by F1 and F2.

Figure 13 .
Figure 13.Sample points and support vectors by F3 and F4.Figure 13.Sample points and support vectors by F3 and F4.

Figure 13 .
Figure 13.Sample points and support vectors by F3 and F4.Figure 13.Sample points and support vectors by F3 and F4.
1 , d k | and the column number of the selected atom satisfies that λ t / ∈ Λ t−1 .(3)Update the index set Λ t = Λ t−1 ∪ {λ t } with λ t , and update the matrix A t = A t−1 ∪ d t .

Table 2 .
Test results of support vector machine (SVM).