Circuit board drilling abnormity intelligent detection method based on image recognition

Through the intelligent detection method of drilling abnormalities of the circuit board based on image recognition, the drilling grayscale image and spatial coordinates are analyzed, and the characteristic value of the drilling hole squid is calculated, the problem of low recognition accuracy of small abnormalities on the drilling surface in the prior art is solved, and higher recognition accuracy and more accurate abnormal detection are achieved.

CN120031815AInactive Publication Date: 2025-05-23HUIZHOU XINGCHUANGYU IND CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510084168.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-20
Publication Date
2025-05-23
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The prior art has low accuracy in identifying tiny abnormalities on the drilling surface of the circuit board in an industrial environment, making it difficult to effectively identify abnormalities on the drilling opening.

Method used

An intelligent detection method for drilling abnormalities of the circuit board based on image recognition is adopted. By obtaining the drilling grayscale image and spatial coordinates, the difference in drilling grayscale, irregularity and probability of the blade are analyzed, and the characteristic value of the drilling edge is calculated to judge the abnormal situation.

Benefits of technology

It improves the accuracy of identifying abnormalities on the drilling hole, reduces misjudgment, can effectively distinguish noise points from reflective points on the edge, avoid noise interference, and improves the accuracy of abnormal detection during the drilling process of the circuit board.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120031815A_ABST
    Figure CN120031815A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of printed circuit boards, in particular to a circuit board drilling abnormity intelligent detection method based on image recognition, and the method comprises the steps: obtaining a drilling gray image of a PCB, and the space coordinates of each drilling hole in the PCB; on the basis of gray distribution of all pixel points in the drill hole gray image, obtaining the outermost closed contour of each drill hole in the drill hole gray image, and obtaining the drill opening gray difference of each drill hole; on the basis of the shape features of the outmost closed outlines of all the drill holes, the drilling opening irregularity of all the drill holes is obtained; coordinate differences of all the drill holes are obtained; calculating a spatial characteristic index of each drill hole, and combining the coordinate difference to obtain a drill opening burr probability of each drill hole; further obtaining a drill opening burr characteristic value of each drill hole; and abnormal conditions in the circuit board drilling process are judged. The method and the device aim at improving the recognition precision of the burr abnormity of the drilling opening in the circuit board drilling process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of printed circuit boards, and in particular to an intelligent detection method for circuit board drilling anomalies based on image recognition. Background Art

[0002] Circuit board drilling is an important step in the manufacture of PCB printed circuit boards. It is used to install components and connect multi-layer circuit boards, and it plays a role in ensuring the conductivity and electrical performance of the circuit board. The accuracy of drilling directly affects the connectivity of the circuit. In high-speed or high-frequency circuits, abnormal drilling deviations will affect the signal transmission path, causing signal attenuation, reflection or crosstalk, thereby affecting the performance of the PCB printed circuit board.

[0003] Therefore, it is necessary to inspect the holes drilled in the circuit board. The commonly used inspection method is X-ray inspection. X-ray inspection uses image processing technology to perform non-contact inspection on PCB boards and automatically identify drilling positions and defects. However, the accuracy of identifying small abnormalities on the drilling surface is low in industrial environments. Summary of the invention

[0004] In view of the above, it is necessary to provide an intelligent detection method for circuit board drilling anomalies based on image recognition. Compared with the traditional intelligent detection method for circuit board drilling anomalies, the recognition accuracy of drill burr abnormalities during the circuit board drilling process is improved.

[0005] The circuit board drilling anomaly intelligent detection method based on image recognition in this application adopts the following technical solutions:

[0006] An embodiment of the present application provides an intelligent detection method for circuit board drilling anomalies based on image recognition, the method comprising the following steps:

[0007] Obtaining a grayscale image of the holes drilled on the PCB and the spatial coordinates of each hole drilled on the PCB;

[0008] Based on the grayscale distribution of all pixels in the grayscale image of the drilling hole, the grayscale value of the copper foil of the PCB circuit board and the outermost closed contour of each drilling hole in the grayscale image of the drilling hole are obtained. By comparing the grayscale value of each pixel in the neighborhood of the outermost closed contour with the grayscale value of the copper foil, and combining the position distribution of all pixels in the neighborhood, the grayscale difference of the drill opening of each drilling hole is obtained.

[0009] Based on the shape characteristics of the outermost closed contour at each borehole, the drill hole irregularity of each borehole is obtained;

[0010] By analyzing the spatial coordinate distribution of the boreholes in the vicinity of each borehole, and comparing the deviation of the spatial coordinate distribution of all the boreholes, the coordinate difference of each borehole is obtained;

[0011] A three-dimensional surface map of the PCB circuit board is obtained based on the spatial coordinates of all the drill holes, and a spatial characteristic index of each drill hole is obtained based on the gradient of the position of each drill hole on the three-dimensional surface map and the spatial distance between each drill hole and the drill holes in its adjacent range;

[0012] Based on the coordinate difference and the spatial characteristic index, the probability of the drill hole flash of each borehole is obtained; based on the drill hole grayscale difference, the drill hole irregularity and the drill hole flash probability, the characteristic value of the drill hole flash of each borehole is obtained;

