An optimal position calculation method for automatic detection of electronic components on PCB boards

By using the optimal point-point calculation method in PCB board detection, the most suitable point is found based on the proportional area, aggregation degree and centralization value of the components, solving the problems of poor adaptability and long acquisition time in the prior art, and achieving a more efficient detection process.

CN118470281BActive Publication Date: 2025-02-28HUAYI INTELLIGENT EQUIP (HANGZHOU) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410717896.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-04
Publication Date
2025-02-28
Estimated Expiration
2044-06-04

Smart Images

  • Figure CN118470281B_ABST
    Figure CN118470281B_ABST
Patent Text Reader

Abstract

The invention relates to the field of engineering detection, and in particular to an optimal position calculation method for automatic detection of electronic components on a PCB board; technical problem: according to the improvement of a traditional algorithm, the adaptability to a variety of different PCB boards and the flexibility of selecting a grid are poor; and the new method improved according to a clustering algorithm is likely to result in only selecting points of multiple components, which increases redundancy and camera acquisition time; technical solution: an optimal position calculation method for automatic detection of electronic components on a PCB board, including formulating a set of rules that should be satisfied by evaluating a suitable point; the invention can effectively reduce the points that need to be moved by the camera and increase the display degree of the components on the photo by setting the optimal point selection rule and performing point planning, so as to improve the accuracy and stability of the algorithm in identifying the components and the detection efficiency of the machine, and can adjust the proportion and decisive value of the rule according to the actual situation, and has high adaptability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the field of engineering detection, and in particular to an optimal position calculation method for automatic detection of electronic components on a PCB board. Background Art

[0002] With the expansion of the current market, the industry's requirements for the efficiency of the production line are gradually increasing, and how to improve the specifications to make the machine run more efficiently is becoming more and more important; when a large number of PCB boards need to be inspected, the length of time required for each board to be inspected is very important, and the total time used by the camera to move at fixed points can be significantly shortened; when planning the camera points during PCB board inspection, a point reduction algorithm based on traditional algorithms and clustering algorithms is used. According to the improvement of the traditional algorithm, only some very coincidental grids are merged, which has poor adaptability to a variety of different PCB boards and poor flexibility in selecting grids. The new method based on the clustering algorithm is likely to lead to the selection of only points of multiple components, so that more points are required to collect peripheral components, which increases redundancy and camera acquisition time. Summary of the invention

[0003] In order to overcome the problem of planning the camera points during PCB board inspection, a point reduction algorithm based on traditional algorithms and clustering algorithms is used. According to the improvement of the traditional algorithm, only some very coincidental grids are merged, which has poor adaptability to a variety of different PCB boards and poor flexibility in selecting grids. The new method based on the clustering algorithm is likely to lead to the selection of points of multiple components, so that more points are required to collect peripheral components, which increases the problem of redundancy and camera collection time.

[0004] The technical solution of the present invention is: a method for calculating the optimal position for automatic detection of electronic components on a PCB board, comprising the following steps:

[0005] S11: Formulate a set of rules that should be met to evaluate a suitable point;

[0006] S12: Randomly select points and cover the entire PCB board with as many points as possible;

[0007] S13: Refer to the rules to find the most suitable point.

[0008] Preferably, a set of optimal point selection rules is established by setting according to the analysis of components and actual needs. This rule reasonably finds the most qualified point in the PCB board according to the algorithm with the largest area occupied by components in the point, the concentration of components in the photo as the auxiliary, and the distance of components from the center point in the photo as the secondary, so as to achieve the desired effect.

[0009] As a preference, when formulating a set of rules that should be met to evaluate a suitable point, the content of the rules is determined based on the following key elements:

[0010] A11: The ratio of the total area of ​​components to the sliding window, that is, the sum of the areas of all components completely contained in this window / the area of ​​this window;

[0011] A12: The degree of clustering of components in the sliding window, that is, the average of the sum of the standard deviations of x and y of all components completely contained in the window;

[0012] A13: The center value of the component in the sliding window, that is, the coordinate points of all components completely contained in this window. Use the clustering algorithm to find the value of the highest clustering degree of these coordinate points, and then calculate the distance between this value and the center of the sliding window.

[0013] Preferably, when formulating a set of rules that should be met in evaluating a suitable point, the formulated rules include: a certain component must be completely contained by a certain window, and cannot be divided and contained by multiple windows.

[0014] As a preferred method, when finding the most suitable point by referring to the rules, the following steps are included:

[0015] S21: Calculate the center point of each sliding window according to the set sliding interval, that is, the coordinate value that the camera needs to move;

[0016] S22: Calculate the ratio of the total area of ​​components in each sliding window to the sliding window, the aggregation degree and the centralization value, and find the optimal sliding window according to the importance;

[0017] S23: Taking the center of the optimal sliding window as the center, multiple sliding windows are calculated with smaller intervals in all directions;

[0018] S24: all the sliding windows calculated in step S23 are used to find the optimal sliding window according to the method in step S22. At this time, it can be determined that this sliding window is the current optimal window, and the center point of this optimal window is recorded;

[0019] S25: according to the optimal sliding window in step S24, delete the components that are completely contained therein;

[0020] S26: Determine whether the remaining components are empty or changed; if the remaining components are empty, it means that all components will be collected, the algorithm ends and returns, and records the center points of all optimal sliding windows.

[0021] Preferably, the present invention can make the camera collect all components on the PCB board better, more optimally and faster by setting the optimal point selection rule; it has the characteristics of fewer collected points and less overall camera walking time, the largest component area in a single photo, the highest component concentration and the highest centralization in a single photo; and the optimal point selection rule is adjusted according to the needs of the actual use scenario to achieve the expected effect; the patent of the present invention is suitable for use when the camera collects multiple elements, shortening the use time of the camera.

[0022] Preferably, in step S26, if the number of remaining components is not empty, all remaining components are input as data, and the process returns to S22 to recalculate the center point of the optimal sliding window starting from step S22.

[0023] Preferably, in step S26, if the number of remaining elements is not empty, and when step S22 is looped twice or more, the number of remaining elements is the same as the number of remaining elements in the previous loop, that is, when a new optimal window cannot be generated, the algorithm ends and returns to the center point of all recorded optimal sliding windows.

[0024] Preferably, when calculating the position of components whose image area is larger than the acquisition area of ​​the camera used in automatic detection, special steps are used to process the large components separately, wherein the special steps are to process the large components after processing the small components.

[0025] Preferably, when using special steps to process large components individually, the following steps are included:

[0026] S31: After processing all small components, all optimal points are obtained;

[0027] S32: Match the large component with the point, add a line connected by points where the large component and the window where the point are located intersect, and record it;

[0028] S33: The uncovered boundary of the large component is represented by a line connected by points, recorded, and merged with the points obtained in step S32;

[0029] S34: Cover all the points of all large components in a sliding window manner, and the sliding window with the most covered points is the optimal window, which is recorded, and the intersecting edges are connected into lines by points and added to the collection of points;

[0030] S35: Calculate the new point set using the method in step S34, and repeat until the point set is empty.

[0031] Preferably, after finding the most suitable point according to the reference rule, the first point selection is also included, that is, after obtaining the current optimal point, the sliding window calculation needs to be performed at a smaller interval to finally obtain the best window.

[0032] Preferably, because the first selection of points is made at a certain interval, and because the PCB board may be very large, the interval cannot be too small, otherwise it will cause too many points, resulting in low efficiency in subsequent calculations; so in order to compensate for the fact that the points generated may not be the optimal points when the interval is large, after obtaining the current optimal point, it is necessary to calculate the sliding window at a smaller interval, and the final window is the best.

[0033] Preferably, when selecting a point for the first time, the following steps are included:

[0034] S41: Taking the center of the optimal sliding window as the center, multiple sliding windows are calculated with smaller intervals in all directions;

[0035] S42: Find the optimal sliding window for all sliding windows calculated in step S41 according to the method in step S22. At this time, it can be determined that this sliding window is the current optimal window, and the center point of this optimal window is recorded.

[0036] Preferably, by setting the selection of the optimal point, the reselection of the point of the large component and the initial selection of the point, it is beneficial to reduce the points that the camera needs to move, increase the visibility of the component in the photo, and improve the accuracy and stability of the algorithm in identifying the component and the detection efficiency of the machine; and the proportion and decisive value of the rule can be adjusted according to the actual situation of the user, which has high adaptability.

