Efficient Hairpin Winding Fault Detection Using Impedance Measurements

This study investigates various hairpin winding faults in electric motors using impedance measurements. Both high-frequency and low-frequency impedances are measured to characterize winding fault conditions. This study proposes various techniques to extract distinctive feature patterns that are associated with fault conditions. These include open circuit faults that show significant discrimination within the low-frequency range, and welding mismatch faults that are distinguished by a proposed similarity indicator. Insulation faults – faults that are related to epoxy – are found to be more difficult to diagnose using simple statistical metrics, so this study proposes a machine learning classification model using a support vector machine (SVM). The results show that the SVM model achieves a high accuracy using a small number of training samples. The methods discussed provide cost-efficient solutions to effectively detect welding and insulation faults, ensuring the product quality of hairpin windings.


I. INTRODUCTION
In the automotive industry, electric motors are gradually replacing internal combustion engines due to environmental concerns. Hairpin windings are a vital component in a brushless DC motor (BLDC), which is the dominant type in current electric vehicle applications. Detecting incipient faults of hairpin windings within the manufacturing process can improve product quality and reduce warranty and maintenance costs.
Signal-based methodologies have been highly effective in detecting faults in electric motors [1], [2]. Most research [3], [4] collect vibration and current signals for fault detection of electric motor components, such as bearings, rotors, and stators. For stator windings, electrical impedance has been found to reveal the characteristics [5], [6], [7]. However, only impedance spectroscopes are explored and the specific relationship between impedance and stator winding characteristics is not revealed.
The associate editor coordinating the review of this manuscript and approving it for publication was M. Shamim Kaiser .
This study proposes a series of signal-based methods to detect various faults within stator windings of BLDCs, including welding and insulation faults. Electrical impedance is measured and used as the primary input for the fault diagnosis. Implementing signal-based methods on impedance data, this study extracts feature patterns that are associated with fault conditions. The first proposed method is a similarity indicator for detecting welding faults. These indicators combined with a baseline threshold can detect an abnormal stator and locate faulty phase windings.
This study also finds that epoxy plays a critical role in impedance behaviors. Using impedance data, a machine learning-based method is proposed to detect insulation faults related to epoxy. This supervised learning approach can effectively extract underlying feature patterns using only a minimal amount of training data.
The paper is organized as follows. Section II reviews related studies on the fault detection of motor windings. Section III introduces the experimental setup and winding impedance measurements. In Section IV, both open circuit and welding mismatch defects are investigated.
Section V applies and evaluates a support vector machine (SVM) to classify faults related to epoxy. Section VI presents the conclusions.

II. RELATED STUDIES
Different types of faults lead to the breakdown of electric motors and various fault detection methodologies have been studied. Particularly, welding faults and insulation faults are commonly of the most concern [8], [9], [10]. These are specifically considered in this study as follows.

A. WELDING FAULTS
For specific hairpin welding fault detection, two dominant techniques are commonly used: image-based and opticalbased techniques. With the image-based technique, data are captured throughout or after the welding process, followed by the application of deep learning-based algorithms to diagnose welding faults [11], [12]. Vater et al. [13] employed both 3D data and grayscale images after the welding process as inputs for hairpin welding surface fault detection. An advanced convolutional neural network was implemented as the classification algorithm. Antony et al. [14] captured image data within the welding process and implemented a deep learning-based object detection algorithm to classify and localize the welding surface pores.
Optical-based techniques mainly focus on condition monitoring during the welding process. These techniques are however affected by a series of physical and chemical reactions that occur during the welding process, including radiation, light intensity, and/or reflected laser light. The characteristics of light are directly related to the properties of the welding, indicating defects within the microstructure of the welding parts. Optical characteristics of emitted light during the welding process are employed for diagnosis [15], [16].
Alternative electric-based techniques have also been considered [17], such as establishing relationships between the resistance properties of hairpins and the welding quality. However, the associated variation due to defects has been found to be minuscule and as low as the micro-ohm level, which is not practical for mass-production applications.

