pick and place - origin

A. simplest case: rectangular board, implicit outline, implicit P&P origin

Assume a board of 775*725 mils needs to be created. The P&P fab says coord 0;0 is the lower left corner. The board fab says they need the centerline of tool-path on the outline layer for milling.

By far the simplest way to handle this board is to rely on builtin defaults:

Setting it up:

ProsCons
  • easy to set up
  • no need to draw the outline
  • limited drawing area - unsuitable for editing small boards
  • supports rectangular shapes only

B. rectangular board, explicit outline, explicit P&P origin

Assume another board of 775*725 mils needs to be created. The P&P fab says coord 0;0 is the lower left corner. The board fab says they need the centerline of tool-path on the outline layer for milling.

This time the virtual board (canvas, drawing area) will be larger and the board outline of a 775*725 will be manually drawn. Since pcb-rnd won't make a guess of where the lower-left corner is, an explicit origin mark needs to be added for the pick&place process. Setting it up, assuming the GTK HID:

There is a video tutorial available on steps 4..8.

Note 1: the mark is not explicitly visible in the XY file. It is not explicitly passed to the P&P fab. Instead, all subcircuit coordinates are calculated considering the mark's center as 0;0.

Note 2: still, 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 would show up on the board. There are multiple options to make the mark disappear:

ProsCons
  • drawing area (canvas) is bigger than the board: easier to edit
  • can handle slots, cut-outs on the outline layer
  • if the pick and place fab requires a slight offset on the placement, it is easy to move the mark
  • requires more steps to set up

C. round board, explicit outline, explicit P&P origin

Assume a third board shaped as a 700 mil diameter circle. The P&P fab says coord 0;0 is the lower left corner of the bounding box of the circle. The board fab says they need the centerline of tool-path on the outline layer for milling.

The process is the same as in example B. The only extra consideration is how to find the coords of the P&P origin mark; for this the P&P fab house needs to be consulted.

There is a video tutorial available on using temporary lines to aid placing the mark for a round lower-left corner.

D. different P&P origin for different fabs

If the same board is populated by two different fabs who want different origins, as long as they are also using different file formats, it is possible to use two marks. The mechanism for finding the relevant mark is this:

This means the origin can be a different mark per format and/or a fallback mark can be also added.

E. mark shapes

In the above examples we used a zero-length line for the mark, which looked like a filled circle. The code will find the first line with the right attribute and use the center point of that line. For a zero-length line the center point is the same as the two endpoints or the center of the filled circle it produces on the screen.

It is possible to use non-zero-length lines for the mark. For example two lines arranged in a + or x shape, either or both lines having the pnp-origin attribute. If the mark is symmetrical, the crossing point happens to be the middle of the line, which is what the code is after.

Of course it's also possible to use a single, non-zer-length line as mark, but then it's harder to see the middle point as an user. It may still work in some simple cases, e.g. a 45 degree short line segment symmetrically placed on the corner of a 90 degree outline corner.