Packages

613 views
Skip to first unread message

Matt Brocklehurst

unread,
Apr 3, 2020, 3:29:47 AM4/3/20
to ope...@googlegroups.com
Hi guys

Playing with OpenPNP again yesterday after leaving it for a year or so, its coming on leaps and bounds :-)

Has anyone written a tool that helps create packages? Say I want to define a 176-LQFP package - it looks a bit tiresome doing that via the GUI (176x "add pad", then keying in the dimensions etc..) - so i'd probably wrangle the json externally. But then I was thinking I think KiCAD (or Eagle?) footprints are already in XML so it would cool if they could be imported.

I only spend about 5-10 minutes playing so if i've missed something obvious sorry(!)

Matt

Jim

unread,
Apr 3, 2020, 4:53:17 AM4/3/20
to OpenPnP
Hi Matt,

I think back in 2016, when the Package Editor was born, many things were planned that could be done with the pad definitions (e.g. vision, dispensing, etc.). But honestly, i think they have no use today (except for fiducials) - just looking nice on the screen.

What are you planning to do with the pad definitions?

Jim

Jason von Nieda

unread,
Apr 3, 2020, 10:22:25 AM4/3/20
to ope...@googlegroups.com
As Jim said, the footprints are really only used for basic visualization currently. I'd like to improve visualization in OpenPnP, and to that end I've been playing with the idea of a footprint generator: https://twitter.com/openpnp/status/1202804241020149760


Jason


--
You received this message because you are subscribed to the Google Groups "OpenPnP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/be6f7fae-f3fa-44ad-b215-dbe4a5f1123e%40googlegroups.com.

Jarosław Karwik

unread,
Apr 3, 2020, 10:26:31 AM4/3/20
to OpenPnP
Why do you reinvent the wheel ???

It is easy to import footprints directly from CAD software - Gerber files might not be the easiest to read, but you can also use Kicad component libraries.
Just import some of  the layers - like  stencil or solder mask.

I can help here if you like the idea.



W dniu piątek, 3 kwietnia 2020 16:22:25 UTC+2 użytkownik Jason von Nieda napisał:
As Jim said, the footprints are really only used for basic visualization currently. I'd like to improve visualization in OpenPnP, and to that end I've been playing with the idea of a footprint generator: https://twitter.com/openpnp/status/1202804241020149760


Jason


On Fri, Apr 3, 2020 at 3:53 AM Jim <rosegarde...@gmail.com> wrote:
Hi Matt,

I think back in 2016, when the Package Editor was born, many things were planned that could be done with the pad definitions (e.g. vision, dispensing, etc.). But honestly, i think they have no use today (except for fiducials) - just looking nice on the screen.

What are you planning to do with the pad definitions?

Jim

--
You received this message because you are subscribed to the Google Groups "OpenPnP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ope...@googlegroups.com.

Jason von Nieda

unread,
Apr 3, 2020, 10:28:26 AM4/3/20
to ope...@googlegroups.com
PCB footprints != package definitions. Unfortunately the terminology is confusing and both are often referred to as footprints. Think about how the package looks to the bottom camera, versus how the pads look on the circuit board. They are often very different.

Jason


To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/1f5eefdf-dcf0-4f32-b1f0-c15d20487596%40googlegroups.com.

Jarosław Karwik

unread,
Apr 3, 2020, 10:34:43 AM4/3/20
to OpenPnP
That would really matter mainly if you wanted to use it for vision ( like detecting  component metal parts) - for visualization it would be enough - at least for me.

But if you want perfect match - you can use Kicad 3D packages - which supposed to match components 1:1.
Even if you do not want 3D - it might be relatively easy to cast their 3D shape to flat projection.

And these days I can find close to 100% of packages online ( eg. componentsearchengine.com )

Jason von Nieda

unread,
Apr 3, 2020, 10:51:07 AM4/3/20
to ope...@googlegroups.com
Certainly importing existing packages would be great. Pull requests are welcome. But I want OpenPnP to be a complete package on it's own. There is already a package editor, it's just hard to use. I want it to be easier to use.

In case it's not clear - this project is a hobby for me. I work on what brings me joy :)

Jason


To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/b79a78ce-46b3-4c01-b5b1-d9d0c4b51187%40googlegroups.com.

Matt Brocklehurst

unread,
Apr 3, 2020, 11:43:39 AM4/3/20
to ope...@googlegroups.com
I'm going to try and bring the dispenser code back to life, its useful for me having a dispenser on the PnP - hopefully its not too much labour to bring it back to scratch - guess it got parked when the job planner got rewritten - think i've seen it as a tagged commit somewhere.

I'll see what I can do with the package editor if I get chance - if not i'll cobble something together as a script for now (probably) that can programmatically make footprints



