Camera light idea ?

733 views
Skip to first unread message

mojalovaa1

unread,
Apr 21, 2016, 4:47:37 AM4/21/16
to OpenPnP
Hi
I wont design LED light for visual control on PnP machine .

Now after search  one hundred  design  I m total confused what will be the best options for DIY .
Today is come LED  who I m buy on EBAY  : http://www.ebay.com/itm/291644572734?_trksid=p2060353.m2749.l2649&var=590678075291&ssPageName=STRK%3AMEBIDX%3AIT

After search and look what will be the best  for DIY  , I m stay on 2 possible options  , one is direct LED ring and second is low angle LED ring  or hexagon .

Please if you have idea , image  from yours visual on openpnp and  image for light  , suggestion   you can write here .


mojalovaa1

unread,
Apr 21, 2016, 7:03:03 PM4/21/16
to OpenPnP
I m attach one options for camera light with low angle light , second is  normal direct LED light .
On this image plane is use 2835 RED LED , 24 pcs  3,2V 10 mA , that is  0.03W ot total 0.72W .
Jason have you  idea for this power , that will be enough or maybe is better use LED 0.5W or 0.2W , I have PWM control on machine for light ?
camera light in housing.png

Anthony Webb

unread,
Apr 21, 2016, 7:05:44 PM4/21/16
to ope...@googlegroups.com
Jason had a cool idea using a flexible PCB in the shape of a cone.  Easy to assemble and very even lighting.  Roll it up and drop it into a 3D printed case and you are done.  I'd like to see that one in action.

--
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 post to this group, send email to ope...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/1bf81ed7-961f-40b6-9db2-9253ed2be6a8%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Jason von Nieda

unread,
Apr 21, 2016, 7:07:26 PM4/21/16
to ope...@googlegroups.com
Hi Moja,

I think this looks good. I don't know if the power is correct or not. I don't really know how to estimate that.

Jason


--

Michael Anton

unread,
Apr 21, 2016, 7:17:29 PM4/21/16
to OpenPnP
You may not want to use PWM to vary the brightness.  I'm pretty sure I read somewhere on here that that can mess up the cameras.  So, instead, you may want to look at linear control, rather than PWM.

Mike

Jason von Nieda

unread,
Apr 21, 2016, 7:18:55 PM4/21/16
to OpenPnP
PWM at KHz frequencies definitely messes with the ELP cams. WS2812 LEDs, for instance, make a mess of the image. I've been told that PWM in MHz frequencies (like in LED backlights) should be fine but I have not verified it.

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 post to this group, send email to ope...@googlegroups.com.

mojalovaa1

unread,
Apr 21, 2016, 7:25:18 PM4/21/16
to OpenPnP
Anthony , flexible pcb can  make problems  when LED  start heat self , and if glue is not some  high quality then have problems , and all so  then LED not have light on same way  and angle , that can make problems on work .
Jason , I have this RED LED like I m say and all so have  5730 LED white  , if RED  will not have  enough light I will make second with 0.5W 5730 LED  , that will be max 12 W  light and use PWM control.
Michael , on machine use PWM  , and all so plane is use it , maybe  not on start when make some test but  be sure that PWM on my machine will be used .
 

Michael Anton

unread,
Apr 22, 2016, 5:21:52 AM4/22/16
to OpenPnP
As long as you understand that slow PWM frequencies will mess up your camera as Jason stated.  That is what I was trying to tell you.  If you PWM in the MHz range you will probably be ok.  Linear control of LED current is pretty easy too (though there is wasted power as a result), and does not cause problems for cameras, so I'm not sure why you wouldn't consider that as well.

Mike

Paul Jones

unread,
Apr 22, 2016, 5:25:47 AM4/22/16
to ope...@googlegroups.com

If you use a switching power supply in constant current mode you get the best of both world, with no flicker.

 

Paul.

 

--

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 post to this group, send email to ope...@googlegroups.com.

Malte R.

unread,
Apr 22, 2016, 6:27:27 AM4/22/16
to OpenPnP
Hey,

I published the Gerbers for my hexagonal LED lights a while back:
http://malte-randt.de/hexagonal-led-light/

