Hello Guest it is April 25, 2024, 03:17:45 PM

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - TomHubin

Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 »
111
Video P*r*o*b*i*n*g / Re: setting up cammera and laser
« 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

112
Video P*r*o*b*i*n*g / Re: setting up cammera and laser
« 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

113
Video P*r*o*b*i*n*g / Re: setting up cammera and laser
« 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

114
Hello Daniel,

> Did you find out how to flip on X axis ?

No.

I think very few people are experimenting with laser triangulation so it has not yet become an issue.

Tom Hubin
thubin@earthlink.net

115
Video P*r*o*b*i*n*g / Laser Focusing
« on: February 28, 2008, 05:06:42 AM »
Hello,

Gaussian Beam:

The ideal light source is a Gaussian beam. Many lasers provide such a beam. Not all lasers, though. Furthermore, if the optics are not appropriate the beam characteristics may be altered so that a Gaussian beam entering the optics may exit as non Gaussian.

A Gaussian (bell shaped profile) beam is described by the waist diameter as measured at the 1/e squared irradiance. The waist is where the beam is narrowest. The waist may be accessible or it may not. Sometimes the waist is inside the laser itself where you cannot easily measure it.

Irradiance is power divided by area. Also commonly known as power density. 1/e squared is (1/2.71828)^2 = 13.5%. Few amateur machinists have any way to actually measure that so we just look at the beam with the naked eye and a rule,r or maybe with a microscope, and estimate the diameter. This usually results in estimating the diameter too large since the beam may be bright enough to saturate the eye or camera. 

One way to spoil a Gaussian is by passing the beam through an aperture that is too small. This is known as clipping the beam. Only 86.5% of the beam energy is contained within the 1/e squared diameter and 13.5% of the beam energy is outside the 1/e squared diameter. Since the beam trails off beyond the 1/e squared diameter it is necessary to have aperture diameters at least 1.5 times the 1/e squared beam diameter with 2.0 times the beam 1/e squared diameter being preferred. This will assure that 99% of the beam energy passes through the aperture unperturbed.

This rule also applies to lens and mirror diameters. Lenses need to be well corrected, and mirrors very flat, over a diameter at least 1.5 times the 1/e squared beam diameter as it passes through optic. 

Collimation:

Collimation is a word of convenience and is not well defined. A collimated beam is loosely defined as one that has a low enough divergence that it is suitable for your application.

No beam is ever truly collimated in the sense that it can propagate an infinite distance and never grow. Light is a wave and waves spread. The exception would be a beam that has an infinite waist diameter. However, that would require an infinite amount of energy.

A Gaussian beam propagates according to the following equations. 

theta = (4/pi) * (lambda/w0)

w(z) = sqrt ( w0^2 + (theta*z)^2 )

where:

pi = 3.14159...
lambda = wavelength in meters.
w0 = waist diameter in meters.
theta = beam divergence in radians.
z = distance from waist in meters.
w(z) = beam diameter at z distance from the waist.

Rayleigh Range:

Rayleigh range is defined as the distance over which the beam propagates to expand its diameter to sqrt(2) times the waist diameter. This is similar to the definition of depth of focus in photography. For locations between the waist and the Rayleigh Range the beam diameter is dominated by the waist diameter so is nearly constant. For propagation distances beyond the Rayleigh Range the beam diameter is dominated by the divergence so is growing rapidly.

The working range of the beam, over which the beam is collimated enough for our purposes, requires that: 

w0 = sqrt( lambda * wr * 2 / pi)

where

wr = working range in meters.

This will give you some idea as to what you need to have in a laser triangulation gauge. If the beam is not Gaussian then the waist will be much larger than that calculated above. So we try to start with a Gaussian source and maintain it as a Gaussian as it propagates through optics like apertures, lenses, and mirrors.

Laser Diode:

A laser diode is a very small Gaussian source. A typical source size is 3um x 1um. Such an elliptical source gives rise to an elliptical divergence. For a 650nm wavelength you can expect divergence of about 15 degrees x 45 degrees with the 3um width diverging at 15 degrees and the 1um width diverging at 45 degrees.

Let's say that you want a working range of 20mm. The working range for this diode, with no optics, would be about 22um for the 15 degree divergence. At a distance of 10mm the beam will have grown to 2.8mm diameter. Definitely not collimated enough for this laser triangulation gauge.

What we need is a beam diameter of 90.9um. We can do that my imaging the emitter with a lateral magnification of 90.9/3=30.3 .That would produce a waist of 90.9um x 30.3um with a divergence of 0.522 degrees x 1.565 degrees. The smaller divergence has a working range of 20mm while the larger divergence has a working range of only 2.2mm.

Line Generator:

Line generators are optics that spread the beam in one dimension. In other words, a line generator deliberately increases the beam divergence in one dimension while having little or no effect on the other dimension. The line generator needs to be installed so that it spreads the beam in the dimension that is already spreading more so that the skinny dimension can be as skinny as possible over the working range.   

