## 2 System Description and Its Mathematical Modeling
### Grid Current Controller Design  
According to the obtained transfer function, it can be concluded that even with practically constant grid current and voltage, a PI controller for the grid current will not be enough for getting acceptable dynamic performances in terms of phase margin and damping of the system response. In fact, in order to get a good tracking of the slowly varying grid current reference \(I_{\text{gref}}\), the bandwidth of the loop gain must be sufficiently high. Nevertheless with a PI controller, a high bandwidth will lead to a low phase margin and eventually to a poorly damped oscillatory response. To mitigate this problem proportional-resonant controllers with infinite gain at the grid frequency is usually used [26; 29]. Nevertheless, the PR controller improves the steady-state error and the phase shifting between the controlled variable and its desired time varying reference but slows down the speed response. Here we use a type-III controller with two zeros and three poles widely used in the power electronics community and many design rules are available for this type of controllers [30]. From the bode plot obtained in the previous subsection, it can be observed that phase boosting at high frequency is necessary to avoid instability. This phase boosting can be accomplished by using a controller with two zeros at high frequencies hence boosting the phase by 180\({}^{\circ}\). For getting a zero steady-state error the controller must also have a pole a the origin. Therefore, a type-III controller can be used. The gain of the controller can be selected according to the desired crossover frequency of the system. The transfer function of a type-III controller can be expressed as follows:  
\[H_{c}(s)=K_{p,c}\frac{\omega_{z1}}{s}\frac{(s/\omega_{z1}+1)(s/\omega_{z2}+1)} {(s/\omega_{p1}+1)(s/\omega_{p2}+1)}. \tag{27}\]  
where \(K_{p,c}\) is the proportional gain of the grid current controller, \(\omega_{z1}\) and \(\omega_{z2}\) are two zeros and \(\omega_{p1}\) and \(\omega_{p2}\) are two poles to be placed appropriately according to the rules detailed in [30]. Namely, the zeros are placed close to but smaller than the resonant frequency of the inverter power stage, the poles are placed at higher frequencies to suppress the noise induced by the switching action.  
Using the previously obtained small-signal model and the type-III controller model, the resulting loop gain can be plotted. The grid current controller design can be performed by appropriately selecting the required performances in terms of settling time, crossover frequency and stability phase margin in the quasi-stationary sense. Figure 8 shows the bode plot of the loop gain of the system.  
The phase margin \(\varphi_{m}\) of the loop gain corresponding to the differential boost inverter with the type-III controller for the grid current is shown in Figure 9 when the operating duty cycle is  
Figure 8: Loop gain frequency response for the differential boost inverter for \(S=1000\) W/m\({}^{2}\) (\(P_{\text{max}}\approx 1.4\) kW) and \(\Theta=25\)\({}^{\circ}\)C when the duty cycle is varied in the range \((0.28,0.72)\).  
varied in the range (0.28, 0.72) for irradiance \(S=1000\) W/m\({}^{2}\) and temperature \(\Theta=25\)\({}^{\circ}\)C. It can be observed that the loop gain remains above 40\({}^{\circ}\) for most values of the duty cycle with a crossover frequency between 2 kHz and 4 kHz which are enough for accurately tracking the low frequency grid current reference. Similar frequency responses have been obtained for different values of irradiance \(S\) and temperature \(\Theta\). It was observed that for values of \(D\) close to 0.5, pole-zero cancellation take place and an order reduction has been applied. In particular a state variable corresponding to pole and a zero in the origin and a pair of complex conjugate poles and zeros are removed. According to the small-signal averaged model, the system is stable and exhibits a sufficient phase margin above 40\({}^{\circ}\) for the whole range of the varied parameter.