Precision measurement

I'm a first-time Arduino programmer but I have previous programming experience using VB and a few others, so although I understand programming in general, I'm on a learning curve to get up to speed with Arduino.
I'm working on a stepper drive to move the Z axis on my fiber laser. That part is going great, but what I'd like to incorporate is an auto-focus capability. The laser is really critical for focus, .5mm out of focus can mean the difference between a good mark and no mark at all. So, my long-winded intro is to ask this: is there a reliable, repeatable, accurate, measuring system that I can use with Arduino? I have looked at infrared, laser, sound, etc., and I'm not finding anything that seems to be as accurate as I need. Any ideas? Or am I looking for something that isn't in the realm of possibilities with Arduino?

Edit: The distance I'd be measuring is between 150mm and 300mm.

It is not the Arduino that is limiting you it is the sensor.
This might be the best you can get

People who use CNC machines regularly use digital readout bars. You can get ones that can be read by a microcontroller.

...R

Hi,
For 0.5mm precision you are moving into the world of industrial laser sensors, or as Robin2 has indicated the digital bars.

https://www.sick.com/au/en/product-portfolio/distance-sensors/displacement-measurement-sensors/dt20-hi/c/g176377

Is a typical device.
If not suitable then contact your local distributor and get advice.

Tom..... :slight_smile:

How is the laser focused normally ? Are you following an irregular surface.

One method is to measure the spot size with separate optics.

Robin2:
People who use CNC machines regularly use digital readout bars. You can get ones that can be read by a microcontroller.

...R

When I put a part in the laser to mark it I need to know the height of the place that I'm marking. I use a ruler now but want to let the computer do that part.

I have a DRO to tell me the height of the Z axis but that does no good until I know the height it should be to focus on the part.

Its normally very straightforward to set that up unless it is an irregular part. Can you supply a link to the laser you are using.

Fibre marking lasers normally sort this out for themselves and 150mm to 300mm is rather a large focal length.

The link Tom supplied should do what you want but will be expensive.(possibly more than a new larser).

Fibre/disc lasers are not cheap.
Is this a homemade device ?
If so post a pic.

Attach a microswitch alongside the laser on the moving Z-axis head. Drive the head down until the switch touches the part. Then back off by the focus distance.

With a little programming, you can program this 'zeroing' operation to run every time you press the button.

LaserManGary:
When I put a part in the laser to mark it I need to know the height of the place that I'm marking. I use a ruler now but want to let the computer do that part.

I have a DRO to tell me the height of the Z axis but that does no good until I know the height it should be to focus on the part.

I can't make any sense of that. Positioning the height does not sound as if it has anything to do with the focus distance.

Can you post a diagram of your machine?

...R

Repost due to some posting problem

Boardburner2:
Its normally very straightforward to set that up unless it is an irregular part. Can you supply a link to the laser you are using.

Fibre marking lasers normally sort this out for themselves and 150mm to 300mm is rather a large focal length.

The link Tom supplied should do what you want but will be expensive.(possibly more than a new larser).

Fibre/disc lasers are not cheap.
Is this a homemade device ?
If so post a pic.

MorganS:
Attach a microswitch alongside the laser on the moving Z-axis head. Drive the head down until the switch touches the part. Then back off by the focus distance.

With a little programming, you can program this ‘zeroing’ operation to run every time you press the button.

Works well for plastic printers . :slight_smile:

No good for irregular parts though

Boardburner2:
Its normally very straightforward to set that up unless it is an irregular part. Can you supply a link to the laser you are using.

Fibre marking lasers normally sort this out for themselves and 150mm to 300mm is rather a large focal length.

The link Tom supplied should do what you want but will be expensive.(possibly more than a new larser).

Fibre/disc lasers are not cheap.
Is this a homemade device ?
If so post a pic.

90% of the parts I mark are irregular... I mark everything from stainless steel data plates (1mm thick, rectangular, all the same size/shape) to AR lowers (varying thickness and shapes as well as several places on any surface to possibly mark), and everything in between.

The focal range isn't 150mm to 300mm, that is the distance the Z axis can travel to accommodate the various size/shape parts.

The link isn't cheap, but a fraction of the laser - it was over $25,000 - not homemade.

MorganS:
Attach a microswitch alongside the laser on the moving Z-axis head. Drive the head down until the switch touches the part. Then back off by the focus distance.

With a little programming, you can program this 'zeroing' operation to run every time you press the button.

My previous co2 laser used this method for focusing and although it worked perfectly fine, it was slow and not suitable to every circumstance. ie. it wouldn't work on the bottom of a bowl or on a surface too small for the plunger switch to accurately touch. It would be much more convenient to point to a surface and have it measure to that point.

Do you see this as being a two-pass operation or single-pass? Two-pass would run a low-power laser and map out the surface for the computer before starting the second pass with the cutting laser. Single-pass would require dynamically moving Z to follow the surface at the same time as the cutting laser is making smoke.

Read recently where a bloke made a cnc machine using dc motors with quadrature encoder mechanism placed on the motor / screw shaft. The mechanics were rather basic but i think most was to mainly demonstrate the acuracy even with a crudely made piece of gear. So I looked for a quad encoder disc and matching optos .....found some on Ebay for about $4....see if I can find his web page and drop a link here for you..... Cheers

MorganS:
Do you see this as being a two-pass operation or single-pass? Two-pass would run a low-power laser and map out the surface for the computer before starting the second pass with the cutting laser. Single-pass would require dynamically moving Z to follow the surface at the same time as the cutting laser is making smoke.

It's actually neither of those - I click on the "Go" button and the Z axis moves up or down until it reaches the distance from the surface that I tell it is in focus. Then laser. Nothing interactive, no contours to follow.

LaserManGary:
, it was slow and not suitable to every circumstance. ie. it wouldn't work on the bottom of a bowl or on a surface too

It sounds like morgans has the right idea.
It will slow the process down though.

If you want dynamic focussing though that will be more difficult.

Using several distance sensors so that there is always one in the direction of travel could work.

Could you use my earlier suggestion perhaps using a separate laser for spot size ? Depends on smoke i suppose.

Autofocus engraverss exist although no one seems to want to tell how they work.

LaserManGary:
It's actually neither of those - I click on the "Go" button and the Z axis moves up or down until it reaches the distance from the surface that I tell it is in focus. Then laser. Nothing interactive, no contours to follow.

So then you are either engraving totally flat pieces or there is already a model of the 3D surface in the computer and you just need to calibrate where that 3D object has been placed for each run. Am I right?

So use the switch method. Sometimes it is called a 'probe'.