[0037] Beneficial effects of the present invention:

[0038] 1. Compared with the prior art, when planning the camera points during PCB board inspection, a point reduction algorithm based on traditional algorithms and clustering algorithms is used. According to the improvement of the traditional algorithm, only some very coincidental grids are merged, which has poor adaptability to a variety of different PCB boards and poor flexibility in selecting grids. The new method based on the clustering algorithm is likely to lead to the selection of only points of multiple components, so that more points are required to collect peripheral components, which increases redundancy and camera acquisition time. This calculation method sets the optimal point selection rule and plans the points based on the optimal point selection rule. It can effectively reduce the points that the camera needs to move and increase the visibility of the components on the photo. It can improve the accuracy and stability of the algorithm in identifying components and the detection efficiency of the machine. It can also adjust the proportion and decisive value of the rules according to the actual situation of the user, and has high adaptability.

[0039] 2. By setting the selection of the optimal point, the reselection of the point of the large component and the first selection of the point, it is beneficial to reduce the points that the camera needs to move, increase the visibility of the component on the photo, and improve the accuracy and stability of the algorithm to identify the component and the detection efficiency of the machine; and the proportion and decisive value of the rule can be adjusted according to the actual situation of the user, which has high adaptability;

[0040] 3. By setting up a set of optimal point selection rules based on the analysis of components and actual needs, this rule uses an algorithm that takes the largest area of ​​components in the point, the concentration of components in the photo as a supplement, and the distance of components from the center point in the photo as a secondary factor to reasonably find the most suitable point in the PCB board, thereby achieving the desired effect. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] Figure 1 What is shown is a flow chart of the optimal position calculation method for automatic detection of electronic components on a PCB board of the present invention;

[0042] Figure 2 Shown is a schematic diagram of a flow chart of selecting the optimal point in the optimal point calculation method for automatic detection of electronic components on a PCB board of the present invention;

[0043] Figure 3 What is shown is a flow chart of large component point selection in the optimal point calculation method for automatic detection of electronic components on a PCB board of the present invention. DETAILED DESCRIPTION

[0044] The present invention will be further described below in conjunction with the accompanying drawings and embodiments.

[0045] See also Figure 1 The present invention provides an embodiment: a method for calculating the optimal position for automatic detection of electronic components on a PCB board, comprising the following steps:

[0046] S11: Formulate a set of rules that should be met to evaluate a suitable point;

[0047] S12: Randomly select points and cover the entire PCB board with as many points as possible;

[0048] S13: Refer to the rules to find the most suitable point.

[0049] Preferably, a set of optimal point selection rules is established by setting according to the analysis of components and actual needs. This rule reasonably finds the most qualified point in the PCB board according to the algorithm with the largest area occupied by components in the point, the concentration of components in the photo as the auxiliary, and the distance of components from the center point in the photo as the secondary, so as to achieve the desired effect.

[0050] See also Figure 2-3 In this embodiment, when formulating a set of rules that should be satisfied by evaluating a suitable point, the content of the rules is determined based on the following key elements:

[0051] A11: The ratio of the total area of ​​components to the sliding window, that is, the sum of the areas of all components completely contained in this window / the area of ​​this window;

[0052] A12: The degree of clustering of components in the sliding window, that is, the average of the sum of the standard deviations of x and y of all components completely contained in the window;

[0053] A13: The center value of the component in the sliding window, that is, the coordinate points of all components completely contained in this window. Use the clustering algorithm to find the value of the highest clustering degree of these coordinate points, and then calculate the distance between this value and the center of the sliding window.

[0054] Preferably, when formulating a set of rules that should be met in evaluating a suitable point, the formulated rules include: a certain component must be completely contained by a certain window, and cannot be divided and contained by multiple windows.

[0055] As a preferred method, when finding the most suitable point by referring to the rules, the following steps are included:

[0056] S21: Calculate the center point of each sliding window according to the set sliding interval, that is, the coordinate value that the camera needs to move;

[0057] S22: Calculate the ratio of the total area of ​​components in each sliding window to the sliding window, the aggregation degree and the centralization value, and find the optimal sliding window according to the importance;

