What's wrong with these gerbers? - Page 1
Forum section: electronics / general

author: Lukas
author_rank: Frequent Contributor
timestamp: May 26, 2018, 10:37:47 am
content: Hello there,a friend of mine did a PCB using my WIP eda softwarehttps://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

author: knapik
author_rank: Regular Contributor
timestamp: May 26, 2018, 11:23:15 am
content: 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"

author: chris_leyson
author_rank: Super Contributor
timestamp: May 26, 2018, 12:00:21 pm
content: ViewMate reportedM48F?MAT,2METRIC,TZT5C0.300T4C0.75T50T3C0.800T2C1.100T1C1.500%. Syntax errorand Parameter statement does not end in asterisk ('*'):G90G05M71T5X-1.900Y8.000X7.6

author: Lukas
author_rank: Frequent Contributor
timestamp: May 26, 2018, 12:18:01 pm
content: Quote from: knapik on May 26, 2018, 11:23:15 amThat one's due to the paste bottom layer being empty, not seeing anything wrong with that though.Quote from: chris_leyson on May 26, 2018, 12:00:21 pmI 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...

author: DerekG
author_rank: Frequent Contributor
timestamp: May 26, 2018, 01:26:39 pm
content: 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.

author: SiliconWizard
author_rank: Super Contributor
timestamp: May 26, 2018, 03:12:44 pm
content: 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.

author: Lukas
author_rank: Frequent Contributor
timestamp: May 29, 2018, 05:59:32 pm
content: QuoteLooks 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).

author: SiliconWizard
author_rank: Super Contributor
timestamp: May 29, 2018, 07:24:04 pm
content: 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.

author: Lukas
author_rank: Frequent Contributor
timestamp: May 29, 2018, 08:14:04 pm
content: Can you provide a link to the spec you're referring to? I'm referring tohttps://www.ucamco.com/files/downloads/file/81/the_gerber_file_format_specification.pdf?39e2bc8b014e75daf9a3f878bee378ecpage 62

author: tycz
author_rank: Regular Contributor
timestamp: May 29, 2018, 11:20:19 pm
content: 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

author: SiliconWizard
author_rank: Super Contributor
timestamp: May 30, 2018, 12:03:03 am
content: Quote from: Lukas on May 29, 2018, 08:14:04 pmThe 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!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.

author: ghent360
author_rank: Contributor
timestamp: May 30, 2018, 06:12:01 am
content: 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).

author: SiliconWizard
author_rank: Super Contributor
timestamp: May 30, 2018, 02:40:13 pm
content: Quote from: ghent360 on May 30, 2018, 06:12:01 amYes, 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." inrevision 2015.06of 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.