[0013] Based on the distribution of the drill burr characteristic values ​​of all drill holes, the abnormal conditions in the circuit board drilling process are judged.

[0014] In one embodiment, the grayscale value of the copper foil and the outermost closed contour of each drill hole in the drill hole grayscale image are obtained by:

[0015] The grayscale value of the copper foil is the grayscale value with the highest frequency in the drilling grayscale image;

[0016] The edge detection algorithm is used to perform edge detection on the grayscale image of the drilling hole. The edge detection result is used as input, and the contour search algorithm is used to output the outermost closed contour of each drilling hole in the grayscale image of the drilling hole.

[0017] In one embodiment, the process of obtaining the grayscale difference of the drill opening is:

[0018] The preset neighborhood range of all pixel points in each outermost closed contour is used to form the extended area of ​​each outermost closed contour;

[0019] Calculate the difference between the grayscale value of each pixel in each extended area and the grayscale value of the copper foil;

[0020] A threshold segmentation algorithm is used to obtain a segmentation threshold of all the differences in each extended area, and a pixel point in each extended area whose difference is greater than the segmentation threshold is used as a feature point;

[0021] Calculate the discrete degree of the horizontal coordinate value and the discrete degree of the vertical coordinate value of all feature points in each extended area respectively;

[0022] The grayscale difference of the drill hole is negatively correlated with the discrete degree of the horizontal coordinate value and the discrete degree of the vertical coordinate value corresponding to each drill hole, and is proportional to the proportion of the number of feature points in the extended area corresponding to each drill hole in all pixel points.

[0023] In one embodiment, the grayscale difference of the drill opening is calculated as follows:

[0024] Calculate the sum of the discrete degree of the abscissa value corresponding to each borehole, the discrete degree of the ordinate value and a preset value greater than 0;

[0025] The drill opening grayscale difference is the ratio of the quantity proportion to the sum value.

[0026] In one embodiment, the process of obtaining the drill hole irregularity is as follows:

[0027] The pixel point sequences on each outermost closed contour are obtained by the chain code method, and the slopes of each pixel point in each pixel point sequence are calculated by the coordinates of each pixel point in each pixel point sequence and its adjacent pixel points, and each power sequence is formed according to the arrangement order of each pixel point in the pixel point sequence;

[0028] The mutation point detection algorithm is used to obtain the mutation data in the first-order difference sequence of each power sequence;

[0029] The drill hole irregularity is the proportion of mutation data in the first-order difference sequence corresponding to each borehole in all data.

[0030] In one embodiment, the coordinate difference is obtained by:

[0031] Projecting the spatial coordinates of all boreholes onto a preset plane, and taking the boreholes within a preset neighborhood of any borehole on the preset plane as the neighboring boreholes of the any borehole;

[0032] Calculating the average coordinate values ​​of all the boreholes in a direction perpendicular to the preset plane;

[0033] Calculate the difference between the coordinate values ​​of each neighboring borehole of any borehole in a direction perpendicular to the preset plane and the mean value of the coordinate values;

[0034] The coordinate difference of any one borehole is the average of all the difference values ​​corresponding to any one borehole.

[0035] In one embodiment, the process of obtaining the spatial feature index is as follows:

[0036] Calculate the average spatial distance between each borehole and all its neighboring boreholes;

[0037] The spatial characteristic index is the ratio of the modulus of the gradient to the average value.

[0038] In one embodiment, the drill bit flash probability is the product of the coordinate difference and the spatial characteristic index.

[0039] In one embodiment, the expression of the drill bit flash characteristic value is:

[0040] Where V i represents the drill bit flash characteristic value of the i-th drill hole; P i represents the grayscale difference of the drill hole of the i-th drill hole; i represents the irregularity of the drill hole of the i-th borehole; τ i represents the probability of drill bit burst of the ith borehole.

[0041] In one embodiment, the process of determining an abnormal situation during the circuit board drilling process is as follows:

[0042] The segmentation threshold of the drill bit flash feature values ​​of all the drill holes obtained by the threshold segmentation algorithm is recorded as the feature segmentation threshold, and the drill holes with drill bit flash feature values ​​greater than the feature segmentation threshold are regarded as flash drill holes;

[0043] If the proportion of flash drilling in all drillings is greater than a preset abnormal threshold, it is determined that an abnormality exists in the drilling process of the circuit board; otherwise, no abnormality exists.

[0044] This application has at least the following beneficial effects:

[0045] This application uses image recognition technology to obtain the grayscale difference of the drill hole according to the reflective characteristics of the drill hole burr of the PCB circuit board, effectively distinguish between noise points and burr reflective points, and reduce the misjudgment of the abnormal drill hole burr; based on the characteristic that the drill hole burr will destroy the shape characteristics of the drill hole, the drill hole irregularity of the drill hole is obtained to improve the recognition accuracy of the abnormal drill hole burr;

[0046] Furthermore, by analyzing the spatial coordinate distribution of the drill holes, the coordinate difference is obtained to reflect the curvature of the PCB circuit board. Combined with the three-dimensional distribution characteristics of the drill holes, the probability of drill hole flash is obtained to reflect the possibility of abnormal drill hole flash.

