Troubleshooting Placement Accuracy

433 views
Skip to first unread message

Sebastian Pichelhofer

unread,
May 22, 2018, 7:12:38 AM5/22/18
to ope...@googlegroups.com
I started expanding this wiki page: https://github.com/openpnp/openpnp/wiki/Troubleshooting-Placement-Accuracy with my experience and tricks I learned in recent times.

In general I still find it quite a challenge to get placements to be 100% accurate all the time even though our machine is pretty high end...

Please help improve the above wiki page, please add your own best-practices and tricks.

What is your general experience with small part placement accuracy? Is anyone placing 0201 successfully?

Regards Sebastian




Cri S

unread,
May 22, 2018, 9:28:53 AM5/22/18
to ope...@googlegroups.com
Do you have a pcb with 4 fiducials ?

2018-05-22 13:11 GMT+02:00, Sebastian Pichelhofer
<sebastian....@gmail.com>:
> --
> 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/CAJ_3Q41H5hz9CMOBP8FHTNn6MZ9sne7Dm2TSufWkbjUhfC6zSw%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.
>

Cri S

unread,
May 22, 2018, 9:29:41 AM5/22/18
to ope...@googlegroups.com
if pcb is greater in size, it is better.

Michael G.

unread,
May 22, 2018, 11:01:56 AM5/22/18
to OpenPnP
great!
I had some issues with offsets on camera visioned parts and made a quick drawing (attached). would add it later...
camera_vision-offset.png

Sebastian Pichelhofer

unread,
May 22, 2018, 11:38:54 AM5/22/18
to ope...@googlegroups.com
Hi Michael

Very nice drawing!

Though I don't follow your argument.

Bottom vision has a separate unit per pixels value and the nozzle is centered to the bottom vision image center and only the offset of the component to the nozzle center is measured so the z height difference should not matter...
Please elaborate.

Regards Sebastian

--
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+unsubscribe@googlegroups.com.

To post to this group, send email to ope...@googlegroups.com.

Michael Gröne

unread,
May 22, 2018, 11:53:45 AM5/22/18
to ope...@googlegroups.com

hmm, was a fast shot, so lets try again:

#1: if you calibrate the x/y-offset position of one nozzle to the downlooking camera, the calibration has to be made for the pcb-layer. this is ensured automatically by using some clay, driving the nozzle into it and then measure the distance to the marker to the camera by commanding the camera to the place, the nozzle tip was before. (this is described in the wiki anywhere already). now if the z-axis is not 100% perfectly aligned, the calibration is only valid for the pcb-layer. below and above that layer, the nozzle has different offset to downlooking cam. one might keep that in mind if any elements (e.g. feeder are not in pcb-layer).

#2: if the nozzle is in center of bottom vision (focal layer), that is good. but if the camera or axis is not 100% perfectly aligned, the nozzle is out of center above/below focal layer. one could check that by bringing nozzle up and down and refocus the lens to see if it is still in center. but that problem will only become visible if focal layer is != pcb layer. to recommendation would be to have both layer be the same and keep that in mind while designing the machine. I had massive offset on parts, where bottom vision was used and think I had tracked it down to this.

You received this message because you are subscribed to a topic in the Google Groups "OpenPnP" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/openpnp/bMcTCErszQc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to openpnp+u...@googlegroups.com.

To post to this group, send email to ope...@googlegroups.com.

Cri S

unread,
May 22, 2018, 12:03:34 PM5/22/18
to ope...@googlegroups.com
Probably you problem was the clay as it thickness is too big to be useful.
If you do that way, use flour that you lay down using credit card and
papers as spacers.
using one or two sheets of paper as spacers. Then use two pcb, repeat
the process
and scale the offset in order to have a table where you could
compensate for pcb thickness.
>> send an email to openpnp+u...@googlegroups.com
>> <mailto:openpnp+u...@googlegroups.com>.
>> To post to this group, send email to ope...@googlegroups.com
>> <mailto:ope...@googlegroups.com>.
>> <https://groups.google.com/d/msgid/openpnp/0cb797ff-b334-4682-8d80-dc13b11d0026%40googlegroups.com?utm_medium=email&utm_source=footer>.
>>
>>
>> For more options, visit https://groups.google.com/d/optout
>> <https://groups.google.com/d/optout>.
>>
>>
>> --
>> You received this message because you are subscribed to a topic in the
>> Google Groups "OpenPnP" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/openpnp/bMcTCErszQc/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> openpnp+u...@googlegroups.com
>> <mailto:openpnp+u...@googlegroups.com>.
>> To post to this group, send email to ope...@googlegroups.com
>> <mailto:ope...@googlegroups.com>.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/openpnp/CAJ_3Q41aNj-geowsrOT9d8hZ%3D8c8gky9Se5y8qQRquEpKTKNng%40mail.gmail.com
>>
>> <https://groups.google.com/d/msgid/openpnp/CAJ_3Q41aNj-geowsrOT9d8hZ%3D8c8gky9Se5y8qQRquEpKTKNng%40mail.gmail.com?utm_medium=email&utm_source=footer>.
>> For more options, visit https://groups.google.com/d/optout.
>
> --
> 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/9bf2adc4-b2d6-dcd7-51b7-7cdbfcfa41d4%40groene.de.

