# Low Current Ripple Parameter-Free MPCC of Grid-Connected Inverters for PV Systems
## 3 Control Algorithm
### LESO Based on Ultralocal Model  
In the modern control theory, the first-order ultralocal model of a single-variable system can be built as  
\[\dot{y}=F+\alpha u \tag{7}\]  
where \(y\) and \(u\) represent the system output and input, respectively; \(\alpha\) denotes a nonphysical scaling factor of system input; \(F\) is the sum of the known and unknown part of the system. In conjunction with (2), the ultralocal mathematical model of grid-connected system can be constructed in a rotating \(dq\) frame as  
\[\frac{\mathrm{d}}{\mathrm{d}t} \begin{bmatrix}i_{d}\\ i_{q}\end{bmatrix} = \begin{bmatrix}F_{d}\\ F_{q}\end{bmatrix} + \begin{bmatrix}\alpha_{d}&0\\ 0&\alpha_{d}\end{bmatrix}\begin{bmatrix}u_{d}\\ u_{d}\end{bmatrix}  \tag{8}\]  
with \( \begin{bmatrix}F_{d}\\ F_{q}\end{bmatrix} = \begin{bmatrix}-R/L_{f}&\omega_{e}\\ -R/L_{f}&-\omega_{e}\end{bmatrix}\begin{bmatrix}i_{d}(k)\\ i_{q}(k)\end{bmatrix} - \begin{bmatrix}1/L_{f}&0\\ 0&1/L_{f}\end{bmatrix}\begin{bmatrix}e_{d}(k)\\ e_{q}(k)\end{bmatrix} ;\alpha=\frac{1}{L_{f}}\). Obviously, \(\alpha\) is constant so it can be confirmed by tuning in the practical system, while \(F\) is still much susceptible to motor parameters, and it decides the accuracy of the ultralocal model. In this way, according to (8), a LESO can be built as  
\[\left\{ \begin{aligned} & err=\overset{\wedge}{i_{s}}-i_{s}\\ \overset{\wedge}{i_{s}}=\overset{\wedge}{F}+\alpha u_{s}-\beta_{1}err\\ &\overset{\wedge}{F}=-\beta_{2}err\end{aligned} \right. \tag{9}\]  
where \(s\in[d,q]\). The \(i_{s}\) and \(F\) are chosen as the state variables. The superscript \"\(\wedge\)\" represents the estimated value; \(\beta_{1}\) and \(\beta_{2}\) are the gain coefficients of LESO. Apply S-transform to (9), it can be rearranged as  
\[\overset{\wedge}{i_{s}}(s)=\frac{(\beta_{1}s+\beta_{2})i_{s}+s\alpha u_{s}}{s ^{2}+\beta_{1}s+\beta_{2}} \tag{10}\]  
Therefore, the characteristic equation of the LESO can be obtained as  
\[s^{2}+\beta_{1}s+\beta_{2}=0 \tag{11}\]  
To keep the system in a stable state, the roots of the characteristic equation should fall at \(-\omega_{0}\). On this premise, the gain coefficients \(\beta_{1}\) and \(\beta_{2}\) are set as  
\[\left\{ \begin{aligned} &\beta_{1}=2\omega_{0}\\ &\beta_{2}=\omega_{0}^{2}\end{aligned} \right. \tag{12}\]  
where \(\omega_{0}\) is the bandwidth of the LESO. There is little doubt that an appropriate bandwidth is in favor of the satisfactory steady-state and dynamic performance of the LESO. For the further design of \(\omega_{0}\), (9) is transformed by forward Euler discretization equation and \(z\)-transform in turn, as \[\left\{ \begin{matrix}err(z)=\overset{\wedge}{i_{s}}(z)-i_{s}(z)\\ z\overset{\wedge}{i_{s}}(z)=\overset{\wedge}{i_{s}}(z)+T_{s}\left[\overset{ \wedge}{F}(z)+au_{s}(z)-\beta_{1}err(z)\right]\\ z\overset{\wedge}{F}(z)=\overset{\wedge}{F}(z)-T_{s}\beta_{2}err(z)\end{matrix} \right. \tag{13}\]  
In fact, the sampling period is so small that the transfer function of the discrete system can be constructed as  
\[G(z)=\frac{\overset{\wedge}{i_{s}}(z)}{i_{s}(z)}=\frac{\beta_{02}T_{s}+\beta_ {01}z-\beta_{01}}{\left(z-1\right)^{2}+\beta_{02}T_{s}+\beta_{01}z-\beta_{01}} \tag{14}\]  
where \(\beta_{01}=\beta_{1}T_{s}\), \(\beta_{02}=\beta_{2}T_{s}\). To ensure the stability of the discrete system, the poles must be in the unit circle. The characteristic equation of the LESO is  
\[\left(z-1\right)^{2}+\beta_{02}T_{s}+\beta_{01}z-\beta_{01}=0 \tag{15}\]  
As mentioned above, we can find that \(\beta_{01}=2\omega_{0}T_{s}\), \(\beta_{02}={\omega_{0}}^{2}T_{s}\). Therefore, the poles of \(G(z)\) can be solved from (15) as  
\[z_{1}=z_{2}=1-\omega_{0}T_{s} \tag{16}\]  
Gradually, the bandwidth \(\omega_{0}\) can be obtained as  
\[\omega_{0}=\frac{1-z_{1,2}}{T_{s}} \tag{17}\]  
When \(z_{1,2}\) is approaching \(1\), \(\omega_{0}\) becomes so small that the dynamic performance of LESO will be apt to deteriorate. Instead, when \(z_{1,2}\) is approaching \(0\), \(\omega_{0}\) becomes so large that the system will diverge with weakened robustness.