Printed circuit board detection positioning method and device, electronic equipment and storage medium

By automatically calculating the actual position and mapping relationship of the positioning holes, the problem of difficult and time-consuming manual positioning in printed circuit board inspection is solved, and efficient and accurate automatic positioning and inspection are achieved.

CN116188447BActive Publication Date: 2026-02-06SUZHOU VEGA TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310225089.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-09
Publication Date
2026-02-06
Estimated Expiration
2043-03-09

AI Technical Summary

Technical Problem

In current printed circuit board (PCB) inspection, the first board positioning requires manual operation, which makes positioning difficult and time-consuming, affecting inspection efficiency and accuracy.

Method used

By acquiring drilling files, the actual position of the positioning holes is automatically calculated, and the mapping relationship between the theoretical holes and the actual holes is determined using image data, thereby achieving automatic positioning and defect detection.

Benefits of technology

It improves the success rate and efficiency of detection and positioning, reduces the need for manual operation, and enhances the accuracy of detection and the efficiency of automated production.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116188447B_ABST
    Figure CN116188447B_ABST
Patent Text Reader

Abstract

A printed circuit board detection positioning method and device, electronic equipment and storage medium are disclosed. The method comprises: obtaining a drilling file of a workpiece to be detected, the drilling file comprising a back drilling drilling file and / or a through hole drilling file; determining at least two positioning holes and a theoretical hole set around the positioning holes according to the drilling file; obtaining image data based on the positioning holes; determining an actual hole set according to the image data; determining a mapping relationship between the theoretical holes and the actual holes according to the theoretical hole set and the actual hole set, the mapping relationship comprising a rotational offset relationship; and performing positioning and defect detection according to the mapping relationship. The actual positions of the positioning holes are automatically calculated by the drilling file, and manual selection of the positioning holes is not required, which is conducive to improving the success rate of detection positioning and effectively improving the detection efficiency.
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 board detection, and in particular to a printed circuit board detection positioning method and device, an electronic device, and a storage medium. BACKGROUND

[0002] An automatic optical detection device is a device that uses a machine vision system to detect products. It can not only detect defects that cannot be detected by manual visual inspection, but also detect components and solder joints that cannot be contacted by a needle bed in online testing, thereby meeting the detection needs of PCBs (printed circuit boards) on the production line.

[0003] In the PCB back drilling detection process, the automatic optical detection device uses a positioning hole for first board positioning, and detects defects such as back drilling and eccentricity of the PCB back drilling in combination with the positioning position of the PCB. In the prior art, the first board positioning needs to be manually selected by an operator, which has the following problems: manual positioning is difficult to operate, time-consuming, and prone to problems such as difficulty in finding the positioning hole, wrong positioning hole, low accuracy, increased operation time, and reduced detection efficiency. SUMMARY

[0004] The present application provides a printed circuit board detection positioning method and device, an electronic device, and a storage medium. The actual position of the positioning hole is automatically calculated by the drilling file. The existing printed board detection uses a manual positioning mode, which results in high positioning difficulty, increased operation time, and reduced operation efficiency. The detection efficiency and accuracy are improved.

[0005] According to an aspect of the present application, a printed circuit board detection positioning method is provided, comprising:

[0006] Obtaining a drilling file of a workpiece to be detected, the drilling file comprising a back drilling file and / or a through-hole drilling file;

[0007] Determining at least two positioning holes and a theoretical hole set around the positioning holes according to the drilling file;

[0008] Obtaining image data based on the positioning holes;

[0009] Determining an actual hole set according to the image data;

[0010] Determining a mapping relationship between the theoretical holes and the actual holes according to the theoretical hole set and the actual hole set, and positioning and defect detection according to the mapping relationship;

[0011] The mapping relationship comprises a rotation offset relationship.

[0012] According to another aspect of the present application, there is provided a printed circuit board detection positioning device, comprising: a data acquisition module configured to acquire a drilling file of a workpiece to be detected, the drilling file comprising a back drilling drilling file and / or a through hole drilling file; a positioning analysis module configured to determine at least two positioning holes and a theoretical hole set around the positioning holes according to the drilling file; an image acquisition module configured to acquire image data based on the positioning holes; an image processing module configured to determine an actual hole set according to the image data; a positioning detection module configured to determine a mapping relationship between the theoretical holes and the actual holes according to the theoretical hole set and the actual hole set, and to perform positioning and defect detection according to the mapping relationship; wherein the mapping relationship comprises a rotational offset relationship.

[0013] According to another aspect of the present application, there is provided an electronic device, comprising: at least one processor; and a memory connected in communication with the at least one processor; wherein the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to perform the printed circuit board detection positioning method.

[0014] According to another aspect of the present application, there is provided a computer readable storage medium storing computer instructions for causing a processor to perform the printed circuit board detection positioning method when executed.

[0015] The technical solution of the embodiments of the present application acquires a drilling file of a workpiece to be detected, determines at least two positioning holes and a theoretical hole set around the positioning holes according to the drilling file, acquires image data based on the positioning holes, determines an actual hole set according to the image data, determines a mapping relationship between the theoretical holes and the actual holes according to the theoretical hole set and the actual hole set, and performs positioning and defect detection according to the mapping relationship, thereby solving the problem that the existing printed board detection adopts a manual operation positioning mode, resulting in great positioning difficulty, increased operation time, and reduced operation efficiency, and only needs to import the drilling file to automatically calculate the actual position of the positioning holes, realize automatic first board positioning, and does not need to manually select the positioning holes, which is beneficial to improve the success rate of detection positioning, effectively improve the detection efficiency and accuracy, and improve the automated production efficiency.

