Gerberfiles don't match PCBnew Layout

Hello everyone!

I ran into a somewhat crazy problem in KiCAD.
I designed a PCB for a project. The PCB is ready, so I generated the gerbers files. I then uploaded these gerbers to PCBWay and then I noticed a problem. The board outline has a circle which is not present in the PCBnew editor. Below is the image of the problem

This is what every gerber-viewer sees:
B - Gerber viewer

My question is, “Do any of you know how this could have happened and how I could possibly fix it, or is it a bug in KiCAD?”

Kind regards,

  • Almer

I could only post one image because I’m a new user. This is how the PCB corner should look like:

What does every mean? Does KiCad’s own gerber viewer have this issue?

I ask because many online gerber viewers associated with PCB fabs have bugs, and bugs with handling arcs are particularly common.

1 Like

I tried the online Gerber-viewers from PCBWay and JLCPCB. I also tried the offline Gerber-viewer from KiCAD. They all show the same problem.The image below is what the KiCAD gerber-viewer sees.

Currently I believe that plotting my PCB creates the problem because KiCAD sees some kind of invisible edgecut.

C - Kicad

If you use KiCad V 5.1.12 (you didn’t told what version you use) then I believe there is low probability of bug and this circle doesn’t come from nowhere. There have to be something in your PCB. May be something at some other layer makes plotting think that it have to be plotted.
If you use different version (specially the nightly) then bug has bigger probability.

You are ‘leveled up’ now.

1 Like

Can you share your project here?

A minor point, you cannot have sharp internal right angles as board are routed out, so there will be a radius of ~2mm

Of course I can! It’s not the prettiest prototype PCB, but it should work for now :wink:

I hope everything is in there!
EE01_EarlyPrototype.zip (589.0 KB)

If you use KiCad V 5.1.12 (you didn’t told what version you use) then I believe there is low probability of bug and this circle doesn’t come from nowhere.

Sorry for not telling what version I run, but that (5.1.12) is the exact version I’m working on!

There have to be something in your PCB. May be something at some other layer makes plotting think that it have to be plotted.

In that case, that “something” is very well hidden because I can’t seem find it :wink:

@4LM3R
try not to use extended X2 format to generate your gerber files

I opened your PCB in KiCad-nightly V6.0.0-rc1 and it does show this artifact in Pcbnew itself:

KiCad-nightly V6.0.0-rc1 also can not render the PCB properly in the 3D viewer unless I delete this circle from the PCB.

I’m quite impressed with the VNH7070AS. And 15A 40V H-bridge in such a small package. It does seem overkill for an N20 motor though. Maybe a cheaper driver such as the Allegro A4950 is good enough?

Your PCB still shows some ratsnest lines and has unconnected items, and these are real faults. One of them is on the south side of the PCB:
Note here that pad 2 of R28 is connected to a small part of a copper zone, but not connected to the rest of the GND plane.

The same for the North-West area of your PCB.
The encircled orange part is not connected to the rest of your GND plane.

KiCad-nightly V6.0.0-rc1 also has an improved DRC, and it flags a lot of “Track has unconnected end” violations. Most of these are not important, but some do require attention. Below for example, you’ve drawn two via’s to increase current handling, but one of the via’s is unused.

There are also some more examples (at least 2) of this in the +3V3 net.

In a general sense, you have copper zones connected to GND on both the top and bottom of the PCB, but these do not combine into a proper GND plane. Both of them are cut into little pieces by copper tracks.
When you are designing a PCB, one of your goal should always be to have one uninterrupted GND plane. You should bring as much tracks as possible to the top layer, even if it means using more via’s on your PCB.

You have drawn C4 and C5 as 270uF capacitors and used 0805 sized footprints for them. This would not work. These are probably electrolytic capacitors. You should also put them closer to the VNH7070AS IC’s (for the ceramic decoupling caps C6 and C7 this is even more important). I suggest to move the testpoints TP1 through TP6 further away from the IC’s, and put the decoupling capacitors in those locations, and as close to those IC’s as possible.

I also suggest to add 100nF decopuling capacitors to both the modules U8 and U5. Put these capacitors close to the power pins (Pin1 1 for both U8 and U5).

Also, ceramic SMT resistors and capacitors are quite fragile, and your PCB is likely to see a lot of abuse. These parts can break if the PCB gets bent or twisted. Resistors tend to ail open when they break, but capacitors often create a short circuit when they fail. One way to fix this is to solder them vertically on the PCB, and then solder a short wire to the other pad. This looks extremely ugly and unprofessional, but the short wire can bend a bit and this prevents your parts from breaking when the PCB gets bent or twisted. A better way is probably to use old fashioned THT parts in this project. Some PCB manufacturers also make thicker PCB’s for a small extra cost.

6 Likes

Also,
high-current IC’s such as the VNH7070AS require special consideration when designing the PCB. You have both the high currents through the PCB (your tracks are to narrow) and heating of the chip itself to consider. Such IC’s are often dependent on copper area connected to their pins to act as a heatsink. See for example the PCB suggestion from the datasheet posted below.

image

