Mike's Forums

Versatronics RV series Pick & Place machines => RV Software => Topic started by: arvydas on July 25, 2016, 07:50:45 PM

Title: Fiducial camera weirdness
Post by: arvydas on July 25, 2016, 07:50:45 PM
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:

(http://agileinnovative.co.uk/other/fiducial1.jpg)

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

(http://agileinnovative.co.uk/other/fiducial2.jpg)

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.
Title: Re: Fiducial camera weirdness
Post by: Mike on July 28, 2016, 11:57:40 AM
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.   
Title: Re: Fiducial camera weirdness
Post by: spiyda on July 28, 2016, 11:36:57 PM
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 !
Title: Re: Fiducial camera weirdness
Post by: arvydas on July 29, 2016, 12:18:40 PM
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.


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.
Title: Re: Fiducial camera weirdness
Post by: Mike on August 01, 2016, 12:39:30 PM
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.
Title: Re: Fiducial camera weirdness
Post by: arvydas on August 01, 2016, 12:47:24 PM
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
Title: Re: Fiducial camera weirdness
Post by: spiyda on August 01, 2016, 01:34:45 PM
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 !
Title: Re: Fiducial camera weirdness
Post by: 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
Title: Re: Fiducial camera weirdness
Post by: arvydas on August 01, 2016, 05:05:47 PM
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.
Title: Re: Fiducial camera weirdness
Post by: Jason on August 06, 2016, 08:54:39 AM
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.
Title: Re: Fiducial camera weirdness
Post by: arvydas on August 07, 2016, 11:04:22 AM
spiyda, how did you work out your fid camera calibration settings?
Title: Re: Fiducial camera weirdness
Post by: spiyda on August 08, 2016, 05:21:48 PM
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.
Title: Re: Fiducial camera weirdness
Post by: SteveW on August 09, 2016, 02:46:47 PM
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...
Title: Re: Fiducial camera weirdness
Post by: 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.
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.   
Title: Re: Fiducial camera weirdness
Post by: SteveW on August 09, 2016, 08:06:07 PM
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 ?

Title: Re: Fiducial camera weirdness
Post by: spiyda on August 09, 2016, 10:14:20 PM
Quote from: Mike on August 09, 2016, 04:59:02 PM
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.

I think you have it there Mike, you and I both have a trillion LEDs to play with, we should be able to get a nice even illumination. I have an A3+ laser printer and some white card, I'll give it a shot later in the week and see if the camera can consistently find the marks.

It might be just that easy !

ps,   I did some tests with part of a grid laser printed, and the onboard LED ring was definitely insufficient to illuminate the dots enough.  17 year old LEDs need replacing !
Title: Re: Fiducial camera weirdness
Post by: Mike on August 11, 2016, 02:39:13 PM
I'm not sure a laser print would be accurate enough, but certainly worth a try to establish the method, and get a photoplot or typesetter print done once the method has  been figured out.
Title: Re: Fiducial camera weirdness
Post by: Mike on August 11, 2016, 02:41:29 PM
Quote from: SteveW on August 09, 2016, 08:06:07 PM
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 ?


The issue is that the grid cal is an automated process that takes many hours, so needs to be able to be left to run by itself, and not be skewed by angled lighting causing offsets.
Lighting differences may make a difference to blob size, but shouldn't afect centering
Title: Re: Fiducial camera weirdness
Post by: spiyda on August 12, 2016, 01:41:23 PM
Quote from: Mike on August 11, 2016, 02:39:13 PM
I'm not sure a laser print would be accurate enough, but certainly worth a try to establish the method, and get a photoplot or typesetter print done once the method has  been figured out.

At least we know the camera can use a laser printed target properly once the lighting is reasonable.

I have a 2400 dpi A3+ laser which is pretty accurate, very linear and certainly repeatable and I can print and then compensate, so the limiting factor will be my ability to measure, and the accuracy of what I use to measure.

In aluminium, the calibration plate will expand about 0.1mm in 5 C  (steel would be about half that)
and getting it cut by a commercial laser will give me datums accurate to about 0.1mm ( so they tell me) to align the printout to.

Cutting all the registration dots as holes gets expensive and we don't really know how those align with the plate until we try.
So a cheap laser printout on card to play with would at least be a start

At this stage I don't know if that is accurate enough, but I'm inclined to get an aluminium base plate made up to play with.

Has anyone on the forum actually seen the original jig?


Title: Re: Fiducial camera weirdness
Post by: spiyda on August 15, 2016, 05:11:01 PM
A mild steel jig is being made (lower coefficient of expansion than aluminium)

I'll report when I have had a play !