[0016] It should be understood that the content described in this part is not intended to identify key or important features of the embodiments of the present application, nor to limit the scope of the present application. Other features of the present application will become apparent from the following description. BRIEF DESCRIPTION OF DRAWINGS

[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the embodiments description. Obviously, the drawings in the following description only some embodiments of the present application, and for those skilled in the art, other drawings can also be obtained from these drawings without creative labor.

[0018] Figure 1 The flow chart of the printed circuit board detection positioning method provided for the first embodiment of the present application;

[0019] Figure 2 The flow chart of the printed circuit board detection positioning method provided for the first alternative embodiment of the first embodiment of the present application;

[0020] Figure 3 The coordinate schematic diagram of the printed circuit board detection positioning method provided for the first embodiment of the present application;

[0021] Figure 4 The flow chart of the printed circuit board detection positioning method provided for the second alternative embodiment of the first embodiment of the present application;

[0022] Figure 5 The flow chart of the printed circuit board detection positioning method provided for the third alternative embodiment of the first embodiment of the present application;

[0023] Figure 6 The flow chart of the printed circuit board detection positioning method provided for the fourth alternative embodiment of the first embodiment of the present application;

[0024] Figure 7 The flow chart of the printed circuit board detection positioning method provided for the fifth alternative embodiment of the first embodiment of the present application;

[0025] Figure 8 The flow chart of the printed circuit board detection positioning method provided for the second embodiment of the present application;

[0026] Figure 9 The structural schematic diagram of the printed circuit board detection positioning device provided for the third embodiment of the present application;

[0027] Figure 10 The structural schematic diagram of the electronic device for realizing the printed circuit board detection positioning method of the embodiments of the present application. DETAILED DESCRIPTION

[0028] In the following, the technical solutions in the embodiments of the present application will be described clearly and completely with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all the other embodiments obtained by a person of ordinary skill in the art without creative effort should belong to the scope of protection of the present application.

[0029] It should be noted that the terms "first", "second" and the like in the description and claims of the present application and the above drawings are used to distinguish similar objects, and do not necessarily indicate a specific order or sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the application described herein can be implemented in other than the order illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device that includes a list of steps or units need not be limited to those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to such processes, methods, products or devices.

[0030] Embodiment one

[0031] Figure 1 A flowchart of a printed circuit board detection positioning method provided by the first embodiment of the present application, the present embodiment can be applied to the application scenario of back drilling defect detection of a printed circuit board, and the method can be executed by a printed circuit board detection positioning device. The printed circuit board detection positioning device can be realized in the form of hardware and / or software, and can be configured in an electronic device, which can be integrated in an automatic optical detection device.

[0032] As shown in Figure 1 , the printed circuit board detection positioning method specifically includes the following steps:

[0033] S1: Obtain a drilling file of a workpiece to be detected.

[0034] The workpiece to be detected is a printed circuit board, and the drilling file can be a program code file for design and processing of the printed circuit board. The program code file is used to define drilling position, drilling size and drilling depth.

[0035] Preferably, the drilling file includes a back drilling drilling file and / or a through-hole drilling file. The back drilling drilling file is a program code file for processing back drilling, and the through-hole drilling file is a program code file for processing through holes.

[0036] S2: determining at least one positioning hole and a theoretical hole set around the positioning hole according to the drilling file.

[0037] The positioning hole and the theoretical hole can be a through hole. By setting the through hole as the positioning hole, positioning difficulty caused by a small number of back-drilling holes is avoided when the back-drilling holes are detected, and the positioning success rate is improved.

[0038] In an embodiment, the number of positioning holes can be set according to the shape and size of the workpiece to be detected. Typically, taking the workpiece to be detected as a rectangle as an example, the number of positioning holes can be set to two, three or four.

[0039] In an embodiment, the positioning hole and the theoretical hole set can be determined according to the through-hole drilling file, or the positioning hole position and the theoretical hole set can be calculated according to the back-drilling drilling file and the through-hole drilling file.

[0040] Specifically, when the positioning hole and the theoretical hole set are determined according to the through-hole drilling file, a target search area can be constructed through the through-hole drilling file, and a through hole with the largest aperture in the target search area can be selected as the positioning hole, and a theoretical hole set can be established according to all through holes within a specific range around the positioning hole.

[0041] S3: obtaining image data based on the positioning hole.

[0042] The image data can be an image of the workpiece to be detected, and the image data includes the actually processed through holes and back-drilling holes.

[0043] In an embodiment, the image acquisition device (for example, a camera) can be controlled to move to the position corresponding to the positioning hole, and the orthographic image of the workpiece to be detected at the position corresponding to the positioning hole can be taken as the image data.

[0044] S4: determining an actual hole set according to the image data.

[0045] The actual hole set can be a set of all through holes and back-drilling holes in the image data.

[0046] In an embodiment, all through holes and back-drilling holes in the image data can be identified based on image processing and curve fitting algorithms, and the actual hole set can be established according to the coordinates of the back-drilling holes and the through holes.

[0047] S5: determining a mapping relationship between the theoretical hole and the actual hole according to the theoretical hole set and the actual hole set, and performing positioning and defect detection according to the mapping relationship.

[0048] The mapping relationship can include a rotational offset relationship. Typically, the rotational offset relationship can be represented by a rigid transformation matrix.

[0049] Exemplarily, the rotation and translation amount between the theoretical holes and the actual holes can be calculated by the coordinates of the corresponding holes in the theoretical hole set and the actual hole set. If the hole in the theoretical hole set is defined as P(x, y), and the hole in the actual hole set is defined as P'(x', y'), the rotation offset relationship satisfies the following formula:

[0050]

[0051] wherein, θ represents the deflection angle between the theoretical holes and the actual holes; t x represents the offset amount between the theoretical holes and the actual holes along the x-axis direction; t y represents the offset amount between the theoretical holes and the actual holes along the y-axis direction; wherein, the x-axis and the y-axis can be the axes of a mechanical coordinate system.

[0052] Therefore, after importing the drilling file of the workpiece to be detected, the technical scheme of the embodiment of the present application can automatically calculate the theoretical hole set around at least two positioning holes and the positioning holes based on the drilling file, acquire the image data based on the positioning holes, determine the actual hole set according to the image data, determine the mapping relationship between the theoretical holes and the actual holes according to the theoretical hole set and the actual hole set, and perform positioning and defect detection according to the mapping relationship, thereby solving the problem that the manual operation positioning mode is used in the existing printed board detection, resulting in great positioning difficulty, increasing the operation time, and reducing the operation efficiency. Only by importing the drilling file, the actual position of the positioning hole can be automatically calculated, automatic first-plate positioning is realized, manual selection of the positioning hole is not needed, the success rate of detection positioning is improved, the detection efficiency and the accuracy are effectively improved, and the automatic production efficiency is improved.

[0053] Optionally, Figure 2 The flowchart of the printed circuit board detection and positioning method of the first alternative embodiment provided by the embodiment of the present application is shown in Figure 1 based on the embodiment shown in the figure, and exemplarily shows a specific implementation of positioning analysis.

[0054] As Figure 2 shown, the at least two positioning holes and the theoretical hole set around the positioning holes are determined according to the drilling file, which includes the following steps:

[0055] S201: Determine the circumscribed contour coordinate information of the workpiece to be detected according to the drilling file.

[0056] wherein, the circumscribed contour can be the smallest circumscribed figure covering the workpiece to be detected.

[0057] In an embodiment, the circumscribed contour figure can be a circumscribed rectangle.

[0058] Preferably, the smallest circumscribed rectangle can be a circumscribed right rectangle, and the edges of the circumscribed right rectangle are parallel to the corresponding theoretical coordinate axes (for example, including the x-axis and the y-axis) of the drilling file.

[0059] In an embodiment, the method for determining the circumscribed contour coordinate information of the workpiece to be detected according to the drill file comprises: performing coordinate unification on the back-drilling drill file and the through-hole drill file to obtain a coordinate-unified file of the through-hole drill file; determining at least two vertex coordinates of a circumscribed rectangle of the workpiece to be detected according to the coordinate-unified file; and determining the circumscribed contour coordinate information according to the vertex coordinates.

[0060] In an embodiment, the method for determining the circumscribed contour coordinate information of the workpiece to be detected according to the drill file comprises: performing coordinate unification on the back-drilling drill file and the through-hole drill file to obtain a coordinate-unified file of the through-hole drill file; determining at least two vertex coordinates of a circumscribed rectangle of the workpiece to be detected according to the coordinate-unified file; and determining the circumscribed contour coordinate information according to the vertex coordinates.

[0061] Specifically, after obtaining the back-drilling drill file and the through-hole drill file, the coordinate offset can be calculated according to the coordinates of the points corresponding to the positions in the back-drilling drill file and the through-hole drill file, the through-hole drill file can be translated based on the coordinate offset, and the translated through-hole drill file can be determined as the coordinate-unified file. Furthermore, the size of the minimum circumscribed rectangle can be calculated according to the coordinates of the through holes in the coordinate-unified file, and the circumscribed contour coordinate information can be calculated according to the vertex coordinates of the circumscribed rectangle.

[0062] In an embodiment, the at least two vertex coordinates at least include the coordinates of the two vertices located at the diagonal positions. The circumscribed contour coordinate information can include but is not limited to the vertex coordinates of the circumscribed rectangle and the coordinates of the midpoint of any side of the circumscribed rectangle.

[0063] S202: determining at least two basic reference points according to the circumscribed contour coordinate information.

[0064] The basic reference points are reference points for constructing a target search area. Typically, the basic reference points can be used as the center of the target search area.

[0065] In an embodiment, the method for determining the circumscribed contour coordinate information of the workpiece to be detected according to the drill file comprises: obtaining at least two vertex coordinates based on the circumscribed contour coordinate information; and determining the basic reference points according to the vertex coordinates.

[0066] For example, Figure 3 A coordinate schematic diagram of a printed circuit board detection positioning method provided by an embodiment of the present application.

[0067] In combination with Figure 3 As shown in the figure, taking the example that the circumscribed contour coordinate information includes the four vertex coordinates of the circumscribed rectangle, if the vertex coordinates of the upper left corner of the circumscribed rectangle are defined as P1(x1, y1) and the vertex coordinates of the lower right corner are defined as P2(x2, y2), the coordinates of all the vertices of the circumscribed rectangle can be calculated according to P1(x1, y1) and P2(x2, y2). Thus, the circumscribed contour coordinate information includes: P 左上(x1, y1), P 左下 (x1, y2), P 右上 (x2, y1), and P 右下 (x2, y2).

[0068] Further, at least two vertex coordinates of P 左上 (x1, y1), P 左下 (x1, y2), P 右上 (x2, y1), P 右下 (x2, y2) are selected, and the selected vertex coordinates are taken as the coordinates of the base reference point.

[0069] S203: determining the positioning hole and the theoretical hole set according to the base reference point and the preset range parameter.

[0070] In this embodiment, the target search area can be constructed according to the coordinates of the base reference point and the preset range parameter. Typically, the target search area can be a circular area with the coordinates of the base reference point as the center and the preset range parameter as the radius. After the target search area is established, the through hole with the largest aperture in the target search area is selected as the positioning hole, and the theoretical hole set is established according to all the through holes within a specific range around the positioning hole.

[0071] It should be noted that the shape of the target search area is not limited in the present application.

[0072] Optionally, Figure 4 The flowchart of the printed circuit board detection and positioning method provided by the second alternative embodiment of the present embodiment is exemplarily shown as a specific implementation of obtaining the positioning hole and the theoretical hole set.

[0073] As Figure 4 shown, determining the positioning hole and the theoretical hole set according to the base reference point and the preset range parameter includes the following steps:

[0074] S2031: obtaining the first preset range parameter.

[0075] The first preset range parameter is a parameter representing the range size of the target search area of the positioning hole.

[0076] In an embodiment, the first preset range parameter can be the radius or the diameter size of the circular target search area.

[0077] Exemplarily, the first preset range parameter includes but is not limited to any of the following values: 50, 100, 150, ….

[0078] S2032: determining the first hole set according to the base reference point and the first preset range parameter.

[0079] The first hole set is a set of all through holes in a circular target search area with the base reference point as the center and the first preset range parameter as the radius. If multiple base reference points are set, an independent first hole set is established based on each base reference point.

[0080] S2033: Obtain hole information of all through holes in the first hole set, and the hole information includes a hole diameter and a hole coordinate.

[0081] The hole diameter is used to compare the size of the through hole, and the hole coordinate is used to mark the position of the through hole.

[0082] S2034: Compare the hole diameters of all through holes, and determine a positioning hole according to the comparison result.

[0083] In this embodiment, the positioning hole can be a through hole with the largest hole diameter in the first hole set.

[0084] It should be noted that the number of positioning holes is the same as the number of base reference points. If two base reference points are set, two positioning holes are finally determined.

[0085] As shown in FIG. 2, the positioning hole and the theoretical hole set are determined according to the base reference point and the preset range parameter, and the method further includes: Figure 4

[0086] S2035: Obtain a second preset range parameter.

[0087] The second preset range parameter is a parameter representing the size of the area around the positioning hole.

[0088] In an embodiment, the second preset range parameter can be the radius or diameter size of the circular surrounding area.

[0089] For example, the second preset range parameter includes but is not limited to any of the following values: 50, 100, 150, ….

[0090] S2036: Determine a second hole set according to the positioning hole and the second preset range parameter.

[0091] The second hole set is a set of all through holes in a circular area with the positioning hole as the center and the second preset range parameter as the radius. If multiple positioning holes are set, a second hole set is established based on each positioning hole.

[0092] S2037: Obtain hole coordinates of all holes in the second hole set.

[0093] All holes in the second hole set include through holes and back-drilling holes.

[0094] S2038: Determine a theoretical hole set according to the hole coordinates.

[0095] ​The theoretical hole set is a set of through holes and back-drilling holes in all second hole sets.

[0096] In combination Figure 3 And Figure 4 As shown in the figure, define P1 and P2 as the basic reference points, the first preset range parameter is R0, and the second preset range parameter is R1. A first target search area is constructed with P1 as the center and the first preset range parameter R0 as the radius. All through holes in the first target search area are searched to establish a 1# first hole set. The largest aperture through hole in the 1# first hole set is determined as the first positioning hole P S1 A second target search area is constructed with P2 as the center and the first preset range parameter R0 as the radius. All through holes in the second target search area are searched to establish a 2# first hole set. The largest aperture through hole in the 2# first hole set is determined as the second positioning hole P S2 . Further, a first surrounding area is constructed with the first positioning hole P S1 as the center and the second preset range parameter R1 as the radius. All through holes and back-drilling holes in the first surrounding area are searched to establish a 1# second hole set. A second surrounding area is constructed with the second positioning hole P S2 as the center and the second preset range parameter R1 as the radius. All through holes and back-drilling holes in the second surrounding area are searched to establish a 2# second hole set. The hole coordinates of all through holes and back-drilling holes in the 1# second hole set and the 2# second hole set are obtained to establish a theoretical hole set PA(x, y).

[0097] Optionally, Figure 5 A flowchart of a printed circuit board detection positioning method of a third alternative embodiment provided by Embodiment One of the present application is shown in the figure. Based on the embodiment shown in the figure, a specific implementation of image acquisition is exemplarily shown. Figure 1 As shown in the figure, image data is acquired based on the positioning hole, including the following steps:

[0098] Figure 5

[0099] S301: Obtain the reference point coordinates of the workpiece to be detected in the mechanical coordinate system.

[0100] The reference point coordinates can be the mechanical coordinates established based on the position of the positioning shoulder of the workpiece to be detected.

[0101] Typically, the positioning shoulder of the workpiece to be detected can be the fixed position of the optical automatic detection equipment at the lower left corner of the motion platform.

[0102] S302: Coordinate adjustment is performed on the positioning hole according to the reference point coordinates to obtain the positioning hole mechanical coordinates.

[0103] ​​Wherein, the positioning hole mechanical coordinate is the actual coordinate of the positioning hole on the actual detection device of the motion platform of the workpiece to be detected.

[0104] Exemplarily, taking the lower left corner point coordinate P3(x1, y2) of the circumscribed rectangle of the workpiece to be detected as the reference point, if the reference point coordinate in the mechanical coordinate system is defined as P0(x0, y0), and the positioning hole coordinate is P sn (x sn , y sn ), then the positioning hole mechanical coordinate P dn (x dn , y dn ) satisfies the following formula two:

[0105]

[0106] Wherein, n represents the positioning hole number.

[0107] S303: controlling the image acquisition device to move to the corresponding position of the positioning hole mechanical coordinate, and acquiring the image of the workpiece to be detected.

[0108] Wherein, the image acquisition device can be a camera or an infrared image acquisition device.

[0109] Specifically, after obtaining the positioning hole mechanical coordinate, the image acquisition device can be controlled to move to the directly above of the positioning hole mechanical coordinate, and the image of the workpiece to be detected at the positioning hole mechanical coordinate position is taken, and the orthographic image of the workpiece to be detected at the positioning hole mechanical coordinate position is taken as the image data. By establishing the positioning hole coordinate adjustment algorithm, the actual position of the positioning hole can be automatically calculated without manually selecting the positioning hole, which is conducive to improving the success rate of detection positioning.

[0110] In an embodiment, when the image of the workpiece to be detected is acquired, the printed circuit board detection positioning method further comprises: evaluating the image data to obtain an evaluation parameter; and adjusting the brightness and angle of the light source according to the evaluation parameter.

[0111] Wherein, the evaluation parameter can be set based on the hole recognition rate and the number of holes.

[0112] Specifically, during the image acquisition process, the brightness and intensity of the light source are controlled, and if the image acquisition device is lighted according to the image acquisition progress, if the hole recognition rate in the image data after lighting is lower than a preset recognition rate threshold, the brightness of the light source can be increased accordingly; and if the number of holes in the image data after lighting is lower than a preset number threshold, the angle of the light source can be adjusted to adjust the overlapping area of the lighting direction and the image taking direction. By adjusting the lighting, the image data acquisition accuracy is improved, which is conducive to improving the success rate of detection positioning.

[0113] Optionally,Figure 6 The flow chart of the fourth alternative printed circuit board detection and positioning method provided for the first embodiment of the present application is shown in Figure 1 Based on the embodiment shown, a specific implementation of obtaining the actual hole set is exemplarily shown.

[0114] As shown in Figure 6 Determining the actual hole set according to the image data includes the following steps:

[0115] S401: Image segmentation processing is performed on the image data to obtain a feature region.

[0116] The image segmentation processing mode includes but is not limited to a threshold-based segmentation method, a region-based segmentation method, an edge-based segmentation method, and a segmentation method based on a specific theory.

[0117] In this embodiment, a gray scale histogram can be constructed based on the gray scale region distribution of different objects in the image data, which is represented as a wave peak on the gray scale histogram. The wave peak on the histogram is identified to obtain a segmentation threshold, which is used to segment the image data into multiple feature regions.

[0118] S402: Feature analysis is performed on the feature region.

[0119] The image features include but are not limited to region area, region angle, region roundness, and region minimum circumscribed rectangle, region minimum circumscribed circle, and region convexity.

[0120] In this embodiment, the feature analysis content can include but is not limited to any one or a combination of multiple items of region area, region roundness, and region minimum circumscribed parameter.

[0121] S403: The feature region is filtered according to the feature analysis result to obtain a back-drilling hole region and a through-hole region.

[0122] Specifically, the back-drilling hole region and the through-hole region can be obtained by filtering based on the region area, the region roundness, and the minimum circumscribed rectangle of each feature region.

[0123] As shown in Figure 6 Determining the actual hole set according to the image data further includes:

[0124] S404: Edge detection processing is performed on the back-drilling hole region and the through-hole region to obtain edge point coordinates.

[0125] The image edge refers to a part where the brightness of a local region of an image changes significantly. The gray scale profile of this region can generally be regarded as a step change. The algorithm involved in this function is to find the part where the brightness of the image region changes significantly. The gray scale value of each pixel point is calculated in a specified direction from the given coordinates, and the gray scale value exceeding the preset threshold is the edge point.

[0126] S405: Curve fitting is performed according to the edge point coordinates to obtain fitting circle information.

[0127] The fitting circle information includes a center and a radius.

[0128] The general equation of a circle is as formula three:

[0129] x 2 +y 2 +a*x+b*y+c=0 (formula three)

[0130] Wherein, a, b, c represent fitting parameters.

[0131] When the number of edge points in the feature area is more than three, the coordinates of the three edge points can be substituted into the above formula three, and the fitting parameters a, b, and c are calculated by the least square method, and then the center and the radius are calculated according to the fitting parameters a, b, and c.

[0132] S406: Determine the actual hole set according to the fitting circle information.

[0133] Specifically, the center coordinates can be used as the coordinates of the actual hole, and the actual hole size can be calculated according to the circle radius, and finally the actual hole set is established according to the actual hole coordinates and the actual hole size.

[0134] Therefore, the embodiment of the present application identifies all through holes and back-drilling holes in the image data through image processing algorithm and fitting circle algorithm, establishes an actual hole set, automatically identifies the actual hole position, and then realizes automatic detection and positioning by using the mapping relationship between the theoretical hole and the actual hole, which is beneficial to improve the success rate of detection and positioning, effectively improve the detection efficiency and accuracy, and improve the automation production efficiency.

[0135] Optionally, Figure 7 The flowchart of the printed circuit board detection and positioning method of the fifth alternative embodiment provided by the embodiment of the present application is shown in Figure 1 The specific implementation of obtaining the drilling file is exemplarily shown based on the embodiment shown in the figure.

[0136] As Figure 7 shown, the drilling file of the workpiece to be detected is obtained, including the following steps:

[0137] S101: Obtain the drawing file of the workpiece to be detected.

[0138] The drawing file can be a file of the workpiece to be detected drawn by AutoCAD drawing software.

[0139] S102: Analyze the drawing file, and determine the back-drilling file and the through-hole drilling file according to the analysis result.

[0140] In the embodiment, Codesys software programming can be used as a file analysis module to analyze the drawing file.

[0141] Specifically, the file analysis module can be called to analyze the drawing file to obtain a graphic track, the graphic track including parameters such as a starting point coordinate, a circle center coordinate and a circular radian, and a back drilling hole file and a through hole drilling hole file are established based on the parameters in the graphic track. The imported drawing file is automatically converted into a drilling hole file, which is beneficial to simplify the operation.

[0142] Embodiment Two

[0143] Figure 8 A flowchart of a printed circuit board detection and positioning method provided for the second embodiment of the application is shown in Figure 1 The detection and display function is added based on the embodiment shown in the figure.

[0144] As Figure 8 shown, after positioning and defect detection according to the mapping relationship, the printed circuit board detection and positioning method further includes:

[0145] S6: Display the defect detection result and mark the defect item.

[0146] Typically, the defect item includes but is not limited to: missing back drilling, eccentricity and other defects.

[0147] S7: Generate a back drilling file according to the defect item.

[0148] Specifically, the defect detection result can be displayed through a display window, and the user can observe the detection result through the display window to determine whether there is a defect item. If there is a defect item, the user can perform operations such as mirroring, rotating, deleting, selecting or positioning on the back drilling hole file and the through hole drilling hole file through the display window to update the drilling hole file.

[0149] In an embodiment, after obtaining the back drilling hole file and the through hole drilling hole file, the printed circuit board detection and positioning method further includes: displaying the back drilling hole file and the through hole drilling hole file, and updating the drilling hole file according to the user's operation on the back drilling hole file and the through hole drilling hole file. The actual position of the positioning hole is automatically calculated through the self-defined drilling hole file, and the defect item is timely compensated, which is beneficial to improve the practicability and accuracy of the detection and positioning and improve the efficiency of the automatic production.

[0150] Embodiment Three

[0151] Based on the same inventive concept, the third embodiment of the present application provides a printed circuit board detection positioning device. The printed circuit board detection positioning device provided by the third embodiment of the present application can execute the printed circuit board detection positioning method provided by any of the embodiments of the present application, and has the corresponding function modules and beneficial effects of the execution method.

[0152] Figure 9 FIG. 1 is a structural schematic diagram of a printed circuit board detection positioning device provided by the third embodiment of the present application.

[0153] As shown in Figure 9 , the printed circuit board detection positioning device 100 comprises:

[0154] a data acquisition module 101 configured to acquire a drilling file of a workpiece to be detected, the drilling file comprising a back drilling drilling file and / or a through hole drilling file;

[0155] a positioning analysis module 102 configured to determine at least two positioning holes and a theoretical hole set around the positioning holes according to the drilling file;

[0156] an image acquisition module 103 configured to acquire image data based on the positioning holes;

[0157] an image processing module 104 configured to determine an actual hole set according to the image data;

[0158] a positioning detection module 105 configured to determine a mapping relationship between the theoretical holes and the actual holes according to the theoretical hole set and the actual hole set, and to perform positioning and defect detection according to the mapping relationship;

[0159] In the embodiment, the mapping relationship comprises a rotational offset relationship.

[0160] In an embodiment, the positioning analysis module 102 is configured to determine outer contour coordinate information of the workpiece to be detected according to the drilling file; to determine at least two basic reference points according to the outer contour coordinate information; and to determine the positioning holes and the theoretical hole set according to the basic reference points and a preset range parameter.

[0161] In an embodiment, when determining the outer contour coordinate information of the workpiece to be detected according to the drilling file, the positioning analysis module 102 is configured to unify coordinates of the back drilling drilling file and the through hole drilling file to obtain a coordinate unified file of the through hole drilling file; to determine at least two vertex coordinates of an outer positive rectangle of the workpiece to be detected according to the coordinate unified file; and to determine the outer contour coordinate information according to the vertex coordinates.

[0162] In one embodiment, when the positioning hole and the theoretical hole set are determined according to the basic reference point and the preset range parameter, the positioning analysis module 102 is configured to obtain a first preset range parameter; determine a first hole set according to the basic reference point and the first preset range parameter; obtain hole information of all through holes in the first hole set, the hole information including a hole diameter and a hole coordinate; compare the hole diameters of all through holes, and determine the positioning hole according to the comparison result.

[0163] In one embodiment, when the positioning hole and the theoretical hole set are determined according to the basic reference point and the preset range parameter, the positioning analysis module 102 is further configured to obtain a second preset range parameter; determine a second hole set according to the positioning hole and the second preset range parameter; obtain hole coordinates of all holes in the second hole set; and determine the theoretical hole set according to the hole coordinates.

[0164] In one embodiment, when the at least two basic reference points are determined according to the circumscribed contour coordinate information, the positioning analysis module 102 is configured to obtain at least two vertex coordinates based on the circumscribed contour coordinate information, and determine the basic reference points according to the vertex coordinates.

[0165] In one embodiment, the image acquisition module 103 is configured to obtain reference point coordinates of the workpiece to be detected in a mechanical coordinate system; perform coordinate adjustment on the positioning hole according to the reference point coordinates to obtain a positioning hole mechanical coordinate; and control the image acquisition device to move to the positioning hole mechanical coordinate to perform image acquisition on the workpiece to be detected.

[0166] In one embodiment, the printed circuit board detection and positioning device 100 comprises a light source control module, which is configured to evaluate the image data to obtain an evaluation parameter when the image acquisition is performed on the workpiece to be detected, and adjust the brightness and angle of the light source according to the evaluation parameter.

[0167] In one embodiment, the image processing module 104 is configured to perform image segmentation processing on the image data to obtain a feature region; perform feature analysis on the feature region, the feature analysis including any one or a combination of multiple items of area, circularity and minimum circumscribed parameter; filter the feature region according to the feature analysis result to obtain a back-drilling hole region and a through-hole region.

[0168] In one embodiment, the image processing module 104 is further configured to perform edge detection processing on the back-drilling hole region and the through-hole region to obtain edge point coordinates; perform curve fitting according to the edge point coordinates to obtain fitting circle information; and determine an actual hole set according to the fitting circle information.

[0169] In one embodiment, the data acquisition module 101 is configured to obtain a drawing file of the workpiece to be detected, analyze the drawing file, and determine a back-drilling hole file and a through-hole drilling file according to the analysis result.

[0170] In an embodiment, the printed circuit board detection positioning device 100 further comprises a display module configured to display the defect detection result and mark the defect item, and generate a re-drilling file according to the defect item.

[0171] In an embodiment, the printed circuit board detection positioning device 100 further comprises a man-machine interaction module, which is provided with a display window and an operation guide window, the display window is configured to display the drilling file after analysis processing and the result of positioning detection to a user, and the operation guide window is configured to guide the user to perform mirror image, rotation, deletion, selection, positioning and the like on the drilling file.

[0172] Embodiment Four

[0173] Based on the same inventive concept, the electronic device provided in Embodiment Four of the present application can execute the printed circuit board detection positioning method provided in any of the embodiments of the present application, and has the corresponding function modules and beneficial effects of the execution method.

[0174] In the present embodiment, the electronic device can be integrally arranged in an automatic optical detection device.

[0175] The electronic device comprises at least one processor and a memory connected in communication with the at least one processor, wherein the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to perform the printed circuit board detection positioning method.

[0176] Figure 10 A structural schematic diagram of an electronic device that can be used to implement the printed circuit board detection positioning method of the embodiments of the present application is shown. The electronic device is intended to represent various forms of digital computers, such as laptops, desktops, tablets, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular telephones, smart phones, wearable devices (such as headsets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not intended to limit the implementations of the present application described and / or claimed in this document.

[0177] As Figure 10As shown, the electronic device 10 includes at least one processor 11, and a memory, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., communicatively connected to the at least one processor 11, where the memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes according to the computer programs stored in the read-only memory (ROM) 12 or loaded into the random access memory (RAM) 13 from the storage unit 18. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0178] Various components in the electronic device 10 are connected to the I / O interface 15, including an input unit 16, such as a keyboard, a mouse, etc., an output unit 17, such as various types of displays, a speaker, etc., a storage unit 18, such as a magnetic disk, an optical disk, etc., and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network, such as the Internet, and / or various telecommunication networks.

[0179] The processor 11 can be various general and / or special-purpose processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 performs various methods and processes described above, such as the printed circuit board detection and positioning method.

[0180] In some embodiments, the printed circuit board detection and positioning method can be implemented as a computer program tangibly embodied in a computer readable storage medium, such as the storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed onto the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the printed circuit board detection and positioning method described above can be performed. Alternatively, in other embodiments, the processor 11 can be configured to perform the printed circuit board detection and positioning method by any other appropriate means, such as by means of firmware.

[0181] The various embodiments of the systems and techniques described above can be implemented in digital electronic circuitry, integrated circuitry, a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on a chip (SOC), a load programmable logic device (CPLD), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include implementation in one or more computer programs that are executable and / or interpretable on a programmable system including at least one programmable processor, which can be special or general purpose, coupled to receive data and instructions from, and to transmit data and instructions to, a storage system, at least one input device, and at least one output device.

[0182] Computer programs used to implement the processes of the application can be written in any combination of one or more programming languages. These computer programs can be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer program, when executed, can cause instructions defined in the flow charts and / or block diagrams to be implemented. The computer program can be executed entirely on a machine, partially on a machine, partially on a machine as a standalone software package and partially on a remote machine or entirely on a remote machine or server.

[0183] In the context of the present application, a computer-readable storage medium can be a tangible medium that can contain or store computer programs for use by or in connection with an instruction execution system, apparatus, or device. Computer-readable storage media can include, but are not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium can be a machine-readable signal medium. More specific examples of the machine-readable storage medium will include one or more lines of electrical connections, portable computer disks, hard disk drives, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or Flash memory), optical fibers, portable compact disc read-only memories (CD-ROMs), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0184] To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the electronic device. Other kinds of devices can be used to provide for interaction with a user as well; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form, including acoustic, speech, or tactile input.

