EEVblog Electronics Community Forum

Electronics => PCB/EDA/CAD => KiCad => Topic started by: Watth on September 19, 2016, 02:33:55 pm

Title: [kinda solved] KiCAD 4.0.3 PCBnew: making a footprint array
Post by: Watth on September 19, 2016, 02:33:55 pm
Hi,

Does any of you know a reliable way to have a nice layout of several occurences of the same footprint ?

In my case I am making a 8x8 LED matrix display, so I have  bunch of identical footprints that needs to be spread in a regular fashion.
In this example it goes from D1 to D64.
They are all in PCBnew, since the were in the netlist that was read. They are roughly spread with "Global Spread and Place".

Here's what I tried then:


Am I doing something wrong ?
Is there another way ?
Is it yet another feature that is impossible in KiCAD ?

Thank you for your attention.

Edit: updated subject
Title: Re: KiCAD 4.0.3 PCBnew: making a footprint array
Post by: Wilksey on September 19, 2016, 05:21:03 pm
Are you trying to create an array all with the same reference as "D1" or are you having issues trying to get KiCAD to number your footprints from 1 - 64?
Title: Re: KiCAD 4.0.3 PCBnew: making a footprint array
Post by: Watth on September 19, 2016, 05:35:34 pm
Are you trying to create an array all with the same reference as "D1" or are you having issues trying to get KiCAD to number your footprints from 1 - 64?

The problem is indeed that all the footprints are referenced as D1, while I would like them to be automatically numbered D1 to D64.
Title: Re: KiCAD 4.0.3 PCBnew: making a footprint array
Post by: ElektroQuark on September 19, 2016, 05:39:01 pm
Did you create the schematic in Eeschema? There you can automagically change the name of the instances and that will translate to Pcbnew in the net list.
Title: Re: KiCAD 4.0.3 PCBnew: making a footprint array
Post by: Watth on September 19, 2016, 06:01:50 pm
Did you create the schematic in Eeschema? There you can automagically change the name of the instances and that will translate to Pcbnew in the net list.

Yes, they are all in eeschema, and imported through the netlist.
They all appear in PCBnew, of course.
What I'm trying to do: have them neatly arranged in an array.
So I tried the "Create Footprint Array" feature.
"BUT," you might say, "if there are LED footprints D1 to 64, you will make duplicates!" To this I'd answer that I tried doing so, having beforehand deleted D2 to D64 beforehand. (And I also tried without removing them).

My problem is that the footprints generated by the "Create Footprint Array" tool all have the same reference.
Title: Re: KiCAD 4.0.3 PCBnew: making a footprint array
Post by: langwadt on September 19, 2016, 06:37:05 pm
Are you trying to create an array all with the same reference as "D1" or are you having issues trying to get KiCAD to number your footprints from 1 - 64?

The problem is indeed that all the footprints are referenced as D1, while I would like them to be automatically numbered D1 to D64.

in pcb delete all but D1 and try creating an array again


Title: Re: KiCAD 4.0.3 PCBnew: making a footprint array
Post by: PCB.Wiz on September 20, 2016, 01:27:37 am
So I tried the "Create Footprint Array" feature.
"BUT," you might say, "if there are LED footprints D1 to 64, you will make duplicates!" To this I'd answer that I tried doing so, having beforehand deleted D2 to D64 beforehand. (And I also tried without removing them).

That menu seems borrowed from pad-array inside footprints, and seems to not manage part renumber.
I'd say that feature 'needs work'...



Yes, they are all in eeschema, and imported through the netlist.
They all appear in PCBnew, of course.
What I'm trying to do: have them neatly arranged in an array.
..
My problem is that the footprints generated by the "Create Footprint Array" tool all have the same reference.
If you have them already imported, then best approach is probably to use a script to place them.
The Python code below uses a array of Ref/X/Y/R/S to place a group of parts in a specific way.
You probably do not need Rotate or Side info, but you get the idea....

Code: [Select]
import sys
from pcbnew import *
pcb = GetBoard()
RefNm   = ['C1','C2','C3','C4','C5','C6','C7','C8','C9','C10','D1','D2',
'J1','Q1','R1','R2','R5','R6','R7','U1','U2','U3','U4','U5','U6','U7','X1','Y1']
RefX    = [ 1150, 500, 1950, 700, 700, 1950, 400, 2100, 2100, 1150, 3535, 3465,
 1575, 3100, 2050, 2050, 400, 3675, 3675, 1400, 1400, 2050, 2050, 750, 750, 650, 2600, 400]
