Creepage Distance Estimation of Hairpin Stators Using 3D Feature Extraction

: The increasing demand for electric drives challenges conventional powertrain designs and requires new technologies to increase production efﬁciency. Hairpin stator manufacturing technology enables full automation, and quality control within the process is particularly important for increasing the process capacity, avoiding rejects and for safety-related aspects. Due to the complex, free-form geometries of hairpin stators and the required short inspection times, inline reconstruction and accurate quantiﬁcation of relevant features is of particular importance. In this study, we propose a novel method to estimate the creepage distance, a feature that is crucial regarding the safety standards of hairpin stators and that could be determined neither automatically nor accurately until now. The data acquisition is based on fringe projection proﬁlometry and a robot positioning system for a highly complete surface reconstruction. After alignment, the wire pairs are density-based clustered so that computations can be parallelized for each cluster, and an analysis of partial geometries is enabled. In several further steps, stripping edges are segmented automatically using a novel approach of spatially asymmetric windowed local surface normal variation, and the creepage distances are subsequently estimated using a geodesic path algorithm. Finally, the approach is examined and discussed for an entire stator, and a methodology is presented that enables the identiﬁcation of implausible estimated creepage distances.


Introduction
The trend of a steadily increasing number of electric vehicles (EV) sold has been observed in global sales for more than ten years. According to [1], the number of EVs amounts to 145 million until 2030 if the extrapolation is based on current policies. Therefore, the continuous development of electrical power train solutions, in particular, is crucial. Electrical engines basically comprise two components, a rotor and a stator, whereas the stator significantly impacts the value chain [2]. The hairpin technology proposes a promising manufacturing technology that replaces thin copper wires in stator winding by massive flat stiff coils [3].
In contrast to conventional winding technology, hairpin winding offers the ability for a higher automation degree in manufacturing. Additionally, due to the usage of methods that are considered to be well researched, such as welding and forming, a better process stability is feasible [4][5][6]. According to [7], the process chain differentiates the number of process steps with regard to the applied technologies. Particularly for contacting the wires and forming the pins to its determined shape, multiple technologies are deployed, where the selection is mainly pendent on the consumers requirements [8].
Apart from process advantages, which result mainly in a higher reachable automation degree, hairpin stators come with some notable technical advantages [6]. Compared to random winding, the usage of hairpin winding improves the overall space efficiency. The geometry enables higher slot fill factors that increase the maximum reachable torque as well as the overall power [6,9,10]. Additionally, cooling is improved because of larger contact areas [5,9]. Apart from the mentioned technical advantages, increasing alternating current losses can be observed in hairpin technology, which limits the overall efficiency.
Approaches to overcome this issue as well as challenges with regard to automated forming and welding are further discussed in [11]. These circumstances and the fact of having a complex process chain result in high demands regarding the quality aspects within each manufacturing step. This creates the need for extensive quality assurance. The creepage distance, which this study significantly contributes to determining, is described as the shortest distance along the surface of a solid insulating material between two conductors at different voltage potentials [12]. The creepage distance is similar to the shortest distance in air between two conductors of different potential, and this is defined as the clearance distance.
To prevent surface flashover or insulation breakdown, both of these features must not fall below the required and prescribed limits depending on the application [12]. In the field of electrical drives, specified requirements need to be ensured, e.g., to prevent parts from explosion [12,13]. Hence, these features are safety relevant; the precise measurement is crucial but has not been integrated within an automatic assurance procedure yet. Thus, further development and design processes of hairpin stators can be improved by an accurate estimation of geometric features, integrating appropriate methods for determining these will be relevant for several manufacturing companies.
The inspection with tactile measurement devices is limited due to the geometry of the hairpin stators. With the advantages of a short inspection time and an increasing resolution in 3D reconstruction, optical measurement systems based on fringe projection profilometry are becoming widely used for inspection applications in production technology [14] and are also used in the proposed approach. Within this study, a novel method is presented in order to estimate the creepage distance based on meshed 3D data. Furthermore, the approach offers the feasibility for a simple integration within the inspection cycle that results in a higher efficiency within the automated inspection during manufacturing.

State of the Art
In the following, a brief overview of relevant processes in hairpin manufacturing is provided as well as image-based approaches for quality assurance along the process chain. The manufacturing procedure basically requires a stator core for further assembly comprising stamping sheet metals that are interlocked afterward [15].