[0185] The systems and techniques described here can be implemented in a computing system that includes a back end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front end component (e.g., a user computer having a graphical user interface or a Web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back end, middleware, or front end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0186] The computing system can include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. A server can be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system, to solve the defects of large management difficulty and weak business scalability in traditional physical host and VPS service.

[0187] Embodiment five

[0188] Based on the same inventive concept, the computer readable storage medium of the embodiment five of the present application stores computer instructions, and the computer instructions are used to make the processor execute the printed circuit board detection and positioning method described above.

[0189] It should be understood that the various forms of flow shown above can be reordered, added to, or deleted from without departing from the scope of the present application. For example, the steps described in the present application can be executed in parallel, in sequence, or in a different order, as long as the desired results of the technical solutions of the present application can be achieved, and the present application does not limit this.

[0190] The foregoing detailed description has set forth various embodiments of the application via specific examples. However, it is to be understood that equivalent alterations and modifications will occur to others skilled in the art upon the reading and understanding of this specification and the annexed drawings. In particular and without limitation, for the purpose of clarity and readability, it is expressly intended that the phrasing in the present claims is to be construed in an inclusive and not an exclusive sense unless otherwise indicated herein. Moreover, from the foregoing detailed description, it will be evident that variations and modifications can be made to the application without departing from the spirit and scope of the application. Accordingly, it is not intended that the application be limited as described herein, but is to be accorded the full scope of alternatives, modifications, additions or equivalents.

