LitePlacer-rmod Updates

mrandt
Posts: 407
Joined: Mon Apr 27, 2015 10:56 am
Location: Stuttgart, Germany

Re: LitePlacer-rmod Updates

Post by mrandt »

Hi Karl,

I tried to help by compiling a quick guide on GitHub contributions - see here:
http://liteplacer.com/phpBB/viewtopic.php?f=10&t=166

Any questions, let me know.

Thanks!

Malte
Knas
Posts: 53
Joined: Thu Jul 16, 2015 3:07 am

Re: LitePlacer-rmod Updates

Post by Knas »

@Malte - awesome, that answered my questions.

So while battling the X/Y change dependent on Z i've run into a bit of a conundrum i was hoping someone can shed some light on.

Because of the wobble of the needle, there's no objective "middle"-position of the needle to use for setting the needle-to-camera distance. Unless the needle is reset to the exact same starting rotation each time, and the needle-to-camera distance is re-calibrated every time you change needles there's no real way of making sure that the distance is constant. How do we solve this? It seems that the up-camera zero routine only tries to detect a single circle at the initial rotation of the needle, this is problematic as that needle position might very well be an extreme in any direction and does in no way give a true midpoint.

Would it be feasible to, after calibrating the needle wobble, take the mean value of all the X and Y wobbles and make that the "center" of the needle, subtracting it from all needle calibration values? ? This way, the current needle wobble could be subtracted from the needle-to-camera position and at least give the distance that would work in most cases.

-Karl
mrandt
Posts: 407
Joined: Mon Apr 27, 2015 10:56 am
Location: Stuttgart, Germany

Re: LitePlacer-rmod Updates

Post by mrandt »

Knas wrote:Because of the wobble of the needle, there's no objective "middle"-position of the needle to use for setting the needle-to-camera distance. Unless the needle is reset to the exact same starting rotation each time, and the needle-to-camera distance is re-calibrated every time you change needles there's no real way of making sure that the distance is constant. How do we solve this?
I think it is just a matter of how the compensation algorithms work - as Einstein said, everything depends on the frame of reference ;-)

We could just define the needle position at A=0 to be the "objective middle position" as you call it and calibrate both needle-camera distance and up camera / needle center for that. While measuring needle wobble, you basically determine an XY offset per A-angle which will be used to correct position if (and only if) a part is picked up or placed at an A-angle different from 0. Let's say XY is off by (0.2,0.4) for A=90 (measured), then placement position must be corrected by this vector if A=90. If A=0, then correction should be (0,0). For any other A-angle, different correction factor might apply.

Also, I think one has to repeat four calibrations (needle height, needle-camera distance, up camera / needle center and needle wobble) after changing the needle to achieve full accuracy. Another interesting aspect is that these calibrations simply have to be done in this sequence.

Thus I would like a "calibration wizard" which quickly and simply guides the user through the steps required and in the right order. I am thinking about a "slimmed" down version of the setup wizard I proposed here:
http://liteplacer.com/phpBB/viewtopic.p ... rt=10#p660

Regards
Malte
mawa
Posts: 139
Joined: Wed Jun 10, 2015 1:23 pm
Location: Near Hamburg, Germany

Re: LitePlacer-rmod Updates

Post by mawa »

If I assume that the A-Axis steel pipe has either no wobble or a reproducible wobble then the needle wobble is an added wobble vector produced by either a slightly angled needle holder, an eccentric needle itself or a bent needle.

But all this is IMHO not important for the needle to camera offset. This offset should be the distance between the center point around which the tube plus needle rotates and this center point is evaluated during needle wobble calibration.
But the way the needle nominal offset (http://www.liteplacer.com/setting-camera-locations/ )is currently set, this point is not considered!

I stepped into this fact after I almost broke my current needle on the edge of the camera hole while jogging without Z protection.
Result was a slightly bent needle. :oops:

I set the needle height, the needle nominal offset and wobble calibration but when trying to pickup a part after some reboots and A axis experiments - either by manual camera jog and pickup or by automatic tape hole - part pickup - the needle was clearly offset and the pickup failed. :(

So I believe that the needle nominal offset calibration should first evaluate the wobble, then the pick a point on the PCB and jog the camera to that point stuff and finally use the wobble offset to compute an save the "real" rotation center/middle point.

When you then calibrate any needle the wobble is measured relative to the center point and therefore the correct position can be computed correctly.
best regards
Manfred
Knas
Posts: 53
Joined: Thu Jul 16, 2015 3:07 am

Re: LitePlacer-rmod Updates

Post by Knas »

mrandt wrote: We could just define the needle position at A=0 to be the "objective middle position" as you call it and calibrate both needle-camera distance and up camera / needle center for that. While measuring needle wobble, you basically determine an XY offset per A-angle which will be used to correct position if (and only if) a part is picked up or placed at an A-angle different from 0. Let's say XY is off by (0.2,0.4) for A=90 (measured), then placement position must be corrected by this vector if A=90. If A=0, then correction should be (0,0). For any other A-angle, different correction factor might apply.
This is all fine and good for a single run, but the next time you restart the machine, unless the A = 0 point is the exact same rotation as the previous time you started the machine the calibration is going to be off. Depending on the wobble of the needle it could be off by as much as a millimeter or two.
mawa wrote:But all this is IMHO not important for the needle to camera offset. This offset should be the distance between the center point around which the tube plus needle rotates and this center point is evaluated during needle wobble calibration.
But the way the needle nominal offset (http://www.liteplacer.com/setting-camera-locations/ )is currently set, this point is not considered!
Exactly. So the question is, how to find the center point of the tube? Obviously the best way would be to have a camera-detect for the tube itself, failing that a midpoint based on the average of the needle wobble is the best we can do - no?

Karl
mawa
Posts: 139
Joined: Wed Jun 10, 2015 1:23 pm
Location: Near Hamburg, Germany

Re: LitePlacer-rmod Updates

Post by mawa »

Knas wrote:
mrandt wrote: Exactly. So the question is, how to find the center point of the tube? Obviously the best way would be to have a camera-detect for the tube itself, failing that a midpoint based on the average of the needle wobble is the best we can do - no?
Karl
Well the wobble calibration describes a circular set of points around that very center point we want to know. In Rezas version you can follow the calibration and each angle wobble result is displayed as a blue cross.
So its just a little bit of trigonometry to compute that center point.

The tube, as I wrote may also have a wobbling lower opening, so IMHO trying to optically find the tube center is not the right way.
best regards
Manfred
Knas
Posts: 53
Joined: Thu Jul 16, 2015 3:07 am

Re: LitePlacer-rmod Updates

Post by Knas »

So my initial tests of averaging the needle position seems very promising. The "mid point" is considered the average middle of the needle wobble and is subsequently subtracted from all calibration points so that everything centers around that "0". The down-cam-to-needle position takes the current needle wobble into consideration when being set and subtracts it from the calculated position. So far, this seems to work with a ~+/-0.1mm tolerance (that's me guessing from staring at the needle for waay too long) at any angle. The angle have in this test been reset several times at different positions, sometimes deliberately, sometimes because of crashes during debugging. It seems to position itself incredibly well with the initial down-cam-to-needle position as long as the needle is recalibrated at each reboot of the machine. I also tried this with my X/Y compensation for height and it works a lot better than before, though i'm not certain it's quite perfect yet.
mawa wrote:Well the wobble calibration describes a circular set of points around that very center point we want to know. In Rezas version you can follow the calibration and each angle wobble result is displayed as a blue cross. So its just a little bit of trigonometry to compute that center point.
This is true if the wobble is perfectly circular or elliptical - however i've found that this is not always the case.
mawa wrote:The tube, as I wrote may also have a wobbling lower opening, so IMHO trying to optically find the tube center is not the right way.
Agreed, i realized this since if your up camera has any angle to it what so ever (which mine def. does) the tube center will not be the needle center - it's height-dependent.

Karl
mrandt
Posts: 407
Joined: Mon Apr 27, 2015 10:56 am
Location: Stuttgart, Germany

Re: LitePlacer-rmod Updates

Post by mrandt »

I still argue that it just a matter of definition. I am not sure about the current implementation in V1 and RMOD (V2) though...

If you want the tube center to be the reference, fine. In that case you have to change the order of calibration steps and apply the needle wobble correction factor when measuring camera - needle distance:

1. calibrate needle height
2. measure needle wobble
3. determine rotational center
4. determine camera-needle distance

For step 3, Manfred's approach probably works:
mawa wrote:Well the wobble calibration describes a circular set of points around that very center point we want to know. In Rezas version you can follow the calibration and each angle wobble result is displayed as a blue cross.
So its just a little bit of trigonometry to compute that center point.
IMHO it is easier to center the needle above the up camera than the rotational center - so I would prefer my approach:

1. calibrate needle height
2. set A = 0 and measure needle-camera distance
3. calibrate needle center above camera
3. measure needle wobble

I also claim that you have to rerun these calibration each time you start the machine and also each time you change the needle - it is the same as homing your machine. After motors are powered off, you simply cannot rely on the position of any of the axis. Thus I would prefer these steps to be executed in an easy wizard.
Knas wrote:the tube center will not be the needle center - it's height-dependent.
This supports my claim that simply centering the needle above the up camera is simpler, as angles and pixel-to-mm rations do not matter when centering a part.

Another remark to the dependency on height (Z): As we do not use telecentric lenses, we will also face perspective and projection errors.

This is the reason why we have to calibrate needle height first, so the needle tip is at PCB surface level when running the calibration. Also, the pixel-to-mm ration for up camera needs to be calibrated for this Z-level (but only once).

For practical reasons, I would assume that steel tube has relatively little or no wobble and is perfectly orthogonal to table surface while needle wobble will be the same on all Z-levels - this can be sorted out mechanically and is important when picking up larger components or using thick component trays as I do.
WayOutWest
Posts: 198
Joined: Thu Jul 16, 2015 12:18 am
Location: Washington State, USA

Re: LitePlacer-rmod Updates

Post by WayOutWest »

Knas wrote: This is all fine and good for a single run, but the next time you restart the machine, unless the A = 0 point is the exact same rotation as the previous time you started the machine the calibration is going to be off. Depending on the wobble of the needle it could be off by as much as a millimeter or two.
This, and parallel issues with other calibrations, led me to decide that calibration absolutely has to be 100% automatic with no human intervention. It took me a long, long long time to get all the code working, but it's possible using QR codes to tell the machine where the various calibration artifacts are.

I also added another camera (my fifth) whose sole job is to look up through a piece of plexiglass with a dot in the center (at PCB height) and tell the machine when the needle is exactly touching the dot. Might sound like overkill, but cameras are cheap, and now I never have to wonder if recalibration is necessary... I just recalibrate reflexively several times a day while getting coffee.

I recently sent out a run of PCBs with this pattern on the copper layer (which is quite high-resolution and very accurate, much more so than laser printers!) for camera calibration:

http://graphics.stanford.edu/software/findgrid/
junc-icon.png
junc-icon.png (80.24 KiB) Viewed 8976 times
- Adam
WayOutWest
Posts: 198
Joined: Thu Jul 16, 2015 12:18 am
Location: Washington State, USA

Re: LitePlacer-rmod Updates

Post by WayOutWest »

thereza wrote:long time no talk. wondering if anyone has made any modifications to my version of the code?
I reconstructed the git history for your ADC patch so it can be rebased forward to newer versions of the TinyG firmware:

http://liteplacer.com/phpBB/viewtopic.php?f=10&t=154
- Adam
Post Reply