A PCB board detection system and method based on 3D scanning

By setting the initial pose, region division, and environmental interference matrix optimization using a dedicated calibration board, combined with dynamic adjustment and point cloud data processing, the accuracy and efficiency issues of 3D scanning technology in PCB board inspection were solved, and high-precision multi-camera system inspection was achieved.

CN120852362BActive Publication Date: 2026-03-17SUZHOU YINGXINTAI TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510979355.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-07-16
Publication Date
2026-03-17
Estimated Expiration
2045-07-16

AI Technical Summary

Technical Problem

Existing 3D scanning technology has problems in PCB board inspection, such as positional deviation, data errors caused by environmental data influence, and insufficient detection accuracy, which leads to quality inspection errors.

Method used

A dedicated calibration board is used to set the initial pose of the 3D camera, perform region division, construct an environmental interference matrix, and adjust the dynamic pose. Combined with point cloud data, the system optimizes restoration and stitching to achieve high-precision detection of a multi-camera system.

Benefits of technology

It improves the accuracy and efficiency of PCB board inspection, adapts to complex working conditions, reduces computational load, ensures coverage of key parts, reduces errors, and enhances inspection integrity and real-time performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120852362B_ABST
    Figure CN120852362B_ABST
Patent Text Reader

Abstract

The application discloses a PCB detection system and method based on 3D scanning, and relates to the technical field of quality detection.The application sets n 3D cameras to collect point cloud data of PCBs at different angles, sets the initial pose of each 3D camera by using a special calibration plate, allocates the divided area to each 3D camera to obtain the detection area of each 3D camera, constructs an environmental interference matrix to dynamically adjust the initial position of each 3D camera, introduces the environmental interference matrix to optimize and restore the point cloud data collected by all 3D cameras, calculates the overlapping area according to the optimized point cloud data to obtain a 3D virtual model of the real-time PCB, collects real-time data of each quality detection item of the real-time PCB by using the 3D virtual model of the real-time PCB, designs the detection standard and the quality threshold according to professional knowledge, and judges whether the quality of the real-time PCB is qualified or not by the quality threshold.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of quality inspection technology, specifically to a PCB board inspection system and method based on 3D scanning. Background Technology

[0002] With the increasing level of industrial automation, the quality requirements for PCB board production are becoming increasingly stringent. For measurements such as bevel angle, board thickness, gold finger thickness, bevel depth, and bevel height during the production process, quality personnel often use methods such as contact dot measurement, manual measurement with electron microscopes, and destructive slicing measurements. These methods are inefficient and pose a risk of secondary damage to the board material, thus only allowing for sampling inspection of a portion of the products. If problems arise in individual products and are not detected during sampling, defective products may be released, affecting customer reputation and leading to decreased customer satisfaction.

[0003] With the advancement of SMT (Surface Mount Technology) processes, the demand for 3D information inspection, such as the quality of soldered pins on PCBs, has increased, leading to the emergence of 3D Optical Inspection (3DAOI) technology. 3DAOI acquires 3D information about components and soldered pins on a circuit board through 3D scanning, enabling more accurate assessment of the connection status between pins and the PCB substrate. Initially, 3DAOI technology primarily employed structured light scanning, but this method suffered from slow detection speed and insufficient measurement stability, limiting its market application. In recent years, with continuous technological advancements, 3D scanning technology has gradually improved, resulting in various 3D inspection solutions based on different principles.

[0004] However, there are still some problems when using 3D scanning technology to inspect PCB boards. These include the high speed of the production line and the large number of products to be inspected, which may lead to deviations in the position of the PCB board during inspection; and the different environmental data of the 3D camera at different locations, which affects the data collected differently. These problems all lead to errors in the final data stitching, resulting in quality inspection failures. Summary of the Invention

[0005] The purpose of this invention is to provide a PCB board inspection system and method based on 3D scanning to solve the problems raised in the prior art.

[0006] To achieve the above objectives, the present invention provides the following technical solution:

[0007] A PCB board inspection method based on 3D scanning, the method comprising the following steps:

[0008] S100: Set up n 3D cameras to collect point cloud data of PCB board from different angles, and use a dedicated calibration board to set the initial pose of each 3D camera.

[0009] Furthermore, the specific steps for setting the initial position of each 3D camera using a dedicated calibration board are as follows:

[0010] S101. Place the dedicated calibration plate in the area to be tested. Set up n 3D cameras in the area to be tested. The surface of the dedicated calibration plate has chrome ball mark points. Extract the world coordinates of each mark point in the world coordinate system and the pixel coordinates acquired by the 3D cameras to construct a 3D camera debugging model. The formula is:

[0011] ;

[0012] In the formula, p k P represents the pixel coordinates of the k-th Mark point. k Let R represent the world coordinates of the k-th Mark point, π represent the camera projection function, and Rk represent the world coordinates of the k-th Mark point. i Let t represent the rotation matrix of the i-th 3D camera. i Let represent the translation vector of the i-th 3D camera, and M represent the total number of Mark points in the dedicated calibration board; k belongs to 1 to M, and i belongs to 1 to n;

[0013] Based on the 3D camera debugging model, the rotation matrix and translation vector of the 3D camera that minimize the summation value are extracted, and the initial poses of all 3D cameras are constructed as {R}. i , t i} n i=1 .

[0014] The physical characteristics of the dedicated calibration board are matched with those of the PCB board, reducing pose calculation errors caused by the "property differences" between the calibration board and the target object, and improving the initial pose accuracy. The unified calibration process enables simultaneous calibration of multiple cameras, avoiding the accumulation of errors from individual calibrations, improving the pose consistency between cameras, and laying the foundation for subsequent point cloud stitching.

[0015] S200. Divide the dedicated calibration board into regions and assign the divided regions to each 3D camera to obtain the detection region of each 3D camera;

[0016] Furthermore, the specific steps to obtain the detection area of ​​each 3D camera are as follows:

[0017] S201. On a dedicated calibration board, professionals divide the board into different regions according to PCB board quality inspection items. They then extract the normal vector, optical axis vector, and resolution of each region. The resolution is standardized, and the fit between each 3D camera and its region is calculated using the following formula:

[0018] ;

[0019] In the formula, ρij a represents the fit between the i-th 3D camera and the j-th segment region. j Let v represent the normal vector of the j-th block region. i Res represents the optical axis direction vector of the i-th 3D camera. i Let w represent the resolution of the i-th 3D camera, and w represent the resolution weight, which is set by professionals.

[0020] S202. Calculate the fit between each 3D camera and the block region. For each block region, select the 3D camera corresponding to the maximum fit and assign it. After traversing and calculating the assignment, each 3D camera obtains the assigned block region and integrates it into the detection region.

[0021] By dividing the calibration board into regions, "on-demand allocation" is achieved. Each camera focuses on a specific area (such as the edge of the PCB board, areas with dense solder joints, etc.), reducing unnecessary data acquisition and lowering the computational load of subsequent processing. Furthermore, clear region division avoids blind spots, ensuring that all critical parts of the PCB board (such as small components and pins) are covered, improving the completeness of the inspection.

[0022] S300: Construct an environmental interference matrix to address the impact of different environmental data collected by each 3D camera on point cloud data in the past.

[0023] Furthermore, the specific steps for constructing the environmental interference matrix are as follows:

[0024] S301. Collect environmental data that has influenced the point cloud data acquired by the 3D camera in the past, including but not limited to temperature, vibration, and light; collect the point cloud data acquired by each 3D camera in the past under all environmental data, and construct an environmental data matrix E. i ={h1, h2, h3, ..., h m}, h1, h2, h3, ..., h m The first, second, third, ..., m environmental data affect the point cloud data acquired by the 3D camera, where m is a positive integer. For the same 3D camera, the deviation value of the acquired point cloud data is calculated when each environmental data changes. The change in environmental data is used as the independent variable, and the deviation value of point cloud data is used as the variable to plot the curve.

[0025] S302. Construct an environmental interference matrix using all environmental data changes and point cloud data deviations, with the following formula:

[0026] ;

[0027] In the formula, for the i-th 3D camera, △P i F represents the point cloud data deviation matrix. i Denotes the mapping relationship matrix, ΔE iRepresents the matrix of environmental data changes;

[0028] S303. The mapping matrix contains the mapping relationship between each environmental data change and the point cloud data deviation value. The mapping algorithm is used to calculate the mapping relationship between each environmental data change and the point cloud data deviation value. The formula is:

[0029] ;

[0030] In the formula, λ represents the regularization coefficient, and I represents the identity matrix.

[0031] By actively collecting historical environmental data (such as light intensity, temperature, and humidity) and their correlation with point cloud errors, a quantitative "environmental interference matrix" is constructed, which can specifically describe the impact of different environments on the point clouds of each camera. Compared with traditional "passive filtering", this matrix achieves "active prediction of interference", providing data support for subsequent point cloud optimization and improving the stability of point clouds in complex environments.

[0032] S400: Utilizes all 3D cameras to acquire point cloud data of the PCB board in real time, compares the real-time PCB board position data with the detection area of ​​each 3D camera, and dynamically adjusts the initial position of each 3D camera.

[0033] Furthermore, the specific steps for dynamically adjusting the initial position of each 3D camera are as follows:

[0034] S401. Utilize all 3D cameras to acquire initial point cloud data of the PCB board in real time. For the detection area of ​​each 3D camera, extract the corner coordinates of the detection area under the initial pose of the 3D camera as preset coordinates. Extract the actual coordinates of the corner points of the detection area of ​​the 3D camera in the real-time initial point cloud data. Calculate the pose adjustment value of the 3D camera using the following formula:

[0035] ;

[0036] In the formula, R pcb t represents the 3D camera rotation matrix adjustment value. pcb Q represents the adjustment value of the 3D camera translation vector. s Q represents the actual coordinates of the s-th corner point. s ref Let represent the preset coordinates of the s-th corner point, and B represent the total number of corner points. The system inputs two automatically generated pose adjustment values ​​to calculate the square of the Euclidean distance between the actual coordinates and the preset coordinates of the corner point. Repeat the operation z times to extract the two pose adjustment values ​​corresponding to the minimum square of the Euclidean distance.

[0037] S402. The initial pose of each 3D camera is dynamically adjusted using the finally extracted pose adjustment values, specifically as follows:

[0038] ;

[0039] In the formula, R i new R represents the new rotation matrix after dynamic adjustment of the i-th 3D camera. T pcb,i t represents the adjustment value of the rotation matrix for the i-th camera. i new Let t represent the translation vector after dynamic adjustment of the i-th 3D camera. pcb,i This represents the adjustment value of the translation vector of the i-th 3D camera.

[0040] The system compares the PCB board position with the camera detection area in real time and dynamically adjusts the camera pose (such as angle and focal length) to ensure that the camera is always focused on the assigned area, thus avoiding detection failures caused by fluctuations in the PCB board position.

[0041] The dynamic adjustment mechanism adapts to the continuity of the production line (such as changes in PCB board conveying speed) and improves the system's robustness to fluctuations in operating conditions.

[0042] S500: For the point cloud data of the real-time PCB board acquired by all 3D cameras, an environmental interference matrix is ​​introduced to optimize and restore the point cloud data. The overlapping area is calculated based on the optimized point cloud data. Then, the point cloud data of each 3D camera is stitched together to obtain a 3D virtual model of the real-time PCB board.

[0043] Furthermore, the specific steps to obtain a real-time 3D virtual model of the PCB board are as follows:

[0044] S501. Real-time acquisition of point cloud data of the PCB board using n 3D cameras after pose adjustment. Environmental data is acquired separately for each 3D camera. The difference between the real-time environmental data and the standard environmental data is calculated as the environmental data change. The environmental data when the 3D cameras are acquiring point cloud data normally is used as the standard environmental data. The acquired point cloud data is optimized and restored using an environmental interference matrix. The formula is:

[0045] ;

[0046] In the formula, p adj p represents the optimized and restored point cloud data matrix. s This represents the real-time point cloud data matrix acquired by the i-th 3D camera; the calculated changes in environmental data are input into the optimization and restoration formula to calculate the optimized and restored point cloud data for each 3D camera;