Claims

1. A method of detecting and positioning a printed circuit board, characterized by, The method comprises the following steps: obtaining a drilling file of a workpiece to be detected, the drilling file comprising a back drilling drilling file and / or a through hole drilling file; determining at least two positioning holes and a theoretical hole set around the positioning holes according to the drilling file; obtaining image data based on the positioning holes; determining an actual hole set according to the image data; determining a mapping relationship between the theoretical holes and the actual holes according to the theoretical hole set and the actual hole set, and performing positioning and defect detection according to the mapping relationship; wherein the mapping relationship comprises a rotational offset relationship; determining at least two positioning holes and a theoretical hole set around the positioning holes according to the drilling file comprises: determining the circumscribed contour coordinate information of the workpiece to be detected according to the drilling file; determining at least two basic reference points according to the circumscribed contour coordinate information; determining the positioning holes and the theoretical hole set according to the basic reference points and a preset range parameter; determining the positioning holes and the theoretical hole set according to the basic reference points and a preset range parameter comprises: obtaining a first preset range parameter; determining a first hole set according to the basic reference points and the first preset range parameter; obtaining hole information of all through holes in the first hole set, the hole information comprising a hole diameter and a hole coordinate; comparing the hole diameters of all through holes, and determining the positioning holes according to the comparison result.

