Page 2 of 3

Re: Can't figure out camera to needle calibration

Posted: Wed Nov 04, 2015 4:11 pm
by mrandt
RMM wrote: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).
I suggest the following quick test for your mechanics and stepper settings:

- Print a mm graph paper (has 1mm and 10mm markings), e.g. from here:
http://www.printfreegraphpaper.com/gp/e-m-1-a4.pdf

- Tape paper somewhere to table, make sure to orient coordinate system in XY direction

- Move down cam above any intersection

- Move machine X+10 and verify that it acutally moved 10mm (Alt + F6 or Alt + Num 6)

- Adjust graph paper rotation if necessary and repeat

- Perform same test for Y+10

- Repeat with different distances

This will help you verify X and Y movement and squareness. If any axis does not move as expected, check V-wheels, belts, current setting on TinyG (motor might stall) and stepper settings in "Basic Setup" tab.

Regards
Malte

Re: Can't figure out camera to needle calibration

Posted: Wed Nov 04, 2015 4:39 pm
by RMM
Malte,

I have a 600mm engineering ruler and besides some possible slack issues, moving 400mm only yields a maximum of ~0.1mm error in the X direction and no detectable error in the Y direction. I think that there is a slight slack issue on the X axis, since there is sometimes a very small amount of irregular error when going back the first step or two, but I am not sure how to fix it. I have double and triple checked all machine tightness and wheel tightness settings, but I am still unsure how tight I can go on the belts.

The major problems I am having I suspect are related to the vision system, not the mechanical aspects of the machine. I have spent a lot of time there and the major errors I am seeing are related to the needle/camera/rotational calibration issues. The fact that the machine is actually moving 1mm and the up looking camera thinks that it is moving 0.4mm-0.5mm tells me that is where the issues are. I put an Andonstar downlooking camera on yesterday and it is much improved over the camera that came with the kit. Recognition is much better and less dependent on perfect lighting. I am going to put a C270 webcam on for the uplooking camera today.

I still need to know about the RMod software: How do I download/compile it?

Re: Can't figure out camera to needle calibration

Posted: Wed Nov 04, 2015 5:06 pm
by mrandt
OK, if both X and Y axis are moving as expected, it seems to be related to the vision system. If Y measurements are off by a factor of 2 (almost), wobble compensation will be as well.

C270 is a great up cam - I also use it. Good resolution and light sensitivity, little noise and also fast USB interface.

The factory lense has very little distortion when adjusted for short focal distance. Px-to-mm rations (box sizes) are almost identical for X and Y on my machine.

Hopefully that will solve your issues :-)

If you want to compile Juha's, Reza's or Karl's software from source, you will need MS Visual Studio (free version available) and some external libs (as described here http://www.liteplacer.com/downloads/).

Juha releases binaries with installer on liteplacer.com - supposedly you are using those.

Reza has also created a few releases, if I am not mistaken the latest should be here:
https://www.dropbox.com/s/wxf4i82e1frvn ... 4.zip?dl=0

The source is on Juha's GitHub and might be newer than above binary.
https://github.com/jkuusama/LitePlacer-ver2/

If you want to try Karl's enhancements, there is currently no other way than downloading the sources from his GitHub fork and compiling your own. Karl's Github is here:
https://github.com/Knaster/LitePlacer-ver2/

Re: Can't figure out camera to needle calibration

Posted: Thu Nov 05, 2015 8:27 am
by android
This is interesting! the needle is not centered when at the height that the calibration used:
Image
@spikee In one of your picture , Z0 to PCB (PCB level) is 38.76, but your Z position when you set Up camera location is 37(when the needle is at the centre of up camera).Shouldn't it be 38.76?
I'm also facing this problem.

Re: Can't figure out camera to needle calibration

Posted: Thu Nov 26, 2015 8:32 am
by android
I am also having the same issue with component placement. After doing wobble calibration, and clicking probe down , needle hit the exact spot where camera was pointing, but if I turn the needle 270 degree, and do Probe down, needle is not hitting the exact spot. Machine picks the components without much problem but placements are off by a little.I am talking about 0805 components.

Re: Can't figure out camera to needle calibration

Posted: Thu Nov 26, 2015 9:05 am
by mrandt
android wrote:I am also having the same issue with component placement. After doing wobble calibration, and clicking probe down , needle hit the exact spot where camera was pointing, but if I turn the needle 270 degree, and do Probe down, needle is not hitting the exact spot. Machine picks the components without much problem but placements are off by a little.I am talking about 0805 components.
Hi,

sounds like too much correction is applied for needle wobble.

