Author Topic: What's wrong with these gerbers?  (Read 4608 times)

0 Members and 1 Guest are viewing this topic.

Offline LukasTopic starter

  • Frequent Contributor
  • **
  • Posts: 412
  • Country: de
    • carrotIndustries.net
What's wrong with these gerbers?
« on: May 26, 2018, 10:37:47 am »
Hello there,

a friend of mine did a PCB using my WIP eda software https://www.eevblog.com/forum/eda/new-work-in-progress-eda-package!/msg1124424/ and seeed studio complained that these gerbers crashed their CAM software (CAM 350). I opened the gerbers with selection of gerber viewers and none of them saw anything wrong with these or even crashed.

Maybe someone has access to that exact software or can tell me what my software did wrong in the gerber output?

Lukas
 

Offline knapik

  • Regular Contributor
  • *
  • Posts: 143
  • Country: au
Re: What's wrong with these gerbers?
« Reply #1 on: May 26, 2018, 11:23:15 am »
Not too sure what the issue is, I can open it up fine with the gerber viewer in KiCAD. However, when opening it up to view, I do get a particular warning pop up, "Warning: this file has no D-Code definition. It is perhaps an old RS274D file. Therefore the size of items is undefined"
 

Offline chris_leyson

  • Super Contributor
  • ***
  • Posts: 1548
  • Country: wales
Re: What's wrong with these gerbers?
« Reply #2 on: May 26, 2018, 12:00:21 pm »
ViewMate reported

M48F?MAT,2METRIC,TZT5C0.300T4C0.75T50T3C0.800T2C1.100T1C1.500%. Syntax error

and Parameter statement does not end in asterisk ('*'):
G90
G05
M71
T5
X-1.900Y8.000
X7.6
 

Offline LukasTopic starter

  • Frequent Contributor
  • **
  • Posts: 412
  • Country: de
    • carrotIndustries.net
Re: What's wrong with these gerbers?
« Reply #3 on: May 26, 2018, 12:18:01 pm »
Not too sure what the issue is, I can open it up fine with the gerber viewer in KiCAD. However, when opening it up to view, I do get a particular warning pop up, "Warning: this file has no D-Code definition. It is perhaps an old RS274D file. Therefore the size of items is undefined"
That one's due to the paste bottom layer being empty, not seeing anything wrong with that though.

ViewMate reported

M48F?MAT,2METRIC,TZT5C0.300T4C0.75T50T3C0.800T2C1.100T1C1.500%. Syntax error

and Parameter statement does not end in asterisk ('*'):
G90
G05
M71
T5
X-1.900Y8.000
X7.6

I got that error as well when loading the drill file as a gerber file. Loading the drill file as such works fine.

We received the attached screenshot from seeed. Seems like the issues are with the copper layers...
 

Offline DerekG

  • Frequent Contributor
  • **
  • Posts: 883
  • Country: nf
Re: What's wrong with these gerbers?
« Reply #4 on: May 26, 2018, 01:26:39 pm »
It appears Seeed are unhappy with your graphic.

If you are desperate to get your boards made, just remove your graphic to see if this satisfies Seeed.
I also sat between Elvis & Bigfoot on the UFO.
 

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 15322
  • Country: fr
Re: What's wrong with these gerbers?
« Reply #5 on: May 26, 2018, 03:12:44 pm »
I think I nailed it. There's a problem with your 'aperture macro' definitions (Gerber: 'AM'), with the use of the circle primitive (primitive code 1). Those primitives take 4 parameters (called "modifiers"), whereas there are 5 in your Gerber files (a trailing zero for no apparent reason). Example: wii-bt-dingsi.gts, line 52.

There may be some other problems with the aperture macro definitions in general in the Gerber generator of your EDA, so you may want to double check the number of modifiers for all the supported aperture macro primitives.

I guess some Gerber analyzers will just ignore that, some will give an error (mine did) and some apparently will crash (which means CAM350 is a piece of crap ;) ).

Attached is the modified file (wii-bt-dingsi.gts) that is now analyzed and renders successfully, along with a PNG view of this layer. Let me know if that solves your problem. If so, you know what to fix.
 

Offline LukasTopic starter

  • Frequent Contributor
  • **
  • Posts: 412
  • Country: de
    • carrotIndustries.net
Re: What's wrong with these gerbers?
« Reply #6 on: May 29, 2018, 05:59:32 pm »
Quote
I think I nailed it. There's a problem with your 'aperture macro' definitions (Gerber: 'AM'), with the use of the circle primitive (primitive code 1). Those primitives take 4 parameters (called "modifiers"), whereas there are 5 in your Gerber files (a trailing zero for no apparent reason). Example: wii-bt-dingsi.gts, line 52.