Hairpin Stator Manufacturing
According to [7], the process chain of hairpin stator manufacturing can be differentiated in five steps as visualised in Figure 1. First, the hairpins are processed utilizing different techniques from sheet-forming technology to produce the shape that has been developed within a previous design process. Depending on the design, different shapes of wires are used for stator manufacturing, which includes, for instance, straight bars that are described as I-Pins [16].
After the geometry of the wires has been defined, the positioning is conducted within a pre-assembly process according to a specified scheme. Subsequently, the hairpins are inserted into the stator core using high forces [7]. After inserting the wires, the axial position is determined. In the following twisting process, defined forces are used to twist the wires cross-sections and to obtain the required tangential position. Therefore, the final position is defined, and the ends of the intended wire pairs can be contacted by multiple welding technologies [7]. Glaessel et al. described different welding technologies and emphasized the importance of a proper removal of the insulation material [17].
Thus, it is of importance, on the one hand, not to reduce conductive material along the cross-section of the wire and, on the other hand, to assure that no insulation material remains in the joining area. According to [17], laser beam welding features some advantages in contrast to established technologies, such as resistance welding or ultrasonic welding. Furthermore, Glaessel et al. proposed the application of infrared lasers with a small focus as a promising technology [17]. In a following processing step, the wires as well as the stator are impregnated to meet the requirements regarding the insulation characteristics that are also evaluated in the final testing procedure [7,15,17].

Image-Based Quality Assurance in Hairpin Manufacturing
Single processes linked to the process chain in hairpin manufacturing have been the subject of intense research. Due to a high number of wires that need to be connected, the welding process features an integral role in hairpin stator manufacturing [18]. In [19], an image-based approach using a neural network architecture was evaluated for in-process monitoring of laser-based weld seams of hairpin stators. Mayr et al. [20] proposed a comparable approach for estimating the quality of the cross-section in contacting, and they used pre-trained neural network architectures to classify the images.
A method that ensures quality monitoring within bending processes was described in [5]. In contrast, Mayr et al. utilized three dimensional data instead of 2D images and performed the data processing based on machine-learning methods. In [21], Vater et al. proposed an approach that processes 3D data that is conducted within hairpin manufacturing and applied for error classification in the laser welding process. It can be observed that some approaches apply 2D data instead of 3D data, which is mainly due to higher costs of 3D scanners.
In contrast, 3D scanning achieves higher inspection stability as well as the advantage of taking height information, which is crucial for reconstructing certain geometries [22]. Extracting features out of 3D data constitutes a wide field of research, which is linked to many different use-cases. Due to an increasing development and cost reduction of surface-probing technologies and 3D scanning, an increasing demand for appropriate 3D data processing has been observed [23].

3D Feature Extraction and Product Metrology
Previous research analysed the performance and revealed the advantages of optical 3D metrology in different applications [14,24,25], and active vision sensors using an additional light source are particularly widespread due to improved robustness and accuracy [26]. Therefore, the development of 3D processing and spatial feature extraction algorithms is crucial. Li et al. [27] introduced an early reverse engineering approach that used 3D reconstruction for modelling parts and subsequently derived tool paths to improve the efficiency in repair processes of worn mechanical parts.
Wang et al. [28] also proposed an approach for robotic path planning based on feature extraction. Using 3D reconstruction, parental surfaces were created after segmentation and B-spline modelling. Recent measurement data were superimposed with the parental surfaces, which led to an improved computation time. In a second iteration of the featureguided trajectory approach, Feng et al. [26] additionally proposed a refining process that comprises outlier separation based on a nearest neighbour analysis (Kd-tree) and void filling. Achieving maximum root mean squared errors less than 0.7 mm, even the computational time was improved by approximately 65% compared to the reverse engineering approach mentioned.
In defect analysis and classification on 3D printed surfaces, Zhao et al. [29] proposed an approach that introduces a novel feature descriptor to statistically evaluate the local topological information. The feature descriptor considers the results of normal differences in the neighbourhood of the keypoints in combination with a rotation projection statistic feature descriptor.
The state of the art emphasizes that quality assurance plays an essential role in the automation of the process chain in hairpin production. It can be observed that many related approaches apply 2D image data instead of 3D data; however, the importance of appropriate 3D data processing continues to increase. However, some exemplary research activities have shown promising developments in raising the robustness and computational efficiency for feature extraction and the processing of spatial data in different applications. This research contributes to the deployment of spatial feature extraction within the automated quality assurance in hairpin manufacturing to enable accurate determination of the safety-relevant creepage distance.