Michael Gröne

unread,
May 22, 2018, 12:05:20 PM5/22/18
to ope...@googlegroups.com
actually I used flour directly on top of an old pcb ;)

Greg Wroblewski

unread,
May 23, 2018, 2:07:04 AM5/23/18
to OpenPnP
I used a trick that I have not seen mentioned so far. I placed a checkerboard marker next to the bottom vision pit, in the best place for downlooking camera to see it when the part is being aligned. That way I can very precisely tell how far away the head's position is from the marker, which is treated like an auxiliary zero point, and this happens at the same time when the part position and rotation is read. Then I add all readings into a single relative move and the head moves directly to the part's position. This requires precise reading of the fiducials at the beginning, especially relative to the checkerboard marker.

Initially I calibrated the marker so that the placement is very precise, regardless of the Z-axis misalignment or runout.

In the end I get repeatable accuracy better than 0.1mm, although using bottom vision for all components is painfully slow.

Greg

SMdude

unread,
May 23, 2018, 3:40:35 AM5/23/18
to OpenPnP
Hmmm, now you have given me an idea!
Place the homing fiducial as close to the bottom camera as possible, that way the camera won't move when the machine is used in hot/cold conditions.

I have found it most important to check and adjust the bottom camera each time I start the machine, though it has been much better since adding the homing fiducial at the home position.

Greg Wroblewski

unread,
May 23, 2018, 3:56:58 AM5/23/18
to ope...@googlegroups.com
Right, I also use the checkerboard marker to reset the coordinates for the bottom camera. I established them once, and right now before and during placing when I move to the bottom camera I restore the coordinates to the original values (they are usually off by no more than 0.25mm, rarely up to 0.5mm).

Greg


To unsubscribe from this group and all its topics, send an email to openpnp+unsubscribe@googlegroups.com.

To post to this group, send email to ope...@googlegroups.com.

Marek T.

unread,
May 23, 2018, 4:15:11 AM5/23/18
to OpenPnP
Do you find that coordinates change during working time when machine gets wormer of working?
Or do you rather feel they change during the day time general temperatures changing?
To unsubscribe from this group and all its topics, send an email to openpnp+u...@googlegroups.com.

To post to this group, send email to ope...@googlegroups.com.

Sebastian Pichelhofer

unread,
May 23, 2018, 4:25:55 AM5/23/18
to ope...@googlegroups.com
On Tue, May 22, 2018 at 5:53 PM, Michael Gröne <mic...@groene.de> wrote:

hmm, was a fast shot, so lets try again:

#1: if you calibrate the x/y-offset position of one nozzle to the downlooking camera, the calibration has to be made for the pcb-layer. this is ensured automatically by using some clay, driving the nozzle into it and then measure the distance to the marker to the camera by commanding the camera to the place, the nozzle tip was before. (this is described in the wiki anywhere already). now if the z-axis is not 100% perfectly aligned, the calibration is only valid for the pcb-layer. below and above that layer, the nozzle has different offset to downlooking cam. one might keep that in mind if any elements (e.g. feeder are not in pcb-layer).


#2: if the nozzle is in center of bottom vision (focal layer), that is good. but if the camera or axis is not 100% perfectly aligned, the nozzle is out of center above/below focal layer. one could check that by bringing nozzle up and down and refocus the lens to see if it is still in center. but that problem will only become visible if focal layer is != pcb layer. to recommendation would be to have both layer be the same and keep that in mind while designing the machine. I had massive offset on parts, where bottom vision was used and think I had tracked it down to this.


I still do not follow, the issue you are describing does not exist in my opinion....

