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 is 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.
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 although the CSV file will need some column/row tweaking as it is a generic format and Macrofab is not flexible on column/row arrangement. I do my manipulation in a Makefile.
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 to its other endpoint – this will result in a 0 long 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.
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 Lunux/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. That said, for a newcomer that has never before used pcb layout software, I would recommend kicad.
Image Credit: ScreamingCircuits