PCB graphic file and drilling file alignment method and device and storage medium

By importing PCB graphics files and drilling files, a coordinate parameter list and hole bitmap are formed, and point coordinates are compared, the problem of difficult alignment between the graphics files and drilling files is solved, and a high-precision and efficient alignment process is achieved.

CN119740526AActive Publication Date: 2025-04-01JIEYI TECHNOLOGY (WUXI) CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202411930469.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-26
Publication Date
2025-04-01
Estimated Expiration
2044-12-26

AI Technical Summary

Technical Problem

During the PCB design stage, the graphics file cannot directly correspond to the drilling file. The drilling file needs to be parsed to obtain the correct proportion and unit information. Traditional methods rely on operation experience and are slow and easy to miss.

Method used

By importing the coordinate data of the PCB layer graphics files and drilling file coordinate data, all possible coordinate parameter lists are formed, and hole bitmaps are generated, and the standard coordinate parameter list is confirmed by selecting points and pad coordinate comparisons, and the alignment of the graphics files and drilling files is realized.

Benefits of technology

Improve the alignment accuracy, quickly filter out the coordinate parameter list that does not meet the requirements, ensure the accuracy of the results, and improve work efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119740526A_ABST
    Figure CN119740526A_ABST
Patent Text Reader

Abstract

The invention discloses a PCB (Printed Circuit Board) graphic file and drilling file alignment method, which comprises the following steps of: 1, importing graphic files of each layer of a PCB, selecting a top layer of a circuit layer as a reference layer, and acquiring bonding pad coordinates and the number of bonding pads in the reference layer; 2, coordinate data of the drilling file are imported, and a list of all possible coordinate parameters is formed according to the coordinate data; forming a hole position map according to each group of coordinate parameter lists; 3, at least three point positions are selected from the hole position maps, coordinates of the selected point positions are obtained and compared with all the bonding pad coordinates, when the coordinates of the selected point positions correspond to the bonding pad coordinates in the reference layer graphic file one to one, a coordinate parameter list corresponding to the group of hole position maps is determined to be standard values, and if the coordinates of the selected point positions correspond to the bonding pad coordinates in the reference layer graphic file one to one, the group of hole position maps is determined to be standard values; through the steps, on one hand, the accuracy of a final result is ensured, and on the other hand, the alignment working efficiency can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of PCB processing, and in particular to a method, a device and a storage medium for aligning a PCB graphic file and a drilling file. Background Art

[0002] PCB graphic files refer to various types of hierarchical files in the process of PCB board processing. The most common type is gerber files. There are also various graphic information on each layer of graphic files, which are used for subsequent plug-in or mounting of various components to finally obtain the finished product. The drilling file generally refers to a string file with coordinate attributes. After importing the drilling file into the drilling equipment, the drilling information is obtained to complete the drilling operation. The plug-in components need to be drilled and then the corresponding holes are used to complete the plug-in and welding. This means that the drilling position indicated by the drilling file corresponds to the pad position reserved in the graphic file.

[0003] During the PCB design stage, different designers have different habits, and there is no unified standard in the industry. This results in the inability to directly correspond to graphic files and drilling files. The drilling files need to be parsed to finally obtain the correct drilling file scale and unit information. The parsed drilling files must be imported into the system to complete the correct drilling operation.

[0004] Traditionally, drilling file parsing is done by importing the drilling file into graphics software, using coordinate files to generate a virtual component layer, and comparing the pad information of the virtual component layer with the graphics layer to determine whether they are aligned. If they are wrong, adjustments are made through rotation and translation. This verification process is slow, relies heavily on the operator's experience, and is prone to omissions. Summary of the invention

[0005] 1. Technical solution

[0006] In order to solve the above technical problems, the present invention provides a PCB graphic file and drilling file alignment method, equipment and storage medium.

[0007] The specific technical solutions are:

[0008] A method for aligning a PCB graphic file and a drilling file, comprising the following steps:

[0009] Step 1: Import the graphic files of each layer of the PCB, select the top layer of the circuit layer as the reference layer, and obtain the pad coordinates and number of pads in the reference layer;

[0010] Step 2: Import the coordinate data of the drilling file, and form a list of all possible coordinate parameters based on the coordinate data; form a hole location map based on each set of coordinate parameter lists;

[0011] Step 3: Select at least three points from the hole map, obtain the coordinates of the selected points, and compare the coordinates with the coordinates of all pads. When the coordinates of the selected points correspond to the pad coordinates in the reference layer graphic file, confirm that the coordinate parameter list corresponding to the hole map is the standard value.

[0012] Furthermore, in step 2, the step of forming a coordinate parameter list includes:

[0013] Step 21: Select the longest number of digits in the coordinate data of the drilling file as the coordinate digital length;

[0014] Step 22: When all coordinate data are the same length as the coordinate digit, zeros are not omitted. When there are different lengths of coordinate data, leading zeros and trailing zeros are omitted to make up to the coordinate digit length.

[0015] Step 23: Select the scale and unit of the adjusted coordinate data respectively. The length of the coordinate number is n. There are n-1 scales, namely (1, n-1), (2, n-2), (3, n-3)...(n-2, 2), (n-1, 1). The units are inch or mm, forming a list of 2*(n-1) groups of coordinate parameters.

[0016] Furthermore, in step three, the step of comparing the selected point position with the pad coordinates includes:

[0017] Step 31: Select the first point p from the selection center;

[0018] Step 32: Circularly select each pad coordinate, calculate the difference between the pad coordinate and the x-axis data and y-axis data of the point p coordinate, and obtain the offset value of the pad coordinate and the point p on the x-axis and y-axis;

[0019] Step 33: The offset value is added to the x-axis and y-axis data of other selected points respectively. When the coordinates of the point after calculation are the same as the coordinates of other pads, the ratio and unit are considered to be standard values, otherwise they are non-standard values.

[0020] Furthermore, the number of selected points is 5, and the specific selection steps are as follows:

[0021] Step a: delineate a rectangular frame in the hole position map, the rectangular frame being the smallest rectangle including all the hole positions in the hole position map, and the sides of the rectangle are parallel to the x-axis and the y-axis respectively;

[0022] Step b: Select the points closest to the four corners and the center of the rectangular frame respectively.

[0023] Furthermore, it also includes filtering error parameters, the specific steps are:

[0024] Step A: measuring the reference layer graphic area, where the reference layer graphic area refers to the product of the length and width of the graphic file in the reference layer;

[0025] Step B: Measure the area of ​​the rectangular frame drawn in step a, where the area of ​​the rectangular frame refers to the product of the length and the width;

[0026] Step C: When the ratio of the rectangular frame area to the number of drill holes is less than 0.001, it is confirmed that the coordinate parameter list corresponding to the group of hole location maps is a non-standard value;

[0027] Step D: When the area of ​​the rectangular frame is larger than the area of ​​the reference layer pattern, confirm that the coordinate parameter list corresponding to the hole position map is a non-standard value;

[0028] The above steps are before step 3.

[0029] Based on the same concept, the present invention also proposes an electronic device, including a memory and a processor, wherein the memory stores a program that can be run on the processor, and when the program is executed by the processor, the electronic device implements any of the methods described above.

[0030] Based on the same concept, the present invention also proposes a readable storage medium, in which a program is stored. When the program is executed, any of the above methods is implemented.

[0031] (II) Beneficial effects

[0032] Compared with the existing technology, the present invention provides a method for aligning graphic files and drilling files. By forming a list of all coordinate parameters, a corresponding hole position map is formed, points with certain identifications are formed in the hole position map, and coordinate alignment is performed with the graphic file through the points. This can improve the alignment accuracy. At the same time, by selecting valid points in the process, some coordinate parameter lists that obviously do not meet the requirements can be quickly filtered out. On the one hand, this ensures the accuracy of the final result, and on the other hand, it can also improve the efficiency of the alignment work. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0034] Figure 1 Specific implementation steps for the invention;

[0035] Figure 2 This is an example of a PCB graphic design file;

[0036] Figure 3 Specific implementation steps for step 2;

[0037] Figure 4 Specific implementation steps for step 3;

[0038] Figure 5 Example of selecting holes for a hole pattern. DETAILED DESCRIPTION

[0039] The following will be combined with the drawings in the embodiments of the invention to clearly and completely describe the technical solutions in the embodiments of the invention. The described embodiments are only part of the embodiments of the invention, not all of the embodiments. Based on the embodiments in the invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the invention.

[0040] In the related prior art, the traditional drilling file parsing work is to import the drilling file into the graphics software, use the coordinate file to generate a virtual component layer, compare the pad information of the virtual component layer and the graphics layer to determine whether they are aligned. If wrong, adjustment is completed through rotation and translation, etc. This verification process is slow, and is more dependent on the operator's experience and prone to omissions.

[0041] Embodiment 1

[0042] See also Figure 1 In order to solve the problems existing in the related prior art, the present invention provides a method for aligning a PCB graphic file and a drilling file, comprising the following steps:

[0043] Step 1: Import the graphic files of each layer of the PCB, select the top layer of the circuit layer as the reference layer, and obtain the pad coordinates and number of pads in the reference layer;