B. INSULATION FAULTS
State-of-the-art technologies for insulation condition monitoring are described in [18] and [19], such as conventional temperature monitoring, tagging compounds, ozone monitoring, partial discharge, and end-winding vibration.
Lenko et al. [20] applied non-destructive testing techniques and thermomechanical characterization to detect typical failures and defects of winding insulations. X-ray computed tomography was employed to visualize defects in insulations. Hao et al. [21] used non-destructive ultrasonic methods to detect epoxy insulation faults. The ultrasonic method was found sensitive to degradation of the aged stator insulation. In addition, acoustic signals were utilized to analyze and identify partial discharge fault types in epoxy resins [22].
Most of the above detection techniques require costly equipment and may be impacted by environmental conditions that limit their application in production line settings. In this study, a cost-efficient rapid signal-based methodology is proposed for hairpin winding fault detection.

III. STATOR MEASUREMENTS AND PRELIMINARY ANALYSIS
Hairpin-based stator windings of BLDCs are considered in this study. A total of 10 stator samples from a production line are used as shown in TABLE 1. All stators are of the same model and have star-connected configurations. Stators 1 to 5 are categorized as being in normal condition and denoted as ''healthy'', whereas stators 6 to 10 contain various faults. Specifically, stators 6, 7, and 8 have a defective epoxy coating, and stators 9 and 10 have faults related to the welding process that happens before epoxy coating. Therefore, stators 9 and 10 have no epoxy on their hairpin windings. Figure 1 shows two stator samples with and without epoxy coating. A galvanostatic test was applied to all stators to obtain impedance measurements. The experimental connection setup is illustrated in Fig. 2. The terminal of one phase winding and the neutral point are connected with a Gamry instrument to measure the impedance data for one specific phase winding within stators. The Gamry instrument applies four-terminal sensing to minimize errors.
In each measurement, four pieces of complex impedance information are recorded, including resistance, reactance, magnitude, and phase angle. Resistance and reactance describe complex impedance in the Cartesian coordinate system, whereas magnitude and phase angles are in the polar coordinate system.
For the high-frequency measurement in each phase winding of stators, there are 171 excitation frequencies covering from 20 kHz to 1 MHz. Each high-frequency measurement data has a shape of (171, 4). Three phase winding measurements are conducted within one stator and a total of 30 phase winding data are available. Figure 3 shows the measurement data of phase winding 2 within ten stators as an example. Other phase winding measurements show a similar trend. For the high-frequency measurement of the range from 20 kHz to 1MHz, healthy stators are plotted with solid lines whereas faulty stators are presented with dashed lines. Both magnitudes and phase angles against excitation frequencies are shown. It is clear in Fig. 3 that stators without epoxy (stators 9 and 10, presented as red and black dashed lines) exhibit significantly different patterns from other stators with epoxy (stators 1-8). Stators 9 and 10 possess higher impedance magnitudes and exhibit peak magnitudes at higher frequencies. This phenomenon shows that epoxy plays a critical role in the impedance behaviors of hairpin windings. The high-frequency impedance measurement can be a promising indicator for epoxy faults. At the same time, faulty stators with epoxy (stators 6, 7 and 8) show little discrepancies against healthy stators. The variation is insignificant and hard to be visually observed.
These impedance measurements are further processed to extract features for fault detection. The following sections first investigate the two welding faults, and then study the insulation faults.

IV. SIMILARITY INDICATORS FOR WELDING FAULT DETECTION
Welding faults are one of the main fault sources within stators. Due to the complexity and instability of laser welding, welding defects and faults are prone to occur during the process, like pores, spatters, craters, and inefficient welding depth [13], [23]. Currently, visual inspection applied in the manufacturing line is prone to human error and can be inefficient. This section proposes a similarity indicator for welding fault detection.
In this section, stators 9 and 10 are the main targets since faults within these two stators are related to the welding process. Stators 9 and 10 have different epoxy configurations from the other stators, so it is not reasonable to compare them side by side. Instead, a comparison between three phase windings within one specific stator is conducted for stators 9 and 10. By comparison of three phase winding characteristics, healthy phase windings can be identified whereas faulty phase windings are diagnosed and located.

