## 4 Frequency and SOC Restoration Control  
As discussed in the previous section, if the SOC deviates from the allowable range, the system frequency is changed by adjusting \(P_{\mathit{ref}}\) of grid-forming DGs (see Figure 1), to restore the SOC within the allowable range. grid-feeding DGs adjust their output power by sensing the frequency deviation; thus, both the frequency and the SOC can be maintained within the desired range. For a single grid-feeding DG, it may be too great a burden to undertake all frequency and SOC restorations. Hence, two or more grid-feeding DGs are proposed to support the frequency only with local measurements. To recover the frequency to the nominal value using only local measurements, integral control of frequency error must be applied. However, in the real world, local measurements and settings can differ slightly from each other, which may cause a problem while recovering the frequency [38]. For instance, two different frequency controllers will conflict with each other when recovering the frequency to the nominal value when their frequency measurements differ. To address this problem, communication is used for secondary control in the real world. To eliminate the dependency on communication, an active power controller for a grid-feeding DG is proposed, as shown in Figure 2, where \(\Delta f_{\mathit{int}}\) is a binary signal, '1' or '0', to control the \"PI On/Off switch\". If \(\Delta f_{\mathit{int}}\) is '1', the switch is connected to node 'a' and the error between \(f_{\mathit{nom}}\) and \(f_{\mathit{o}}\) enters into the PI controller. If \(\Delta f_{\mathit{int}}\) is '0', the switch is connected to node 'b' and the zero input enters into the PI controller. In other words, the PI controller acts as to eliminate the frequency deviation and yields a value to adjust the active power reference. Before adding this value to the active power reference, it passes the low-pass filter to prevent this value being changed in a step-wise way, and is added to \(P_{\mathit{schd}}\) to yield \(P_{\mathit{ref}}\). The core part of the grid-feeding DG's active power controller is the process of generating the \(\Delta f_{\mathit{int}}\) signal, which is shown in Figure 3: the frequency deviation signal goes into the integrator through the dead band block, which prevents too-frequent activation of the \(\Delta f_{\mathit{int}}\) signal; hence, it tolerates a small deviation in the frequency. The absolute value of the integral of frequency deviation is compared to a certain constant value, \(K_{\mathit{int}}\), to determine whether or not to restore the frequency. Note that the integrator is used to reflect not only the time, but also the magnitude of the frequency deviation. \(K_{\mathit{int}}\) can be adjusted by the system operator. By decreasing \(K_{\mathit{int}}\), the frequency can be strictly adjusted to the nominal value but the output of the grid-feeding DG unit will be changed too frequently. The output of the comparator is multiplied by the output of the hysteresis loop, which yields '1' or '0'. Hence, \(\Delta f_{\mathit{int}}\) will be set to '1' to turn on the \"PI On/Off switch\" in Figure 2, only if both the comparator and the hysteresis loop outputs are '1' will the \"PI on/off switch\" be on; otherwise, it will be turned off. The hysteresis loop plays a key role in turning off the switch. It outputs '1' when the absolute value of the difference between \(f_{\mathit{nom}}\) and \(f_{\mathit{o}}\) exceeds a certain value, and outputs '0' if the frequency difference is restored back to a certain other value. For instance, if the former and the latter values are 0.1 and 0.01, respectively, the hysteresis loop outputs '1' if the absolute frequency difference exceeds 0.1 Hz, and outputs '0' if the absolute frequency difference is restored back to 0.01 Hz. Once the hysteresis loop outputs '0', \(\Delta f_{\mathit{int}}\) becomes '0' and the integrator is reset. Without the proposed hysteresis loop control, secondary control without communication cannot be implemented.