Can't figure out camera to needle calibration

RMM
Posts: 20
Joined: Sat Oct 24, 2015 9:02 pm

Can't figure out camera to needle calibration

Post by RMM »

I've been trying to get my LitePlacer working, and I've been having trouble getting it working right.

I can run the needle calibration routine and get the camera lined up spot on the impression the needle left, then go to place a component and it the needle will miss the component pickup by ~1 to 2mm every time. It either misses the component completely, or grabs it on the very edge. I have the up looking camera working correctly, and the vision correctly finds the center of the component hole and the component with the tape test functions, but I'll be darned if I can get it to pick up a component correctly. It just won't do it--and these are 0805 components.

The only thing I can think of is that when I do the uplooking camera calibration then come back to it, the needle is always ~0.1mm-0.2mm off-center from where I thought it should be. Manually adjusting the values seems to be inconsistent, and something else has got to be wrong for the automatic calibration routine to be so off.

I've tried everything I can think of, including setting up the machine from scratch all over again just to make sure everything is right, but after 12+ hours of frustration I am at the end of what I know to look for and do. The cameras are tight and well-adjusted. Any suggestions?
Spikee
Posts: 115
Joined: Wed Mar 04, 2015 9:49 am

Re: Can't figure out camera to needle calibration

Post by Spikee »

Same problem here, trying to fix it now.

Using automatic (both were spot on):
x98.6 mm offset (im using other cam)
y 33.80

Manually (always home first + needle cal)
x99.048
y33.74

Y seems consistent , x seems to be always off.

Edit:
erm wut... still off!

I saved the needle cal spot using one of those customizable buttons. When I use that at the location that I calibrated the needle on it is spot on!
But when I go back to the center of the 0603 capacitor with the cam and calculate the offsets they are the same as posted above. But
when i use needle to cam on that spot it is off. Something fishy going on with the needle wobble calibration?

measured again manually:
cam:
x32.202
y1.560

needle (center of 0603 cap):
x131.250
y35.300

cam to needle offset:
x= 131.250 - 32.202 = 99.04800
y=35.3 - 1.560 = 33.74
This confirms that he previously calculated offsets were correct.

But! after I do the needle wobble calibration these values are off.

I'm gonna recheck my pixel per mm of the up cam now ... maybe there is the offset?

-- edit up cam box was set at 3mm , was 6.5 mm in practice. I have moved the thing about a bit so this could be causing miscalculated needle wobble -> error is picking.
Testing now

--edit edit
This did not help error according to cal needle is off about 0.05mm which is not big enoug of an error.
Going to needle 0603 cap loaction (using button) and going down is perfect hit.
Using button to goto center of 0603cap is spot on. Manual calculations are spot on.
Yet the pickup this is off.

Needle on center of cap:
Image
Image

Camera on center of cap:
Image

Where it actually hits:
Image

Settings in needle offset:
Image

Where is this offset coming from???
  • A: 0.000, X: 1.901, Y: 2.210
    A: 22.500, X: 1.820, Y: 2.275
    A: 45.000, X: 1.804, Y: 2.145
    A: 67.500, X: 1.820, Y: 2.048
    A: 90.000, X: 1.853, Y: 1.983
    A: 112.500, X: 1.918, Y: 1.918
    A: 135.000, X: 1.983, Y: 1.885
    A: 157.500, X: 2.048, Y: 1.885
    A: 180.000, X: 2.113, Y: 1.934
    A: 202.500, X: 2.145, Y: 1.983
    A: 225.000, X: 2.178, Y: 2.048
    A: 247.500, X: 2.178, Y: 2.113
    A: 270.000, X: 2.161, Y: 2.178
    A: 292.500, X: 2.113, Y: 2.226
    A: 315.000, X: 2.048, Y: 2.259
    A: 337.500, X: 1.966, Y: 2.243
    A: 360.000, X: 1.885, Y: 2.210
If those are the x/y offsets for a certain degree of rotation than that is off by quite a lot!

Needle:
Image

filter:
Image

This is interesting! the needle is not centered when at the height that the calibration used:
Image

Actual zero:
Image

filter + measurement now:
Image

More refinement:
Image

Final measurement
Image

Running needle cal:
  • A: 0.000, X: -0.049, Y: -0.016
    A: 22.500, X: -0.111, Y: -0.065
    A: 45.000, X: -0.133, Y: -0.143
    A: 67.500, X: -0.159, Y: -0.195
    A: 90.000, X: -0.111, Y: -0.273
    A: 112.500, X: -0.049, Y: -0.309
    A: 135.000, X: 0.016, Y: -0.338
    A: 157.500, X: 0.068, Y: -0.341
    A: 180.000, X: 0.146, Y: -0.306
    A: 202.500, X: 0.208, Y: -0.247
    A: 225.000, X: 0.228, Y: -0.195
    A: 247.500, X: 0.228, Y: -0.130
    A: 270.000, X: 0.215, Y: -0.049
    A: 292.500, X: 0.146, Y: 0.000
    A: 315.000, X: 0.085, Y: 0.003
    A: 337.500, X: 0.016, Y: 0.016
    A: 360.000, X: -0.049, Y: -0.013
