## 3 Polarization Control Algorithm  
In the process of accomplishing polarization control, the control algorithm is a key part. An effective tracking method should have fast convergence and stable output results. The most commonly used and simple control algorithms are the GD and GLD algorithms.  
The traditional polarization control method which locks to a fixed SOP typically utilizes the GD algorithm, which first calculates the gradient of the feedback signal, and then updates the HWP or phase shifter accordingly [22; 23]. The gradient of the GD method is obtained by adding a perturbation and finding the secant. Different Poincare sphere trajectories and state of polarization change rates (RSOP) lead to different azimuth-changing velocities of the LO. When the azimuth angle (phase) of HWP (phase shifter) cannot keep up with the azimuth variation of input LO, the feedback signal will fall into an uncontrolled area. In the event of the above situation, there will be a large error in the calculation of the gradient, which leads to fluctuations in the SOP of the output optical signal.  
Considering the simplification of the control loop in the SHC system, the DSP optimization equation in this control system is simpler. On this basis, the GLD algorithm may be better suited to control injected SOP of the PC. The flow of the variable-step GLD algorithm in MZI-structure PC is shown in Figure 6. \(\varepsilon_{I}\) represents the input feedback signal of the DSP module, while \(\theta_{1}\) and \(\theta_{2}\) represent the azimuth of the first and second phases of the phase shifter, respectively. The updated formula of MZI is as Equation (13). The method of shifting \(\theta_{1}\) is shown in Equation (14). The initial value of \(n\) is set to 1. When \(\theta_{2}=0\) or \(\pi\), \(n=n+1\).  
\[\theta_{2}(i+1)=\theta_{2}(i)+sign[\varepsilon_{I}(i)-\varepsilon_{I}(i-1)] \cdot\Delta\theta_{1/2} \tag{13}\]  
\[\theta_{1}=\frac{\pi}{2}+\frac{\pi}{2}\cdot(-1)^{n} \tag{14}\]  
When the feedback signal value converges, the algorithm stops tracking. Then DSP continues to judge the value of the feedback signal and to track once the feedback signal is  
\begin{table}
\begin{tabular}{c c c} \hline \hline
**Parameter** & **HWP [21]** & **MZI [18]** \\ \hline Half-wave voltage & 10 vs. & 2.4 v \\ Length & 6.2 cm & 1.5 cm \\ Response time & \(<\)100 ns & \(<\)5 ns \\ Optical insertion loss & 2.4–3.0 dB & 0.92 dB \\ Operating wavelength & 1.5–1.6 um & 0.4–5 μm \\ Reset & NO & YES \\ \hline \hline \end{tabular}
\end{table}
Table 1: Some parameters of PC based on HWP or MZI.  
out of control. To elevate tracking ability and improve the convergence speed, a variable-step GLD algorithm can be used, that is, when the SOP of LO is far from the target position, select a larger step size \(\Delta\theta_{1}\) for tracking, and if it is near target position, select a smaller one \(\Delta\theta_{2}\) for tracking. The criteria for step selection are based on the feedback signal, which will be discussed in the next section.  
This method can not only ensure high precision of the signal after control but also improve the ability to track a larger RSOP. In the HWP architecture, the only difference is that \(\theta_{1}\) and reset are not required.