2. The method of claim 1, wherein, determining the circumscribed contour coordinate information of the workpiece to be detected according to the drilling file comprises: unifying the coordinates of the back drilling drilling file and the through hole drilling file to obtain a coordinate unified file of the through hole drilling file; determining at least two vertex coordinates of a circumscribed rectangle of the workpiece to be detected according to the coordinate unified file; determining the circumscribed contour coordinate information according to the vertex coordinates.

3. The method of claim 1, wherein, determining the positioning holes and the theoretical hole set according to the basic reference points and a preset range parameter comprises: obtaining a second preset range parameter; determining a second hole set according to the positioning holes and the second preset range parameter; obtaining hole coordinates of all holes in the second hole set; determining the theoretical hole set according to the hole coordinates.

4. The method of claim 1, wherein, determining at least two basic reference points according to the circumscribed contour coordinate information comprises: obtaining at least two vertex coordinates based on the circumscribed contour coordinate information; determining the basic reference points according to the vertex coordinates.

5. The method of claim 1, wherein, obtaining image data based on the positioning holes comprises: obtaining reference point coordinates of the workpiece to be detected in a mechanical coordinate system; performing coordinate adjustment on the positioning holes according to the reference point coordinates to obtain positioning hole mechanical coordinates; controlling an image acquisition device to move to a corresponding position of the positioning hole mechanical coordinates, and performing image acquisition on the workpiece to be detected.

