Hello Guest it is November 22, 2019, 10:59:30 AM

Author Topic: setting up cammera and laser  (Read 44320 times)

0 Members and 1 Guest are viewing this topic.

Re: setting up cammera and laser
« Reply #30 on: February 28, 2008, 06:39:30 AM »
Hey Tom

I was starting to worry that my last post aimed at stimulating disscussion had, in fact, killed it :(

No need to apologize I'm sure everyone following this thread is appreciative of you knowledgable input.

To Answer your questions...

The lens is variable focus and this was actiually a source of grief in its previous use as a machine vision feedback system as the slack in the lens could cause the image to move and thus falsely represent the position of the target it was trying to adjust. I intend to clamp it down once everything is setup.

CCd is moveable in the Z only so some shift adjustment may be necessary in my mount design to ensure the image is in the center of the detector.

Oh No! more homework!

The resolution question is one more related to the final use of this scanner which I assume is for reproducing things on ones CNC so I would hazard a guess that a scanning resolution of twice the machining resolution would be ideal, 1:1 would be adequate and 2:1 poor, Given this assumtion I would think a resolution of say 0.0005" would be great fo a real CNC doing metal work while 0.01" would be fine for wood carving. What do those of you with working machines want?

Happy testing


Cheers

Mark

 
Re: setting up cammera and laser
« Reply #31 on: April 11, 2008, 10:23:50 PM »
Geez it's been quiet in here since my last post.... maybe I did kill it :(


Here's another question to those out there that are testing this plugin and/or  also to Art and co on how it works.

Using the camera and lens setup I have the field of view is only 15mm , is this going to be an issue for the plugiin? i would like to keep this setup as it will have very good resolution per pixel and also hopefully  limiit any specular noise outside the central image.

 Am I right in assuming that the point cloud is made up of single captured pixels from each frame grab? I.e it is looking at the height coordinate given by the intercept of the laser line and a vertical stip  of the video image with the X and Y coordinates given by the know CNC position (many snaps). Or, is it storing the whole vector seen in the FOV and is building an image by merging these short vectors (fewer snaps but more susceptible to lens duistortion errors).

I need to get my head around this a bit as the machine I'm building is comming together and it will have an impact on how I mount my unpronouncable schemflug (sp) mount and laser. That is if I will still be able to import one here in Oz since some dickheads have been out targeting planes on final approach with high power ones! Media has been making out that laser pointers are the problem not the 100mW plus ones I've seen videos of.


Cheers

Mark



Re: setting up cammera and laser
« Reply #32 on: April 12, 2008, 01:22:19 AM »
Hello Mark,

> I need to get my head around this a bit as the machine I'm building is coming together and it
> will have an impact on how I mount my unpronounceable schemflug (sp) mount and laser.

Try this link for some discussion about the pronunciation of Scheimpflug.

http://www.largeformatphotography.info/forum/showthread.php?t=8214

I think they end up with shine-floog or maybe shine-flook if you want to sound a little more German.

I'll comment on the technical stuff after I have some dinner. I know it's after 1am but I keep weird hours.

Tom Hubin
thubin@earthlink.net
Re: setting up cammera and laser
« Reply #33 on: April 12, 2008, 02:23:27 AM »
Hello Mark,

It would be helpful to have some numerical specs on the camera, camera lens, and laser.

What camera are you using? Can you provide a link to specs?

What camera lens focal length and fNumber? Can you provide a link?

What laser? Single point or line generator? Can you provide a link? You will get better accuracy with a single point laser but it will take longer to scan an area with a single laser point than to scan with a laser line. Trying to discuss setup and use for both single laser point and for laser line will be difficult. The single laser point is easier to explain and understand and it is also more accurate. So that is where I prefer to start.

I describe laser focusing elsewhere in the Video Probing forum. Have you read that yet?

> Using the camera and lens setup I have the field of view is only 15mm

Field of view is usually an angular measurement for the camera and lens combined. So I presume that you mean 15mm FOV at a convenient distance from the camera. What is that distance? The distance is usually referenced to a particular plane on the camera or on the lens. For now, just a good guess will do. Maybe something like 100mm from camera lens to laser?

Tom Hubin
thubin@earthlink.net
Re: setting up cammera and laser
« Reply #34 on: April 12, 2008, 03:00:26 AM »
Hi again Tom (not another shift worker!)

I did post this info somewhere but to recap 90% of my CNC build including the cameras and lenses are for salvaged platemaking (printing) and film setter (Autologic/ECRM) gear that they were throwing away at work. It may turn out the they are not suitable for the purpose but thought I'd give they a try.

I have two types of cameras (both b/w) that where originally used for machine vision in an automatic bender

the better one :
Panasonic WV-BP554 Super Dynamic
and
Unsure of brand but has a smaller CCD has Sony internal components

Lenses:
Computar brand TV lens 50mm 1:1.8

Using a 20mm tube extender the focal distance is around 150mm  (lens front to object) This also would be the approximate distance (20mm tube extender) that will be present once i make the Scheimpflug lens mount

This gives a FOV (in mm) if the object plane is parallel to the image plane of approx 15mm

USB interface/capture card :

Kworld USB2800D (DVD maker)

At this point I do not have a laser pointer or line generator although I do have some pretty good optics and 5mw laser out of the imagesetters (however will probably purchase a line gen from Edmund or similar in future)
 

I finally got my head around the manipulation of the focal plane from your very helpfull pointers and a bit of reading on the net. Its more how Art has written his plugin to work that I am fuzzy on. From the descriptions in the forum it would appear most have quite wide FOV and can see the laser line across their calibration blocks in a single frame. That would not be the case with my present setup and I am curious if this is an issue for him.

Cheers

Mark

Re: setting up cammera and laser
« Reply #35 on: April 12, 2008, 06:37:00 AM »
Hello Mark,

> (not another shift worker!)

No. Just a night person.

> I have two types of cameras (both b/w) that where originally used for machine vision in an automatic bender

> the better one : Panasonic WV-BP554 Super Dynamic

I just downloaded the PDF manual and skimmed through it. Output is 1vpp video...not USB. Otherwise looks good. I see below where you mention a video capture to USB device.

> and Unsure of brand but has a smaller CCD has Sony internal components

Can you find out what that is?

> Lenses: Computar brand TV lens 50mm 1:1.8

High quality. That is good.
 
Using a 20mm tube extender the focal distance is around 150mm  (lens front to object) This also would be the approximate distance (20mm tube extender) that will be present once i make the Scheimpflug lens mount

The lens is probably designed for objects at infinity. How is the image quality for an object distance of 150mm?

> USB interface/capture card : Kworld USB2800D (DVD maker)

Does this take video from camera and convert to USB for the computer?

> At this point I do not have a laser pointer or line generator
 
AixiZ sells some cheap laser diode modules on eBay. I tried the 3.2vdc, 650nm, 5mw module for $8 with a 60 degree line generator lens for $3.40. $4.00 to ship. These are the 12mm diameter, 30mm long metal tube. I used half inch shrink tube over the module and lenses to stabilize the lenses once I got it all set up. otherwise, the lenses tend to wiggle around and would probably fall off after enough vibration.

I hope to use the 3-5vdc version and tap 5vdc from a USB hub on the laser triangulation gauge. There has been some confusion in ordering the laser modules. They sent me the wrong modules, I returned them for exchange, they sent me something else completely, then they gave me full refund so I could start over, then ebay reordered my previous order along with my new order. As it stands now I am not paying until somebody straightens this mess out.

> I finally got my head around the manipulation of the focal plane from your very helpfull pointers and
> a bit of reading on the net. Its more how Art has written his plugin to work that I am fuzzy on.

I cannot tell how Art has arranged his camera and lens. I think he is just setting them up so that they overlap at an arbitrary angle somewhere in space. Not imaging the laser plane onto the ccd array would account for a lot of his problems with getting good data.

> From  the descriptions in the forum it would appear most have quite wide FOV and can see the laser line
> across their calibration blocks in a single frame. That would not be the case with my present setup
> and I am curious if this is an issue for him.

I think you can use any size cube as a calibration standard. It does appear that the line must cross the full cube width and maybe even reach down to the bottom so the calibration can cover Y and Z.

Objects with a matte finish are easier for the camera to see than mirror-like objects. Ceramic makes a good target since it scatters light pretty evenly. Gauge blocks would probably be bad because of the mirror-like finish. Talcum powder on a gauge block might work. Sandblasted surfaces work well.
 
My gauge design is complete. Now I need to order materials and tools and then find some time to make chips. This one will not be like yours, with the laser pointed straight down the z axis. This one will be closer to what I think Art is doing but the angles will be carefully chosen to image the laser plane onto the ccd array. My plan is to build three of these and donate one to Art for testing and developing.

Tom Hubin
thubin@earthlink.net
Re: setting up cammera and laser
« Reply #36 on: April 12, 2008, 09:08:12 PM »
Hi Tom

Still trying to pull up the specs of the other camera but it would be similar to the Panasonic as they were for the same purpose. It is a little less fancy that the Panasonic in that it doesn't have all that alarm and image masking hardware (which may be handy in excluding all the laser line except the region of interest)
It has an adjustable shutter from off to 1/20000
Same video output

The lens image is fine at this distance with no discernible distortion but I haven't looked that close. I have been playing with angles while imaging a steel ruler obliquely to get a sharp focus across the full frame.

I didn't intend on having the laser plane along the Z but more in line with what you have been saying with the camera and lens setup in an adjustable mount to tilt the image plane correctly onto the CCD. The lens by themselves are intended for a focal length of between 1m to infinity that's where the tube extenders come in to shorten this down.

The Kworld is the Video capture device which takes NTSC or PAL or even SECAM input and puts it into the USB port.

I'll check out that site for line generators as the good ones at Edmund don't come cheap. BTW I have access to a Beamscan XY spot size meter so when I do get a laser (in the 670nM range) I'll be able to tell you exactly how gaussian and wide my beam is :).

The main disadvantage I see with using my current lenses is that range of Z measurements will be greatly reduced than with a wider angle lens. If I have a 90 degree included angle between the laser plane and the optical axis (equally spread each side ie. laser plane intersects the table at 45 degrees) then that will only give me sqrt 2 (1.4) times my measured FOV of 15mm or around 20mm of Z depth measurable.  This would be increases the more oblique the optic axis to the bed became but there are limits with this too as one need the camera not to run into the object its scanning not be too blind to the shadow area... decisions decisions.

Depending on what I wish to scan this may be way too small  I would be happier with am max depth scanable of 150mm. One could do slices by indexing the scan head down but again I am not sure how either Arts s/w would cope with this or how I would join the separate meshes latter (probably using Gmax or similar)

I do not believe Art's software works like the David stuff which needs to see the reference background planes to interpolate the height information, but I may be wrong. I really need to get the plugin working so that i can figure it out for myself but I've been concentrating on building my machine of late and I now have a windows\driver\mach3 conflict somewhere on my new laptop that crashes big time everytime I launch a video plugin from mach (blue screen of death) . I'll probably fall back onto the old desktop to experiment.

What kind of ballpark numbers for laser plane and optical axis (plus FOV ) are you shooting for?  Does my scanning resolution versus machine resolution of 2:1 sound right (ie why scan at a higher accuracy than on can then machine?).

Cheers

Mark
Re: setting up cammera and laser
« Reply #37 on: April 13, 2008, 01:32:04 AM »
Hi again

Just bought a Cosmicar 25mm C mount lens to try for a wider FOV. First ebay purchase $5.50 :)  happy camper

Cheers
Mark
Re: setting up cammera and laser
« Reply #38 on: April 13, 2008, 05:02:06 AM »
Hello Mark,

Taking a break from sorting income tax info.

> Still trying to pull up the specs of the other camera

Not important unless we talk specifics about this camera.

> it doesn't have all that alarm and image masking hardware (which may be handy in excluding all
> the laser line except the region of interest)

I would think that the meshing software will allow you to delete regions that are properly measured but not of interest...like the table that the object is sitting on. There should be no data outside the laser plane bounded by the camera's field of view. The laser is so much brighter than any other lighting that a short exposure time, like 1ms, will black out everything but the laser wherever it intersects the object.

> It has an adjustable shutter from off to 1/20000

If auto exposure is used it should be based on peak value and not the customary average over the entire view. Peak AGC would show the laser and black out everything else.

> The lens image is fine at this distance with no discernible distortion but I haven't looked
> that close. I have been playing with angles while imaging a steel ruler obliquely to get a
> sharp focus across the full frame.

> I didn't intend on having the laser plane along the Z but more in line with what you have
> been saying with the camera and lens setup in an adjustable mount to tilt the image plane
> correctly onto the CCD.

The payoff to allowing the CCD to be tilted is that you can locate the laser just about any way that you want to. Consider a simple laser pointer that is pointed straight down the Z axis and focused to a small diameter on the target 100mm below. Locate the lens off to the left of the laser about 75mm. Point the lens optical axis at the laser waist at the target. The object distance is 125mm since the laser and the lens and the target form a 3:4:5 right triangle.

