Skip to content

Grok helping with Kicad issues

Question about clearance resolution report

I am using Kicad for my electronic design. In the PCB editor I get an error about clearance. After running an inspection clearance report I get this info "Clearance resolution for:

Layer F.Cu

Pad 1 [Net-(D1-K)] of D1 on F.Cu [netclass Default]

Pad 2 [Net-(D1-A)] of D1 on F.Cu [netclass Default]

Checking netclass 'Default' clearance: 0.2000 mm.

Constraint applied.

Board minimum clearance: 0.1524 mm.

Resolved min clearance: 0.2 mm.

Physical clearance resolution for:

Layer F.Cu

Pad 1 [Net-(D1-K)] of D1 on F.Cu [netclass Default]

Pad 2 [Net-(D1-A)] of D1 on F.Cu [netclass Default]

No 'physical_clearance' constraints defined." What does it mean?

The message you're seeing comes from the Inspect → Clearance Resolution tool in KiCad's PCB Editor (very useful for debugging DRC issues, especially around pads and footprints).

Here’s a clear breakdown of what each part means, and most importantly — what the real problem almost certainly is in your case.

The key parts of your report

  1. Clearance resolution for: Layer F.Cu
    → KiCad is telling you which copper layer it analysed (front copper in this case).

  2. Pad 1 [Net-(D1-K)] of D1 and Pad 2 [Net-(D1-A)] of D1
    → These are the two pads of the same footprint (your diode D1).
    One pad is the cathode (K), the other the anode (A).
    → They belong to different nets — that's normal and expected for a diode.

  3. Checking netclass 'Default' clearance: 0.2000 mm.
    → Both pads/net use the Default net class.
    → That net class has its clearance set to 0.20 mm (very typical default value in KiCad).

  4. Constraint applied. Board minimum clearance: 0.1524 mm.
    → The board-level absolute minimum (set in Board Setup → Design Rules → Constraints) is 0.1524 mm (≈ 6 mil).
    → Because 0.20 mm > 0.1524 mm → the netclass value wins (KiCad always takes the larger / stricter value when there is a conflict).

  5. Resolved min clearance: 0.2 mm.
    → Final decision: between these two pads, KiCad will enforce ≥ 0.20 mm clearance.

  6. Physical clearance resolution for: ... No 'physical_clearance' constraints defined.
    → This just means you are not using the advanced custom design rules feature (the (constraint physical_clearance ...) syntax in custom rules).
    → Almost everyone in Fab Academy / beginner/intermediate boards does not use it → so this line is normal and not a problem.
    → You can safely ignore it.

So what is actually wrong?

The DRC error (clearance violation) appears because the two pads of your diode footprint are physically closer than 0.20 mm to each other (edge-to-edge copper distance).

This is extremely common when:

  • You are using a small diode package (e.g. SOD-123, SOD-323, 0805/1206 SMD diode, mini-melf, or even some 0603 parts)
  • But you left the Default netclass clearance at 0.200 mm (which is quite conservative — good for 2-layer hobby boards with 1 oz copper, but too large for tight footprints)

Many small SMD footprints have pad-to-pad spacing in the ~0.15–0.18 mm range (sometimes even less).
→ When KiCad enforces 0.20 mm between different nets — even if they are pads of the same component — it flags a violation.

How to fix it (practical steps – pick one)

