Connector XX on Part YY should have both copper top and bottom layers, but the svg only specifies one layer

I have tried creating a 5 custom made parts for my project. 4 work well, One is killing me. The one that is killing me is a common rotary encoder used in arduinos.

there is one here, but it is for 90 degree headers. My part has straight through headers, so I decided to build my own part. I am getting the aforementioned error and autoroute is also not routing across the top and bottom of the PCB. I have created a gerber file and used gerblook to visualise the PCB. The holes are drilled properly, the copper is on TOP and bottom layers, soldermask is on both layers, everything looks proper in the gerber, but the PCB is not routing across top and bottom. It is using vias.
KY-040_M274_Encoder.fzpz (8.1 KB)

The svg has two groups, copper1>copper0>(connectorpads).
All my other parts also have the same PCB SVG format and they work pretty well.

I looked at the fpz file(using an xml editor). I noticed that the connector pads were only on one layer.
I edited the fpz file manually to include the pads on both layers, but when I try to import the file into fritzing, I get an error that says Unable to import part.

Here is the xml edited part:
KY-040_M274_Encoder_2.fzpz (58.6 KB)

@vanepp if you can help me out, I’d be grateful.

Looking at the part in Part editor mode, PCB view, If I hide all layers and then show copper Top and copper Bottom, I am able to see the copper in both layers. Why is it not working then?


Hi @Charles_Kalthrop,

The problem with this second part is that it contains a folder instead of files (you compressed the containing folder instead of the files inside): once you fix it, the part can be imported normally.

In any case, the part has some other issues that @vanepp (probably) will explain better than me.

Best regards

First of there is already a part for this:

which has an improved version later in the post. That said, as @roboteach said your zip file is the entire folder which is why the part won’t load. To correct that zip only the files to a .fzpz file and it will work. Doing that indicates a number of errors: schematic lacks terminalIds which causes this:

where the wire connects to the middle of the connector rather than the end as it should. As well in pcb the hole sizes are incorrect (and inconsistent):

which shows in the gerber drill.txt file like this

; NON-PLATED HOLES START AT T1
; THROUGH (PLATED) HOLES START AT T100
M48
INCH
T100C0.035870
T101C0.035871
T102C0.038000
%
T100
X009111Y012777
T101
X009111Y010777
X009110Y011777
X009111Y013777
X009111Y014777
T102
X005111Y010777
X005111Y013777
X005111Y011777
X005111Y014777
X005111Y012777
T00
M30

The top two entries

T100C0.035870
T101C0.035871

should match the third

T102C0.038000

which is the correct size for a 0.1in header. The 0.035in holes are too small. Running your part through FritzingCheckPart.py flags these errors:

Error 69: File
‘svg.breadboard.KY-040_M274_Encoder_d33e40f98d1af7a1907cc6ccb62876a1_3_breadboard.svg.bak’
At line 22

Found a drawing element before a layerId (or no layerId)

Error 69: File
‘svg.schematic.KY-040_M274_Encoder_d33e40f98d1af7a1907cc6ccb62876a1_3_schematic.svg.bak’
At line 30

Found a drawing element before a layerId (or no layerId)

Error 77: File
‘svg.schematic.KY-040_M274_Encoder_d33e40f98d1af7a1907cc6ccb62876a1_3_schematic.svg.bak’
At line 227

terminalId connector13terminal can’t be a g as it won’t work.

Error 18: File
‘part.KY-040_M274_Encoder_9c03b2867a9e0537c22532e90d8f3222_4.fzp.bak’

Connector connector8terminal is in the fzp file but not the svg file. (typo?)

svg svg.schematic.KY-040_M274_Encoder_d33e40f98d1af7a1907cc6ccb62876a1_3_schematic.svg.bak

Error 18: File
‘part.KY-040_M274_Encoder_9c03b2867a9e0537c22532e90d8f3222_4.fzp.bak’

Connector connector9terminal is in the fzp file but not the svg file. (typo?)

svg svg.schematic.KY-040_M274_Encoder_d33e40f98d1af7a1907cc6ccb62876a1_3_schematic.svg.bak

Error 18: File
‘part.KY-040_M274_Encoder_9c03b2867a9e0537c22532e90d8f3222_4.fzp.bak’

Connector connector10terminal is in the fzp file but not the svg file. (typo?)

svg svg.schematic.KY-040_M274_Encoder_d33e40f98d1af7a1907cc6ccb62876a1_3_schematic.svg.bak

Error 18: File
‘part.KY-040_M274_Encoder_9c03b2867a9e0537c22532e90d8f3222_4.fzp.bak’

Connector connector11terminal is in the fzp file but not the svg file. (typo?)

svg svg.schematic.KY-040_M274_Encoder_d33e40f98d1af7a1907cc6ccb62876a1_3_schematic.svg.bak

Error 18: File
‘part.KY-040_M274_Encoder_9c03b2867a9e0537c22532e90d8f3222_4.fzp.bak’

Connector connector12terminal is in the fzp file but not the svg file. (typo?)

svg svg.schematic.KY-040_M274_Encoder_d33e40f98d1af7a1907cc6ccb62876a1_3_schematic.svg.bak

The no layerId errors mean that your part won’t export as an image, the rest should be self explanatory. The following tutorial may help you in correcting the errors:

Part creation howto part 1 breadboard and pcb

Peter

@vanepp Hi, thanks for replying.

First of there is already a part for this:

I saw that part and mentioned it in my first letter. But that part is for 90 degree header pins breakout board, not for a straight pins breakout board which is what I need for my project. If someone can point me towards a straight pin version, I’ll be very happy.

Is the issue with schematics a deal breaker? Is it going to be a big problem in the future? coz this is how my schematic looks right now:


The connection is at the centre as you mentioned, but it conveys the message pretty well enough is what I am thinking. Unless I’m missing some really important use case of the schematic, like automated PCB design capabilities with other softwares or something.

The top two entries
T100C0.035870
T101C0.035871
should match the third
T102C0.038000
which is the correct size for a 0.1in header. The 0.035in holes are too small.

How do I get the hole sizes to match? All the holes are of the same size in the SVG files. Why the difference in gerber then??

@roboteach I re-zipped the file and for now, the major issues are sorted.
Thank you.

If anyone wants, here are the parts I made. They are purely functional. Absolutely non-aesthetic. Free to use by everyone, just like fritzing. Have a few rough edges, just like fritzing :wink:.

If anyone improves on the files, please be sure to re-upload the improved files so that everyone can benefit.
KY-040_M274_Encoder_V2.fzpz (58.2 KB)
SO5V1000.fzpz (8.2 KB)
SO24V500.fzpz (8.5 KB)
Wurth 744821110 LCM CMC__CK__Final.fzpz (9.4 KB)

The terminalIds are not fatal, as you see, it will connect fine to the middle of the pin. The missing layerIds aren’t fatal, but your part won’t appear in the image if the sketch is exported as an image, again not fatal if you aren’t using images of the sketch. As to the pad sizes, assuming you are using Inkscape, the hole size is

hole_size = pad_diameter - (2 * stroke-width)

as the svg scale is odd, I copied in a correct pad to the pcb svg and then displayed it.

The radius should be 2.0880003 and the stroke-width 1.44 to make the pad hole the correct 0.038in. I fixed up the layerIds and modified schematic to add the terminalIds to make this part which should be correct:

KY-040_M274_Encoder_2-improved.fzpz (7.8 KB)

note you will need to delete the current part before being able to load this one as I didn’t change the moduleId. It looks like this:

schematic is somewhat smaller and has terminalIds

Pcb is mostly identical except all the holes are 0.038in as they should be:

; NON-PLATED HOLES START AT T1
; THROUGH (PLATED) HOLES START AT T100
M48
INCH
T100C0.038000
%
T100
X008763Y009344
X008763Y011344
X008763Y010344
X008763Y013344
X008763Y012344
X012763Y012344
X012763Y013344
X012763Y009344
X012763Y011344
X012763Y010344
T00
M30

Peter

Thank you very much peter.