Methods and related equipment for detecting defects in motor stator windings
By using multi-angle shooting and image stitching processing, combined with pixel positioning and standard parameter comparison, the problem of misjudgment caused by the complex structure of stator windings was solved, and high-precision winding defect detection was achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- DONGGUAN YUANYUAN AUTOMATION TECH CO LTD
- Filing Date
- 2026-03-31
- Publication Date
- 2026-06-30
AI Technical Summary
Due to the complex structure of the stator winding and the presence of obstructed areas, the outline of some turns cannot be clearly imaged, resulting in incomplete outline information. This makes it impossible to accurately reflect the actual winding distribution, leading to a high misjudgment rate in the detection results.
The stator winding is photographed from multiple angles. The stator winding images are obtained from different angles using an industrial camera. The images are then stitched together to eliminate areas of uneven lighting, the winding outline is extracted, pixel points are located and the coil coordinates are calculated, and defects are identified by comparing with standard parameters.
It achieves accurate identification and pixel-level positioning of wire coil contours, improves the objectivity and sensitivity of detection, reduces human error, enhances the consistency and repeatability of geometric parameter measurements, and supports the automatic identification of minute defects.
Smart Images

Figure CN122306805A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of motor technology, and in particular to a method and related equipment for detecting defects in motor stator windings. Background Technology
[0002] In the field of motor manufacturing and quality inspection, the winding quality of the stator winding is one of the key factors affecting motor performance. In recent years, with the development of machine vision technology, some automated inspection solutions have been applied to the identification of stator winding defects.
[0003] However, due to the complex structure of the stator winding and the presence of obstructed areas, the outlines of some turns cannot be clearly imaged, resulting in incomplete outline information. This makes it impossible to accurately reflect the actual winding distribution, leading to a high misjudgment rate in the detection results. Summary of the Invention
[0004] The main technical problem addressed in this application is to provide a method and related equipment for detecting defects in motor stator windings. This method solves the problem that due to the complex structure of the stator windings and the presence of obstructed areas, the outlines of some windings cannot be clearly imaged, resulting in incomplete outline information and an inability to accurately reflect the actual winding distribution, leading to a high rate of misjudgment in the detection results.
[0005] To solve the above-mentioned technical problems, this application adopts a method for detecting defects in motor stator windings, which includes the following steps: The stator winding of the motor is photographed from multiple angles to obtain stator winding images, and the stator winding outline is extracted from the stator winding images. The stator winding contour is located by pixel points to obtain the stator winding turn coordinates, and the turn spacing of the stator winding is calculated based on the stator winding turn coordinates. The stator winding defect determination result is obtained by comparing the spacing between the windings with standard parameters.
[0006] Furthermore, the step of taking multi-angle photographs of the stator windings of the motor to obtain stator winding images includes: Multiple sets of initial stator winding images were obtained by taking pictures of the stator winding of the motor from different angles using an industrial camera. The multiple initial stator winding images are stitched together to obtain a complete stator winding image, wherein the industrial cameras are evenly distributed around the stator winding and the shooting angle interval between adjacent cameras is the same. The system detects whether there are uneven lighting areas in the complete stator winding image. If so, it compensates for the uneven lighting areas in the complete stator winding image to obtain the stator winding image.
[0007] Furthermore, extracting the stator winding contour from the stator winding image includes: The stator winding image is converted to a color space to obtain a winding grayscale image, and the winding grayscale image is binarized and segmented using a segmentation threshold to obtain a winding segmentation region, wherein the winding segmentation region includes a winding foreground region and a non-winding background region. The pixel transition positions between the winding foreground region and the non-winding background region are detected in the winding segmentation region to obtain a set of boundary candidate points. Connectivity tracking is performed along the adjacent pixel transition positions in the set of boundary candidate points to obtain the stator winding profile.
[0008] Furthermore, the step of locating the stator winding contour pixel by pixel to obtain the stator winding turn coordinates includes: Extract the coil feature pixels of the stator winding profile, wherein the coil feature pixels include the horizontal pixel values and the vertical pixel values in the stator winding image; Based on the preset size of the calibration reference and the number of pixels occupied by the calibration reference in the stator winding image, the pixel equivalent of the feature pixels of the winding is calculated to obtain the pixel equivalent coefficient. Multiply the horizontal and vertical pixel values of the feature pixels of the winding by the pixel equivalent coefficient to obtain the coordinates of the stator winding winding.
[0009] Furthermore, the step of calculating the stator winding turn spacing based on the stator winding turn coordinates includes: Based on the spatial distribution of the center points of each turn in the stator winding turn coordinates, adjacent turns of the stator winding are paired and associated to obtain a turn pairing sequence, wherein the turn pairing sequence includes several groups of adjacent turn pairs arranged along the stator slot depth direction. Based on the coordinate difference of the center point of each pair of adjacent line turns in the line turn pairing sequence, the line turn spacing between the center points of adjacent line turns is calculated.
[0010] The present invention also provides a device for detecting defects in motor stator windings, comprising: The imaging module is used to capture images of the stator winding of the motor from multiple angles to obtain stator winding images and extract the stator winding outline from the stator winding images. The positioning module performs pixel-point positioning on the stator winding contour to obtain the stator winding turn coordinates, and calculates the turn spacing of the stator winding based on the stator winding turn coordinates. The comparison module compares the spacing between the wire turns with standard parameters to obtain the stator winding defect judgment result.
[0011] Furthermore, the shooting module includes: The imaging submodule is used to capture images of the stator winding of the motor from different angles using an industrial camera, thereby obtaining multiple sets of initial stator winding images. The stitching module is used to perform image stitching processing on the multiple sets of initial stator winding images to obtain a complete stator winding image, wherein the industrial cameras are evenly distributed around the stator winding and the shooting angle interval between adjacent cameras is the same. The detection module is used to detect whether there are uneven lighting areas in the complete stator winding image. If so, the uneven lighting areas in the complete stator winding image are compensated to obtain the stator winding image.
[0012] The present invention also provides a computer device, including a memory and a processor coupled to each other, wherein the memory stores program instructions, and the processor is used to execute the program instructions to implement any of the above-described methods for detecting defects in motor stator windings.
[0013] The present invention also provides a computer-readable storage medium storing program instructions that can be executed by a processor, the program instructions being used to implement the motor stator winding defect detection method described above.
[0014] The present invention also provides a computer program product, which includes a computer program that, when executed by a processor, implements any of the above-described methods for detecting defects in motor stator windings.
[0015] The above solution involves taking multi-angle photographs of the motor's stator windings to obtain stator winding images, extracting the stator winding contour from these images, locating pixels on the stator winding contour to obtain stator winding turn coordinates, and calculating the turn spacing based on these coordinates. The turn spacing is then compared with standard parameters to obtain a stator winding defect determination result. This solution addresses the problem that due to the complex structure of the stator windings and the presence of obstructed areas, some turn contours cannot be clearly imaged, resulting in incomplete contour information and an inability to accurately reflect the actual winding. The technical problem of high misjudgment rate in detection results caused by the distribution of wire turns has been solved. Pixel-level positioning of the wire turn contour based on the accurate contour has been achieved, enabling high-precision identification of wire turn coordinates. This makes the spacing measurement between adjacent wire turns closer to the real physical distribution, enhances the consistency and repeatability of geometric parameter measurements, and enables quantitative comparison of key parameters such as measured wire turn spacing with standard design values. It supports automatic identification of subtle defects such as dense, sparse, and misaligned wire turns, improves the objectivity of defect judgment and detection sensitivity, and reduces subjective errors caused by manual visual inspection. Attached Figure Description
[0016] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0017] Figure 1 This is a schematic diagram of a device for detecting the stator windings of an electric motor in one embodiment of the present invention; Figure 2 This is a schematic diagram of the steps of a method for detecting defects in motor stator windings in one embodiment of the present invention; Figure 3 This is a schematic diagram of step S1 in one embodiment of the present invention; Figure 4 This is a schematic diagram of step S2 in one embodiment of the present invention; Figure 5 This is a schematic diagram of the structure of the detection device of the present invention; Figure 6 This is a schematic diagram of the motor stator of the present invention; Figure 7 This is a structural block diagram of a motor stator winding defect detection device according to an embodiment of the present invention; Figure 8 This is a schematic block diagram of the structure of a computer device according to an embodiment of the present invention.
[0018] The objectives, features, and advantages of this invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0019] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of the embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.
[0020] Specifically, the motor stator winding defect detection method of this embodiment includes the following steps: like Figure 1 As shown, Figure 1 This invention provides a method for detecting defects in motor stator windings, comprising the following steps: Step S1: Take multi-angle photos of the stator winding of the motor to obtain a stator winding image, and extract the stator winding outline from the stator winding image.
[0021] Specifically, multi-angle imaging of the motor's stator windings involves placing the stator on a rotatable fixture and using multiple industrial cameras arranged in a ring to simultaneously or sequentially acquire images from different angles, obtaining stator winding images covering all sides of the windings. Then, the clearest parts of each region are selected from the acquired image sequence and stitched together or selected from the corresponding viewpoints. Next, edge detection algorithms combined with morphological processing are used to extract the stator winding contour from the images. For example, under uniform lighting conditions, the Canny operator is used to obtain continuous boundaries, and contour tracking is then used to retain the main winding region. For broken contours caused by reflections or occlusions, information is supplemented from adjacent angle images to repair them, ensuring that the final extracted stator winding contour is complete and continuous, suitable for subsequent pixel location analysis.
[0022] Step S2: Pixel point positioning is performed on the stator winding contour to obtain the stator winding turn coordinates, and the turn spacing of the stator winding is calculated based on the stator winding turn coordinates.
[0023] Specifically, after obtaining the stator winding contour, it is first converted into a binary image, and then the points on the contour are traversed using an eight-neighborhood search method to mark the continuous pixel positions of the edge of each coil turn, thereby completing the pixel positioning of the stator winding contour. These located pixels are divided into several clusters according to their spatial distribution, and each cluster corresponds to a coil turn. The coordinates of its geometric center or the densest region are used as the stator winding coil coordinates of that coil turn. Next, the Euclidean distance between the stator winding coil coordinates of two adjacent coil turns is calculated to obtain the straight-line distance between the two points. This value is the corresponding coil spacing. For example, in a certain detection instance, the lateral deviation between the coordinates of the nth coil turn and the (n+1)th coil turn is small, but the longitudinal offset is obvious. The calculated coil spacing will reflect the uneven density of the winding in that local area. The whole process relies on the image resolution and calibration parameters to keep consistent to ensure measurement accuracy.
[0024] Step S3: Compare the spacing between the wire turns with standard parameters to obtain the stator winding defect judgment result.
[0025] Specifically, the winding spacing is imported into the analysis module and compared item by item with the standard parameters pre-stored in the database. These standard parameters include the winding spacing tolerance range specified in the design drawings and the winding pitch reference value. The comparison process uses a difference judgment method; when the measured winding spacing of a certain section exceeds a set threshold of ±0.15mm, the area is marked as abnormal. Simultaneously, the contour distribution trend extracted from multi-angle images is used to determine whether it is a local burr or an overall offset. For example, if the measured spacing of three consecutive turns in a slot is less than the minimum allowable value, the system determines it as an overly dense winding defect; conversely, if a significant increase occurs, it is considered... Loose or missing turns; finally, by comprehensively considering various deviation types and location information, a stator winding defect judgment result containing defect category and coordinates is generated and output to the display interface or connected to an automated sorting system. This achieves high-precision identification of turn coordinates, making the spacing measurement between adjacent turns closer to the actual physical distribution, enhancing the consistency and repeatability of geometric parameter measurements, and enabling quantitative comparison of key parameters such as measured turn spacing with standard design values. It supports automatic identification of subtle defects such as dense, sparse, and misaligned turns, improving the objectivity of defect judgment and detection sensitivity, and reducing subjective errors caused by manual visual inspection.
[0026] In a specific embodiment, the step of taking multi-angle photographs of the stator winding of the motor to obtain stator winding images includes: Step S11: Take pictures of the stator winding of the motor from different angles using an industrial camera to obtain multiple sets of initial stator winding images; Step S12: Perform image stitching processing on the multiple sets of initial stator winding images to obtain a complete stator winding image, wherein the industrial cameras are evenly distributed around the stator winding and the shooting angle interval between adjacent cameras is the same. Step S13: Detect whether there is an uneven illumination region in the complete stator winding image. If so, compensate for the uneven illumination region in the complete stator winding image to obtain the stator winding image.
[0027] Specifically, such as Figure 3As shown, when taking multi-angle photos of the stator winding of a motor, the stator to be measured is fixed on a rotating worktable, with three or four industrial cameras evenly distributed around it in a circumferential direction. The installation angle interval between adjacent cameras is 90 degrees or 120 degrees, ensuring that each camera can cover a sector of the stator winding. When shooting starts, each industrial camera is triggered synchronously, acquiring a set of initial stator winding images from different perspectives. Each image contains some local details of the winding. Then, image stitching algorithms are used to register and fuse these multiple sets of initial stator winding images. Typically, SIFT feature point matching is used to determine overlapping areas, and then weighted fusion is used to eliminate stitching seams, ultimately forming a continuous, unobstructed, complete stator winding image. This step is crucial because it is difficult to see the winding state on the back of the tooth tip or in the interlayer transition area from a single perspective. After stitching, it is necessary to check whether there are areas of uneven lighting in the complete stator winding image. Such problems often occur at the edge of the camera's field of view or in areas with strong metal reflections. The detection method typically involves calculating the local variance of the image's grayscale histogram. If the standard deviation of a certain area is lower than a preset threshold, it is identified as an underexposed or shadowed area. At this point, an illumination compensation mechanism is activated, employing homomorphic filtering or Retinex enhancement techniques to correct the brightness of unevenly illuminated areas in the complete stator winding image, improving contrast in dark areas without excessively enhancing bright areas. For example, in the detection of a 48-slot motor, the information of the top few turns was lost due to copper wire reflection in the area corresponding to the second camera. After compensation processing, the outline became clearly discernible, ensuring the accuracy and reliability of the subsequently extracted stator winding outline. The entire process significantly improves image quality, laying the foundation for subsequent analysis.
[0028] In a specific embodiment, extracting the stator winding contour from the stator winding image includes: The stator winding image is converted to a color space to obtain a winding grayscale image, and the winding grayscale image is binarized and segmented using a segmentation threshold to obtain a winding segmentation region, wherein the winding segmentation region includes a winding foreground region and a non-winding background region. The pixel transition positions between the winding foreground region and the non-winding background region are detected in the winding segmentation region to obtain a set of boundary candidate points. Connectivity tracking is performed along the adjacent pixel transition positions in the set of boundary candidate points to obtain the stator winding profile.
[0029] Specifically, after acquiring the stator winding image, it is first converted from the RGB color space to a grayscale image. This process is achieved using a weighted average method, that is, linearly combining the original pixels with coefficients of 0.299R + 0.587G + 0.114B to obtain the grayscale image of the winding, thus preserving the contrast information between the copper wire and the insulating varnish. Next, the grayscale image of the winding is binarized. The segmentation threshold used can be automatically obtained through the Otsu method, or a fixed value such as 128 can be set according to the ambient lighting conditions. Pixels with values higher than this value are classified as foreground, and those lower are classified as background, ultimately forming a winding segmentation region with clear boundaries. At this point, the image contains both real winding edges and pseudo-regions caused by flying debris or shadows. In order to extract effective contours, the system scans the entire image to find pixel positions that jump from 0 to 1 or 1 to 0. These points constitute a set of boundary candidate points. Usually, the jumps are obvious at tooth corners or inter-turn gaps, while the arc transition areas at the ends are relatively gentle. Then, starting from a certain initial transition point, the transition positions of adjacent pixels are traced along the eight-neighborhood direction to determine whether they meet the connectivity conditions, such as a distance of no more than √2 pixel units and continuous direction, and are gradually connected to form a closed or open path. If a break occurs in the middle, sub-pixel interpolation is used to fill the gap to ensure that no critical segments are lost. For example, when detecting a flat wire motor, local grayscale gradients are caused by oxidation of the enameled wire surface, resulting in breakpoints in ordinary threshold segmentation. However, by tracing the minimum path connection between candidate points, the complete stator winding outline can still be restored, providing a reliable basis for subsequent positioning.
[0030] In a specific embodiment, the step of detecting the pixel transition position between the winding foreground region and the non-winding background region from the winding segmentation region to obtain a boundary candidate point set includes: In the winding segmentation region, an eight-neighborhood window is constructed with the current pixel as the center. The pixel value of the current pixel is compared one by one with the pixel values of each adjacent pixel in the eight-neighborhood window. When the current pixel belongs to the winding foreground region and there is at least one adjacent pixel in the eight-neighborhood window that belongs to the non-winding background region, the current pixel is marked as a pixel jump position. When traversing all pixels in the winding segmentation region, the coordinates of all pixels marked as pixel transition positions are extracted, and the pixel coordinates are aggregated into a set of boundary candidate points.
[0031] Specifically, when processing the winding segmentation region, the system scans each pixel in the image row by row and column by column, constructing a 3×3 eight-neighborhood window with the current pixel as the center point. This window covers the adjacent pixels in the top, bottom, left, right, and four diagonal directions. For the current pixel, it is first determined whether it belongs to the winding foreground region, i.e., its binarized pixel value is 1. If so, it is further checked whether there is at least one pixel with a value of 0 in the eight-neighborhood window, which is an adjacent pixel belonging to the non-winding background region. Once this condition is met, it indicates that the current pixel is located at the boundary between the foreground and background, with a significant pixel jump. At this time, its coordinates are recorded and marked as the pixel jump position. This detection method can effectively capture the abrupt change features of the winding edge, especially suitable for areas with clear contrast between the copper wire and the slot. The entire process continuously traverses all pixels in the winding segmentation region, without missing any possible boundary points. After all the pixels that meet the conditions have been identified, the coordinates of these pixels marked as pixel jump positions are extracted one by one and uniformly collected to form a set of boundary candidate points. For example, in an image of a stator end winding, the tightly packed windings result in some inter-turn gaps occupying only 2-3 pixels in width, which traditional methods easily miss. However, by comparing eight neighboring regions point by point, even in narrow transition areas, the transition points can be accurately identified, ensuring sufficient data support for subsequent connectivity tracing. Although this operation is computationally intensive, it can still be completed in real time on existing industrial computers, making it highly practical.
[0032] In a specific embodiment, the connectivity tracking along the adjacent pixel transition positions in the boundary candidate point set to obtain the stator winding profile includes: Select a pixel transition position from the boundary candidate point set as the tracking start point. Using the tracking start point as the current point, search the boundary candidate point set for unvisited pixel transition positions within the eight-neighbor range of the current point as the next adjacent point. Update the next adjacent point to the current point and mark it as visited. Repeat the adjacent point search and update operation. Record each visited pixel transition position in the order of visit as a contour point sequence. When the next adjacent point and the tracking start point are within the eight-neighbor range, the tracking start point is added to the end of the contour point sequence to form a closed contour point sequence with the beginning and end connected. The pixel jump positions in the closed contour point sequence are then connected sequentially to obtain the stator winding contour.
[0033] Specifically, although the pixel transition positions extracted from the boundary candidate point set have been marked as possible edge points, they are still in a discrete state and need to be organized into a continuous path through connectivity tracing. In practice, an unvisited pixel transition position is first selected from the boundary candidate point set as the starting point for tracing. Usually, the first valid point located at the lower or left edge of the image is preferred to ensure a stable starting position. After selection, this point is set as the current point, and the search begins with its coordinates. Other unvisited pixel transition positions within the eight-neighborhood of the current point are searched in the boundary candidate point set, that is, it is determined whether there are adjacent points that are no more than one diagonal pixel away and have not yet been marked as visited. If so, this point is confirmed as the next adjacent point, its coordinates are recorded in a temporary buffer, and updated as the new current point. At the same time, a visited mark is added to prevent repeated tracing. This process is repeated, and each step searches for the next connection point based on the current position, and the resulting sequence gradually extends. As the operation continues, each pixel transition position is recorded as a contour point sequence according to the actual spatial connection order. When the next adjacent point found in a search is also within the eight-neighborhood of the initial tracking starting point, it indicates that the closed path has completed a full loop. At this point, the tracking starting point is added back to the end of the contour point sequence, forming a closed structure with the beginning and end connected. Finally, adjacent points in the closed contour point sequence are connected one by one with straight line segments to form a continuous and unbroken geometric path, thus obtaining the complete stator winding contour. For example, when processing the winding image of a 4-pole motor, a certain phase winding is distributed in a loop. The tracking process starts from the tooth root, loops around the end, and then approaches the starting point again. The system detects that the proximity relationship meets the closed-loop condition and automatically closes the path. The final output contour accurately reflects the actual winding shape.
[0034] In a specific embodiment, the step of locating the stator winding contour pixel point to obtain the stator winding turn coordinates includes: Extract the coil feature pixels of the stator winding contour, wherein the coil feature pixels include the horizontal pixel values and the vertical pixel values in the stator winding image; Based on the preset size of the calibration reference and the number of pixels occupied by the calibration reference in the stator winding image, the pixel equivalent of the feature pixels of the winding is calculated to obtain the pixel equivalent coefficient. Multiply the horizontal and vertical pixel values of the feature pixels of the winding by the pixel equivalent coefficient to obtain the coordinates of the stator winding winding.
[0035] Specifically, after obtaining the stator winding contour, it is necessary to further locate the specific position of each coil in the image. First, feature points representing the position of a single coil are extracted from the stator winding contour; these are coil feature pixels. These points are typically selected as the geometric center of the closed contour of each coil, or the midpoint of the arc segment closest to the tooth tip in densely packed areas. Their coordinates are represented by the horizontal and vertical pixel values of that point in the stator winding image. Since pixel values are only image units and cannot directly reflect the actual physical size, conversion is necessary. Therefore, a calibration reference of known size, such as a square metal block with a side length of 5mm, is placed next to the stator during shooting. The number of pixels it occupies in the image is recorded. For example, if it occupies 100 pixels horizontally, the actual distance corresponding to each pixel can be calculated as 0.05mm. This ratio is the pixel equivalent coefficient. Once this coefficient is determined, it is used for all subsequent coordinate conversions. The lateral pixel value of each feature pixel on a winding is multiplied by its equivalent pixel coefficient to obtain its actual lateral coordinate. The same operation is performed on the axial pixel values to obtain the axial physical coordinate. Combining these two values constitutes the spatial position of the winding, i.e., the stator winding winding coordinates. The entire process relies on consistent calibration; if the camera height or magnification is changed, the equivalent pixel coefficient must be re-measured. For example, in one inspection, the lateral coordinate of the third turn of a certain phase winding was found to deviate significantly from the design position by 0.12mm. Combined with data from other turns, this was determined to be a local offset defect, which was identified precisely based on accurate pixel location. Although this method requires prior calibration, it is stable and suitable for batch automated inspection scenarios.
[0036] In a specific embodiment, calculating the stator winding turn spacing based on the stator winding turn coordinates includes: Step S21: Based on the spatial distribution of the center points of each turn in the stator winding turn coordinates, pair and associate adjacent turns of the stator winding to obtain a turn pairing sequence, wherein the turn pairing sequence includes several groups of adjacent turn pairs arranged along the stator slot depth direction. Step S22: Calculate the spacing between the center points of adjacent line turns based on the coordinate difference of the center points of each pair of adjacent line turns in the line turn pairing sequence.
[0037] Specifically, such as Figure 4As shown, based on the spatial distribution reflected by the coordinates of the stator winding turns, the arrangement trend of the center points of each turn in the image is first analyzed, especially the extension path along the stator core axis or slot depth direction. Since the windings are usually wound in a stacked manner, adjacent turns are arranged in an approximately straight line or arc shape in space. The system pairs and associates adjacent turns accordingly. In specific operation, starting from an initial turn, the system searches for the next turn that is closest to it and conforms to the winding direction, forming a pair. Then, this process is repeated, combining each subsequent pair of adjacent turns in sequence to form an ordered turn pairing sequence. This sequence contains several pairs of adjacent turns arranged continuously along the stator slot depth direction, which can truly reflect the actual stacking order of the windings. For some cases with slot skipping or oblique winding, it is also necessary to combine the prior information of the winding direction to eliminate incorrect matches. After pairing is completed, the spacing calculation stage begins. For each pairing in the coil pairing sequence, the stator winding coil coordinates of the center points of the two coils are extracted. The difference between their horizontal and vertical coordinates in a Cartesian coordinate system, i.e., Δx and Δy, is calculated. Then, the straight-line distance between the two points is calculated using the Euclidean distance formula √(Δx² + Δy²). This value is the coil spacing at that location. For example, when inspecting a certain SMP motor, the calculated spacing between the 4th and 5th coils was found to be 0.8mm, significantly larger than the normal range of 0.3-0.4mm between other coils in the same area, indicating that there may be a problem of looseness or insufficient winding tension. The entire calculation process depends on the accuracy of the initial coordinate positioning; any deviation will directly affect the final judgment result.
[0038] In a specific embodiment, the step of pairing adjacent turns of the stator winding according to the spatial distribution of the center points of each turn in the stator winding turn coordinates to obtain a turn pairing sequence includes: Based on the coordinate components of the center point of each turn along the depth direction of the stator slot in the coordinate of the stator winding turns, the center points of each turn are arranged in ascending order to obtain a turn depth sorting list. The center points of the turns in the turn depth sorting list are arranged in order from the nearest to the farthest from the slot opening. Extract the center points of two adjacent wire turns from the wire turn depth sorting list as a pair of adjacent wire turn pairs, and mark the center point of the wire turn on the slot opening side as the upper wire turn and the center point of the wire turn on the slot bottom side as the lower wire turn, to obtain wire turn pairs with hierarchical identifiers. The wire-turn pairs with hierarchical identifiers are sequentially numbered according to the depth coordinate components of the upper-level wire-turn pairs to obtain a wire-turn pairing sequence.
[0039] Specifically, after obtaining the coordinates of the stator winding turns, the spatial position of each turn's center point is known, but its stacking order within the slot needs to be further clarified. First, the coordinate components of each turn's center point along the stator slot depth direction are extracted. These components reflect its relative position in the axial or radial direction, typically based on the distance from the slot opening. All turn center points are arranged in ascending order according to this depth coordinate component, resulting in a turn depth sorting list. Points at the beginning are closer to the slot opening, while those further down gradually extend to the slot bottom. For example, in a 12-slot stator, if a phase winding has 6 turns, its depth coordinates, from smallest to largest, correspond to the actual distribution from the outer layer to the inner layer. Next, two adjacent turn center points are extracted from this list, forming a pair of adjacent turn pairs. That is, the first and second points form one pair, the third and fourth points form the next pair, and so on. For each pair, the turn with the smaller depth coordinate and closer to the slot opening is marked as the upper-layer turn, and the other as the lower-layer turn, forming turn pairs with hierarchical identifiers. This step helps distinguish winding layers and avoid misjudging inter-layer spacing. Finally, these pairs are sorted again according to the depth coordinates of the upper layer turns from smallest to largest, and numbered sequentially to form the final turn pairing sequence. This sequence not only reflects physical adjacency but also preserves spatial order, providing a reliable basis for subsequent calculations of inter-layer spacing. In practical applications, an abnormal inter-layer spacing of 0.9mm was found in a certain pair, far exceeding the normal value of 0.35mm, which was confirmed to be a winding misalignment defect. The entire process is based on coordinate calculations, requires no additional sensors, and is simple and stable to implement.
[0040] Please see Figure 5 This is a schematic diagram of an automated testing equipment. It uses a serial process description to show the complete process flow of a product from the moment it enters the testing line to the moment it leaves the line.
[0041] First, the loading mechanism, located at the beginning of the system, is responsible for picking up the product to be inspected from the winding machine and accurately transferring it to the central inspection station. Next, the product is placed on a rotating fixture table, which rotates the product at multiple angles during the inspection process to facilitate comprehensive imaging by the subsequent vision system. At the same time, the CCD imaging units (at four angles) arranged around the perimeter are activated to capture images of the product from all directions, ensuring that all surfaces to be inspected are covered without any blind spots. After the image acquisition and data analysis are completed, the equipment enters the unloading stage—the unloading mechanism automatically removes the inspected product and moves it out of the inspection area, achieving a closed-loop operation.
[0042] Please see Figure 6 1. The main subject of the image is the motor stator, where you can see the precisely wound gold enameled wire coils and stator core. A CCD is used to check the winding quality.
[0043] 2. Four-view layout: Four windows display the stator from four different CCD shooting angles, aiming to cover the stator's 360° appearance, avoid blind spots, and simultaneously inspect coil winding defects from multiple angles and all directions. 3. Software Interface Functions Left main view: Stator images captured in real time by an industrial camera, used for visual algorithm analysis. The right-hand information panel displays the test log, parameter configuration, or NG / OK statistics. An "OK" icon is visible in the upper right corner, indicating that the current test result is acceptable. Top toolbar: Contains function buttons for image acquisition, parameter settings, saving, and tool access; it is a typical interface of machine vision inspection software (such as VisionPro, Halcon, or self-developed vision systems). 4. Workflow and Applications: Multi-view imaging; a fixture drives the stator to rotate; four CCDs take pictures sequentially or simultaneously from different angles; then algorithmic detection is performed: software automatically analyzes the images to identify coil winding problems. Result determination: Output OK / NG result, and the unloading mechanism sorts qualified and defective products according to the result. Please see Figure 7 , Figure 7 This is a schematic diagram of the framework of an embodiment of the motor stator winding defect detection device of this application. Figure 7 As shown, the motor stator winding defect detection device includes an imaging module 1, which is used to take multi-angle pictures of the motor stator winding to obtain stator winding images and extract the stator winding outline from the stator winding images. Positioning module 2 uses pixel point positioning on the stator winding contour to obtain the stator winding turn coordinates, and calculates the turn spacing of the stator winding based on the stator winding turn coordinates. Comparison module 3 compares the spacing between the wire turns with standard parameters to obtain the stator winding defect judgment result.
[0044] The motor stator winding defect detection device also includes the imaging module, which includes: The imaging submodule is used to capture images of the stator winding of the motor from different angles using an industrial camera, thereby obtaining multiple sets of initial stator winding images. The stitching module is used to perform image stitching processing on the multiple sets of initial stator winding images to obtain a complete stator winding image, wherein the industrial cameras are evenly distributed around the stator winding and the shooting angle interval between adjacent cameras is the same. The detection module is used to detect whether there are uneven lighting areas in the complete stator winding image. If so, the uneven lighting areas in the complete stator winding image are compensated to obtain the stator winding image.
[0045] Reference Figure 8 This invention also provides a computer device whose internal structure can be as follows: Figure 8 As shown, the computer device includes a processor, memory, display screen, input device, network interface, and database connected via a system bus. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores the operating system, computer programs, and database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The database stores the data corresponding to this embodiment. The network interface is used to communicate with external terminals via a network connection. When the computer program is executed by the processor, it implements the above-described method.
[0046] Those skilled in the art will understand that Figure 8 The structures shown are merely block diagrams of some structures related to the present invention and do not constitute a limitation on the computer devices on which the present invention is applied.
[0047] An embodiment of the present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-described method. It is understood that the computer-readable storage medium in this embodiment can be a volatile readable storage medium or a non-volatile readable storage medium.
[0048] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the present invention and embodiments can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual-rate SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM, etc.
[0049] In some embodiments, the functions or modules of the apparatus provided in this disclosure can be used to perform the methods described in the above method embodiments. The specific implementation can be referred to the description of the above method embodiments, and for the sake of brevity, it will not be repeated here.
[0050] The description of the various embodiments above tends to emphasize the differences between the various embodiments. The similarities or similarities between them can be referred to, and for the sake of brevity, they will not be repeated here.
[0051] In the several embodiments provided in this application, it should be understood that the disclosed methods and apparatus can be implemented in other ways. For example, the apparatus implementations described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection of devices or units may be electrical, mechanical, or other forms.
[0052] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment, depending on actual needs.
[0053] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0054] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the methods of various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0055] If the technical solution of this application involves personal information, the product using this technical solution has clearly informed the user of the personal information processing rules and obtained the user's voluntary consent before processing the personal information. If the technical solution of this application involves sensitive personal information, the product using this technical solution has obtained the user's separate consent before processing the sensitive personal information, and also meets the requirement of "express consent". For example, at personal information collection devices such as cameras, clear and prominent signs are set up to inform users that they have entered the scope of personal information collection and that personal information will be collected. If an individual voluntarily enters the collection scope, it is deemed that they have agreed to the collection of their personal information; or on the personal information processing device, with clear signs / information informing users of the personal information processing rules, authorization is obtained from the individual through pop-up information or by asking the individual to upload their personal information; wherein, the personal information processing rules may include information such as the personal information processor, the purpose of personal information processing, the processing method, and the types of personal information processed.
Claims
1. A method for detecting defects in motor stator windings, characterized in that, Includes the following steps: The stator winding of the motor is photographed from multiple angles to obtain stator winding images, and the stator winding outline is extracted from the stator winding images. The stator winding contour is located by pixel points to obtain the stator winding turn coordinates, and the turn spacing of the stator winding is calculated based on the stator winding turn coordinates. The stator winding defect determination result is obtained by comparing the spacing between the windings with standard parameters.
2. The method for detecting defects in motor stator windings according to claim 1, characterized in that, The process of taking multi-angle photographs of the stator windings of the motor to obtain stator winding images includes: Multiple sets of initial stator winding images were obtained by taking pictures of the stator winding of the motor from different angles using an industrial camera. The multiple initial stator winding images are stitched together to obtain a complete stator winding image, wherein the industrial cameras are evenly distributed around the stator winding and the shooting angle interval between adjacent cameras is the same. The system detects whether there are uneven lighting areas in the complete stator winding image. If so, it compensates for the uneven lighting areas in the complete stator winding image to obtain the stator winding image.
3. The method for detecting defects in motor stator windings according to claim 1, characterized in that, Extracting the stator winding contour from the stator winding image includes: The stator winding image is converted to a color space to obtain a winding grayscale image, and the winding grayscale image is binarized and segmented using a segmentation threshold to obtain a winding segmentation region, wherein the winding segmentation region includes a winding foreground region and a non-winding background region. The pixel transition positions between the winding foreground region and the non-winding background region are detected in the winding segmentation region to obtain a set of boundary candidate points. Connectivity tracking is performed along the adjacent pixel transition positions in the set of boundary candidate points to obtain the stator winding profile.
4. The method for detecting defects in motor stator windings according to claim 1, characterized in that, The step of locating the stator winding contour pixel point to obtain the stator winding turn coordinates includes: Extract the coil feature pixels of the stator winding profile, wherein the coil feature pixels include the horizontal pixel values and the vertical pixel values in the stator winding image; Based on the preset size of the calibration reference and the number of pixels occupied by the calibration reference in the stator winding image, the pixel equivalent of the feature pixels of the winding is calculated to obtain the pixel equivalent coefficient. Multiply the horizontal and vertical pixel values of the feature pixels of the winding by the pixel equivalent coefficient to obtain the coordinates of the stator winding winding.
5. The method for detecting defects in motor stator windings according to claim 1, characterized in that, The calculation of the stator winding turn spacing based on the stator winding turn coordinates includes: Based on the spatial distribution of the center points of each turn in the stator winding turn coordinates, adjacent turns of the stator winding are paired and associated to obtain a turn pairing sequence, wherein the turn pairing sequence includes several groups of adjacent turn pairs arranged along the stator slot depth direction. Based on the coordinate difference of the center point of each pair of adjacent line turns in the line turn pairing sequence, the line turn spacing between the center points of adjacent line turns is calculated.
6. A device for detecting defects in motor stator windings, characterized in that, The method for detecting defects in motor stator windings according to any one of claims 1 to 5 includes: The imaging module is used to capture images of the stator winding of the motor from multiple angles to obtain stator winding images and extract the stator winding outline from the stator winding images. The positioning module performs pixel-point positioning on the stator winding contour to obtain the stator winding turn coordinates, and calculates the turn spacing of the stator winding based on the stator winding turn coordinates. The comparison module compares the spacing between the wire turns with standard parameters to obtain the stator winding defect judgment result.
7. The motor stator winding defect detection device according to claim 8, characterized in that, The shooting module includes: The imaging submodule is used to capture images of the stator winding of the motor from different angles using an industrial camera, thereby obtaining multiple sets of initial stator winding images. The stitching module is used to perform image stitching processing on the multiple sets of initial stator winding images to obtain a complete stator winding image, wherein the industrial cameras are evenly distributed around the stator winding and the shooting angle interval between adjacent cameras is the same. The detection module is used to detect whether there are uneven lighting areas in the complete stator winding image. If so, the uneven lighting areas in the complete stator winding image are compensated to obtain the stator winding image.
8. A computer device, characterized in that, The method includes a memory and a processor coupled to each other, wherein the memory stores program instructions and the processor executes the program instructions to implement the motor stator winding defect detection method according to any one of claims 1 to 5.
9. A computer-readable storage medium, characterized in that, The device stores program instructions that can be executed by a processor, the program instructions being used to implement the motor stator winding defect detection method according to any one of claims 1 to 5.
10. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, enables the implementation of the steps of the motor stator winding defect detection method as described in any one of claims 1 to 5.