[0047] Furthermore, by correcting the drill image features in the drill grayscale image through the drill burr probability, noise interference in the drill grayscale image can be avoided. From the perspective of the cause of drill burr, the characteristic value of tiny drill burr in the drill grayscale image is enhanced, thereby improving the recognition accuracy of drill burr abnormalities during the circuit board drilling process. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present application or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0049] Figure 1A flowchart of the steps of the circuit board drilling anomaly intelligent detection method based on image recognition provided in this application;

[0050] Figure 2 is a schematic diagram of the detection device;

[0051] Figure 3 It is a schematic diagram of the fitting of the PCB circuit board and the supporting panel;

[0052] Figure 4 Schematic diagram of the process for obtaining the drill bit flash characteristic value. DETAILED DESCRIPTION

[0053] In the description of the embodiments of the present application, words such as "exemplary", "or", "for example" and the like are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary", "or", "for example" and the like is intended to present related concepts in a concrete manner.

[0054] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art in the present application. The terms used in the present application are only for the purpose of describing specific embodiments and are not intended to limit the present application. It should be understood that, unless otherwise specified, " / " means or.

[0055] It should also be noted that the terms "first" and "second" in the present application are used to distinguish similar objects rather than to describe a specific order or sequence.

[0056] The specific scheme of the circuit board drilling anomaly intelligent detection method based on image recognition provided by the present application is described in detail below with reference to the accompanying drawings.

[0057] An embodiment of the present application provides an intelligent detection method for circuit board drilling anomalies based on image recognition. Specifically, the following intelligent detection method for circuit board drilling anomalies based on image recognition is provided. Figure 1 , the method comprises the following steps:

[0058] Step 1: Obtain a grayscale image of the drilling holes on the PCB circuit board and the spatial coordinates of each drilling hole on the PCB circuit board.

[0059] During the PCB drilling process, the PCB is first automatically placed and fixed on the drilling table, the support panel is placed under the PCB, a drill bit of appropriate specifications is selected according to the design requirements, and a drilling machine is used to perform drilling operations according to the program to form holes on the PCB.

[0060] A grating ruler and a data acquisition card are installed inside the drilling machine to record the real-time position of the drilling nozzle of the drilling machine and obtain the spatial coordinates of each drill hole. A board position sensor is connected to the PCB circuit board. When the drilling nozzle of the drilling machine contacts the PCB circuit board, the board position sensor will send a board position signal of the PCB circuit board. After receiving the board position signal from the board position sensor, the data acquisition card immediately collects the current grating ruler's drill nozzle position information and records it as the spatial coordinates of the drilling hole, where the drill nozzle position information is specifically the (x, y, z) coordinates of the drill nozzle in the drilling coordinate system, where the drilling coordinate system is a world coordinate system with the starting position of the drilling machine as the origin.

[0061] After drilling a hole on the PCB circuit board, the present application places a detection device on the PCB circuit board, wherein the schematic diagram of the detection device is as shown in FIG. Figure 2 As shown, Figure 2 101 is a CCD camera, 102 is a first light source, 103 is a second light source, and 104 is a fixing bracket. When the PCB circuit board is inspected, the first light source 102 and the second light source 103 are turned on to fill light for the PCB circuit board below, and the drilling image of the PCB circuit board is collected by the CCD camera.

[0062] In order to improve the accuracy of subsequent image feature extraction and image detection, the drilling image is first preprocessed. The preprocessing specifically includes first denoising the drilling image, then sharpening the denoised drilling image to highlight the edge contour information, and finally graying the sharpened drilling image to obtain a drilling grayscale image. Among them, the graying process is a well-known technology, and the specific process is not repeated in this application.

[0063] In this embodiment, a bilateral filtering algorithm is used to denoise the borehole image. The bilateral filtering algorithm is a well-known technology and will not be described in detail in this application. As other implementation methods, on the basis of being able to denoise the borehole image, the implementer may adopt other existing technologies, such as Gaussian filtering, mean filtering, etc., and this application does not impose any special restrictions.

[0064] In this embodiment, the Laplace algorithm is used to sharpen the denoised borehole image. The Laplace algorithm is a well-known technology and will not be described in detail in this application. As other implementation methods, on the basis of being able to sharpen the denoised borehole image, the implementer may adopt other existing technologies, such as Roberts operator, Sobel operator, etc., and this application does not make any special restrictions.

[0065] Step 2: Based on the grayscale distribution of all pixels in the grayscale image of the drilling hole, the grayscale value of the copper foil of the PCB circuit board and the outermost closed contour of each drill hole in the grayscale image of the drilling hole are obtained. By comparing the grayscale value of each pixel in the neighborhood of the outermost closed contour with the grayscale value of the copper foil, and combining the position distribution of all pixels in the neighborhood, the grayscale difference of the drill mouth of each drill hole is obtained.

[0066] The drilling form in the PCB circuit board is a circuit board via with different apertures, and its main function is electrical conduction. The PCB circuit board is a multi-layer structure composed of two layers of copper foil and interlayer materials. The hardness of the materials in different layers is different, and the thickness difference is large. During the drilling process of the drilling machine, it is easy to produce irregular and sharp copper foil protrusions, that is, burrs. In the grayscale image of the drilling of the PCB circuit board, the copper foil has a metallic luster and a high grayscale value. The burrs of the drill holes of the PCB circuit board are abnormally prominent, irregular in shape, and the sizes of the drill burrs are also different. Some drill holes have a large burr area, forming a burr surface perpendicular to the fill light, resulting in a higher grayscale value than the copper foil of the PCB circuit board.

