# Adaptive Neural Network for a Stabilizing Shunt Active Power Filter in Distorted Weak Grids
###### Abstract
In this method, if the grid voltage were unbalanced/distorted, the voltage angle would not be well estimated and would cause the active filter to malfunction. (3) DC-link voltage regulation: The DC-link capacitor voltage must be monitored continuously, as the capacitor must momentarily inject current into the line. The current injection causes the capacitor voltage to drop, which must be controlled by the capacitor voltage control algorithm. In [16], a low-pass filter (LPF) was used to filter ripples. In [17], the authors proposed a method to minimize DC-link capacitance through direct current control, while [18] proposed a predictive scheme for DC-link voltage control of back-to-back converters based on energy-balance modeling. Summarizing according to the classification of filter control system issues, the significant shortcomings observed in existing works can be mentioned as follows:  
In [19], a passive filter was used to remove existing harmonics. Among the weaknesses of the inherent structure of this method is that it does not deal with a wide range of harmonics. In addition, one of the basic defects of the passive filter is the possibility of resonance and a sharp rise in the passing current. The SAPF used in [20] was inconsistent in dealing with nonlinear current, and in this paper, it was not possible to detect and remove harmonics completely in the control structure of the filter. Removing a major part of the harmonics created in the grid by the method mentioned in [21,22] involves the complexity of calculations, which increases the cost and inefficiency of the system. The most critical point noted in these studies is the failure to design and adjust PLL control gains in weak-grid connections. This is because the performance of conventional PLLs in the direction of detecting the phase angle is inefficient in weak-grid conditions. It may cause instability in the system due to the adverse interaction of the PLL for phase angle detection with the current controller to adjust the phase angle for delivering the reference current. Since the grid impedance is high, there would be a significant phase angle shift in the voltage (caused by the current controller), which affects the PLL performance for detecting the stable phase angle of the voltage [23]. In addition, one of the main parts of the SAPF control structure is the regulation of the DC-link voltage. In [24,25], reducing the transient response of the DC-bus voltage and unwanted changes in the DC-link voltage in the mode transient also had relatively complex control blocks and methods, and during large transient changes, the DC-link voltage changed dramatically and the protective mechanism was likely to be activated. In this paper, the active filter was used to deal with the harmonics created by power electronics tools in the grid. To determine the current reference in the first part of the filter control structure, ADALINE was used. In the second part of the control structure, to synchronize the phase angle of voltage and current, an approach that has two modes was used. First, the synchronization was performed by considering the conventional PLL, and in the second case, it used the RSF and RSQSF PLL model, which led to the matching of voltage and current phase angles. Finally, in the third part of the control structure, a proportional-integral (PI) controller was used, which is responsible for tracking the voltage error signal and comparing it with the reference voltage and which leads to setting the DC voltage level of the capacitor at any desired level. The methodology proposed in the paper can be summarized as follows:  
(1) In this paper, an active filter is used to reduce the harmonics created in the grid, which is easier to install and has a lower operating cost compared to passive filters. (2) In the control structure of the filters, the ADALINE network is used to determine the current reference, which has a better performance than other methods due to good prediction and a reduction in response delay.