Method and system for correcting CAD (Computer Aided Design) position in PCB (Printed Circuit Board)

By acquiring the point cloud data of the PCB board and fitting the base surface using the least squares method, combined with rectangularity calculation and mask label image matching, the CAD position is corrected, solving the overkill problem caused by CAD position offset in the existing technology and improving the detection accuracy and efficiency of the AOI equipment.

CN120807627APending Publication Date: 2025-10-17SUZHOU JIERUISI INTELLIGENT TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510680410.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-26
Publication Date
2025-10-17

AI Technical Summary

Technical Problem

In the prior art, CAD position correction of PCB boards easily leads to over-kill, which affects the inspection yield and accuracy of AOI equipment.

Method used

By acquiring the point cloud data of the PCB board, the least squares method is used to fit the base surface, and the CAD position is corrected by combining rectangularity calculation and mask label image matching.

Benefits of technology

It improves the detection accuracy and efficiency of AOI equipment, solves the CAD position offset problem caused by various factors, and improves the detection yield.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120807627A_ABST
    Figure CN120807627A_ABST
Patent Text Reader

Abstract

The invention relates to a method and a system for correcting a CAD (Computer Aided Design) position in a PCB (Printed Circuit Board). The method comprises the following steps: acquiring point cloud data information of the PCB in a single FOV area; rasterizing the point cloud of a single FOV area and acquiring position information of each grid, counting a histogram formed by point cloud data, and taking an area with the most points in the histogram as a ground point of the point cloud; calculating the central position P of the CAD, then generating a horizontal ray from the point P to the right, and judging whether the horizontal ray intersects with a ground point; fitting the extracted point cloud ground points into a base plane by using a least square method; filtering the contour through the rectangularity, and calculating the rectangularity; matching the CAD with the contour in the mask label image; and applying the calculated CAD average offset value to each CAD detection frame so as to correct the position of the CAD. According to the invention, the CAD position of the PCB can be effectively corrected.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of industrial visual inspection, and particularly refers to a method and system for correcting CAD positions in a PCB. BACKGROUND

[0002] Printed circuit boards (PCB) are the core components of electronic devices, used to support and connect various electronic components. As electronic devices become increasingly complex, the complexity of PCB design and manufacturing also increases. Various defects may occur during the manufacturing process, such as poor soldering, missing or misaligned components, etc., which can affect the performance and reliability of the device. To ensure product quality, strict detection is required at each stage of manufacturing. Automated optical inspection (AOI) is a non-contact optical detection technology used to detect printed circuit boards (PCB). AOI plays a crucial role in the electronics manufacturing industry, ensuring the quality and reliability of PCBs. When using AOI to detect component misalignment, a reference position is needed to calculate the relative displacement of the component, and then determine whether the component has misaligned based on the pre-set allowable displacement range. The reference position can be a fixed reference point on the PCB, a solder pad position, or a computer-aided design (CAD) position.

[0003] When calculating the displacement of the component based on the CAD position, manufacturing process errors, equipment calibration problems, temperature changes, material stress, data conversion and processing errors, fixture and fixing problems, and operator errors can all cause the CAD position to shift, resulting in false detection results. In addition, positioning mark point errors are also a common problem. AOI systems usually use positioning mark points to align the PCB and CAD data. If these mark point positions have errors, or the detection system cannot accurately identify the mark points, it will cause overall alignment to shift, affecting the accuracy of detection.

[0004] In summary, when calculating the displacement based on the component body and the CAD position, due to the interference of various factors, the CAD position shifts, resulting in incorrect calculation of the component displacement, which leads to overkill (i.e., misjudging a good product as a defective product), thereby reducing the detection yield of the AOI equipment, and thus failing to meet the production detection needs of enterprises. Therefore, it is necessary to correct the CAD position. SUMMARY

[0005] To this end, the technical problem to be solved by the present application is to overcome the problem of overkill caused by the correction of the CAD position in the PCB in the prior art.

[0006] To solve the above technical problems, the present invention provides a method for correcting CAD position in a PCB board, comprising:

[0007] Step S1: Acquire point cloud data information of the PCB board within a single FOV area;

[0008] Step S2: rasterize the point cloud of a single FOV area and obtain the position information of each grid, calculate the histogram of the point cloud data, and take the area with the largest number of points in the histogram as the ground point of the point cloud;

[0009] Step S3: Calculate the center position P of the CAD, then generate a horizontal ray from point P to the right, and determine whether the horizontal ray intersects with the ground point;

[0010] Step S4: fitting the extracted point cloud ground points into a base surface using the least squares method;

[0011] Step S5: filtering the contours by rectangularity and performing rectangularity calculation;

[0012] Step S6: Match the CAD with the contours in the mask label image;

[0013] Step S7: The calculated CAD average offset value is applied to each CAD detection frame, thereby correcting the position of the CAD.

[0014] In one embodiment of the present invention, the histogram of the statistical point cloud data in step S2 is calculated as follows:

[0015]

[0016] Where H(i) represents the number of points with height value i, I(x,y) represents the height value corresponding to the image position (x,y), M and N represent the width and height of the image (PCB image), respectively, and δ is the Dirac delta function. When I(x,y) = i, δ(I(x,y)-i) = 1, otherwise δ(I(x,y)-i) = 0.

[0017] In one embodiment of the present invention, the center position P of the CAD is calculated, and a horizontal ray y=y from point P to the right is generated. p , check each edge [(x i ,y i ),(x i+1 ,y i+1 )] is it consistent with the horizontal ray y=y p intersect.

[0018] In one embodiment of the present invention, the checking of each edge [(x i ,yi ),(x i+1 ,y i+1 )] whether the formula for intersecting the horizontal ray y=y p

[0019]

[0020] Where, if x c >x p , it means that the intersection point is on the ray; finally, the number of intersection points is counted, if the number of intersection points is the cardinal number, it means that the CAD center position is in the contour, if the number of intersection points is even, it means that the CAD center position is outside the contour.

[0021] In an embodiment of the present application, the step S4 uses the least square method to fit the extracted point cloud ground points into a base surface, and the formula is as follows:

[0022]

[0023] Where, n is the number of data points, y i is the actual observation value of the i th data point, x i is the independent variable of the i th data point, and f(x i , β) is the fitting function.

[0024] In an embodiment of the present application, the formula for calculating the rectangularity in the step S5 is as follows:

[0025]

[0026] Where, A s is the area of the contour, and W and H are the area of the minimum circumscribed rectangle of the contour.

[0027] To solve the above technical problems, the present application provides a system for correcting the position of a CAD in a PCB, comprising:

[0028] An acquisition module is configured to acquire point cloud data information of a PCB in a single FOV region;

[0029] A statistics module is configured to rasterize the point cloud of a single FOV region and acquire position information of each grid, and to count a histogram of the point cloud data and take the region with the most points in the histogram as the ground point of the point cloud;

[0030] A calculation module is configured to calculate the center position P of a CAD, and then generate a horizontal ray from the point P to the right to determine whether the horizontal ray intersects the ground point;

[0031] A fitting module is configured to use the least square method to fit the extracted point cloud ground points into a base surface; ​

[0032] Filtering module: used for filtering the contour by rectangularity and calculating the rectangularity;

[0033] Matching module: used for matching the CAD with the contour in the mask label image;

[0034] Correction module: used for correcting the position of the CAD by using the calculated average offset value of the CAD to each CAD detection frame.

[0035] To solve the above technical problems, the present application provides an electronic device, comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method for correcting the position of the CAD in the PCB when executing the computer program.

[0036] To solve the above technical problems, the present application provides a computer readable storage medium having a computer program stored thereon, wherein the computer program is executable by a processor to implement the steps of the method for correcting the position of the CAD in the PCB.

[0037] The above technical solution of the present application has the following advantages compared with the prior art:

[0038] The present application corrects all CADs in the FOV using the point cloud data of the single FOV, effectively improves the correction accuracy of the CAD position, and can solve the problem of insufficient detection ability caused by the error of the component offset amount calculated based on the CAD when the CAD position is offset due to various factors during the PCB detection process of the AOI device. The accuracy and real-time requirements during the detection process are met;

[0039] The present application combines the traditional 2D algorithm and 3D point cloud algorithm with specific industrial scenarios, which can effectively solve the problem of component offset overkill caused by the error of the component offset amount calculation when the CAD position is offset due to various factors, improve the yield of the AOI device during the detection process, effectively improve the detection accuracy and detection efficiency, and provide a reference for the detection of other similar products. BRIEF DESCRIPTION OF DRAWINGS

[0040] In order to make the content of the present application more easily understood, the present application will be further described in detail below according to specific embodiments of the present application and in conjunction with the accompanying drawings.

[0041] Figure 1 is a flow chart of the method of the present application

[0042] Figure 2 is a schematic diagram of the intersection of each edge composed of the ground contour points with the horizontal ray. DETAILED DESCRIPTION

[0043] The present application will be further described in conjunction with the accompanying drawings and specific embodiments so that those skilled in the art can better understand and implement the present application, but the embodiments are not intended to limit the present application.

[0044] Embodiment one

[0045] Referring to Figure 1 The present application relates to a method for correcting the position of CAD in a PCB, comprising:

[0046] Step S1: Obtain the point cloud data information of the PCB in a single FOV region;

[0047] Step S2: Grid the point cloud of a single FOV region and obtain the position information of each grid, count the histogram composed of the point cloud data, and take the region with the most points in the histogram as the ground point of the point cloud;

[0048] Step S3: Calculate the center position P of the CAD, then generate a horizontal ray to the right from point P, and determine whether the horizontal ray intersects with the ground point;

[0049] Step S4: Fit the extracted point cloud ground point into a base surface using the least squares method;

[0050] Step S5: Filter the contour by rectangularity and calculate the rectangularity;

[0051] Step S6: Match the CAD with the contour in the mask label image;

[0052] Step S7: Use the calculated average offset value of the CAD to each CAD detection box to correct the position of the CAD.

[0053] The present application relates to a method for correcting the position of CAD in a PCB, comprising:

[0054] The present application relates to a method for correcting the position of CAD in a PCB, comprising: Figure 1 The specific process is as follows:

[0055] 1. Use a high-resolution camera, DLP, and 3D imaging algorithm to obtain the point cloud data information of the PCB in a single FOV region.

[0056] 2. Rasterize the point cloud of a single FOV area and obtain the position information of each grid. Then, use Formula 1 to calculate the histogram of the point cloud data and use the area with the largest number of points in the histogram as the ground point of the point cloud. Here, H(i) represents the number of points with height value i, I(x,y) represents the height value corresponding to the image position (x,y), M and N represent the width and height of the image, respectively, and δ is the Dirac delta function. When I(x,y) = i, δ(I(x,y)-i) = 1, otherwise δ(I(x,y)-i) = 0.

[0057]

[0058] 3. Calculate the center position P of the CAD, and then generate a horizontal ray y=y from point P to the right p , then check each edge [(x i ,y i ),(x i+1 ,y i+1 )] is it consistent with the horizontal ray y=y p Intersect, the intersection condition is shown in formula 2. If x c >x p Then it means the intersection point is on the ray. Finally, count the number of intersection points. If the number of intersection points is a cardinal number, it means the CAD center position is inside the contour. If the number of intersection points is an even number, it means the CAD center position is outside the contour. Figure 2 , Figure 2 (a) in the equation represents an intersection point. Figure 2 (b) in the equation represents two intersection points. Figure 2 (c) in the figure indicates zero intersections.

[0059] Intersection conditions:

[0060]

[0061] 4. All CAD positions are determined. If most of them are not within the contour, it means that the extracted ground points are on the substrate surface rather than the base surface of the PCB. Then, use the point cloud with the second most points in the histogram as the ground point and repeat this process to obtain the accurate ground point.

[0062] The extracted point cloud ground points are fitted into the base surface using the least squares method, as shown in Formula 3.

[0063]

[0064] Where n is the number of data points, y i is the actual observed value of the i-th data point, x i is the independent variable of the i-th data point, f(xi , β) is a fitting function.

[0065] The height values of each point in the point cloud are recalculated using the fitted base surface, and the area with a point cloud height value greater than the pad height value is regarded as an area where components can exist and a mask label image is generated, wherein the pixel value of the area where components can exist is 1 and the pixel value of other areas is 0.

[0066] 5. Since the components commonly used on PCBs such as resistors, capacitors, ICs, etc. are rectangular, the contours can be filtered by rectangularity, and the rectangularity calculation is shown in formula 4. Wherein, A s is the area of the contour, and W and H are the areas of the minimum circumscribed rectangle of the contour. In addition, each component has a standard size, and the area of the minimum and maximum component can also be used to filter the area where non-components are located.

[0067]

[0068] 6. When matching the contours in the CAD and the mask label image, the CAD center is enlarged by 1.5 times, and then a search image m1 is obtained by cropping from the single FOV mask. It is determined whether the CAD intersects with the contour in m1, and if it intersects, the rectangle corresponding to the maximum intersection area contour is returned; if it does not intersect, the rectangle corresponding to the closest contour centroid to the image center, i.e. the CAD center, is returned.

[0069] 7. Since there is a large deviation in the positioning of the mark points, a threshold value needs to be preset, and when the deviation of a single CAD exceeds the threshold value, the cumulative total deviation is no longer calculated. In addition, matching contours or noise interference can also cause errors in the calculation of the CAD deviation, so all calculated CAD deviations are sorted, and the first 30% and the last 30% are discarded, and only the middle 40% of the data is used to calculate the average deviation value of the CAD. Finally, the calculated average deviation value of the CAD is used for each CAD detection box, so as to correct the position of the CAD.

[0070] Example Two

[0071] The embodiment provides a system for correcting the position of a CAD in a PCB, comprising:

[0072] An acquisition module for acquiring point cloud data information of a PCB in a single FOV area;

[0073] A statistical module for rasterizing the point cloud of a single FOV area and obtaining the position information of each grid, and counting a histogram of the point cloud data, and regarding the area with the most points in the histogram as the ground point of the point cloud;

[0074] A calculating module is configured to calculate a center position P of the CAD, and then generate a horizontal ray from the point P to the right, and determine whether the horizontal ray intersects with the ground point;

[0075] A fitting module is configured to fit the extracted ground points of the point cloud into a base surface by using a least square method;

[0076] A filtering module is configured to filter the contour by using a rectangular degree, and perform rectangular degree calculation;

[0077] A matching module is configured to match the CAD with the contour in the mask label image;

[0078] A correcting module is configured to use the calculated average offset value of the CAD to correct the position of each CAD detection box.

[0079] Embodiment three

[0080] The embodiment provides an electronic device, which comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the steps of the method for correcting the position of the CAD in the PCB board according to the embodiment one when executing the computer program.

[0081] Embodiment four

[0082] The embodiment provides a computer readable storage medium, which stores a computer program, and the computer program is executable on a processor to implement the steps of the method for correcting the position of the CAD in the PCB board according to the embodiment one.

[0083] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can be in the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can be in the form of a computer program product implemented on one or more computer usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer usable program code. The solutions in the embodiments of the present application can be implemented in various computer languages, such as object-oriented programming language Java and direct script language JavaScript.

[0084] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 one or more flowcharts and / or blocks Figure 1 means for functionally implementing the steps listed in the flowchart block or blocks.

[0085] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instructions which implement the function specified in the flowchart block or blocks. Figure 1 one or more flowcharts and / or blocks Figure 1 means for functionally implementing the steps listed in the flowchart block or blocks.

[0086] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 one or more flowcharts and / or blocks Figure 1 means for functionally implementing the steps listed in the flowchart block or blocks.

[0087] While the preferred embodiments of the application have been described, additional variations and modifications can be made to the embodiments by those of skill in the art once they have the benefit of the present disclosure. Therefore, the appended claims are intended to cover all such variations and modifications as falling within the scope of the application.

[0088] Obviously, the embodiments described above are only examples for clarity and are not intended to limit the scope of the application. Based on the above description, other different forms can also be made by those of ordinary skill in the art. Here, it is not necessary or possible to exhaust all the embodiments. The obvious changes or modifications derived therefrom are still within the protection scope of the present application.

Claims

1. A method for correcting CAD position in a PCB, characterized by: include: Step S1: Acquire point cloud data information of the PCB board within a single FOV area; Step S2: rasterize the point cloud of a single FOV area and obtain the position information of each grid, calculate the histogram of the point cloud data, and take the area with the largest number of points in the histogram as the ground point of the point cloud; Step S3: Calculate the center position P of the CAD, then generate a horizontal ray from point P to the right, and determine whether the horizontal ray intersects with the ground point; Step S4: fitting the extracted point cloud ground points into a base surface using the least squares method; Step S5: filtering the contours by rectangularity and performing rectangularity calculation; Step S6: Match the CAD with the contours in the mask label image; Step S7: The calculated CAD average offset value is applied to each CAD detection frame, thereby correcting the position of the CAD.

2. The method for correcting CAD position in a PCB according to claim 1, wherein: The histogram of the statistical point cloud data in step S2 is calculated as follows: Where H(i) represents the number of points with height value i, I(x,y) represents the height value corresponding to the image position (x,y), M and N represent the width and height of the image, respectively, and δ is the Dirac delta function. When I(x,y) = i, δ(I(x,y)-i) = 1, otherwise δ(I(x,y)-i) = 0.

3. The method for correcting CAD position in a PCB according to claim 1, wherein: Calculate the center position P of the CAD and generate a horizontal ray y=y from point P to the right p , check each edge [(x i ,y i ),(x i+1 ,y i+1 )] is it consistent with the horizontal ray y=y p intersect.

4. The method for correcting CAD position in a PCB according to claim 3, wherein: The inspection consists of each edge [(x i ,y i ),(x i+1 ,y i+1 )] is it consistent with the horizontal ray y=y p The formula for intersection is: Among them, if x c >x p It means that the intersection point is on the ray; finally, count the number of intersection points. If the number of intersection points is a cardinality, it means that the center position of the CAD is inside the contour. If the number of intersection points is an even number, it means that the center position of the CAD is outside the contour.

5. The method for correcting CAD position in a PCB according to claim 1, wherein: In step S4, the extracted point cloud ground points are fitted into a base surface using the least squares method, and the formula is: Where n is the number of data points, y i is the actual observed value of the i-th data point, x i is the independent variable of the i-th data point, f(x i ,β) is the fitting function.

6. The method for correcting CAD position in a PCB according to claim 1, wherein: The formula for calculating the rectangularity in step S5 is: Among them, A s is the area of ​​the contour, W and H are the areas of the minimum circumscribed rectangle of the contour.

7. A system for correcting CAD position in a PCB, characterized by: include: Acquisition module: used to obtain point cloud data information of the PCB board within a single FOV area; Statistics module: used to rasterize the point cloud of a single FOV area and obtain the position information of each grid, calculate the histogram of the point cloud data, and take the area with the largest number of points in the histogram as the ground point of the point cloud; Calculation module: used to calculate the center position P of the CAD, then generate a horizontal ray from point P to the right, and determine whether the horizontal ray intersects with the ground point; Fitting module: used to fit the extracted point cloud ground points into the base surface using the least squares method; Filtering module: used to filter the contour by rectangularity and perform rectangularity calculation; Matching module: used to match the contours in the CAD and mask label images; Correction module: used to apply the calculated CAD average offset value to each CAD detection frame, thereby correcting the CAD position.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the steps of the method for correcting the CAD position in a PCB board as claimed in any one of claims 1 to 6 are implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method for correcting the CAD position in a PCB board as claimed in any one of claims 1 to 6 are implemented.