[0067] Based on the above analysis, an edge detection algorithm is used to perform edge detection on the grayscale image of the drilling hole of the PCB circuit board, and the edge detection result is used as input. The outermost closed contour of each drilling hole in the grayscale image of the drilling hole is output using the contour search algorithm, where each outermost closed contour corresponds to a drilling hole on the PCB circuit board. In this embodiment, the cv2.findContours function in the OpenCV library is used to obtain the outermost closed contour of each drilling hole in the grayscale image of the drilling hole.

[0068] In this embodiment, the Canny edge detection algorithm is used to perform edge detection on the grayscale image of the drill hole. The Canny edge detection algorithm is a well-known technology and will not be described in detail in this application. On the basis of being able to realize edge detection on the grayscale image of the drill hole, as other implementation methods, the implementer may adopt other existing technologies, such as the Sobel operator, the Prewitt operator, etc., and this application does not make any special restrictions.

[0069] Since the copper foil area in the drilling grayscale image is larger than the drilling area, the occurrence frequency of each grayscale value in the drilling grayscale image is counted, and the grayscale value with the largest occurrence frequency is taken as the grayscale value of the copper foil of the PCB circuit board.

[0070] The drill burrs are concentrated at the edge of the drill hole, that is, there are burr reflective points near the outermost closed contour of the drill hole grayscale image. This application takes each pixel point in each outermost closed contour as the center, constructs a neighborhood range of a preset size, and uses the union of the preset neighborhood ranges of all pixel points in each outermost closed contour as the extended area of ​​each outermost closed contour.

[0071] In this embodiment, an N×N square window is constructed with each pixel in each outermost closed contour as the center, and the value of N is 5. The value of N is preset manually and can be set by the implementer. This application does not impose any special restrictions.

[0072] Since there are noise points in the grayscale image of the drilling hole, the grayscale value of the noise points is too large, which makes it difficult to distinguish between the noise points and the flash reflective points. Therefore, the difference between the grayscale value of each pixel point in each extended area and the grayscale value of the copper foil is calculated, and the threshold segmentation algorithm is used to obtain the segmentation threshold of all the differences in each extended area. The pixel points in each extended area whose difference is greater than the segmentation threshold are taken as feature points. The obtained feature points may be the flash reflective points of the drill mouth. At the same time, the upper left corner pixel point in the grayscale image of the drilling hole is taken as the origin, the horizontal direction is taken as the horizontal axis, and the vertical direction is taken as the vertical axis. The image coordinate system is constructed, and the discrete degree of the horizontal coordinate value and the discrete degree of the vertical coordinate value of all feature points in each extended area are calculated respectively.

[0073] In this embodiment, the Otsu threshold segmentation algorithm is used to obtain the segmentation threshold of all the differences in each extended area. The Otsu threshold segmentation algorithm is a well-known technology and will not be described in detail in this application. As other implementation methods, on the basis of being able to obtain the segmentation threshold of all the differences in each extended area, the implementer may adopt other existing technologies, such as global threshold segmentation, iterative threshold segmentation, etc., and this application does not make any special restrictions.

[0074] In this embodiment, the discreteness of the horizontal coordinate values ​​and the discreteness of the vertical coordinate values ​​of all feature points in each extended area are both standard deviations. As other implementation methods, on the basis of being able to measure the uneven distribution of the horizontal coordinate values ​​and the vertical coordinate values ​​of all feature points in each extended area, the implementer may adopt other existing technologies, such as variance, coefficient of variation, etc., and this application does not impose any special restrictions.

[0075] Furthermore, based on the position distribution of the feature points in the extended area corresponding to each borehole and the proportion of the feature points in all pixel points, the grayscale difference of the drill mouth of each borehole is obtained, and the expression is:

[0076] Where P i represents the grayscale difference of the drill hole of the i-th drill hole; η i represents the ratio of the number of feature points in the extended area corresponding to the i-th drilling hole to all the pixels; B i,1 Indicates the discrete degree of the horizontal coordinate values ​​of all feature points in the extended area corresponding to the i-th borehole; B i,2 It represents the degree of discreteness of the ordinate values ​​of all feature points in the extended area corresponding to the i-th borehole; α represents a preset value greater than 0, which is used to avoid the denominator being 0. The value of α is preset manually and can be set by the implementer. In this embodiment, the value of α is 0.01.

[0077] It should be noted that: when the feature points in the extended area of ​​the outermost closed contour are more concentrated, that is, B i,1 +B i,2 The smaller it is, the less noise components there are in the feature points, and the more the number of feature points can represent the number of flashing reflective points. At the same time, the more the number of feature points in the extended area of ​​the outermost closed contour accounts for, that is, η i The larger the value is, the higher the flash reflection intensity is near the drill hole, the more significant the flash phenomenon is, and the grayscale difference P of the drill hole is. i The bigger.