RefY    = [-1000,-1000,-1550,-1700,-1350,-900,-1550,-400,-1800,-1650,-1565,-565,
-375,-1200,-550,-1200,-1700,-925,-1275,-800,-1450,-800,-1450,-1600,-1250,-800,-600,-1400]
RefOri  = [ 180, 180, 180, 180, 180, 180, 180, 0, 0, 180, 45, 315,
 0, 90, 0, 0, 0, 255, 105, 0, 0, 0, 0, 0, 0, 0, 0, 90]
RefSide = [True,True,True,True,True,True,True,False,False,True,False,False,
True,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False]

print('Start Place XYRS')
for Idx,Rn in enumerate(RefNm):
  nPart = pcb.FindModuleByReference(Rn)
  nPart.SetPosition(wxPoint(FromMils(RefX[Idx]), FromMils(RefY[Idx])))  # Update XY
  nPart.SetOrientationDegrees (RefOri[Idx])                             # Update Rot
  if RefSide[Idx]!= nPart.IsFlipped():                                  # Current Side <> Reqd Side ? then flip
        nPart.Flip (nPart.GetPosition())
print('Finished Place XYRS, Press F11 to refresh display')
Title: Re: KiCAD 4.0.3 PCBnew: making a footprint array
Post by: langwadt on September 20, 2016, 08:15:35 pm
Did you create the schematic in Eeschema? There you can automagically change the name of the instances and that will translate to Pcbnew in the net list.

Yes, they are all in eeschema, and imported through the netlist.
They all appear in PCBnew, of course.
What I'm trying to do: have them neatly arranged in an array.
So I tried the "Create Footprint Array" feature.
"BUT," you might say, "if there are LED footprints D1 to 64, you will make duplicates!" To this I'd answer that I tried doing so, having beforehand deleted D2 to D64 beforehand. (And I also tried without removing them).

My problem is that the footprints generated by the "Create Footprint Array" tool all have the same reference.

it seems they broke that feature, I tried in 4.0.2 and it worked as expected, in 4.0.4 they all get the same reference



Title: Re: KiCAD 4.0.3 PCBnew: making a footprint array
Post by: firewalker on September 20, 2016, 09:27:14 pm
Please, fill a bug report.

https://bugs.launchpad.net/kicad
Title: Re: KiCAD 4.0.3 PCBnew: making a footprint array
Post by: firewalker on September 21, 2016, 07:47:04 am
I filled a bug report.

https://bugs.launchpad.net/kicad/+bug/1625964

Alexander.
Title: Re: KiCAD 4.0.3 PCBnew: making a footprint array
Post by: Watth on September 21, 2016, 01:01:30 pm
YES, definitely a 4.0.3 & 4.0.4 issue. I reinstalled 4.0.2 and it worked.
Thanks everyone.
Title: Re: [kinda solved] KiCAD 4.0.3 PCBnew: making a footprint array
Post by: langwadt on September 22, 2016, 06:57:38 pm
and now it is "won't fix"

so it was changed from something that could work to something that is guaranteed to not work...
Title: Re: [kinda solved] KiCAD 4.0.3 PCBnew: making a footprint array
Post by: firewalker on September 22, 2016, 07:04:54 pm
Yes. I really didn't understand the explanation.

Alexander.
Title: Re: [kinda solved] KiCAD 4.0.3 PCBnew: making a footprint array
Post by: bson on September 22, 2016, 08:02:56 pm
I understand the explanation, but I don't think the writer understands the problem.  If this is the level of attention of the engineers working on KiCAD, then we're all in trouble.
Title: Re: [kinda solved] KiCAD 4.0.3 PCBnew: making a footprint array
Post by: Watth on September 22, 2016, 10:18:01 pm
I guess they really don't want people to use this sofware.  :-//
Title: Re: [kinda solved] KiCAD 4.0.3 PCBnew: making a footprint array
Post by: firewalker on September 23, 2016, 10:23:56 am
I think commit 18f07d8efb66328a147c500a10644d2fa9050de7 did the change.

Alexander.