[0044] Among them, each layer of the PCB graphic file is a separate file. The graphic file contains circuit and pad information. Each layer corresponds to a file. The common graphic file is the gerber file. Each layer file corresponds to the same size import and corresponds to each other.

[0045] The pad is the basic unit of surface mount, which is used to form the pad pattern of the circuit board, that is, the combination of pads designed for special component types. The position of the plug-in component is also the position where the drilling needs to be realized, that is, the corresponding position of the pad. Figure 2 , Figure 2 It is a common PCB graphic design file, where 1 is the circuit graphic, 2 is the pad, and the outer frame represented by 3 is the graphic outer frame. The area of ​​the graphic can be calculated by obtaining the graphic outer frame.

[0046] Step 2: Import the coordinate data of the drilling file, form a list of all possible coordinate parameters based on the coordinate data, and form a hole location map based on each set of coordinate parameter lists;

[0047] The coordinate data of the drilling file refers to the specific location of each hole. In the industry, it is expressed in the form of x and y coordinates in inches or mm. Different point coordinates can be formed by selecting different scales and units. By confirming the position of each hole in the same standard coordinate, the corresponding hole position map can be obtained.

[0048] Step 3: Select at least three points from the hole map, obtain the coordinates of the selected points, and compare the coordinates with the coordinates of all pads. When the coordinates of the selected points correspond to the pad coordinates in the reference layer graphic file, confirm that the coordinate parameter list corresponding to the hole map is the standard value.

[0049] See also Figure 3 In step 2, the steps of forming a coordinate parameter list include:

[0050] Step 21: Select the longest number of digits in the coordinate data of the drilling file as the coordinate digital length;

[0051] Step 22: When all coordinate data are the same length as the coordinate digit, zeros are not omitted. When there are different lengths of coordinate data, leading zeros and trailing zeros are omitted to make up to the coordinate digit length.

[0052] Step 23: Select the scale and unit of the adjusted coordinate data. The length of the coordinate number is n. There are n-1 scales, namely (1, n-1), (2, n-2), (3, n-3)...(n-2, 2), (n-1, 1). The units are inch or mm, forming a list of 2*(n-1) sets of coordinate parameters.

[0053] Table 1 is an example of a coordinate list:

[0054] x y 0335866 0354 002648 0033491 0358463 033448

[0055] Steps 21 to 23 will be explained in detail through the above example.

[0056] The coordinate digital length referred to in step 21 refers to the maximum number of digits of the coordinates in the coordinate list. In the above example, the maximum number of digits of the three coordinates "0335866", "0033491" and "0358463" is 7, so the maximum number of digits is 7;

[0057] In step 22, if the length of the coordinate number is less than 7, leading zeros and trailing zeros are added respectively. Leading zeros refer to when the number of coordinate digits is less than the length of the coordinate number, zeros are added before the coordinate number to the length of the coordinate number. Trailing zeros refer to when the number of coordinate digits is less than the length of the coordinate number, zeros are added after the coordinate number to the length of the coordinate number. The above coordinate list is added with leading zeros and trailing zeros to obtain the following two sets of tables:

[0058] The post-zero table is:

[0059] x y 0335866 0354000 0026480 0033491 0358463 0334480

[0060] The front zero table is:

[0061] x y 0335866 0000354 0002648 0033491 0358463 0033448

[0062] At this time, the length of the number is 7, so there are 6 ratios. The ratio refers to adding a decimal point to the number to adjust the size of the coordinate number, which are (1,6), (2,5), (3,4), (4,3) (5,2), (6,1). The corresponding zero-saving table forms 6 sets of coordinate parameter lists, which are:

[0063] Zero is omitted, and the coordinate parameter list corresponding to the scale (1,6) is:

[0064] x y 0.335866 0.354000 0.026480 0.033491 0.358463 0.334480

[0065] The zero is omitted, and the coordinate parameter list corresponding to the scale (2,5) is:

[0066] x y 03.35866 03.54000 00.26480 00.33491 03.58463 03.34480

[0067] Zero is omitted, and the coordinate parameter list corresponding to the scale (3,4) is:

[0068] x y 033.5866 035.4000 002.6480 003.3491 035.8463 033.4480

[0069] Zero is omitted, and the coordinate parameter list corresponding to the scale (4,3) is:

[0070] x y 0335.866 0354.000 0026.480 0033.491 0358.463 0334.480

[0071] Zero is omitted, and the coordinate parameter list corresponding to the scale (5,2) is:

[0072] x y 03358.66 03540.00 00264.80 00334.91 03584.63 03344.80

