Converting GERBER to PCBNEW

Hi all,

I am new to KiCAD. I am trying to reuse the previously designed PCB layout in PCBNEW. All i have is its gerber file. I also have schematics of the circuit which I replicated in KiCAD.

My expectation is not to redo the layout from the scratch, which is very difficult as the schematics is very big. Kindly help to get some ideas.

Santhosh S

First, you have to have the footprints in KiCad format. There’s no way around that and you can’t make them easily from gerber data. So you must find, make or convert them from some recognizable format first.

You can export a copper or other layer from gerbview to a .kicad_pcb file (not to your actual project pcb file but an extra file). Probably you want copper layers and some guidance layer like silk or fab component outline layer, and edge cuts. Silk or fab layers shouldn’t be exported as that same layer but moved to an extra graphic layer.

In copper layers tracks are probably OK as they are, but zones aren’t, and pads can’t be used at all. Zones must be drawn from scratch and pads come from the footprints. Delete the zones from the exported file (open the .kicad_pcb file in pcbnew in standalone mode).

Update the PCB from the schematic so that you get all the footprints there.

Open pcbnew in standalone mode and open a .kicad_pcb file which has an previously exported layer. Copy the items in the layer. Switch to your project’s pcbnew and paste the data in a place where it doesn’t interfere with anything.

Using the pasted data as guidance create the board outline – or if the outline is now in Edge.Cuts layer use it as it is – and set the helper graphics layer to the correct location.

Place the footprints one by one, using the helper graphics as guidance.

Finally, when you move the tracks as a whole exactly to the right place, they magically receive the nets from the footprint pads.

This is how I remember it, it’s been a while since I did it.

1 Like

Looks like you are in for a redo.
gerbers cannot be imported in a way to convert it into a usable pcb layout.
You need to place components in any case. For that purpose the gerber could be imported as a picture to scale as a placement guide.

Pcbnew can not import Gerbers, but as eelik already mentioned Gerbview can surely make a PCB from Gerbers. Lot’s of info is missing from Gerber files, so the conversion can never be perfect. the whole concept of “footprints” does not exist in the Gerber format for example.

The things you can get from a Gerber import with just a few mouse clicks are:

  • Board outline.
  • Location of mounting holes.
  • All PCB tracks from all layers.
  • Location of all components.

I would use the same workflow as eelik. The easiest way to get real footprints on the incomplete PCB is to first draw (parts of) the schematic, assign footprints there and then import into Pcbnew.

Having an schematic (even in pain old paper format) is a plus, but even without it you can still put some components on the schematic, port them to Pcbnew and place them on the right locations, and then start adding connections in Eeschema and update the PCB until the DRC errors go away. With a schematic you can do this with less iterations and faster and you have an extra check against making mistakes.

1 Like

The OP said: “I also have schematics of the circuit which I replicated in KiCAD”, so the workflow is this:

  1. Footprints must exist first.
  2. Footprints are assigned in the schematic.
  3. The pcb file is created, the footprints appear there.

This far the workflow is standard. After that the layers exported from gerbview are copied to the design.

One of the critical issues is getting all placements correctly. That involves selecting the copy reference point and using a good grid. Possibly drawing common reference points to all layers before copying.

1 Like

Totally agree with most what eelik wrote except maybe:

Once you’ve imported brand new Footprints from Eeschema, you can simply click on a pad of a component, then press m for Move, which attaches it to the cursor, and then use the endpoint of an existing track as a magnetic snap point.

This works best with a very coarse grid because the magnetic snap distance also increases with the gridsize. This of course only works if the magnetic snap points are enabled. The setting is in:
Pcbnew / Preferences / Preferences / Pcbnew / Magnetic Points / Snap to Tracks: "Always"

You can recognize when a snap point is used by a small circle of around 9mm diameter around the cursor (Circle stays same size when zooming in or out).

If component placement is on a usable grid of the old PCB you can of course reuse it

1 Like

I don’t remember exactly what I did. It may be that I used @paulvdh’s workflow, too. I experimented a lot so I may have tried several worklfows.

The content of gerbers depends on the program which generated them. It was painful to delete all segments which formed the zones.

This kind of reverse engineering isn’t well supported in KiCad. It’s of course difficult to implement because there’s no semantics in gerber. IIRC someone has made some scripts which would make something of this easier, but I don’t remember who and where. Maybe it was for footprints?

As indicated above, you can get some help via GerbView to KiCad, but it is iterative, and you may like to start on a simpler board.
Footprints need to come from libraries, and nets come via SCH, but the traces you can get some help with via the translations

GerbView export defaults to placing vias on pads, as it has no footprint intelligence, (probably dates from way back when thru hole was common) so those extras you will need to delete, and you can save that ‘cleaned’ file to merge later.
Also check the latest nightlies, as there was work being done on GerbView export.

See some comments and examples here

1 Like

Thanks a Lot.

Your idea seems great. I can create the footprints as i will recreate the schematics itself. It will be awesome if I receive the nets by doing so.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.