Jarosław Karwik

unread,
Apr 3, 2020, 12:07:07 PM4/3/20
to OpenPnP
Well, importing would require changes in OpenPnp.
I would rather go for some python scripting importing/creating  ready made packages in OpenPnp formt ( xml ? - will have to check)

ma...@makr.zone

unread,
Apr 3, 2020, 1:32:48 PM4/3/20
to ope...@googlegroups.com
Am 03.04.2020 um 16:28 schrieb Jason von Nieda:
PCB footprints != package definitions. Unfortunately the terminology is confusing and both are often referred to as footprints. Think about how the package looks to the bottom camera, versus how the pads look on the circuit board. They are often very different.

I was thinking about that in the past months, mainly driven by the practicality that importing the "solder paste footprints" would be the only solution that guarantees consistency and will work without additional (manual) work, each time a new package is used.

So I was thinking about how surface tension works in reflow, and how that could be used as a model for best-fitting the "solder paste footprint" to the pads, pins and balls in bottom vision. I wondered if you could simply apply a gaussian blur to the solder paste template for the best "surface tension style" fit. 

https://youtu.be/opPDZnmrPPE?t=51

I agree that the two things are not the same, and yes I do have very limited experience. But I have yet to see a package's vision signature that is completely "estranged" from its solder paste footprint. I assume a TemplateMatch or similar will find the best fit regardless of artifacts like pins arching away from pads or interspersing cream lands on large center pads or leaving the odd pad unsoldered. Also, at least according to my limited experience, the smaller and more modern the parts get, the smaller the difference. With all the "Flat No Leads" and BGA packages (not that I use the latter) the differences turn cosmetic.

Having said that, I'm sure there will be counterexamples out there. Still, I'd rather hand-edit one out a hundred packages than all of them. ;-)

@Jaroslaw, Jason already added code to read Gerber files for the solder paste dispenser. This was probably removed along with the dispenser, but it's still there in the repo. BUT: you can't use that because the solder paste lands are all flattened into one layer. There is no semantic connection between the lands and individual parts. You have to import them from the E-CAD.

I was planning to do that for my old Eagle, and I already checked it out, 90% of the code is already in OpenPNP. Way back I did a similar thing here:

https://makr.zone/pcb-manual-placement-helper-in-html/39/

_Mark


Jarosław Karwik

unread,
Apr 4, 2020, 12:36:27 AM4/4/20
to OpenPnP
Old , traditional Gerber was flat.

But latest standard allows "extended attributes" - up to the point to describe pad component id/pin number ( https://www.ucamco.com/files/downloads/file/81/the_gerber_file_format_specification.pdf  look for '.P' )
But it is rarely supported, even Kicad has only partial implementation of it.

Hanski

unread,
Apr 4, 2020, 4:48:18 AM4/4/20
to OpenPnP
Hi!
Just out of curiosity, was there any solution for packages where machine vision center is different from part pick center (origo) e.g. DPAK?
Most packages are rectangle type and there the pick point center is the same as machine vision & centroid data center.

It not a problem for me, I can change the footprint origo for DPAK in my CAD library for future boards..

-Hanski

Marek T.

unread,
Apr 4, 2020, 5:22:59 AM4/4/20
to OpenPnP
I'm almost 100% sure that DPAK origo in my original (not modified) DXP library is center of the furthest pads' edges. At least I've never had to modify anything to get pipeline finding proper center properly.

Jim

unread,
Apr 4, 2020, 8:43:24 AM4/4/20
to OpenPnP
I did not try to correct vision coordinates on a real machine but would a simple script in pipeline work?

// PipelineScriptAddOffset.js
//
// add some offset to longer side of parts

print("### SCRIPT IN PIPELINE ###");

// arguments
var o = parseFloat(args);
print(" Offset = " + o + " px");

// get result from previous stage named "rect"
var r = pipeline.getResult("rect");
var i = r.getImage();

// get model
var m = r.getModel();
var x = m.center.x;
var y = m.center.y;
var w = m.size.width;
var h = m.size.height;
var a = m.angle;
var c = a * (Math.PI / 180);

// do some simple math
if (w > h) {
  x
= x + o * Math.cos(c);
  y
= y + o * Math.sin(c);
} else {
  x
= x + o * Math.sin(c);
  y
= y - o * Math.cos(c);
}

// create model
var rr = new Packages.org.opencv.core.RotatedRect;
rr
.center.x = x;
rr
.center.y = y;
rr
.size.width = w;
rr
.size.height = h;
rr
.angle = a;

// offer modified result
var Result = Packages.org.openpnp.vision.pipeline.CvStage.Result;
var result = new Result(i, rr);
result
;


pipelinescript.PNG

Reply all
Reply to author
Forward
0 new messages