A. OPEN CIRCUIT FAULT
An open circuit is a common welding defect. An example is shown in Fig. 4, where a welding point is damaged by an accident. The high-frequency (20 kHz-1MHz) impedance behaviors of the three phase windings are plotted in Fig. 5. It is hard to see any difference among them. However, distinct patterns are shown when measuring the low-frequency impedance. In Fig. 6, impedance behaviors of three phase windings in the low-frequency range from 1 Hz to 20 kHz are presented. Phase winding 1 shows distinct differences compared to the other two phase windings. Meanwhile, phase windings 2 and 3 still present consistent patterns. Therefore, phase windings 2 and 3 are assumed as healthy phase windings and can be set as the baseline for fault detection within stator 10. The impedance magnitude of phase winding 1 is larger under frequencies of 100 Hz whereas the phase angle of phase winding 1 is smaller under 1 kHz. Phase winding 1 presents larger resistance characteristics compared to the other two phase windings. It can be concluded that phase winding 1 is faulty.  With measurements in the low-frequency range, open circuit faults can be visually diagnosed. This fault presents distinct patterns in the low-frequency range while maintaining similar behaviors in the high-frequency range. This is because open circuit faults mainly affect the resistance part of the impedance behaviors. Though the variation in the high-frequency range is difficult to observe virtually, the proposed similarity indicator shows a discriminant, as presented later in this section.

B. WELDING MISMATCH FAULT
Welding mismatch is another welding fault that occurs during manufacturing. Fig. 7 shows an example of mismatched welding. The two terminal sticks are only welded at the top point, reducing the contact area between the two parts. Such faults can be identified by visual inspection, but are prone to human error. Fig. 8 shows high-frequency impedance measurement plots for three phase windings of stator 9. No distinct discrepancies can be observed. Also the behaviors in the low-frequency range remain consistent between the three phase windings. To discriminate these insignificant distinctions, a similarity indicator is proposed in Subsection D.

C. DATA PREPROCESSING
To facilitate downstream processing and reduce the effect of different data scales, preprocessing techniques are applied to the measurement data first. These mainly include transformations and normalizations as follows.
Before implementing detection algorithms, measurement data needs to be transformed into a representation that is suitable for downstream steps. Each original measurement with a size of (171, 4) is reshaped as a new form of (1, 684), squeezing to one row, and concatenating to 171 × 4 columns. Since a total of 30 phase winding samples are available, these 30 measurement data are stacked in rows, presenting a shape of (30, 684) for next-step processing. Each row represents one phase winding measurement. The corresponding labels in Table 1 are added to each row of phase winding data.
To reduce the impacts of different data scales, normalization [24], [25] is then applied. This converts data into a common scale. Normalization is found to improve algorithms' performance and maintain numerical stability in this study. Normalization is achieved by computing the z-score [26] wherex is the mean and S is the standard deviation of samples.
After these preprocessing steps, measurement data are ready for processing and analyzing.

D. SIMILARITY INDICATORS
Based on the previous analysis, it appears that the difference between phase windings reveals distinct features for the welding fault condition. To represent such features numerically, this study proposes a similarity indicator to compare the similarities between phase windings within one stator.
This study employs Euclidean distance [27], [28] to construct similarity indicators. Euclidean distance measures the distance between two points in a multi-dimensional space. It is a simple and efficient method to compare the similarities between two objects. A small Euclidean distance presents a higher similarity whereas a large distance indicates a lower similarity. This metric can measure the similarity between data points and cluster data points.
The Euclidean distance d can be calculated as: where x and y are two phase winding measurements after preprocessing, each having a size of (1, 684); n is the number of dimensions, equal to 684; and x k and y k present the k th dimension value of x and y.
Since there are three phase windings within one stator, three Euclidean distances can be calculated, as shown in Table 2. This produces three similarity indicators d 1 , d 2 , and d 3 . In this method, a threshold is established to evaluate similarity indicators, extracting feature patterns related to fault conditions. The maximum value of these similarity indicators within healthy stators is referenced as the threshold. By comparing similarity indicators with the healthy threshold, stator fault conditions can be determined.
Though healthy stators possess epoxy coating that is different from stators 9 and 10, they still exhibit some commonalities within healthy stators, like the relative consistency and stability between phase winding characteristics. The similarity of phase windings within healthy stators contributes to the small variation in the measurement and the Euclidean distance indicators change within a small range. The proposed threshold may be different from the true threshold of healthy samples without epoxy, however it is still reasonable to be used as a reference.  It is clear that Euclidean distance indicators within stator 9 are far beyond the threshold. Therefore, it is safe to conclude that stator 9 possesses a fault. Meanwhile, d 1 and d 2 indicator values are much higher than the threshold whereas d 3 is within the reasonable range. This indicates that phase winding 1 in stator 9 is totally distinct from phase windings 2 and 3, based on the indicator definition in Table 2. Thus, it can be concluded that the fault is located in phase winding 1, which is consistent with the inspected fault location.

E. EVALUATION RESULTS
Similarly, stator 10's indicators show a similar trend to stator 9, indicating that phase winding 1 is faulty at a high level of probability. This result is consistent with the visual observation of open circuit faults in Section IV-A.
The proposed similarity indicators effectively detect both open circuit and welding mismatch faults and successfully locate faulty phase windings.
In Fig.9, the indicators of faulty stators with epoxy (stators 6-8) are close to the threshold. The difference amongst the three indicators is also indistinctive. Therefore, advanced machine learning algorithms are introduced in the next section to detect such faults.

V. MACHINE LEARNING FOR INSULATION FAULT DETECTION
Epoxy provides insulation for the windings to prevent short circuits or arcing from adjacent coils [29] and increases thermal characteristics [30]. Voids, cracks or other defects during the epoxy manufacturing process can contribute to the aging or degradation of insulation under electrical and thermal stresses, leading to motor failure. Faults related to epoxy defects are defined as insulation faults. Stators 6, 7 and 8 are categorized as this fault. To distinguish such faults, machine learning algorithms are applied for diagnosis in this section.

A. DATA VISUALIZATION
With data preprocessing in Section IV-C, all measurement data are preprocessed and have a shape of (30,684). To visualize this high-dimensional data, t-Distributed Stochastic Neighbor Embedding (t-SNE) is applied [31]. t-SNE maps the data from high dimensions to a two-dimension space. Data samples with similar patterns are concentrated whereas others show sparse distant points. Kullback-Leibler divergence is checked for updates in each iteration [32]. Figure 10 shows the t-SNE of all 30 stator measurements. Healthy and two faulty conditions are highlighted with different colors. It is clear that stators with welding faults (stators 9 and 10, without epoxy) have distinct distances compared to other stators. Epoxy-related faulty stators (stators 6, 7 and 8) form a cluster and are close to healthy stators. With the help of coloring, the boundary between healthy and epoxy fault stators is clear and there is no overlap. However, it is impossible to draw a boundary without prior knowledge about data labels.
Principal Component Analysis (PCA) [33] is also applied to this dataset. PCA transforms the data such that the most relevant features are ranked higher. Its results are more consistent than t-SNE. The first two dimensions of principal component features are shown in Fig. 11. Similar to the results of t-SNE, clear boundaries exist between different categories of stators. Welding faults can be readily identified as a separate cluster, whereas epoxy faults and healthy ones are close but not overlapping.

B. DETECTION ALGORITHM
With clues in both t-SNE and PCA, a machine-learning algorithm is selected for classification. Through the analysis in the previous subsection, data labels play a key role in boundary establishment. Therefore, supervised learning algorithms are selected in this study.
This study finds that Support Vector Machine (SVM) [34], [35], [36] is suitable for this problem. SVM employs a hyperplane to perform binary separation. It is well suited for non-linear and multi-class classification.
Since welding faults are already detected in Section IV and this section focuses on insulation faults, stators 9 and 10 data are not included in this section. With the preprocessing mentioned in Section IV-C, the measurement data is reshaped and  normalized. Each sample data has a shape of (1, 684) and is input to the SVM for classification.
The SVM applied in this study is called C-Support Vector Classification [37]. It achieves classification by minimizing the following target function.
where w is the weight vector of the hyperplane; b is the bias term; C is the regularization parameter; ζ is the value of the misclassification; x i is the i th data point; n is the number of data points. With labeled data, the SVM is trained to reveal the underlying pattern and relationship of the data. It uses Eq. (3) to maximize the margin between classes by minimizing ∥w∥ 2 2 and define the parameters of the hyperplane. After training, the SVM applies the established hyperplane to predict the classes for the unseen testing data.

