Hi, I’m still struggling to create new custom design rules for the PCB editor.
Here is what I would like to implement:
I would like to check the distance from plated thru holes to tracks depending on hole diameter.
If the hole diameter is <0.5mm the minimum allowed spacing is 0.2mm, for bigger holes the minimum spacing is 0.28mm.
Can someone help with this, please?
This probably can be done, but is it really needed? Is your board so dense that you can’t spare 80um for small holes?
A PCB is always a compromise between various constraints, and I always strive to use as few “special cases”. as possible.
My board is VERY dense. Yes. I need to implement this.
@paulvdh I frequently see you reply to people asking questions with a suggestion that they should not be doing the thing they are trying to do instead of answering their question. Doing this, especially when it’s the first reply a poster gets, can be discouraging. I recommend holding back such “do you really need to do the thing you’re trying to do” posts unless you are more certain that the user is in a situation where a different approach would be better (the XY problem).
@tom_iphi what have you tried so far? What you describe is pretty straightforward, but note that you’ll need to implement it as two rules with different conditions. The way the custom rule system works, you can’t write a single rule that has two different clearance values based on something. In your example, I would make one rule that has as part of its condition “hole size less than 0.5mm” and a second rule that has “hole size greater than or equal to 0.5mm”
For a start I try to flag a clearance violation if the hole diameter is >=0,4mm like this:
(rule “Cust Distance PTH to copper of different net”
(constraint hole_clearance (min 0.5mm))
(condition “(A.Hole_Size_X>=0.4mm)||(A.Hole_Size_Y>=0.4mm)”))
The syntax is ok, but it doesn’t throw any error upon DRC. I made a little test project with a 0,5mm PTH in 0,45mm distance from a track which should violate above condition.
What am I doing wrong?
That should work, unless both the track and the hole have no net assigned. Can you attach your test project?
Got it. You were testing with a via while I used a PTH. Your rule doesn’t work because vias don’t have the properties Hole_Size_X
and Hole_Size_Y
as they can only have a round hole, and their hole size property is just called Hole
.
So if you change your rule condition to (condition "A.Hole_Size_X>=0.4mm || A.Hole_Size_Y>=0.4mm || A.Hole>=0.4mm")
it works
@JeffYoung I wonder if you have thoughts about this; it seems like it wouldn’t hurt to add hidden properties to vias that respond to Hole_Size_X
and Hole_Size_Y
just so that people don’t have to write longer (and un-intuitive) rules
Indeed, it does, many thanks for setting me on the right track!