Macrofab Pick and Place (PnP) – musings

NOTE: This post has some significant update of January 28, 2018

I have been doing some PCB SMT design using pcb-rnd with a goal of trying a board assembly shop.  I’ll do a few prototypes but that is all. Macrofab has enough recommendations for prototype quantities that I have been concentrating on it. Pcb-rnd  a spin-off from geda pcb. Geda pcb has stagnated, not dead but somewhat stagnate, so an interested team created pcb-rnd in order to accomplish some significant new features while maintaining backward compatibility to geda pcb. There are numerous YouTube videos about Macrofab HEREpcb-rnd has significantly diverged from geda-pcb since it was forked, Pcb-rnd has added many more features and uses different file formats, although geda-pcb formats can be imported/exported.

It turns out that PnP assembly is tricky as there are NO real industry standards. I’ve tested centroid/xyrs part placement files with several fab houses and each wants a different file format. Likewise each fab company has other peculiarities in its required x/y measurement origin, nomenclature and unit of measure. Additionally, their documentation for “their” format is typically scant to none, ScreamingCircuits being an exception as they have significant documentation. I have been helping Tibor Palinkas (Igor2), the Lead Developer of the pcb-rnd project, on getting pcb-rnd to export a xyrs file that Macrofab can correctly read. It was a challenge but we are finished and pcb-rnd correctly produces a centroid file that has correct rotation and size values.

With square/rectangle boards pcb-rnd uses the implicit Pick and Place (P&P) origin of 0;0 at the lower left corner. Pnp-rnd handles the origin used by XYRS with odd shaped boards with a special dot on any layer of the board – a “PnP-Mark”.  The PnP-Mark dot is created by drawing a short line and then drag&drop move the endpoint of the unselected mark line back to its origin endpoint – this will result in a zero length line, which looks like a filled circle. Next select the mark, drag&drop move it to the lower left corner of the outline box relative to the outline’s line centerlines, as shown in Figure 2, below. With the mark still selected, press ctrl+e and click on the “add attribute” button in the property editor. Type in “pnp-origin” in the “Attribute key” and “yes” in the “Attribute value” field (see Fig 3 below); click ok and close the property editor. Finally, export the Gerber and xy files.

Creating Macrofab Compatible Files with pcb-rnd

Macrofab requires Protel-like
. Macrofab has a help page that explains their requirements at THIS-LINK.
For example, the Top Copper layer’s suffix is GTL, i.e.,

  • With square/rectangle boards pcb-rnd uses the implicit Pick and Place(P&P) origin of 0;0 at the lower left corner.
  • For odd shaped boards pcb-rnd handles the origin used for XYRS files with a special mark on any layer of the board – a “pnp-origin” Mark.

