Abstract
An automated alignment procedure, based on wavefront measurement with a single-grating interferometer, has been developed for precise tuning of Kirkpatrick-Baez nanofocusing mirrors for X-ray free-electron lasers (XFELs). This approach optimizes focus size and maximizes peak intensity while minimizing aberrations. Wavefront errors are quantitatively correlated with alignment deviations - incidence angle, perpendicularity and astigmatism - via Legendre polynomial analysis. These errors are subsequently corrected through a straightforward optimization process. Implemented at the SPring-8 Angstrom Compact Free-Electron Laser (SACLA), the system consistently achieves a reproducible XFEL focus below 150 nm × 200 nm within 10 min. Routine operation at SACLA demonstrates the reliability and efficacy of this method, enabling rapid restoration of optimal nanofocusing conditions.