Problem Definition
In Figure 2, an exemplary hairpin winding is visualised in detail. The isolation edge can be observed in the highlighted areas, which feature the transition from insulating to noninsulating material on the wires surface. The challenge of estimating the creepage distance d cd automatically and accurately constitutes the main work of this study. Even under ideal conditions, to date, no approaches are available that go beyond simple estimation procedures and allow for robust implementation in the context of automated production measurement technology. The following section describes and evaluates a novel method to extract the relevant areas out of three dimensional data to quantify the creepage distance.
Metrology 2023, 1 4 In defect analysis and classification on 3D printed surfaces, Zhao et al. [29] proposed an approach that introduces a novel feature descriptor to statistically evaluate the local topological information. The feature descriptor considers the results of normal differences in the neighbourhood of the keypoints in combination with a rotation projection statistic feature descriptor.
The state of the art emphasizes that quality assurance plays an essential role in the automation of the process chain in hairpin production. It can be observed that many related approaches apply 2D image data instead of 3D data; however, the importance of appropriate 3D data processing continues to increase. However, some exemplary research activities have shown promising developments in raising the robustness and computational efficiency for feature extraction and the processing of spatial data in different applications. This research contributes to the deployment of spatial feature extraction within the automated quality assurance in hairpin manufacturing to enable accurate determination of the safety-relevant creepage distance.

Problem Definition
In Figure 2, an exemplary hairpin winding is visualised in detail. The isolation edge can be observed in the highlighted areas, which feature the transition from insulating to noninsulating material on the wires surface. The challenge of estimating the creepage distance d cd automatically and accurately constitutes the main work of this study. Even under ideal conditions, to date, no approaches are available that go beyond simple estimation procedures and allow for robust implementation in the context of automated production measurement technology. The following section describes and evaluates a novel method to extract the relevant areas out of three dimensional data to quantify the creepage distance.

Experimental Setup
The data used in the following were acquired with a robot cell supplied by GOM GmbH (Braunschweig, Germany). The utilised measurement system is described as ATOS ScanBox and comprises a six-axis jointed-arm robot (ARC Mate 120iC) by FANUC K.K. (Oshina, Japan) with an optical sensor that is mounted at the robots end effector. A GOM ATOS 5 3D-scanner was applied and is based on fringe projection profilometry to reconstruct 3D geometries. The specifications of the utilized robot kinematics as well as the applied fringe projection sensor are listed in Table 1.
Additionally, a rotation table is located inside the cell to realize an improved orientation of the inspection parts. As a result, the data are epresented as a meshed 3D point cloud and stored in .STL-files. For a more detailed overview on the application of fringe projection metrology at various scales within production metrology, a comprehensive assessment is provided in [14].Within the scope of this study, different types of hairpin stators were inspected and reconstructed. The dimensions as well as specifications in terms of the power differentiated depending on the stator type. The proposed approach was evaluated using one specific stator type. For these initial investigations, and to develop the algorithmic pipeline, an automated measurement routine was programmed using the Inspect-Software from GOM. The implemented routine attempts to capture the specimen as well as possible since a hairpin stator features complex geometry, which requires multiple measurement poses. However, for better integration into the production process and higher reconstruction accuracies, other instruments and measurement approaches are also conceivable. The overall measurement duration amounts to a few minutes.

Data Processing
The main data processing steps for determining the creepage distance are visualized in Figure 3 and mainly comprise data alignment based on manually assigned initial points and subsequent division into clusters, each corresponding to a pair of wires. The clusters are processed individually for determining the stripping edge, which is based on a local surface normal variation. For accurate results in regard to spatial windowing, a polygonal resampling is applied to transform the mesh into a point cloud with uniform point density. Subsequently, the creepage distance is determined as the geodesic distance of the neighbouring stripping edge points on the mesh for each cluster.

