DRC, DFM, and Getting a Board Manufactured
DRC tells you the board matches your rules. DFM tells you whether anyone can build it. They are not the same rules.
🎯 By the end you'll understand
How to turn a fab's capability sheet into design rules that actually protect you, and why setting them to the fab's absolute minimum is the wrong move. What design-rule checking genuinely verifies and the specific classes of defect it has no model of at all — mask slivers, unfilled vias in pads, parts too close to a scored edge, and placement rotations that are correct in your tool and wrong in the assembler's. How to generate Gerber X2, drill, BOM and placement files reproducibly from the command line, what every field in a placement file means, and why the assembler's rendered preview is the last free gate before a board exists. And what five assembled boards cost against twenty-five, which is a lesson about fixed costs rather than about boards.
KEY INSIGHT"DRC clean" is a statement about you, not about the board
Zero errors, zero warnings, exclusions all reviewed. The fab rejected it in four hours for a solder-mask sliver between two pads on a part nobody had looked at since the library was copied.
A design-rule check compares your board against constraints you typed into Board Setup. If you typed generous numbers, DRC is generous. If you typed your fab's absolute floor, DRC only complains when the board is literally unbuildable. If you never enabled a check, it is not run. "DRC clean" therefore means precisely one thing: the board is consistent with the rules in this project file. It is not a claim about physics, about the factory, or about whether the thing will work.
Design for manufacture is the other half, and it runs against a different rule set that lives in someone else's building: what their drills, their etch line, their mask process, their pick-and-place and their reflow oven can actually do, at what yield, at what price tier. Some of those rules overlap with yours. Many do not, and a few of them the fab will simply apply to your data without asking — quietly changing the board you thought you designed. The job of this lesson is to move as much of that second rule set as possible into the first one, and to know exactly what remains outside it.
Three rule sets act on your board, and only one of them is yours. Your design rules decide what DRC catches. The fab's capability decides what is buildable and at what price. The assembler's conventions decide what actually gets placed on the pads — and that third one has no checker at all, only a rendered preview that you have to choose to look at.
HOW IT WORKSFrom capability sheet to Board Setup
Every fab publishes a capability page: minimum trace and space, minimum drill, minimum annular ring, minimum hole-to-hole, copper-to-edge clearance, solder-mask dam, silkscreen line width and text height, and the tiers at which each of those changes price. These are current published capabilities, not physical constants — they improve, they vary between process tiers, and they differ between fabs. Read the page the week you design and copy the numbers into the project.
For a standard four-layer process of the kind Beacon uses, JLCPCB's published capability at the time of writing sits around 0.09 mm minimum trace and space, a 0.15 mm minimum via drill, and roughly 0.13 mm minimum annular ring. Those are the numbers below which the board either cannot be built or moves into an advanced price tier.
This is the single most common misuse of a capability sheet. The fab's minimum is the edge of what their process can do, with their tolerances consuming all of it. Design at that edge and every normal variation — etch undercut, drill wander, registration between layers — eats into a margin that is already zero, so yield falls and the boards that do come back are the ones that happened to be lucky.
Set your rules above the fab's floor and let DRC defend that margin for you. Beacon's house rules are 0.15 mm trace and space against a 0.09 mm capability and a 0.25 mm drill against a 0.15 mm capability, with the tighter numbers used deliberately and only in the module's fan-out, where a documented exception is worth more than a blanket relaxation.
| Constraint | Fab capability (current, standard 4-layer) | Beacon's house rule | Why the gap |
|---|---|---|---|
| Minimum trace / space | 0.09 mm | 0.15 mm | Etch variation; a 0.09 mm trace on a 1 oz layer has no margin against undercut |
| Minimum via drill | 0.15 mm | 0.25 mm | Drill wander and aspect ratio on a 1.6 mm board; 0.15 mm used only in the module fan-out, as a documented exception |
| Annular ring | 0.13 mm | 0.15 mm | Registration tolerance between drill and copper; breakout is invisible after assembly |
| Copper to board edge | 0.2 mm | 0.5 mm | Routing tolerance; exposed copper at a cut edge is a short waiting for a screwdriver |
| Solder-mask web (dam) | ~0.2 mm | 0.2 mm, checked | Below this the fab removes the dam and merges the openings. The rule is only useful if you enter it |
| Silkscreen line / text | 0.15 mm line, 1 mm text | same, checked | Thinner is dropped by the printer; smaller is illegible under a microscope during rework |
Running DRC honestly
Two habits separate a DRC run that means something from a ritual.
- No blanket exclusions. KiCad lets you exclude individual violations, which is right and necessary — a deliberate 0.15 mm via in the module fan-out will trip a 0.25 mm house rule every time. What is not acceptable is disabling a check class or excluding a violation without a written reason. Beacon's convention is that every exclusion carries a comment naming who approved it and why, and the review in Lesson 5.9 reads the exclusion list out loud.
- Run the other checks too. The clearance run is the famous one, but "unconnected items", "check footprints against library" and the courtyard overlap check catch different families of defect. A board with three unrouted ratsnest lines is DRC-clean on clearances and unfinished.
CORE CONCEPTWhat DRC never checks
Here are the categories that live outside any rule you can type, roughly in order of how often they arrive as a surprise.
- Solder-mask slivers and webs. Between two closely spaced pads there is a strip of mask. Below the fab's minimum web width they cannot print it, so they delete it and the pads share one opening — which is a bridging risk on a fine-pitch part. KiCad 8 and 9 have a minimum solder-mask web width constraint in Board Setup; almost nobody sets it, and it defends nothing until you do.
- Vias in pads. No design-rule check has an opinion. During reflow the solder drains down the barrel and the joint above starves (Lesson 5.4). Either pay for filled-and-capped vias or keep the via out of the pad.
- Panelization and depaneling stress. A 35 × 25 mm board is assembled on a panel with rails. V-scoring gives a straight snap line and needs copper clearance from the score; tab routing with mouse-bites handles shaped outlines and leaves nubs. Either way, snapping a panel bends the board, and ceramic capacitors near a snap line crack — sometimes visibly, sometimes as an intermittent that appears weeks later.
- Fiducials and tooling. Assembly machines locate the board optically from fiducials: typically a 1 mm bare copper dot with a 2 mm mask opening, three per panel in an asymmetric arrangement so orientation is unambiguous, plus local fiducials beside fine-pitch parts. If your board goes on the assembler's panel, their rails carry the global fiducials — but check, because a board without any is a board they will quote a panel charge to fix.
- Rotation conventions. The one with no checker. Your tool's zero rotation for a package and the assembler's zero rotation for the same package are two independent conventions, and they disagree often enough that assemblers publish correction tables. This is where the canon's rotated LED comes from.
- Part availability and substitution. A DFM concern that has nothing to do with geometry. If the assembler's stock of a part runs out they may query, substitute, or leave the position unpopulated. Mark critical parts as no-substitute in the BOM and expect to be asked.
SEE ITDFM checker
Eight real issues seeded into Beacon Rev A's layout. Choose the rule set you run DRC against, decide whether you will spend three minutes on the assembler's rendered preview, and see which gates catch what. The eighth issue is the one this whole stage has been walking towards.
Run it once with the fab's minimum as your rule set. DRC goes quiet, which feels like success and is the opposite: you have set your checker to complain only when the board is unbuildable, so it stops defending the margin between "buildable" and "buildable reliably". Then run it with the house rules on but the 3D preview skipped, and watch the number that reaches the board fall to one. That last one is not a rule problem. It is the placement rotation of a four-pad LED, and the only thing standing between it and twenty-five rotated parts is a person choosing to look at a picture.
IN PRACTICEGenerating the outputs
Four artefacts leave your project and become someone else's input.
| Artefact | Format | What it carries | The usual mistake |
|---|---|---|---|
| Fabrication | Gerber X2 (or IPC-2581 / ODB++) | Copper, mask, paste, silk, board outline — plus, in X2, attributes naming each layer's function and each pad's net | Plotting plain RS-274X, so the fab's CAM has to guess which file is which layer; or omitting the Edge.Cuts layer entirely |
| Drill | Excellon | Hole positions, diameters, plated versus non-plated | A drill origin that differs from the plot origin, putting every hole in the wrong place relative to the copper |
| Assembly BOM | CSV | Designators grouped by part, value, footprint, supplier part number, do-not-populate lines | No supplier part numbers, so the assembler guesses; or a "DNP" that is a note in a comment rather than a field |
| Placement (CPL / POS) | CSV | Designator, value, package, mid X, mid Y, rotation, layer | Rotation in your tool's convention, which the assembler reads in theirs |
Generate them from the command line rather than by hand. KiCad ships kicad-cli, which makes the whole output set a reproducible artefact of a specific commit instead of a folder somebody produced on a Tuesday.
# Reproducible fabrication and assembly outputs, tagged with the commit. set -euo pipefail OUT="fab/revA-$(git rev-parse --short HEAD)" mkdir -p "$OUT" kicad-cli pcb export gerbers --output "$OUT" beacon.kicad_pcb kicad-cli pcb export drill --format excellon --output "$OUT" beacon.kicad_pcb kicad-cli pcb export pos --format csv --units mm --side both \ --output "$OUT/beacon-cpl.csv" beacon.kicad_pcb kicad-cli sch export bom --output "$OUT/beacon-bom.csv" beacon.kicad_sch # The one manual gate that no script replaces: # upload, open the assembler's rendered preview, and look at every # polarised part. Rotation is not in any file you can diff. zip -j "$OUT.zip" "$OUT"/*
Designator,Val,Package,Mid X,Mid Y,Rotation,Layer
U1,ESP32-C3-MINI-1,MINI-1,7.60mm,-8.30mm,0,top
U2,TPS62840,SOT-563,21.00mm,-16.50mm,270,top
U3,MCP73831,SOT-23-5,26.00mm,-22.00mm,180,top
U4,SHT40,DFN-4-1EP,2.50mm,-22.50mm,0,top
D1,WS2812B-2020,LED_WS2812B-2020,30.20mm,-11.40mm,90,top
J2,JST-PH-2,B2B-PH-K-S,32.00mm,-21.75mm,0,top
Six columns, five of which are geometry that any tool computes correctly. The sixth is Rotation, and it is a translation between two conventions: your footprint's orientation as drawn, and the assembler's zero-degree reference for that package. Assemblers publish correction tables for common packages precisely because the disagreement is routine. The highlighted line is Beacon's LED, and the number in it is correct in KiCad and wrong on the machine — a defect that exists only in the gap between two conventions and is visible in exactly one place: the rendered preview the order page shows before you confirm.
Low-cost fabs run an automated DFM pass and email you an engineering query for anything they cannot resolve — a hole they want to change, a mask opening they intend to merge, a part they are out of. The email usually arrives with a large "Confirm" button, and the fastest path is to press it. Read it instead. Every query is the factory telling you something specific about your board that no tool on your desk noticed, and half of them are describing a change they will otherwise make silently next time.
BEACONBeacon Rev A ordered: five boards, assembled
The Stage 5 milestone ends here: a reviewed schematic, a four-layer layout passing DRC against house rules, correct RF keep-out, a BOM and a placement file, Gerbers generated, and five assembled boards ordered. The order itself is a series of small decisions worth writing down.
| Order option | Beacon Rev A | Reason |
|---|---|---|
| Layers / thickness | 4 layers, 1.6 mm, JLC04161H-7628 | Fixed in Lesson 5.4; the stackup is named on the order so the fab builds the one the design assumed |
| Surface finish | ENIG | Flat coplanar pads for the module's castellations and the leadless parts; worth the upcharge on a 5-board run |
| Controlled impedance | No | No 50 Ω feed line, and the USB pair is electrically short (Lesson 5.4). Recorded as a refusal with the condition that reverses it |
| Via process | Through only, no filling | Blind and buried vias would move the order into HDI pricing for no HDI need |
| Quantity | 5 boards, all assembled | Two for bring-up and destructive testing, one for the jig, two spare. Enough to find defects, few enough that finding them is cheap |
| Assembly | Top side only | Every part is on the top side by design, which halves the assembly setup and removes a whole class of second-reflow problems |
What five boards cost against twenty-five
R5 caps the unit BOM at IDR 150,000 — around USD 9.5 — at 25 units excluding the enclosure. The five-board run will come in far above that, and the reason is arithmetic rather than economics.
Assume fixed costs of about USD 60 for the run — stencil, assembly setup, and per-unique-part feeder charges — plus a PCB cost and a parts cost per unit. Get real numbers from a live quote; these are placeholders chosen to show the structure.
| 5 units | 25 units | |
|---|---|---|
| Fixed cost per unit | 60 / 5 = USD 12.00 | 60 / 25 = USD 2.40 |
| Bare PCB | USD 2.00 | USD 1.50 |
| Parts | USD 6.00 | USD 5.50 |
| Per unit | USD 20.00 | USD 9.40 |
Same board, same parts, half the price — entirely because the fixed costs divide by five times as many units. Two consequences follow. First, a five-board prototype price tells you nothing about whether R5 is met; only the 25-unit quote does, which is why R5 is written at 25. Second, the number of unique parts is a real cost lever, because feeder setup is charged per line item: consolidating resistor and capacitor values across the design reduces the fixed cost that hurts most at low volume. Stage 6's cost lesson takes this from 25 to 25,000, where the curve changes shape again.
Six items, ten minutes, run immediately before the upload: DRC clean against house rules with every exclusion carrying a written reason; layer 2 viewed alone and confirmed continuous; the antenna keep-out zone present on all four layers; the Gerber set opened in an independent viewer and compared layer by layer against the layout; the BOM checked for do-not-populate lines and supplier part numbers; and the assembler's rendered preview inspected part by part for every polarised component. The Lesson 5.9 review signs the first five. The sixth is the one Rev A skips.
WEAKNESSWhere manufacturing bites
It feels rigorous and it removes your only margin. Their minimum is the edge of the process with all the tolerance already spent, so a board designed at that edge is a board whose yield depends on luck. Worse, DRC then stays silent through the entire design, which trains you to trust a checker that has been configured not to speak. Design above the floor, use the floor deliberately in the few places that need it, and record each of those places as an exclusion with a reason.
The plot dialog has a lot of checkboxes and some of them silently omit things: the board outline plotted on the wrong layer, an inner layer left unselected, negative-plane polarity, a drill origin that does not match. KiCad's own viewer is a good check and an unrelated viewer is a better one, because it exercises the files rather than the project. Five minutes, layer by layer, against the layout on the other screen. This is the cheapest gate in the whole stage and the most frequently skipped.
It is a rendering of what their machine will actually do, generated from your placement file after their rotation corrections. It is the only artefact in the entire flow that shows the intersection of your data and their conventions, it is free, and it is the last gate before a physical object exists. A rotated LED, a connector facing inwards and a diode placed backwards are all visible in it, in colour, in seconds. Rev A ships with a rotated LED on twenty-five boards because this step was skipped under schedule pressure, which is exactly when it is most needed.
KEY INSIGHTHow this connects
- Routing: Traces, Current, and Return Paths (5.6) — the net classes and widths defined there become the design rules DRC enforces here.
- Symbols, Footprints, and the Lie in Every Library (5.3) — mask dams, paste reduction and pin-1 orientation are footprint properties; this is where they meet the factory that has to build them.
- Beacon Rev A: Design Review Before Fab (5.9) — the pre-order checklist above becomes a signed review, and the item that stays unsigned becomes a defect.
- Board Bring-Up: Smoke Test to First Blink (6.1) — where five assembled boards arrive and everything decided in this stage is tested against reality.
The outputs are generated and the order is ready to place. One thing remains before money is spent: a review that makes the board defend itself.
GLOSSARYKey terms introduced
- Capability sheet
- A fab's published limits — minimum trace, space, drill, annular ring, mask web — and the price tiers at which they change. Current practice, not physics; re-read before each design.
- Solder-mask web
- The strip of mask between two adjacent pad openings. Below the fab's minimum it cannot be printed, so the openings are merged and the pads share bare copper.
- Gerber X2
- Gerber with embedded attributes identifying each file's layer function and each pad's net, so the fab's CAM interprets the data rather than inferring it from file names.
- CPL / POS file
- The placement file: designator, value, package, centroid coordinates, rotation and side for every placed part. The rotation column is the field with no checker.
- Fiducial
- A bare copper dot with a mask opening used by assembly machines to locate the board optically; global fiducials on the panel, local ones beside fine-pitch parts.
- Panelization
- Arranging small boards on a larger panel with rails for assembly. V-scoring for straight edges, tab routing with mouse-bites for shaped ones; both stress the board when snapped.
- Engineering query (EQ)
- The fab's message asking you to approve a change they intend to make. The half you do not answer is the half they make silently on the next order.
- Do not populate (DNP)
- A BOM field marking a footprint that is deliberately left empty. A field, not a comment — comments are not read by the machine that loads feeders.
ACTIVE RECALLCheck your understanding
Answer in your own words first, then reveal.
1Why is setting your design rules to the fab's published minimums a mistake, and what should the numbers be instead?›
Because the published minimum is the edge of their process with all the manufacturing tolerance already consumed — etch undercut, drill wander, layer-to-layer registration. A board designed at that edge has zero margin against normal variation, so yield falls and the good boards are the lucky ones. It also silences DRC across the entire design, which trains you to trust a checker configured not to object. The rules should sit comfortably above the floor: on Beacon, 0.15 mm trace and space against a 0.09 mm capability and a 0.25 mm drill against 0.15 mm, with the tighter numbers used deliberately in the module fan-out and recorded as exclusions carrying a written reason.
2Name three defect classes that a fully clean DRC run is compatible with, and say which gate catches each.›
Any three of: a solder-mask web below the fab's minimum, which the fab removes and which KiCad only checks if you enable the constraint and enter their number; an unfilled via inside a solder pad, which no rule checks and which the fab's DFM pass usually queries; a component too close to a V-groove edge, which is caught by an edge keep-out you have to draw or by the fab's DFM; silkscreen crossing a pad, which the fab clips silently and which a silk-clearance rule catches if enabled; and a placement rotation that follows your tool's convention rather than the assembler's, which has no checker anywhere and is visible only in the assembler's rendered preview.
3Five assembled Beacons cost about USD 20 each and twenty-five cost about USD 9.40. Explain the difference and name the design lever it implies.›
The difference is almost entirely fixed cost divided by more units. A run carries setup charges — stencil, assembly programming, and a feeder charge per unique part — that do not change with quantity; at five units those spread to about USD 12 per board and at twenty-five to about USD 2.40. The variable parts, bare PCB and components, barely move. Two consequences: a five-board prototype price says nothing about whether R5 is met, which is why R5 is stated at 25 units; and the number of unique line items is a genuine cost lever at low volume, so consolidating resistor and capacitor values across the design reduces the fixed cost that dominates a small run.
4Your rotation for a part is correct in KiCad and wrong on the assembler's machine. Why does no checker catch this, and what is the only gate that does?›
Because there is nothing to check against. Rotation in the placement file is a number expressed in your tool's convention for that package; the machine reads it in the assembler's convention. Both are internally consistent, both files are valid, and no rule in your project encodes what the other party means by zero degrees. DRC checks geometry against your rules, and the fab's DFM pass checks manufacturability of copper and holes — neither has a model of what the part will look like once placed. The gate that catches it is the assembler's rendered preview: a picture generated from your placement file after their rotation corrections, showing what their machine will actually do. It is free, it takes three minutes, and skipping it under schedule pressure is precisely how Beacon Rev A ends up with twenty-five rotated LEDs.