Reverted on the custom rules as they kept flagging even after excluding them with a comment
This commit is contained in:
1 parent
4e04c7a06f
commit
90c634ed93
3 files changed
+3838
-3581
No files matched your search
@@ -1,272 +0,0 @@
|
|||||||
(version 1)
|
|
||||||
# Custom Design Rules (DRC) for KiCad — JLCPCB: 4 layer, 2oz copper
|
|
||||||
#
|
|
||||||
# Matching JLCPCB capabilities: https://jlcpcb.com/capabilities/pcb-capabilities
|
|
||||||
#
|
|
||||||
# This is the '4L-2oz' variant. If your order differs, use one of
|
|
||||||
# the other variants (2L-1oz, 4L-1oz, 6L-1oz) — see the README table.
|
|
||||||
#
|
|
||||||
# GENERATED FILE — do not edit by hand.
|
|
||||||
# Edit capabilities/JLCPCB.toml and run tools/generate_dru.py instead.
|
|
||||||
#
|
|
||||||
# KiCad documentation: https://docs.kicad.org/8.0/en/pcbnew/pcbnew.html#custom-design-rules
|
|
||||||
|
|
||||||
|
|
||||||
# --- Drill/Hole Size ---
|
|
||||||
|
|
||||||
(rule "JLCPCB: Drill Hole Size"
|
|
||||||
(constraint hole_size (min 0.15mm) (max 6.3mm))
|
|
||||||
)
|
|
||||||
|
|
||||||
(rule "JLCPCB: Via Hole Size"
|
|
||||||
(condition "A.Type == 'Via'")
|
|
||||||
(constraint hole_size (min 0.15mm))
|
|
||||||
)
|
|
||||||
|
|
||||||
(rule "JLCPCB: Via Annular Ring"
|
|
||||||
(condition "A.Type == 'Via'")
|
|
||||||
(constraint annular_width (min 0.05mm))
|
|
||||||
)
|
|
||||||
|
|
||||||
# Comment out if extra cost is OK.
|
|
||||||
(rule "JLCPCB: Via diameter < 0.45mm with hole < 0.3mm adds extra cost"
|
|
||||||
(condition "(A.Type == 'Via') && (A.Hole < 0.3mm)")
|
|
||||||
(constraint via_diameter (min 0.45mm))
|
|
||||||
)
|
|
||||||
|
|
||||||
(rule "JLCPCB: PTH Hole Size"
|
|
||||||
(condition "A.Type == 'Pad' && A.Pad_Type == 'Through-hole' && A.isPlated()")
|
|
||||||
(constraint hole_size (min 0.15mm) (max 6.3mm))
|
|
||||||
)
|
|
||||||
|
|
||||||
(rule "JLCPCB: NPTH Hole Size"
|
|
||||||
(condition "A.Type == 'Pad' && A.Pad_Type == 'NPTH, mechanical' && !A.isPlated()")
|
|
||||||
(constraint hole_size (min 0.5mm))
|
|
||||||
)
|
|
||||||
|
|
||||||
(rule "JLCPCB: Castellated Hole Size"
|
|
||||||
(condition "A.Type == 'Pad' && A.Fabrication_Property == 'Castellated pad'")
|
|
||||||
(constraint hole_size (min 0.5mm))
|
|
||||||
)
|
|
||||||
|
|
||||||
(rule "JLCPCB: PTH Annular Ring"
|
|
||||||
(condition "A.Type == 'Pad' && A.Pad_Type == 'Through-hole' && A.isPlated()")
|
|
||||||
(constraint annular_width (min 0.254mm))
|
|
||||||
)
|
|
||||||
|
|
||||||
(rule "JLCPCB: NPTH Annular Ring"
|
|
||||||
(condition "A.Type == 'Pad' && A.Pad_Type == 'NPTH, mechanical' && !A.isPlated()")
|
|
||||||
(constraint annular_width (min 0.45mm))
|
|
||||||
)
|
|
||||||
|
|
||||||
# An expensive 4-Wire Kelvin Test is auto-added for holes < 0.3mm with diameter <= 0.4mm.
|
|
||||||
(rule "JLCPCB: Avoid 4-Wire Kelvin Test"
|
|
||||||
(condition "(A.Type == 'Via' && A.Hole < 0.3mm && A.Diameter <= 0.4mm) || (A.Type == 'Pad' && ((A.Hole_Size_X < 0.3mm && A.Size_X <= 0.4mm) || (A.Hole_Size_Y < 0.3mm && A.Size_Y <= 0.4mm)))")
|
|
||||||
(constraint annular_width (min 0.125mm))
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
# --- Pad Size ---
|
|
||||||
|
|
||||||
# JLCPCB's hard lower limit for an SMD pad. Their recommended
|
|
||||||
# minimum is larger; this only catches pads the fab cannot make.
|
|
||||||
(rule "JLCPCB: SMD Pad Size"
|
|
||||||
(condition "A.Type == 'Pad' && A.Pad_Type == 'SMD' && (A.Size_X < 0.125mm || A.Size_Y < 0.125mm)")
|
|
||||||
(constraint assertion "A.Size_X >= 0.125mm && A.Size_Y >= 0.125mm")
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
# --- VIA Support Rules ---
|
|
||||||
|
|
||||||
(rule "JLCPCB: Only Throughhole VIAs are supported"
|
|
||||||
(condition "A.Type == 'Via'")
|
|
||||||
(constraint assertion "!(A.isBlindBuriedVia() || A.isMicroVia())")
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
# --- Slot Width ---
|
|
||||||
|
|
||||||
(rule "JLCPCB: Plated Slot Width"
|
|
||||||
(condition "A.Type == 'Pad' && (A.Hole_Size_X != A.Hole_Size_Y) && A.isPlated()")
|
|
||||||
(constraint hole_size (min 0.35mm))
|
|
||||||
)
|
|
||||||
|
|
||||||
# JLCPCB: "The length of the slot should be at least 2 times of the width."
|
|
||||||
(rule "JLCPCB: Plated Slot Length-to-width Ratio"
|
|
||||||
(condition "(A.Type == 'Pad')")
|
|
||||||
(constraint assertion "(A.Hole_Size_X == A.Hole_Size_Y) || (A.Hole_Size_X >= (2 * A.Hole_Size_Y)) || (A.Hole_Size_Y >= (2 * A.Hole_Size_X))")
|
|
||||||
)
|
|
||||||
|
|
||||||
(rule "JLCPCB: Non-Plated Slot Width"
|
|
||||||
(condition "A.Type == 'Pad' && (A.Hole_Size_X != A.Hole_Size_Y) && !A.isPlated()")
|
|
||||||
(constraint hole_size (min 1.0mm))
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
# --- Minimum Clearance ---
|
|
||||||
|
|
||||||
(rule "JLCPCB: Via Hole to Via Hole Clearance (Different Nets)"
|
|
||||||
(condition "A.Type == 'Via' && B.Type == 'Via' && A.Net != B.Net")
|
|
||||||
(constraint hole_to_hole (min 0.2mm))
|
|
||||||
)
|
|
||||||
|
|
||||||
(rule "JLCPCB: Pad Hole to Pad Hole Clearance (Pad with Hole, Different Nets)"
|
|
||||||
(condition "A.Type == 'Pad' && (A.Pad_Type == 'Through-hole' || A.Pad_Type == 'NPTH, mechanical') && B.Type == 'Pad' && (B.Pad_Type == 'Through-hole' || B.Pad_Type == 'NPTH, mechanical') && A.Net != B.Net")
|
|
||||||
(constraint hole_to_hole (min 0.45mm))
|
|
||||||
)
|
|
||||||
|
|
||||||
# NOTE: KiCad applies the LAST matching rule, so the general "implied" rules below
|
|
||||||
# must come before the specific ones they would otherwise override.
|
|
||||||
|
|
||||||
# NOTE: This is not stated specifically, but is implied by other rules.
|
|
||||||
(rule "JLCPCB: Via/Pad to Via/Pad Clearance (Different Nets)"
|
|
||||||
(condition "(A.Type == 'Pad' || A.Type == 'Via') && (B.Type == 'Pad' || B.Type == 'Via') && A.Net != B.Net")
|
|
||||||
(constraint clearance (min 0.127mm))
|
|
||||||
)
|
|
||||||
|
|
||||||
# NOTE: This is not stated specifically, but is implied by other rules.
|
|
||||||
(rule "JLCPCB: Via/Pad Hole to Via/Pad Hole Clearance (Same Net)"
|
|
||||||
(condition "(A.Type == 'Pad' || A.Type == 'Via') && (B.Type == 'Pad' || B.Type == 'Via') && A.Net == B.Net")
|
|
||||||
(constraint hole_to_hole (min 0.254mm))
|
|
||||||
)
|
|
||||||
|
|
||||||
# NOTE: Inferred from the pad-to-pad hole figure; not documented by the fab.
|
|
||||||
# A via and a plated pad on different nets are covered by neither the
|
|
||||||
# via-to-via nor the pad-to-pad hole spacing rule; the pair involves a pad
|
|
||||||
# hole, so the pad figure applies.
|
|
||||||
(rule "JLCPCB: Via Hole to Pad Hole Clearance (Different Nets, inferred)"
|
|
||||||
(condition "((A.Type == 'Via' && B.Type == 'Pad') || (A.Type == 'Pad' && B.Type == 'Via')) && A.Net != B.Net")
|
|
||||||
(constraint hole_to_hole (min 0.45mm))
|
|
||||||
)
|
|
||||||
|
|
||||||
# Specific rule: must sit after the general clearance rule above to take effect.
|
|
||||||
(rule "JLCPCB: Pad to Pad Clearance (Pad without Hole, Different Nets)"
|
|
||||||
(condition "A.Type == 'Pad' && (A.Pad_Type != 'Through-hole' && A.Pad_Type != 'NPTH, mechanical') && B.Type == 'Pad' && (B.Pad_Type != 'Through-hole' && B.Pad_Type != 'NPTH, mechanical') && A.Net != B.Net")
|
|
||||||
(constraint clearance (min 0.15mm))
|
|
||||||
)
|
|
||||||
|
|
||||||
(rule "JLCPCB: Via to Trace"
|
|
||||||
(condition "A.Type == 'Via' && B.Type == 'Track'")
|
|
||||||
(constraint hole_clearance (min 0.2mm))
|
|
||||||
)
|
|
||||||
|
|
||||||
(rule "JLCPCB: PTH to Trace"
|
|
||||||
(condition "A.Type == 'Pad' && A.Pad_Type == 'Through-hole' && A.isPlated() && B.Type == 'Track'")
|
|
||||||
(constraint hole_clearance (min 0.28mm))
|
|
||||||
)
|
|
||||||
|
|
||||||
(rule "JLCPCB: PTH to Trace (inner layer)"
|
|
||||||
(layer inner)
|
|
||||||
(condition "A.Type == 'Pad' && A.Pad_Type == 'Through-hole' && A.isPlated() && B.Type == 'Track'")
|
|
||||||
(constraint hole_clearance (min 0.3mm))
|
|
||||||
)
|
|
||||||
|
|
||||||
(rule "JLCPCB: NPTH to Trace"
|
|
||||||
(condition "A.Type == 'Pad' && A.Pad_Type == 'NPTH, mechanical' && !A.isPlated() && B.Type == 'Track'")
|
|
||||||
(constraint hole_clearance (min 0.2mm))
|
|
||||||
)
|
|
||||||
|
|
||||||
(rule "JLCPCB: NPTH to Copper (non-Track)"
|
|
||||||
(condition "A.Type == 'Pad' && A.Pad_Type == 'NPTH, mechanical' && !A.isPlated() && B.Type != 'Track'")
|
|
||||||
(constraint hole_clearance (min 0.2mm))
|
|
||||||
)
|
|
||||||
|
|
||||||
(rule "JLCPCB: Pad to Trace"
|
|
||||||
(condition "A.Type == 'Pad' && (A.Pad_Type == 'Through-hole' || A.Pad_Type == 'NPTH, mechanical') && B.Type == 'Track' && A.Net != B.Net")
|
|
||||||
(constraint clearance (min 0.2mm))
|
|
||||||
)
|
|
||||||
|
|
||||||
# BGA fan-out clearance. Assign BGA fan-out nets to a 'BGA' net class.
|
|
||||||
(rule "JLCPCB: BGA to Trace"
|
|
||||||
(condition "A.NetClass == 'BGA' && B.Type == 'Track' && A.Net != B.Net")
|
|
||||||
(constraint clearance (min 0.1mm))
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
# --- Minimum Trace Width and Spacing ---
|
|
||||||
|
|
||||||
(rule "JLCPCB: Trace Width"
|
|
||||||
(condition "A.Type == 'Track'")
|
|
||||||
(constraint track_width (min 0.15mm))
|
|
||||||
)
|
|
||||||
|
|
||||||
(rule "JLCPCB: Trace Spacing"
|
|
||||||
(condition "A.Type == 'Track' && B.Type == 'Track'")
|
|
||||||
(constraint clearance (min 0.15mm))
|
|
||||||
)
|
|
||||||
|
|
||||||
# As of KiCad 9.0.8, this incorrectly flags any kind of connection
|
|
||||||
# between tracks (even if the track continues straight on and is just
|
|
||||||
# split into two parts with "Break Track").
|
|
||||||
# (rule "JLCPCB: Same-net Trace Spacing"
|
|
||||||
# (condition "A.Type == 'Track' && B.Type == 'Track'")
|
|
||||||
# (constraint physical_clearance (min 0.25mm))
|
|
||||||
# )
|
|
||||||
|
|
||||||
|
|
||||||
# --- Impedance-Controlled Net Classes ---
|
|
||||||
#
|
|
||||||
# WARNING: trace width/gap for a target impedance depend on YOUR stackup
|
|
||||||
# (dielectric height, Dk, copper weight). The values below are typical
|
|
||||||
# starting points for JLCPCB's default stackup — verify against
|
|
||||||
# JLCPCB's impedance calculator for your actual order. Constraints use
|
|
||||||
# (opt ...) so they guide the router without raising nuisance DRC errors;
|
|
||||||
# tighten to (min/max) once tuned. Assign nets to these classes in
|
|
||||||
# Board Setup > Net Classes.
|
|
||||||
|
|
||||||
(rule "JLCPCB: 50R Single-Ended"
|
|
||||||
(condition "A.NetClass == '50R'")
|
|
||||||
(constraint track_width (opt 0.2mm))
|
|
||||||
)
|
|
||||||
|
|
||||||
(rule "JLCPCB: 60R_Diff Differential Pair"
|
|
||||||
(condition "A.NetClass == '60R_Diff'")
|
|
||||||
(constraint track_width (opt 0.3mm))
|
|
||||||
(constraint diff_pair_gap (opt 0.15mm))
|
|
||||||
)
|
|
||||||
|
|
||||||
(rule "JLCPCB: 90R_Diff Differential Pair"
|
|
||||||
(condition "A.NetClass == '90R_Diff'")
|
|
||||||
(constraint track_width (opt 0.2mm))
|
|
||||||
(constraint diff_pair_gap (opt 0.13mm))
|
|
||||||
)
|
|
||||||
|
|
||||||
(rule "JLCPCB: 100R_Diff Differential Pair"
|
|
||||||
(condition "A.NetClass == '100R_Diff'")
|
|
||||||
(constraint track_width (opt 0.2mm))
|
|
||||||
(constraint diff_pair_gap (opt 0.2mm))
|
|
||||||
)
|
|
||||||
|
|
||||||
(rule "JLCPCB: 120R_Diff Differential Pair"
|
|
||||||
(condition "A.NetClass == '120R_Diff'")
|
|
||||||
(constraint track_width (opt 0.15mm))
|
|
||||||
(constraint diff_pair_gap (opt 0.2mm))
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
# --- Legend ---
|
|
||||||
|
|
||||||
(rule "JLCPCB: Minimum Line Width"
|
|
||||||
(layer "?.SilkS")
|
|
||||||
(condition "A.Type == 'Text' || A.Type == 'Text Box'")
|
|
||||||
(constraint text_thickness (min 0.15mm))
|
|
||||||
)
|
|
||||||
|
|
||||||
(rule "JLCPCB: Minimum Text Height"
|
|
||||||
(layer "?.SilkS")
|
|
||||||
(condition "A.Type == 'Text' || A.Type == 'Text Box'")
|
|
||||||
(constraint text_height (min 1mm))
|
|
||||||
)
|
|
||||||
|
|
||||||
(rule "JLCPCB: Pad to Silkscreen"
|
|
||||||
(condition "A.Type == 'Pad' && ((A.existsOnLayer('F.Mask') && B.Layer == 'F.SilkS') || (A.existsOnLayer('B.Mask') && B.Layer == 'B.SilkS'))")
|
|
||||||
(constraint silk_clearance (min 0.15mm))
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
# --- Board Outlines ---
|
|
||||||
|
|
||||||
(rule "JLCPCB: Trace to Board Edge"
|
|
||||||
(condition "A.Type == 'Track'")
|
|
||||||
(constraint edge_clearance (min 0.2mm))
|
|
||||||
)
|
|
||||||
+3836
-3263
File diff suppressed because it is too large.
Load diff
@@ -77,14 +77,6 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"drc_exclusions": [
|
"drc_exclusions": [
|
||||||
[
|
|
||||||
"annular_width|145670000|71280000|fd57d775-c20e-4b32-b14d-512f6314a433|00000000-0000-0000-0000-000000000000",
|
|
||||||
"This footprint is annoying. If there is any issues with JLC it WILL have to be checked over"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"annular_width|145670000|75460000|0f2a5146-32b9-46c5-a885-8409d0fccf68|00000000-0000-0000-0000-000000000000",
|
|
||||||
"Should be fine"
|
|
||||||
],
|
|
||||||
[
|
[
|
||||||
"annular_width|147100000|74960000|33486332-86f6-4d37-9ac9-3875094f1212|00000000-0000-0000-0000-000000000000",
|
"annular_width|147100000|74960000|33486332-86f6-4d37-9ac9-3875094f1212|00000000-0000-0000-0000-000000000000",
|
||||||
""
|
""
|
||||||
@@ -93,14 +85,6 @@
|
|||||||
"annular_width|152900000|74960000|97c35f53-08d6-4601-8993-0b0cdad68e12|00000000-0000-0000-0000-000000000000",
|
"annular_width|152900000|74960000|97c35f53-08d6-4601-8993-0b0cdad68e12|00000000-0000-0000-0000-000000000000",
|
||||||
"Should be fine"
|
"Should be fine"
|
||||||
],
|
],
|
||||||
[
|
|
||||||
"annular_width|154330000|71280000|180b126c-c005-4d13-888c-dbe8ae282a21|00000000-0000-0000-0000-000000000000",
|
|
||||||
""
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"annular_width|154330000|75460000|857526e2-2e35-43ce-b085-7544668d7931|00000000-0000-0000-0000-000000000000",
|
|
||||||
""
|
|
||||||
],
|
|
||||||
[
|
[
|
||||||
"clearance|147300128|75570116|64e63a3c-1c72-4c89-ab8d-1c9e0f45da65|d1493c64-c608-41a7-bcbc-344f8c1a7bf0",
|
"clearance|147300128|75570116|64e63a3c-1c72-4c89-ab8d-1c9e0f45da65|d1493c64-c608-41a7-bcbc-344f8c1a7bf0",
|
||||||
""
|
""
|
||||||
@@ -120,34 +104,6 @@
|
|||||||
[
|
[
|
||||||
"pth_inside_courtyard|145670000|71280000|fd57d775-c20e-4b32-b14d-512f6314a433|74ca5ce2-102c-4afb-9fcc-6b7b634042b0",
|
"pth_inside_courtyard|145670000|71280000|fd57d775-c20e-4b32-b14d-512f6314a433|74ca5ce2-102c-4afb-9fcc-6b7b634042b0",
|
||||||
"Do not care"
|
"Do not care"
|
||||||
],
|
|
||||||
[
|
|
||||||
"text_thickness|141300000|79250000|ff01ed84-ebe4-42b3-a63e-e6c3531bc487|00000000-0000-0000-0000-000000000000",
|
|
||||||
""
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"text_thickness|145050000|105700000|c5ca6232-3020-471d-aa81-845bb927a4fe|00000000-0000-0000-0000-000000000000",
|
|
||||||
""
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"text_thickness|149600000|113200000|fd34f47a-b955-4713-abe0-27a0b3da9532|00000000-0000-0000-0000-000000000000",
|
|
||||||
""
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"text_thickness|149600000|115150000|d241070d-1bd1-4bca-89b1-91dc6b7d3916|00000000-0000-0000-0000-000000000000",
|
|
||||||
""
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"text_thickness|152600000|82750000|1d070fc9-247f-4421-ba5b-1cec145d76e5|00000000-0000-0000-0000-000000000000",
|
|
||||||
""
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"text_thickness|152650000|88200000|cee55dea-f4b1-4810-a29f-d50226638732|00000000-0000-0000-0000-000000000000",
|
|
||||||
""
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"text_thickness|154600000|105050000|193dc776-69e7-4fae-aa54-1932d784ac2c|00000000-0000-0000-0000-000000000000",
|
|
||||||
""
|
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
"meta": {
|
"meta": {
|
||||||
@@ -201,7 +157,7 @@
|
|||||||
"starved_thermal": "error",
|
"starved_thermal": "error",
|
||||||
"text_height": "warning",
|
"text_height": "warning",
|
||||||
"text_on_edge_cuts": "error",
|
"text_on_edge_cuts": "error",
|
||||||
"text_thickness": "warning",
|
"text_thickness": "ignore",
|
||||||
"through_hole_pad_without_hole": "error",
|
"through_hole_pad_without_hole": "error",
|
||||||
"too_many_vias": "error",
|
"too_many_vias": "error",
|
||||||
"track_angle": "error",
|
"track_angle": "error",
|
||||||
@@ -596,7 +552,7 @@
|
|||||||
"classes": [
|
"classes": [
|
||||||
{
|
{
|
||||||
"bus_width": 12,
|
"bus_width": 12,
|
||||||
"clearance": 0.2,
|
"clearance": 0.15,
|
||||||
"diff_pair_gap": 0.25,
|
"diff_pair_gap": 0.25,
|
||||||
"diff_pair_via_gap": 0.25,
|
"diff_pair_via_gap": 0.25,
|
||||||
"diff_pair_width": 0.2,
|
"diff_pair_width": 0.2,
|
||||||
|
|||||||
Reference in new issue
Block a user