[0073] Zero is omitted, and the coordinate parameter list corresponding to the scale (6,1) is:

[0074] x y 033586.6 035400.0 002648.0 003349.1 035846.3 033448.0

[0075] The above 6 sets of coordinate parameter lists use inch and mm as length units respectively, and 12 sets of coordinate parameter lists are obtained accordingly; if the rear zero is used, 12 sets of coordinate parameter lists are also obtained. When the coordinate data length of the original drilling file is unified, the non-zero method is used, and 12 sets of coordinate parameter lists are also obtained, that is, 2*(n-1) sets of coordinate parameter lists.

[0076] Import the coordinates in each set of coordinate parameter lists into a standard coordinate to form a hole location map, thus correspondingly forming 2*(n-1) hole location maps.

[0077] See also Figure 4 In step 3, the steps of comparing the selected point with the pad coordinates include:

[0078] Step 31: Select the first point p from the selection center;

[0079] Step 32: Circularly select a pad coordinate, calculate the difference between the pad coordinate and the x-axis data and y-axis data of the point p coordinate, and obtain the offset value of the pad coordinate and the point p on the x-axis and y-axis;

[0080] Step 33: The offset value is added to the x-axis and y-axis data of other selected points respectively. When the coordinates of the point after calculation are the same as the coordinates of other pads, the ratio and unit are considered to be standard values, otherwise they are non-standard values.

[0081] The specific step 31 refers to selecting a point p in the above-mentioned 2* (n-1) groups of coordinate parameter lists, and using the coordinates of this point to subtract the x-axis data and y-axis data from the coordinates of each pad on the reference layer in turn to obtain several groups of offset values, and adding each group of offset values ​​to the x-axis data and y-axis data of the coordinates of other selected points respectively. Only when the coordinates of all other points after the calculation have the same coordinates as a pad in the reference layer, it means that the selected point corresponds to the reference layer pad coordinates, which means that the coordinate parameter list is still a standard value, otherwise it is a non-standard value.

[0082] See also Figure 5 , Figure 5 This is an example of a hole location map. Specifically, the number of selected points is 5. The specific selection steps are as follows:

[0083] Step a: demarcate a rectangular frame in the hole position map, the rectangular frame is the smallest rectangle that includes all the hole positions in the hole position map, and the rectangular sides are parallel to the x-axis and the y-axis respectively, wherein the rectangular outer frame 4 is the smallest rectangular outer frame that includes all the hole positions;

[0084] Step b: Select the points closest to the four corners and the center of the rectangular frame. Figure 5In the figure, point 5 is the point closest to the four corners and the center of the rectangular frame.

[0085] The above five points are unique, which can effectively avoid overlapping of the points with other similar points, thereby avoiding errors that lead to erroneous results. At the same time, the more points there are, the more accurate the result of the entire operation will be, and the corresponding amount of calculation will also increase. Taking all factors into consideration, selecting five points in the above manner ensures efficiency on the one hand, while also ensuring the efficiency of the operation.

[0086] At the same time, the above steps also include filtering error parameters, the specific steps are:

[0087] Step A: measuring the reference layer graphic area, where the reference layer graphic area refers to the product of the length and width of the graphic file in the reference layer;

[0088] Step B: Measure the area of ​​the rectangular frame drawn in step a, where the area of ​​the rectangular frame refers to the product of the length and the width;

[0089] Step C: When the ratio of the rectangular frame area to the number of drill holes is less than 0.001, it is confirmed that the coordinate parameter list corresponding to the group of hole location maps is a non-standard value;

[0090] In step C, when the ratio of the rectangular box area to the number of holes drilled is less than 0.001, it means that the drilling pattern is small but the number of holes drilled is large. In the PCB field, it is impossible to achieve multiple hole overlaps in a very small position. This data is obviously not in line with common sense. Therefore, this group of coordinate parameters is obviously wrong and can be directly defined as non-standard values. This can reduce unnecessary calculations. This data often appears in situations where leading zeros are required.

[0091] Step D: When the area of ​​the rectangular frame is larger than the area of ​​the reference layer pattern, confirm that the coordinate parameter list corresponding to the hole position map is a non-standard value;

[0092] In step D, when the area of ​​the rectangular box is larger than the area of ​​the reference layer graphic, it means that the drilling position exceeds the area of ​​the reference layer graphic, because the drilling position needs to correspond to the pad information, and the pad information is selected from the reference layer graphic file, which means that the pad information must be located within the reference layer graphic area. When the area of ​​the rectangular box is larger than the area of ​​the reference layer graphic, it means that there must be a point that exceeds the reference layer graphic area. The exceeding point must be confirmed as a non-standard value through the calculation of steps 31-33. Therefore, the coordinate parameter list corresponding to the set of hole position maps can be directly confirmed as a non-standard value. This can also filter part of the data, reduce the number of calculations, and improve work efficiency.