First create macrofab compatable files

  1. You will be more successful if your pcb-rnd layout includes certain fields for your board. Consequentially, make sure that your layout is production ready before starting this process:
    • Your part’s footprint and value attributes (Edit→edit_attributes_of→subcircuit) should be meaningful.
      This is because macrofab will need real manufacturer part
      and values (ohms, etc).
    • Macrofab’s Bill of Materials screen can search parts that are available from component vendors but if your part number is a real manufacturer’s part number and value then the process will go much more smoothly.
  2. The pnp-origin dot is created by drawing a short, thin line and then drag&drop move the endpoint of the unselected mark line back to its origin endpoint – this will result in a zero length line, which looks like a small filled circle.
  3. Next select the dot, drag&drop move it to be centered on the lower left corner of the outline box relative to the board outline’s line centerlines (bounding
  4. With the mark still selected, press ctrl+e and click on the “add attribute”button in the property editor.
  5. Type in “pnp-origin” in the “Attribute key” and “yes” in the “Attribute value” field; click ok and then close the property editor. A short video of pnp-origin creation is available at THIS-LINK.
  6. Finally, export the Gerber and xyfile:
    1. When exporting the gerbers (File→Export_Layout→gerber), select checkbox “all-layers” and select name-style “universal”.
    2. When exporting the XY file (File→Export_Layout→XY), select “Macrofab” format. Rename the XY file’s suffix to XYRS.

Note 1: The pnp-origin mark is not explicitly visible in the XY file nor is it explicitly passed to macrofab. Instead, all part coordinates are calculated considering the mark’s center as 0;0.

Note 2: However, the mark is not hidden or suppressed by pcb-rnd from any of the output. It must be a line, but it can be on any of the layers. Thus the mark potentially could show up on the board. There are options to make the mark disappear:

  • Make the mark diameter smaller that the router mill bit diameter and place the mark on a copper layer; the board fab will have the copper dot, but it will be milled away.
  • This should also work if the mark is on a silk layer or even on the solder mask layer where this object would be a small cutout over void
  • Make a new (copper) layer or unused layer, such as an inside layer, place the mark there and don’t send that layer’s Gerber export to macrofab.

Next Upload Files to macrofab

Macrofab has help pages that explain their process for uploading and verifying board files to their system for several EDA software products but not specifically for
pcb-rnd. If your board is created as described above you should have no problems.


For the record:

  • Macrofab measures x/y placement, in mils, based on the lower left corner of the board or, if present, the lower left corner of the outline centerline. For an example of the proper position, see Figure 2, below. Placement is looking through the board (think X-ray). NOTE that Macrofab uses bounding box measurement so if your board is an odd shape, for example wider at the top than the bottom, the lower-left corner will be that of the bounding box and not necessarily that of the board’s outline. See Figure 1 “Bounding Box PCB Example” below.
  • Macrofab requires the part dimensions, in mils, of the part’s Rotation-0 orientation regardless of the rotation of particular placement. So, a part, measured Rotation-0 orientation, of XSize 366.27, YSize 237.17 would use the same value when in Rotation 90, etc.
  • Macrofab rotation is based upon Dual inline chips being oriented at 0 (zero) rotation with pin one on the upper left. Two pin and single inline components are oriented at 0 (zero) rotation with pin one to the left. See figure below. Also, rotation for the bottom is the same but with the board flipped, bottom now facing you.
  • Macrofab requires the XYRS file be TAB delimited with columns in a fixed order, meaning a heading row is ignored and, in fact, creates a problem if present. The order is: Designator, X-Loc, Y-Loc, Rotation, Side, Type, Xsize, Ysize, Value ,Footprint, Populate, MPN

BTW – some may wonder why I use pcb-rnd or geda pcb instead of kicad (I avoid non-open-source software). I have tried kicad enough to know that it is a very capable product – but – it is too monolithic for me. I prefer the Linux/Unix approach of a tool-suite, which geda pcb and pcb-rnd provide. I have a history with geda pcb, having used it for years – I know it and therefore find it easy to use – but pcb-rnd has many more features than older geda-pcb and is therefore what I use. That said, for a newcomer that has never before used pcb layout software, I would recommend kicad.

Image Credit: ScreamingCircuits


Fig 1: Bounding Box PCB Example


Fig 2: PnP-Mark re Outline Centerline


Fig 3: PnP Mark Example

This entry was posted in Electronics, PCB Etching and tagged , , , , , . Bookmark the permalink.

3 Responses to Macrofab Pick and Place (PnP) – musings

  1. acassis says:

    Hi Celem,
    Nice post!
    I think KiCAD is the EDA to replace Eagle, gEDA is more old-school EDA and it has its followers.
    When you get your project done, please post more info about it. BR, Alan


  2. Duane Benson says:

    Thanks for the shout out, and I’m glad you find our documentation useful. We do our best to pass on what we learn in the assembly business. While we do like business, we make this information available to anyone regardless of who they have build their boards.

    Our blog, at, is our primary publishing venue for design hints, traps, and best practices. It’s all about trying to make the designer’s job easier, which, in turn, leads to more reliable electronics in general.


  3. old school here, rolls of various narrow black tape, backlit sheet of mylar and a comfortable height desk was my ‘standard’ until the use of computers brought reief to this task!!

    with so many ‘brands’ of layout/cad software offered, they all try to bring something special and along the way the concept of standards seems to get plowed into the fray.

    your blog is way informative for anyone trying to sort out what is available, for new and older folks.

    with the capacity to use 3.4 and more layers, narrowed vias and jiminy even the use of automatic time delay parameters for lengths, we all can become a “custom house” and make ‘merica GREAT again!

    hope your new project(s) reap success!

    Liked by 1 person

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s