  The search for exoplanets is pushing adaptive optics systems on ground-based
telescopes to their limits. One of the major limitations at small angular
separations, exactly where exoplanets are predicted to be, is the servo-lag of
the adaptive optics systems. The servo-lag error can be reduced with predictive
control where the control is based on the future state of the atmospheric
disturbance. We propose to use a linear data-driven integral predictive
controller based on subspace methods that is updated in real time. The new
controller only uses the measured wavefront errors and the changes in the
deformable mirror commands, which allows for closed-loop operation without
requiring pseudo-open loop reconstruction. This enables operation with
non-linear wavefront sensors such as the pyramid wavefront sensor. We show that
the proposed controller performs near-optimal control in simulations for both
stationary and non-stationary disturbances and that we are able to gain several
orders of magnitude in raw contrast. The algorithm has been demonstrated in the
lab with MagAO-X, where we gain more than two orders of magnitude in contrast.
