Kicad

2016-11-13

New Kicad Tricks:

+USE THE ICON FOR PLACING PINS FROM A HIERACHAL SHEET: If I use the icon for placing pins from a hierchal sheet instead of right clicking on the symbol, I can place all of the pins in sequence instead of right clicking 100 times.

+USE THE PYTHON SCRIPTING ENGINE: One can move a component with something like this:

b = pcbnew.GetBoard()

d401=b.FindModuleByReference('D401')

p=d401.GetPosition()

np=pcbnew.wxPointMM(160, 62)

d401.SetPosition(np)

+To pattern place a group of parts with an offset, save this as:

~username/.local/lib/python2.7/site-packages/yeltrow.py

to use it: import yeltrow

yeltrow.patternPlace()

#

# yeltrow's Part Position Patterning Tool

# Written 2016-11-13

# to use:

# open scripting console in pcbnew

# import yeltrow

# yeltrow.patternPlace()

#

#

# I had lots of embedded hierarchal pages that had the same parts on them

# When I annotated the part #'s, each part got the # of the page times 100.

# this made it really easy to script the replication of the part positions

# and rotations from a seed block of parts from the lowest numbered page

# to all of the subsequent pages and blocks of parts.

import pcbnew

def patternPlace():

print("processing")

b=pcbnew.GetBoard()

# Input to this looks something like {"d401","r101"}

# Example list of parts that will be seed for the pattern

l=({"D301","D302","R301","R302","R303"})

s=4

e=10

axis="X"

increment=2.54*1.5

## l=input("List of parts :")

## s=int(input("Starting part hundreds place #xx:"))

## e=int(input("Ending part hundreds place #xx:"))

## axis=input("XorY")

## amount=int(input("Increment Amount:"))

for p in l:

print("Processing parts like:",p);

suffix=p[-2:]

prefix=p[0]

patternPos=b.FindModuleByReference(p).GetPosition()

patternOrientation=b.FindModuleByReference(p).GetOrientation()

print("Pattern Pos",str(patternPos))

iteration=0

for n in range(s,e+1):

iteration=iteration+1

nPartName=prefix+str(n)+suffix

print(nPartName)

movePart=b.FindModuleByReference(nPartName)

newX=patternPos.x/float(pow(10,6))

newY=patternPos.y/float(pow(10,6))+iteration*increment

print("Original Pos",str(movePart.GetPosition()))

newPos=pcbnew.wxPointMM(newX,newY)

print("New Pos",str(newPos))

movePart.SetPosition(newPos)

movePart.SetOrientation(patternOrientation)

What I have learned about using Kicad for doing industrial wiring diagrams.

1) It generally works, but no one has shared an industrial symbols library on the github site. I intend to package mine up so maybe it can turn into something useful.

2) If you want to edit a symbol that has multiple units, sometimes it is easier to draw one and use a text editor to make the copies of the changed items.

3) To move things from one library to another, it might be easier just to copy it in a text editor; BUT one can:

a) use the library button to select the library the part you want to move is in

b) load the part from the library.

c) switch the active library to the library you want to put it in.

d) click the "update component in current library"

e) save

4) "Slotted" Components with multiple units are very helpful for industrial schematics where it is common to sprinkle the auxiliary contacts all of the schematic.

5) Terminal connections can take advantage of slotting to be able to annotate the terminals. Be careful to hand assign the annotations so the annotation engine doesn't start creating short circuits. It can be handy for keeping track of what terminals have been used.

6) Slotting produces some kinda weird subdesignators on the contacts, but I'm just going to get used to it.

7) Netlisting will fail unless everything is annotated, which prevents using the BOM tool or doing even a partial layout (I wanted to just do the terminal strips).

8) If I can get things to netlist, I can probably use the PCB editor to create a control panel layout. If you set everything up with through-hole pins, there should be tons of colors one can use to route "tracks" to show where wires would go.