Practical:

You can get an inexpensive laser module on ebay for about $10. You can also get power for it for another $10 or you can get a 5vdc version of a module and tap power off the camera USB cable.

Remove the lens and line generator from the laser module and put the module in a Vblock. Rotate the laser module until the large divergence is vertical. Install the lens. Focus until the beam is very small at your target distance. A paper target is sufficient.

Install the generator and rotate it gently (so as not to disturb the lens) until the generated line is vertical. You should now have a very skinny vertical line on your target.

Move the target closer and farther to see if the skinny beam width increases noticeably. This will define the working range as you have it set up.

If the working range is too short then the distance from target to laser is also too short. Increase the distance between target and laser and adjust the laser lens to focus on the target and try again.

If the working distance is too long then the distance from target to laser is also too long. Decrease the distance between target and laser and adjust the laser lens to focus on the target and try again.

Design Problem:

As a professional, I would have more control over the design. I would know the laser diode characteristics from a data sheet and I would have the lens prescription, or at least the focal length, so that I could do the math. If I don't like the result then I would choose a different lens or rethink my layout or discuss alternatives with the client. As amateur machinists scrounging cheap laser modules off the internet we have very little design data so more experimenting is needed.

Hardware Problem:

I have noticed that the lens and line generator that I have are a loose fit on the module. These items tend to wiggle too freely for my taste. They should have lock nuts or set screws but they do not. Locktite might be useful to prevent wiggling.

Electrical Problem:

Laser diodes often have the case connected to one power lead or the other. You need to be sure that the case is isolated if you plan to share power sources. Use an ohmmeter to check for continuity between each lead and the module housing.

Tom Hubin
thubin@earthlink.net
   


116
Video P*r*o*b*i*n*g / Re: setting up cammera and laser
« on: February 27, 2008, 08:43:57 AM »
Hello Mark,

Sorry about the delay in responding. For now I just have a few minutes for the easy questions.

> Am I right in thinking that my camera/lens mount should have the pivot point around the ccd plane?

Yes. That point will be near the center of the array but usually a little off center. There are choices that you can make but I like arranging the optical axis as the bisector of the angular field of view. That minimizes the effect of lens aberrations by keeping the angle of incidence on the lens as small as possible.

> The lenses I have are variable focus which  (again if I'm reading this right) will have the effect  of
> pivoting the image plane so I may be able to use this to fine tune the focus across the whole ccd.

Do you mean variable focal length or just movable for best focus?

> The other thing this Panasonic camera has which may be helpfull in alignment is the
> ability to move the CCd inside the camera independently from the body of the camera.

Is that movable in z for best focus or is that movable to shift the center in the horizontal and vertical?

> I also assume you would want to open the aperture fully to decrease the DOF.

Yes, assuming that the lens aberrations are small at full aperture. A professional grade lens is usually pretty well corrected at full aperture. The $10 webcam lenses might be a bit fuzzy at full aperture. But then, a cheap webcam lens won't usually have an adjustable aperture.

> Have done a few really rough tests to get my head around the camera /lens / object
> alignment and voila it actually works :) I got the video into MAch also using a cheap
> usb video converter (Kworld USB2800 D)

Great.

> Tom do you know off hand the formula for theoretical spot size?
[snip several laser related questions]

Yes but there is a lot to discuss just on laser focusing so I think I will start another topic for that. Might be a couple of days before I sit down to do that. Meantime, if you are eagar, you can look up the following subjects:

LaGrange Invariant (sometimes called Optical Invariant)
Etendue
Photometric Brightness
Optical Throughput

 > What sort of resolution do we want to achieve?

The real question is "What sort of resolution do YOU want to achieve?" Each of us has some project in mind and probably no two of us agree on the necessary range and resolution. In general, with inexpensive webcams and laser modules, I would expect to get something close to 1% of the working range. I would loosely define working range as the range parallel to the z axis.

With better cameras and laser modules and lens choices I would expect more like one thousandth of the working range. That takes the price out of the amateur range but all of the principles are the same. So this is an inexpensive way to learn how laser triangulation works.

> I know for our machine vision systems that vibration was a real quality killer so a sturdy mount would be advisable.

Sounds reasonable but I don't expect my Sherline mill to vibrate much. The machine should not be in motion when the image is formed just before grabbing the frame.
 
> While I'm thinking about it, did Art figure out what was causing that Z-stepping in his scans?

Art described his setup as pretty arbitrary. I don't think the laser is imaged onto the CCD array. The calibration procedure and the distortion correction math could also be off. I don't really have enough info on his setup so I can only speculate.

> Anyway just a bunch of off the top ideas and comments. BTW some may be way off
> the mark but if it promotes discussion then its not a waste on time.

I think you are catching on just fine.

Tom Hubin
thubin@earthlink.net

117
Video P*r*o*b*i*n*g / Re: setting up cammera and laser
« on: February 21, 2008, 08:53:17 PM »

> In the days of technical plate cameras, it was usual to have a rising front lens plate

This method keeps the object, lens, and image planes parallel. This method introduces no distortion. However, the lens must be optimized for wide angle fov. That can mean a very expensive lens.

> or a tilting back plate holder.

This method introduces distortion due to perspective. However, the lens is conventional and the depth of focus need not be high. Hence it is a purely mechanical solution.

> The idea was to be able to get architectural photos without the building looking as if
> it tapered to the top of the picture.
> Olympus even did a fancy lens for their OM series SLR cameras to achieve this effect.
> You could also get the same correction by tilting the baseplate of the enlarger when printing
> but you needed to stop the lens right down to get the depth of field to keep the focus sharp.

I think that the solution for printing is to reverse the process by tilting the film and print paper appropriately to reverse the distortion back to normal.

> So, please tell me if I have got this right.

Yes, but the devil is in the details.

> The center of the object, lens and CCD should all be on one line.

Not actually the centers. The optical axis is perpendicular to and centered on the lens. The optical axis intersects the object and image planes but generally not in their centers.

> The planes of the object, lens and CCD should all intersect at one line.

Correct.

> The problem then is to set the webcam at 45 degrees

or whatever angle you are designing for.

> and make a lens mounting that fulfills these conditions. This should be only a matter of allowing for some lens tilt and ability to bring the lens onto the centerline - a relatively easy mechanical design problem. This will enable the laser line to be in focus across the CCD.

Correct.

I would choose 60 degrees myself. Nothing wrong with 45 degrees but 60 degrees makes a smaller gauge, although it introduces more distortion than 45 degrees. So the choice of angle depends on your accuracy needs over the gauge working range.

BTW, I like to orient the lens so that its optical axis bisects the angular FOV. This minimizes lens aberrations by keeping the angle of incidence on the lens as small as possible.

Tom Hubin
thubin@earthlink.net

118
Video P*r*o*b*i*n*g / Re: setting up cammera and laser
« on: February 21, 2008, 06:56:18 AM »
Hello Mark,

Ok so I need to make one of these :
http://www.oxfordlasers.com/imaging/accessories/scheimpflug_mount

In principle, yes. In practice, no.

The camera above is adjustable to accommodate any angle that the photographer needs. For a laser triangulation gauge there is only one angle and that is determined by your design.

A typical design would have the laser pointed straight down (parallel to z) and the lens up to the left 30 degrees CCW from the z axis. This would mean that the object (the laser) is tilted 60 degrees CCW from perpendicular to the optical axis. Assume you have a lateral magnification of -0.2. Then the ccd array would be tilted 19.107 degrees CW from perpendicular to the optical axis. Plug the CCD array into the drawing and trace the endpoints through the lens center to see where they intersect the laser.

This assumes that you know the lens focal length and that the lens is thin. To really nail it down you need to ray trace through the lens prescription...if you can get the prescription.

Are you in Australia?

Tom Hubin
thubin@earthlink.net

119
Video P*r*o*b*i*n*g / Re: setting up cammera and laser
« on: February 21, 2008, 06:37:21 AM »
Hello Mark,

> Looks like I have home work  ;D first thing will be to figure out how to pronounce Scheimpflug  ???

I have had that problem for years. I still have that problem.

> I'll try slapping something together to do some testing as it may help Art with his s/w debugging
> if he can separate problems caused by poor optics from those in his algorithms.

I plan to do the same. Design for a simple non-Scheimpflug layout is nearly complete. I hope to machine the pieces in a few weeks then send a completed laser triangulation gauge to Art to evaluate. I hope to convince him that he needs to disable AGC and set exposure time for less than a millisecond to make all disappear except the laser.

> Thanks for the formulas as it gives me a starting point to get my head around the issues.
> Its interesting how magnification has an impact on the tilt angle.

BTW, that lateral magnification is only valid at the points where the optical axis crosses the object and image planes. It is just a useful number that you can relate to conventional optical layouts. The actual linear magnification needs to be calculated parallel to the object plane and its corresponding point parallel to the image plane. This number will vary with distance from the optical axis.

> So if I am doing the math properly... simplifying everything if one has a 45 degree
> object plane and a 1:1 magnification then the lens axis would be tilted 22.5 degrees
> to rotate the image plane to the CCd plane.

I am not sure what you are saying but it does not sound right. If you have 1:1 magnification then the image plane tilt with respect to the optical axis must be equal to the object tilt with respect to the optical axis. Try laying it out with a paraxial ray trace on graph paper.

