# Adaptive PI + VPI Harmonic Current Compensation Strategy under Weak Grid Conditions
## 3 Adaptive SRF-PLL Based on a Lattice Notch Filter
### Adaptive Lattice Notch Filter  
To maintain the high attenuation ability of the notch filter in the case of voltage unbalance, distortion and frequency deviation under weak grid conditions, this paper proposes an adaptive lattice notch filter based on the recursive gradient descent algorithm (RGDA). The main structure adopts the lattice structure shown in Figure 7. The parameter \(\theta_{2}\) that determines the notch bandwidth is fixed, and the parameter \(\theta_{1}\) that determines the notch frequency is dynamically adjusted by the adaptive algorithm. The goal of the adaptive algorithm is to filter out a frequency signal determined by \(\theta_{1}\) in \(y(n)\) as much as  
Figure 7: The structure of the lattice notch filter: (**a**) The structure of the lattice unit; (**b**) the notch filter \(N(z)\). possible. Therefore, the energy of the filtered output signal can be used as an indicator function, as shown in (32), and tends to be minimized. \[y(n)=N(z)\cdot u(n) \tag{32}\]  
\[J=E[y^{2}(n)] \tag{33}\]  
In this paper, the fixed \(\theta_{2}\) bandwidth control parameters are used, and the adaptive parameters are only \(\theta_{1}\). The recursive gradient descent algorithm is used. Assuming that the adaptive step size is \(\mu\), the adaptive process is shown in (34). The last item contains the negative gradient term \(-\
abla_{\theta_{1}(n)}\). \[\theta_{1}(n+1)=\theta_{1}(n)+\mu\cdot y(n)\cdot\underbrace{(-\frac{\partial y (n)}{\partial\theta_{1}})}_{-\
abla_{\theta_{1}}(n)} \tag{34}\]  
The partial derivative of \(\theta_{1}\) is obtained in Equation (32). \[\frac{\partial y(n)}{\partial\theta_{1}}=\frac{1+\sin\theta_{2}}{\cos\theta_{ 2}}\underbrace{\frac{1-\sin\theta_{2}}{2}\frac{1-z^{-2}}{D(z)}}_{P(z)}x_{1}(n) \tag{35}\]  
\[x_{1}(n)=\frac{\cos\theta_{1}\cos\theta_{2}z^{-1}}{D(z)}u(n) \tag{36}\]  
\[D(z)=1+\sin\theta_{1}(1+\sin\theta_{2})z^{-1}+\sin\theta_{2}z^{-2} \tag{37}\]  
The intermediate variable defined in (36) is the signal after the forward output delay of the \(\theta_{1}\) unit of the lattice filter, and (37) is the characteristic polynomial of the lattice filter. The adaptive lattice notch filter structure based on the recursive gradient descent algorithm is shown in Figure 8. The index function is a nonquadratic function of the notch frequency parameter. However, as the bandwidth determined by the parameter \(\theta_{2}\) decreases, the gradient \(\partial E[y^{2}(n)]/\partial\theta_{1}\) will make the convergence very \"dull\". If the initial frequency is far away from the notch frequency, the convergence speed will be very slow. To improve the convergence speed, the recursive gradient descent adaptive iterative expression (34) is rewritten as Equation (38). It can be proven that Equation (38) has a stronger driving ability and smaller calculation amount of the iterative algorithm, which can be called the simplified recursive gradient descent algorithm. \[\theta_{1}(n+1)=\theta_{1}(n)-\mu\cdot y(n)\cdot x_{1}(n) \tag{38}\]  
Figure 7:0 Adaptive lattice notch filter based on the recursive gradient descent algorithm. The derivation analysis of the driving terms of Equations (34) and (38) is as follows:  
Figure 7:1  
Figure 7:2  
Equation (39) indicates that the simplified gradient algorithm and the gradient algorithm can finally converge to the notch signal frequency with the same local linearization convergence model. Equation (40) indicates that in the process of frequency adaptation, the driving term of the simplified gradient algorithm is always stronger than that of the gradient algorithm, so it can ensure faster convergence speed. Figure 9 presents the value \(\theta_{1}\) of the driving term when the notch frequency converges to \(\omega_{0}=0.5\pi\) when the notch bandwidth parameter \(\theta_{2}\) is \(0.2\pi\) and \(0.4\pi\). The curve verifies the above analysis.