It is really very well hidden. I found it only because paulvdh showed it.
Using V 5.1.12 I left only Edge.Cuts visible.
Selecting with rectangle:


I got:

I showed selecting rectangle as it is critical to work. It have not to select any line of PCB border. If you use bigger rectangle so that any line is selected then that line is visible as selected but those 2 white rectangles are not shown.
In my opinion it is a bug.
Even if in 5.1.12 it is assumed (as I suppose) that arc starting and ending in the same point is not the whole circle but nothing after selecting the rectangle including it it should always be shown.

Edid:
After a while I noticed that if selection contains only one element it is shown with editing rectangles and if selection contains more then one then they are just shown bold. That is why I got white rectangles only if my selection contained only that arc in question.

What are the disadvantages that the extended X2 format has?

Wow, thank you so much for all the feedback! As a student, this will certainly help me and I will try to apply all feedback. I can’t really express how grateful I am!

I opened your PCB in KiCad-nightly V6.0.0-rc1 and it does show this artifact in Pcbnew itself:

The circle you see in PCBnew is unfortunately not visible to me. Maybe that’s because of the difference in the KiCAD versions between us? I’m running version 5.1.12. At least because of you I know that there is actually something there.

I’m quite impressed with the VNH7070AS. And 15A 40V H-bridge in such a small package. It does seem overkill for an N20 motor though. Maybe a cheaper driver such as the Allegro A4950 is good enough?

About your comment about the VNH7070AS; To prevent this project from becoming too expensive, I use as many parts as possible that are available in my university’s workshop. If I had more budget, I would definitely look at alternatives, such as the Allegro A4950 you mentioned.

In addition, I will take all your feedback on the capacitors and the resistors and thanks again for your feedback!

Greetings from the Netherlands!

  • Almer

The disadvantage is that cheap pcb fabs can’t manage this format because the use old software.

Hi Piotr,

By deleting the “hidden circle” you found, my gerbers now look as they’re suppossed to!

As you just said, it looks a a bug. The strange thing is that @paulvdh does see thie hidden circle in KiCAD V6.0.0-rc1. So in that case the bug already has been fixed? Weird…

I want to thank you and @paulvdh for helping me to fix the issue!

Greetings from the Netherlands,

  • Almer

Just to be clear, old non-complaint software. Also appature macros are not X2.

So how did you delete the “arc” if you could not see it in V5.1.12?
I agree with Piotr that this is a bug, but we’re very close now to the official release of KiCad V6.

KiCad’s files are all text based and easily readable.
If I open the PCB in a text editor and search for “58.42”, then it finds this string 7 times, but only one of those lines is an arc:

(gr_arc (start 121.92 67.31) (end 121.92 58.42) (angle 0) (layer Edge.Cuts) (width 0.05))

I also have some serious doubt about your microphones. Your motors will couple mechanical noise into the PCB, and your microphones are likely to pick up this conducted noise.

And as this is a school (learning) project…
KiCad can do a lot more with hierarchical sheets.
For example, you have two motor controllers drawn on the same sheet. In KiCad you can draw a sheet with one motor controller, and then include that sheet twice in the project (Just reuse the same filename if you add the second hierarchical sheet). This is especially handy if you have to modify the schematic later. You change one sub-circuit, and all instances of that sub circuit change with it.
This also works for your microphone circuit. Draw it once, and then include it thrice.

I assume that R19 and R20 should be 2M instead of 2m That is also quite a lot of amplification (2000x) Maybe R24 which is 100k (100x amplification) is more sensible.

I also noticed that you have just left pins 5, 6 and 7 of U6 open. This is not good practice. Unused opamps can oscillate. Loot at the datasheet of how to properly passivate unused opamps.

How do you mount your batteries, and what sort of batteries do you use? If your battery holder is connected with wires, then using THT padsmay be more appropriate.

If you put a few vias through SMT pads, then adherence to the PCB is a lot stronger. This is also very useful for SMT connectors with mechanical pads (often used for USB connectors) Pads can become detached from the PCB quite easily especially during repeated soldering.

Are you aware that you can also buy N20 motors with a bolted on encoder? Even when you do not want to use these immediately, you may want to make sure these fit on your PCB.

IR diodes and photo transistors are directional. You probably want to put them a bit further from the edge, so you can bend them outwards without them sticking out beyond the PCB edge.

After selecting it as I did it you are able to see its parameters and delete it.

The bug in my opinion is that KiCad allowed to add an arc with arc angle of 0.
If that arc already is in file than the KiCad behavior making hard to find it is logical. You also have a problem to find very thin and very short line as if selecting with something else it will still be so small that not visible. You have to zoom in to see it but at what point to zoom-in…
I am adding (temporarily) such piece (0.01mm length) of line (at Edge.Cuts) to allow me to link several layers in Inkscape (and I want it be really invisible). I do it if I have some footprints protrude beyond the PCB edge. If not, the original PCB Edge.Cuts rectangle is enough. I find my line to delete it as I know where it is :slight_smile:

Edit.
And one more…
Don’t you think that in V6 there is also a bug. The arc is defined as having angle of 0 but V6 sees 360?

1 Like