[0047] S502. For each pair of adjacent 3D cameras, calculate the Euclidean distance L between the coordinates of each point cloud in the two point cloud data matrices after optimization and restoration, set a distance threshold Ly, and use the distance threshold to judge the Euclidean distance of the point cloud coordinates. When L≤Ly, it is judged as the same point cloud, and when L>Ly, it is judged as different point clouds. Iterate through the calculations to define the regions where all the same point clouds are located as overlapping regions.

[0048] S503. For two adjacent 3D cameras, the boundary of the overlapping area is used as the stitching limit. The point cloud data of the adjacent 3D cameras are stitched together, and the point cloud coordinates of the overlapping area are averaged for optimization. The operation is repeated for all 3D cameras, and the stitched point cloud data is used to obtain the real-time 3D virtual model of the PCB board.

[0049] An environmental interference vector matrix is ​​introduced to "optimize and restore" real-time point clouds, eliminating noise and distortion caused by interference from lighting, temperature, etc., and improving the accuracy of point clouds from a single camera. By calculating the overlapping areas of the optimized point clouds, stitching is achieved "based on actual data matching" rather than "theoretical stitching" that relies on the initial pose, which significantly reduces stitching errors and improves the overall accuracy of the 3D virtual model.

[0050] S600 allows professionals to input calculation functions for all quality inspection items, collect real-time data for each quality inspection item on the real-time PCB board using a 3D virtual model of the real-time PCB board, design inspection standards and quality thresholds based on professional knowledge, and determine whether the real-time PCB board is qualified based on the quality thresholds.

[0051] Furthermore, the specific steps for determining whether the real-time PCB board quality is acceptable using parameter thresholds are as follows:

[0052] S601. Professionals input the calculation function for each PCB quality inspection item to obtain the quality inspection model G. G contains the calculation functions for all quality inspection items of all PCB boards. Real-time data for each quality inspection item is calculated in the 3D virtual model. The quality inspection items include the bevel angle of the front and back sides, the bevel depth of the front and back sides, the bevel height of the front and back sides, the board thickness, the excess thickness, the difference in bevel angle, the difference in bevel depth, and the difference in bevel height.

[0053] The method for calculating the angle of the hypotenuse on the front and back sides is as follows: Fit a virtual hypotenuse parallel to the hypotenuse on the hypotenuse part of the PCB board, and fit a virtual horizontal plane parallel to the horizontal part on the horizontal part. Construct the normal vectors of the two virtual planes, and use the dot product method to find the angle between the two normal vectors. The hypotenuse angle = 180° - the angle between the two normal vectors.

[0054] The method for calculating the depth of the hypotenuse on both sides is as follows: project the hypotenuse of the PCB board onto a horizontal plane, and take the projection length on the horizontal plane as the hypotenuse depth.

[0055] The method for calculating the height of the hypotenuse on both sides is: Hypotenuse height = Hypotenuse depth × tan (hypotenuse angle).

[0056] The method for calculating the board thickness is as follows: calculate the distance between all corresponding points on the front and back of the PCB board that have a vertical mapping relationship, and then calculate the average value to obtain the board thickness;

[0057] The method for calculating the excess thickness is as follows: Excess thickness = Plate thickness - Front bevel height - Back bevel height;

[0058] The method for calculating the difference in the hypotenuse angle is: Difference in hypotenuse angle = Front hypotenuse angle - Back hypotenuse angle;

[0059] The method for calculating the difference in the depth of the hypotenuse is: difference in the height of the hypotenuse = height of the hypotenuse on the front side - height of the hypotenuse on the back side;

[0060] The method for calculating the height difference of the hypotenuse is: the difference in the depth of the hypotenuse = the depth of the hypotenuse on the front side - the depth of the hypotenuse on the back side;

[0061] Based on the calculation methods for different quality inspection items, the deviation between the real-time data of each inspection item and the inspection standard in the 3D virtual model is calculated. Inspection standards and quality thresholds are set for each quality inspection item. The deviation is judged using the quality thresholds. When the deviation of all inspection items is less than or equal to the quality threshold, the real-time PCB quality is judged to be qualified; when the deviation of any inspection item is greater than the quality threshold, the real-time PCB quality is judged to be unqualified.

[0062] 3D virtual models can extract complete hardware data (such as solder joint volume, component spacing, pin tilt angle and other three-dimensional parameters), covering key quality indicators that traditional 2D inspection cannot obtain.

[0063] A PCB board inspection system based on 3D scanning, comprising a data acquisition module, a 3D camera setting module, an environmental interference module, a pose adjustment module, a PCB board inspection module, and a quality judgment module;

[0064] The data acquisition module is used to collect point cloud data and corresponding environmental data from historical 3D camera data.

[0065] The 3D camera setting module is used to set the 3D camera to collect point cloud data of the PCB board from different angles, and to set the initial pose of each 3D camera using a dedicated calibration board; and to allocate a divided area to each 3D camera to obtain the detection area of ​​each 3D camera.

[0066] The environmental interference module is used to construct an environmental interference matrix based on the impact of different environmental data collected by each 3D camera in the history on point cloud data.

[0067] The pose adjustment module is used to acquire point cloud data of the PCB board in real time using all 3D cameras, compare the real-time PCB board position data with the detection area of ​​each 3D camera, and dynamically adjust the initial position of each 3D camera.

[0068] The PCB board detection module is used to optimize and restore the point cloud data of the real-time PCB board collected by all 3D cameras by introducing an environmental interference matrix. The overlapping area is calculated based on the optimized point cloud data, and then the point cloud data of each 3D camera is stitched together to obtain a 3D virtual model of the real-time PCB board.

[0069] The quality judgment module is used to design testing standards and quality thresholds based on professional knowledge, and to determine whether the quality of the PCB board is qualified in real time through the quality thresholds.

[0070] The 3D camera setup module includes an initial pose unit and a detection area unit;

[0071] The initial pose unit is used to set n 3D cameras to collect point cloud data of PCB boards at different angles, and to set the initial pose of each 3D camera using a dedicated calibration board.

[0072] The detection area unit is used to divide the dedicated calibration plate into regions, assigning a region to each 3D camera to obtain the detection area of ​​each 3D camera.

[0073] The PCB board inspection module includes a point cloud optimization and restoration unit and a point cloud stitching unit;

[0074] The point cloud optimization and restoration unit is used to optimize and restore the point cloud data of the real-time PCB board acquired by all 3D cameras by introducing an environmental interference matrix.

[0075] The point cloud stitching unit is used to calculate the overlapping area based on the optimized point cloud data, and then stitch together the point cloud data of each 3D camera to obtain a real-time 3D virtual model of the PCB board.

[0076] Compared with the prior art, the beneficial effects of the present invention are:

[0077] 1. This invention solves the problem of insufficient accuracy caused by calibration errors, environmental interference, and position fluctuations in traditional multi-camera systems through dedicated calibration, dynamic pose adjustment, and environmental interference optimization, and realizes high-precision 3D modeling under complex working conditions.

[0078] 2. The present invention reduces data redundancy by dividing the area, avoids invalid data collection by dynamic adjustment, and reduces computational load by optimizing splicing. While ensuring full coverage of the PCB board, it improves data processing efficiency and adapts to the real-time requirements of the production line. Attached Figure Description

[0079] Figure 1 This is a module distribution diagram of a PCB board inspection system based on 3D scanning according to the present invention;

[0080] Figure 2 This is a schematic diagram illustrating the steps of a PCB board inspection method based on 3D scanning according to the present invention. Detailed Implementation

[0081] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0082] Example: Figures 1-2 As shown, the present invention provides a technical solution.

[0083] A PCB board inspection method based on 3D scanning, the method comprising the following steps:

[0084] S100: Set up n 3D cameras to collect point cloud data of PCB board from different angles, and use a dedicated calibration board to set the initial pose of each 3D camera.

[0085] The specific steps for setting the initial position of each 3D camera using a dedicated calibration board are as follows:

[0086] S101. Place the dedicated calibration plate in the area to be tested. Set up n 3D cameras in the area to be tested. The surface of the dedicated calibration plate has chrome ball mark points. Extract the world coordinates of each mark point in the world coordinate system and the pixel coordinates acquired by the 3D cameras to construct a 3D camera debugging model. The formula is:

[0087] ;

[0088] In the formula, p k P represents the pixel coordinates of the k-th Mark point. k Let R represent the world coordinates of the k-th Mark point, π represent the camera projection function, and Rk represent the world coordinates of the k-th Mark point. i Let t represent the rotation matrix of the i-th 3D camera. i Let represent the translation vector of the i-th 3D camera, and M represent the total number of Mark points in the dedicated calibration board; k belongs to 1 to M, and i belongs to 1 to n;

[0089] Based on the 3D camera debugging model, the rotation matrix and translation vector of the 3D camera that minimize the summation value are extracted, and the initial poses of all 3D cameras are constructed as {R}. i , t i}n i=1 .

[0090] The physical characteristics of the dedicated calibration board are matched with those of the PCB board, reducing pose calculation errors caused by the "property differences" between the calibration board and the target object, and improving the initial pose accuracy. The unified calibration process enables simultaneous calibration of multiple cameras, avoiding the accumulation of errors from individual calibrations, improving the pose consistency between cameras, and laying the foundation for subsequent point cloud stitching.

[0091] S200. Divide the dedicated calibration board into regions and assign the divided regions to each 3D camera to obtain the detection region of each 3D camera;

[0092] The specific steps to obtain the detection area of ​​each 3D camera are as follows:

[0093] S201. On a dedicated calibration board, professionals divide the board into different regions according to PCB board quality inspection items. They then extract the normal vector, optical axis vector, and resolution of each region. The resolution is standardized, and the fit between each 3D camera and its region is calculated using the following formula:

[0094] ;

[0095] In the formula, ρ ij a represents the fit between the i-th 3D camera and the j-th segment region. j Let v represent the normal vector of the j-th block region. i Res represents the optical axis direction vector of the i-th 3D camera. i Let w represent the resolution of the i-th 3D camera, and w represent the resolution weight, which is set by professionals.

[0096] S202. Calculate the fit between each 3D camera and the block region. For each block region, select the 3D camera corresponding to the maximum fit and assign it. After traversing and calculating the assignment, each 3D camera obtains the assigned block region and integrates it into the detection region.

[0097] By dividing the calibration board into regions, "on-demand allocation" is achieved. Each camera focuses on a specific area (such as the edge of the PCB board, areas with dense solder joints, etc.), reducing unnecessary data acquisition and lowering the computational load of subsequent processing. Furthermore, clear region division avoids blind spots, ensuring that all critical parts of the PCB board (such as small components and pins) are covered, improving the completeness of the inspection.

[0098] S300: Construct an environmental interference matrix to address the impact of different environmental data collected by each 3D camera on point cloud data in the past.

[0099] The specific steps for constructing the environmental interference matrix are as follows:

[0100] S301. Collect environmental data that has influenced the point cloud data acquired by the 3D camera in the past, including but not limited to temperature, vibration, and light; collect the point cloud data acquired by each 3D camera in the past under all environmental data, and construct an environmental data matrix E. i ={h1, h2, h3, ..., h m}, h1, h2, h3, ..., h m The first, second, third, ..., m environmental data affect the point cloud data acquired by the 3D camera, where m is a positive integer. For the same 3D camera, the deviation value of the acquired point cloud data is calculated when each environmental data changes. The change in environmental data is used as the independent variable, and the deviation value of point cloud data is used as the variable to plot the curve.

[0101] S302. Construct an environmental interference matrix using all environmental data changes and point cloud data deviations, with the following formula:

[0102] ;

[0103] In the formula, for the i-th 3D camera, △P i F represents the point cloud data deviation matrix. i Denotes the mapping relationship matrix, ΔE i Represents the matrix of environmental data changes;

[0104] S303. The mapping matrix contains the mapping relationship between each environmental data change and the point cloud data deviation value. The mapping algorithm is used to calculate the mapping relationship between each environmental data change and the point cloud data deviation value. The formula is:

[0105] ;

[0106] In the formula, λ represents the regularization coefficient, and I represents the identity matrix.

[0107] By actively collecting historical environmental data (such as light intensity, temperature, and humidity) and their correlation with point cloud errors, a quantitative "environmental interference matrix" is constructed, which can specifically describe the impact of different environments on the point clouds of each camera. Compared with traditional "passive filtering", this matrix achieves "active prediction of interference", providing data support for subsequent point cloud optimization and improving the stability of point clouds in complex environments.

[0108] S400: Utilizes all 3D cameras to acquire point cloud data of the PCB board in real time, compares the real-time PCB board position data with the detection area of ​​each 3D camera, and dynamically adjusts the initial position of each 3D camera.

[0109] The specific steps for dynamically adjusting the initial position of each 3D camera are as follows:

[0110] S401. Utilize all 3D cameras to acquire initial point cloud data of the PCB board in real time. For the detection area of ​​each 3D camera, extract the corner coordinates of the detection area under the initial pose of the 3D camera as preset coordinates. Extract the actual coordinates of the corner points of the detection area of ​​the 3D camera in the real-time initial point cloud data. Calculate the pose adjustment value of the 3D camera using the following formula:

[0111] ;

[0112] In the formula, R pcb t represents the 3D camera rotation matrix adjustment value. pcb Q represents the adjustment value of the 3D camera translation vector. s Q represents the actual coordinates of the s-th corner point. s ref Let represent the preset coordinates of the s-th corner point, and B represent the total number of corner points. The system inputs two automatically generated pose adjustment values ​​to calculate the square of the Euclidean distance between the actual coordinates and the preset coordinates of the corner point. Repeat the operation z times to extract the two pose adjustment values ​​corresponding to the minimum square of the Euclidean distance.

[0113] S402. The initial pose of each 3D camera is dynamically adjusted using the finally extracted pose adjustment values, specifically as follows:

[0114] ;

[0115] In the formula, R i new R represents the new rotation matrix after dynamic adjustment of the i-th 3D camera. T pcb,i t represents the adjustment value of the rotation matrix for the i-th camera. i new Let t represent the translation vector after dynamic adjustment of the i-th 3D camera. pcb,i This represents the adjustment value of the translation vector of the i-th 3D camera.

[0116] The system compares the PCB board position with the camera detection area in real time and dynamically adjusts the camera pose (such as angle and focal length) to ensure that the camera is always focused on the assigned area, thus avoiding detection failures caused by fluctuations in the PCB board position.

[0117] The dynamic adjustment mechanism adapts to the continuity of the production line (such as changes in PCB board conveying speed) and improves the system's robustness to fluctuations in operating conditions.

[0118] S500: For the point cloud data of the real-time PCB board acquired by all 3D cameras, an environmental interference matrix is ​​introduced to optimize and restore the point cloud data. The overlapping area is calculated based on the optimized point cloud data. Then, the point cloud data of each 3D camera is stitched together to obtain a 3D virtual model of the real-time PCB board.

[0119] The specific steps to obtain a real-time 3D virtual model of the PCB board are as follows:

[0120] S501. Real-time acquisition of point cloud data of the PCB board using n 3D cameras after pose adjustment. Environmental data is acquired separately for each 3D camera. The difference between the real-time environmental data and the standard environmental data is calculated as the environmental data change. The environmental data when the 3D cameras are acquiring point cloud data normally is used as the standard environmental data. The acquired point cloud data is optimized and restored using an environmental interference matrix. The formula is:

[0121] ;

[0122] In the formula, p adj p represents the optimized and restored point cloud data matrix. s This represents the real-time point cloud data matrix acquired by the i-th 3D camera; the calculated changes in environmental data are input into the optimization and restoration formula to calculate the optimized and restored point cloud data for each 3D camera;

[0123] S502. For each pair of adjacent 3D cameras, calculate the Euclidean distance L between the coordinates of each point cloud in the two point cloud data matrices after optimization and restoration, set a distance threshold Ly, and use the distance threshold to judge the Euclidean distance of the point cloud coordinates. When L≤Ly, it is judged as the same point cloud, and when L>Ly, it is judged as different point clouds. Iterate through the calculations to define the regions where all the same point clouds are located as overlapping regions.

[0124] S503. For two adjacent 3D cameras, the boundary of the overlapping area is used as the stitching limit. The point cloud data of the adjacent 3D cameras are stitched together, and the point cloud coordinates of the overlapping area are averaged for optimization. The operation is repeated for all 3D cameras, and the stitched point cloud data is used to obtain the real-time 3D virtual model of the PCB board.

[0125] An environmental interference vector matrix is ​​introduced to "optimize and restore" real-time point clouds, eliminating noise and distortion caused by interference from lighting, temperature, etc., and improving the accuracy of point clouds from a single camera. By calculating the overlapping areas of the optimized point clouds, stitching is achieved "based on actual data matching" rather than "theoretical stitching" that relies on the initial pose, which significantly reduces stitching errors and improves the overall accuracy of the 3D virtual model.

[0126] S600 allows professionals to input calculation functions for all quality inspection items, collect real-time data for each quality inspection item on the real-time PCB board using a 3D virtual model of the real-time PCB board, design inspection standards and quality thresholds based on professional knowledge, and determine whether the real-time PCB board is qualified based on the quality thresholds.

[0127] The specific steps for determining whether the real-time PCB board quality is acceptable based on parameter thresholds are as follows:

[0128] S601. Professionals input the calculation function for each PCB quality inspection item to obtain the quality inspection model G. G contains the calculation functions for all quality inspection items of all PCB boards. Real-time data for each quality inspection item is calculated in the 3D virtual model. The quality inspection items include the bevel angle of the front and back sides, the bevel depth of the front and back sides, the bevel height of the front and back sides, the board thickness, the excess thickness, the difference in bevel angle, the difference in bevel depth, and the difference in bevel height.

[0129] The method for calculating the angle of the hypotenuse on the front and back sides is as follows: Fit a virtual hypotenuse parallel to the hypotenuse on the hypotenuse part of the PCB board, and fit a virtual horizontal plane parallel to the horizontal part on the horizontal part. Construct the normal vectors of the two virtual planes, and use the dot product method to find the angle between the two normal vectors. The hypotenuse angle = 180° - the angle between the two normal vectors.

[0130] The method for calculating the depth of the hypotenuse on both sides is as follows: project the hypotenuse of the PCB board onto a horizontal plane, and take the projection length on the horizontal plane as the hypotenuse depth.

[0131] The method for calculating the height of the hypotenuse on both sides is: Hypotenuse height = Hypotenuse depth × tan (hypotenuse angle).

[0132] The method for calculating the board thickness is as follows: calculate the distance between all corresponding points on the front and back of the PCB board that have a vertical mapping relationship, and then calculate the average value to obtain the board thickness;

[0133] The method for calculating the excess thickness is as follows: Excess thickness = Plate thickness - Front bevel height - Back bevel height;

[0134] The method for calculating the difference in the hypotenuse angle is: Difference in hypotenuse angle = Front hypotenuse angle - Back hypotenuse angle;

[0135] The method for calculating the difference in the depth of the hypotenuse is: difference in the height of the hypotenuse = height of the hypotenuse on the front side - height of the hypotenuse on the back side;

[0136] The method for calculating the height difference of the hypotenuse is: the difference in the depth of the hypotenuse = the depth of the hypotenuse on the front side - the depth of the hypotenuse on the back side;

[0137] Based on the calculation methods for different quality inspection items, the deviation between the real-time data of each inspection item and the inspection standard in the 3D virtual model is calculated. Inspection standards and quality thresholds are set for each quality inspection item. The deviation is judged using the quality thresholds. When the deviation of all inspection items is less than or equal to the quality threshold, the real-time PCB quality is judged to be qualified; when the deviation of any inspection item is greater than the quality threshold, the real-time PCB quality is judged to be unqualified.

[0138] 3D virtual models can extract complete hardware data (such as solder joint volume, component spacing, pin tilt angle and other three-dimensional parameters), covering key quality indicators that traditional 2D inspection cannot obtain.

[0139] A PCB board inspection system based on 3D scanning, comprising a data acquisition module, a 3D camera setting module, an environmental interference module, a pose adjustment module, a PCB board inspection module, and a quality judgment module;

[0140] The data acquisition module is used to collect point cloud data and corresponding environmental data from historical 3D camera data.

[0141] The 3D camera setting module is used to set the 3D camera to collect point cloud data of the PCB board from different angles, and to set the initial pose of each 3D camera using a dedicated calibration board; and to allocate a divided area to each 3D camera to obtain the detection area of ​​each 3D camera.

[0142] The environmental interference module is used to construct an environmental interference matrix based on the impact of different environmental data collected by each 3D camera in the history on point cloud data.

[0143] The pose adjustment module is used to acquire point cloud data of the PCB board in real time using all 3D cameras, compare the real-time PCB board position data with the detection area of ​​each 3D camera, and dynamically adjust the initial position of each 3D camera.

[0144] The PCB board detection module is used to optimize and restore the point cloud data of the real-time PCB board collected by all 3D cameras by introducing an environmental interference matrix. The overlapping area is calculated based on the optimized point cloud data, and then the point cloud data of each 3D camera is stitched together to obtain a 3D virtual model of the real-time PCB board.

[0145] The quality judgment module is used to design testing standards and quality thresholds based on professional knowledge, and to determine whether the quality of the PCB board is qualified in real time through the quality thresholds.

[0146] The 3D camera setup module includes an initial pose unit and a detection area unit;

[0147] The initial pose unit is used to set n 3D cameras to collect point cloud data of PCB boards at different angles, and to set the initial pose of each 3D camera using a dedicated calibration board.

[0148] The detection area unit is used to divide the dedicated calibration plate into regions, assigning a region to each 3D camera to obtain the detection area of ​​each 3D camera.

[0149] The PCB board inspection module includes a point cloud optimization and restoration unit and a point cloud stitching unit;

[0150] The point cloud optimization and restoration unit is used to optimize and restore the point cloud data of the real-time PCB board acquired by all 3D cameras by introducing an environmental interference matrix.

[0151] The point cloud stitching unit is used to calculate the overlapping area based on the optimized point cloud data, and then stitch together the point cloud data of each 3D camera to obtain a real-time 3D virtual model of the PCB board.

[0152] Example: In industrial production, a mass production testing line for 6-layer gold finger slot boards is constructed, and 8 3D cameras are set up for testing. The initial pose of each 3D camera is set.

[0153] The dedicated calibration plate is divided into

[0154] Area A: (Cameras 1 and 2 assigned)

[0155] Area B: (Cameras 3 and 4 assigned)

[0156] Area C: (Cameras 5 and 6 assigned)

[0157] Area D: (Cameras 7 and 8 assigned)

[0158] Example of the allocation process: the fit ρ between area A and camera 1 A区-相机1 Specifically:

[0159] ;

[0160] Historical environmental data and corresponding point cloud data were collected, with a temperature variation of ±5℃ and a humidity of -10%. The corresponding point cloud data deviation was +12μm (z-direction). Using the historical data, the environmental interference matrix for camera 1 was obtained through training, where the weight matrix is: ;

[0161] The PCB board is inspected in real time. After the camera pose is dynamically adjusted based on the corner coordinates, real-time environmental data and point cloud data are extracted. Let the real-time environmental data at the camera be: ;

[0162] The optimized value of point cloud data is calculated using the environmental interference matrix, and the formula is as follows: ;

[0163] The optimized values ​​are used to optimize and restore the point cloud data collected in real time.

[0164] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the invention can be implemented in other specific forms without departing from its spirit or essential characteristics. Therefore, the embodiments should be considered in all respects as exemplary and non-limiting, and the scope of the invention is defined by the appended claims rather than the foregoing description. Thus, all variations falling within the meaning and scope of equivalents of the claims are intended to be included within the present invention. No reference numerals in the claims should be construed as limiting the scope of the claims.

Claims

1. A 3D scanning based PCB board detection method, characterized in that: The method comprises the following steps: S100, setting n 3D cameras to collect point cloud data of PCB boards at different angles, and setting initial poses of each 3D camera by using a special calibration board; S200, dividing the special calibration board into regions, and assigning each 3D camera with a divided region to obtain a detection region of each 3D camera; S300, collecting influences of different environmental data in history on point cloud data for each 3D camera, and constructing an environmental interference matrix; The specific steps of constructing the environmental interference matrix are: S301, collect historical environment data affecting 3D camera acquisition point cloud data, the environment data includes but is not limited to temperature, vibration and light; corresponding to collect all environment data under each 3D camera historical acquisition point cloud data, environment data matrix E is constructed i ={h1, h2, h3,..., hm} m}, h1, h2, h3,..., hm m Indicate the 1st, 2nd, 3rd,..., mth environment data affecting the 3D camera acquisition point cloud data, m is a positive integer; for the same 3D camera, the deviation value of the point cloud data corresponding to the acquisition when each environment data changes is calculated, and the environment data change amount is taken as the independent variable, and the point cloud data deviation value is taken as the variable to draw a curve; S302, constructing the environmental interference matrix by using all environmental data variation values and point cloud data deviation values, and the formula is: ; In the formula, for the i th 3D camera, △P i represents the point cloud data deviation value matrix, F i represents the mapping relationship matrix, △E i represents the environmental data change quantity matrix; S303, the mapping relationship matrix contains the mapping relationship of each environmental data variation value on the point cloud data deviation value, and the mapping algorithm is used to calculate the mapping relationship of each environmental data variation value and the point cloud data deviation value, and the formula is: ; In the formula, λ represents a regularization coefficient, and I represents a unit matrix; S400, collecting point cloud data of the PCB board in real time by using all 3D cameras, comparing real-time PCB board position data with the detection region of each 3D camera, and dynamically adjusting the initial position of each 3D camera; The specific steps of dynamically adjusting the initial position of each 3D camera are: S401, collecting initial point cloud data of the PCB board in real time by using all 3D cameras, extracting corner point coordinates of the detection region of each 3D camera at the initial pose of the 3D camera as preset coordinates, and extracting actual coordinates of the corner point of the detection region of the 3D camera in the real-time initial point cloud data; calculating a pose adjustment value of the 3D camera, and the formula is: ; In the formula, R pcb represents the 3D camera rotation matrix adjustment value, t pcb represents the 3D camera translation vector adjustment value, Q s represents the actual coordinates of the s-th corner point, Q s ref represents the preset coordinates of the s-th corner point, B represents the total number of corner points; the system inputs the two kinds of pose adjustment values generated automatically to calculate the Euclidean distance square of the actual coordinates and the preset coordinates of the corner points, repeats the operation z times, and extracts the two kinds of pose adjustment values corresponding to the minimum Euclidean distance square; S402, dynamically adjusting the initial pose of each 3D camera by using the finally extracted pose adjustment value, and the specific steps are: ; In the formula, R i new represents the new rotation matrix of the i-th 3D camera after dynamic adjustment, R T pcb,i represents the i-th camera rotation matrix adjustment value, t i new represents the translation vector of the i-th 3D camera after dynamic adjustment, t pcb,i represents the i-th 3D camera translation vector adjustment value; S500, for the real-time PCB board point cloud data collected by all 3D cameras, introducing the environmental interference matrix to optimize and restore the point cloud data, calculating the overlapping region according to the optimized point cloud data, and then splicing the point cloud data of each 3D camera to obtain a 3D virtual model of the real-time PCB board; The specific steps of obtaining the 3D virtual model of the real-time PCB board are: S501, collecting point cloud data of the PCB board in real time by using the n 3D cameras after pose adjustment, collecting environmental data for each 3D camera separately, calculating a difference between real-time environmental data and standard environmental data as an environmental data variation value, taking environmental data of the 3D camera when collecting point cloud data normally as the standard environmental data, and optimizing and restoring the collected point cloud data by using the environmental interference matrix, and the formula is: ; In the formula, p adj represents the point cloud data matrix after optimization and recovery, p s represents the real-time point cloud data matrix collected by the i th 3D camera; the calculated environmental data change is input into the optimization and recovery formula, and the point cloud data after optimization and recovery of each 3D camera is calculated. S502, for two adjacent 3D cameras, calculating the Euclidean distance L of each point cloud coordinate between the two point cloud data matrices after optimization and restoration, setting a distance threshold Ly, judging the Euclidean distance of the point cloud coordinate by using the distance threshold, judging as the same point cloud when L≤Ly, and judging as different point cloud when L>Ly; and the region where all the same point clouds are located is defined as the overlapping region by traversal calculation. S503, for each two adjacent 3D cameras, taking the boundary of the overlapping area as the splicing boundary, splicing the point cloud data of the adjacent 3D cameras, and averaging the point cloud coordinates of the overlapping area to optimize; repeat the operation for all 3D cameras, and obtain the 3D virtual model of the real-time PCB board by using the spliced point cloud data; S600, professional personnel input the calculation function of all quality detection items, collect the real-time data of each quality detection item of the real-time PCB board by using the 3D virtual model of the real-time PCB board, design the detection standard and the quality threshold according to the professional knowledge, and judge whether the quality of the real-time PCB board is qualified or not by the quality threshold.

2. The PCB detection method based on 3D scanning according to claim 1, characterized in that: The specific steps for setting the initial position of each 3D camera in S100 by using a special calibration board are as follows: S101, place the special calibration board in the detection area, set n 3D cameras in the detection area, and there are Mark points of chromium balls on the surface of the special calibration board; extract the world coordinates of each Mark point in the world coordinate system and the pixel coordinates collected by the 3D camera; construct a 3D camera debugging model, and the formula is: ; In the formula, p k represents the pixel coordinates of the kth Mark point, P k represents the world coordinates of the kth Mark point, and π represents a camera projection function i represents the rotation matrix of the ith 3D camera, t i represents the translation vector of the ith 3D camera, and M represents the total number of Mark points in the special calibration board k belongs to 1 to M, and i belongs to 1 to n; According to the 3D camera debugging model, the rotation matrix and the translation vector of the 3D camera are extracted when the sum value is the smallest, and the initial pose of all 3D cameras is constructed as {R i , t i} n i=1 .

