(version 1) # hbox-watchdog v4 — design rules # # Why three rules instead of one blanket minimum: # # The old file was a single unconditional (min 0.15mm). A custom rule outranks # the netclass table, and an unconditional rule matches EVERY pair on the board, # so it was silently overriding the HV24 netclass's 0.5 mm clearance everywhere. # The netclass said 0.5; DRC was only ever enforcing 0.15. # # These three are mutually exclusive on the case that matters, so they give the # same answer whether KiCad resolves by rule order or by specificity: # # 1. neither item is HV24 -> 0.15 mm (unchanged) # 2. either item is HV24 -> 0.50 mm # 3. except U2 pad-to-pad, its own land pattern -> 0.15 mm # # Rule 3 exists for exactly one pair. U2 is the MP1584EN buck (SOIC-8-EP): # pad 7 (24V, 1.95 x 0.6) to pad 9 (the 2.29 x 3.0 exposed thermal pad, GND) is # 0.355 mm, and that is the manufacturer's qualified land pattern — it is set by # the package, not by routing, so no amount of rerouting can open it. Scoping # the exception to Pad-to-Pad inside U2 keeps it from relaxing anything else: # measured on this board, U2's courtyard contains 9 pads and all 9 belong to U2, # so this condition cannot match a foreign pad. The tracks and vias that pass # through that courtyard are excluded by the A.Type/B.Type test and stay at the # full 0.5 mm. # # HV24 = /24V_IN, 24V, IGN_IN, Q10_GATE (netclass_patterns in the .kicad_pro) # # Note: raising HV24 to 0.5 mm also widens the copper pour pullback around those # nets, because a zone floods to max(its own clearance, the effective DRC # clearance) — 0.3 mm before, 0.5 mm now. Press B to refill before running DRC. (rule "Minimum clearance 1" (constraint clearance (min 0.15mm)) (condition "A.NetClass != 'HV24' && B.NetClass != 'HV24'") ) (rule "HV24 clearance" (constraint clearance (min 0.5mm)) (condition "(A.NetClass == 'HV24' || B.NetClass == 'HV24') && !(A.Type == 'Pad' && B.Type == 'Pad' && A.memberOfFootprint('U2') && B.memberOfFootprint('U2'))") ) (rule "HV24 exception: MP1584EN land pattern" (constraint clearance (min 0.15mm)) (condition "A.Type == 'Pad' && B.Type == 'Pad' && A.memberOfFootprint('U2') && B.memberOfFootprint('U2')") )