Issue with Gerber loading

Hello Friends,

I am not able to open gerber file as I am getting following error
" Warning: this file has no D-code definition Therefor the size of the same items is undefined"

Please provide me proper feedback :slight_smile:

Post the gerber file, easier than trying to debug a screenshot.

There is indeed not much we can do with only a screenshot. We don’t even know what the PCB is supposed to look like. I am guessing that a bunch of the tracks are too narrow, maybe they don’t have a width at all?

And what is the origin of these Gerber files? Were they made with KiCad, or imported? What sort of results do you get when you import those Gerbers into another program (for example Gerbv from the Geda project, or in an online gerber viewer? Ucamco is the maintainter of the Gerber format, and they have an online (reference) gerber viewer.

These files are definitely not made with KiCad. They also look prehistoric, with painted zones and such. I guess these were made over 20 years ago. And a quick check shows file dates of 1998-08-25, so indeed 25 years ago.

Geda’s Gerbv can not load these files at all and gives thousands of errors about Undefined D-codes

The errors themselves seem to be mostly for D11, D39 and D42. You can try hacking into the gerber files with a text editor in an attempt to define these codes but I don’t know if it’s worth the effort.

You can follow the tutorial below. Stuff imported from gerber files is inherently missing a lot of information, and therefore I replaced most of the back imported items from the Gerbers by KiCad native entities (such as footprints) anyway. Your painted zones are also ancient and also have to be replaced / recreated to be able to work with it in KiCad. By back importing it to KiCad you can recover some things, such as PCB outline, location of mounting holes and footprints and an indication where other things are or should be. But a lot has changed in these 25 years and it will require some effort to make something decent out of this.

Thanks for the explanation :slight_smile:

Please find layout for reference.

I think this gerber was generated in Pads, I tried opening gerber using other tools still same issue

Here, I fixed your gerbers/drill
Gerber Test Converted.zip (124.8 KB)

I don’t know where that new screenshot comes from, but at least it has wide lines. But overall it does not matter much. the pad and zone painting I have seen in the project are very obsolete.

Apart from that, it is a quite simple project. For someone fluent in KiCad it would take just a few hours to re-create the project from this info. Most of it are also 8 copies of the same thing and that also makes it easier. It depends a bit on availability of a schematic, and on how accurate the reproduction has to be compared to the old version.

Edit / Addition:
Those Gerbers dsa-t fixed look a lot better, but the pad and zone painting is still present. Whole area’s are built up with the D11 flash code. Here a screenshot form KiCad’s own gerber viewer:

Thanks a lot :pray:t2:.
Could please let know the procedure ? I have multiple files, need to work around.

For Gerbers, there’s a script: pads-conv.pl, run it like this on Linux:

for f in *.PHO; do (./pads-conv.pl ${f%.PHO}.REP; cat $f) >${f%.PHO}.gbr; done

If dimensions are wrong, tweak this line in the script (see “The Gerber Layer Format Specification”):

print "\%FSLAX33Y33*\%\n";

Then for .DRL files:

  1. Look at the UL136.LST file and see the drill listing:
Drill: 32  Tool: 1  Feed: 200  Speed: 500
Drill: 36  Tool: 2  Feed: 200  Speed: 500
Drill: 40  Tool: 3  Feed: 200  Speed: 500
Drill: 51  Tool: 4  Feed: 200  Speed: 500
Drill: 126  Tool: 5  Feed: 200  Speed: 500
Drill: 189  Tool: 6  Feed: 200  Speed: 500
  1. Look at tool commands in UL136.DRL:
T1F2S5
T2F2S5
T3F2S5
T4F2S5
T5F2S5
T6F2S5
  1. Modify them to add diameters, using C# commands.
    Drill: values are in mils, so for Drill: 32, add C0.032
T1C0.032F2S5
T2C0.036F2S5
T3C0.04F2S5
T4C0.051F2S5
T5C0.126F2S5
T6C0.189F2S5
  1. Fix the work zero in the drill file to make it line up with Gerbers.

Subtract coordinates of a reference point in Gerbers from a reference point in the Drill file.
Then use “Zero Set” command (add at the top just below %), you can specify values in inches:

G93X20.350Y22.875

Or using fixed precision:

G93X20350Y22875

Okay,
Thanks I shall try it out .

Could it possible using CAM350 ? or other different method.

I don’t know. You can try.

Btw, if the goal is to export to the PCB editor, you can set the selection filter to tracks only, select them, and create zones from selection (use “Create bounding hull” option)


.

2 Likes

man, this is a post i should have seen a couple of weeks ago… :disappointed_relieved:
I’m converting to KiCad a lot of old PCBs (from gerbers) with complex plane areas and this is a HUGE help.

Just learned something new today :slight_smile:

That Bounding Hull option works quite nicely.

Before:

After:

A few (small) extra note though. There are a few circles on the PCB, and if one of those is part of the selection, then it does not work because the Create Zone from Selection is not accessible. KiCad also follows the old geometry closely. Assigning a hotkey to “delete corner” and swiping the mouse cursor over a troublesome area while holding down that key while it is repeating also works quite nicely (Undo works too).

I guess you still have a bunch of project for which you can use this conversion then. :slight_smile:

A long time ago I worked on a set of Gerbers made with some old Protel version, and this used pad painting for the pads too. For pads, it is easier to simply delete all the painted vectors and replace them with a stock footprint.

alas, yes. I’ve explored different options, like converting in multiple steps from other eda tools but at the moment all my options seems to be more or less painful.

However the trick shown by dsa-t can speedup significantly the process…

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