Calculate the image distance and the image tilt.

clfl = camera lens focal length
od = object distance
id = image distance
latm = lateral magnification
otilt = object tilt (zero degrees is perpendicular to the optical axis)
itilt = image tilt (zero degrees is perpendicular to the optical axis)

Given:

cfl = 50mm

od = 125mm

Calculate:

id = 1/(1/clfl - 1/od)  = 1/(1/50mm - 1/125mm) = 83.333333mm

latm = -id/od = -83.333333mm/125mm = -0.667

otilt = atan(100mm/75mm) = 53.1301 degrees

itilt = atan(m*tan(otilt)) = atan(-0.889) = -41.634 degrees

Since the laser is the center of symmetry the camera can be located on the left or the right or front or rear or several cameras all around.

> I'll check out that site for line generators as the good ones at Edmund don't come cheap.

Also checkout Thorlabs. Not cheap there either but many more choices for laser, housing, lens combinations.
 
> BTW I have access to a Beamscan XY spot size meter so when I do get a laser
> (in the 670nM range) I'll be able to tell you exactly how gaussian and wide my beam is :).

That is great. I don't suppose we are neighbors. I am in Laurel MD (between DC and Baltimore MD).

> The main disadvantage I see with using my current lenses is that range of Z measurements
> will be greatly reduced than with a wider angle lens.