Looks like you're right! I patched the gerber export to not output the 5th parameter and the boards are in production now. Although, the 5th parameter is optional according to the gerber spec as it specifies the rotation angle around the center of the pad (TBH, a bit pointless for circles).
 

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 15322
  • Country: fr
Re: What's wrong with these gerbers?
« Reply #7 on: May 29, 2018, 07:24:04 pm »
Glad it helped.

Well, according to the official Ucamco Gerber spec, not in aperture macro definitions. Circles only have 4 modifiers. I looked again in the 2011 revision as well as later ones.
For instance, look at the ref spec rev. J2, page 92. The circle is the only primitive not having a rotation angle modifier.
 

Offline LukasTopic starter

  • Frequent Contributor
  • **
  • Posts: 412
  • Country: de
    • carrotIndustries.net
Re: What's wrong with these gerbers?
« Reply #8 on: May 29, 2018, 08:14:04 pm »
Can you provide a link to the spec you're referring to? I'm referring to https://www.ucamco.com/files/downloads/file/81/the_gerber_file_format_specification.pdf?39e2bc8b014e75daf9a3f878bee378ec page 62
 

Offline tycz

  • Regular Contributor
  • *
  • Posts: 104
Re: What's wrong with these gerbers?
« Reply #9 on: May 29, 2018, 11:20:19 pm »
Lukas,

You can find old versions of the document via Archive.org. Here's the J1 version from 2013.

https://web.archive.org/web/20130630231317/http://www.ucamco.com:80/en-us/downloads.aspx
 

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 15322
  • Country: fr
Re: What's wrong with these gerbers?
« Reply #10 on: May 30, 2018, 12:03:03 am »
Can you provide a link to the spec you're referring to? I'm referring to https://www.ucamco.com/files/downloads/file/81/the_gerber_file_format_specification.pdf?39e2bc8b014e75daf9a3f878bee378ec page 62

The J2 revision was the last I really used!

Seems like the new Gerber X2 format introduced this additional fifth parameter which didn't exist in RS274-X (which indeed doesn't seem to make much sense). That's good to know! I was actually planing on updating my Gerber analyzer to the new X2 format, so now I know at least one thing I have to be careful about.

So I guess CAM350 is probably not X2 compliant either, but the bad thing is that it makes it crash! :-DD

That said, I think you should probably add it as an option to generate Gerber X or X2. X2 has also additional features that you may make good use of, but leave it as an option, as I'm sure many CAM tools are not yet compliant.

Sounds like we all learned something. :-+
 

Offline ghent360

  • Contributor
  • Posts: 14
  • Country: us
Re: What's wrong with these gerbers?
« Reply #11 on: May 30, 2018, 06:12:01 am »
The rotation modifier rotates the primitive around the macro center (origin), not the primitive center. In that respect it is not completely pointless in the spec.

A circle with center at (0, 10) rotated 90 degree would result in a circle with the same radius and center (10, 0).
 

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 15322
  • Country: fr
Re: What's wrong with these gerbers?
« Reply #12 on: May 30, 2018, 02:40:13 pm »
The rotation modifier rotates the primitive around the macro center (origin), not the primitive center. In that respect it is not completely pointless in the spec.

A circle with center at (0, 10) rotated 90 degree would result in a circle with the same radius and center (10, 0).

Yes, although not strictly necessary as rotating a circle is just a matter of rotating its center, they probably added it to make all the primitives have a rotation parameter, for consistency; but it's still optional for the circle, whereas it's not stated as optional for the other primitives (probably for backward compatibility). Since there was no clear concept (as far as I remember anyway) of optional modifiers in earlier revisions of the spec, many CAM software developers probably have assumed the number of modifiers was fixed for each primitive. This is what I did to ensure the Gerber files were correctly formed.

According to the revision history, "The mistakenly omitted rotation parameter of the circle macro primitive was restored." in revision 2015.06 of the spec.

For Gerber generators, I suggest still omitting this modifier for now (especially if you don't use rotation) to ensure maximum compatibility with all current CAM software.
As I suggested, you may add some kind of user option to generate older or newer Gerber to be more flexible. Apart from this modifier, a lot has been added or marked as deprecated in newer revisions, so this would be good to be able to generate Gerber files fully compliant to the latest revision, but keeping the optional possibility of using an older revision just to be safe.

 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf