the objective lens focus in discrete steps over a certain range. Because varying the focus induces phase shifts into the electron wave field, this technique has similarities to interferometry.
Sophisticated AI algorithms have been developed to correct electron trajectories, improve the control of electron lenses in real time, and automatically align the beam, while rectifying astigmatism, ...