[0093] The above steps are before step 3.

[0094] Based on the same concept, the present invention also proposes an electronic device, including a memory and a processor, wherein the memory stores a program that can be run on the processor, and when the program is executed by the processor, the electronic device implements any of the above methods.

[0095] Based on the same concept, the present invention also proposes a readable storage medium, in which a program is stored. When the program is executed, any of the above methods is implemented.

[0096] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A method for aligning a PCB graphic file and a drilling file, characterized in that: The steps include: Step 1: Import the graphic files of each layer of the PCB, select the top layer of the circuit layer as the reference layer, and obtain the pad coordinates and number of pads in the reference layer; Step 2: Import the coordinate data of the drilling file, and form a list of all possible coordinate parameters based on the coordinate data; form a hole location map based on each set of coordinate parameter lists; Step 3: Select at least three points from the hole map, obtain the coordinates of the selected points, and compare the coordinates with the coordinates of all pads. When the coordinates of the selected points correspond to the pad coordinates in the reference layer graphic file, confirm that the coordinate parameter list corresponding to the hole map is the standard value.

2. A PCB graphic file and drilling file alignment method according to claim 1, characterized in that: In step 2, the step of forming a coordinate parameter list includes: Step 21: Select the longest number of digits in the coordinate data of the drilling file as the coordinate digital length; Step 22: When all coordinate data are the same length as the coordinate digit, zeros are not omitted. When there are different lengths of coordinate data, leading zeros and trailing zeros are omitted to make up to the coordinate digit length. Step 23: Select the scale and unit of the adjusted coordinate data respectively. The length of the coordinate number is n. There are n-1 scales, namely (1, n-1), (2, n-2), (3, n-3)...(n-2, 2), (n-1, 1). The units are inch or mm, forming a list of 2*(n-1) groups of coordinate parameters.

3. A PCB graphic file and drilling file alignment method according to claim 1, characterized in that: In step 3, the step of comparing the selected point position with the pad coordinates includes: Step 31: Select the first point p from the selection center; Step 32: Circularly select each pad coordinate, calculate the difference between the pad coordinate and the x-axis data and y-axis data of the point p coordinate, and obtain the offset value of the pad coordinate and the point p on the x-axis and y-axis; Step 33: The offset value is added to the x-axis and y-axis data of other selected points respectively. When the coordinates of the point after calculation are the same as the coordinates of other pads, the ratio and unit are considered to be standard values, otherwise they are non-standard values.

4. A method for aligning a PCB graphic file and a drilling file according to claim 3, characterized in that: The number of selected points is 5, and the specific selection steps are as follows: Step a: delineate a rectangular frame in the hole position map, the rectangular frame being the smallest rectangle including all the hole positions in the hole position map, and the sides of the rectangle are parallel to the x-axis and the y-axis respectively; Step b: Select the points closest to the four corners and the center of the rectangular frame respectively.

5. A method for aligning a PCB graphic file and a drilling file according to claim 4, characterized in that: It also includes filtering error parameters. The specific steps are: Step A: measuring the reference layer graphic area, where the reference layer graphic area refers to the product of the length and width of the graphic file in the reference layer; Step B: Measure the area of ​​the rectangular frame drawn in step a, where the area of ​​the rectangular frame refers to the product of the length and the width; Step C: When the ratio of the rectangular frame area to the number of drill holes is less than 0.001, it is confirmed that the coordinate parameter list corresponding to the group of hole location maps is a non-standard value; Step D: When the area of ​​the rectangular frame is larger than the area of ​​the reference layer pattern, confirm that the coordinate parameter list corresponding to the hole position map is a non-standard value; The above steps are before step 3.

6. An electronic device, characterized in that: The electronic device comprises a memory and a processor, wherein the memory stores a program executable on the processor, and when the program is executed by the processor, the electronic device implements the method according to any one of claims 1 to 6.

7. A readable storage medium, wherein a program is stored in the readable storage medium, characterized in that: When the program is executed, the method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Method for improving programming speed and precision of soldering robot by using Gerber file

    CN102990178A

  • Method for inspecting and generating work data of PCB inspection device

    CN105844048A

  • Packaged file checking method and device, equipment and computer readable storage medium

    CN113962170A

  • Automatic alignment method for bonding pads in coordinate file and Gerber file

    CN113966084A

  • Automatic soldering machine teaching programming method based on model and numerical control drilling file

    CN114535738A