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 HERE. pcb-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
suffixes. 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
- 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
numbers 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.
- 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.
- 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
- 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; click ok and then close the property editor. A short video of pnp-origin creation is available at THIS-LINK.
- Finally, export the Gerber and xyfile:
- When exporting the gerbers (File→Export_Layout→gerber), select checkbox “all-layers” and select name-style “universal”.
- 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