Skip to content

Conversation

@RaghavArora14
Copy link
Contributor

Fix QFN Footprint Pad Sizing to Match KiCad IPC Standards

Fixes #413


The Issue

QFN (Quad Flat No-lead) footprints were generating pads that were significantly too small compared to KiCad IPC standards:

  • QFN32 with 0.4mm pitch was generating 0.2mm × 0.2mm square pads
  • KiCad standard uses 0.8mm × 0.2mm rectangular pads
  • This resulted in a 79% area difference - pads were 4x too small in length!
  • Pads were positioned at the package edge instead of extending beyond it

The undersized pads would cause manufacturing and soldering issues, as QFN packages require pads that extend beyond the package edge for proper solder joint formation.


The Fixes

1. Updated QFN Pad Dimensions (src/fn/qfn.ts)

Applied KiCad IPC standards for QFN packages:

  • Pad width: 0.5 × pitch (e.g., 0.2mm for 0.4mm pitch, 0.325mm for 0.65mm pitch)
  • Pad length: 0.8mm (fixed, not pitch-dependent)

2. Added Pad Offset Support (src/fn/quad.ts)

  • Added padoffset parameter to the quad function
  • Enables fine-tuning of pad position relative to package edge
  • QFN pads now extend 0.35mm beyond the package edge for proper soldering

3. Added KiCad Parity Test

  • Created tests/kicad-parity/qfn32_kicad_parity.test.ts
  • Validates footprints against KiCad reference
  • Now passes with <5% difference (down from 79%)

📸 Visual Snapshots

Before (Incorrect - Pads Too Small)

Pads: 0.2mm × 0.2mm at -1.6mm position - way too small and not extending beyond package
image

After (Correct - Matches KiCad)

Pads: 0.8mm × 0.2mm at -1.95mm position - proper size with 0.35mm extension beyond package edge
image

KiCad Parity Comparison

Boolean difference visualization showing near-perfect alignment with KiCad footprint
image

###References
https://tscircuit.github.io/kicad-viewer/#Package_DFN_QFN.pretty/QFN-32-1EP_4x4mm_P0.4mm_EP2.65x2.65mm.kicad_mod

Note: Visual snapshots are generated in the test suite. See tests/__snapshots__/qfn16_w4_h4_p0.65mm.snap.svg and tests/kicad-parity/__snapshots__/qfn32_kicad_parity.snap.svg for the actual rendered footprints.

@RaghavArora14 RaghavArora14 force-pushed the fix-qfn-pad-sizing-clean branch from 7bf9e7d to 7c9fc5d Compare November 10, 2025 17:58
- Update QFN pad dimensions to use 0.8mm length (not 2x pitch)
- Set pad width to 0.5x pitch as per IPC standards
- Add padoffset parameter to quad function for fine-tuning pad position
- Position QFN pads to extend 0.35mm beyond package edge for proper soldering
- Add QFN32 KiCad parity test (now passes with <5% difference)
- Update QFN16 snapshot with corrected pad dimensions

Fixes tscircuit#413
@RaghavArora14 RaghavArora14 force-pushed the fix-qfn-pad-sizing-clean branch from 1d607ed to 716dfeb Compare November 10, 2025 18:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

QFN32 (and generally QFN) footprints don't match kicad- pads are too small

1 participant