Autofocus camera technology is so well established in consumer, industrial and medical applications, that it is easy to forget the complex mechanical and electronics system required to make it work well. One widely used method is described below.
The basic idea is to change the distance from the lens to the light-sensitive surface (matrix or film) and provide focus. This can be achieved either by moving the lens or moving light-sensitive surface. Depending on the application that movement is powered by ultrasonic piezoelectric motor, stepper motor or VCM motor.
The images below shows lens movement being controlled by an actuator. The actuator creates linear movement of a rod and a return spring ensures a force-closure. This eliminates any gap between the rod and a carriage.
Two guides are used in this system to minimize dynamic and static position errors of the lens carriage.
The support electronics for the actuator provide the signal analysis required to determine the correct position.