Pcbnew / Kicad

User avatar
7bit

04 Nov 2012, 09:28

Soarer wrote:...
That might take you 30 minutes once you know the basics of the tools. How long to write the script? Yeah, now how long to write a script that copes with special cases, even just non-full columns/rows? And don't miss out the time it takes you to figure out what the script should be writing :lol:

At which point exporting the netlist and importing it to pcbnew should give you a massive stack of components all in the same place. THEN you can think about a script to place the switches. This is the only part I think worth scripting.

I dunno if you're planning on using diodes inside the switches or placing them seperately... if it's the former then I doubt that SW_PUSH is the best choice for the schematic symbol; a custom MX with diode symbol would be better.
Thanks for the list.
Switch placement: To place them manually is quite a pain, especially because there are so many variants.

Doing this from one source is much more pleasant. So the only thing that is remaining is drawing the tracks.


edit: placing the components on the PCB is plain sailing, because all I have to do is copy the modules from the modules file and set their name and position on the PCB, both are well-known.

User avatar
7bit

09 Nov 2012, 08:56

Steps to be performed after running the PCB-generating script on mypcb:

Code: Select all

eeschema mypcb.sch &
- select current path in Preferences/Library: Hit Add in the 2nd field and enter $PWD/
- "use relative path?": Hit "yes"
- In 1st field hit Add and select "components.lib".
- save the useless config file (which is ignored even if loaded!)
- Now hit 4th icon from the right (Netlist generation) in the top panel of the main window.
- hit Netlist
- and save the file.
- eeschema can be closed now.

Code: Select all

pcbnew HyperMini_PCB.brd &
- select current path in Preferences/Library: Hit Add in the 2nd field and enter $PWD/
- "use relative path?": Hit "yes"
- In 1st field hit Add and select "mypcb.mod".
- save the useless config file (which is ignored even if loaded!)
- Now hit 2nd icon from the right (read Netlist) in the top panel left of that useless "+/- to switch" field of the main window. (look at the baloon texts).
- hit read current netlist
- ignore all warnings
- now you can place the traces....

User avatar
7bit

24 Nov 2012, 20:01

Next question:

How to export the PCB design into something like this:

Image

I only get a very un-smooth postscript file (via print to file).

:?

bpiphany

25 Nov 2012, 03:22

That one is generated from gerbv, KiCAD is really poor on exporting image files...

User avatar
7bit

25 Nov 2012, 09:42

bpiphany wrote:That one is generated from gerbv, KiCAD is really poor on exporting image files...
Thanks!

Now, how do I export the file to read with gerbv?
:roll:

bpiphany

25 Nov 2012, 17:15

That is something absolutely central, this you've got to learn. The gerber files is what this is all about. File->Plot, and from there you should be able to figure things out =)

User avatar
7bit

25 Nov 2012, 17:25

bpiphany wrote:That is something absolutely central, this you've got to learn. The gerber files is what this is all about. File->Plot, and from there you should be able to figure things out =)
Exactly at this point nothing works anymore. Pcbnew spits out a lot of files and when I run gerberv on them nothing happens...

bpiphany

25 Nov 2012, 18:55

"Open with" doesn't work with gerbv, the program only starts without loading the file. It usually sets the folder to the correct one when you want to open the file from within the program again... And to add the gerber files to the current project, you need to use the plus button at the bottom of the left hand panel.

User avatar
7bit

25 Nov 2012, 20:15

Code: Select all

HyperMini_PCB-Adhes_Back.gba
HyperMini_PCB-Adhes_Front.gta
HyperMini_PCB-Back.gbl
HyperMini_PCB-Comments.gbr
HyperMini_PCB-Drawings.gbr
HyperMini_PCB-Eco1.gbr
HyperMini_PCB-Eco2.gbr
HyperMini_PCB-Front.gtl
HyperMini_PCB-Mask_Back.gbs
HyperMini_PCB-Mask_Front.gts
HyperMini_PCB-PCB_Edges.gbr
HyperMini_PCB-SilkS_Back.gbo
HyperMini_PCB-SilkS_Front.gto
HyperMini_PCB-SoldP_Back.gbp
HyperMini_PCB-SoldP_Front.gtp
Which is the file I must load?

When I run

Code: Select all

 gerbv HyperMini_PCB*.g* &
it does not work.

bpiphany

25 Nov 2012, 21:48

I suggest

Code: Select all

gerbv &
and then do it through the GUI ;)

Edit: actually, the following worked perfectly for me =D

Code: Select all

gerbv ErgoDOX*.g* &
But you still probably want to set specific colors to different layers, sort them in a specific order, and save a project file with those settings until next time...

Edit again: Depending on which version of KiCAD you are using you may want to tick the "use minimal header" in the plot dialogue. I think gerbv used to crash for me otherwise... In my new version of KiCAD i think they use the minimal header and did away with the check box.

User avatar
7bit

26 Nov 2012, 21:08

It works with your Phantom files, but not with my stuff.

Is the gerbv-thing in any way important, or just cosmetic?

Code: Select all

(gerbv:18946): GLib-GObject-WARNING **: value "-nan" of type `gdouble' is invalid or out of range for property `position' of type `gdouble'
This is one line of the error messages which cause my input files.

edit: It seems there is something missing.

User avatar
7bit

26 Nov 2012, 21:59

OK, problem solved!
:ugeek:

The frame was missing. It does not matter where the elements are, but there must be a frame:

Code: Select all

$DRAWSEGMENT
Po 0 132500 -3000 -3000 -3000 150
De 28 0 900 0 0
$EndDRAWSEGMENT
$DRAWSEGMENT
Po 0 132500 44000 132500 -3000 150
De 28 0 900 0 0
$EndDRAWSEGMENT
$DRAWSEGMENT
Po 0 -3000 44000 132500 44000 150
De 28 0 900 0 0
$EndDRAWSEGMENT
$DRAWSEGMENT
Po 0 -3000 -3000 -3000 44000 150
De 28 0 900 0 0
$EndDRAWSEGMENT


bpiphany

27 Nov 2012, 20:47

7bit wrote:OK, problem solved!
:ugeek:

The frame was missing. It does not matter where the elements are, but there must be a frame:
That seems a bit odd. I don't see why you shouldn't be able to draw a PCB without specifying the edges...

Gerbv is good to have to look at the gerber files. KiCAD has a gerber viewer as well, but I haven't used it much. So I can't tell if it is any good =)

You should read up on the gerber file format. It's really simple, and when you've learned it, you can script the gerber files directly ;)
http://www.ucamco.com/LinkClick.aspx?fi ... nload=true

User avatar
7bit

27 Nov 2012, 22:14

Wait!

You mean I don't need the stuff I already done and have to start anew with the gerber files?!
Image

One more thing: How do I add vias?
Attachments
icon_shockedugeek.gif
icon_shockedugeek.gif (633 Bytes) Viewed 5114 times

User avatar
7bit

29 Nov 2012, 20:57

2 more questions:

1. How to add vias?

Answer: Click on a trace and then left click to select Place Via.


2. How to change the width of traces?

It is obvious that the traces must be less wide, because the soldering points of the ATMEGA32WHATEVER are too close to each other.
Still need to know how narrow the tracks can be.

bpiphany

29 Nov 2012, 22:54

You can add your own trace widths under Design rules. To place a via you press PgUp/PgDn while drawing a trace. There is a list of all hotkeys that is probably useful. To change trace width you can right click and go through that menu.

The manufacturer probably have specifications on minimum track widths and spacings, hole sizes and everything...

User avatar
7bit

30 Nov 2012, 09:49

Does not work. I can add other track widths but I can't select them.

edit: OK, I can edit the one and only track width in Design Rules and then place the tracks in that thickness.

User avatar
Game Theory
Mr. Despair

06 Jan 2013, 21:43

7bit wrote:Steps to be performed after running the PCB-generating script on mypcb:

Code: Select all

pcbnew HyperMini_PCB.brd &
- select current path in Preferences/Library: Hit Add in the 2nd field and enter $PWD/
- "use relative path?": Hit "yes"
- In 1st field hit Add and select "mypcb.mod".
- save the useless config file (which is ignored even if loaded!)
- Now hit 2nd icon from the right (read Netlist) in the top panel left of that useless "+/- to switch" field of the main window. (look at the baloon texts).
- hit read current netlist
- ignore all warnings
- now you can place the traces....
When I do this with the wiki tutorial I get

Code: Select all

 Component [SW3:13]: footprint <CHERRY_PCB_100H> not found 

