# 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
At the same time, the mode coefficient expression for correcting aberrations in Tweeter is as follows:  
\[a_{t}=I_{t}\cdot a=I_{t}\cdot Z^{+}\cdot S \tag{15}\]  
In the equation, \(a_{t}=[a_{t1},a_{2},...,a_{tn}]^{T}\) is the mode coefficient assigned to Tweeter for aberration correction. \(I_{t}\) is the diagonal matrix of \(n\times n\), also called the limiting matrix of higher-order aberrations. For example, if Tweeter only corrects 3 rd-order aberrations, the expression for \(I_{t}\) is as follows:  
\[I_{t}=\left[ \begin{array}{cccc}0&&&&\\ &0&&&\\ &&1&&\\ &&...&\\ &&&0&\\ &&&&0\end{array} \right] \tag{16}\]  
According to Equation (8), the initial control voltage of the Tweeter can be directly calculated, and its expression is:  
\[v_{t}=T_{t}\cdot a_{t}=T_{t}\cdot I_{t}\cdot Z^{+}\cdot S \tag{17}\]  
In the equation, \(v_{t}=[v_{t1},v_{t2},...,v_{t}]^{T}\) is the initial control voltage of the Tweeter, and \(t\) is the number of actuators for the Tweeter. \(T_{t}\) is the conversion matrix between Zernike mode coefficient and the Tweeter control voltage, calculated by Equations (5)-(7). \(a_{t}\) is the mode coefficient of the Tweeter calculated by Equation (15) that will correct for aberrations. After obtaining the initial control voltage of the Tweeter using Equation (17), a PI controller is used to solve the final control voltage of the Tweeter and send it to the Tweeter for operation. In order to accurately calculate the control voltage of the Tweeter, the final control voltage expression of the Tweeter at time \(k\) is:  
\[V_{t}(k)=k_{i\_t}\cdot V_{t}(k-1)+k_{p\_t}\cdot v_{t}(k-1) \tag{18}\]  
In the equation, \(k_{i\_t}\) is the integral gain coefficient of the PI controller, and \(k_{p\_t}\) is the proportional gain coefficient of the PI controller. \(V_{t}(k)=[V_{t1},V_{t2},V_{t3},...,V_{tn}]^{T}\) is the final control voltage of the Tweeter, and \(t\) is the number of actuators for the Tweeter. \(v_{t}(k-1)\) is the initial control voltage of the Tweeter calculated at the previous moment. By using Equations (14) and (18), the final control voltage of the Woofer and the Tweeter can be calculated to obtain the corrected wavefront phase. The corrected wavefront phase is denoted as \(\phi^{k}\), and the iterative phase expression after the \(k\)-th correction is:  
\[\phi^{k+1}=\phi^{k}+(V_{w}^{k}\cdot f_{w})+(V_{t}^{k}\cdot f_{t}) \tag{19}\]  
In the equation, \(f_{w}\) is the influence function of the Woofer, and \(f_{t}\) is the influence function of the Tweeter. In practical applications, the measurement and calculation of \(Z\), \(Z^{+}\), \(T_{w}\), \(T_{t}\),\(f_{w}\) and \(f_{t}\) can be completed in advance and saved for future use, allowing for quick and efficient access during the calibration process. This decoupling algorithm not only streamlines the program's performance by reducing its running time and storage space but also significantly enhances computational efficiency. This decoupling algorithm provides the flexibility to correct any order of aberration independently, while also enabling independent correction of each order of aberration. This makes it highly adaptable to different types of dual-deformable-mirrors system and enables efficient and accurate wavefront correction for a wide range of applications. The above elucidates the principle of the separation coefficient algorithm, and the flowchart of the algorithm is illustrated in Figure 2. The algorithm proposed in this article is implemented using MatlabR2016b software. The process begins by setting the slope data \(S_{r}\) of the ideal wavefront to a 0 matrix, representing a plane wavefront. The slope data collected by the Hartmann wavefront sensor, \(S_{c}\), is then subtracted from \(S_{r}\) to obtain the error slope \(S_{e}\). Using the wavefront reconstruction principle, \(S_{e}\) is converted into Zernike coefficients, which are then used to calculate the Zernike coefficients that need to be corrected by FSM and DM. A limited matrix is used for this purpose.