[0078] Step 3: Based on the shape characteristics of the outermost closed contour at each drill hole, the drill hole irregularity of each drill hole is obtained.

[0079] In the grayscale image of drilling holes on a PCB, since the via holes on the PCB are circular drill holes, the drill holes on the PCB have different sizes of burrs and are irregular. Even if the drill hole burr area is small and the grayscale difference Pi of the drill hole is low, the insignificant drill hole burr can still easily destroy the circular feature of the drill hole.

[0080] Based on the above analysis, the pixel point sequence on each outermost closed contour is obtained by the chain code method, and the slope of each pixel point in each pixel point sequence is calculated by the coordinates of each pixel point in each pixel point sequence and its adjacent pixel points, and each power sequence is formed according to the arrangement order of each pixel point in the pixel point sequence. The mutation point detection algorithm is used to obtain the mutation data in the first-order difference sequence of each power sequence, and the proportion of the mutation data in the first-order difference sequence corresponding to each borehole in all data is used as the drill mouth irregularity of each borehole, which is used to reflect the degree of damage of the drill mouth burr to the regular characteristics of the drill mouth morphology. Among them, the chain code method and the calculation of the slope are both well-known technologies, and this application will not repeat them.

[0081] In this embodiment, the slope is calculated using the coordinates of each pixel point and its adjacent previous pixel point. For the first pixel point in the pixel point sequence, the last pixel point in the pixel point sequence is used as the adjacent previous pixel point of the first pixel point. As another implementation method, the implementer may calculate the slope using the coordinates of each pixel point and its adjacent next pixel point. For the last pixel point in the pixel point sequence, the first pixel point in the pixel point sequence is used as the adjacent next pixel point of the last pixel point.

[0082] In this embodiment, the Bernaola Galvan segmentation algorithm is used to obtain mutation data in the first-order difference sequence of each power sequence. The Bernaola Galvan segmentation algorithm is a well-known technology and will not be described in detail in this application. As other implementation methods, on the basis of being able to obtain mutation data in the first-order difference sequence of each power sequence, the implementer may adopt other existing technologies, such as the Pettitt mutation point detection algorithm, the Mann-Kendall mutation point detection algorithm, etc., and this application does not make any special restrictions.

[0083] Step 4: By analyzing the spatial coordinate distribution of the boreholes in the vicinity of each borehole and comparing it with the deviation of the spatial coordinate distribution of all the boreholes, the coordinate difference of each borehole is obtained.

[0084] However, the acquisition scene of the borehole grayscale image is an industrial production environment with great noise interference, and the morphological characteristics of the drill hole are highly sensitive to noise interference. Noise interference will also cause the circular characteristics of the drill hole to be destroyed. For the tiny drill hole burrs in the borehole grayscale image, image recognition technology is difficult to effectively identify them, and there is a phenomenon of misjudgment and wrong judgment of drilling anomalies.

[0085] Furthermore, during the drilling process of the PCB, the appearance of drilling flash is related to the degree of curvature of the PCB. The PCB is a multi-layer structure with a large thickness. A PCB with a large curvature cannot fit tightly with the support panel, and there is an obvious gap between the PCB and the support panel. The schematic diagram of the fitting of the PCB and the support panel is shown in Figure 3 As shown, Figure 3 201 is the drilling head of the drilling machine, 202 is the PCB circuit board, and 203 is the support panel. Figure 3 Some areas of the PCB circuit board are not tightly attached to the support panel and are in a suspended state. When the drilling machine drills a hole near the suspended PCB circuit board, the copper foil will be brought out during the drilling process of the drill bit, forming a sharp edge at the drill mouth.

[0086] The spatial coordinates of all boreholes are projected onto a preset plane to obtain the projection coordinates of each borehole. A circle with a radius of R is constructed on the preset plane with the projection coordinates of any borehole as the midpoint, and each borehole within the circle is used as each neighboring borehole of the any borehole. Based on the coordinate value distribution of each neighboring borehole of each borehole in the direction perpendicular to the preset plane, compared with the deviation of the coordinate value distribution of all boreholes in the direction perpendicular to the preset plane, the coordinate difference of each borehole is obtained, and the expression is:

[0087] In the formula, represents the coordinate difference of the i-th drilling hole; M i represents the number of neighboring boreholes of the ith borehole; h i,mrepresents the coordinate value of the ith drilling hole in the direction perpendicular to the preset plane; H i It represents the average coordinate value of all the holes in the direction perpendicular to the preset plane.

[0088] In this embodiment, the preset plane is the XOY plane, and the coordinate value in the direction perpendicular to the preset plane is the z coordinate value, that is, the z coordinate value in the spatial coordinate of the drilling hole.

[0089] In this embodiment, the value of R is w×d, where d is the diameter of the drill hole, which is read from the drilling machine program file, and w is a preset constant greater than 1. The value of w is preset manually and can be set by the implementer. In this embodiment, the value of w is 4.

[0090] It should be noted that: If The larger the value is, the more likely the PCB circuit board at the location of the i-th drilling hole is to deviate from the normal PCB circuit board height. The larger the value is, the greater the degree of suspension of the PCB circuit board at the location of the i-th drill hole, and the more likely the i-th drill hole will have drilling flash.