Ibelieve i have the KiCAD-Keyboard-Tutorial-master's footprints.mod and components.lib setup correctly:
KiCADlib.png
KiCADlib.png (34.97 KiB) Viewed 4955 times
Yes I am currently in Windows :oops:

Any ideas?

User avatar
Game Theory
Mr. Despair

06 Jan 2013, 21:53


User avatar
7bit

13 Aug 2014, 20:01

Most problems are solved, now just one more thing:

What do I have to send to the PCB-manufacturer?

I know that there are some gerber-files to be generated (File->Plot in pcbnew),
but what exactly do I have to send to the manufacturer and what are the settings I need?
Attachments
pcbnew_File_Plot.png
pcbnew_File_Plot.png (71.2 KiB) Viewed 4597 times

User avatar
Muirium
µ

13 Aug 2014, 22:25

Submit your answers in a PERL script…

User avatar
7bit

14 Aug 2014, 09:55

How do I make a drill file for plated holes and one for unplated holes?
:?

bpiphany

14 Aug 2014, 10:16

It may just be that you are using an archaic version of KiCAD that doesn't separate between plated and non-plated holes... In almost every case it won't matter if all holes are plated. On my first boards in KiCAD I had a semi manual emacs script to delete all plated/non-plated holes respectively before generating the drill files.

The developing versions of KiCAD has a lot of nifty new features. I don't know how much has been incorporated into the current stable version. I never had any (serious) troubles using the latest developing version. Things do change every now and then, usually to the better, but it sometimes requires some extra work to adopt projects to the new way of thinking.
Last edited by bpiphany on 27 Aug 2014, 08:57, edited 1 time in total.

User avatar
7bit

14 Aug 2014, 11:01

Sorry for asking, I already did this:

Code: Select all

MYNAME="$@"
MYINPUT=$MYNAME".brd"
MYPADS=$MYNAME"_pads.brd"
MYHOLES=$MYNAME"_holes.brd"

grep -cH NEWLINE $MYINPUT | grep -v \:0
grep -cH DOLLAR $MYINPUT | grep -v \:0

cat $MYINPUT |
sed 's/$/NEWLINE/' |
sed 's/^[\$]EndPAD/DOLLAREndPAD/' |
tr -d '\n' |
sed 's/NEWLINE[\$]/\n\$/g' |
grep "NEWLINEAt\([[:space:]]\+\)HOLE\([[:space:]]\+\)" -v |
sed 's/NEWLINE/\n/g' |
sed 's/DOLLAREndPAD/\$EndPAD/' | grep . > $MYPADS


cat $MYINPUT |
sed 's/$/NEWLINE/' |
sed 's/^[\$]EndPAD/DOLLAREndPAD/' |
tr -d '\n' |
sed 's/NEWLINE[\$]/\n\$/g' |
grep "NEWLINEAt\([[:space:]]\+\)STD\([[:space:]]\+\)" -v |
sed 's/NEWLINE/\n/g' |
sed 's/DOLLAREndPAD/\$EndPAD/' | grep . > $MYHOLES


echo " "
echo "output written to:"
echo "$MYPADS"
echo "$MYHOLES"
echo " "
:roll:

I know this is really primitive and fails if NEWLINE or DOLLAR are in the file, or maybe if a file rm -rf is given, but no risk no fun.
:evilgeek:

Parak

14 Aug 2014, 14:18

My kicad version (2013-07-07 BZR 4022) automatically generates two drill files, one for plated and one for nonplated holes.

User avatar
7bit

14 Aug 2014, 14:31

Code: Select all

# Created by Pcbnew(2010-03-14)-final
:oops:

Parak

14 Aug 2014, 14:39

Ew. I remember those earlier versions being quite frustrating in other ways too.

User avatar
ne0phyte
Toast.

14 Aug 2014, 15:59

7bit wrote:

Code: Select all

# Created by Pcbnew(2010-03-14)-final
:oops:
Why and how? That is way behind even the Debian stable repos :lol:

User avatar
7bit

14 Aug 2014, 16:10

Never change a running system!
:-)

User avatar
ne0phyte
Toast.

14 Aug 2014, 16:17

That only applies to software that actually works, the difference between yours and the current Kicad is quite big :D

Post Reply

Return to “Workshop”