You can expect to get accuracy about 1% of your fov. To get better than that you will need to design and build everything just right. Since you are scrounging and making compromises you should be proud if you get 1% of your fov as accuracy.

> If I have a 90 degree included angle between the laser plane and the optical axis
> (equally spread each side ie. laser plane intersects the table at 45 degrees) then
> that will only give me sqrt 2 (1.4) times my measured FOV of 15mm or around
> 20mm of Z depth measurable. 

Actually, I think you need to divide by the square root of two. That makes it closer to 10.6mm z combined with 10.6mm x.

>This would be increases the more oblique the optic axis to the bed became but there
> are limits with this too as one need the camera not to run into the object its scanning
> not be too blind to the shadow area... decisions decisions.

This is the way that I am doing mine. A 90 degree included angle means that you really cannot have the laser vertical because that would require the camera to be horizontal. I am setting the laser 30 degrees cw of the vertical and setting the camera 60 degrees ccw of the vertical. The advantage to this approach is that I can swap lenses to change my fov since the ccd array is not tilted with respect to the optical axis. And since I am interested in teaching it is easier for amateurs to copy and vary. The disadvantage is that x and z both depend on the h and v camera coordinates.

However, the professional method is to point the laser straight down the z axis. Then z depends on either the camera h or v coordinate (depending on camera orientation) while x and y are just taken from the cnc machine's DRO. The disadvantages are that it is more difficult to understand and design and build, the image will be distorted (but predictable) so must be corrected in software, changing the lens focal length changes the image tilt.     

> Depending on what I wish to scan this may be way too small  I would be happier with am max
> depth scanable of 150mm. One could do slices by indexing the scan head down but again I am
> not sure how either Arts s/w would cope with this or how I would join the separate meshes
> latter (probably using Gmax or similar)

You get accuracy by having a small fov and scanning over as large a volume as necessary, as you suggest, to accumulate the point cloud shifted by machine coordinates so that it is relative to absolute space.

Also, accuracy depends on methodology. Two points can be uncertain by 0.010 inches and used to define a straight line. It would be best if those two points are as far apart as possible. Even better, many points taken along the length of the line reduce random error by a factor equal to the square root of the number of points. So 100 points along the line can reduce the error by a factor of 10.

> I really need to get the plugin working so that i can figure it out for myself but I've been
> concentrating on building my machine of late and I now have a windows\driver\mach3 conflict
> somewhere on my new laptop that crashes big time everytime I launch a video plugin from
> mach (blue screen of death) . I'll probably fall back onto the old desktop to experiment.

I am about to do that myself. I now have three laptops that will run Mach3, or the camera vendors software, or both side by side. I can access the camera with the Mach3 video window plugin but after that Mach3 slows to about 1% of its normal speed. I have to exit Mach3 and restart it to get it working right again.

> What kind of ballpark numbers for laser plane and optical axis (plus FOV ) are you shooting for?

Similar to yours. I started with a goal of one inch but scaled it down a bit so that I could make a one piece frame on my little Sherline 5410 CNC mill.

Tom Hubin
thubin@earthlink.net
Re: setting up cammera and laser
« Reply #39 on: April 13, 2008, 07:11:35 AM »
Thanks again Tom

I am very visual in my way of understanding things and your descriptions have helped me paint that picture. Takes a while for the penny to drop but I usually get there. I always need to draw sketches when I'm explaining something and I find it difficult to decipher ideas from words alone sometimes.

 I was looking at the way i was imaging my tilted ruler backwards in that I was thinking the laser plane was coming from the other side  (ie pointing towards the camera and at an oblique angle to increase my FOV and Z measurment ability) not from the near side and at an acute angle to the lens axis. I may not be describing this well but I understand now the idea of having the laser plane vertical and the camera lens mount off to one side tilted to bring the laser plane into focus.  I also get the wider aperture as possible to stop occlusion by having the lens tilted.

Hmm am I close... well I'm between Sydney and Newcastle in NSW Australia so that would be a no.
 
I would like to see Art use a wedge rather than a block for calibration as this would take lens distortion into account.... maybe he's listening :)

Yeah its a weird bug with the drivers I have on this beast laptop. I'll figure it out eventually (bloody windows!). I've gotten into my head that I want to run my machine using a smooth stepper usb interface card running off a wireless usb extender hub (made by Belkin http://catalog.belkin.com/IWCatProductPage.process?Product_Id=377793) with my nice laptop safely far away from the noise and mess of the CNC.

Make sure you post some pics of your setup once you get it going. Well I better get to bed early as I am a shift worker and I start early tomorrow.

Cheers
Mark