I also published a 3D-printable mount for the boards and a Logitech C270 webcam - but you could easily combine the top parts with any camera you like:
http://malte-randt.de/improved-3d-printable-camera-mount/

With regards to driving the LEDs:

- Problem is referred to as "CMOS rolling shutter effect", just google that ;-)

- Basically you need to use switching frequency fast enough to not fool the camera; from my experience anything above 20kHz is fine - faster does not harm.

And beware: Most switching power supplies and even some of the common voltage regulators also introduce switching voltage ripple high enough to cause problems.

Best practice is to have a large cap after your power supply and use a proper LED driver chip with fast PWM capability to adjust brightness.

Check out this page - very helpful to select a driver chip:
http://www.dcdcselector.com/

Have fun!

Malte

Michael Anton

unread,
Apr 22, 2016, 6:33:18 AM4/22/16
to OpenPnP
That sounds like a good plan.  Proper filtering should allow it to work ok.  An LC circuit may be even better than just bulk capacitance.

Mike

mojalovaa1

unread,
Apr 22, 2016, 7:24:38 AM4/22/16
to OpenPnP
Malte R. do you have some image with that camera and that light ?

If you have some image that will be very usable for see .

 

Paul Jones

unread,
Apr 22, 2016, 8:00:20 AM4/22/16
to ope...@googlegroups.com

The output ripple can be adjusted by changing inductor and capacitor values, so you should be able to easily get less than 1% ripple even without a filter. Depending on the controller IC sometimes it’s not a good idea to add a filter anyway as it messes with the feedback control loop. Even too much capacitance can do it.

 

 

Paul.

 

Mark Harris

unread,
Apr 22, 2016, 10:09:14 AM4/22/16
to ope...@googlegroups.com
I designed an octagon light for 32mm board cameras:

It should be 4000 lumens, but has current limiting ICs on it so you can bring that down if you want - each wedge has the ability to be individually dimmed/switched off so I can optimise light for different packages to get the best machine recognition. The LEDs are focused at a point 55mm above the top of the camera board. This is so the bottom vision can be mounted under a table with a 1" wood top that is sitting on 2" high extrusion and not bottom out below, whilst having the light at an optimal angle to reduce reflections back to the camera and limit lighting of the area above the part in view for easier machine vision.

mojalovaa1

unread,
Apr 22, 2016, 10:21:09 AM4/22/16
to OpenPnP
Mark this look nice , you are use  LED driver IC for control PWM or only for CC mode ?
Have some one  image with that tip LED light  on real , that can see how look  image of components with that tipe LED light ?

Mark Harris

unread,
Apr 22, 2016, 10:28:31 AM4/22/16
to ope...@googlegroups.com
Its an LED driver IC to keep the current limited, very cheap - but it supports an input to switch it off for dimming, so you can do high speed PWM with them if you want.

On 22 April 2016 at 08:21, mojalovaa1 <moja...@gmail.com> wrote:
Mark this look nice , you are use  LED driver IC for control PWM or only for CC mode ?
Have some one  image with that tip LED light  on real , that can see how look  image of components with that tipe LED light ?

--
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 post to this group, send email to ope...@googlegroups.com.

mojalovaa1

unread,
Apr 25, 2016, 12:45:27 PM4/25/16
to OpenPnP
Hi folks 

Today I m test camera and light  for my new PnP machine .

http://imgur.com/a/eayYA/all



All so I m make some image , if Jason can render it and see how that look for OpenPnP?
Image is make with difference buck ground color , white paper , white photo paper , blue mat paper , black mat colored paper  , orange paper  .

http://imgur.com/a/UKMOk/all

If have some suggestion  you can write me  , that will be help full on this moment ?




Jason von Nieda

unread,
Apr 25, 2016, 1:26:52 PM4/25/16
to OpenPnP
Hi Moja,

I'll take a closer look at these later in the week, but I can give you some quick feedback:

* Several of the images have very uneven lighting. Image 1 and 3 especially. This will make it hard to remove the background.
* The background is very bright, overall. Ideally you want the background to be as dark as possible and only the chip or pins to be bright. You may be able to improve this by changing the exposure of your camera, reducing the brightness of the LEDs or using a less reflective background.
* The images appear to be overexposed and washed out. In the images with the orange background, the orange color is desaturated, making it hard to use chromakeying to remove.