6. The method of claim 5, wherein, when performing image acquisition on the workpiece to be detected, further comprising: evaluating the image data to obtain evaluation parameters; adjusting the brightness and angle of a light source according to the evaluation parameters.

7. The method of claim 1, wherein, determining an actual hole set according to the image data comprises: performing image segmentation processing on the image data to obtain a feature region; performing feature analysis on the feature region, the feature analysis including any one or a combination of multiple of area, roundness, and minimum circumscribed parameter; filtering the feature region according to the feature analysis result to obtain a back-drilling region and a through-hole region.

8. The method of claim 7, wherein, The determining the actual hole set according to the image data further includes: performing edge detection processing on the back-drilling region and the through-hole region to obtain edge point coordinates; performing curve fitting according to the edge point coordinates to obtain fitting circle information; determining the actual hole set according to the fitting circle information.

9. The method according to any one of claims 1-8, characterized in that, The obtaining the drilling file of the workpiece to be detected includes: obtaining a drawing file of the workpiece to be detected; performing analysis on the drawing file to determine the back-drilling drilling file and the through-hole drilling file according to the analysis result.

10. The method according to any one of claims 1-8, characterized in that, After the positioning and defect detection according to the mapping relationship, further includes: displaying and marking a defect item according to the defect detection result; generating a back-drilling file according to the defect item.

