## 3 Controller Design and Analysis  
The comprehensive control strategy is outlined in the framework diagram presented in Figure 2. The architecture of the innovative networks is illustrated in Figure 3.  
Layer I (input layer): The input of the neural network is customized according to the requirements of the specific problem and introduced into the network processing through this layer. The signal transfer of this layer is expressed as follows:  
\[net_{i}^{1}(N)=x_{i}^{1}(N) \tag{2}\]  
\[y_{i}^{1}(N)=f_{i}^{1}\left(net_{i}^{1}(N)\right)=net_{i}^{1}(N) \tag{3}\]  
where \(x_{i}^{1}(N)\) and \(y_{i}^{1}(N)\) represent the input and output of the node, respectively, the superscript represents the number of layers in which the variable exists, the subscript  
Figure 1: The schematic representation of a single-phase active power filter. Layer II (membership function layer/fuzzy layer): In this layer, Gaussian functions with center vectors and uncertain base widths are utilized to enhance the neural network's capability in handling nonlinearity. Let the \(j\)-th group in the type-2 fuzzy output set be defined as \([\underline{\mu}_{jj}^{2},\overline{\mu}_{jj}^{2}]\). The relationship between input and output is expressed as follows:  
\[x_{ij}^{2}(N)=y_{i}^{1}(N) \tag{4}\]  
\[\underline{\mu}_{ij}^{2}(N)=\exp\left[-\frac{1}{2}\left(\frac{x_{ij}^{2}(N)- \underline{c}_{ij}^{2}}{\underline{c}_{ij}^{2}}\right)^{2}\right] \tag{5}\]  
\[\overline{\mu}_{ij}^{2}(N)=\exp\left[-\frac{1}{2}\left(\frac{x_{ij}^{2}(N)- \overline{c}_{ij}^{2}}{\overline{c}_{ij}^{2}}\right)^{2}\right] \tag{6}\]  
where \(\mu_{ij}^{2}\), \(c_{ij}^{2}\), and \(\sigma_{ij}^{2}\) represent the output of the node, the center vector, and the base width of the Gaussian function, respectively. In addition, the lower bound and upper bound of the variable are distinguished by \"\(\divide\)\" and \"\(\divide\)\", respectively. Layer III (rule layer): This layer consolides input signals received from the preceding layer. The detailed rules are expressed as follows:  
\[\underline{F}_{k}^{3}=\prod\limits_{i=1}^{I}\underline{\mu}_{ij}^{2};\overline {F}_{k}^{3}=\prod\limits_{i=1}^{I}\overline{\mu}_{ij}^{2} \tag{7}\]  
\[\underline{f}_{k}^{3}=\frac{\underline{F}_{k}^{3}}{\sum\limits_{k=1}^{K} \underline{F}_{k}^{3}};\overline{J}_{k}^{3}=\frac{\overline{F}_{k}^{3}}{\sum \limits_{k=1}^{K}\overline{F}_{k}^{3}} \tag{8}\]  
where \(f_{k}^{3}\) represents the output of the rule layer after normalization. Layer IV (self-feedback recursive layer): This layer integrates signals from the rule layer with past information regarding this layer's output (handled and stored through a temporary recursive structure), and the specific operational logic is as follows:  
Figure 3.0  
Figure 3.1  
Figure 3.2  
Figure 3.3  
Figure 3.4  
Figure 3.5  
Figure 3.6  
Figure 3.7  
Figure 3.8  
where \(x^{4}(N)\) denotes the signal from the rule layer at the current sampling time; \(x^{4c}(N)\) represents the historical information stored in the temporary recursive structure; \(\omega^{4c}\) represents a self-feedback weight; \(\omega^{4}\) signifies the weight of the SFR layer; \(\alpha\) serves as the self-feedback gain, determining the weighting of historical information; \(b_{l}^{4}\) is a bias term; \(\sigma(\cdot)\) denotes a sigmoid activation function. Layer V (output layer): The output of the network is computed through weighted operation, expressed as follows:  
Figure 3.9  
The super-twisting sliding mode control (STSMC) is implemented to mitigate chattering. In this study, an adaptive rate for gain \(k_{1}\) is additionally devised to alleviate the challenges associated with parameter adjustment, as illustrated in \[net_{i}^{1}(N)=x_{i}^{1}(N) \tag{2}\]0 Assume the tracking error of the APF system is as follows:  
\[net_{i}^{1}(N)=x_{i}^{1}(N) \tag{2}\]1  
where \(x\) corresponds to the actual compensation current in the APF system and \(x_{r}\) represents its expected value.