Data Alignment
The reconstructed 3D mesh Ω = {v, f } of the geometry comprises vertices v ∈ R 3×V and faces f ∈ N 3×F 1 . The latter are stored in the form of a connectivity list for all respective polygons. The overall approach is based on clustering corresponding pairs of wires to subsequently analyse every clustered pair itself. Subsequently, the isolation edge is segmented so that the shortest distance between the two conductors can be estimated. An overview of the procedure for processing the 3D data is visualised in Figure 3. The reconstructed mesh is aligned within a coordinate frame. In an initial implementation, this is performed via a two-step alignment process, which may be redundant in later automation due to fully identified kinematic relationships along with minor numerical corrections.
Let pc s,1 = R 3×M be a set of points that are manually selected (M ≥ 3) via a graphical user interface and that are located in the base plane of the reconstructed mesh. This is visualized in Figure 4a with red points, into which a plane is subsequently fitted via a least-squares approach [32]. Additionally, the deviations of all vertices in the plane normal direction d p ∈ R V are calculated. The subset of all plane points with the maximum point-plane normal distance d c is then used in the following for the optimization of the unknown rigid-body transformation T p ∈ SO (3):

Data Alignment
The reconstructed 3D mesh Ω = {v, f } of the geometry comprises vertices v ∈ R 3×V and faces f ∈ N 3×F 1 . The latter are stored in the form of a connectivity list for all respective polygons. The overall approach is based on clustering corresponding pairs of wires to subsequently analyse every clustered pair itself. Subsequently, the isolation edge is segmented so that the shortest distance between the two conductors can be estimated. An overview of the procedure for processing the 3D data is visualised in Figure 3. The reconstructed mesh is aligned within a coordinate frame. In an initial implementation, this is performed via a two-step alignment process, which may be redundant in later automation due to fully identified kinematic relationships along with minor numerical corrections.
Let pc s,1 = R 3×M be a set of points that are manually selected (M ≥ 3) via a graphical user interface and that are located in the base plane of the reconstructed mesh. This is visualized in Figure 4a with red points, into which a plane is subsequently fitted via a Due to numerical considerations, the quaternion convention is used for the optimization of the rotational component, since it performs well and converges fast [33]. The non-linear Levenberg-Marquardt algorithm is applied as a solver [34][35][36].
In a second step, on the basis of additional manually assigned points pc s,2 = R 3×N , N ≥ 6 (green points as per Figure 4b), a circle is then fitted into the point clouds on a geometric circumference using a least-squares approach [32] {c s,x , c s,y } = arg min based on the vertex-cylinder distance d s ∈ R V . The aligned point cloud, subsequently centred around {c x , c y }, is further separated into different segments for subsequent cluster analysis with fixed geometric thresholds based on the polar coordinate representation with regard to the radius and z-component. In a second step, on the basis of additional manually assigned points pc s,2 = R 3×N , N ≥ 6 (green points as per Figure 5b), a circle is then fitted into the point clouds on a geometric circumference using a least-squares approach [32] {c s,x , c s,y } = arg min based on the vertex-cylinder distance d s ∈ R V . The aligned point cloud, subsequently centred around {c x , c y }, is further separated into different segments for subsequent cluster analysis with fixed geometric thresholds based on the polar coordinate representation with regard to the radius and z-component.  In a second step, on the basis of additional manually assigned points pc s,2 = R 3×N , N ≥ 6 (green points as per Figure 4b), a circle is then fitted into the point clouds on a geometric circumference using a least-squares approach [32] {c s,x , c s,y } = arg min based on the vertex-cylinder distance d s ∈ R V . The aligned point cloud, subsequently centred around {c x , c y }, is further separated into different segments for subsequent cluster analysis with fixed geometric thresholds based on the polar coordinate representation with regard to the radius and z-component.
For clustering the wires into corresponding pairs, the dbscan density-based clustering algorithm [37] is applied. Figure 5 shows the division into K clusters, which are processed individually in the For clustering the wires into corresponding pairs, the dbscan density-based clustering algorithm [37] is applied. Figure 6 shows the division into K clusters, which are processed individually in the following to estimate the corresponding vertices of the stripping edges for the determination of the creepage distance as accurately as possible. First, a reduced mesh Ω k ∈ Ω = {v k , f k } is derived via a rangesearch based on the fast k-d search tree [38,39] with respect to the Euclidean distance in the XY plane, and the polygon-based normal vectors n k ∈ R 3×F k are extracted according to Figure 7.

Cluster Analysis
Using the shortest Euclidean distance with respect to the polygon normal vectors and the z-axis For clustering the wires into corresponding pairs, the dbscan density-based clustering algorithm [37] is applied. Figure 5 shows the division into K clusters, which are processed individually in the following to estimate the corresponding vertices of the stripping edges for the determination of the creepage distance as accurately as possible. First, a reduced mesh Ω k ∈ Ω = {v k , f k } is derived via a rangesearch based on the fast k-d search tree [38,39] with respect to the Euclidean distance in the XY plane, and the polygon-based normal vectors n k ∈ R 3×F k are extracted according to Figure 6.

