Ordering From Macrofab with KiCad

Quick guide to using KiCad, kicad-xyrs, and kicad-make with MacroFab for PCB assembly.

TLDR

There’s an example project manufacturing package of the Scopefun V2 up here. Checkout kicad-xyrs and kicad-make for ordering KiCad projects with Macrofab.

Introduction

I recently toured MacroFab’s Houston facility and came away impressed. It’s a clean, efficient shop with a solid reputation among engineers I trust. They have a hybrid model with in-house manufacturing with a North American partner network. That’s a win for prototyping speed, reliability, and a healthier domestic supply chain. For projects that don’t need white glove service this is a great solution. They have an auto-quote engine which does a DFM check when you upload. They have some demos that are worth exploring here.

I first tried using MacroFab a few years ago, but gave up due to import issues and lack of support for KiCad v8. Support was responsive, but it was just too much of a pain at the time. So it’s time to try again.


The Joy and Frustration Auto-Order

MacroFab upload page

The upload page suggests KiCad and Eagle users upload the board source file directly. Their tools will then pull out the layers, BOM, and parts placement. For Altium and Pads they suggest using ODB++ and for the others they recommend Gerbers and an XYRS placement file.

Why Not Just Send the Board Files?

While it’s convenient to upload a .kicad_pcb, there are a few reasons you might not want to:

  • Security and Privacy: Your source files can include metadata, notes, part sourcing info, and naming conventions you might prefer to keep internal.
  • Version Sensitivity: You don’t have control over the version being used.
  • Font Funnies: If you use non-default fonts or special characters, they might not render correctly unless MacroFab’s server has the same fonts installed. If you can build your project in one of the official Docker containers you’ll probably be okay.

For now, generating the Gerbers or (ODB++ in v9+) yourself is still the safest bet.


MacroFab Required Design Files

So their docs say we need the gerbers and an .XYRS file which is both BOM and centroid as well as part size. We can also add an optional xlsx BOM to override the Manufacturers Part Number field in the XYRS. The docs threaten us with needing to generate this by hand which is low on my list.

A properly configured ODB++ output will also contain the component placement information. If your EDA tool is not supported and does not support the ODB++ generation then you will need to build your component placement information by hand in the form of the .XYRS format.

ODB++ Support

MacroFab supports ODB++, which is great. It’s a modern, structured format that carries rich manufacturing metadata. KiCad v9 adds ODB++ support after long last, unfortunately I’m on v8. I used a Docker image of v9 and confirmed the ODB++ import works. If you’re on v9 you can use that! If you’re not on v9 or you like sending explicit data to fabs then the rest of the post may be of interest.


kicad-xyrs and kicad-make

kicad-xyrs

kicad-xyrs is a tool that generates the pick-and-place CSV file (with X/Y/Rotation/Side) exactly how MacroFab wants it. It references the bottom left corner of the bounding box of your board as requested. I got some misleading errors when figuring that out. I believe this error actually means your part position is off the board as changing the board origin point to the bottom left fixed it:

Cryptic MacroFab XYRS errors

# "Designator"  "X-Loc" "Y-Loc" "Rotation"  "Side"  "Type"  "X-Size"    "Y-Size"    "Value" "Footprint" "Populate"  "Manufacturer Part Number"
"C1"    "531.50"    "141.73"    "0.00"  "top"   "SMT"   "184.65"    "94.09" "220N"  "C_1206_3216Metric" "True"  "GRM31C5C1H224JE02L"
"C2"    "914.83"    "61.10" "180.00"    "top"   "SMT"   "120.08"    "61.02" "10N0"  "C_0603_1608Metric" "True"  "GRM1885C1H103JA01D"
"C3"    "383.49"    "1019.17"   "90.00" "top"   "SMT"   "184.65"    "94.09" "2U20"  "C_1206_3216Metric" "True"  "CL31B225KAHNNNE"
"C4"    "291.49"    "1019.17"   "90.00" "top"   "SMT"   "184.65"    "94.09" "2U20"  "C_1206_3216Metric" "True"  "CL31B225KAHNNNE"
"C5"    "113.49"    "755.17"    "-90.00"    "top"   "SMT"   "184.65"    "94.09" "2U20"  "C_1206_3216Metric" "True"  "CL31B225KAHNNNE"
"C6"    "199.49"    "1019.17"   "90.00" "top"   "SMT"   "184.65"    "94.09" "2U20"  "C_1206_3216Metric" "True"  "CL31B225KAHNNNE"
"C7"    "423.49"    "747.17"    "0.00"  "top"   "SMT"   "184.65"    "94.09" "2U20"  "C_1206_3216Metric" "True"  "CL31B225KAHNNNE"

I Have seen nicer file formats but it works.

kicad-make

Once the XYRS file is working, it’s time to clean up your Gerber exports. MacroFab accepts the standard KiCad Gerber extensions but chokes on extra files. The fab_release target in kicad-make filters and zips only what’s needed so it’s clean and ready to upload.

Results

After dialing in the XYRS Gerbers we get green checks across the board and we’re ready to go!

Successful MacroFab project import from gerbers and XYRS