11. A printed circuit board inspection positioning apparatus, characterized by comprising: includes: a data acquisition module configured to acquire a drilling file of a workpiece to be detected, the drilling file including a back-drilling drilling file and / or a through-hole drilling file; a positioning analysis module configured to determine at least two positioning holes and a theoretical hole set around the positioning holes according to the drilling file; an image acquisition module configured to acquire image data based on the positioning holes; an image processing module configured to determine an actual hole set according to the image data; a positioning detection module configured to determine a mapping relationship between theoretical holes and actual holes according to the theoretical hole set and the actual hole set, and to perform positioning and defect detection according to the mapping relationship; wherein the mapping relationship includes a rotational offset relationship; the positioning analysis module is further configured to determine an external contour coordinate information of the workpiece to be detected according to the drilling file, to determine at least two basic reference points according to the external contour coordinate information, and to determine the positioning holes and the theoretical hole set according to the basic reference points and a preset range parameter; the positioning analysis module is further configured to acquire a first preset range parameter, to determine a first hole set according to the basic reference points and the first preset range parameter, to acquire hole information of all through-holes in the first hole set, the hole information including a hole diameter and a hole coordinate, and to compare the hole diameters of all through-holes to determine the positioning holes according to a comparison result.

12. An electronic device, comprising: The electronic device includes: at least one processor; and a memory connected to the at least one processor in communication; wherein the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to execute the printed circuit board detection positioning method of any one of claims 1-10.

13. A computer-readable storage medium, characterized in that, The computer readable storage medium stores computer instructions for enabling the processor to implement the printed circuit board detection positioning method of any one of claims 1-10 when executed.

Citation Information

Patent Citations

  • Method and device for acquiring PCB (printed circuit board) back drilling hole detection file and optical detection equipment

    CN112862867A

  • Position point compensation method, apparatus and device, and storage medium

    WO2021223416A1