Cluster Analysis
Using the shortest Euclidean distance with respect to the polygon normal vectors and the z-axis the mesh is adjusted for polygons that do not point towards the z-axis: In this case, a threshold of d l,t = 40 mm is selected. Based on the inlier vertices, the reduced mesh Ω k,in = {v k,in , f k,in } with face normals n k,in is generated according to Figure 7a. For subsequent calculations, it is essential to generate a point cloud pc k = {pc k,x , pc k,y , pc k,z} ∈ R 3×P with a relatively homogeneous local point density, which, accordingly, cannot be based on the simple vertices v k,in due to strongly varying polygon sizes. Therefore, random samples are generated in dependence of the polygon size according to the approach of Osada et al. [40], which was further developed in [41,42]. The result is shown in Figure 7b. For the localization of the stripping edge, the local normal variation is calculated, where ∪ {pc k,x,j − pc k,x,p , pc k,y,j − pc k,y,p } 2 ≤ d t,2 , ∀ p = 1, · · · , P} represents the indices of all neighbour points with respect to pc k within the cylindersphere intersection defined by d t,1 = 1 mm and d t,2 = 0.2 mm. Additional windowing is subsequently performed via spherical distance weighting: Metrology 2023, 1 8 is calculated, where ∪ {pc k,x,j − pc k,x,p , pc k,y,j − pc k,y,p } 2 ≤ d t,2 , ∀ p = 1, · · · , P} represents the indices of all neighbour points with respect to pc k within the cylindersphere intersection defined by d t,1 = 1 mm and d t,2 = 0.2 mm. Additional windowing is subsequently performed via spherical distance weighting: The results are shown in Figure 7c. Subsequently, the sum or the median N med (p z ) = median(N var,k (ι N (p z ))) (11) of all normal variations N var with regard to the vertical position p z ∈ [40, 60] is determined.
representing the indices of neighbouring points within regard to their vertical position and threshold d t,3 = 2 mm. The normalized results are depicted in Figure 8. The results are shown in Figure 7c. Subsequently, the sum or the median N med (p z ) = median(N var,k (ι N (p z ))) (11) of all normal variations N var with regard to the vertical position p z ∈ [40, 60] is determined.
representing the indices of neighbouring points within regard to their vertical position and threshold d t,3 = 2 mm. The normalized results are depicted in Figure 8.
In principle, similar characteristics ofN sum andN med can be observed, with the median likely being more robust with respect to strongly fluctuating numbers of points within the local neighbourhood. Although this did not occur in the experiment, it is conceivable with respect to the polygon masking according toN var . For the identification of the stripping edge within mesh Ω k , it is necessary to find neighbouring vertices with respect to the global maximum ofN sum orN med . Since neighbouring vertices v k,in feature a certain distance to a mesh-plane intersection at a respective height, lower and upper limits are defined via the normalized distanceN t = 0.95, which is represented in Figure 8.
Metrology 2023, 1 9 In principle, similar characteristics ofN sum andN med can be observed, with the median likely being more robust with respect to strongly fluctuating numbers of points within the local neighbourhood. Although this did not occur in the experiment, it is conceivable with respect to the polygon masking according toN var . For the identification of the stripping edge within mesh Ω k , it is necessary to find neighbouring vertices with respect to the global maximum ofN sum orN med . Since neighbouring vertices v k,in feature a certain distance to a mesh-plane intersection at a respective height, lower and upper limits are defined via the normalized distanceN t = 0.95, which is represented in Figure 8.     The resulting mesh Ω k,r ∈ Ω k is further modified by triangle subdivision refinement until a sufficient number of vertices is close enough to the mean heightN mean (red according to Figure 9), respectively, and the overall maximum polygon area is reached. This is shown in Figure 9b by the black, refined mesh Ω k,r,f , which is incorporated in an updated mesh The resulting mesh Ω k,r ∈ Ω k is further modified by triangle subdivision refinement until a sufficient number of vertices is close enough to the mean heightN mean (red according to Figure 9), respectively, and the overall maximum polygon area is reached. This is shown in Figure 9b by the black, refined mesh Ω k,r,f , which is incorporated in an updated mesh Ω f = {(Ω ∩ Ω 1,r ) ∪ Ω 1,r,f , · · · , (Ω ∩ Ω K,r ) ∪ Ω K,r,f } = {v f , f f }.

