Page 3 of 7

Re: Better Downward Camea

Posted: Tue Jun 02, 2015 1:16 pm
by mrandt
RinusDamen wrote:I can get the needle picture aligned centered, however in that case the needle is not in the middle of the view.
I'll have to try and rotate the camera 180 degrees to see if it's the camera's lens itself.
Maybe it is the lense mount (threaded ring screwed onto PCB) or even the lense itself? I would just try and tilt the PCB a little and see if that helps.

Also, I think it does not matter to much so don't worry. Once you apply visual filters, most of the picture is discarded anyway and you are really interested in 2D-picture of the needle tip or components anyway.

Re: Better Downward Camea

Posted: Tue Jun 02, 2015 3:51 pm
by mrandt
thereza wrote:I think there is a simple solution to your downcamera perspective issue. Simply support multiple calibrations at different heights. The needle probing can measure the height of the surface being probed, and all you need is a dot at any height to determine the scaling at that height.
Hey Reza, I really admire your ingenious work on the software and I am pretty sure Juha and other users do so as well ;-)

In addition to probing height and calibrating at different Z levels, we would probably need to also define parts / subspaces of the work area for which those measurements and calibrations apply. I am thinking along the lines of defining a few rectangles by providing e.g. top left and bottom right coordinate. If machine is positioned within these coordinates, it should assume a preset Z-level and apply corresponding calibration and pixel to mm ratio. So PCB area could have different Z-level and pixel to mm ratio defined than table surface, and one or more component pickup areas could again have another Z-level an ratio.

I think correcting for the perspective error makes most sense for component pickup though.

For homing, I could just elevate the mark to PCB level. PCB level itself will mostly be the the same, at least as long as I use standard 1.55mm PCB.

But the component tapes have different heights (thinking of electrolytic caps or connectors), so ideally I would create trays or feeders that bring top of the tape to same level as shown here:
Sketch showing tray with same surface level for different component heights
Sketch showing tray with same surface level for different component heights
same_surface_level_tray.jpg (26.39 KiB) Viewed 19702 times
This way, I only neet to compensate for one Z-level and not different Z-levels per component tape...

If you would try and have a go at this, I would much appreciate it and of course help with testing and devlopment as much as I can.

Thanks!

Malte

Re: Better Downward Camea

Posted: Tue Jun 16, 2015 8:44 pm
by thereza
with regards to part pickup, i think a simpler solution is to ensure the camera is centered - with a number of moves. Then you apply the needle offset plus needle wobble offset from the current location - and you should be right on the part. avoids the perspective issue. Takes additional steps, but it's the only way to ensure correct calibration.

Also for the needle, rather than re calibrating the needle height before a wobble measurement, the upcamera calibration is performed.

I'm also looking into measuring pickup errors using the upcamera - given components have a variable height that will affect measurements, the 'move till you are centered' approach will work here as well.

This way, the optical calibration doesn't have to be as accurate. The only other solutions would be to use 2 downward cameras to give some kind of steroscopic vision.

Re: Better Downward Camea

Posted: Wed Jun 17, 2015 5:35 pm
by mrandt
with regards to part pickup, i think a simpler solution is to ensure the camera is centered
I think that is correct. For picking up individual parts, that works fine.

But what about the tapes? Are you suggesting to detect the component in the tape pocket instead of the sprocket hole as currently implemented?
Also for the needle, rather than re calibrating the needle height before a wobble measurement, the upcamera calibration is performed.
Agreed.
I'm also looking into measuring pickup errors using the upcamera - given components have a variable height that will affect measurements, the 'move till you are centered' approach will work here as well.
This would be a very important feature, at least for me. I am looking to place TQFP 0.5mm pitch and also QFN 0.4mm pitch leadless ICs. I guess, accuracy would be much improved by moving it above the camera and compensating off-center and orientation error.
The only other solutions would be to use 2 downward cameras to give some kind of steroscopic vision.
Well, stereoscopic vision would be one way to go - I've seen some machines recently which had one camera oriented along the X and another one along the Y axis. Both cameras would look at the needle tip at an angle of about 30°. This way the computer vision could figure out X, Y and Z locations. But I guess there is a lot of algorithms, processing and tuning involved to make this work - out of my league unfortunately.

Another option would be to use a so called telecentric lense. Basically, these type of lenses optically compensate for perspective error and other distortions. Downside is they are expensive and relatively large.

So if we could solve the issues in software, that would be the easier and cheaper solution.

Re: Better Downward Camea

Posted: Fri Jun 19, 2015 3:05 pm
by mrandt
Juha's thoughts in another thread just made me aware of yet a new challenge:

When moving any component overhead the up looking camera, the Z-level might need to be corrected to have the component in focus and at a level with known pixel-mm ratio to take measurements. Currently, the needle is just lowered to the previously calibrated Z-level of the PCB surface. This is absolutely correct for needle wobble correction.

However, if I pickup a large electrolytic cap (maybe 8mm tall) or a thick IC (QFN) and move that to the camera, I need to hover it at a different, higher Z-level; which will be PCB surface level + component height.

As I am using custom trays for the components, the component height Z-level measured during pickup will never relate to PCB level.

