## 4 Approximate Prediction of Fast-Scale Instability and Adaptive Slope Compensation
### Adaptive Slope Compensation Circuit  
To generate an adaptive slope and amplitude according to (22), a circuit with an output signal \(v_{r}\) with the following expression must be used  
\[v_{r}(t)=\frac{\kappa_{r}}{\tau_{r}}\int_{0}^{t\bmod T}v_{01}(nT)\mathrm{d}\zeta \tag{23}\]  
The integral is reset to zero at the beginning of each switching cycle of time period \(T\). \(\tau_{r}\) is the time constant of the resettable integrator and \(\kappa_{r}\) is a suitable gain to be selected in such a way that \(\kappa_{r}/\tau_{r}=R_{s}/(2L)\). Since the switching ripple of the voltage \(v_{01}\) is negligible, the instantaneous value \(v_{01}(t)\) of this voltage can be used in (23) instead of its sampled value \(v_{01}(nT)\) without significantly altering the results. With this slight modification, the new expression of the adaptive compensation signal becomes as follows  
\[v_{r}(t)=\frac{\kappa_{r}}{\tau_{r}}\int_{0}^{t\bmod T}v_{01}(\zeta)\mathrm{d}\zeta \tag{24}\]  
Figure 11: The eigenvalue \(\lambda(\theta)\) as the phase angle is varied within \((0,\pi)\) with an adaptive compensation scheme using \(m_{r}=-R_{s}m_{0}/2\). The generation of the adaptive slope compensating signal can be performed by the circuit depicted in Figure 12. Without loss of generality, the resistance \(R_{r}\) and the capacitance \(C_{r}\) can be selected in such a way that \(R_{r}C_{r}=2L/R_{s}\) and the resistances \(R_{1}\) and \(R_{2}\) can be selected in such a way that \(R_{1}/R_{2}=\kappa_{r}\). With the previous adaptive compensation scheme, a stable response for the system will be obtained regardless of the weather conditions. Figure 13 shows the duty cycle signal obtained from numerical simulations corresponding to the results presented in Figures 5-7 but with the compensating signal amplitude selected according to (24) using the circuit diagram of Figure 12 with \(R_{r}C_{r}=2L/R_{s}=2\) ms (\(C_{r}=10\) nF and \(R_{r}=200\) k\(\Omega\)) and \(R_{1}=R_{2}=10\) k\(\Omega\). For the sake of clarity only some switching cycles are represented in Figure 13. Notice that the fast-scale instability is completely suppressed and that the slope of the compensating signal is equal to one half the absolute value of the down slope of the signal \(\sigma\) for all the switching periods within the grid cycle hence guaranteeing stability for all values of the duty cycle \(D\) and phase angle \(\theta\). It is worth noting that for the parameter values considered in this study, the maximum value reached by the duty cycle is \(D_{\text{max}}\approx~{}0.72\) for \(S=200\) W/m\({}^{2}\). Therefore, the previous expression of the ramp signal can be multiplied by \(D_{\text{max}}\) and fast-scale instability will still be avoided. Another choice of the slope of the compensating signal is by making it equal to the absolute value of the down slope of the signal \(\sigma\), i.e., \(m_{r}=R_{s}v_{\sigma 1}(\theta)/L\). This choice of the slope \(m_{r}\) of the compensating signal \(v_{r}\) not only guaranties fast-scale stability for all values of the duty cycle but also gives rise to a fastest or _deadbeat_ response at the switching time scale [27]. The slope and amplitude guaranteeing this response are given by the following  
Figure 12: The block diagram (**top**) and the equivalent schematic circuit representation (**bottom**) of the adaptive compensating slope signal generator. Figure 13: The time varying duty cycle calculated from (12) (\(D(t)\)) obtained from numerical simulation (\(d(nT)\), \(n\in\mathbb{N}\)) for guaranteeing stability within the complete duty cycle range. expressions Another choice of the slope of the compensating signal is by making it equal to the absolute value of the down slope of the sensed signal \(\sigma\), i.e., \(m_{r}=R_{s}v_{o1}(\theta)/L\). This choice of the slope \(m_{r}\) of the compensating signal \(v_{r}\) not only guaranties stability for all values of the duty cycle but gives rise to a fastest or _deadbeat_ response at the switching time scale [27].