An ideal image would have these properties:
* Pins bright, everything else dark.
* If a background color is used it should be well saturated so that it can be keyed and removed.
* Lighting should be uniform with no significant bright spots.

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 post to this group, send email to ope...@googlegroups.com.

DAniel Dumitru

unread,
Apr 25, 2016, 2:34:38 PM4/25/16
to ope...@googlegroups.com
Could you please share the box details ?

REgarding highlighting only pins , do you have the option to try red led's ?

Daniel

On 25/04/2016 7:45 PM, mojalovaa1 wrote:
> Hi folks
>
> Today I m test camera and light for my new PnP machine .
>
> http://imgur.com/a/eayYA/all
>
>
>
> All so I m make some image , if Jason can render it and see how that
> look for OpenPnP?
> Image is make with difference buck ground color , white paper , white
> photo paper , blue mat paper , black mat colored paper , orange paper .
>
> http://imgur.com/a/UKMOk/all


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

mojalovaa1

unread,
Apr 25, 2016, 2:53:07 PM4/25/16
to OpenPnP
Daniel on this moment is not for share but after finishing all I will share some information that every one can DIY  similar camera box and light .

Jason this is image on normal color and with threshold 252 :  http://imgur.com/a/F6Rpq/all

Camera is like I m say before that I m buy : http://www.ebay.com/itm/181429280252?_trksid=p2060353.m2749.l2649&ssPageName=STRK%3AMEBIDX%3AIT
I use white LED 5050 package on this moment and camera have low angle light .
Total have 20 pcs 5050 LED .
Box is 3D printed .

Jason von Nieda

unread,
Apr 25, 2016, 4:18:42 PM4/25/16
to OpenPnP
Hi Moja,

Those images look reasonably good, although a threshold of 252 is very high. That only leaves you 3 grey levels to work with so I'd expect the results would not be very stable given a large number of inputs.

I'd try to work on getting your background to be darker and less reflective so you can use a lower threshold.

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 post to this group, send email to ope...@googlegroups.com.

Malte R.

unread,
Apr 26, 2016, 8:39:23 AM4/26/16
to OpenPnP
Sorry for the late response. Here are three pictures from the up-facing camera I use on my PnP.

It is the Logitech C270 in my 3D printed case; using red LED illumination in this case.

I switched to white light in the mean time but don't have any pictures with white light on my Laptop right now. Will post a few more later this week, if you're still interested.

First picture shows TQFP44 IC (image scaled down to 640x480), second the nozzle in orginal resolution and third one a mm-grid. Last picture shows that stock-lense of webcam has very little distortion.

Cheers
Malte
upcam_printed_mm_grid_original_resolution.png
upcam_tqfp44_scaled_to_640x480.png
upcam_nozzle_original_resolution.png

mojalovaa1

unread,
Apr 26, 2016, 9:11:34 AM4/26/16
to OpenPnP
Malte R. , what lens you have on that camera  , how much is distance  with lens and nozzle on that image ?

Jason  , what is the best parameters for image see on openPnP , how much threshold  and other  parameters need be ?


Malte R.

unread,
Apr 26, 2016, 9:26:58 AM4/26/16
to OpenPnP

Malte R. , what lens you have on that camera  , how much is distance  with lens and nozzle on that image ?

Stock plastic lense included with C270 - just cut away a bit of glue and then you're able to adjust the focus by turning the lense.

Camera is mounted underneath the table using my 3D printed holder with hex LED light (see links above).

Distance from camera to part is about 29mm - but could be further increased if you needed larger field of view.

Jason von Nieda

unread,
Apr 26, 2016, 12:21:47 PM4/26/16
to ope...@googlegroups.com
Moja,

Those parameters are all machine specific and you will have to experiment to find the best ones for your machine. Like I said earlier, ideally you will see only the pins in the filtered image. You want to adjust your thresholds, filters, masks, etc. until just the pins are visible.

Jason


On Tue, Apr 26, 2016 at 6:11 AM mojalovaa1 <moja...@gmail.com> wrote:
Malte R. , what lens you have on that camera  , how much is distance  with lens and nozzle on that image ?

