Page 1 of 1

Fiducials found correctly but components are off

Posted: Sun Oct 25, 2015 9:51 pm
by Knas
So it seems that when i'm measuring the fiducials with my machine, they are all found correctly but the components are generally off, it seems to be variable over the board - i thought i saw a cumulative error in the Y axis moving backwards, but im not sure. I've squared my machine several times and made sure each axis does indeed go exactly as far as they should given a certain distance. I should point out that i'm not worried about the actual placement right now, i'm just looking with the camera at the component placing and it's off to about 0.5mm worst case. Anyone have any idea why this would happen? Does the current Kabsch implementation take in scaling? Everything *should* be to scale but i'm still wondering..

Re: Fiducials found correctly but components are off

Posted: Mon Oct 26, 2015 10:47 am
by JuKu
Can you send me the board (PDF, gerbers) and the pick and place data? I'd like to have a look.

Re: Fiducials found correctly but components are off

Posted: Tue Oct 27, 2015 7:42 am
by Knas
Thanks Juha for responding.

It seems that despite my best efforts, i've failed at verifying that the machine does indeed go the exact amount of millimeters given, hence the component placement is off. It's interesting because the fiducial finding routine correctly changes the position of the fiducials, but then the components on the board are only calculated from the center of the board, ignoring the scaling data from the Kabsch algorithm - this makes the whole thing a little confusing. I measured the distance of the fiducials as given by the machine and then compared it to my board data, and the whole thing was about 0.5mm off over the X axis - enough to make for bad placement, but apparently not enough for me to notice this during any of my (many) attempts to verify travel distance. After poking around with the hardware settings i'm getting much better results than i have before.

Given that i'm pretty bad at mechanical things, but consider myself a decent programmer, i'm thinking that there should be a way of pretty easily use the fiducial data (given that it's measured correctly) to recalculate the X and Y travel parameters. I simply took the measured X distance in between two fiducials and divided it with the distance given in my CAD data and then multiplied the result with 40 and here we go, way better results - but not yet perfect. I'm thinking that if i could use the measured fiducial data and apply the calculated rotation of the board i should be able to get perfect results, but unfortunately i don't really quite understand how the Kabsch algorithm is implemented - the concept is easy enough but the way the matrixes are handled in the code is confusing to me. Anyone able to give me a quick rundown it'd be much appreciated.

Another way of doing this would of course be to apply the scaling data from the Kabsch algorithm to all the component data, though that might not be the right way to go as that would still mean the machine isn't actually travelling the given distance. Though it would be nice to use the scaling data if the scaling is indeed off.

I have been thinking about how coordinates are handled within the machine both given this and the squareness correction parameter. That one's giving me a headache any time i set it to anything but zero. Case in point is how it's built into the move routines to the degree that if focusing on an object with the camera and then trying to go there, the squareness correction may (if set high enough) make the needle miss the object in question. It seems to me that the only real use for squareness correction and indeed a rigid coordinate system is when the machine is given parameters rendered by another software, when the user is using the camera to move the machine the only thing that will matter is the needle-to-camera distance.

Karl

Re: Fiducials found correctly but components are off

Posted: Tue Oct 27, 2015 9:24 am
by JuKu
I put an accurate ruler* under the machine and measured the amount of travel, then calculated correction values. I guess I measured the accuracy of the belt manufacturer. Still, this should not matter that much, all the operations are done in machine coordinates anyway, except the few mm's from tape hole to component. That error should be vanishingly small. Hmm.

*: It is surprisingly hard to find a reasonable priced ruler with specified accuracy. I ended up using these: http://www.schaedlerprecision.com/products.htm. (Turned out that when I bought my steel ruler, I made a good deal: I got significantly more steel than I paid for... :roll: )

> i don't really quite understand how the Kabsch algorithm is implemented - the concept is easy enough but the way the matrixes are handled in the code is confusing to me

I bought the code that takes the measured and nominal coordinates of fiducials and from these, calculates the transform from nominal to machine coordinates. this is why a) the source code is not on GitHub and b) you don't get a deeper explanation from me - it is a black box to me as well. Sorry about this.

The squareness correction also should not effect things. The machine is almost square anyway, if it moves smoothly. As said, everything is supposed to happen in machine coordinates and the transform should account for off-squareness (skew) as well. On the other hand, it shouldn't hurt either. It is also implemented at such a low level, that the net effect should only be that the rest of the code sees a perfectly squared machine.

Re: Fiducials found correctly but components are off

Posted: Fri Oct 30, 2015 3:59 pm
by Spikee
Gcode has something for this G68 coordinate rotation:
Align work that is not exactly aligned to the coordinate system. For example, suppose you wanted to run without tramming in a fixture. If you can probe the fixture to determine its angle, you can apply a G68 to "zero out" that angle and then run the part program. This can reduce setup time by reducing the need to be accurate and trammed in.
http://www.cnccookbook.com/CCCNCGCodeG6 ... tation.htm

Measure 3/4 feducials -> calculate the rotation of it -> apply G68 for that rotation. Now all coordinates are automatically rotation compensated.
You can also use these measurements to automatically determine the pcb zero point.

I have also found that the currently implemented measurement is off. And if you have a accurate pcb zero than you might as well do no feducial compensation ;)
Even for 0.5mm pitch QFN the nominal location (more or less spot on) is more than accurate enough.