Adaptive optics mitigates optical phase aberrations caused by atmospheric turbulence or imperfect media in real time. A Shack-Hartmann lenslet array senses local wavefront slope errors, and a high-bandwidth feedback controller drives an array of piezoelectric micro-actuators behind a deformable mirror to flatten distorted wavefronts into diffraction-limited plane waves.