[0058] S23: Taking the center of the optimal sliding window as the center, multiple sliding windows are calculated with smaller intervals in all directions;

[0059] S24: all the sliding windows calculated in step S23 are used to find the optimal sliding window according to the method in step S22. At this time, it can be determined that this sliding window is the current optimal window, and the center point of this optimal window is recorded;

[0060] S25: according to the optimal sliding window in step S24, delete the components that are completely contained therein;

[0061] S26: Determine whether the remaining components are empty or changed; if the remaining components are empty, it means that all components will be collected, the algorithm ends and returns, and records the center points of all optimal sliding windows.

[0062] Preferably, the present invention can make the camera collect all components on the PCB board better, more optimally and faster by setting the optimal point selection rule; it has the characteristics of fewer collected points and less overall camera walking time, the largest component area in a single photo, the highest component concentration and the highest centralization in a single photo; and the optimal point selection rule is adjusted according to the needs of the actual use scenario to achieve the expected effect; the patent of the present invention is suitable for use when the camera collects multiple elements, shortening the use time of the camera.

[0063] Preferably, in step S26, if the number of remaining components is not empty, all remaining components are input as data, and the process returns to S22 to recalculate the center point of the optimal sliding window starting from step S22.

[0064] Preferably, in step S26, if the number of remaining elements is not empty, and when step S22 is looped twice or more, the number of remaining elements is the same as the number of remaining elements in the previous loop, that is, when a new optimal window cannot be generated, the algorithm ends and returns to the center point of all recorded optimal sliding windows.

[0065] Preferably, when calculating the position of components whose image area is larger than the acquisition area of ​​the camera used in automatic detection, special steps are used to process the large components separately, wherein the special steps are to process the large components after processing the small components.

[0066] Preferably, when using special steps to process large components individually, the following steps are included:

[0067] S31: After processing all small components, all optimal points are obtained;

[0068] S32: Match the large component with the point, add a line connected by points where the large component and the window where the point are located intersect, and record it;

[0069] S33: The uncovered boundary of the large component is represented by a line connected by points, recorded, and merged with the points obtained in step S32;

[0070] S34: Cover all the points of all large components in a sliding window manner, and the sliding window with the most covered points is the optimal window, which is recorded, and the intersecting edges are connected into lines by points and added to the collection of points;

[0071] S35: Calculate the new point set using the method in step S34, and repeat until the point set is empty.

[0072] Preferably, after finding the most suitable point according to the reference rule, the first point selection is also included, that is, after obtaining the current optimal point, the sliding window calculation needs to be performed at a smaller interval to finally obtain the best window.

[0073] Preferably, because the first selection of points is made at a certain interval, and because the PCB board may be very large, the interval cannot be too small, otherwise it will cause too many points, resulting in low efficiency in subsequent calculations; so in order to compensate for the fact that the points generated may not be the optimal points when the interval is large, after obtaining the current optimal point, it is necessary to calculate the sliding window at a smaller interval, and the final window is the best.

[0074] Preferably, when selecting a point for the first time, the following steps are included:

[0075] S41: Taking the center of the optimal sliding window as the center, multiple sliding windows are calculated with smaller intervals in all directions;

[0076] S42: Find the optimal sliding window for all sliding windows calculated in step S41 according to the method in step S22. At this time, it can be determined that this sliding window is the current optimal window, and the center point of this optimal window is recorded.

[0077] Preferably, by setting the selection of the optimal point, the reselection of the point of the large component and the initial selection of the point, it is beneficial to reduce the points that the camera needs to move, increase the visibility of the component in the photo, and improve the accuracy and stability of the algorithm in identifying the component and the detection efficiency of the machine; and the proportion and decisive value of the rule can be adjusted according to the actual situation of the user, which has high adaptability.

[0078] The embodiments of the present invention are described in detail above with reference to the accompanying drawings, but the present invention is not limited to the above embodiments, and various changes can be made within the knowledge scope of those skilled in the art without departing from the spirit of the present invention.

Claims