Determination of the Creepage Distance
With the edge cutoff distance d edge = 0.2 mm, the subset of all corresponding edge vertices is extracted. Subsequently, the centroid in the XY plane is determined for each cluster edge vertex set v k,edge , and the corresponding neighbour clusters are identified via 2-NN search. This determines the corresponding clusters within the mesh that may be affected by creepage currents. For determination of the creepage

Determination of the Creepage Distance
With the edge cutoff distance d edge = 0.2 mm, the subset of all corresponding edge vertices is extracted. Subsequently, the centroid in the XY plane is determined for each cluster edge vertex set v k,edge , and the corresponding neighbour clusters are identified via 2-NN search. This determines the corresponding clusters within the mesh that may be affected by creepage currents. For determination of the creepage distance d cd ∈ R |v k,edge | , the geodesic distance on the mesh is calculated on the basis of the Graph toolbox of Peyre [43], which is used with few modifications and features functions to be locally compiled for optimized runtime. The process is visualized in Figure 10 for a pair of wires, where, initially, the fast marching mesh front propagation [44] is used to determine the distance function D for all starting points (green) followed by the estimation of the geodesic distance [45], which is visualized with black curves. For further computational acceleration, the number of edge vertex correspondences to be computed is reduced via further neighbourhood classifications and rangesearch operations, and the mesh is trimmed for each search operation (refer Figure 10), which, however, is not further elaborated here. In total, the computation time amounts to about 20 min with about 2.4 million polygons and 12,500 edge vertices (start resp. end points). All data processing operations were implemented using MATLAB (The MathWorks, Inc., Natick, MA, USA). Further reductions of the processing time, for example, by more efficient vectorizations or GPU implementations, are feasible. All neighbourhood searches were based on the data structure of the fast k-d search tree [38], although more efficient search tree structures or queries are possible.

Results
The following section presents the results of the proposed method applied to the conducted measurements. After assessing the stripping edge, the creepage distance is estimated for the whole stator and is visualised in Figure 11a. In addition, Figure 11b shows the minimal values for the creepage distance that are further considered to assess the feature since they are more relevant when investigating the potential leakage current.
On closer inspection, at Figure 11b, one cluster exhibits an abnormally high creepage distance with d cd,min ≈ 32 mm. This observation motivated a further analysis to attempt to evaluate whether the assessed value for the feature represents an outlier or an inlier. One possible cause for excessive creepage distances is an incomplete mesh with many holes, which is likely due to faulty reconstruction during data acquisition, e.g., shading effects. Therefore, according to Figure 12a, the total number of geodetic edge vertices n ve of each cluster is examined. A low number of geodetic edge vertices indicates that either the stripping edge itself was incompletely reconstructed or, more likely, the geodetic path of all vertices corresponds to one or very few edge vertices of an adjacent stripping edge.
This may indicate that the mesh contains holes or other errors and that the path was presumably estimated as overly long. The results are shown in Figure 12, where the data For further computational acceleration, the number of edge vertex correspondences to be computed is reduced via further neighbourhood classifications and rangesearch operations, and the mesh is trimmed for each search operation (refer Figure 10), which, however, is not further elaborated here. In total, the computation time amounts to about 20 min with about 2.4 million polygons and 12,500 edge vertices (start resp. end points). All data processing operations were implemented using MATLAB (The MathWorks, Inc., Natick, MA, USA). Further reductions of the processing time, for example, by more efficient vectorizations or GPU implementations, are feasible. All neighbourhood searches were based on the data structure of the fast k-d search tree [38], although more efficient search tree structures or queries are possible.

