Fiducial camera weirdness

Started by arvydas, July 25, 2016, 07:50:45 PM

Previous topic - Next topic

arvydas

Trying to get my machine set up and fiducial camera has always bothered me. I haven't been using fiducial camera and just manually adjusting the position for the board. This worked OK, but I want to get this sorted.

My panels have only one set of fiducials for the whole panel. When I setup the board and position the the ref 1 manually, ref 2 is always spot on. This is how much off is the fiducial camera for bottom left corner:



This is how much it's offset on the top right corner:



If I align the board with fiducial camera, my placement is completely off.

I understand that there may be two issues.

Issue #1: Fiducial Camera Offset is incorrect

I've been trying to set up the offset by entering various values in the fiducial camera offset settings, but can't seem to get even close to making both fiducials work. If I set up for one, then the other one is way off. Does any one have any suggestions on what would be the best way to calibrate offsets? From my experience even the location of where I'm calibrating the fiducial camera affects the values I have to input in the offset box.

Issue #2: Machine needs grid calibration

Doesn't that mean that the machine needs grid calibration? Out of frustration I even started reverse engineering the code which does calibration grid with some good results. More about this in a separate thread.

Mike

Bear in mind that the fid cam offset might be wierd due to the arm geometry - it may not be a simple x/y offset.
On my machine it's set to -2550,-500, whick looks about right for an x/y offset of posiiton on the head.
Bear in mind that camera rotation is also crucial - I'm guessing there is some fixed reference rotation, i.e. with the arm in a specific position it's exactly horizontal. It's possible the grid cal process also corrects for camera rotation. 

I'm pretty sure grid cal is also an issue. I see small offsets - on every job I start exactly on the fids, look at the placement errors nearest each fid and manually offset ( i.e. on a new panel I set the camera to the centres, then add the offsets & use "use current position). The biggest offsets I've seen are about 30 thou.
After setting PCB ref 1 position, there is usually some offset when it goes to set ref 2.

I've not looked at the grid cal but I suspect it may not need reverse-engieering - I'd start by running the procedure & seeing how it behaves, and looking at the resulting cal files may be enough. There is a CAD file for the alignment jig in the hardware thread - from memory it's a half-inch grid.
You should be able to get an accurate grid by getting someone to photoplot or phototypeset it on film. Something like a TV LED backlight might make a good surface to put it on.
An issue is figuring out where the absolute location of the jig should be, and if this really matters for accuracy.   

spiyda

I can't offer any help as I have the same problem !

The machine I have where the camera is not set up properly, places components perfectly accurately if the fiducials are set manually by aligning the nozzle over the fid by eye, so I imagine the basic grid calibration must be in the ballpark.

but I wonder if it would be worth folks that have a correctly calibrated fiducial camera, posting the offsets and what the camera axis is aligned to (rotationally)

I tried guessing the offset, but it didn't seem to respond logically, so perhaps it is the camera rotational setting at fault.

It can't be rocket science !

arvydas

I think I have figured it out! It's not perfect, but it works very very well. First of all I noticed that there is a pattern when I change the fiducial camera offsets, but only when the Y is set to zero. So I thought that if I can get as close for both fiducials as possible to be in the same position even though they are offset, I should be able just to set the board biases to a constant value and always rely on the fiducials! Here is what I did with my machine.

Fiducial Camera Offset Calibration

I'm assuming you have everything already set up and ready for placement.


  • Open RvPlace
  • Place a board with fiducials to the right top corner of the placement are
  • Manually align the fiducials with your eye and nozzle 1
  • Write down your current fiducial camera offset values (just in case you want to go back), set Y offset to 0 and don't forget to click the apply fid button
  • Place all -> Fiducial Correct
  • The fiducial alignment window will come up twice just like I've shown in the first post
  • Check to see the displacement of the two fiducials and how far off they are
  • Open calibration and set the value of X fiducial camera offset to either + or - 100, divide this number by two when you can see that displacement overshoots to the opposite direction
  • Note that when you are changing the camera calibration, both fiducials will move in either direction!
  • Go back to (5) until the fiducials align, don't worry if they are offset from your original location

After this your fiducials might be offset, but when the machine looks at them, they are offset at exactly the same position both on X and Y. One tip is to use exactly the same focal position for the fiducial calibration, because fiducials slightly move as the camera focus is adjusted. My fiducial camera offsets are X=-1620 and Y=0.

Board biases

When you are confident that the offset is exactly the same, just calculate the offset by moving the arm in the Fiducial Correct window and calculate the steps of the offset. They should be the same on both fiducials. Mine were X=156, Y=6. Put those values as negative into PCB setup window for board biases. It is very important that the biases are negative to the values you calculated when you manually adjusted the position. For board biases I entered X=-156 and Y=-6.