Option A – Quick & recommended for most Fab Academy boards (especially if using a fab like PCBWay / JLCPCB with ≥ 0.15–0.18 mm capability)

  1. Go to File → Board Setup → Design Rules → Net Classes
  2. In the Default netclass row, change Clearance from 0.2000 mm to 0.15 mm or 0.18 mm (depending on your fab's real minimum clearance)
  3. Click OK
  4. Re-run DRC (or Inspect Clearance again)

Most fabs accept 0.15–0.18 mm for 1–2 layer boards without extra cost.

Option B – More selective (only relax for this component)

  1. Select the footprint D1 → right-click → Properties
  2. Go to the Clearance tab (or sometimes called "Local clearance" in older versions)
  3. Set a specific clearance override (e.g. 0.15 mm) just for this footprint → This overrides the netclass value only for objects inside this footprint

Option C – Create a separate netclass (cleaner long-term)

  • Create a new netclass called e.g. "Tight" with Clearance = 0.15 mm
  • Assign the nets of this diode (and similar tight components) to that netclass
  • This keeps 0.20 mm for power traces / long routes, but allows tight spacing where needed

Quick checklist before you send to fab

  • Confirm your PCB manufacturer's real minimum clearance (usually listed under "capabilities")
  • If you're doing 2-layer board for Fab Academy electronics production week → 0.15–0.18 mm is almost always fine
  • After changing → always re-fill zones if you have any, and re-run full DRC

Question about Nets

what is net?


Hello! Great question — understanding nets is one of the most important foundational concepts in electronic design (both in the schematic and especially when moving to the PCB stage). Since you're coming from a software engineering + teaching background, think of a net like a variable name or an identifier that groups things together logically, but here it's about electrical connectivity.

Let me explain it step by step, clearly and at the right level for someone experienced but new to hardware/EDA tools like KiCad (as used in Fab Academy 2026).

What is a "net" in KiCad (and in electronics design in general)?

A net is simply:

A group of connection points (pins or pads) that must be electrically connected together — i.e., at the same voltage / part of the same conductive path.

  • In the schematic (Eeschema):
    You draw wires between symbol pins. Every time you connect pins with wires (or they are implicitly connected via hierarchy/labels), KiCad creates a net.
    → All those pins now belong to one single net → they are shorted together in the real circuit.

  • In the PCB (Pcbnew):
    The net tells KiCad: "All these pads that belong to the same net must end up connected by copper (tracks, vias, zones/fills)".
    → The ratsnest lines (those thin white/orange spider-web lines) are just visual reminders: "Connect these pads — they are part of the same net."

Everyday examples (very concrete)

  • All the GND pads of every component → usually one big net called GND.
    On the PCB you connect them with tracks or (better) a copper pour/zone.

  • The signal going from an output pin of your microcontroller to the input of an LED driver → that's one net, maybe called LED_CTRL or auto-named Net-(U1-Pad23) if you didn't label it.

  • In your earlier diode example:

  • Pad 1 of D1 belongs to net (D1-K) → cathode net
  • Pad 2 of D1 belongs to net (D1-A) → anode net
    → These are two different nets because in a diode current flows one way — the two pads are not supposed to be shorted together on the board.
    That's exactly why KiCad checked clearance between different nets (0.2 mm in your case).

How nets get their names

How the net gets named Example name When it happens Tip / best practice
You add a net label VCC, GND, DATA, CLK You deliberately label a wire Recommended — makes everything readable
Auto-generated (no label) Net-(R5-Pad2) KiCad makes one up based on a pin OK for small circuits, ugly in big ones
Power symbols / global labels +5V, GND Using power/flag symbols Automatic and global

→ Always try to label important nets in the schematic — it makes DRC errors, routing, and debugging much easier.

Why does KiCad care so much about nets?

  1. DRC (Design Rule Check) uses nets to detect problems:
  2. Are all pads of the same net actually connected? (unconnected end, missing connection)
  3. Are different nets too close? (clearance violation — your earlier case)
  4. Did someone accidentally short two nets? (short circuit error)

  5. Routing tools respect nets:
    The interactive router won't let you connect track from net A to pad of net B by accident.

  6. Net classes group similar nets and apply rules:

  7. All NetClass = "Power" → wider tracks, bigger clearance
  8. All NetClass = "Default" → normal signal rules (your 0.2 mm clearance)

  9. Fabrication / manufacturing output (Gerber, drill files) doesn't care about nets — but correct nets ensure your board actually works electrically.

Quick mental model (software analogy)

Think of nets as variable scoping / graph nodes:

  • Each net = one node in a graph
  • Each pad/pin = a vertex attached to exactly one node
  • Tracks/vias/zones = edges that must connect vertices of the same node
  • DRC = static analysis checking the graph for shorts (two nodes touching) and opens (node not fully connected)

Quick tips for you right now (Fab Academy context)

  • In Electronics Design week: label at least GND, VCC, 3V3, important signals → saves headaches later.
  • Use Inspect → Net Inspector (in PCBnew) to see stats per net: how many pads? total track length? Very useful for debugging.
  • When you see something like Net-(D1-K) in an error → that's just KiCad's auto-name for "the net attached to pad K of diode D1".

If you'd like, show me a small piece of your schematic (or describe it) and I can help spot which nets are which — or walk you through labeling / net class setup step-by-step.

Difference between tracks, vias, zones/fills

What's the difference between tracks, vias, zones/fills?


Hello! Excellent question — this is exactly the kind of detail that separates a working board from one that performs well (low noise, good power delivery, reliable signals). Since you're in Fab Academy 2026 (right around Electronics Design → Production weeks in late February / early March), let's clarify these four copper elements in KiCad's PCB Editor (Pcbnew) with clear definitions, purposes, analogies from software, and practical tips for your projects.

Think of the copper on your PCB as a city road network: - Tracks = individual narrow roads for specific cars (signals) - Vias = tunnels / bridges that let cars jump between levels (layers) - Zones / fills = huge parking lots or express highways shared by many cars of the same type (usually GND or power)

Here is a structured comparison:

Element What it is physically Main purpose How you create it in KiCad Typical width / size Belongs to a net? Connects to pads how? Common Fab Academy use case
Track Narrow copper path (line) Carry a specific signal or current from A to B Interactive Router (hotkey X), or Place → Track 0.25–1.0 mm (depends on current) Yes (one net) Ends at pads or other tracks Routing signals between MCU pins and sensors/LEDs
Via Small plated hole (barrel + annular ring) Connect copper between different layers While routing: press V (or right-click → Add Via) Annular ring ~0.3–0.6 mm, drill ~0.3–0.8 mm Yes (inherits from track) Automatically connects tracks on multiple layers Jump from top to bottom layer to avoid crossing traces
Zone (also called copper pour / fill / plane) Large filled (or hatched) copper area defined by outline polygon Create low-resistance planes (GND, VCC), shielding, heat spreading Place → Add Filled Zone (hotkey Ctrl+Shift+Z or toolbar icon) Fills available space (mm² to cm²) Yes (one net only) Connects automatically to pads/vias/tracks of same net (thermal relief or direct) GND plane on bottom layer — connect all GND pads
Fill (Just another name for the filled copper inside a zone) Same as zone — "fill" is the common industry term for the actual copper poured inside the zone outline Automatically generated when you refill zones (B hotkey) Same as zone (people say "copper fill" or "zone fill")

Key differences in one sentence each

  • Track — A deliberate, point-to-point copper "wire" you draw manually (or autoroute) to connect exactly two points (or chain them). It's like a named function call in software — specific and controlled.
  • Via — A vertical connector only. It has no length horizontally — just drills through the board to link tracks/zones on different layers. Think of it as a function that changes the "scope" (layer).
  • Zone — A smart, automatic flood-fill of copper assigned to one net (e.g. GND). It respects clearance rules and connects to all compatible pads/vias/tracks of that net. Like declaring a global variable — many parts share it without you wiring each one individually.
  • Fill — Not a separate object; it's the result of filling a zone (solid copper or pattern inside the zone outline). When people say "add a fill" they almost always mean "add and fill a zone".

Practical tips for your boards (Fab Academy style)

  1. Tracks
  2. Start with default width from your net class (e.g. 0.3–0.4 mm for signals).
  3. Use KiCad's calculator (Tools → Calculator) or online tools to widen tracks for power (e.g. 1–2 mm for 1 A on 1 oz copper).
  4. Tip: Route orthogonal (horizontal on one layer, vertical on the other) → fewer vias needed.

  5. Vias

  6. Use microvias or smaller only if your fab supports them (most cheap fabs like JLCPCB do 0.3 mm drill / 0.6 mm diameter).
  7. Avoid tiny vias under components unless tented (covered with solder mask).
  8. Hotkey tip: While routing, V places a via and switches layer — very fast!

  9. Zones / Fills

  10. Almost always add at least one GND zone on the bottom layer (B.Cu) — assign net = GND.
  11. Set pad connection = thermal relief (default) so soldering is easier (spokes instead of solid connection).
  12. Refill zones often: press B (refill all) after changes — or enable auto-refill in preferences.
  13. Priority tip: If you have multiple zones (e.g. GND + VCC), set higher priority on the smaller one (zone properties) so it "wins" overlaps.
  14. Clearance: Zones keep your netclass clearance automatically (e.g. 0.2 mm from other nets).

Quick visual checklist in KiCad

  • Tracks & vias: thin lines / small circles (toggle filled/outline view with toolbar buttons).
  • Zones: large colored areas (press B to see them filled; toggle zone visibility in Appearance panel).

Try this mini-exercise on your current board: 1. Finish routing a few signals with tracks. 2. Press V mid-track to add a via and jump layers. 3. Place a big GND zone on B.Cu → draw outline around board edge → assign net GND → B to fill. 4. Run DRC → watch how zones connect automatically to GND pads (via thermal reliefs).

If anything looks confusing in your layout (e.g. zone not connecting, via not working), describe it or share what layer/net you're using — I can give targeted fixes.

SPICE model for LED 5988230107F

Please see the datasheet of a LED https://s3-us-west-2.amazonaws.com/catsy.557/DIA_Selector_Guide_SMD_060820.pdf. I want to create a SPICE model to use within KiCad for type 5988230107F


I'll walk you through this step-by-step, assuming you're using KiCad 7 or 8 (common in most Fab labs). We'll base the model on the datasheet specs from Dialight's 598 series documentation. Key relevant specs for modeling:

Datasheet Highlights (Typical at 25°C, If=20 mA)

  • Forward Voltage (Vf): Min 1.7 V, Typ 2.0 V, Max 2.4 V
  • Test Current (If): 20 mA
  • Absolute Max Forward Current: 25 mA (continuous), 100 mA (peak pulse)
  • Reverse Voltage (Vr): 5 V
  • Power Dissipation: 55 mW
  • Operating Temperature: -30°C to +85°C
  • Luminous Intensity (Iv): Min 70 mcd, Max 150 mcd (no typ listed, but ~110 mcd from distributor summaries)
  • Dominant Wavelength: 600–610 nm
  • Viewing Angle: 140°
  • No detailed I-V curve data points (just ranges), so we'll fit a simple model to the typical Vf=2.0 V at If=20 mA.

SPICE doesn't model light output directly, but we can create a diode-based model that captures the nonlinear forward conduction, series resistance, and reverse breakdown—perfect for simulating current limiting, dimming, or array behavior.

Step 1: Understanding the SPICE Model

We'll use a standard diode (.MODEL D) with tuned parameters to match the LED's behavior: - IS (saturation current): Controls the "turn-on" threshold. - N (emission coefficient): Higher for LEDs (typically 2–5) to account for non-ideal diode behavior. - RS (series resistance): Models internal resistance, affecting voltage drop at higher currents. - BV/IBV: For reverse breakdown (safe up to 5 V). - CJO/VJ/M/TT: Junction capacitance and transit time for AC/transient sims (optional but good for completeness).

Based on the datasheet and common orange LED models, here's a fitted model. I tuned it mathematically to hit Vf ≈ 2.0 V at 20 mA (using Python for quick iteration—analogous to debugging code!):

.model LED_5988230107F D (
  IS=5.5e-10
  N=4
  RS=10
  BV=5
  IBV=10e-6
  CJO=3p
  VJ=0.75
  M=0.333
  TT=3u
)
- This gives ~2.0 V at 20 mA, with a soft knee around 1.7 V (matching min Vf). - RS=10 Ω accounts for ~0.2 V drop at 20 mA, typical for small SMD LEDs. - If you have more curve data (e.g., from measuring a physical part), we can refine it further—treat it like parameter fitting in software optimization.

For comparison, a generic orange LED model from online sources (close but tuned for ~2.1 V):

.model Generic_Orange_LED D (IS=93.1p RS=42m N=4.61 BV=4 IBV=10u CJO=2.97p VJ=0.75 M=0.333 TT=4.32u)
Your custom one is better tailored.

Step 2: Creating the SPICE Model File in KiCad

  1. In your KiCad project folder, create a new text file named LED_5988230107F.lib (or add to an existing .lib file).
  2. Paste the .model statement above into it. Save as plain text.
  3. Example file content:
    .model LED_5988230107F D (IS=5.5e-10 N=4 RS=10 BV=5 IBV=10e-6 CJO=3p VJ=0.75 M=0.333 TT=3u)
    
  4. This is a "subcircuit" in SPICE lingo, but simple enough for direct use.

  5. If you want to include temperature effects (e.g., Vf drops with heat), add params like EG=2.05 (bandgap energy for orange LED, from wavelength ~605 nm). But start simple—ngspice handles basic temp sims.

Step 3: Assigning the Model to Your LED Symbol in KiCad

  1. Open your schematic in Eeschema.
  2. Place or select an LED symbol (e.g., from the standard library: Symbol → LED → LED).
  3. Edit its reference (e.g., D1) and value (e.g., 5988230107F).
  4. If needed, associate the correct footprint (e.g., LED_SMD:LED_1206_3216Metric) for PCB layout.

  5. Right-click the LED → PropertiesEdit Properties (or press E).

  6. Go to the SPICE Model tab:
  7. Select Model Type: Passive → Diode (or Custom if needed).
  8. Click Edit SPICE Model...
  9. In the dialog: Select File and browse to your LED_5988230107F.lib.
  10. Choose the model name LED_5988230107F from the dropdown.
  11. Check Include in simulation.

  12. Save. Now the LED will use this model in simulations.

Step 4: Testing the Model in Simulation

  1. Add a simple test circuit: Voltage source (e.g., 5 V DC), series resistor (e.g., 150 Ω for ~20 mA: (5-2)/0.02=150 Ω), and your LED to GND.
  2. Go to Tools → Simulator (or hotkey Alt+Shift+M).
  3. Set up a DC op point or sweep: e.g., DC sweep of source from 0–5 V.
  4. Run → Plot Vf across LED or current through it. It should show ~2.0 V at 20 mA.
  5. If it doesn't match, tweak RS or N in the .lib and reload (Simulator → Reload Netlist).

Tips for your level: - Debug like code: If sim fails, check netlist (Simulator → Show SPICE Netlist) for errors—similar to compiling. - Advanced: For arrays or PWM dimming, add multiple LEDs and sim transient response. Use .temp for temp effects. - Fab context: This model's great for simulating before milling (e.g., in Electronics Production week). Measure a real LED with a multimeter/curve tracer to validate—Vf often varies ±0.2 V. - Limitations: This is DC-focused; for high-speed switching, capacitance matters more. No optical sim—use separate calcs for brightness (Iv proportional to If).

If you share your circuit or measured Vf values (e.g., at 5/10/20 mA), I can refine the model further. Or if you're stuck on sim setup, describe the error! You're building transferable skills here—SPICE is like unit testing hardware. Keep prototyping! 🚀