  An adaptive optics system with a single deformable mirror is being
implemented on the THEMIS 90cm solar telescope. This system is designed to
operate in the visible and is required to be as robust as possible in order to
deliver the best possible correction in any atmospheric conditions, even if
wavefronts are sensed on some low-contrast solar granulation. In extreme
conditions, the images given by the subapertures of the Shack-Hartmann
wavefront sensor get randomly blurred in space, in the set of subapertures, and
the distribution of blurred images is rapidly changing in time, some of them
possibly fading away. The algorithms we have developed for such harsh
conditions rely on inverse problem approach. As an example, with the gradients
of the wavefronts, the wavefront sensor also estimates their errors, including
their covariance. This information allows the control loop to promptly optimize
itself to the fast varying conditions, both in space (wavefront reconstruction)
and in time. A major constraint is to fit the calculations in a low-cost
multi-core CPU. An overview of the algorithms in charge of implementing this
strategy is presented, focusing on wavefront sensing.