1. A method for calculating the optimal position for automatic detection of electronic components on a PCB; characterized in that: The following steps are included: S11: Develop a set of rules that should be met to evaluate a suitable point. The content of the rules is determined based on the following key elements: A11: The ratio of the total area of ​​components to the sliding window, that is, the sum of the areas of all components completely contained in this window / the area of ​​this window; A12: The degree of clustering of components in the sliding window, that is, the average of the sum of the standard deviations of x and y of all components completely contained in the window; A13: The center value of the component in the sliding window, that is, the coordinate points of all components completely contained in this window. Use the clustering algorithm to find the value of the highest clustering degree of these coordinate points, and then calculate the distance between this value and the center of the sliding window; S12: Randomly select points and cover the entire PCB board with as many points as possible; S13: Find the most suitable point according to the rules, including the following steps: S21: Calculate the center point of each sliding window according to the set sliding interval, that is, the coordinate value that the camera needs to move; S22: Calculate the ratio of the total area of ​​components in each sliding window to the sliding window, the aggregation degree and the centralization value, and find the optimal sliding window according to the importance; S23: Taking the center of the optimal sliding window as the center, multiple sliding windows are calculated with smaller intervals in all directions; S24: all the sliding windows calculated in step S23 are used to find the optimal sliding window according to the method in step S22. At this time, it can be determined that this sliding window is the current optimal window, and the center point of this optimal window is recorded; S25: according to the optimal sliding window in step S24, delete the components that are completely contained therein; S26: Determine whether the remaining components are empty or changed; if the remaining components are empty, it means that all components will be collected, the algorithm ends and returns, and records the center points of all optimal sliding windows.

2. The optimal position calculation method for automatic detection of electronic components on a PCB according to claim 1, characterized in that: When formulating a set of rules that should be met for evaluating a suitable point, the rules include: a component must be completely contained by a window and cannot be divided and contained by multiple windows.

3. The optimal position calculation method for automatic detection of electronic components on a PCB according to claim 1, characterized in that: In step S26, if the number of remaining components is not empty, all remaining components are input as data, and the process returns to S22 to recalculate the center point of the optimal sliding window starting from step S22.

4. The method for calculating the optimal position for automatic detection of electronic components on a PCB according to claim 1, characterized in that: In step S26, if the number of remaining elements is not empty, and when step S22 is looped twice or more, the number of remaining elements is the same as the number of remaining elements in the previous loop, that is, when a new optimal window cannot be generated, the algorithm ends and returns to the center point of all recorded optimal sliding windows.

5. The optimal position calculation method for automatic detection of electronic components on a PCB according to claim 1, characterized in that: When calculating the position of a component whose image area is larger than the acquisition area of ​​the camera used in automatic detection, a special step is used to process the large component separately, wherein the special step is to process the large component after processing the small component.

6. The method for calculating the optimal position for automatic detection of electronic components on a PCB according to claim 5, characterized in that: When using special procedures to individually process large components, the following steps are included: S31: After processing all small components, all optimal points are obtained; S32: Match the large component with the point, add a line connected by points where the large component and the window where the point are located intersect, and record it; S33: The uncovered boundary of the large component is represented by a line connected by points, recorded, and merged with the points obtained in step S32; S34: Cover all the points of all large components in a sliding window manner, and the sliding window with the most covered points is the optimal window, which is recorded, and the intersecting edges are connected into lines by points and added to the collection of points; S35: Calculate the new point set using the method in step S34, and repeat until the point set is empty.

7. The method for calculating the optimal position for automatic detection of electronic components on a PCB according to claim 1, characterized in that: After finding the most suitable point according to the reference rules, it also includes the first selection of the point, that is, after obtaining the current optimal point, it is necessary to calculate the sliding window at a smaller interval to finally get the best window.

8. The method for calculating the optimal position for automatic detection of electronic components on a PCB according to claim 7, characterized in that: When selecting a point for the first time, the following steps are included: S41: Taking the center of the optimal sliding window as the center, multiple sliding windows are calculated with smaller intervals in all directions; S42: Find the optimal sliding window for all sliding windows calculated in step S41 according to the method in step S22. At this time, it can be determined that this sliding window is the current optimal window, and the center point of this optimal window is recorded.

Citation Information

Patent Citations

  • Welding point quality detection system detection window optimized layout method

    CN103383745A

  • System and method for automatic focusing based on statistic data

    CN106031155A