Motor tab positioning detection method using optical recognition
By using optical recognition methods to perform high-resolution image processing and precise positioning of motor inserts, the problem that traditional detection methods cannot accurately quantify insert offset is solved, achieving high-precision insert detection and quality traceability, and improving the stability of the motor manufacturing process.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-24
- Publication Date
- 2026-03-10
AI Technical Summary
Existing technologies cannot perform non-destructive online testing of motor inserts immediately after stamping. Especially in micro motors and precision servo motors, the slight offset of the inserts relative to the central axis can lead to latent failures such as local overheating of the windings and increased electromagnetic noise. Traditional testing methods cannot accurately quantify the corner positions of the inserts.
An optical recognition method is used to acquire high-resolution images, construct an edge gradient model of the insert, extract a set of candidate boundary points, construct the insert contour and perform deformation matching, calculate the position offset and angle deviation of the insert, combine the center positioning features for accurate positioning, construct the offset vector and compare it with the tolerance model, and generate a heat map of the insert error distribution.
It achieves sub-pixel-level precision measurement and morphological correction of the insert position, breaking through the limitations of traditional detection in terms of accuracy and efficiency, and significantly improving the quality traceability and production stability of the motor manufacturing process.
Smart Images

Figure CN121391871B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of motor manufacturing and testing technology, and specifically to a method for positioning and testing motor inserts using optical recognition. Background Technology
[0002] In the manufacturing process of motor stator or rotor laminations, inserts (i.e., winding insertion ports or terminal mounting ports) are typically formed on silicon steel sheets through a stamping process and serve as important structural interfaces for winding or welding in subsequent processes. The accuracy of the insert position directly affects the symmetry of the motor windings, the balance of mechanical stress, and the electromagnetic performance during operation. However, current mainstream methods for detecting insert position mostly rely on mechanical reference alignment or indirect quality traceability after winding, making it impossible to perform non-destructive online testing of the insert accuracy immediately after stamping.
[0003] Especially in certain micro motors, precision servo motors, or high-speed stator assemblies, even a slight offset (less than 0.2mm) of the lamination relative to the central axis can lead to localized overheating of the windings, increased electromagnetic noise, stress concentration at the ends, and even latent failures such as cracking of the insulating varnish. Adding to the complexity, during mass production stamping, wear of some molds or springback of the steel sheets can cause irregular deformation of the laminations (such as localized obtuse angle shrinkage). Traditional two-dimensional visual inspection cannot accurately quantify the corner positions of the laminations, leading to missed detections. Summary of the Invention
[0004] The purpose of this invention is to provide a method for positioning and detecting motor inserts using optical recognition, in order to overcome the shortcomings of the prior art.
[0005] To achieve the above objectives, the present invention provides the following technical solution: a method for positioning and detecting motor inserts using optical recognition, comprising:
[0006] Acquire a full-frame high-resolution image G of the target wafer, including the insert area and the reference boundary area;
[0007] The full-frame high-resolution image G is subjected to grayscale enhancement and reflection interference suppression processing. An interpolation edge gradient model E is constructed, and the interpolation candidate boundary point set P is extracted based on the interpolation edge gradient model E.
[0008] Based on the candidate boundary point set P of the insert, the initial polygon M0 of the insert contour is constructed, and the shape prior model F is used to perform deformation matching on the initial polygon M0 of the insert contour to obtain the corrected insert contour M1.
[0009] Obtain the stator or rotor center positioning features in the full-frame high-resolution image G, and calculate the relative offsets ΔX, ΔY and angular deviation θ between the centroid coordinates and center features of the corrected lamination profile M1;
[0010] The insert position offset vector V is constructed based on the relative offsets ΔX, ΔY and angular deviation θ, and compared with the set tolerance model T to determine whether the insert is qualified.
[0011] If the offset vector V of the insert position exceeds the limit of the tolerance model T, the current insert is marked as abnormal according to the direction and magnitude of the offset vector V, and the insert number and offset feature are recorded in the database; otherwise, it is marked as qualified.
[0012] A heatmap of insert error distribution is constructed based on the offset data of multiple stampings to assess the mold condition or batch stability of steel sheets.
[0013] Preferably, the construction of the insert edge gradient model E includes:
[0014] Based on the brightness histogram distribution of the full-frame high-resolution image G, the overall grayscale range of the image is expanded;
[0015] The image is enhanced in the frequency domain to highlight the local gray-level variation features at the outline of the insert;
[0016] After image preprocessing, the gradient information of the insert edge is extracted, and the gradient model E of the insert edge is constructed.
[0017] Preferably, the step of extracting the candidate boundary point set P of the insert according to the insert edge gradient model E includes:
[0018] A directional consistency analysis was performed on the edge gradient model E of the insert, and all edge points were clustered according to the gradient direction to select candidate edge segments with continuously changing gradient directions.
[0019] Based on the pixel intensity gradient distribution of candidate edge segments, false edge points caused by scratches and stains on the stamping surface are eliminated, while stable and continuous real structural edge points are retained.
[0020] Local geometric fitting is performed on the retained real structural edge points. The fitting residual is used to determine whether the edge points meet the geometric morphological characteristics of the insert. Points that meet the characteristics are marked as candidate boundary points for the insert.
[0021] Connectivity reconstruction is performed on the marked candidate boundary points of the insert to form a set of candidate boundary points P.
[0022] Preferably, the step of performing deformation matching on the initial polygon M0 of the insert contour using a shape prior model F to obtain the corrected insert contour M1 includes:
[0023] The candidate boundary point set P of the insert is clustered according to its spatial distribution, and a density-based clustering algorithm is used to determine the endpoint cluster and corner cluster of each insert boundary.
[0024] Based on the relative distribution order of boundary points in the image, connect each group of cluster centers to construct the initial polygon M0 of the insert contour, where each edge is a polyline segment and the endpoint is the point with the highest fitting confidence among the candidate boundary points;
[0025] A shape prior model F is constructed, consisting of a standard geometric template for inserts and its tolerance parameters. A nonlinear deformation method based on thin plate spline functions is used to map the initial polygon M0 to the geometric structure closest to F.
[0026] The output mapped polygonal contour is used as the corrected interpolation contour M1, where the position of each vertex is optimized by shape prior model constraints.
[0027] Preferably, the calculation of the relative offsets ΔX, ΔY, and angular deviation θ between the centroid coordinates and the center feature of the corrected insert profile M1 includes:
[0028] In the full-frame high-resolution image G, identify the reference structure for center positioning, including the outer circle boundary of the stator or the center hole of the rotor, and obtain the center coordinates as the center positioning feature C by fitting the circular Hough transform method.
[0029] The centroid is calculated for the coordinates of all vertices in the modified insert profile M1. The arithmetic mean of the x-coordinates and y-coordinates of all vertices is used as the x-coordinate and y-coordinate of the centroid, respectively.
[0030] Based on the coordinate difference between the center of gravity coordinates and the center positioning feature C, the lateral offset ΔX and longitudinal offset ΔY of the insert position are calculated.
[0031] Using the central positioning feature C as a reference, the angle difference between the main side direction and the reference direction of the corrected insert profile M1 is obtained by using the vector angle calculation method, thus obtaining the angle deviation θ.
[0032] Preferably, the insert position offset vector V is constructed based on the relative offsets ΔX, ΔY and angular deviation θ, and compared with the set tolerance model T to determine whether the insert is qualified, including:
[0033] Obtain the relative offset parameters ΔX, ΔY and angular deviation θ of the modified insert contour M1 relative to the center positioning feature C, and combine the three to construct the position offset vector V = (ΔX, ΔY, θ).
[0034] The position offset vector V is input into the preset tolerance model T. The tolerance model T includes the allowable lateral offset range Tx, the allowable longitudinal offset range Ty, and the allowable angular deviation range Tθ. An offset judgment threshold set T = (Tx, Ty, Tθ) is established.
[0035] Compare each component of the position offset vector V with the corresponding components of the tolerance model T. If the absolute offset values satisfy |ΔX|≤Tx, |ΔY|≤Ty and |θ|≤Tθ respectively, then the structural offset of the current insert is determined to be within the acceptable range.
[0036] If any component of the position offset vector V exceeds the corresponding tolerance range, the insert will be marked as unqualified, and the offset vector V and its out-of-tolerance components will be output.
[0037] Mark the insert as qualified and record the offset vector V as statistical reference data, and output the qualified status information of the insert.
[0038] Preferably, marking the current insert as abnormal based on the direction and magnitude of the insert position offset vector V includes:
[0039] After comparing the position offset vector V with the threshold of the tolerance model T, it is determined whether any component of the vector V exceeds the corresponding threshold range. If it does, it is determined that there is an out-of-tolerance offset.
[0040] When an out-of-tolerance offset is detected, the offset direction and offset magnitude are determined according to the sign and magnitude of the three components ΔX, ΔY and θ of the position offset vector V, and this information is associated with the number of the current insert to generate an abnormal record entry.
[0041] Write the abnormal record entries into the preset quality tracking database, including the insert number, the three components of the position offset vector V, the out-of-tolerance type label, and the offset degree value;
[0042] If the position offset vector V is entirely within the range defined by the tolerance model T, then the insert is marked as qualified, and its position offset vector V is stored as a qualified sample.
[0043] Preferably, a heatmap of insert error distribution is constructed based on the offset data of multiple stampings to assess the die condition or batch stability of steel sheets, including:
[0044] The offset vectors V of all inserts in multiple punches identified within a preset time period are summarized to establish an original data matrix D containing insert numbers, offset components ΔX, ΔY and θ;
[0045] The offset position of each patch is mapped to the coordinates of a unified reference model in the image coordinate system, and a spatial offset grid is constructed using the patch number as an index.
[0046] Calculate the local average offset and standard deviation in each grid cell, which serve as the offset trend value and dispersion index of the region, respectively.
[0047] A heatmap of interpolation error distribution is generated based on the offset trend value and the dispersion index. The heatmap represents the spatial offset intensity in the form of a color gradient.
[0048] The technical effects and advantages provided by the present invention in the above technical solution are as follows:
[0049] 1. This invention provides a method for positioning and detecting motor inserts based on optical recognition, which can achieve sub-pixel-level position measurement and high-precision shape correction of the insert structure. By constructing an insert edge gradient model, an insert contour fitting model, and combining center positioning feature extraction, the method achieves quantitative detection of insert offset and angle error, breaking through the limitations of traditional manual or mechanical alignment detection in terms of accuracy, efficiency, and consistency.
[0050] 2. This invention introduces a structured modeling and visualization analysis mechanism for offset data to construct a heat map of insert error distribution, effectively assisting in the identification of hidden process problems such as mold wear, steel sheet springback, and unstable feeding. Through statistical aggregation and spatial visualization of the offset trends of multiple inserts, it realizes the transformation from single-point error detection to batch-level quality trend assessment, significantly improving the quality traceability and production stability of the motor lamination manufacturing process. Attached Figure Description
[0051] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this invention. For those skilled in the art, other drawings can be obtained based on these drawings.
[0052] Figure 1 This is a flowchart of the method of the present invention. Detailed Implementation
[0053] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0054] For examples, please refer to Figure 1 As shown, the motor insert positioning and detection method using optical recognition described in this embodiment includes:
[0055] A full-frame high-resolution image G of the target sheet is acquired, including the insertion area and the reference boundary area. The image acquisition device is an industrial-grade area scan camera with a fixed-focus, low-distortion industrial lens of 35mm focal length, covering the entire sheet outline.
[0056] The camera is fixedly installed above the unloading section of the stamping production line to take pictures immediately after each stamping piece is completed.
[0057] The acquired full-frame high-resolution image G contains all the insert structures of the lamination and several geometric feature regions in the edge of the lamination body (such as the outer circle boundary of the stator, positioning holes, wedges, etc.). These regions serve as reference boundary regions for subsequent image positioning and correction.
[0058] The full-frame high-resolution image G is subjected to grayscale enhancement and reflection interference suppression processing. An interpolation edge gradient model E is constructed, and the interpolation candidate boundary point set P is extracted based on the interpolation edge gradient model E.
[0059] After acquiring the high-resolution image G of the target wafer, the image preprocessing stage begins. In this embodiment, the overall grayscale distribution of image G is first enhanced to improve the contrast between the wafer insertion area and the background. Specifically, the brightness distribution curve is obtained by calculating the grayscale histogram of all pixels in image G. A local adaptive histogram equalization method is used to expand the image grayscale range to the full range of 0 to 255, where the grayscale distribution of each local region is independently stretched to enhance the brightness difference at the edge of the wafer insertion. This operation effectively improves the edge blurring phenomenon caused by uneven local illumination or surface reflection.
[0060] The enhanced image undergoes frequency domain feature enhancement processing. The specific steps are as follows: First, a two-dimensional Fast Fourier Transform (FFT) is performed on the image to transform it from the spatial domain to the frequency domain. Then, a bandpass enhancement filter is constructed to preserve mid-to-high frequency information and suppress low-frequency background interference. The passband range of this filter is adjusted according to the spatial frequency of the patch contour features, typically set to preserve components with frequencies between 10 and 40 cycles per image width. Finally, an Inverse Fourier Transform is performed on the frequency-enhanced image to restore it to the spatial domain, thereby highlighting the abrupt gray-level changes at the patch edges.
[0061] After image frequency domain enhancement is completed, the edge gradient extraction step is performed. This embodiment uses the Canny edge detection operator, which includes four processes: Gaussian filtering, gradient calculation, non-maximum suppression, and dual thresholding. The Gaussian filter kernel size is set to 5×5 pixels, the low threshold is 0.4 times the average grayscale value of the image, and the high threshold is 0.8 times. The obtained gradient information is used to construct an interpolated edge gradient model E. Model E is a two-dimensional coordinate matrix that records the position, gradient magnitude, and gradient direction of each edge pixel, serving as the basis for boundary point recognition.
[0062] After constructing the edge gradient model E of the insert, the boundary point set extraction stage begins. First, a direction consistency analysis is performed on the edge gradient model E. The analysis method is as follows: the gradient direction interval is divided into groups of 10 degrees, for a total of 36 groups. All edge points are clustered according to the gradient direction, and edge points with continuous and densely distributed gradient directions are grouped into candidate edge segments; this operation is used to remove stray edge points with discontinuous directions.
[0063] Secondly, for each candidate edge segment, the gradient magnitude distribution of its pixels is analyzed. If the standard deviation of the gradient magnitude in a certain region exceeds a set threshold (e.g., 5.0), the edge segment is determined to be likely caused by stains, scratches, or reflections on the stamping surface and is considered a false edge segment, which is then discarded. The remaining part is the stable and continuous real structural edge point.
[0064] For the retained true structural edge points, local geometric shape fitting analysis is performed. In this embodiment, the least squares method is used to construct a fitting curve for 10 adjacent pixels and the fitting residual is calculated. If the fitting residual is less than the threshold of 0.8 pixels and the shape of the fitting result curve matches the preset insert edge template (such as approximating a straight line or arc segment), then the point is marked as an edge point that satisfies the geometric shape characteristics of the insert and is used as a candidate boundary point for the insert.
[0065] Finally, all edge points satisfying the patch features are reconstructed for connectivity based on pixel adjacency. Adjacent points are merged using the 8-neighborhood connection rule to generate a complete and closed edge structure, thus forming the patch candidate boundary point set P. Each point in the point set P contains two-dimensional coordinates, local gradient direction, and fitting confidence information.
[0066] Based on the candidate boundary point set P of the insert, an initial polygon M0 of the insert contour is constructed, and the shape prior model F is used to perform deformation matching on the initial polygon M0 of the insert contour to obtain the corrected insert contour M1.
[0067] After extracting the candidate boundary point set P of the insert, in order to construct a clear initial outline of the insert that can be used for subsequent shape correction, this embodiment first performs spatial clustering analysis on the boundary point set P. Specifically, a density-based clustering algorithm is used to cluster the candidate boundary point set P of the insert. The density clustering algorithm adopts the DBSCAN algorithm, setting the minimum number of neighborhood points to 6 and the search radius to 8 pixels, to identify edge endpoints and corner points with dense spatial distribution in the insert structure. Through this algorithm, the key structural regions of the insert can be automatically distinguished from boundary noise points, and points with obvious curvature changes are classified into corner point clusters, and points at the ends of straight line segments are classified into endpoint clusters.
[0068] Based on the clustering results, the initial polygon M0 of the intercalation outline is constructed by sequentially connecting the cluster centers of each group according to the spatial distribution order of the candidate boundary points in the image. Specifically, in each cluster, the boundary point with the highest fitting confidence is selected as the vertex of the polygon, and adjacent cluster centers are used as connection targets. The shortest path algorithm is then used to connect these points into polyline segments, constructing a closed polygon outline structure. The fitting confidence is calculated based on the sum of squared residuals of the boundary points in the local curve fitting; the smaller the residual, the higher the confidence. M0, as the first-round structural representation of the intercalation, retains the main edge morphological features of the intercalation.
[0069] To further improve the accuracy and standardization of the contour, a shape prior model F is constructed to optimize the structure of the initial polygon M0. The shape prior model F includes a standard geometric template for the inserts and its corresponding set of tolerance parameters. The standard geometric template is derived from statistical modeling, using the mean shape extraction of at least 200 manually annotated qualified insert contours to form the standard polygon template. The tolerance parameters define the allowable deviation range for each side length, angle, and endpoint position, with the allowable error for side length set at ±0.2 mm and the allowable range for angle deviation set at ±5 degrees.
[0070] To map the initial polygon M0 of the insert contour to the geometry of the closest prior shape model F, a thin-plate spline function is used as the nonlinear deformation model. This method uses the vertices of M0 as source control points and the standard vertices in F as target control points to construct a deformation function in two-dimensional space. Deformation mapping is achieved by minimizing bending energy. The mapping function consists of a set of weight coefficients, obtained by solving a system of linear equations. It possesses continuous differentiability and global smoothness, effectively suppressing local distortions.
[0071] After mapping, the output corrected insert contour M1 not only matches the actual boundary point set P at its vertex position, but also satisfies the geometric constraints of the shape prior model F. M1 has higher consistency and anti-interference ability, serving as the basic contour input for subsequent insert offset detection and qualification judgment, ensuring the accuracy and stability of the detection results.
[0072] Obtain the stator or rotor center positioning features in the full-frame high-resolution image G, and calculate the relative offsets ΔX, ΔY and angular deviation θ between the centroid coordinates of the corrected lamination profile M1 and the center features.
[0073] After completing the construction of the modified lamination profile M1, in order to achieve precise positioning of the lamination in the lamination structure, it is necessary to extract the geometric center of the lamination as a reference datum. In this embodiment, the reference structure for center positioning is identified in image G, including the outer circular boundary of the stator lamination or the central through hole of the rotor lamination.
[0074] The specific method is as follows: First, edge enhancement and edge extraction are performed on image G, using the Canny edge operator to extract edge information from the entire image. Then, the Circular Hough Transform algorithm is applied to the edge image to search for edge structures with closed circular features in polar coordinate space. To improve fitting accuracy, the preset search range for the circle radius is 40% to 60% of the image width. When a peak point exceeding a set accumulation threshold (set to 0.2% of the total number of image pixels) appears in the Circular Hough Transform result, a valid circular structure is considered to have been identified. The coordinates of the circle's center are used as the center localization feature C for interpolation offset calculation.
[0075] After extracting the center localization feature C, the geometric centroid coordinates of the corrected insert contour M1 are calculated. The method is as follows: All vertex coordinates in the corrected insert contour M1 are labeled (x1, y1), (x2, y2), ..., (xn, yn), where n is the total number of vertices. The centroid's horizontal coordinates are obtained by summing all horizontal coordinates and dividing by n; the centroid's vertical coordinates are obtained by summing all vertical coordinates and dividing by n. That is:
[0076] The x-coordinate of the centroid = (x1 + x2 + ... + xn) / n;
[0077] The centroid's ordinate = (y1 + y2 + ... + yn) / n.
[0078] The obtained geometric center is the centroid coordinate of the modified insert profile M1.
[0079] Then, based on the coordinate difference between the centroid coordinates of the corrected insert profile M1 and the center positioning feature C, the relative position offset of the insert is calculated. Specifically: the horizontal offset ΔX is obtained by subtracting the horizontal coordinate of the center positioning feature C from the horizontal coordinate of the centroid; the vertical offset ΔY is obtained by subtracting the vertical coordinate of the center positioning feature C from the vertical coordinate of the centroid. ΔX and ΔY are important parameters for evaluating whether the insert is off-center in the lamination structure, and are in pixels, which can be converted to actual millimeters using camera calibration coefficients.
[0080] Furthermore, to determine whether there is an angular deviation in the installation direction of the insert, the angle difference is calculated using the central positioning feature C as a reference point and the vector angle method. The specific steps are as follows: Two points are selected in the corrected insert contour M1 to form a principal side (preferably the longest side or a side with symmetry), constructing a direction vector V1; a reference direction vector V2 is set in the stamping structure (e.g., vertically upward or horizontally), and the angle between the two vectors is the directional deviation angle θ of the insert. The angle is calculated using the vector dot product formula, expressed as: θ represents the angular deviation; V1 represents the direction vector formed by the main edges in the corrected insert contour M1; V2 represents the reference direction vector set in the stamping structure (such as the horizontal vector (1, 0) or the vertical vector (0, 1) in the image coordinate system); the result ranges from -180 degrees to +180 degrees, and the clockwise or counterclockwise deviation direction is determined by the sign. The angular deviation θ, together with the offsets ΔX and ΔY, constitutes a complete description of the deviation in the insert position and orientation.
[0081] The insert position offset vector V is constructed based on the relative offsets ΔX and ΔY and the angle deviation θ, and compared with the set tolerance model T to determine whether the insert is qualified.
[0082] After obtaining the centroid coordinates and main side direction of the modified insert profile M1, in order to determine whether the insert position meets the assembly accuracy requirements, this embodiment performs position and attitude error analysis on it and constructs a position offset vector for determination.
[0083] First, the centroid coordinates of the corrected insert contour M1 are compared with the center positioning feature C to obtain the lateral offset ΔX and vertical offset ΔY, in pixels. Simultaneously, the angular deviation θ, in degrees, is calculated based on the angle between the main side direction and the reference direction. These three parameters are combined to construct the position offset vector V, denoted as: V = (ΔX, ΔY, θ). This vector comprehensively reflects the translational and rotational errors of the insert in space.
[0084] Next, the position offset vector V is input into the tolerance model T for compliance comparison. The tolerance model T is a set of preset threshold parameters, including:
[0085] Tx: Maximum permissible lateral offset, the value of which depends on the motor design requirements and is usually set to ±0.2 mm;
[0086] Ty: Maximum allowable longitudinal offset, typically set to ±0.2 mm;
[0087] Tθ: The maximum permissible angular deviation, usually set to ±3 degrees.
[0088] The three factors together form the offset determination threshold set: T = (Tx, Ty, Tθ).
[0089] Then, each component of the position offset vector V is compared with the corresponding threshold in the tolerance model T. If the actual offset value of the insert meets the following conditions: lateral offset |ΔX|≤Tx, longitudinal offset |ΔY|≤Ty, and angular deviation |θ|≤Tθ, then the actual position and attitude error of the current insert is considered to be within the allowable range, that is, the insert structure is in a qualified state.
[0090] If any component in the offset vector V exceeds its corresponding tolerance range, for example: |ΔX| > Tx, or |θ| > Tθ, it is determined that the insert does not meet the assembly accuracy requirements and is marked as unqualified. The system outputs the complete offset vector V of the insert and its out-of-tolerance components, and records them in the quality tracking database for subsequent anomaly statistics and die calibration analysis.
[0091] If the insert is determined to be qualified, the offset vector V of the insert is recorded as qualified sample data for cumulative statistics and production quality trend analysis. At the same time, the qualified status information of the insert is output to provide a judgment basis for subsequent equipment sorting or alarm.
[0092] If the insert position offset vector V exceeds the limit of the tolerance model T, the current insert is marked as abnormal according to the direction and amplitude of the insert position offset vector V, and the insert number and offset characteristics are recorded in the database; otherwise, it is marked as qualified.
[0093] After completing the threshold comparison between the position offset vector V and the tolerance model T, it enters the anomaly judgment and status marking stage. In this embodiment, the position offset vector V consists of three components, namely the lateral offset ΔX, the longitudinal offset ΔY, and the angular deviation θ. The tolerance model T defines three error allowable ranges, including the allowable maximum lateral offset Tx, the longitudinal offset Ty, and the angular deviation Tθ.
[0094] In this step, it is sequentially determined whether each component of the vector V exceeds its corresponding tolerance range. The judgment conditions are: if |ΔX| > Tx, it is regarded as lateral out-of-tolerance; if |ΔY| > Ty, it is regarded as longitudinal out-of-tolerance; if |θ| > Tθ, it is regarded as angular out-of-tolerance. If any of the above conditions is satisfied, it is determined that the current insert has an out-of-tolerance offset and enters the anomaly record processing flow.
[0095] After determining that there is an out-of-tolerance offset, the signs and amplitudes of the components in the position offset vector V are further analyzed to accurately calibrate the offset direction and offset degree. Specifically, the positive and negative signs of ΔX and ΔY respectively represent right / left, down / up offset, and the positive and negative values of θ represent clockwise or counterclockwise rotation of the insert relative to the reference direction. After combining these three numerical values with the sign information, they are bound to the unique number of the current insert to generate an anomaly record entry.
[0096] The anomaly record entry is written into the preset quality tracking database as traceable quality event information. Each record entry contains the following fields:
[0097] Insert number: A unique identifier automatically generated by the production line code and timestamp;
[0098] Three components of the offset vector V: including ΔX (unit: millimeter), ΔY (unit: millimeter), θ (unit: degree);
[0099] Out-of-tolerance type labels: such as "lateral out-of-tolerance", "angle out-of-tolerance", etc., multiple labels can coexist;
[0100] Offset value: refers to the absolute difference exceeding the tolerance range, used to assess the severity.
[0101] This information will serve as the data basis for subsequent mold anomaly detection, process optimization, and traceability analysis.
[0102] If all components of the offset vector V are within the limits of the tolerance model T, i.e., satisfying |ΔX|≤Tx; |ΔY|≤Ty; |θ|≤Tθ, then the insert is marked as acceptable. Simultaneously, the offset vector V of this insert is stored in the acceptable dataset as a reference sample for subsequent statistical analysis, process capability assessment, and standard baseline updates.
[0103] A heatmap of insert error distribution is constructed based on the offset data of multiple stampings to assess the mold condition or batch stability of steel sheets.
[0104] First, within a preset time period (e.g., every 1000 wafers inspected), the offset vectors V of all detected wafers are aggregated. Each wafer corresponds to a set of offset data, including lateral offset ΔX, longitudinal offset ΔY, and angular deviation θ, and is accompanied by a unique wafer number. All data is organized into an original data matrix D, in the following format: Where ID is the insert number and n is the number of statistical samples.
[0105] Subsequently, the position of each insert is mapped to a unified reference model coordinate system. Specifically, based on the positioning coordinates of the insert in the image, it is converted into normalized coordinates in two-dimensional pixel coordinates (e.g., with the center of the outer circle of the stamping as the origin, and the unit being millimeters). Then, its insert offset vector V is spatially projected to establish a spatial offset grid indexed by the insert number. The grid is divided into multiple rectangular or polar coordinate grid cells, each with a unique number, used to summarize the offset data within the region.
[0106] Within each grid cell, collect the offset data of all inserts falling within that region, and calculate the following two statistics:
[0107] Regional average offset (mean): This is the arithmetic mean of all ΔX and ΔY values in the region, representing the offset trend;
[0108] Regional dispersion indices (standard deviations): These are the standard deviations of ΔX and ΔY, representing the stability of the regional shift; denoted as μx and μy, and σx and σy, respectively. These statistics will serve as important parameters for heatmap generation.
[0109] Finally, a heatmap of the interpolation error distribution was constructed based on the above calculation results. In the heatmap, the color gradient represents the spatial migration intensity, where the color depth is determined by the local migration modulus. and its standard deviation The color of an area is darker and more dispersed than the offset value, reflecting abnormal trends such as decreased mold positioning accuracy or uneven springback of steel sheets.
[0110] This heat map can be overlaid on a standard template image, allowing quality management personnel to visually identify problem areas, which can then be used as a basis for mold condition monitoring, steel sheet batch evaluation, or process modification recommendations.
[0111] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application.
Claims
1. A method for detecting the positioning of a motor tab using optical recognition, characterized in that: The method comprises the following steps: Obtain a full-width high-resolution image G of the target punching sheet, including the patch area and the reference boundary area; Perform gray scale enhancement and reflection interference suppression processing on the full-width high-resolution image G, construct a patch edge gradient model E, and extract a patch candidate boundary point set P according to the patch edge gradient model E; According to the patch candidate boundary point set P, construct a patch contour initial polygon M0, and perform shape deformation matching on the patch contour initial polygon M0 through a shape prior model F to obtain a corrected patch contour M1; Obtain the center positioning feature of the stator or rotor in the full-width high-resolution image G, and calculate the relative offsets ΔX, ΔY and angular deviation θ between the center of gravity coordinates of the corrected patch contour M1 and the center positioning feature; Based on the relative offsets ΔX, ΔY and angular deviation θ, construct a patch position offset vector V, and compare it with a set tolerance model T to determine whether the patch is qualified; If the patch position offset vector V exceeds the limit of the tolerance model T, mark the current patch as abnormal according to the direction and amplitude of the patch position offset vector V, and record the patch number and offset feature into a database; Otherwise, mark it as qualified; Based on the offset data of multiple punching sheets, construct a patch error distribution heat map to evaluate the mold state or the stability of the steel sheet batch.
2. The motor tab positioning detection method using optical recognition according to claim 1, characterized in that: The method comprises the following steps: Based on the brightness histogram distribution of the full-width high-resolution image G, expand the overall gray scale range of the image; Perform frequency domain enhancement processing on the image to highlight the local gray scale change features of the patch contour; After completing the image preprocessing, extract the patch edge gradient information to construct the patch edge gradient model E.
3. The motor tab positioning detection method using optical recognition according to claim 2, characterized in that: The method comprises the following steps: Perform direction consistency analysis on the patch edge gradient model E, cluster all edge points according to the gradient direction, and select candidate edge segments with continuous gradient direction changes; Based on the pixel intensity gradient distribution of the candidate edge segments, remove the pseudo-edge points caused by punching sheet surface scratches and stains, and retain stable and continuous real structure edge points; Perform local geometric fitting on the retained real structure edge points, determine whether the edge points meet the patch geometric feature through the fitting residual, and mark the points meeting the feature as patch candidate boundary points; Reconstruct the marked patch candidate boundary points for connectivity to form a patch candidate boundary point set P.
4. The method for detecting the positioning of the motor insert sheet using optical recognition according to claim 1, characterized in that: The method comprises the following steps: Cluster the patch candidate boundary point set P according to spatial distribution, and determine the end point cluster and corner point cluster of each patch boundary by using a density-based clustering algorithm; Connect each cluster center to construct a patch contour initial polygon M0 according to the relative distribution order of the boundary points in the image, wherein each edge is a polyline segment and the end point is the point with the highest fitting confidence in the candidate boundary points; Construct a shape prior model F composed of a standard patch geometric template and its tolerance parameters, and use a thin plate spline function-based nonlinear deformation method to map the initial polygon M0 to the geometric structure closest to F. The mapped polygon contour is output as a modified patch contour M1, wherein each vertex position is optimized by a shape prior model constraint.
5. The method for detecting the positioning of the motor plug sheet using optical recognition according to claim 1, characterized in that: The relative offset ΔX, ΔY and angular deviation θ between the center of gravity of the calculated modified patch contour M1 and the center positioning feature are calculated, including: In the full-width high-resolution image G, a reference structure for center positioning is identified, including the outer circular boundary of the stator or the center hole of the rotor, and the circular center coordinates obtained by the circular Hough transform method are fitted as the center positioning feature C; The center of gravity of the modified patch contour M1 is calculated, and the arithmetic mean of the horizontal coordinates and the vertical coordinates of all vertexes is taken as the horizontal coordinate and the vertical coordinate of the center of gravity, respectively; According to the coordinate difference between the center of gravity and the center positioning feature C, the horizontal offset ΔX and the vertical offset ΔY of the patch position are calculated; Taking the center positioning feature C as the reference, the angle difference between the main edge direction of the modified patch contour M1 and the reference direction is calculated by the vector angle calculation method, and the angular deviation θ is obtained.
6. The method for detecting the positioning of the motor insert sheet using optical recognition according to claim 1, wherein: Wherein, based on the relative offset ΔX, ΔY and angular deviation θ, the patch position offset vector V is constructed and compared with the set tolerance model T to determine whether the patch is qualified, including: Obtain the relative offset parameters ΔX, ΔY and angular deviation θ of the modified patch contour M1 relative to the center positioning feature C, and combine them to construct the position offset vector V=(ΔX, ΔY, θ); Input the position offset vector V into the preset tolerance model T, and the tolerance model T includes the allowed horizontal offset range Tx, the allowed vertical offset range Ty and the allowed angular deviation range Tθ, and the offset judgment threshold set T=(Tx, Ty, Tθ) is established; Compare each component of the position offset vector V with the corresponding component of the tolerance model T. If the absolute offset values satisfy |ΔX|≤Tx, |ΔY|≤Ty and |θ|≤Tθ, respectively, it is determined that the structural offset of the current patch is within the acceptable range; If any component of the position offset vector V exceeds the corresponding tolerance range, the patch is marked as unqualified, and the offset vector V and the out-of-tolerance component are output; Mark the patch as qualified and record the offset vector V as statistical reference data, and output the patch qualification status information.
7. The motor tab positioning detection method using optical recognition according to claim 1, characterized in that: Wherein, according to the direction and amplitude of the patch position offset vector V, the current patch is marked as abnormal, including: After completing the threshold comparison of the position offset vector V and the tolerance model T, it is judged whether any component of the vector V exceeds the corresponding threshold range. If it does, it is determined that there is an out-of-tolerance offset; When it is determined that there is an out-of-tolerance offset, the offset direction and offset amplitude are determined according to the signs and numerical values of the three components ΔX, ΔY and θ of the position offset vector V, and the information is associated with the number of the current patch to generate an abnormal record entry; Write the abnormal record entry into the preset quality tracking database, including the patch number, the three components of the position offset vector V, the out-of-tolerance type label and the offset degree value; If the position offset vector V is within the range defined by the tolerance model T, the patch is marked as qualified, and its position offset vector V is stored as a qualified sample.
8. The motor tab positioning detection method using optical recognition according to claim 1, characterized in that: Constructing a patch error distribution heat map based on the offset data of multiple punches to evaluate the mold state or the stability of the steel sheet batch, comprising: Data aggregation is performed on the offset vectors V of all patches in the multiple punches identified within a preset time period to establish an original data matrix D containing patch numbers, offset components ΔX, ΔY and θ; The offset position of each patch is mapped to a unified reference model coordinate in the image coordinate system, and a spatial offset grid is constructed with patch numbers as indexes; The local average offset and standard deviation are calculated in each grid cell as the offset trend value and dispersion degree index of the region, respectively; A patch error distribution heat map is generated based on the offset trend value and dispersion degree index, and the heat map represents the spatial offset intensity in the form of color gradient.
Citation Information
Patent Citations
Offset detection method and device, conveying device and storage medium
CN117795549A
Motor stator and rotor iron core sheet stamping precision detection system
CN120451125A