We describe a technique for aligning the axis of an optical system with the axis of a rotating mechanical system. The optical system is focused onto a linear grating that rotates in conjunction with the mechanical system. Light reflected from the grating produces an interference pattern in the pupil of the optical system. Temporal modulation of the fringes in the interference pattern is observed as the mechanical system rotates if the optical and mechanical axes are misaligned. Experimentally we demonstrate alignment to better than 0.1 μm.