[0091] Step 5, obtaining a three-dimensional surface map of the PCB circuit board based on the spatial coordinates of all the drill holes, and obtaining a spatial characteristic index of each drill hole based on the gradient of the position of each drill hole on the three-dimensional surface map and the spatial distance between each drill hole and the drill holes in its adjacent range.

[0092] During the drilling process of PCB circuit boards, the steeper the board surface information at the drilling location, the more difficult it is for the supporting panel to provide effective support during drilling, reducing the working force of the drill bit. At the same time, when two holes are too close, the material on one side is too thin when drilling the second hole, the drilling machine drill bit is unevenly stressed, and the holes in the curved board are more likely to form flashes.

[0093] Based on the above analysis, firstly, the spatial coordinates of all the holes are used as the input of the surface fitting algorithm based on NURBS curves, and the three-dimensional surface diagram of the PCB circuit board is output, wherein the surface fitting algorithm based on NURBS curves can be specifically implemented by PointcloudtoNURBS software; secondly, in the three-dimensional surface diagram of the PCB circuit board, the gradient of each hole position on the three-dimensional surface diagram is calculated, and the modulus of the gradient is calculated, and the modulus of the gradient is used to reflect the steepness of the hole position on the PCB circuit board; then, the Euclidean distance of the spatial coordinates between each hole and its neighboring holes is calculated, and the average value of the Euclidean distance between each hole and all its neighboring holes is calculated, which is used to reflect the material thickness of the PCB circuit board during drilling; wherein, calculating the gradient of each hole position on the three-dimensional surface diagram is a well-known technology, and this application will not repeat it;

[0094] Finally, the ratio of the modulus of the gradient to the average value is used as the spatial characteristic index of each drill hole, which is used to reflect the degree to which the curvature of the PCB circuit board promotes the formation of the flash. Among them, when the modulus of the gradient is larger, it means that the steepness of the drilling position on the PCB circuit board is higher. At the same time, the smaller the average value is, the smaller the spacing between the drill holes is, and the thinner the PCB circuit board material is during the drilling process. At this time, the drill hole located at the curvature position of the PCB circuit board is more likely to form a flash, and the larger the spatial characteristic index is.

[0095] Step 6, based on the coordinate difference and the spatial characteristic index, obtain the probability of drill hole flash of each borehole; based on the drill hole grayscale difference, the drill hole irregularity and the drill hole flash probability, obtain the drill hole flash characteristic value of each borehole.

[0096] Furthermore, the product of the coordinate difference of each drill hole and the spatial characteristic index is used as the probability of drill burr of each drill hole. The larger the spatial characteristic index is, the more significant the promotion degree of the board curvature of the PCB circuit board at the drilling position to the formation of burr is. At the same time, when the coordinate difference is larger, it means that the board curvature of the PCB circuit board is greater, the drilling hole is more likely to have drill burr, and the probability of drill burr is greater.

[0097] Furthermore, since the analysis of the grayscale image of the borehole is performed in a two-dimensional plane, and the analysis of the borehole coordinates is performed in a three-dimensional space, in order to combine the analysis results in the two-dimensional plane and the three-dimensional space, the image coordinate system is converted into the borehole coordinate system using the coordinate system transformation technology according to the image coordinate system of the grayscale image of the borehole and the camera parameters of the CCD camera during the image acquisition process, wherein the camera parameters can be obtained through the camera specification sheet, and the coordinate system transformation is a well-known technology, and the specific process is not repeated. On the XOY plane under the borehole coordinate system, the outermost closed contour area containing the (x, y) coordinates of any borehole is counted, and the borehole corresponding to the outermost closed contour area is the same borehole as any of the boreholes, and then the drill hole grayscale difference, drill hole irregularity and drill hole flash probability of each borehole can be obtained.

[0098] Furthermore, since the probability of drill hole flash is calculated by the grating ruler and data acquisition card of the drilling machine, it has good anti-industrial noise interference ability. Therefore, based on the drill hole grayscale difference, drill hole irregularity and drill hole flash probability of each drill hole, the drill hole flash characteristic value of each drill hole is obtained, and the expression is:

[0099] Where V i represents the drill bit flash characteristic value of the i-th drill hole; P i represents the grayscale difference of the drill hole of the i-th drill hole; i represents the irregularity of the drill hole of the i-th borehole; τ irepresents the probability of drill bit flash of the ith borehole. The purpose of +1 is to prevent the base number P×λ<1.

[0100] It should be noted that: when the probability of drilling head flash τ i The larger the value is, the greater the probability of drill burr appearing in the borehole. Its beneficial effect is to avoid noise interference in the grayscale image of the borehole. From the perspective of the cause of the drill burr, the feature value of the tiny drill burr in the grayscale image of the borehole is enhanced to improve the recognition accuracy of the abnormal drill burr. At the same time, when P i ×λ i The larger the value is, the more significant the flash reflective feature of the drill hole is, the more irregular the drill hole shape is, and the more the drill hole conforms to the flash feature of the drill hole, then the flash feature value V i The larger the drill bit is, the larger the drill bit is. Figure 4 shown.