For example if your both fiducial board offsets are X=-100 and Y=20, then you should put in X=100 and Y=-20 into board biases.

Notes

I think that my machine's fiducial calibration file seems to be OK and it's just the camera offset that was incorrect in my case. Alternatively I think that if I manually offset the values in the fiducial calibration file by the amount of offset I currently have, I wouldn't have to deal with board biases, but it's just not worth the time :-)

If anything out of my instructions doesn't make sense, just drop a message here and I will clarify for you.

Mike

Bear in mind you probably     have to   do  that procedure per job, depending on the absolute posiitons of the fids.

One thought I had was that it wouldn't be hard to fit a small camera module to a nozzle mount, to place manually on  the head to get an accurate centre view.

arvydas

Quote
Mike, you are right. Placed another board with different locations of the fiducials and had to the same procedure. I think that by experimenting this way I might be able to calculate values which will eventually work with all boards. Just getting slightly closer to understanding the machine bit by bit :)
The problem as I understand it is that that calibration is a map of the differences between the fid cam position and the nozzle over the  bed, due to the arm geometry, so the error varies depending on the   absolute position. I always find significant differences between offsets for different jobs.
Quote

If I understand correctly, when you place a camera module, you would still have to rely only on manual fiducial adjustments? The automated system sort of relies on the offsets of fid camera calibration.
Yes - I've   never used the auto fid correct as it's rather fussy about lighting

spiyda

Taking your lead I decided to try and sort out the one of my machines with the fid problem.

First issue was that the lens had dropped off the end of the camera inside the housing !

Sorted that and of course the offsets were then way out

since I've never altered the actual calibration settings

I spent several hours yesterday working out what the offsets should be.

The calibration isn't spot on, but I've split the difference and it is now within 8 steps at the edges of my working area (only about 150mm square)

That will do for now until someone comes up with a loaner calibration grid !

Mike

That's wierd -  the post before last was by me, but has somehow been attributed to Arvydas

arvydas

Mike, did you notice that my comment is also gone? Very odd.

Anyway, if the software is not using inverse kinematics then it makes sense why there has to be a calibration grid. It does introduce quite a bit of error and makes sense why you would be having these issues. Will go into more depth to see how fiducial camera coordinates are mapped to head coordinates within the software.

Jason

Quote from: Mike on August 01, 2016, 04:02:49 PM
That's wierd -  the post before last was by me, but has somehow been attributed to Arvydas

I'm guessing, as Admin, you hit the Edit button rather than the Quote button.

arvydas

spiyda, how did you work out your fid camera calibration settings?

spiyda

Quote from: arvydas on August 07, 2016, 11:04:22 AM
spiyda, how did you work out your fid camera calibration settings?

I didn't,  I looked at the .dat file and discovered I had made a backup when I got the machine, so I just set the offsets to a usable position.

I restored all the calibration data from the backup first.
And assumed that the original fid camera calibration was correct.

Then it was just trial and error.

I set up a sheet of paper at the right height, with fid marks at the four corners of what I needed for a work area.
then I lined up the nozzle with the mark, swapped to camera ad made a mark on the paper at the camera cross hair position.

I then plotted the path made by changing the x and y offsets to get a handle on the actual movement.

Once I'd done all that I was able to guesstimate and set the offset close enough so that it appeared in all four corners..

I then split the difference...

It works well enough now so that I can just align the board with the fids...
Auto would work well enough if I had actual fid marks on the boards, but I align using pins sticking up from the board supports into suitable through holes..  so it isn't necessary.

Not so good on setting up feeders, but I know how far out the cam offset for each feeder is, so I can guesstimate there too !

It does need someone to make the effort to build the calibration jig etc.  but at the moment, I can live with the way it works.

SteveW

Quote from: spiyda on August 08, 2016, 05:21:48 PM
It does need someone to make the effort to build the calibration jig etc.  but at the moment, I can live with the way it works.

Is that just a PCB with a load of fiducials on it, from our favourite Chinese PCB house?
I'm happy to do that, if there are a few others to help soak up the postage...

Mike

PCB is one option, but may be tricky to get uniform lighting across the whole area. Also PCB doesn't have optimal contrast.
My though would be a photoplotted transparency with black dots on top of an LCD backlight.
Or maybe just on a sheet of white paper, assuming you can get the lighting right. A temporary ring-light round the camera maybe ( on mine the camera light is pretty ineffective, but could just be aging LEDs.   

SteveW

Quote from: Mike on August 09, 2016, 04:59:02 PM
PCB is one option, but may be tricky to get uniform lighting across the whole area. Also PCB doesn't have optimal contrast.

But PCB might be consistent with actual PCBs. Something with massive contrast and backlit may deliver crisper pics, but not line up with where the fiducials appear to be in real use / real lighting ?