Results
The following section presents the results of the proposed method applied to the conducted measurements. After assessing the stripping edge, the creepage distance is estimated for the whole stator and is visualised in Figure 11a. In addition, Figure 11b shows the minimal values for the creepage distance that are further considered to assess the feature since they are more relevant when investigating the potential leakage current.
On closer inspection, at Figure 11b, one cluster exhibits an abnormally high creepage distance with d cd,min ≈ 32 mm. This observation motivated a further analysis to attempt to evaluate whether the assessed value for the feature represents an outlier or an inlier. One possible cause for excessive creepage distances is an incomplete mesh with many holes, which is likely due to faulty reconstruction during data acquisition, e.g., shading effects. Therefore, according to Figure 12a, the total number of geodetic edge vertices n ve of each cluster is examined. A low number of geodetic edge vertices indicates that either the stripping edge itself was incompletely reconstructed or, more likely, the geodetic path of all vertices corresponds to one or very few edge vertices of an adjacent stripping edge.
This may indicate that the mesh contains holes or other errors and that the path was presumably estimated as overly long. The results are shown in Figure 12, where the data of the probable outlier are marked in orange. The supposed outlier is transferred to the creepage distance of all geodesic edge vertices d cd (Figure 12b) as well as the minimum creepage distance d cd,min of each cluster, according to Figure 12c. The results demonstrate that an estimation of plausible or implausibly determined creepage distances is feasible with this approach.
Metrology 2023, 1 12 stripping edge itself was incompletely reconstructed or, more likely, the geodetic path of all vertices corresponds to one or very few edge vertices of an adjacent stripping edge. This may indicate that the mesh contains holes or other errors and that the path was presumably estimated as overly long. The results are shown in Figure 12, where the data of the probable outlier are marked in orange. The supposed outlier is transferred to the creepage distance of all geodesic edge vertices d cd (Figure 12b) as well as the minimum creepage distance d cd,min of each cluster, according to Figure 12c. The results demonstrate that an estimation of plausible or implausibly determined creepage distances is feasible with this approach. stripping edge itself was incompletely reconstructed or, more likely, the geodetic path of all vertices corresponds to one or very few edge vertices of an adjacent stripping edge. This may indicate that the mesh contains holes or other errors and that the path was presumably estimated as overly long. The results are shown in Figure 12, where the data of the probable outlier are marked in orange. The supposed outlier is transferred to the creepage distance of all geodesic edge vertices d cd (Figure 12b) as well as the minimum creepage distance d cd,min of each cluster, according to Figure 12c. The results demonstrate that an estimation of plausible or implausibly determined creepage distances is feasible with this approach.
Metrology 2023, 1 12 stripping edge itself was incompletely reconstructed or, more likely, the geodetic path of all vertices corresponds to one or very few edge vertices of an adjacent stripping edge. This may indicate that the mesh contains holes or other errors and that the path was presumably estimated as overly long. The results are shown in Figure 12, where the data of the probable outlier are marked in orange. The supposed outlier is transferred to the creepage distance of all geodesic edge vertices d cd (Figure 12b) as well as the minimum creepage distance d cd,min of each cluster, according to Figure 12c. The results demonstrate that an estimation of plausible or implausibly determined creepage distances is feasible with this approach.

Discussion
The work conducted in this study and the results presented demonstrate that automated and accurate quantification of the creepage distance in electric motor stators is possible. For all clustered wire pairs, the creepage distance could be estimated. Although the vast majority of the results show comparable values representing the feature, an outlier can be observed by visually inspecting Figure 11b. This motivated the further analysis that is presented in Figure 12. To identify possible outliers only by interpreting Figure 12b,c seems challenging. However, the results evaluated in Figure 12a allow the outlier to be determined due to a very low number of vertices that are considered to estimate the creepage distance. Through combining with the previous results, the outliers can be neglected for further evaluation.
However, it should be noted that this approach requires a complete and seamlessly meshed surface model for precise estimation of the creepage distance. In the case of a faulty mesh, the creepage distance is estimated to be too long and, therefore, harmless from a safety point of view. Thus, it should be mentioned that, in its current form, even with the introduced outlier identification, the actual structure and condition of the mesh is not further evaluated. Further investigations and algorithmic improvements are, therefore, possible to improve the precision and robustness of the approach.
As there were no comparable solutions available on the market until now, the implementation leads to advantages within the quality assurance process and, in consequence, helps to improve the product quality. However, this also results in the inability to validate the approach and compare it with reference data.
The proposed method offers the ability for extensive evaluation of manufactured hairpin stators regarding absolute measurements of the creepage distance as well as the variance of the feature over each wire pair. Due to the fact that the length of the creepage distance influences the characteristics of the electrical machine [46], an increased precision in measuring the feature allows optimizations in the design process. Although other product features are evaluated within the supplied software of the measurement system producer, the proposed method has the feasibility for a simple integration within the automated inspection cycle. However, raising the efficiency in the quality assurance process and, furthermore, integrating novel approaches, which results in a higher precision of determining features, leads to great value for manufacturing companies.

Conclusions
Within this work, a novel approach was proposed to provide the estimation of the creepage distance of hairpin stators. Using a fringe projection sensor, the 3D-geometry was reconstructed for further processing. Multiple steps for data processing were used mainly