LitePlacer software only knows the correct component height if I have ever placed the component on the board and thus it has measured place Z-level - so chicken and egg problem :|

Possible workarounds:
a) Manually input the component height per tape position or line item for individually picked components
b) Enforce placing each component to PCB once before any up camera measurements / pickup error compensation can be taken
c) Measure or input component tray base level as offset compared to table or PCB Z-level and measure + calculate correct offset during pickup for each tape position or line item

Any other ideas?

Re: Better Downward Camea

Posted: Fri Jun 19, 2015 10:58 pm
by thereza
But what about the tapes? Are you suggesting to detect the component in the tape pocket instead of the sprocket hole as currently implemented?
you'll center the camera over the holes to determine their location. my code computes the slope of the holes angle offset of the components and seems to work ok but sometimes is off by a tad - that's why i want the upcamera correction
Another option would be to use a so called telecentric lense. Basically, these type of lenses optically compensate for perspective error and other distortions. Downside is they are expensive and relatively large.
easier to move the needle fixed distances, measure the location on the camera and compute a spacial mapping - code exists in opencv to apply this correction in software.

Re: Better Downward Camea

Posted: Fri Jun 19, 2015 11:03 pm
by thereza
also we can compute the height of a component by picking it up, moving it to the a flat area, dropping it down and measuring when it triggers the needle switch vs. the needle w/o the part.

Re: Better Downward Camea

Posted: Sat Jun 20, 2015 7:23 am
by JuKu
The measurements are done from straight up, so perspective error matters only if it is too big compared to the asked accuracy so that the process does not find a solution. (The machine would try to move on top of the target, overshoot try again, overshoot again and so on.)

For this, the software could use thereza's automatic pixel size measurement and measure both pcb level and tape level. Also, needle calibration could be done at different levels too.

Re: Better Downward Camea

Posted: Sat Jun 20, 2015 2:34 pm
by mrandt
OK, pickup stays pretty much as it is today then. Center camera on sprocket hole, move machine by fixed offset, pickup component. Pixel-mm ratio does not matter much. Only the nice display of pickup locations that Reza introduced will be misleading if the calibration is off because of perspective error ;-)

Another idea that we have been poking with but a bit off-topic here: Wouldn't pick & place itself be much faster if we taught the machine first and last sprocket whole location for each strip? We could then calculate all the pcikup locations in between, assuming a strip is straight. I believe that should be accurate enough for passives. And for more complex components, we would probably need component measurement and alignment using up cam anyways.

Juha, your reply about straight up measurement assumes that we take the approach suggested by Reza for component centering (move until centered) - similar to optical homing and fiducial alignment? That way the pixel to mm ratio does need to be 100% right and perspective error would be compensated. Fine with me.

I still think that we need to know the height of tall components and hover them at a Z-level, so that the pins are at PCB level. Basically needle tip would be at PCB surface level + component height. This is not only relevant for perspective but for focus as well! I just tried with a large electrolytic cap which is about 8mm tall and the upcam image became blurry when needle tip was at PCB level. I know this is mostly because of my high res cams and optics, but I think higher resolution is necessary for fine pitch and potentially BGA at some point.

As I just posted in the other thread (http://liteplacer.com/phpBB/viewtopic.p ... rt=10#p458), I believe we should support both "blind" placing for passives and other simple components and up camera measurement and compensation for rotation and non-centered pickup alignment errors.

I would assume that we should put all these options in the "Setup tape position" dialog. In my mind, there should be for each row:
a) one checkbox to mark specific components for optical alignment (up cam measurment and compensation)
b) an extra button to measure component height and an input field that allows to tweak the value - similar to calibrating needle / PCB height but with a component underneath rather than a board
c) if we follow the approach of measuring first and last sprocket hole, additional button and coordinate column that sets "last hole" and a button that runs the measurement on first and last hole and calculates pickup locations - similar to fiducial measurement actually

For those components that are picked up from the pickup area, I would always enforce optical alignment as they will never be centered. In that case, the component height can easily be measured during pickup. If we used trays instead, I think we are back to "tape" positions - but I will post that in yet another thread.

Does this make sense?

Re: Better Downward Camea

Posted: Sat Jul 18, 2015 11:35 pm
by WayOutWest
thereza wrote: I tried my USB Camera (http://www.ebay.com/itm/2MP-USB-Digital ... 1c3d9ec20d) and it worked much better than the included one.
I would like to second thereza's recommendation here. I ordered the same camera after seeing his images, and WOW it is a really amazing camera. It seems to have a much higher framerate and less blur than the bundled camera, but it is more expensive. If you're looking for a ~$60USD camera upgrade, this is what you want.

Take care to look for the brand name "Andonstar" when buying. There are a lot of similar knockoff cameras with the same housing (on, e.g., ebay amazon etc), but there's no way to know if it's the same one unless the item description includes the brand name. Andonstar has their own USB VID which is burned into the device, you should see it when you plug it in.

Although the bundled cameras' resolution exceeds the mechanical accuracy of the machine, additional resolution is helpful for image recognition. Plus it's really handy to have a reasonably-powered microscope mounted on an automatic gantry; I'm looking forward to using this to stitch together high-resolution "sweeps" of items much larger than the field-of-view.