Find location of specific hole sizes in a PCB layout

I produced a drill report, and it has a lot of hole sizes that are very close due to my using a lot of the library parts. Here is the list of drill sizes on a PCB I just finish to show what I’m talking about:

T1C0.0100
T2C0.0150
T3C0.0200
T4C0.0315
T5C0.0320
T6C0.0350
T7C0.0360
T8C0.0380
T9C0.0394
T10C0.0520
T11C0.0560
T12C0.0620
T13C0.0630
T14C0.0701
T15C0.0750
T16C0.1260
T17C0.1457
T18C0.1500

I want to be able to locate, for example, all the .0315 holes and make them .032 holes to reduce the number of drill sizes. Similarly, I have both a .062 and .063 holes size, I’d like to make them all .062.

If I take this board to production, I may need to adjust hole sizes for the “standard drill sizes” supported by the PCB fabrication house.

I’ve search the forums, didn’t find anything on this…

I’d like to / is there any way to:

  1. Find and display or highlight all the holes of a given size ?
  2. Do a “bulk change” of all holes of a given size to a different size ?

TIA for any help.

1 Like

If you go to: Pcbnew / File / Fabrication Outputs / Drill (.drl) File Then at the bottom of the dialog you can generate a Map file or a Report File.

The report file is a simple text file which lists the drill sizes and number of holes for each drill:

Drill report for /home/paul/projects/kicad/mumar_base_stm32/mumar_base_stm32.kicad_pcb
Created on ma 28 dec 2020 18:41:54 CET

Copper Layer Stackup:
    =============================================================
    L1 :  F.Cu                      front
    L2 :  B.Cu                      back


Drill file 'mumar_base_stm32-PTH.drl' contains
    plated through holes:
    =============================================================
    T1  0,40mm  0,016"  (111 holes)
    T2  0,41mm  0,016"  (14 holes)
    T3  0,50mm  0,020"  (17 holes)
    T4  0,55mm  0,022"  (2 holes)
    T5  0,80mm  0,031"  (8 holes)
    T6  1,00mm  0,039"  (68 holes)
    T7  1,02mm  0,040"  (42 holes)
    T8  1,50mm  0,059"  (6 holes)
    T9  1,78mm  0,070"  (3 holes)
    T10  2,00mm  0,079"  (1 hole)
    T11  2,50mm  0,098"  (1 hole)
    T12  3,20mm  0,126"  (2 holes)
    T13  3,30mm  0,130"  (4 holes)

    Total plated holes count 279


Drill file 'mumar_base_stm32-NPTH.drl' contains
    unplated through holes:
    =============================================================

    Total unplated holes count 0

The map file is a graphical representation of which drill sizes are used in different locations, and looks like:

The above is not a way to fix anything, just a way to get some statistics.
If you have via’s with different hole sizes you want to change, then you can work with: Pcbnew / Edit / Set Track and Via Properties

If you have footprints that have many instances on the board, then you can put those into a project specific library, then edit one of those footprints in the Footprint Editor, and update the footrpints on the PCB from that modified footprint.

If a footprint has many pads, then you can select one of those pad in the Footprint Editor, and then:

  • Edit the hole size of the pad.
  • Right click on a pad and: Pads / Copy Pad Properties
  • Select all similar pads and: Pads / Paste Pad Properties

This also copies pad rotation and other properties to the other pads, so be careful with that. there is also a Push Pad Properties option. I have not experimented with that.


Everything put together, it’s quite a lot of work.
A much simpler and quicker way would be to close KiCad, open the PCB in a text editor and do some quick search and replace operations. Any Decent text editor can report how many strings have been replaced, and this should fit with the number of holes reported in the .map file. Hacking into these files with a text editor is quite error prone, so make a backup before you do this.

Search & replace works best if you replace the whole S-expression, so to re-use your example, search for: “(drill 0.315)” and replace it with: “(drill 0.32)”. If you search for just the numbers you will get a lot of false positives for coordinates.


An even simpler solution would be to just ignore it, and let your PCB manufacturer figure it out. Modern PCB drilling machines have automatic tool changers and lots of available drill sizes. Usually they also apply some rounding so holes with very small size differences just get drilled with the same drill size. If exact drill size is important, (for example for press fit connectors) then this should be communicated to the PCB manufacturer.


Some notes:

  • I do not know if it’s common for all manufacturers to round their drill sizes, nor how much rounding they think is acceptable.
  • Sometimes the drill size is specified, others interpret it as the size of the finished hole after plating. (approx 17um on both sides,)
1 Like

OK on that, I’ll try the map. Was hoping there was a “Jump to X Y” function in the PCB editor I missed…

I have a “standard set of drill sizes” I tend to use. I suspect I’ll just copy any library parts I want to use to my “big” library and edit from there.

There’s also a lot of Metric/English preferences in play here too.

On a lot of the various connectors you can see differences in hole size that seem to be a function of if the pin was square or round, particularly on the various pin headers.

As for the “Is the size the drill or final plated hole size”, that seems like a debate that can go on forever and, like many things where if there are very few choices people can argue forever (“bike shed” or Parkinson’s law of triviality). As you suggest, if the hole size is critical and a few mils are make or break, you need to have specific instructions to your board house.

Thanks again for the drill map, it should speed up the process a bit.

Pete

My PCB manufacturer by definition rounds the hole sizes to 0.05mm for small sizes (don’t remember up to what size is small) and to 0.1mm for bigger sizes. So if I specify 0.5mm holes and 20mils (=0.508mm) holes both would be the same for him.

The “drill rounding” is a familiar process. With the use of various footprints where some are mills and some are mm, it’s essential. Seems like every board has an odd part in it and you have to see if you can reduce the number of drills. Years ago, 8 drill sizes was a magic limit since the board could be drilled in one pass. I used to do most of my PCBs with AP Circuits before they went away, and that drove my drill size selection. I’ve not seen an equivalent concept in OSH park.

I’ve cleaned up the board, here is the hole size list. Going forward, I think I’ll just limit the small via sizes to 10 and 20 mills hole size.

It seems like the “.03x” sizes are always difficult. There isn’t once size in that range that works for everything. Parts that need an .032" can use a .035", but if you go up to .038" the pads get too close or the part moves around too much. So I suspect I’ll always have a .035 and .038 hole size. And then again, there are times when you can’t get around specifying an odd size (i.e. not used much) drill because the part has a snap-in piece or other physical constraints

FWIW, here is the final list of hole sizes for this board. Thanks to everyone for the advice. There will always be the “Can I automate this, or is this a spend an hour manually doing things” moments when working with PCBs.
T1C0.0100
T2C0.0150
T3C0.0200
T4C0.0350
T5C0.0380
T6C0.0520
T7C0.0620
T8C0.0700
T9C0.1500

Pete
.

I used only mils defined hole sizes while I was designing PCBs using Protel. Together with moving to KiCad I decided to use only mm holes from now on (I also replaced 0603 with 1608).

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.