How to reduce accuracy of gerber coordinates below 4.5?

Hi,
I have a CNC milling machine for PCBs that needs gerber data with worse less than 4.4. KiCAD settings get the coarsest resolution of 4.5.

How to reduce coordinate accuracy?

Have you looked if one of gerber viewers can do it for you?

I tried to import gerber into gerbv and then export it, but the coordinate precision setting is missing.

I need some program for linux or online tool.

I see it more of a limitation of your CNC not accepting enough digits, as of KiCad producing too many digits.

What sort of CNC are you using?
KiCad’s gerber probably has a higher resolution than would be usefull for any CNC, but your CNC program should not choke on it, and I see it in a bug in that program.

Do you have any intermediate steps? How do you go from Gerber to toolpaths for a CNC program?

1 Like

That was just my first thought. May be other gerber viewer have output format settings.
If I had to do it for myself I would probably write short C++ program finding the coordinate numbers and cutting some digits at the end (probably 0-s). May be Python could be better for it but I don’t know it.

I use a 4MILL300 milling machine, using TrackMaker to control it and deliver it.

Importing gerber data into TrackMaker, showing it correctly, but generating gcode takes much longer than on gerber data generated from Eagle with less coordinate accuracy.

Eagle gerber processes in minutes, data from KiCAD to processing a few hours.

I am considering writing a parser to reduce coordinate accuracy, but first I wanted to find out if there is another solution …

If Eagle generates data with fewer than 5 decimal digits, they do not export valid Gerber files[1]. I doubt that the slowness you observe is the result of digits.

Perhaps there is another option that you are checking that is different? Would you be able to share your board design?

[1] https://www.ucamco.com/files/downloads/file/81/The_Gerber_File_Format_specification.pdf?ea8fb2b6cc790ec6f4f4fb1c31c4cccf

1 Like

Yes, this is not secret design :slight_smile: These are my gerber files.

digitizer_12b_30MSPS-F_Cu.top (367.7 KB)
digitizer_12b_30MSPS.drl (2.5 KB)
digitizer_12b_30MSPS-B_Cu.bot (306.0 KB)
digitizer_12b_30MSPS-Edge_Cuts.boa (987 Bytes)

Gerber files from Eagle I can provide in 12h has them with me a colleague who just sleeps …

Neat!

Looking at the files, there is nothing unusual. So I imagine that your processor (TrackMaker?) does not merge the layer elements before handling them

Due to some details about how KiCad generates fills, there will be many small segments around the rounded edges of the outline. These are the D33 and D26 photo elements in your gerbers. Eagle is, I am guessing, generating raw polygons without the extra stroking.

I would suggest e-mailing TrackMaker and letting them know of the problem. This is not a KiCad-only issue as many programs offer stroking fills.

2 Likes

Here are some sample gerber files from a colleague from Eagle that can be quickly processed in TackMaker.

pid.top (281.8 KB)
pid.bot (308.6 KB)
pid.boa (28.1 KB)
pid.drl (2.6 KB)

Thanks for these. There are some interesting and unexpected differences here.

Eagle does not follow the Gerber Standard in specifying the number of decimals. But any modern program will simply convert all elements to their internal unit representation without regard to whether the number is 4.50001mm or 4.5000mm. The speed should be the same*.

One major difference is that KiCad draws the fill as a copper polygon with only the copper. Eagle appears to draw the fully plane and then draw a negative polygon over the spaces where there should be no fill. Both are valid in gerber and generate files of about the same size.

As expected, Eagle does not stroke the polygon. I suspect that this is where TrackMaker is choking.

  • Note that for some limited microprocessors with only 16-bit representation and no floating point processor, this may not be true. But I assume you are running this on a desktop.
2 Likes

You are right with the accuracy of the numbers. I have found that the problem is not the number of coordinates in the gerber files, although TrackMaker 4.5 and more accurate do not identify, but the data is displayed.

If I remove text and polygons from the design, processing is similar to that of Eagle processing.

The problem will probably be the number of short lines that are generated at the edges of the polygon.

Is it possible to reduce the number of these lines and have polygons more angular?

Not in v5. We’re in the process of testing their removal for v6.

1 Like

I downloaded KiCAD 4 and used it to edit the polygons. I changed the segments / 360 ° to 16.

However, the number of lines on the polygon edges in the gerber files is considerable and TrackMaker cannot handle the gerber.

So I contacted TrackMaker developers.

I hope that my problem will be resolved soon.
Thank you so much for your help :slight_smile:

How are you manufacturing the board and are there lots of thermals (like you show in the screenshot)? Just an idea, if you are using a reflow process you might be able to change the zone connections from thermal to solid and refill the zones. This could reduce the complexity a little (but would make it very hard to hand solder).

1 Like

The prototype will be mounted manually, these are unit pieces for physical experiments.

It would be possible to use rigid joints for pads, but their number is less than the number of pads to be wrapped.

Hi,
after consulting with the technical support of TrackMaker, we managed to reduce the time needed to process gerber files generated by KiCAD for 26 minutes (for these files). While this still is a great disproportion to the time that gerber suobory generated from Eagle needs, it allowed the PCB to milling.

Technical support promises to pass the problem to developers. They say it is a problem to prepare data for machine messing if they consist of as many small parts as the above-described dots on the edges of the polygons. Hopefully, TrackMaker developers will be able to resolve this and speed up processing.

In the attachment I send a change of settings from the default, if someone else needed it …

Thank you so much for your help.

1 Like

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