This non-provisional application claims priority under 35 U.S.C. § 119(a) on Patent Application No(s). 202010541059.7 filed in China on Jun. 15, 2020, the entire contents of which are hereby incorporated by reference.
This disclosure relates to a printed circuit board (PCB), and more particularly to an arrangement method of PCB in component-level and board-level.
In the printed circuit board (PCB) manufacturing industry, independent PCB components are grouped into a single-PCB, and then such PCBs are grouped again into a larger multiple-PCB. Minimizing the resulting average PCB area is critical to the manufacturing costs.
However, minimizing the PCB area requires a large amount of human efforts. The tester first tries different combinations of PCB layouts, exports the PCB board layout results, and then verify whether the results are smaller. The above flow will take a lot of time and labor costs.
Accordingly, this disclosure provides a method for generating packing solution of PCB to solve the above problems.
According to an embodiment of the present disclosure, a method for generating packing solution of printed circuit board (PCB) comprising: obtaining a plurality of component files, a first constraint, and a second constraint, wherein each of the component files corresponds to an electrical component, the first constraint corresponds to a single-PCB, and the second constraint corresponds to a multiple-PCB; performing a genetic algorithm according to the plurality of component files and the first constraint to generate a plurality of single-PCB feasible solutions, wherein each of the plurality of single-PCB feasible solutions has a shape description; performing a concave hull algorithm according to each of the plurality of single-PCB feasible solutions to update the shape description; and after performing the concave hull algorithm according to each of the plurality of single-PCB feasible solutions to update the shape description, performing the genetic algorithm according to the plurality of single-PCB feasible solutions and the second constraint to generate a multiple-PCB packing solution.
In sum, the method for generating packing solution of PCB can deal with the combination with arbitrary component shapes, with physical limitations imposed by board-level, copper wire etc. The present disclosure may pack components into a PCB and make the PCB area as small as possible or the PCB area utilization rate as large as possible. The present disclosure uses a bottom-up approach together with the genetic algorithm based optimization to reduce the workloads and time required to generate good PCB packing results. The present disclosure not only reduces the search space of feasible solutions, but also greatly minimizes the computation time. Therefore, the present disclosure can achieve a near-optimal solution in a short amount of time.
The present disclosure will become more fully understood from the detailed description given hereinbelow and the accompanying drawings which are given by way of illustration only and thus are not limitative of the present disclosure and wherein:
In the following detailed description, for purposes of explanation, numerous specific details are set forth in order to provide a thorough understanding of the disclosed embodiments. It will be apparent, however, that one or more embodiments may be practiced without these specific details. In other instances, well-known structures and devices are schematically shown in order to simplify the drawings.
The method for generating packing solution of printed circuit (PCB) board proposed by the present disclosure is configured to pack a plurality of electrical components into one or more single-PCBs, and then pack said one or more single-PCBs into a multiple-PCB. The electrical component may be non-convex and contain holes. The electrical component can be rotated in a finite set of orientations, e.g. every 90 degrees.
Please refer to
Step S1 shows “obtaining component files, a first constraint, and a second constraint”. Each of the component files corresponds to an electrical component (hereinafter referred to as “component”). The present disclosure determines a set of components that will be assembled by obtaining component files.
The first constraint corresponds to a single-PCB, and the second constraint corresponds to a multiple-PCB. For example, the first constraint comprises a maximal dimension of the single-PCB. If the specification of the single-PCB is rectangular, the maximal dimension comprises a length and a width of the single-PCB. The second constraint comprises a maximal number of single-PCBs that can be disposed on one multiple-PCB, this number is also called “panelization number”. The second constraint further comprises a minimal side length of the multiple-PCB. It should be noticed that contents of the first and second constraints are not limited to the above examples. For another example, a break-away size or a number of tooling holes may be set in the first and second constraints respectively.
Please refer to
S11 shows “obtaining a boundary data and a constraint data”. For example, the boundary data and the constraint data are stored in a drawing exchange format (DXF) file. The DXF file records the appearance information (i.e., boundary data) and assembly constraints (i.e., constraint data) of a component.
S13 shows “updating the boundary data as the component file according to the constraint data”. Please refer to
Therefore, step S13 performs a preprocessing task according to the DXF files obtained in step S11. Specifically, after extracting the original boundary data from the DXF file, step S13 converts the boundary data into a scalable vector graphics (SVG) file by a dxf2svg program, reads the boundary data of the document object model (DOM) in the SVG file by Javascript, and generates the layout boundary as the component file according to the constraint associated with the component size. The layout boundary is an updated boundary data according to the constraint of the component. As shown in
Please refer to
In the process of performing the genetic algorithm, each component is assembled in order according to its encoded value to generate a single-PCB preliminary solution, and a fitness function is used to calculate the parameters of each child (single-PCB preliminary solution). The better child is selected as the single-PCB feasible solution according to the calculation results and default thresholds of these parameters, and the next iteration is performed to generate a new assembly order or a new assembly rule. The genetic algorithm adjusts the conditions of component assembly, such as the assembly order or the rotation angle placed on the substrate at each iteration. Regarding the termination condition of the genetic algorithm, for example, the number of iterations reaches a specified value, or the fitness value outputted by the fitness function is convergent or reaches a specified threshold. The dimension (estimation parameter) of the fitness function comprises: the minimum space of components; the curve tolerance, i.e., the maximum error allowed for linear approximations of Bezier paths and arcs, in SVG units or “pixels”, and this value will be decreased if curved parts appear to slightly overlap; and component rotation, i.e., the possible number of rotations to evaluate for each component, e.g., 4 for only the cardinal directions, wherein the larger value of the component rotation may improve results, but will be slower to converge.
Please refer to
Please refer to
S31 shows “performing a NFP algorithm according to the component files to generate a first shape”. For example, this step selects two component files corresponding to two components, and performs NFP (no-fit polygon) algorithm to generate a first shape according to two layout boundaries described in these two component files. The first shape is a non-overlapping possible assembled shape containing these two components. Specifically, given two polygons A and B and their respective reference vertices RA and RB, the NFP algorithm may output a polygon NFPA, B representing all possible positions for which polygon B touches but does not overlap with polygon A. In other words, the no-fit polygon NFPA, B can be found by tracing the polygon B around the boundary of the polygon A. The polygon A remains fixed at RA and the other traverses around the fixed polygon's edges with RB while ensuring that the polygons always touch but never intersect. The present disclosure does not limit the NFP algorithm configured to generate the first shape.
Step S33 shows “generating a first arrangement solution according to the first shape”. Since NFPA, B includes a plurality of arrangement candidates of components A and B, when performing the genetic algorithm, one or more of these arrangement candidates will be selected, for example, in a random manner, as the first arrangement solution. Using the NFP algorithm can quickly generate a first arrangement solution in which two components are closely connected to each other.
Step S35 shows “preserving the first arrangement solution as one of the single-PCB feasible solutions according to the first constraint”. Specifically, the genetic algorithm estimates according to a plurality of rules defined in the first constraint to preserve the qualified first arrangement solution. Every time an iteration is finished, the fitness function of the genetic algorithm will estimate whether to preserve the first arrangement solution generated this time to serve as a single-PCB feasible solution according to parameters described above. The genetic algorithm may generate a plurality of single-PCB feasible solutions according to a default number of generations.
Step S5 shows “performing a concave hull algorithm to update the single-PCB feasible solution”. When the shape of the single-PCB solution generated in step S3 is non-convex, step S5 will be performed. In an embodiment of the present disclosure, step S5 is performed selectively.
Specifically, each single-PCB feasible solution has a shape description. The step S5 performs a concave hull algorithm according to each single-PCB solution generated in step S3. The shape description records how components are assembled in the single-PCB feasible solution and a shape of the single-PCB. Please refer to
As shown in
In an embodiment, the radius parameter of the concave hull algorithm is twice the length of all short sections in the shape description. In general, any of concave hull algorithms requires one radius parameter that shall be assigned manually. The smaller the radius is, the more precise the shape of the hull is. However, a smaller radius can also erode the shape too aggressively and increase the difficulty of assembly. In order to overcome this problem, the present disclosure uses a linear approximation method to generate a representative long side L0 of the shape D1. The long side D1 is referred to as the skeleton of the shape D1. The long side will be forcibly split into a plurality of shorter sides connected to each other, as shown in short sections L1-L5 of
In an embodiment, after obtained short sections L1-L5, the present disclosure returns to step S3 to fix rules which is used by the genetic algorithm in step S3 and is configured to arrange components. For example, if the short section L1 comprises components C14-C18 (not depicted), the arrangement solution of components C14-C18 may be fixed in the iterations of step S3.
Through the correction steps described above, after the genetic algorithm of the first stage is finished, the number of single-PCB feasible solutions with a concave shell shape can be reduced. In general, convex polygons are easier to assemble than concave polygons. Therefore, the results of the concave shell algorithm in step S5 are returned to step S3 for correction, it is expected to improve the execution efficiency of the genetic algorithm of the second stage.
S7 shows “performing the genetic algorithm according to the single-PCB solution and the second constraint to generate a multiple-PCB packing solution”. After step S5, “updating each of the single-PCB feasible solutions by performing the concave hull algorithm”, step S7 performs the genetic algorithm of the second stage. The operation of step S7 is similar to that of step S3, while the difference is that the input data of step S7 is single-PCB feasible solutions and the output data of step S7 is a multiple-PCB packing solution.
Please refer to
The second constraint comprises a minimal side length of the multiple-PCB. The maximal number of single-PCBs that a multiple-PCB can accommodate is defined in the second constraint, and this maximal number is set to 4 is the example shown in
Please refer to
Please refer to
In said another embodiment, the method for generating packing solution of PCB further comprises step S8 and step S9 after step S7.
Step S8 shows “obtaining corresponding constraint data according to each of the component files of the multiple-PCB packing solution”. Specifically, in the PCB layout stage, in addition to the multiple-PCB packing solution generated in step S7, it also requires to take the constraint of each component into consideration. Therefore, when a SVG component file is outputted in step S13 and the corresponding constraint is removed from the outputted file, the deleted content will be recorded, and will be recovered into the corresponding component when step S8 is performed.
Step S9 shows “outputting a drawing exchange format file”. After the removed constraint of the component in the multiple-PCB packing solution is recovered, the DXF files will be outputted and be used in layout stage.
Please refer to
S4 shows “deleting the single-PCB feasible solution according to the third constraint”. Specifically, in order to speed up the subsequent packaging process and reduce the solution space for finding feasible solutions, the method proposed in the present disclosure can be interrupted when the genetic algorithm of the first stage is finished, loads the specified third constraint, and deletes one or more single-PCB feasible solutions which do not follow the rules defined in the third constraint. For example, the rule, “the number of resistors in a single-PCB should be less than 100”, may be one of the rules defined in the third constraint. Therefore, those single-PCB feasible solutions whose total resistor numbers violate the rule will be deleted. The step S4 may accelerate the speed to perform step S7. For another example, the third constraint defines the upper limit of the weight of the components on a single-PCB, and this rule can avoid the risk of excessive components falling due to the remelting of solder paste when the PCB passes through the reflow oven. The heat absorption coefficient of the element can also be defined in the third constraint. Generally speaking, the rules defined in the third constraint file are related to the parameters not associated with the shape but should be considered during actual assembly process of components.
In sum, the method for generating packing solution of PCB can deal with the combination with arbitrary component shapes, with physical limitations imposed by board-level, copper wire etc. The present disclosure may pack components into the PCB and make the PCB area as small as possible or the PCB area utilization rate as large as possible. The present disclosure uses a bottom-up approach together with the genetic algorithm based optimization to reduce the workloads and time required to generate good PCB packing results. The present disclosure not only reduces the search space of feasible solutions, but also greatly minimizes the computation time. Therefore, the present disclosure can achieve a near-optimal solution in a short amount of time.
Number | Date | Country | Kind |
---|---|---|---|
202010541059.7 | Jun 2020 | CN | national |
Number | Name | Date | Kind |
---|---|---|---|
8918750 | Moffitt | Dec 2014 | B1 |
20090031273 | Tsai | Jan 2009 | A1 |