## 3 High-Dynamic Atmospheric Turbulence Compensation Algorithm
### Modeling Strategy  
In the context of our testbed, the wavefront reconstructor is a digital signal processor (DSP) which controls a digital-analog-converter (DAC) to produce an analog voltage of 0\(\sim\)2.226 volts which is subsequently amplified to 0\(\sim\)187 volts by a high voltage amplifier when controlling DM. When it comes to FSM, the 0\(\sim\)2.226 volts output of DAC is amplified to 0\(\sim\)10 volts. Due to the fact that the input of DAC is produced by DSP using a 24-bit data segment among which, there are 12 bits responsible for the voltage level of the output analog. Therefore, controlling voltages are expressed in a digital voltages range from 0 to 4095 within the capability of a 12-bit data segment. Literally, the relationship between the output analog voltages and input digital voltages of DAC follows Equation (3), where \(V_{analog}\) is the level of output analog voltage, \(V_{reference}\) is the reference voltage which is 1.25 volts in our context, and \(V_{digital}\) represents the digital voltage. \[V_{analog}=2V_{reference}\times\frac{V_{digital}}{2^{12}} \tag{3}\]  
When powered on, the initial digital voltages for the DM and FSM are 2048 and 2448, respectively. Furthermore, in order to choose a reasonable stroke of the wavefront correctors, the range of digital voltages are limited to \(-\)1600\(\sim\)\(+\)1600 and \(-\)400\(\sim\)\(+\)400 for the DM and FSM. Additionally, we ensure the precision of the digital voltages during the process of iteration by normalizing them to \(-\)1\(\sim\)1. Letting \(v_{i}\) and \(s_{i}\) represent the digital voltage and the normalized digital voltage of the \(i\)th electrode on DM or FSM, the normalization process is shown in Equation (4), where \(v_{initial}\) symbolises the digital voltages as our testbed is powered on 2048 for DM and 2448 for FSM. Meanwhile, \(v_{norm}\) is the normalization radius of the electrodes on DM which is designed to 1600 for DM and 400 for FSM in our experiment. Figure 4: (**a**) Spots distribution on SHWS without distortion. (**b**) Spots distribution on SHWS with distortion. \[s_{i}=(v_{i}-v_{initial})\div v_{norm} \tag{4}\]  
Because of the attribute of DMs, the response of DMs is a function with respect to the square of controlling voltages. Nevertheless, ref. [29] points out that in practical testing, measured data are always accompanied with noise. Due to the tension of the continuous membrane introducing reflective jitter and system-level noise, the spots offsets are not exactly proportional to the square of controlling voltages. Hence, we adopt their modeling strategy adding first-order terms and constant terms to the model for more accurate fitting results. Subsequently, by assuming there are totally \(M\) electrodes on DM, the model for \(offset_{i}\) which is the \(i\)th element in \(offset\) is shown as follows  
\[offset_{i}=\sum_{j=1}^{M}a_{i,j}\times s_{j}^{2}+b_{i,j}\times s_{j}+c_{i,j} \tag{5}\]  
where, \(a_{i,j}\), \(b_{i,j}\) and \(c_{i,j}\) symbolise coefficients of second-order terms, first-order terms, and constant terms, respectively. Additonally, the 37 electrodes are modeled one by one sequentially. During the procedure of modeling, we configure the electrodes for 10 cycles of calibration voltages, and record the spots offsets captured by SHWS. One cycle of calibration voltages contains 34 elements. Therefore, we gain 340 spots offsets vectors expressed as \(offset_{1}\sim offset_{340}\). Correspondingly, each spots offsets vector corresponds to an calibration voltage vector marked as \(S_{full,1}\sim S_{full,340}\). Equation (6) depicts the process of single electrode modeling. \[\left[offset_{1}\quad\cdots\quadoffset_{340}\right]=P_{DM}\times\left[S_{full,1 }\quad\cdots\quad S_{full,340}\right] \tag{6}\]  
where, \(P_{DM}\) is the model coefficients matrix for the currently modeled electrode. However, when modeling the \(j\)th electrode, the constant term of it describes the comprehensive effect of all \(M\) electrodes.