Jason  , what is the best parameters for image see on openPnP , how much threshold  and other  parameters need be ?


--
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 post to this group, send email to ope...@googlegroups.com.

mojalovaa1

unread,
Apr 26, 2016, 12:30:15 PM4/26/16
to OpenPnP
Ok Jason , can you please for sample say me what mask and filters you are use  ?

If some one can write me  some parameter for  sample one of this image that will be  used and that give nice image for job?

http://imgur.com/a/vIHxH/all

Jason von Nieda

unread,
Apr 26, 2016, 12:33:06 PM4/26/16
to OpenPnP
Moja,

Please see https://github.com/openpnp/openpnp/wiki/Bottom-Vision#default-pipeline for a description of the default bottom vision pipeline that I use. This is what I use on my machine and it works well. You can see the individual parameters by starting OpenPnP and looking at Machine Setup -> Vision -> Bottom Vision -> Pipeline -> Edit. You can also use that to experiment with your own setup. 

I recommend that you read all of https://github.com/openpnp/openpnp/wiki/Bottom-Vision and https://github.com/openpnp/openpnp/wiki/CvPipeline to see how this all works and how you can customize it.

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 post to this group, send email to ope...@googlegroups.com.

mojalovaa1

unread,
Apr 26, 2016, 6:01:38 PM4/26/16
to OpenPnP
Thanks Jason , I m try use cv pipeline but on this moment I m not  make some  special  setup that is ok for my camera .

On this album have  some image that I m make with openpnp snapshot  , same component with min light and with max light , with same th  but for one is all so used desaturate   and  equalize  and after that th , but  that image is a lot worse .

http://imgur.com/a/BAbkc

Jason von Nieda

unread,
Apr 26, 2016, 6:56:54 PM4/26/16
to OpenPnP
Hi Moja,

The third picture in each series looks quite good. How did you achieve these? If you used CvPipeline, you can click the Copy button to copy the pipeline to XML and send it to me here.

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 post to this group, send email to ope...@googlegroups.com.

Daniel Dumitru

unread,
Apr 28, 2016, 3:04:47 AM4/28/16
to ope...@googlegroups.com
Moja,
Taking in consideration JAson's answers that software it's looking only for pins reflections, In this case specific, I consider that it's better to have direct lighting (led emision direction to be parrallel with camera direction of view).

Also an ideea would be to lighten the part with a wavelength that it's reflected most by part pins but here I have no ideea.

Kind regards,
DAniel

mojalovaa1

unread,
Apr 28, 2016, 3:42:24 AM4/28/16
to OpenPnP
Hi Jason
No , I m not use CV pipeline , I m try work with  that program but I not have allot time for look how do that .
I m use openpnp for make snap shoot  and then open it in GIMP , then on GIMP set  threshold only , and on other black image I m all so before threshold  use desaturate + equalize + threshold .

Daniel
I m before all so use direct LED light , then you have  very big light reflections and then need  have  some milk white plastic cover  , all so if LED  not have same intensity  , for sample have 2 ring with LED on same PCB  and then one   for some reason not have  same intensity like other  all so have big problems for make image .

On this moment I will test this way , after that I will all so test with direct LED light and  with other color and see  what is the best option .

If you are remember first image that I m add , this  is how look after  rendering on my friends  program : http://imgur.com/a/M1LgO

mojalovaa1

unread,
Apr 29, 2016, 6:53:28 PM4/29/16
to OpenPnP
And this is image that I m make in OpenPnP  :  http://imgur.com/a/GEhBE

On this  image I m use orange buck ground  , same quality is when use black or white or blue  and all so is same if use  min light or max light intensity .

I think that I m make quality package for camera + light + plastic box  , :)

Jason why you are have that allot filters  and other staff in CV pipeline ?
We use only 4  filters .

Jason von Nieda

unread,
Apr 29, 2016, 7:06:31 PM4/29/16
to OpenPnP
Hi Moja,

I use many filters because my machine has a lot of visual clutter above the nozzle. This causes too much extra stuff to appear in the image, so I filter it out. In addition, my lighting is not very uniform and has some hot spots.

I'm certainly open to more ideas, though. Can you share the code you are using?

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 post to this group, send email to ope...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages