I did some trial laser focus adjustments and have concluded that the setup that I have is adequate for my requirements. I was concerned about the settling time from my initial observations but after evaluating some data I've decided that I probably won't achieve a substantially better result. My initial goal for this project was to achieve a +/- 0.2 mm accuracy by using measurement averaging. For my laser application somewhere between +/- 0.5 mm and +/- 1 mm is acceptable.
There are two data plots below.
The first plot uses the program and the LaserGRBL setup that I described in earlier blogs. My focal distance is 39 mm and I've adjusted the reading offset on the microLIDAR sensor using a printed calibration block.
I'm starting > 6 mm above the the 39 mm target (arbitrary - simulates changing from thicker to thinner material without manually adjusting the Z position first). The search moves down at 20 mm/min (ramp to allow for averaging). After it finds the target it backs up 2 mm and then redoes the search at 2 mm/min (to account for initial overshoot due to averaging). I did two runs to check for repeatability. You can see that I wasn't too precise in setting the starting Z position. The runs seem to be fairly settled at about 90 seconds.
For the second plot I made sure that I adjusted the start position a bit more precisely for both runs to get the data better aligned. I also changed the back off to 1 mm since the overshoot did not seem that large. These runs seem to be fairly settled at around 60 seconds. The final value has about +/- 0.2 mm of noise although it appears to average around the target value.
Here is a short video showing the laser head movement and the measured value on the MicroView display. You can see it stop and backup before converging on the final value.
So there is still room for improvement and I still plan to do some characterization of the measurement stability of the VL6180X, but for now I think this will meet my needs.
Here are links to my previous Nanorama blog posts:
Adding Z Align (Laser Focus) Button to LaserGRBL