Regards Sebastian
To unsubscribe from this group and all its topics, send an email to openpnp+unsubscribe@googlegroups.com.

To post to this group, send email to ope...@googlegroups.com.

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

Sebastian Pichelhofer

unread,
May 23, 2018, 4:32:28 AM5/23/18
to ope...@googlegroups.com
On Wed, May 23, 2018 at 8:07 AM, Greg Wroblewski <greg...@gmail.com> wrote:
I used a trick that I have not seen mentioned so far. I placed a checkerboard marker next to the bottom vision pit, in the best place for downlooking camera to see it when the part is being aligned. That way I can very precisely tell how far away the head's position is from the marker, which is treated like an auxiliary zero point, and this happens at the same time when the part position and rotation is read. Then I add all readings into a single relative move and the head moves directly to the part's position. This requires precise reading of the fiducials at the beginning, especially relative to the checkerboard marker.

You mean you created a kind of "homing" fiducial seen by top vision for calibrating the bottom vision nozzle position correct?
And you do not use this to center the nozzle in bottom vision but you add additionally measured offset to the placement offset correct?
A very interesting idea!

Did you create custom code to support this?

To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+unsubscribe@googlegroups.com.

To post to this group, send email to ope...@googlegroups.com.

Sebastian Pichelhofer

unread,
May 23, 2018, 4:36:15 AM5/23/18
to ope...@googlegroups.com
Btw. machinekoder made a PR adding a vision pipeline for visually auto centering the nozzle in bottom vision but it was not merged by Jason: "I think this is a fix for a machine specific setup problem and it doesn't add a lot of value for most users."

Maybe it's time to reconsider?


Regards Sebastian

Trampas Stern

unread,
May 23, 2018, 7:27:44 AM5/23/18
to OpenPnP

So a few things I had done...

steps per pixel
I take an image from top camera of the PCB and then move 1mm in the X and take another image of PCB. Then using the two images I calculate the X & Y translation of the images.  If I have a Y movement I know my camera rotation is wrong, I actually determine the camera rotation this way. The X pixel translation in the two images and the fact I moved 1mm allows me to know the mm per pixel. I repeat for Y. 

The Z axis perpendicular movement
The Z axis movement as was stated needs to be perpendicular to the PCB plane.  This has nothing to do with nozzle run out, but can easily be confused by newbie.  The fact is that the top (looking down) camera has a focal point and you need to keep your PCB, feeders, etc on the Z plane where the camera focal point is. If you are changing Z height (feeders at different height than PCB) you will have problems, not just with the perpendicular Z axis movement but with camera focal point.  
Since the up looking camera has a focal plane as well it should be adjust to same Z location as when nozzle is touching PCB.  Note some might try to check that Z axis is perpendicular to build plane by moving nozzle up and down while looking at it the bottom up camera. This does not work unless the up looking camera is perpendicular to the build plane.  Hence it is best to use a square and check your Z axis slides being perpendicular to build plane at multiple points on build plane. 

Nozzle run out
Calibrating the nozzle run out has to be done. Here you have to do this each time you power on and rotate the nozzle in up looking camera to calibrate run out, else it is hard to pick parts reliably. That is nozzle can be so far out that at certain rotations it will miss feeders for 0402 parts. However when it pick parts and does the up looking rotation and alignment it will correct the error.  Hence it is easy to be confused as to why sometimes the machine picks parts and places perfect and other times it does not. 

Machine squareness. 
I found that my machine squareness varied with position. Hence on large PCBs placement errors were good near home but off as you got further away.  I was working on an inspection system to adapt the machine parameters. That is I pick a part, check in up camera for alignment and rotation, then place part.  After which I would inspect placement using down looking camera. If the part was off I would note the error and then see if there was a correlation to the position of PCB.  On machine, if so correct.  I did not get this fully working. 

Part Release
I also found that how the part is released makes a difference, just turning off vacuum was not enough. Adding some puff of air helps but too much and it blows parts off.  Hitting PCB too hard with nozzle causes problems too. Hence tweaking the part release is critical to good placement.  I found that with double stick tape on the PCB I could place parts very very well, but with solder paste they would be off. This was due to part release (hitting PCB too hard or no puff of air). Hence I recommend everyone use double stick tape for testing machine and get that to work first. If that works perfect then they know the problems with real boards are most likely in the part placement/release system.  For me I found that without vacuum sensor, the nozzle might fail to pick part, then I put nozzle down on PCB with no part and plug the nozzle with solder paste. You need a puff of air and vacuum sensor to help prevent plugging nozzles.