[0101] Step 7: Based on the distribution of the drill burr characteristic values ​​of all the drill holes, determine the abnormal conditions in the circuit board drilling process.

[0102] The threshold segmentation algorithm is used to obtain the segmentation threshold of the drill hole flash feature value of all boreholes, and the boreholes with drill hole flash feature values ​​greater than the segmentation threshold are regarded as flash drill holes.

[0103] In this embodiment, the Otsu threshold segmentation algorithm is used to obtain the segmentation threshold of the drill cut feature value of all boreholes. The Otsu threshold segmentation algorithm is a well-known technology and will not be described in detail in this application. As other implementation methods, on the basis of the segmentation threshold that can be used to obtain the drill cut feature value of all boreholes, the implementer may adopt other existing technologies, such as global threshold segmentation, iterative threshold segmentation, etc., and this application does not impose any special restrictions.

[0104] During the drilling process of PCB circuit boards, due to the actual errors between the drilling machine and the PCB circuit board during operation, it is normal for a small number of drill holes to have drill burrs, which can be removed by external grinding later. However, when the proportion of drill holes with drill burrs is too high, it is very likely that there will be abnormal conditions during the drilling process of the circuit board, such as improper drilling parameter settings, unclean cleaning of the PCB circuit board, or abnormal spindle speed.

[0105] Furthermore, if the proportion of flash drilled holes in all drilled holes is greater than a preset abnormality threshold, it is determined that there is an abnormality in the drilling process of the circuit board, and the staff or administrator is reminded to inspect and maintain the drilling process of the PCB circuit board; if the proportion of flash drilled holes in all drilled holes is less than or equal to the preset abnormality threshold, it is determined that there is no abnormality in the drilling process of the circuit board, and the drill burr abnormality is within the allowable error range, and the PCB circuit board is polished using a polishing device to remove the drill burr of the drilled holes.

[0106] In this embodiment, the value of the preset abnormal threshold is 0.3. The value of the preset abnormal threshold is preset manually and can be set by the implementer. This application does not impose any special restrictions.

[0107] In summary, the present application uses image recognition technology to obtain the grayscale difference of the drill hole according to the reflective characteristics of the drill hole burr of the PCB circuit board, effectively distinguish the noise points and the burr reflective points, and reduce the misjudgment of the abnormal drill hole burr; according to the characteristic that the drill hole burr will destroy the shape characteristics of the drill hole, the drill hole irregularity of the drill hole is obtained, and the recognition accuracy of the abnormal drill hole burr is improved;

[0108] Furthermore, by analyzing the spatial coordinate distribution of the drill holes, the coordinate difference is obtained to reflect the curvature of the PCB circuit board. Combined with the three-dimensional distribution characteristics of the drill holes, the probability of drill hole flash is obtained to reflect the possibility of abnormal drill hole flash.

[0109] Furthermore, by correcting the drill image features in the drill grayscale image through the drill burr probability, noise interference in the drill grayscale image can be avoided. From the perspective of the cause of drill burr, the characteristic value of tiny drill burr in the drill grayscale image is enhanced, thereby improving the recognition accuracy of drill burr abnormalities during the circuit board drilling process.

[0110] The flowchart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to the embodiment of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of the code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. In some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, which can depend on the functions involved. In the description corresponding to the flowchart and the block diagram in the accompanying drawings, the operations or steps corresponding to different boxes can also occur in a different order from the order disclosed in the description, and sometimes there is no specific order between different operations or steps. For example, two consecutive operations or steps can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, which can depend on the functions involved. Each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented by a dedicated hardware-based system that performs the specified functions or actions, or may be implemented by a combination of dedicated hardware and computer instructions.

[0111] It is obvious to those skilled in the art that the present application is not limited to the details of the above exemplary embodiments, and that the present application can be implemented in other specific forms without departing from the basic features of the present application. Therefore, no matter from which point of view, the above embodiments of the present application should be regarded as exemplary and non-restrictive.

Claims

1. An intelligent detection method for circuit board drilling anomalies based on image recognition, characterized in that: The method comprises the following steps: Obtaining a grayscale image of the holes drilled on the PCB and the spatial coordinates of each hole drilled on the PCB; Based on the grayscale distribution of all pixels in the grayscale image of the drilling hole, the grayscale value of the copper foil of the PCB circuit board and the outermost closed contour of each drilling hole in the grayscale image of the drilling hole are obtained. By comparing the grayscale value of each pixel in the neighborhood of the outermost closed contour with the grayscale value of the copper foil, and combining the position distribution of all pixels in the neighborhood, the grayscale difference of the drill opening of each drilling hole is obtained. Based on the shape characteristics of the outermost closed contour at each borehole, the drill hole irregularity of each borehole is obtained; By analyzing the spatial coordinate distribution of the boreholes in the vicinity of each borehole, and comparing the deviation of the spatial coordinate distribution of all the boreholes, the coordinate difference of each borehole is obtained; A three-dimensional surface image of the PCB circuit board is obtained based on the spatial coordinates of all the drill holes, and a spatial characteristic index of each drill hole is obtained based on the gradient of the position of each drill hole on the three-dimensional surface image and the spatial distance between each drill hole and the drill holes in its adjacent range; Based on the coordinate difference and the spatial characteristic index, the probability of the drill hole flash of each borehole is obtained; based on the drill hole grayscale difference, the drill hole irregularity and the drill hole flash probability, the characteristic value of the drill hole flash of each borehole is obtained; Based on the distribution of the drill burr characteristic values ​​of all drill holes, the abnormal conditions in the circuit board drilling process are judged.