C. EVALUATION RESULTS
To evaluate this supervised learning method, the available data is split into training and testing sets. Training data are used to find optimal SVM parameters, and testing data are used to produce evaluation results.
Faulty stator classification is always of the most concern since faulty samples are rare in a mature production line. If representative features are not effectively extracted, the model is prone to misclassification. To simulate different scenarios, two experiments are conducted. Experiment I represents a rigorous setup where only one stator is used for training (three phase winding samples) in the faulty with epoxy class. Experiment II simulates scenarios where limited but sufficient faulty training samples are available, and two faulty stators are selected for training (six phase winding samples). The specific data splits are detailed in TABLE 3. To simulate a realistic scenario, the samples under one category (training or testing) in both classes always come from the same stators.
Cross-validation is applied to estimate the performance of the machine learning method. The specific setup is presented in TABLE 4. During each evaluation, the healthy class setup always keeps consistent where three arbitrary stators (nine phase winding samples) are selected for training and the other two stators (six phase winding samples) are used for testing. Faulty class varies in each experiment. In Experiment I, only one faulty stator is applied for training whereas Experiment II has two faulty stators for training. In each cross-validation setup, 1000 training-evaluation cycles are conducted to reduce the effect of training randomness. The table shows the average test accuracy for each cross-validation setup as well as the overall accuracy for the whole experiment.
In Experiment I, the test accuracy for different cross-validation setups is 100%, 95% and 89% separately. This shows only one faulty stator for training cannot extract all the features of the faulty stators, leading to some misclassification. Despite such a rigorous condition, the overall classification can still achieve a high accuracy of 94.7%.
In Experiment II, all the cross-validation setups' accuracy achieves 100% when two faulty stators are used for training. With sufficient faulty samples, the proposed machine learning model can effectively extract the features of faulty stators and successfully classify both healthy and faulty stators.
These results indicate that the SVM model using impedance features can achieve high detection accuracy with a minimal amount of faulty data. This is likely attributed to the fact that healthy and faulty clusters are non-overlapping as discussed in Section V-A, and thus a clear boundary can be established effectively. In a production environment, these experiments have practical implications since it may be difficult to gather a large number of faulty stators.

VI. CONCLUSION
In this study, a signal-based methodology for fault detection within hairpin windings of stators is proposed. Using impedance measurements of three phase windings, both welding faults and insulation faults are effectively diagnosed by employing versatile techniques.
In particular, the proposed similarity indicators can successfully detect abnormal stators and locate faulty phase windings with welding fault conditions. The computational cost of indicators is negligible. Additionally, a machine learning-based method can further classify insulation faults that are difficult to distinguish using similarity indicators. These proposed methodologies show promising results and a high potential for improving quality assurance and reducing maintenance costs.
Future works will investigate hybrid fault detection strategies integrating both model-based and data-driven methods, in addition to this pure data-driven method, with an objective to improve detection accuracy and robustness. Another research direction will explore the similarity indicator more to reveal the severity of faults.
[37] C.-C. Chang  YOUSSEF ZIADA is currently the Battery Electrode Production and Cell Assembly Leader of Ford Motor Company for the BlueOval SK joint venture. In this capacity and previous industry 4.0 roles, he has pursued a range of research projects in automotive manufacturing. His research interests include rapid characterization and fault detection in battery and e-motor manufacturing, predictive maintenance and physics-based AI modeling of machine tools and production equipment, and digital twins (live and static) for production systems.
SAEID HABIBI (Member, IEEE) is currently a Professor and the former Chair of the Department of Mechanical Engineering, McMaster University, and holds the Senior Industrial Research Chair of Hybrid Technologies sponsored by NSERC and Ford Canada. His research interests include intelligent control, state and parameter estimation, fault diagnosis and prediction, variable structure systems (VSS), actuation systems, mechatronics, and fluid power. Application areas include automotive, aerospace, water distribution, and robotics. He developed the smooth variable structure filter (SVSF) theory, which is a predictor-corrector model-based state estimation strategy that guarantees stability and allows extraction of a higher degree of information from characteristics make SVSF exceptionally suitable for advanced control and vehicle tracking, prognostics, and health monitoring in automotive systems.