My conclusions on the hardware design were:
1. squareness and perpendicular machine can not be fixed in software!  Use only rigid parts (ie metal) parts, else you will face problems. Test this before installing OpenPnP or turning on cameras. 
2. Nozzles need to have encoders for rotation, to help with nozzle run out. 
3. Need vacuum sensors and puff of air.  
4. Ideally the nozzles would have on-the-fly up looking cameras - This is very complex for software and hardware but would be the best and fastest system for small parts. 

I also found that there are two types of builders. Those that have a better idea, like me, who usually fails to get something really working (like me). Then their are the ones to who learns from others and makes something using known proven parts and designs (be sure they are proven designs). The second ones are the ones that want a PnP for what it does, the first want to build something for the fun of it and may not ever get it working.  I know I have spent $4k-$5k on my home built PnP and countless hours, and never got it fully functional. In retrospect buying a Chinese PnP and converting to OpenPnP would have saved me lots of time and money.  I also bet that everyone who has a good working machine has spent more than $5k on it, either in parts or labor.  

Trampas



 

Cri S

unread,
May 23, 2018, 10:13:27 AM5/23/18
to ope...@googlegroups.com
Hi Trampas, i probably remember that you use python.
Can you use .bsh (beanshell) as scripting ?
> --
> 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/b8b733be-5cdb-4636-a9f6-482de8984479%40googlegroups.com.

Cri S

unread,
May 23, 2018, 10:56:09 AM5/23/18
to ope...@googlegroups.com
Otherwise you surely could traslate it to python.

Basically find out distance.
move it to any other position and find out distance of fiducials.
You must check that fiducial distance and pulley distance should be
compatible with this check.
Basically move the pcb several times 20mm to the right (depending on
pulley size)
and you see the error the pulley is responsable. This for X.
Move only in supersteps, ie using only the check_fid_move but without any
squareness correction or backlash correction.

If the error is negligible, ok, otherwise you must measure out the
error at least inside
the pcb area and check the uplooking camera position using flour and
using fiducial
as placing part with pipeline for nozzle recognition and 0.000001 mm
part height.
Then apply the correction to the camera setup (crop) in multiplies of 8 pixels.
check_fid.bsh
check_fid_move-x.bsh
check_fid_move-y.bsh
check_fid_move_x.bsh
check_fid_move_y.bsh

Jason von Nieda

unread,
May 23, 2018, 9:22:19 PM5/23/18
to ope...@googlegroups.com
I'm open to reconsidering this, but I'd like to see it as a finished feature - not a building block. The PR did not have any specific functionality that a user might use aside from verifying something during setup. The same thing can be accomplished pretty easily as a script. 

If you / machinekoder turn this into a full nozzle calibration feature or something like that I'd be happy to include 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.

Marek T.

unread,
May 24, 2018, 3:21:26 AM5/24/18
to OpenPnP
Full nozzle calibration feature would be really great step ahead, valuable (important and usable) as much as prerotate option... All the problems with Chinese runouts have gone would be amazing...

Cri S

unread,
May 24, 2018, 5:53:25 AM5/24/18
to ope...@googlegroups.com
Nozzle calibration was present a long time before prerotate and is
still present.
There is a small bug on table lookup, relevant only for a small angle,
otherwise it works
as is. The implementation have side effects that the user need to be
aware, however it
works.
Otherwise for precise pickup of very small parts, the pickup need to
be done at angle 0.
Pr #6t05 as example does this.
> --
> 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/0e8e3681-70b5-47a5-baa5-5ec2c71735ce%40googlegroups.com.

Cri S

unread,
May 30, 2018, 7:16:00 AM5/30/18
to ope...@googlegroups.com
Fine pitch assemble for production environment require 60pixel/mm for 01005 and
40pixel/mm for 0201 (all imperial measures). For prototyping the
requirement is 60% of that
for production machines. This is 34pixel/mm and 24pixel/mm respective.
Further it require 30 theets and 32 microstepping or 20 theets and 16
microstepping for 2mm gt2 belt or better.]]

Greg Wroblewski

unread,
Jun 7, 2018, 2:49:50 AM6/7/18
to OpenPnP
Correct, I have custom code for everything. In addition this solves the runout problem, because the flow goes like this:

1. Pick up the part.
2. Move above the camera, while rotating to the desired angle.
3. Align head using the checkerboard marker.
4. Read the part angle, correct part rotation.
5. Read XY offset of the part.
6. Use the offset to adjust the movement for the placing.