Much better

Now it hits the correct spot 100% of the time!

Moral of the story:
1. Check the mm/pixel value of your up cam
2. Set the Up camera center at the height it actually measures at. In my case z= 37.761 when it does automatic measurement.

Things to change in software:
Make sure step 2 is included at the needle setup calibration (and when setting up cam location).
Last edited by Spikee on Thu Oct 29, 2015 1:31 am, edited 11 times in total.
RMM
Posts: 20
Joined: Sat Oct 24, 2015 9:02 pm

Re: Can't figure out camera to needle calibration

Post by RMM »

Still working on it, but now my machine has another problem where the Z axis causes the connection to break with any small jog movements, (F11 or F12 or F11/F12+shift). The machine head doesn't move, the program hangs, then throws up error: "CNC-Z: Timeout / CNC connection cut!" Homing and bigger Alt+F11/F12 movements still work. All other homing and movements still work. \
Spikee
Posts: 115
Joined: Wed Mar 04, 2015 9:49 am

Re: Can't figure out camera to needle calibration

Post by Spikee »

RMM wrote:Still working on it, but now my machine has another problem where the Z axis causes the connection to break with any small jog movements, (F11 or F12 or F11/F12+shift). The machine head doesn't move, the program hangs, then throws up error: "CNC-Z: Timeout / CNC connection cut!" Homing and bigger Alt+F11/F12 movements still work. All other homing and movements still work. \
Have you tried the latest software ? Two versions ago there was a problem like that because Juka's Z settings were much higher than normal. Causing the software to give an timeout error.
mrandt
Posts: 407
Joined: Mon Apr 27, 2015 10:56 am
Location: Stuttgart, Germany

Re: Can't figure out camera to needle calibration

Post by mrandt »

Hey,

errors like these are a bit tricky. Glad you could fix it! :D

My usual approach:

1) use ruler to make sure that machine travel is accurate in X and Y direction (moving machine by 20mm in software must match 20mm in reality...)
-> check software settings for steppers, acceleration, etc.
-> check mechanics like belts, rails, eccentric spacers, pulleys, gears
-> make sure current settings for motors are good and no steps missed / motors do not stall

2) check position repeatability: jog camera above a mark, move 100mm right (X+), then forward (Y+), then left (X-), then backward (Y-) - camera should be exactly above the mark again
-> check same as in 1)
-> also check mechanical squareness

If (and only if) mechanics work nicely, go on with calibration.

3) Home machine (!)

4) calibrate needle height / Z-level for PCB surface - it is important that up camera measures needle tip at correct height

5) calibrate pixel-to-mm ration for both cameras - and make sure to do so at correct Z-levels (otherwise you have projection / zoom errors)

6) calibrate needle-camera distance - I put a piece of carbon paper (remember making multiple copies on typewriters?) on the table surface and lower the needle so it leaves a mark. If I position camera above said mark, I know the exact offset

7) set needle position above up-camera (at PCB surface Z-level)

8) calibrate for needle wobble

9) manually test "pick up this" and "place here" and make sure to rotate components (A+ / A-) during the tests


If you fail to perform any of these steps or change the sequence, placement will be inaccurate.

@Juha As previously discussed, this is yet another example how porting px-mm calibration from rmod and adding a "calibration wizard" would greatly improve user experience ;)

Have fun!
RMM
Posts: 20
Joined: Sat Oct 24, 2015 9:02 pm

Re: Can't figure out camera to needle calibration

Post by RMM »

I am able to successfully pick up and place a part multiple times with it remaining centered, but if I rotate the part it still ends up skewed. This means that my problem is still with the wobble calibration. I am following the instructions set forth in this thread but there is still something off.

I've got a better camera setup now and am trying again tonight. Stupid question, but what way should the uplooking camera be oriented? It seems like it would be easy to get it upside down. There are no clear pictures or instructions regarding this crucial point in the setup instructions.

Is this upside down? If I push F5 the needle moves left relative to the center point.
Image

As a side note, this rule is propped up on my 1.6mm MCPCBs to get the correct measurement offset.
mrandt
Posts: 407
Joined: Mon Apr 27, 2015 10:56 am
Location: Stuttgart, Germany

Re: Can't figure out camera to needle calibration

Post by mrandt »

Hi,

without knowing how your ruler is oriented on the table, it is hard to tell wether orientation of up-cam is correct ;-)

