## 4 AFC Algorithm for FSM Motion System  
During the operation of the AFC algorithm in FSM motion systems, dynamic disturbances are generated by mechanical vibration and atmospheric turbulence. Specifically, disturbances from sudden mechanical vibrations amplify certain frequency components, compromising the control system's robustness and reducing its convergence speed. Therefore, to enhance the tip-tilt control performance by suppressing these disturbances, an AFC algorithm can be designed to operate in parallel with the feedback controller (i.e., the PI controller), as depicted in Figure 12.  
An AFC algorithm is particularly effective in this scenario because it improves the attenuation of periodic disturbances without requiring a redesign of the feedback controller. Theoretically, a disturbance model can be integrated into the feedback loop based on the identified plant model specifications, and this approach can simply be extended to account for multiple sinusoidal components. In addition, the proposed AFC algorithm can be more easily optimized, considering the frequencies of various disturbances. Figure 11: Actuating resolution of FSM motion system: (**a**) tip direction; (**b**) tilt direction. Figure 12: Schematic of FSM control system with AFC algorithm. The disturbance model in the feedback loop of the FSM motion control system is expressed as follows:  
\[d(k)=\sum_{i=1}^{n}\{a_{i}(k)cos(\omega kT_{s})+b_{i}(k)sin(\omega kT_{s})\}. \tag{4}\]  
\(C_{AFC}\) denotes the AFC algorithm in the feedback loop, while its continuous and discrete forms are denoted by \(C_{AFC}\)(s) and \(C_{AFC}\)(z), respectively; these forms are expressed as follows:  
\[\text{Continuous form}:\ C_{AFC}(s)=\text{g}_{i}\Bigg{\{}\frac{cos(\varnothing _{i})s-\sin{(\varnothing_{i})\omega_{i}}}{s^{2}+\omega_{i}^{2}}\Bigg{\}}, \tag{5}\]  
\[\text{Discrete form:}\ C_{AFC}(z)=\text{g}_{i}\Bigg{\{}\frac{cos(\varnothing _{i})z^{2}-cos(\omega_{i}T_{s}+\varnothing_{i})z}{z^{2}-cos(\omega_{i}T_{s})z+ 1}\Bigg{\}}, \tag{6}\]  
where \(T_{s}\), \(\omega_{i}\), \(\beta_{i}\), and \(\phi_{i}\) are the sampling time, periodic frequency, adaptive gain, and the phase angle gain of the AFC algorithm, respectively. For the cancellation of periodic disturbances, the control input of the AFC algorithm adopts the following form in discrete time:  
\[u_{AFC}[k]=\hat{d}(k)=\sum_{i=1}^{n}\Big{\{}\hat{d}_{i}[k]cos(\omega T_{s}k)+ \hat{b}_{i}[k]sin(\omega T_{s}k)\Big{\}}. \tag{7}\]  
The update laws for the elimination of periodic disturbances are as follows:  
\[\hat{a}_{i}[k]=\hat{a}_{i}[k-1]+\text{g}_{i}e(k)cos(\omega_{i}T_{s}+\varnothing _{i}), \tag{8}\]  
\[\hat{b}_{i}[k]=\hat{b}_{i}[k-1]+\text{g}_{i}e(k)sin(\omega_{i}T_{s}+\varnothing _{i}), \tag{9}\]  
For sinusoidal compensation, the AFC algorithm can be designed by adjusting \(g_{i}\) and \(\phi_{i}\). The adaptation gain \(g_{i}\) requires careful selection through experiments. The disturbance-attenuation performance of the FSM motion system can be improved by increasing the magnitude of the open-loop frequency response at the disturbance frequency of the FSM motion system. However, if \(g_{i}\) is excessively large, the response of the control system at other frequencies will become extremely unstable. Therefore, the fastest convergence (i.e., the fastest elimination of periodic disturbances) must be achieved at a low adaptive gain. Concurrently, it is necessary to select the appropriate \(\phi_{i}\) at \(\omega\) (periodic disturbance frequency), which is expressed as follows:  
\[\varnothing_{i}=\angle\frac{P(\text{z})}{1+P(z)C_{PI}(\text{z})}\ at\ \omega_{i}, \tag{10}\]  
where \(P\)(z) represents the designed FSM motion system, and \(C_{PI}\)(z) is the PI controller. The proposed control system design for the FSM motion in this study simultaneously eliminated periodic disturbance and managed vibrations in the experimental environment.