Have you calibrated pixel-to-mm ratio for upward camera correctly? Software can only determine how many pixels the needle tip is off-center in camera picture.

This value then needs to be converted to mm, so machine position can be corrected accordingly for each A-angle.

I suggest the following:
1. Calibrate needle height
2. Move needle over upwards camera and lower needle to PCB level (needle down)
3. Enable box display (draw box) for upward camera
4. Jog needle a bit left of the box
5. Only jog to the right (X+) from now on to reduce effect of slack
6. Carefully and slowly jog machine until needle tip is exactly centered on left box boundary in display - apply zoom if needed
7. Note X coordinate
8. Jog machine until needle is exactly centered on right box boundary
9. Again note X coordinate
10. Calculate distance by substracting the X coordinates you have noted down
11. Repeat for Y axis with lower and upper box boundaries
12. Set box size for X and Y which lets software calculate pixel-to-mm ratio

In addtion, make sure to calibrate needle-camera offset and set needle center / up camera position afterwards.

If you care to install RMod / Ver2 it has auto calibration for pixel-to-mm ratio for both down- and upcamera - similar procedure to the one described above but automated.

Even if you don't want to use that version, you could use it to determine the values once and then copy & paste them to the other software.

I think that calibration is very helpful I posted a request to port that calibration routine to main branche here:
https://github.com/jkuusama/LitePlacer-DEV/issues/30

Hope this helps!

Best regards
Malte

Re: Can't figure out camera to needle calibration

Posted: Thu Nov 26, 2015 9:21 am
by android
You have already mentioned that in one of my other post, and I used your method to set the box size.
I've a doubt about this, that should I set the needle height at PCB level or 1 mm less that of PCB level(at which wobble calibration takes place) when setting up camera location and setting box sizes??
because in my case after wobble calibration, and Needle to cam, and take needle down it is not at exact centre but if raise 1mm it's exactly centre.
If you care to install RMod / Ver2 it has auto calibration for pixel-to-mm ratio for both down- and upcamera - similar procedure to the one described above but automated.
where can i get that??

Re: Can't figure out camera to needle calibration

Posted: Thu Nov 26, 2015 9:52 am
by mrandt
android wrote:You have already mentioned that in one of my other post, and I used your method to set the box size.
Sorry, did not mean to repeat myself...
android wrote:I've a doubt about this, that should I set the needle height at PCB level or 1 mm less that of PCB level(at which wobble calibration takes place) when setting up camera location and setting box sizes??
Well, I think the difference should be minor. I always just use the "needle down" button on "Setup Cameras" tab. I would have to try whether that is exactly PCB level, table surface level or something in between or slightly above.
android wrote:because in my case after wobble calibration, and Needle to cam, and take needle down it is not at exact centre but if raise 1mm it's exactly centre.
That sounds really weird. Could you check that your upward camera is level (looking upright / exectly perpendicular to table surface)? Same for Z-axis maker slide and rotating steel tube - at least as good as it gets.

If even a slight Z-level difference changes center position, one of those must be really tilted which might explain the problems you are having.

I suspect either camera or steel tube being misaligned.

I used a water level to align table surface first, than a smaller water level to get the upwards camera straight. Assuming the table surface is straight and level, you can also use a water level to check Z-axis and tube are perpendicular - if you have one with good enough precision. A good 90° angle will also help.

A nice trick is also to use a plumb line hanging from ceiling - both Z-axis and tube need to be parallel to the line - again assuming your table is well leveled.
android wrote:
[...] RMod / Ver2 [...]
where can i get that??
Unless you want to get sources from GitHub and compile yourself, I think a recent build was linked in this post:
http://liteplacer.com/phpBB/viewtopic.p ... t=10#p1388

Re: Can't figure out camera to needle calibration

Posted: Thu Nov 26, 2015 11:04 am
by android
But needle is exactly centre at the height it used for wobble calibration(26.56mm) my pcb level is 27.56.
Can you please verify in your machine.

Re: Can't figure out camera to needle calibration

Posted: Thu Nov 26, 2015 11:10 am
by mrandt
android wrote:But needle is exactly centre at the height it used for wobble calibration(26.56mm) my pcb level is 27.56.
But you mentioned before that it moves out of center if you move it to 27.56 - or did I misunderstand that?

On my machine, the needle tip stays centered over a large range of Z-levels - which makes sense if both camera line of sight and Z-axis (makerslide profile + rotating steel tube) are parallel (i.e. camera flat with table surface, Z-axis + tube perpendicular to table).

If either is tilted, that would explain a misalignment of needle tip depending on Z-axis - and that would obviously cause trouble with different size parts, pickup from trays or feeders, placement on PCB etc.

Does that make sense?