I have a modified pico video projector that I need to add an autofocus to. The focusing ring already has a fast stepper motor added to it.
If the focus had to be done on the middle of the projection frame I suppose I could just put a laser distance sensor in the optical path of the projection by having a 45 degree IR reflect, visible spectrum pass dichro attached after and maybe before the final focusing and zooming lens. But I want the ability to focus to any point in the frame. This requires the sensor to be able to be rotated, or if it goes through lenses, tilted in two axis. I could do that with a small gantry system with stepper motors and the distance sensor attached to it, or galvonometer mirrors that would reflect the distance sensor beam to a given point/angle, but there may be a better way or a better sensor for this I am not aware of which wouldn't require so many parts.
Requirements are ability to measure distance up to 4 meters, accuracy about at least +-5cm up to 1 meter, +-10cm after that, which I believe is not much to ask from a sensor and acceptable accuracy for a video projection focus. Measuring on shiny or reflective surfaces don't need to be supported as projectors don't project properly on those.
Having a camera and software which focuses until software finds the sharpest result would work if it was fast enough (200 ms). As I understand with this method the lens is focused until the sharpest image is detected which is slow.