Using relative coordinates in KiCad to design mechanical aspects of PCB boards

TL;DR: press the space bar to set the origin of the relative coordinate system and then watch the dx,dy cursor coordinates in the status bar as you draw.

See  section 2.6. “Displaying cursor coordinates” of the Eeschema reference manual.

There are two coordinates systems (frames) in KiCad:

  • absolute: origin is in one of the corners of the “paper” sheet, displays as “X…Y…”
  • relative: origin is wherever you set it using the space bar, displays as “dx…dy….”

KiCad continually displays the location of the cursor in the right side of the status bar which appears near the bottom of the application window.  KiCad updates the displayed location even as you use some tool to draw, place, etc.  KiCad displays the location of the cursor in both coordinate systems.

Use the relative coordinate system to layout a board mechanically.  First set the origin, say to the upper left corner of your board:

  • move the cursor to where you want it
  • press the space bar.  Expect the relative coordinates to change to “dx 0.0000 dy 0.0000.”

Then as you draw, you can stop the cursor at some precise dimension.

KiCad does not persist the origin of the relative coordinate system (save it in your project.)  You need to set the origin at the beginning of each design session.

KiCad does not display any particular symbol at the origin of the relative coordinate system.  You can add a fiducial symbol at the origin.

Few people use the absolute coordinate system and many people complain that you can’t set its origin.  But they should just use the relative coordinate system.

From a user-interface viewpoint, maybe KiCad should:

  • place more emphasis on the relative coordinate system (display relative coords left of/preceding the absolute coords)
  • make the origin persist
  • add a pop-up menu item to set the origin (space bar is too obscure)
  • make the displayed nomenclature more consistent (why is it not “dX,dY and dx,dy” or “X,Y and x,y” or “aX, aY and rX, rY” or “abs x,y and rel x, y”)

Framed Panels and Nested PCB’s using KiCad and OSHPark

This continues my earlier post.

About OSHPark

Here is an Element14 article about the OSHPark business model and company history.

Briefly, it says that OSHPark adds value for small makers by aggregating small boards from many customers into large boards that PCB manufacturers are equipped to make.  Some of added value is the software that runs the OSHPark business:  the web store, the software that aggregates many small PCB designs into a larger one, the software that understands and converts many different design file formats.

I appreciate their work and wish them continued success.

OSHPark and ad hoc panels (without frames)

A panel created according to my earlier post does not have any explicit support tabs or a frame.  I will call this an ‘ad hoc panel.’

OSHPark adds support tabs for you, between the PCB’s of your ad hoc panel.  (They also add support tabs on the outside of your panel, to the adjacent customer’s board or panel in the manufactured, huge, aggregate board.)

Unfortunately, OSHPark might also break apart your ad hoc panel at their convenience or need.  OSHPark breaks apart their aggregate, huge panels into customer’s boards.  While they are doing this, they don’t know which groups of boards are a customer’s ad hoc panel.  So OSHPark may break apart your ad hoc panel.

Just looking at the aggregate panel pictured in the above linked article, you can see that it might be difficult for the person separating customer’s boards NOT to break apart your ad hoc panel.

My point is: if you want your panel to stay together, you need to add a frame.  Otherwise, you are taking your chances.  The frame is what tells OSHPark not to break apart the boards.

Why create panels?

  • so you can save labor by stenciling or assembling boards in panels/batches
  • to save board costs by nesting odd-shaped boards

For the first purpose, the fact that OSHPark may break apart your ad hoc panel might defeat the purpose.  In my experience, making panels of 3 small boards, to stencil them by threes, for hand pick and place, it has not been a problem.  If OSHPark breaks apart your ad hoc panel in odd ways, you can always break them into individual units and stencil them by ones (using a corner of the same stencil for the whole panel.)

As I mentioned in an earlier post, OSHPark doesn’t always break your multiple board order into individual boards.  Sometimes you get ‘happenstance panels’ even if you did not order an ad hoc panel.  (Assuming your boards are much smaller than OSHPark cardboard shipping envelopes of about 5×7 inches.)

I am not really serious about volume production yet.  If you are, you should frame your panels.

Nesting odd-shaped boards into ad hoc panels

Say you have an L-shaped board.  OSHPark calculates the cost from the bounding rectangle.  That is, they will charge you for the empty space between the arms of the L.

If you nest two such L-shaped boards into an ad-hoc panel, the cost for the bounding rectangle of the panel will be less than twice the cost of the individual boards.

Other words for nesting are tiling or bin packing.

Tiling is partly how OSHPark subsidizes small makers, by fitting small boards into the wasted space of larger, odd-shaped boards.  If you create your own tiled, ad hoc panels, you save costs, but then someone else might be less subsidized.



Understanding “Unconnected” using KiCad Pcbnew

Using KiCad Pcbnew (PCB layout tool) you may see “Unconnected 1” in the status bar at the bottom of the GUI.  And you will see a ratsnest line (a thin white line) visible between some pin and the nearest place it could be connected.

This may happen even if you see that a copper layer (say ground fill) touches said pin.   And if you use “Highlight net” tool, clicking on that pin, it will highlight other ground pins.

So the message seems to mean “there is no trace that starts or ends on the pin.”  It does not mean “the pin is not electrically connected to the correct net.”  And the produced board might work, since the real, copper, ground layer will touch the pin.   So the message seems to be a warning in this case.

If you want to be safe and get rid of the message, simply draw a trace from the pin to some place in the ground fill, create a via, and end the trace.

Please check for yourself.   I could be wrong, I am not an expert.  KiCad might have changed since I wrote this.  The notion of connectedness is different in the schematic editor.

Panelizing a PCB in KiCad


This is a tutorial for panelizing (producing a panel comprising replicates of a small PCB) in KiCad.

The goal is a separate design, a panel comprising a horizontal row of my boards separated by the 100 mil routing width that my fab uses.  The purpose is a panel that is an easily handled batch during assembly  (solder paste stenciling, placing SMD components, and moving to the reflow oven.)

This is specialized:

  1. uses KiCad
  2. replicates one small board,
  3. I don’t design internal support tabs
  4. I don’t design a frame around the replicates
  5. it’s a manual operation using fiducials and block copying

In this example, I assume the fab is OHSPark:

  1. requires 100 mil separation
  2. they will add internal and external support tabs
  3. they don’t require a frame (since I will accept if the panels break apart in shipping.)

Internal support tabs hold the panel together.  External support tabs hold my panel in the larger panel that the fab makes.

There might be other ways to do this.  At one time there existed Python scripts to automate this.

Overview of the process

Use fiducials (layer alignment targets.)  Create an initial fiducial pair at grid size 100 mils. Use a minimum grid size( 0.01mm) and nudging with the arrow keys when aligning copies.  Use block copy to copy both the PCB and nearby fiducials.

Here is a picture of the nearly finished result:



Before you start

You have a finished existing board design.  (Any changes to it will not automatically flow into your panel design.  You will need to redo your panel if the child PCB changes.)

Your zone outlines and all other components are within your PCB edge outline ( simplifies block copy.)

The line width of your board outline (in Edge.Cuts layer) is small (say the default of 0.15 mm).  This matches the line width of fiducials, making it easier to see when your board outline is corner aligned to a fiducial.  (Your fab cuts to the center of the graphic line defining the edge.)

Your existing board design need not be aligned to any particular grid size.  Your board size need not be a multiple of any particular grid size.  (Although it might be easier if your board is aligned to a 100 mil grid and a multiple of 100 mils in size.)

The process

Starting PCBNew app

Click on the PCBNew icon (in your desktop, launcher, or file browser.)  Expect a window showing an empty PCB design.  (Note you can’t start PCBNew from within your existing project, since then it opens your existing design, that you should keep separate.)

Import your existing PCB into the empty panel design

Choose File>Append Board.  Expect a file browser to open.

Select the foo.kicad_pcb file of your existing PCB design and choose the OK button.  Expect a floating view of your existing PCB design.

Click in the sheet anywhere to place the first copy of your PCB.

Add two fiducials on a 100 mil grid

Choose ‘100 mils’ from the grid combobox in the toolbar.  Expect the grid to change.

Select the fiducial tool by clicking in the “Add layer alignment target” icon in the right toolbar.  Expect the cursor to change to a pencil icon.  Click in the sheet near the upper right corner of the PCB copy.  Expect a fiducial symbol placed on the sheet, snapped to the nearest grid point. (It is in the Edge.Cuts layer.)

Repeat, placing another fiducial 100 mils to the right of the first fiducial.

Align the first replicate’s upper right corner to the left fiducial

Choose ‘0.01 mils’ from the grid combobox in the toolbar.

Zoom in so you can see precise alignment.

Choose the pointer tool.

Drag out a rect around the PCB.  Expect a “Block Operation” dialog to open.  Choose the OK button.  Expect an image of the PCB to follow the cursor (an the original to remain visible.)

Align upper right of the first replicate to the fiducial’s cross, and click the LMB (left mouse button.) Expect the PCB to be placed.

Delete the left fiducial

Using the pointer tool, click the RMB (right mouse button) on the left fiducial.  Expect a context menu to pop up.  Choose “Delete Target.”

Block copy the PCB and fiducial

Using the pointer tool, drag out a rect around the first PCB replicate and the fiducial to its right. Expect a “Block Operation” dialog to open.  Choose the OK button.  Expect an image of the PCB  and fiducial to follow the cursor, but for the original also to be visible.

Align upper left of the dragged copy to the  fiducial of the original.  Click the RMB ( right! mouse button.) Expect a context menu to pop up.  Choose “Copy Block”.  Expect a second replicate of your PCB to be placed.

(Also expect horizontal rat’s nest lines to appear, connecting nets in the left copy to nets in the right copy.  You can ignore those, or “Hide board ratsnest”.)

Note that unless your board is a multiple of 100 mils wide, the newly copied fiducial won’t be on a 100 mils grid.


Delete the left fiducial and again copy the right PCB ( or many of them) and the fiducial to its right.

You might make a few more copies.  You should not make more copies than will fit in the larger panels used in the fab.

Delete  fiducials

KiCad puts fiducials in the Edge.Cuts layer.  Some fabs (OSHPark) might deal with this as you expect, while other fabs may route out (drill) the fiducials!  A post on the KiCad forums discusses this.

You should probably delete the fiducials, so you don’t worry about how your fab interprets them.

Save As

Choose File>Save As and so forth to save the panel design.  You probably should create a separate folder to put it in.  In that separate folder, you can also put the Gerbers for the panel.

(If you choose File>Save you might get an error message, probably because on some platforms, KiCad attempts to save in the locked directory of the application file.)

Finishing up

You might want to run the DRC.  It should still work.

You now can plot Gerbers and generate a drill file.  (It seems like you must choose an absolute path for the drill file, else KiCad attempts to write it in a locked app directory?)

One advantage of a panel such as this: the solder mask Gerber layer will precisely align with the boards of the panel.  (You don’t need to panelize a solder paste stencil like you might for a happenstance panelization that the fab might create and deliver to you.)


I don’t think you need to be super accurate.  When I do it, the alignment seems a few pixels off, less than a mil off.  Use the arrow keys while dragging to nudge your PCB a few pixels.

Even if the distance between your PCB copies is a few mils off, the fab actually uses a router bit that is smaller than 100 mils (it cuts on the way into a slot, moves over, and cuts on the way out.)

If the outer edges of your panel are a few mils off, your panel will still probably fit in the jig for your solder paste stencil.

In other words, don’t worry about a few mils, because your home hobbyist processes don’t require that accuracy.


I haven’t tested this with OSHPark yet.