You can easily check, function keys should move needle tip in image as shown in this drawing I made:
mrandt_liteplacer_upcam_orientation.png
mrandt_liteplacer_upcam_orientation.png (18.82 KiB) Viewed 7868 times
I described an alternative method to measure box size without a ruler this other post:
http://liteplacer.com/phpBB/viewtopic.p ... =189#p1242
Another approach that works well for me is to move needle overhead up camera, lower the needle to PCB level, jog the needle tip to the lower left corner of the box, note X and Y coordinate, jog it to upper right and note X and Y again - with simple substraction you can now figure out exact box dimensions. RMod (Ver2) of software does this automatically by the way.
Regards
Malte
RMM
Posts: 20
Joined: Sat Oct 24, 2015 9:02 pm

Re: Can't figure out camera to needle calibration

Post by RMM »

Thank you for the reply, it is greatly appreciated. I did note that "If I push F5 the needle moves left relative to the center point." That said, it appears that my camera is oriented correctly.

I had never thought about using the needle like that. When I measure using the needle movement I get measurement values of X=7.1mm and Y=13.6mm. That Y value is quite surprising. I measured it twice just to be sure. I am going to try a few pick, place, and rotate right now after a new needle calibration.

Update: It didn't work and my calibration is still totally messed up. With the Y axis at the 0 degree position pick and place works great, but at 270 it will completely miss an 0805 component by about an entire component length. The Y=13.6mm calibration is obviously wrong for the machine, even though the needle does move that much (I suspect that the perspective error is huge).

This is my latest calibration data (X=7.1mm; Y=13.6mm):
A: 0.000, X: 0.266, Y: -0.578
A: 22.500, X: 0.096, Y: -0.061
A: 45.000, X: -0.082, Y: 0.000
A: 67.500, X: -0.249, Y: -0.068
A: 90.000, X: -0.398, Y: -0.252
A: 112.500, X: -0.483, Y: -0.537
A: 135.000, X: -0.525, Y: -0.959
A: 157.500, X: -0.472, Y: -1.176
A: 180.000, X: -0.373, Y: -1.489
A: 202.500, X: -0.231, Y: -1.680
A: 225.000, X: -0.071, Y: -1.754
A: 247.500, X: 0.089, Y: -1.673
A: 270.000, X: -0.497, Y: 0.673
A: 292.500, X: 0.330, Y: -1.231
A: 315.000, X: 0.351, Y: -0.864
A: 337.500, X: 0.327, Y: -0.524
A: 360.000, X: 0.231, Y: -0.252

Here is the data with (X=7.1mm; Y=7.1mm):
A: 0.000, X: 0.231, Y: -0.426
A: 22.500, X: 0.107, Y: -0.192
A: 45.000, X: -0.018, Y: -0.163
A: 67.500, X: -0.138, Y: -0.178
A: 90.000, X: -0.259, Y: -0.231
A: 112.500, X: -0.330, Y: -0.323
A: 135.000, X: -0.369, Y: -0.504
A: 157.500, X: -0.355, Y: -0.611
A: 180.000, X: -0.263, Y: -0.696
A: 202.500, X: -0.170, Y: -0.781
A: 225.000, X: -0.060, Y: -0.817
A: 247.500, X: 0.053, Y: -0.802
A: 270.000, X: 0.156, Y: -0.742
A: 292.500, X: 0.227, Y: -0.639
A: 315.000, X: 0.266, Y: -0.518
A: 337.500, X: 0.238, Y: -0.380
A: 360.000, X: 0.178, Y: -0.270

With the 7.1mm and 7.1mm camera setting the machine is pretty close, but still isn't consistently spot on at any rotation. It will start hitting the 0805 component near the edges instead of the center. Any idea what is going on here?

I am still wondering if there is something mechanical about the machine. If I move the machine's X axis 400mm sometimes it will miss by around 0.5mm, but sometimes it won't. The Y axis doesn't do this at all. When they say that the belts need to be tight, how can you tell how tight they should be? I've tried a few settings but don't want to over tighten and ruin anything.

Regarding RMod: For those of us who aren't as savvy, how do I compile the latest build? I only know how to download an executable right now, but I could learn how to compile is there is a guide somewhere.
JuKu
Site Admin
Posts: 1114
Joined: Thu Feb 14, 2013 3:06 pm
Location: Tampere, Finland
Contact:

Re: Can't figure out camera to needle calibration

Post by JuKu »

Are you sure that the box size for up camera is set correctly? You can check it by measuring needle (uplooking camera setup, needle, click measure), move the needle a known amount (shift+F key is 1mm), measure again; the difference should be 1mm.
RMM
Posts: 20
Joined: Sat Oct 24, 2015 9:02 pm

Re: Can't figure out camera to needle calibration

Post by RMM »

JuKu wrote:Are you sure that the box size for up camera is set correctly? You can check it by measuring needle (uplooking camera setup, needle, click measure), move the needle a known amount (shift+F key is 1mm), measure again; the difference should be 1mm.
When I move the machine 1mm either way in the X direction the measurement says that the needle is only moving ~0.4mm-0.5mm. Y direction is also only ~0.4mm.

I still don't know how tight the belts should be (I realize that this is a separate issue).
Post Reply