Start with all planes vertical. Object on the left, image on the right, lens between them, light traveling from left to right, object distance equal to image distance equal to twice the lens focal length. Then rotate the object plane 45 degrees CW about its center. Trace from the object end points through the lens to the image end points. You will find that the image has rotated 45 degrees CCW. In this particular arrangement the image plane is perpendicular to the object plane.

In a triangulation gauge you are more likely to have latmag between -0.1 and -0.5.

> I don't have one but I think the cheap CCd cams one can get at Jaycar or Dick Smith
> (like radio shack / Tandy) are focusable so the optics can be unscrewed and possibly modified.

I have reverse engineered the optical and mechanical essentials of the 3Com Watchport/V. This is a nice security webcam that lists for $150 but regularly auctions on ebay for $10 to $35, including shipping. I like the 12mm focal length f/2 lens. You take pot luck on which lens comes with it but you can get lens sets for it on ebay. The lens thread is M12-0.5. The active CCD area is 3.6mm x 2.7mm. And it is very close to CS format as I measure with calipers. Four Torx T9 screws hold the covers together and two Torx T8 screws hold the lens mount in place. Windows drivers and standalone software are sometimes included on CD but it is also on the internet for free.

> Well I better go off and start reading my homework.

Be careful! If you fall asleep while reading about Scheimpflug you will have Scheimpflug nightmares. ;-)

Tom Hubin
thubin@earthlink.net

120
Video P*r*o*b*i*n*g / Re: setting up cammera and laser
« on: February 21, 2008, 03:08:47 AM »
Hello Mark,

> Its good having a 10 hour time delay between us (Your in the UK? aren't you?)

Nope. Just a night person in Maryland USA.

> I am still not clear on what type of optic element would be required to keep the laser
> in focus with a non orthogonal CCD axis to laser plane.

Nothing special. An ordinary imaging lens is all that you need.

> Maybe I'm not thinking about this the right way.

You need to read about the Scheimpflug principle. Many references in a google search. Reading about it will make you cross eyed and dazed until the instant that it makes sense.

Here is a mini lesson.

Let's define the optical axis as the line perpendicular to the lens plane and passing through the center of the lens.

odist is the distance from lens to object plane as measured along the optical axis.

idist is the distance from lens to image plane as measured along the optical axis.

latmag = -idist/odist is lateral magnification where the optical axis intersects the object and image planes.

It is customary for the object plane to be parallel to the lens plane. In that case the image is also parallel to the lens plane.

However, if you tilt the object plane so that it is NOT parallel to the lens plane then the image plane will also be tilted so that it is NOT parallel to the lens plane either.

To be more specific,

tan(image tilt angle) = latmag*tan(object tilt angle)

or

image tilt angle = arctan(latmag*tan(object tilt angle))

> You are also right in pointing out that you will most likely have either barrel or pincushion
> distortion but this too can be compensated for by s/w calibration

agreed

> I would think a B/W security camera would be better suited to this app than a Web cam.
> You don't need colour as you will just be filtering out as much as possible outside the
> 670nm (for HeNe or for whatever colour laser you chose) plus the single CCd may be
> less noisy and most likely higher res. I would think that one could get one of these
> fairly inexpensively since everyone wants colour theses days.

I agree about B&W being better and cheaper than color. However, webcam vs BNC is a debate about connector and communication styles. Either type has both good and poor quality cameras. I am accustomed to the Sony XC-75 but that is a $500 BNC CCTV camera and then you need to buy a frame grabber and do some programming. Webcams are convenient because they are cheap and plentiful and...most important...that is what Mach3 uses. 

> So the question now is.... If one has a camera and separate lens is it a simple
> matter of adding another optical element between them to get the desired
> effect and if so what does this beast look like?

Only one lens needed. See the math above to start.

> My setup consists of Panasonic B/W security cam with a 1/3" CCD
> a 5mm extension tube and a 50mm 1:1.8 lens . this gives a focal
> length of around 12" with a FOV of around 1"
> I can make the image even tighter using a 2x adapter but that really restricts
> the FOV and hence the measurement range plus by changing the extension
> tubes I can increase or decrease the working range which will depend on how
> I end up mounting the gear.

You need to start with your requirements and do the math to determine lens focal length and location and orientation. Then find a close lens and redo the math to fit the chosen lens focal length.

There are graphical techniques as well as math for the layout but you really need to get a handle on the Scheimpflug principle first.

> The other thing that I would think is a trade off is that as you decrease the included
> angle between the camera axis and the beam plane the measurement range goes up
> while the resolution goes down while the FOV remains constant.

The ANGULAR FOV remains constant.

The resolution at the near end of the measurement range is the best while the resolution at the far end is the worst. Kind of like your own vision. You might judge distance to a far away object as 100 feet plus or minus 10 feet and the distance to a nearby object as 10 feet plus or minus 1 foot.

Tom Hubin
thubin@earthlink.net

Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 »