# Research on a Decoupling Algorithm for the Dual-Deformable-Mirrors Correction System
## 2 Principle of Wavefront Correction with Dual Deformable Mirrors
### Principle of Separation Coefficient Algorithm
According to Equations (5) and (6), the conversion matrix \(T\) from the Zernike mode coefficient to the control voltage of the DM can be obtained as [9]:  
\[T=C_{ff}(i,j)^{-1}\cdot C_{fz}(i,j) \tag{7}\]  
In the equation, \(C_{fz}\) is the cross-correlation matrix obtained from Equation (5). \(C_{ff}\) is the autocorrelation matrix obtained from Equation (6). \(C_{ff}^{-1}\) is the inverse matrix of matrix \(C_{ff}\); then, the expression of the control voltage to be loaded each time by the DM is [9]:  
\[v=T\cdot a \tag{8}\]  
In the equation, \(a=[a_{1},a_{2},...,a_{n}]^{T}\) is the Zernike coefficient, dimension is \(n\times 1\), and \(n\) is the order of the Zernike polynomial. \(T\) is the transformation matrix between Zernike mode coefficients and DM control voltages. \(v=[v_{1},v_{2},...,v_{p}]^{T}\) is the initial control voltage of the DM, and \(P\) is the number of actuators of the DM. The Shack-Hartmann Wavefront Sensor (SH-WFS) can measure the slope, and its slope matrix is represented as:  
\[S\ =\ Z\cdot a \tag{9}\]  
In the equation, \(S=\left[S_{x1},S_{x2},...,S_{xm},S_{y1},S_{y2},...,S_{ym}\right]\) is the slope matrix directly measured by the SH-WFS, dimension is \(2m\times 1\), and \(m\) is the number of subpertures of the SH-WFS. \(Z\) is the wavefront reconstruction matrix, dimension is \(2m\times n\). \(a=[a_{1},a_{2},...,a_{n}]^{T}\) is the Zernike coefficient, dimension is \(n\times 1\), and \(n\) represents the order of the Zernike polynomial. According to the wavefront reconstruction principle of the Zernike mode method [15], the Zernike coefficient can be reconstructed using the measured slope \(S\), and the expression is as follows:  
\[a=Z^{+}\cdot S \tag{10}\]  
In the equation, \(Z^{+}\) is the generalized inverse matrix of \(Z\). The mode coefficient expression for correcting aberrations with Woofer is as follows:  
\[a_{w}=I_{w}\cdot a=I_{w}\cdot Z^{+}\cdot S \tag{11}\]  
In the equation, \(a_{w}=[a_{w1},a_{w2},...,a_{wn}]^{T}\) is the mode coefficient assigned to the Woofer for aberration correction. \(I_{w}\) is the diagonal matrix of \(n\times n\), also known as the limiting matrix of low-order aberrations. For example, if the Woofer corrects 1 st- to 2 nd-order aberrations, the expression for \(I_{w}\) is as follows:  
\[I_{w}=\left[ \begin{array}{cccc}1&&&&\\ &1&&&&\\ &&0&&\\ &&...&&\\ &&&0&\\ &&&&0\end{array} \right] \tag{12}\]  
Based on Equation (8), the initial control voltage of the Woofer can be directly calculated. The expression is:  
\[v_{w}=T_{w}\cdot a_{w}=T_{w}\cdot I_{w}\cdot Z^{+}\cdot S \tag{13}\]  
In the equation, \(v_{w}=[v_{w1},v_{w2},...,v_{wh}]^{T}\) is the initial control voltage of the Woofer, and \(h\) is the number of actuators for the Woofer. \(T_{w}\) is the conversion matrix between the Zernike mode coefficient and the control voltage of the Woofer, calculated by Equations (5)-(7). \(a_{w}\) is the mode coefficient that the Woofer calculated by Equation (11) will correct for aberrations. After obtaining the initial control voltage of the Woofer using Equation (13), a PI controller is used to solve the final control voltage of the Woofer and send it to the Wooferfor operation. In order to accurately calculate the control voltage of the Woofer, the final control voltage expression of the Woofer at time \(k\) is:  
\[V_{w}(k)=k_{i\_w}\cdot V_{w}(k-1)+k_{p\_w}\cdot v_{w}(k-1) \tag{14}\]  
In the equation, \(k_{i\_w}\) is the integral gain coefficient of the PI controller, and \(k_{p\_w}\) is the proportional gain coefficient of the PI controller. \(V_{w}(k)=[V_{w1},V_{w2},V_{w3},...,V_{wh}]^{T}\) is the final control voltage of the Woofer, and \(h\) is the number of actuators for the Woofer. \(v_{w}(k-1)\) is the initial control voltage of the Woofer calculated at the previous moment.