SOT-23 Vision errors

252 views
Skip to first unread message

jamoiam

unread,
Nov 2, 2022, 6:09:38 PM11/2/22
to OpenPnP
Are there any tricks to improve on this problem that I am getting occasionally?

Vision pipeline and threshold etc is setup to give pins only. i.e. 3 dots. no SOT-23 body. Sorry I didn't capture that image.
I don't know how I could, or should? capture the SOT-23 body with it black on a black nozzle.

bv_result_1667083271172518410_Small.png

Litterio Andrea Guainella

unread,
Nov 2, 2022, 6:55:36 PM11/2/22
to OpenPnP
Hi,
your images should be inside "C:\Users\XXX\.openpnp2\org.openpnp.vision.pipeline.stages.ImageWriteDebug" where XXX is your account name in windows machine.
Your image seems too bright so I suggest you decrease "exposure" camera feature. (please don't mind my screenshot because I am away from pnp machine. is only reference for camera feature.) As image below.

35.png

As you can see below this is my typical SOT-23 snapshot.

34.png

LAG

jamoiam

unread,
Nov 2, 2022, 11:33:43 PM11/2/22
to OpenPnP
Yes, that is where I am getting the debug images from, but it was not setup to capture the intermediate stages of the vision pipeline, only the end result.

I note your result has the red outline based on the pins extent... so the body is excluded from your vision pipeline?

Like the image below?
If this is the case the pins appear as 3 dots and I can see how the vision pipeline has trouble defining a square from 3 pins. A triangle?

Note the image is small as I am setup to place a 30x30mm part, which makes the SOT-23 quite small in the images

Untitled3.png

Mark

unread,
Nov 3, 2022, 5:48:35 AM11/3/22
to ope...@googlegroups.com

First, I recommend you upgrade to the newest OpenPnP test version.

Then update the pipeline to the standard pipeline, so you can benefit from the newest Parametric control.

https://github.com/openpnp/openpnp/wiki/Computer-Vision#using-new-stock-pipelines

https://github.com/openpnp/openpnp/wiki/Exposed-Pipeline-Parameters

Use the sliders to set the threshold. See the animation here:

Parametric-Pipeline

If this does not help:

The SOT-23 "triangular" instability is well known. You can try to use the Multishot feature, as shown in the video here (sorry for the stuttering commentary there, I hope you still understand it is about isolating and detecting the pins on both sides separately):

https://youtu.be/P-ZudS7QQeE?t=296

To understand this function, you probably best read the Wiki too (and watch the whole video).

https://github.com/openpnp/openpnp/wiki/Vision-Compositing

_Mark
--
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/99cef913-a2c8-433b-a984-dbc12d4c017en%40googlegroups.com.

Mark

unread,
Nov 16, 2022, 3:11:23 AM11/16/22
to ope...@googlegroups.com

Hi jamoiam

please respond publicly, so others can learn, this is an Open Source community!

I'm reposting your message here:

> Sorry for the delay. I had to absorb your suggestions and find time to do it.

> I thought I had made the changes correctly but now getting an unexpected vision error that I don't know how to fix.

>

This in itself does look good! Press the yellow step button () to advance to the next shot, where it isolates the single pin on the opposite.

It might help to rewatch the video (again, sorry for the stuttering):

https://youtu.be/P-ZudS7QQeE?t=296

At 5:45 you see how it also uses two bracketing shots to nail down the part, that's the whole trick of using Multi Shot vision:

  + 

Maybe it fails on the second shot, but you would have to document this best by using Test Alignment and sending the log.

Side Notes:

You should improve camera shading to remove bright elements. The whole area behind the nozzle tip (yellow hatching) should be shaded. With your light showing like that, you probably also need to crop away the sides (blue hatching), so only the center square is left.

Alternatively, you could use a longer (tele) lens, so the existing shade is filling the view vertically, you could then still crop horizontally.

See also:

https://github.com/openpnp/openpnp/wiki/Nozzle-Tip-Background-Calibration

_Mark

jamoiam

unread,
Nov 16, 2022, 1:38:46 PM11/16/22
to OpenPnP
Thanks Mark.... I did click the wrong button in error for replying, and of course then didn't have a copy of my reply. So thanks for re-pasting back here.

I think I see your points....I will look into this, and try again soon. Sorry, it sometimes takes a while to absorb all the finer points that are well known to you.

Re the image size and background noise/objects the camera is setup this way to place a large 35x35mm part. I do see this new method would have avoided the need to back off the camera and make the image larger. I am reluctant to move the camera back up as it took some doing and an awful lot of tweaking that now works well, except the SOT-23 triangle problem. I will have to add a rectangle mask to all my vision pipelines.

tonyl...@gmail.com

unread,
Nov 16, 2022, 5:15:50 PM11/16/22
to OpenPnP
I noticed that OpenCV has this function to compute the minimum area enclosing triangle.  It seems like it shouldn't be too difficult to create a pipeline stage using it that could correctly detect components with a triangular arrangement of leads.
Reply all
Reply to author
Forward
0 new messages