Disclosure of Invention
The invention aims to provide a PCB cutting typesetting method and a system, which are used for solving the technical problems in the background technology.
In order to achieve the above purpose, the present invention provides the following technical solutions:
a PCB cutting typesetting method comprises the following steps:
obtaining segmentation feature information of a PCB material plate, wherein the segmentation feature information comprises material plate image information and a plurality of preset segmentation required areas;
Acquiring the surface area and the appearance characteristic information of the material plate according to the image information of the material plate, acquiring the surface integrity and the side integrity according to the appearance characteristic information of the material plate, and acquiring the quality index of the PCB according to the surface integrity and the side integrity;
judging whether the quality index of the PCB is larger than a preset quality index of the PCB or not;
If the quality index of the PCB is not greater than the preset quality index of the PCB, judging that the PCB has defects, obtaining the defect position information of the material plate according to the appearance characteristic information of the material plate, and marking the material plate area according to the defect position information of the material plate to obtain the defect marked PCB area;
Typesetting and adapting a plurality of preset division required areas and the PCB material plate surface of the defect mark based on CAD to obtain adapting typesetting information;
and cutting and typesetting the PCB material plate according to the adaptive typesetting information.
Preferably, the step of obtaining the surface integrity and the side integrity according to the material plate appearance characteristic information and obtaining the quality index of the PCB board according to the surface integrity and the side integrity includes:
Gray processing is carried out on the material plate image information to obtain black-and-white surface image information, the black-and-white surface image information is screened to obtain black stripes, coordinates are respectively set at two ends of the black stripes to obtain first coordinates and second coordinates, the outer surface crack length of the black stripes is calculated according to the first coordinates and the second coordinates, and corresponding first weight values are obtained according to the outer surface crack length;
Transmitting a plurality of sound wave pulse signals to the black stripe based on a sound wave scanner, receiving a plurality of rebound signals returned after the sound wave pulse signals strike the black stripe, acquiring the outer surface crack depth according to the rebound signals, and acquiring a corresponding second weight value according to the outer surface crack depth;
acquiring contour information of black stripes based on Canny edge detection, acquiring a plurality of crack widths among black stripe openings according to the contour information of the black stripes, sorting the crack widths in an incremental manner to obtain a crack width sorting table, taking the last crack width in the crack width sorting table as an appearance crack width, and acquiring a corresponding third weight value according to the appearance crack width;
Acquiring a preset crack length judgment threshold according to the outer surface crack length;
Acquiring a preset crack depth judgment threshold according to the outer surface crack depth;
acquiring a preset crack width judgment threshold according to the apparent crack width;
calculating the surface integrity according to the outer surface crack length, the outer surface crack depth, the outer surface crack width, the preset crack length judgment threshold, the preset crack depth judgment threshold, the preset crack width judgment threshold, the first weight value, the second weight value and the third weight value, wherein the calculation formula is as follows:
Wherein B (M) represents surface integrity, H (c) represents surface crack length, H(s) represents surface crack depth, H (k) represents surface crack width, Y (c) represents a preset crack length judgment threshold, Y(s) represents a preset crack depth judgment threshold, Y (k) represents a preset crack width judgment threshold, d (Y) represents a first weight value, d (e) represents a second weight value, and d(s) represents a third weight value;
Acquiring first dark stripes and side flatness of the side face of the PCB according to the black-and-white surface image information, acquiring splitting width of the side stripes according to the first dark stripes, and acquiring side integrity according to the splitting width of the side stripes and the side flatness, wherein the side integrity is calculated in the same way as the surface integrity;
Acquiring a corresponding surface integrity weight value according to the surface integrity;
acquiring a corresponding side integrity weight value according to the side integrity;
And calculating the quality index of the PCB according to the surface integrity and the side integrity, wherein the calculation formula is as follows:
s(c)=[B(M)*a+C(D)*b]*100%;
Wherein s (C) represents a PCB board quality index, B (M) represents surface integrity, a represents a surface integrity weight value, C (D) represents side integrity, and B represents a side integrity weight value.
Preferably, the step of obtaining the material plate defect position information according to the material plate appearance characteristic information includes:
Acquiring a plurality of corresponding first edge fixed point coordinates according to the material plate area, and selecting one as a first origin coordinate according to the plurality of first edge fixed point coordinates;
acquiring a corresponding first center point according to the black stripes, and acquiring a first coordinate of the first center point according to the first origin coordinate and the first center point;
acquiring a plurality of corresponding second corner fixed point coordinates according to the side surface area, and selecting one as a second origin coordinate according to the second corner fixed point coordinates;
Acquiring a corresponding second center point according to the first dark stripe, and acquiring a second coordinate of the second center point according to a second origin coordinate and the second center point;
And taking the position information corresponding to the first coordinate and the second coordinate as the position information of the material plate defect.
Preferably, the step of marking the area of the PCB according to the position information of the defect of the PCB to obtain the area of the PCB with the defect mark comprises the following steps:
Obtaining the corresponding depth of the dark stripe according to the first dark stripe, and obtaining the area of the PCB with the side defect according to the depth of the dark stripe and the cracking width of the side stripe;
acquiring the surface defect PCB material plate area according to the second origin coordinates and the outer surface crack length, wherein the second origin coordinates are used as circle centers, and the outer surface crack length is used as a diameter;
And marking the side defect PCB material plate area and the surface defect PCB material plate area respectively to obtain the side defect marking PCB material plate area and the surface defect marking PCB material plate area, and taking the side defect marking PCB material plate area and the surface defect marking PCB material plate area as the defect marking PCB material plate area.
Preferably, the step of typesetting and adapting the preset division requirement areas and the area of the PCB material plate with the defect mark based on CAD to obtain the adapted typesetting information includes:
Acquiring the actual use area of the PCB according to the defect marked PCB;
Randomly arranging the preset partition required area as particles on an actual use area based on particle swarm optimization to obtain a plurality of typesetting layouts, wherein each particle represents one type of typesetting layout of the PCB;
Obtaining corresponding layout characteristic parameters according to a plurality of typesetting layouts, wherein the layout characteristic parameters comprise a plurality of cutting paths, a plurality of typesetting area utilization rates, a plurality of segmentation safety distances and a plurality of preset segmentation requirement area typesetting quantities, and sequentially calculating a plurality of fitness comprehensive values according to the plurality of cutting paths, the plurality of typesetting area utilization rates, the plurality of segmentation safety distances and the plurality of preset segmentation requirement area typesetting quantities, wherein a calculation formula is as follows:
S(i...n)=[L(J)i*Ci+X(L)i*Di+J(L)i*Ei+S(L)i*Fi]i;...;
[L(J)n*Cn+X(L)n*Dn+J(L)n*En+S(L)n*Fn]n;
Wherein S (i..n) represents an i-th to n-th applicability integrated value, L (J) i represents an i-th cut path, C i represents an i-th cut path weight value, X (L) i represents an i-th layout area utilization rate, D i represents an i-th layout area utilization rate weight value, J (L) i represents an i-th division safety distance, E i represents an i-th division safety distance weight value, S (L) i represents an i-th preset division required area layout number, F i represents an i-th preset division required area layout number weight value, wherein i represents a count number, i=1, 2, 3..n;
And screening the plurality of applicability comprehensive values according to the maximum value to obtain a first screening applicability comprehensive value, taking the typesetting layout corresponding to the first screening applicability comprehensive value as an optimal typesetting scheme, and performing typesetting adaptation on the PCB based on CAD according to the typesetting layout corresponding to the first screening applicability comprehensive value to obtain adaptive typesetting information.
Preferably, the step of performing cutting typesetting processing on the PCB material board according to the adaptive typesetting information includes:
acquiring a plurality of corresponding first preset division requirement areas according to the adaptive typesetting information;
And acquiring corresponding first cutting paths according to the adaptive typesetting information, and cutting and typesetting the plurality of first preset cutting required areas on the PCB according to the first cutting paths.
The application also provides a PCB cutting typesetting system, which comprises:
The PCB material plate segmentation device comprises a first acquisition module, a second acquisition module and a segmentation module, wherein the first acquisition module is used for acquiring segmentation characteristic information of a PCB material plate, and the segmentation characteristic information comprises material plate image information and a plurality of preset segmentation required areas;
The second acquisition module is used for acquiring the surface area and the appearance characteristic information of the material plate according to the image information of the material plate, acquiring the surface integrity and the side integrity according to the appearance characteristic information of the material plate and acquiring the quality index of the PCB according to the surface integrity and the side integrity;
the first judging module is used for judging whether the quality index of the PCB is larger than a preset quality index of the PCB;
If the quality index of the PCB is not greater than the preset quality index of the PCB, judging that the PCB has defects, obtaining the defect position information of the material plate according to the appearance characteristic information of the material plate, and marking the material plate area according to the defect position information of the material plate to obtain the defect marked PCB area;
the first typesetting module is used for typesetting and adapting a plurality of preset division required areas and the area of the PCB material plate with the defect mark based on CAD to obtain adapting typesetting information;
And the first processing module is used for cutting and typesetting the PCB material plate according to the adaptive typesetting information.
Preferably, the second acquisition module includes:
The first acquisition unit is used for carrying out gray processing on the material plate image information to obtain black-and-white surface image information, screening the black-and-white surface image information to obtain black stripes, respectively setting coordinates at two ends of the black stripes to obtain first coordinates and second coordinates, calculating the outer crack length of the black stripes according to the first coordinates and the second coordinates, and acquiring corresponding first weight values according to the outer crack length;
The second acquisition unit is used for transmitting a plurality of sound wave pulse signals to the black stripe based on the sound wave scanner, receiving a plurality of rebound signals returned after the sound wave pulse signals strike the black stripe, acquiring the outer surface crack depth according to the rebound signals, and acquiring a corresponding second weight value according to the outer surface crack depth;
A third obtaining unit, configured to obtain contour information of black stripes based on Canny edge detection, obtain a plurality of crack widths between black stripe openings according to the contour information of the black stripes, sort the plurality of crack widths in an incremental manner, obtain a crack width sorting table, use a last crack width in the crack width sorting table as an external crack width, and obtain a corresponding third weight value according to the external crack width;
A fourth obtaining unit, configured to obtain a preset fracture length judgment threshold according to the outer surface fracture length;
A fifth obtaining unit, configured to obtain a preset fracture depth judgment threshold according to the outer surface fracture depth;
a sixth obtaining unit, configured to obtain a preset crack width judgment threshold according to the apparent crack width;
The first calculating unit is configured to calculate surface integrity according to the outer surface crack length, the outer surface crack depth, the outer surface crack width, the preset crack length judgment threshold, the preset crack depth judgment threshold, the preset crack width judgment threshold, the first weight value, the second weight value and the third weight value, where the calculating formula is as follows:
Wherein B (M) represents surface integrity, H (c) represents surface crack length, H(s) represents surface crack depth, H (k) represents surface crack width, Y (c) represents a preset crack length judgment threshold, Y(s) represents a preset crack depth judgment threshold, Y (k) represents a preset crack width judgment threshold, d (Y) represents a first weight value, d (e) represents a second weight value, and d(s) represents a third weight value;
a seventh obtaining unit, configured to obtain a first dark stripe and a side flatness of a side surface of the PCB according to the black-and-white surface image information, obtain a splitting width of the side stripe according to the first dark stripe, and obtain a side integrity according to the splitting width of the side stripe and the side flatness, where a side integrity calculating manner is the same as a surface integrity calculating manner;
an eighth obtaining unit, configured to obtain a corresponding surface integrity weight value according to the surface integrity;
a ninth obtaining unit, configured to obtain a corresponding side integrity weight value according to the side integrity;
The second calculating unit is used for calculating the quality index of the PCB according to the surface integrity and the side integrity, wherein the calculating formula is as follows:
s(c)=[B(M)*a+C(D)*b]*100%;
Wherein s (C) represents a PCB board quality index, B (M) represents surface integrity, a represents a surface integrity weight value, C (D) represents side integrity, and B represents a side integrity weight value.
The application also provides a computer device comprising a memory storing a computer program and a processor implementing the steps of the above method when executing the computer program.
The application also provides a computer readable storage medium having stored thereon a computer program which when executed by a processor performs the steps of the above method.
The PCB layout method has the beneficial effects that the segmentation characteristic information of the PCB is firstly obtained, wherein the segmentation characteristic information comprises material plate image information and a plurality of preset segmentation requirement areas, then the material plate area and the material plate appearance characteristic information are obtained according to the material plate image information, so that basis can be provided for subsequent layout rearrangement after the material plate area and the material plate appearance characteristic information are obtained, meanwhile, the surface integrity and the side integrity can be obtained according to the material plate appearance characteristic information, the PCB plate quality index is obtained according to the surface integrity and the side integrity, thus the PCB plate quality index can be rapidly judged whether defects exist in the PCB plate under the action of the PCB plate quality index, and whether the PCB plate quality index is larger than the preset PCB plate quality index is judged, if the PCB plate quality index is not larger than the preset PCB plate quality index, the PCB plate defects are judged, and the material plate defect position information is obtained according to the material plate appearance characteristic information, so that the PCB plate areas are marked with defects can be obtained, the PCB can be avoided after the material plate areas with the defect marks are obtained, the PCB plate quality index is newly laid out, and meanwhile, the PCB plate quality index can be adapted to the PCB plate quality index is obtained, and the PCB layout can be further processed according to the PCB layout requirement information, and the PCB layout requirements can be further, and the PCB layout problem is greatly can be avoided.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
As shown in fig. 1-3, the present application provides a PCB cutting typesetting method applied to an earphone charging stand detection platform, including:
s1, obtaining segmentation feature information of a PCB material plate, wherein the segmentation feature information comprises material plate image information and a plurality of preset segmentation required areas;
s2, acquiring panel surface area and panel appearance characteristic information according to the panel image information, acquiring surface integrity and side integrity according to the panel appearance characteristic information, and acquiring a PCB (printed circuit board) quality index according to the surface integrity and the side integrity;
s3, judging whether the quality index of the PCB is larger than a preset quality index of the PCB or not;
If the quality index of the PCB is not greater than the preset quality index of the PCB, judging that the PCB has defects, obtaining the defect position information of the material plate according to the appearance characteristic information of the material plate, and marking the material plate area according to the defect position information of the material plate to obtain the defect marked PCB area;
S4, typesetting and adapting a plurality of preset division required areas and the PCB material plate surface of the defect mark based on CAD to obtain adapting typesetting information;
S5, cutting and typesetting processing is carried out on the PCB material plate according to the adaptive typesetting information.
As described in the above steps S1-S5, typesetting and dividing are required for the material plates in the process of processing the PCB material plates, but the existing PCB material plates are usually typeset and divided for dividing areas with uniform area specifications in the process of processing, so that when the material plates are defective, the preset dividing areas with the material plate defects are discarded, and a large amount of material plates are wasted, therefore, the invention firstly obtains the dividing characteristic information of the PCB material plates, wherein the dividing characteristic information comprises material plate image information and a plurality of preset dividing requirement areas, then obtains material plate surface area and material plate appearance characteristic information according to the material plate image information, can provide basis for subsequent typesetting after obtaining the material plate surface area and material plate appearance characteristic information, can simultaneously obtain surface integrity and side integrity according to the material plate appearance characteristic information, can rapidly judge whether the material plates have defects or not according to the surface integrity and side integrity, and judge whether the PCB material plates have defects or not, and can obtain a plurality of material plate appearance indexes according to the preset quality indexes, if the material plate surface area is not larger than the preset quality indexes, and can obtain a plurality of material plate appearance defect marks by matching the material plate according to the position of the material plate, and can obtain the material plate appearance defect area information by performing the step of typesetting after the material plate defect information, and the material plate appearance information is suitable for the material plate defect is obtained, and the material plate is obtained according to the position of the material plate defect information is printed by the material plate surface area and the material plate is printed by the material plate defect is obtained, and then cutting and typesetting the PCB according to the adaptive typesetting information, so that the PCB after typesetting can be reused, and the problem of waste of a large number of PCBs can be avoided.
In one embodiment, the step S2 of obtaining the surface integrity and the side integrity according to the material plate appearance characteristic information and obtaining the quality index of the PCB board according to the surface integrity and the side integrity includes:
S201, carrying out gray processing on the material plate image information to obtain black-and-white surface image information, screening the black-and-white surface image information to obtain black stripes, respectively setting coordinates at two ends of the black stripes to obtain first coordinates and second coordinates, calculating the outer surface crack length of the black stripes according to the first coordinates and the second coordinates, and obtaining corresponding first weight values according to the outer surface crack length;
S202, transmitting a plurality of sound wave pulse signals to a black stripe based on a sound wave scanner, receiving a plurality of rebound signals returned after the sound wave pulse signals strike the black stripe, acquiring the outer surface crack depth according to the rebound signals, and acquiring a corresponding second weight value according to the outer surface crack depth;
S203, acquiring contour information of black stripes based on Canny edge detection, acquiring a plurality of crack widths among black stripe openings according to the contour information of the black stripes, sorting the crack widths in an incremental manner to obtain a crack width sorting table, taking the last crack width in the crack width sorting table as an external crack width, and acquiring a corresponding third weight value according to the external crack width;
S204, acquiring a preset crack length judgment threshold according to the outer surface crack length;
S205, acquiring a preset crack depth judgment threshold according to the outer surface crack depth;
s206, acquiring a preset crack width judgment threshold according to the apparent crack width;
S207, calculating the surface integrity according to the outer surface crack length, the outer surface crack depth, the outer surface crack width, a preset crack length judgment threshold, a preset crack depth judgment threshold, a preset crack width judgment threshold, a first weight value, a second weight value and a third weight value, wherein the calculation formula is as follows:
Wherein B (M) represents surface integrity, H (c) represents surface crack length, H(s) represents surface crack depth, H (k) represents surface crack width, Y (c) represents a preset crack length judgment threshold, Y(s) represents a preset crack depth judgment threshold, Y (k) represents a preset crack width judgment threshold, d (Y) represents a first weight value, d (e) represents a second weight value, and d(s) represents a third weight value;
S208, acquiring first dark stripes and side flatness of the side face of the PCB according to the black-and-white surface image information, acquiring splitting widths of the side stripes according to the first dark stripes, and acquiring side integrity according to the splitting widths of the side stripes and the side flatness, wherein the side integrity is calculated in the same way as the surface integrity;
s209, acquiring a corresponding surface integrity weight value according to the surface integrity;
S2010, acquiring a corresponding side integrity weight value according to the side integrity;
s2011, calculating the quality index of the PCB according to the surface integrity and the side integrity, wherein the calculation formula is as follows:
s(c)=[B(M)*a+C(D)*b]*100%;
Wherein s (C) represents a PCB board quality index, B (M) represents surface integrity, a represents a surface integrity weight value, C (D) represents side integrity, and B represents a side integrity weight value.
As described in the above steps S201-S2011, since the defects of the PCB are usually side and surface cracks, it is necessary to find out the positions of the cracks of the PCB, and since the cracks are black or deep black in the image after gray processing, the invention firstly performs gray processing on the image information of the PCB to obtain black-and-white surface image information, and screens the black-and-white surface image information to obtain black stripes, so that the positions of the defects on the surface of the PCB can be determined by the black stripes, and since the lengths, widths and depths of the cracks all have a certain influence on the PCB, coordinates are set on both ends of the black stripes to obtain first coordinates and second coordinates, and the apparent crack lengths of the black stripes are calculated according to the first coordinates and the second coordinates, for example, one end of each crack is at coordinates (100, 200), the other end of each crack is at coordinates (300, 400), and the length unit mm can be calculated by the following formula: And obtaining a corresponding first weight value according to the outer crack length, thus being beneficial to evaluating the severity of cracks after obtaining the outer crack length, then transmitting a plurality of sound wave pulse signals to the black cracks based on a sound wave scanner, receiving a plurality of rebound signals returned after the sound wave pulse signals strike the black cracks, obtaining the outer crack depth according to the rebound signals, obtaining a corresponding second weight value according to the outer crack depth, obtaining the contour information of the black cracks based on Canny edge detection, obtaining a plurality of crack widths among the black crack openings according to the contour information of the black cracks, sorting the crack widths according to an incremental mode to obtain a crack width sorting table, taking the last crack width in the crack width sorting table as the outer crack width, the surface crack width is also an important parameter basis for judging the integrity of the PCB, a preset crack length judgment threshold value is obtained according to the surface crack length, a preset crack depth judgment threshold value is obtained according to the surface crack depth, a preset crack width judgment threshold value is obtained according to the surface crack width, and finally, the surface integrity is calculated according to the surface crack length, the surface crack depth, the surface crack width, the preset crack length judgment threshold value, the preset crack depth judgment threshold value, the preset crack width judgment threshold value, the first weight value, the second weight value and the third weight value, so that the integrity of the surface of the PCB can be judged through the surface integrity, the basis is provided for calculating the quality index of the PCB, and then the first dark color stripes and the side surface evenness of the PCB side surface are obtained according to the black-white surface image information, and obtaining a side surface stripe splitting width according to the first dark stripe, and obtaining a side surface integrity according to the side surface stripe splitting width and the side surface flatness, wherein the side surface integrity calculating mode is the same as the surface integrity calculating mode, so that the quality index of the PCB board can be obtained completely when the surface integrity and the side surface integrity are obtained, then a corresponding surface integrity weight value is obtained according to the surface integrity, then a corresponding side surface integrity weight value is obtained according to the side surface integrity, finally, the quality index of the PCB board is calculated according to the surface integrity and the side surface integrity, and thus the integrity of the PCB board can be known through the PCB board quality index, and an important basis is provided for judging the defects of the subsequent PCB board.
In one embodiment, the step S3 of obtaining the defect position information of the take-out plate according to the appearance characteristic information of the take-out plate includes:
S301, acquiring a plurality of corresponding first angular fixed point coordinates according to the material plate area, and selecting one as a first origin coordinate according to the plurality of first angular fixed point coordinates;
s302, acquiring a corresponding first center point according to the black stripe, and acquiring a first coordinate of the first center point according to a first origin coordinate and the first center point;
s303, acquiring a plurality of corresponding second corner fixed point coordinates according to the side surface area, and selecting one as a second origin coordinate according to the plurality of second corner fixed point coordinates;
Acquiring a corresponding second center point according to the first dark stripe, and acquiring a second coordinate of the second center point according to a second origin coordinate and the second center point;
S304, taking the position information corresponding to the first coordinate and the second coordinate as the position information of the material plate defect.
As described in the above steps S301-S304, after determining that the PCB panel has a defect, the defect position needs to be identified, and a basis is provided for re-cutting and typesetting of the subsequent PCB panel, so that a corresponding plurality of first corner fixed point coordinates are obtained according to the panel area, and one is selected as a first origin coordinate according to the plurality of first corner fixed point coordinates, so that a coordinate system can be established according to the first origin coordinate, so that subsequent calculation and positioning are facilitated, then a corresponding first center point is obtained according to the black stripe, and a first coordinate of the first center point is obtained according to the first origin coordinate and the first center point, then a corresponding plurality of second corner fixed point coordinates are obtained according to the side surface area, and one is selected as a second origin coordinate according to the plurality of second corner fixed point coordinates, so that a potential defect area can be deduced through the position of the black stripe, and a basis is provided for subsequent re-typesetting, and a corresponding second center point is obtained according to the first dark stripe, and a second coordinate is obtained according to the second origin coordinate (as shown in fig. 4) is obtained according to the second origin coordinate and the second center point, and the position of the second origin coordinate is obtained according to the second origin coordinate and the second center point, and the preset position of the subsequent panel is required to be cut and suitable for the subsequent layout.
In one embodiment, the step S3 of marking the area of the PCB board according to the location information of the defect of the board to obtain the area of the defect marked PCB board includes:
S301, obtaining corresponding dark stripe depth according to the first dark stripe, and obtaining the area of the PCB with the side defect according to the dark stripe depth and the side stripe splitting width;
S302, acquiring the surface defect PCB material plate area according to a second origin coordinate and an outer surface crack length, wherein the second origin coordinate is used as a circle center, and the outer surface crack length is used as a diameter;
S303, marking the area of the side defect PCB material plate and the area of the surface defect PCB material plate respectively to obtain the area of the side defect marking PCB material plate and the area of the surface defect marking PCB material plate, and taking the area of the side defect marking PCB material plate and the area of the surface defect marking PCB material plate as the area of the defect marking PCB material plate.
As described in the above steps S301-S303, since the position of the material plate defect affects the segmentation and typesetting of the PCB, the area corresponding to the position of the material plate defect needs to be marked, and then the data support is provided for the subsequent re-planning, on the basis of this, the invention obtains the corresponding depth of the dark stripe according to the first dark stripe, obtains the area of the PCB material plate with the side defect according to the depth of the dark stripe and the splitting width of the side stripe, because the surface of the PCB material plate needs to be cut when the defective part of the PCB material plate is rejected, the depth of the dark stripe represents the width in the surface, the splitting width of the side stripe represents the length in the surface (as shown in fig. 4), and the area of the PCB material plate with the side defect is the product of the depth of the dark stripe and the splitting width of the side stripe, and then obtaining the surface defect PCB material plate area according to the second origin coordinates and the outer crack length, wherein the second origin coordinates are used as the center of a circle, the outer crack length is used as the diameter (shown in figure 4), so that after the defects of the side and the surface are standardized, important basis (such as defect path avoidance) can be provided for subsequent rearrangement, then the side defect PCB material plate area and the surface defect PCB material plate area are marked respectively to obtain the side defect mark PCB material plate area and the surface defect mark PCB material plate area, the side defect mark PCB material plate area and the surface defect mark PCB material plate area are used as the defect mark PCB material plate area, after knowing the defect mark PCB material plate area, the basis can be provided for the rearrangement for scrapping of the PCB material plate due to the defects, so that a large amount of materials can be saved after the rearrangement, avoiding a great deal of waste.
In one embodiment, the step S4 of performing layout adaptation on the plurality of preset division requirement areas and the defect mark PCB panel surface based on CAD to obtain adapted layout information includes:
S401, acquiring the actual use area of the PCB according to the defect marked PCB;
s402, randomly arranging the preset partition required area as particles on an actual use area based on particle swarm optimization to obtain a plurality of typesetting layouts, wherein each particle represents one type of typesetting layout of the PCB;
S403, acquiring corresponding layout characteristic parameters according to the typesetting layout, wherein the layout characteristic parameters comprise a plurality of cutting paths, a plurality of typesetting area utilization rates, a plurality of segmentation safety distances and a plurality of preset segmentation requirement area typesetting quantities, and sequentially calculating a plurality of fitness comprehensive values according to the cutting paths, the plurality of typesetting area utilization rates, the plurality of segmentation safety distances and the plurality of preset segmentation requirement area typesetting quantities, wherein a calculation formula is as follows:
S(i...n)=[L(J)i*Ci+X(L)i*Di+J(L)i*Ei+S(L)i*Fi]i;...;
[L(J)n*Cn+X(L)n*Dn+J(L)n*En+S(L)n*Fn]n;
Wherein S (i..n) represents an i-th to n-th applicability integrated value, L (J) i represents an i-th cut path, C i represents an i-th cut path weight value, X (L) i represents an i-th layout area utilization rate, D i represents an i-th layout area utilization rate weight value, J (L) i represents an i-th division safety distance, E i represents an i-th division safety distance weight value, S (L) i represents an i-th preset division required area layout number, F i represents an i-th preset division required area layout number weight value, wherein i represents a count number, i=1, 2, 3..n;
S404, screening the plurality of applicability comprehensive values according to the maximum value to obtain a first screening applicability comprehensive value, taking the typesetting layout corresponding to the first screening applicability comprehensive value as an optimal typesetting scheme, and typesetting and adapting the PCB material taking plate based on CAD according to the typesetting layout corresponding to the first screening applicability comprehensive value to obtain adapted typesetting information.
According to the invention, as described in the steps S401-S404, the actual use area of the PCB material plate is obtained according to the area of the defect marked PCB material plate, thus, the PCB material plate can be subjected to re-typesetting segmentation according to the actual use area, then the preset segmentation requirement area is randomly arranged on the actual use area as particles based on particle swarm optimization to obtain a plurality of typesetting layouts, wherein each particle represents a PCB layout, wherein the particle swarm optimization algorithm is an optimization method for simulating social behaviors, the optimal solution of problems is found through information exchange and cooperation among particles, the simplicity and the flexibility of the optimal solution are enabled to be effective tools for solving various complex optimization problems, and as a plurality of factors are needed to be considered in the re-typesetting process, each typesetting scheme simultaneously corresponds to a group of operation data, the common operation data comprises a cutting path, a typesetting area utilization rate, a segmentation safety distance and a preset segmentation requirement area typesetting quantity, so that only the optimal solution is needed to be found in the factors, and meanwhile, the optimal solution is evaluated through an application degree comprehensive value, therefore, the preset layout parameter is obtained, the preset layout parameter comprises a plurality of the preset layout parameter, the preset layout requirement distance is calculated, the multiple segmentation area is calculated, the multiple segmentation requirement area is divided by a plurality of the preset, and the preset segmentation requirement area is calculated according to the preset, the multiple layout requirement area is divided by the preset, and the multiple layout requirement area is calculated by the multiple application requirement area is calculated by the multiple factor to be obtained by the multiple segmentation requirement. And taking the typesetting layout corresponding to the first screening suitability comprehensive value as an optimal typesetting scheme, and typesetting and adapting the PCB material plate based on CAD according to the typesetting layout corresponding to the first screening suitability comprehensive value to obtain adaptive typesetting information, so that an optimal segmentation scheme can be provided for the PCB material plate through the adaptive typesetting information.
In one embodiment, the step S5 of performing cutting and typesetting processing on the PCB material board according to the adaptive typesetting information includes:
s501, acquiring a plurality of corresponding first preset division requirement areas according to the adaptive typesetting information;
S502, acquiring corresponding first cutting paths according to the adaptive typesetting information, and cutting and typesetting the plurality of first preset cutting required areas on the PCB according to the first cutting paths.
As described in the above steps S501-S502, the present invention obtains a plurality of corresponding first preset dividing required areas according to the adaptive typesetting information, then obtains a corresponding first cutting path according to the adaptive typesetting information, and performs cutting typesetting processing on the PCB material board according to the first cutting path on the plurality of first preset dividing required areas, so that the PCB material board after being typeset again can reuse the defective PCB material board, and meanwhile, the problem of wasting a large amount of material boards can be avoided.
The application also provides a PCB cutting typesetting system, which comprises:
The PCB material plate segmentation device comprises a first acquisition module, a second acquisition module and a segmentation module, wherein the first acquisition module is used for acquiring segmentation characteristic information of a PCB material plate, and the segmentation characteristic information comprises material plate image information and a plurality of preset segmentation required areas;
The second acquisition module is used for acquiring the surface area and the appearance characteristic information of the material plate according to the image information of the material plate, acquiring the surface integrity and the side integrity according to the appearance characteristic information of the material plate and acquiring the quality index of the PCB according to the surface integrity and the side integrity;
the first judging module is used for judging whether the quality index of the PCB is larger than a preset quality index of the PCB;
If the quality index of the PCB is not greater than the preset quality index of the PCB, judging that the PCB has defects, obtaining the defect position information of the material plate according to the appearance characteristic information of the material plate, and marking the material plate area according to the defect position information of the material plate to obtain the defect marked PCB area;
the first typesetting module is used for typesetting and adapting a plurality of preset division required areas and the area of the PCB material plate with the defect mark based on CAD to obtain adapting typesetting information;
And the first processing module is used for cutting and typesetting the PCB material plate according to the adaptive typesetting information.
In one embodiment, the second acquisition module includes:
The first acquisition unit is used for carrying out gray processing on the material plate image information to obtain black-and-white surface image information, screening the black-and-white surface image information to obtain black stripes, respectively setting coordinates at two ends of the black stripes to obtain first coordinates and second coordinates, calculating the outer crack length of the black stripes according to the first coordinates and the second coordinates, and acquiring corresponding first weight values according to the outer crack length;
The second acquisition unit is used for transmitting a plurality of sound wave pulse signals to the black stripe based on the sound wave scanner, receiving a plurality of rebound signals returned after the sound wave pulse signals strike the black stripe, acquiring the outer surface crack depth according to the rebound signals, and acquiring a corresponding second weight value according to the outer surface crack depth;
A third obtaining unit, configured to obtain contour information of black stripes based on Canny edge detection, obtain a plurality of crack widths between black stripe openings according to the contour information of the black stripes, sort the plurality of crack widths in an incremental manner, obtain a crack width sorting table, use a last crack width in the crack width sorting table as an external crack width, and obtain a corresponding third weight value according to the external crack width;
A fourth obtaining unit, configured to obtain a preset fracture length judgment threshold according to the outer surface fracture length;
A fifth obtaining unit, configured to obtain a preset fracture depth judgment threshold according to the outer surface fracture depth;
a sixth obtaining unit, configured to obtain a preset crack width judgment threshold according to the apparent crack width;
The first calculating unit is configured to calculate surface integrity according to the outer surface crack length, the outer surface crack depth, the outer surface crack width, the preset crack length judgment threshold, the preset crack depth judgment threshold, the preset crack width judgment threshold, the first weight value, the second weight value and the third weight value, where the calculating formula is as follows:
Wherein B (M) represents surface integrity, H (c) represents surface crack length, H(s) represents surface crack depth, H (k) represents surface crack width, Y (c) represents a preset crack length judgment threshold, Y(s) represents a preset crack depth judgment threshold, Y (k) represents a preset crack width judgment threshold, d (Y) represents a first weight value, d (e) represents a second weight value, and d(s) represents a third weight value;
a seventh obtaining unit, configured to obtain a first dark stripe and a side flatness of a side surface of the PCB according to the black-and-white surface image information, obtain a splitting width of the side stripe according to the first dark stripe, and obtain a side integrity according to the splitting width of the side stripe and the side flatness, where a side integrity calculating manner is the same as a surface integrity calculating manner;
an eighth obtaining unit, configured to obtain a corresponding surface integrity weight value according to the surface integrity;
a ninth obtaining unit, configured to obtain a corresponding side integrity weight value according to the side integrity;
The second calculating unit is used for calculating the quality index of the PCB according to the surface integrity and the side integrity, wherein the calculating formula is as follows:
s(c)=[B(M)*a+C(D)*b]*100%;
Wherein s (C) represents a PCB board quality index, B (M) represents surface integrity, a represents a surface integrity weight value, C (D) represents side integrity, and B represents a side integrity weight value.
The present invention also provides a computer readable storage medium having stored thereon a computer program which when executed by a processor implements the steps for a PCB cutting typesetting method described above.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by hardware associated with a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium provided by the present application and used in embodiments may include non-volatile and/or volatile memory. The nonvolatile memory can include Read Only Memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual speed data rate SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (SYNCHLINK) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), among others.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, apparatus, article, or method that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, apparatus, article, or method. Without further limitation, an element defined by the phrase "comprising one does not exclude the presence of other like elements in a process, apparatus, article, or method that comprises the element.
The foregoing description is only of the preferred embodiments of the present invention and is not intended to limit the scope of the invention, and all equivalent structures or equivalent processes using the descriptions and drawings of the present invention or directly or indirectly applied to other related technical fields are included in the scope of the invention.