2. The circuit board drilling anomaly intelligent detection method based on image recognition as claimed in claim 1, characterized in that: The grayscale value of the copper foil and the outermost closed contour of each drill hole in the drill hole grayscale image are obtained by: The grayscale value of the copper foil is the grayscale value with the highest frequency in the drilling grayscale image; The edge detection algorithm is used to perform edge detection on the drilling grayscale image. The edge detection result is used as input, and the contour search algorithm is used to output the outermost closed contour of each drilling hole in the drilling grayscale image.

3. The circuit board drilling anomaly intelligent detection method based on image recognition as claimed in claim 1, characterized in that: The process of obtaining the grayscale difference of the drill opening is as follows: The preset neighborhood range of all pixel points in each outermost closed contour is used to form the extended area of ​​each outermost closed contour; Calculate the difference between the grayscale value of each pixel in each extended area and the grayscale value of the copper foil; A threshold segmentation algorithm is used to obtain a segmentation threshold of all the differences in each extended area, and a pixel point in each extended area whose difference is greater than the segmentation threshold is used as a feature point; Calculate the discrete degree of the horizontal coordinate value and the discrete degree of the vertical coordinate value of all feature points in each extended area respectively; The grayscale difference of the drill hole is negatively correlated with the discrete degree of the horizontal coordinate value and the discrete degree of the vertical coordinate value corresponding to each drill hole, and is proportional to the proportion of the number of feature points in the extended area corresponding to each drill hole in all pixel points.

4. The circuit board drilling anomaly intelligent detection method based on image recognition as claimed in claim 3, characterized in that: The calculation method of the drill opening grayscale difference is: Calculate the sum of the discrete degree of the abscissa value corresponding to each borehole, the discrete degree of the ordinate value and a preset value greater than 0; The drill opening grayscale difference is the ratio of the quantity proportion to the sum value.

5. The circuit board drilling anomaly intelligent detection method based on image recognition as claimed in claim 1, characterized in that: The process of obtaining the drill hole irregularity is as follows: The pixel point sequences on each outermost closed contour are obtained by the chain code method, and the slopes of each pixel point in each pixel point sequence are calculated by the coordinates of each pixel point in each pixel point sequence and its adjacent pixel points, and each power sequence is formed according to the arrangement order of each pixel point in the pixel point sequence; The mutation point detection algorithm is used to obtain the mutation data in the first-order difference sequence of each power sequence; The drill hole irregularity is the proportion of mutation data in the first-order difference sequence corresponding to each borehole in all data.

6. The circuit board drilling anomaly intelligent detection method based on image recognition as claimed in claim 1, characterized in that: The process of obtaining the coordinate difference is: Projecting the spatial coordinates of all boreholes onto a preset plane, and taking the boreholes within a preset neighborhood of any borehole on the preset plane as the neighboring boreholes of the any borehole; Calculating the average coordinate values ​​of all the boreholes in a direction perpendicular to the preset plane; Calculate the difference between the coordinate values ​​of each neighboring borehole of any borehole in a direction perpendicular to the preset plane and the mean value of the coordinate values; The coordinate difference of any one borehole is the average of all the difference values ​​corresponding to any one borehole.

7. The circuit board drilling anomaly intelligent detection method based on image recognition as claimed in claim 6, characterized in that: The process of obtaining the spatial feature index is as follows: Calculate the average spatial distance between each borehole and all its neighboring boreholes; The spatial characteristic index is the ratio of the modulus of the gradient to the average value.

8. The circuit board drilling anomaly intelligent detection method based on image recognition as claimed in claim 1, characterized in that: The drill bit flash probability is the product of the coordinate difference and the spatial characteristic index.

9. The circuit board drilling anomaly intelligent detection method based on image recognition as claimed in claim 1, characterized in that: The expression of the drill bit flash characteristic value is: Where V i represents the drill bit flash characteristic value of the i-th drill hole; P i represents the grayscale difference of the drill hole of the i-th drill hole; i represents the irregularity of the drill hole of the i-th borehole; τ i represents the probability of drill bit burst of the ith borehole.

10. The circuit board drilling anomaly intelligent detection method based on image recognition as claimed in claim 1, characterized in that: The process of judging abnormal conditions during the circuit board drilling process is as follows: The segmentation threshold of the drill bit flash feature values ​​of all the drill holes obtained by the threshold segmentation algorithm is recorded as the feature segmentation threshold, and the drill holes with drill bit flash feature values ​​greater than the feature segmentation threshold are regarded as flash drill holes; If the proportion of flash drilling in all drillings is greater than a preset abnormal threshold, it is determined that an abnormality exists in the drilling process of the circuit board; otherwise, no abnormality exists.

Citation Information

Cited By

  • PCB drilling quality automatic evaluation method based on artificial intelligence

    CN121073916A