3. The PCB detection method based on 3D scanning according to claim 1, characterized in that: The specific steps for obtaining the detection area of each 3D camera in S200 are as follows: S201, divide the special calibration board into different block areas according to the quality detection items of the PCB board by professional personnel, extract the normal vector of each block area, the optical axis direction vector of each 3D camera, and the resolution, standardize the resolution, calculate the adaptation degree of each 3D camera and the block area, and the formula is: ; In the formula, ρ ij represents the adaptation degree of the i-th 3D camera and the j-th sub-block region, a j represents the normal vector of the j-th sub-block region, v i represents the optical axis direction vector of the i-th 3D camera, Res i represents the resolution of the i-th 3D camera, and w represents the resolution weight, which is set by a professional. S202, calculate the adaptation degree of each 3D camera and the block area, select the 3D camera corresponding to the maximum adaptation degree for each block area, and calculate the distribution after iteration, so that each 3D camera obtains the integrated block area after distribution as the detection area.

4. The PCB detection method based on 3D scanning according to claim 3, characterized in that: The specific steps for judging whether the quality of the real-time PCB board is qualified or not by the parameter threshold in S600 are as follows: S601, professional personnel input the calculation function of each PCB quality detection item to obtain a quality detection model G, which contains the calculation function of all quality detection items of the PCB board; calculate the real-time data of each quality detection item in the 3D virtual model; the quality detection items include the angle of the oblique edge of the front and back surfaces, the depth of the oblique edge of the front and back surfaces, the height of the oblique edge of the front and back surfaces, the thickness of the board, the excess thickness, the angle difference of the oblique edge, the depth difference of the oblique edge, and the height difference of the oblique edge; The calculation method of the angle of the oblique edge of the front and back surfaces is as follows: a virtual oblique plane parallel to the oblique edge is fitted in the oblique edge part of the PCB board, and a virtual horizontal plane parallel to the horizontal part is fitted in the horizontal part; the normal vectors of the two virtual planes are constructed; the included angle of the two normal vectors is calculated by using the dot product method; and the oblique edge angle = 180°-the included angle of the two normal vectors; The calculation method of the depth of the oblique edge of the front and back surfaces is as follows: project the oblique edge of the PCB board on the horizontal plane, and take the projection length on the horizontal plane as the depth of the oblique edge; The calculation method of the height of the oblique edge of the front and back surfaces is as follows: the oblique edge height = the oblique edge depth × tan (oblique edge angle); The calculation method of the thickness of the board is as follows: calculate the distance between all corresponding points with vertical mapping relationship on the front and back surfaces of the PCB board, and then calculate the average value to obtain the thickness of the board; The excess thickness calculation method is: excess thickness = plate thickness - front bevel height - back bevel height; The bevel angle difference calculation method is: bevel angle difference = front bevel angle - back bevel angle; The bevel depth difference calculation method is: bevel height difference = front bevel height - back bevel height; The bevel height difference calculation method is: bevel depth difference = front bevel depth - back bevel depth; According to the deviation of each detection item in the 3D virtual model from the calculation method of different quality detection items, the detection standard and the quality threshold value are set for each quality detection item, the deviation is judged by using the quality threshold value, when the deviation of all detection items is less than or equal to the quality threshold value, it is judged that the real-time PCB quality is qualified; when the deviation of any detection item is greater than the quality threshold value, it is judged that the real-time PCB board quality is unqualified. 5.A 3D scanning based PCB board detection system using the 3D scanning based PCB board detection method of any one of claims 1-4, characterized in that: The PCB board detection system comprises a data acquisition module, a 3D camera setting module, an environmental interference module, a pose adjustment module, a PCB board detection module and a quality judgment module; The data acquisition module is used for acquiring the point cloud data collected by the 3D camera and the corresponding environmental data in history; The 3D camera setting module is used for setting the point cloud data of the PCB board collected by the 3D camera at different angles, setting the initial pose of each 3D camera by using a special calibration board, and allocating the divided area to each 3D camera to obtain the detection area of each 3D camera; The environmental interference module is used for collecting the influence of different environmental data in history on the point cloud data for each 3D camera, and constructing an environmental interference matrix; The pose adjustment module is used for collecting the point cloud data of the PCB board in real time by using all 3D cameras, comparing the real-time PCB board position data with the detection area of each 3D camera, and dynamically adjusting the initial position of each 3D camera; The PCB board detection module is used for collecting the point cloud data of the real-time PCB board collected by all 3D cameras, introducing the environmental interference matrix to optimize and restore the point cloud data, calculating the overlapping area according to the optimized point cloud data, and then splicing the point cloud data of each 3D camera to obtain the 3D virtual model of the real-time PCB board; The quality judgment module is used for designing the detection standard and the quality threshold value according to professional knowledge, and judging whether the real-time PCB board quality is qualified or not by the quality threshold value.

6. The 3D scanning based PCB detection system of claim 5, wherein: The 3D camera setting module comprises an initial pose unit and a detection area unit; The initial pose unit is used for setting the point cloud data of the PCB board collected by the n 3D cameras at different angles, and setting the initial pose of each 3D camera by using a special calibration board; The detection area unit is used for dividing the area of the special calibration board, allocating the divided area to each 3D camera, and obtaining the detection area of each 3D camera.

7. The 3D scanning based PCB inspection system of claim 5, wherein: The PCB board detection module comprises a point cloud optimization and restoration unit and a point cloud splicing unit; The point cloud optimization and restoration unit is used for collecting the point cloud data of the real-time PCB board collected by all 3D cameras, and introducing the environmental interference matrix to optimize and restore the point cloud data; The point cloud splicing unit is used for calculating the overlapping area according to the optimized point cloud data, and then splicing the point cloud data of each 3D camera to obtain the 3D virtual model of the real-time PCB board.

Citation Information

Patent Citations

  • Fusion calibration method of three-dimensional laser radar and binocular visible light sensor

    CN110349221A

  • Optical detection equipment for a PCB (Printed Circuit Board), an operation method of the optical detection equipment and a 3D (Three-Dimensional) detection camera assembly

    CN113466248A