Discussion
The work conducted in this study and the results presented demonstrate that automated and accurate quantification of the creepage distance in electric motor stators is possible. For all clustered wire pairs, the creepage distance could be estimated. Although the vast majority of the results show comparable values representing the feature, an outlier can be observed by visually inspecting Figure 11b. This motivated the further analysis that is presented in Figure 12. To identify possible outliers only by interpreting Figure 12b,c seems challenging. However, the results evaluated in Figure 12a allow the outlier to be determined due to a very low number of vertices that are considered to estimate the creepage distance. Through combining with the previous results, the outliers can be neglected for further evaluation.
However, it should be noted that this approach requires a complete and seamlessly meshed surface model for precise estimation of the creepage distance. In the case of a faulty mesh, the creepage distance is estimated to be too long and, therefore, harmless from a safety point of view. Thus, it should be mentioned that, in its current form, even with the introduced outlier identification, the actual structure and condition of the mesh is not further evaluated. Further investigations and algorithmic improvements are, therefore, possible to improve the precision and robustness of the approach.
As there were no comparable solutions available on the market until now, the implementation leads to advantages within the quality assurance process and, in consequence, helps to improve the product quality. However, this also results in the inability to validate the approach and compare it with reference data.
The proposed method offers the ability for extensive evaluation of manufactured hairpin stators regarding absolute measurements of the creepage distance as well as the variance of the feature over each wire pair. Due to the fact that the length of the creepage distance influences the characteristics of the electrical machine [46], an increased precision in measuring the feature allows optimizations in the design process. Although other product features are evaluated within the supplied software of the measurement system producer, the proposed method has the feasibility for a simple integration within the automated inspection cycle. However, raising the efficiency in the quality assurance process and, furthermore, integrating novel approaches, which results in a higher precision of determining features, leads to great value for manufacturing companies.

Conclusions
Within this work, a novel approach was proposed to provide the estimation of the creepage distance of hairpin stators. Using a fringe projection sensor, the 3D-geometry was reconstructed for further processing. Multiple steps for data processing were used mainly to align the measured part and cluster the wires. In the cluster analysis, the relevant points to estimate the creepage distance were located and extracted.
Finally, the geodesic distance was implemented to assume the creepage distance. The evaluation on experimental data showed promising results, and the discussion already mentioned some important components where further development is needed. Furthermore, we emphasize that the proposed approach has feasibility for integration within the automatic quality assurance process.

Further Research
Although we have shown the principal functionality of the method as well as promising results, various aspects can be addressed in further research. An integration in the quality assurance process offers the opportunity for acquiring a large quantity of data and, therefore, a profound evaluation of the proposed approach. This evaluation could include an analysis on the robustness regarding interferences and different types of stators. In order to analyse the accuracy of our method more extensively, it is crucial to include reference measurements for the creepage distance itself in the conducted measurements.
In addition, algorithmic or conceptual improvements are possible with respect to the concept presented in this study. First, it is worth investigating whether another metrological approach can possibly be pursued as an essential alternative to fringe projection profilometry. In particular, focus variation metrology should be considered in this context. However, it operates on a significantly smaller scale and can, accordingly, reconstruct only a very small part of the surface, which necessitates a combination with an appropriate positioning system for complete data acquisition from various individual measurements.
Advantageously, by omitting a triangulation basis, shadowing effects can be significantly reduced, and the reconstructed and meshed surface model presumably contains fewer holes. Furthermore, optical cooperativity (for example, by matting spray) does not need to be ensured in the same form, since the measurement principle is, in particular, more robust against effects, such as multiple reflections. Due to the smaller scale, a higher lateral and axial resolution can additionally be assumed.
An adapted inspection setup would also provide better and faster automatability as well as direct data prealignment by identifying all relevant kinematic relationships during system calibration. Although vectorized, precompiled or GPU-supported algorithms have been widely applied, further runtime improvements are certainly possible in order to not exceed a total inspection time in combination with a possible positioning setup and acquisition procedure.
Algorithmically, further improvements are feasible, including, in particular, mesh postprocessing (such as the closing of holes) or the improved determination of the stripping edge height, which is of considerable importance in the case of diagonal stripping edges. Furthermore, additional quality metrics can assess the quality of the underlying mesh; thus, the accuracy of each reconstructed creepage distance can be developed to further improve the robustness and informative value of the inspection approach.