It's slower, but very precise. (5) being after the part rotation can accommodate runouts.

Greg

Cri S

unread,
Jun 7, 2018, 3:24:11 AM6/7/18
to ope...@googlegroups.com
How do you align with chessboard pattern.
You get over 30 sub pixel accurate corners.
How do you correlate over it?
To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+unsubscribe@googlegroups.com.

To post to this group, send email to ope...@googlegroups.com.

Greg Wroblewski

unread,
Jun 7, 2018, 4:17:33 AM6/7/18
to ope...@googlegroups.com
The pattern is just four squares 2x2mm: two black and two white. The algorithm looks for the center of the pattern, by subtracting pixels on opposite diagonals, then calculating sum. The minimum of the sum indicates where the center is. This is only for adjusting inaccuracies <0.5mm, but one could probably expand the same idea for general positioning of the head over the bottom camera.

Greg


To unsubscribe from this group and all its topics, send an email to openpnp+unsubscribe@googlegroups.com.

To post to this group, send email to ope...@googlegroups.com.

Sebastian Pichelhofer

unread,
Jun 7, 2018, 4:19:16 AM6/7/18
to ope...@googlegroups.com
Very interesting, did you upload your custom code somewhere already?

Regards Sebastian

ma...@makr.zone

unread,
Jun 7, 2018, 4:33:30 AM6/7/18
to OpenPnP
Hi

I will be trying to do this with my machine:


(please excuse the hand-drawn quick sketch)

Has this ever been tried?

The ring would have to be from thin material or bevelled to make the upper edge visible from the bottom camera.

I think together with nozzle calibration (2) it would be the end of all head to camera inaccuracies. Or am I mistaken?

_Mark
Auto Generated Inline Image 1

Cri S

unread,
Jun 7, 2018, 6:55:31 AM6/7/18
to ope...@googlegroups.com

It is the same as 'prerotate' does. The addition of 2x2 square pattern , that effectively return one single result edge with subpixel accuracy gives you indication if you have step loss.
Naybe that is effectivly slow templatematch could give the same without subpixel accuracy.

Cri S

unread,
Jun 7, 2018, 7:39:46 AM6/7/18
to ope...@googlegroups.com
@Mark
The ring is not needed.
Do you work with the official source without modifications? 

ma...@makr.zone

unread,
Jun 7, 2018, 9:35:30 AM6/7/18
to OpenPnP

The ring is not needed.

Why not?

Let me be more specific how this is supposed to work:

  1. The down looking camera can get a position reference of the ring in the PCB plane.
  2. The up looking camera can get a position reference of the ring in the PCB plane.
  3. Because the ring is in the PCB plane, it is focused from both cameras.
  4. Because the ring is in the PCB plane, any camera axes being non-square (non-zero pitch and yaw) are irrelevant.
  5. Because we look at the ring and not the nozzle tip, any run-out of the latter is irrelevant.
  6. The ring does not have to be perfectly centred or perfectly round. Any offset or imperfection will be present in both the up looking and down looking vision (assuming the very ring edge can be correctly determined). As the up image is already mirrored before it is processed by vision, these coordinates are not even sign reversed.
  7. Therefore the true position of the bottom camera can be automatically calculated without user intervention.
  8. With the true position of the up camera known, we can do nozzle tip calibration (only a rough down looking camera to nozzle offset is needed). 
  9. This will work, even if the zero C position is not known when powering the machine (not true in the current implementation).
  10. The centroid of the vision-recognised nozzle tip positions at stepped C rotation angles is the true centre of the nozzle.
  11. Therefore the true down looking camera to nozzle offset an be automatically calculated without user intervention. No more Silly Putty.
  12. The machine will place perfectly even without bottom vision. Only the pickup inaccuracies remain.
I don't see a similar solution without such a common reference like the ring.


Do you work with the official source without modifications?

This is only planned. It is clear that it will need new vision pipelines for the ring and new code in the homing and in the nozzle calibration code.

_Mark


Greg Wroblewski

unread,
Jun 8, 2018, 4:09:50 AM6/8/18
to ope...@googlegroups.com
Yes, here is the code:


It's basically calling the same find_min_rect() that has been discussed many times already, but twice, with rotation correction in between. At the end it calculates the total part offset that later gets added to the part coordinates.

Greg


Reply all
Reply to author
Forward
0 new messages