## 4 ESS Controller Parameter Design for Electromechanical Oscillation Suppression
### ROCOF < 0  
When ROCOF is less than 0, corresponding to Intervals II and III in Figure 7, (15) can be rewritten as:  
\[-T_{\rm J}m\leq T_{\rm J}\frac{{\rm d}\Delta\omega}{{\rm d}t}=-T_{\rm D}\Delta \omega\leq 0, \tag{30}\]  
Therefore, in this stage, the P controller parameter \(K_{\rm p}\) should satisfy:  
\[T_{\rm J}\frac{{\rm d}\Delta\omega}{{\rm d}t}=-T_{\rm D}\Delta\omega=-\left(D +K_{\rm q}K_{\rm p}\right)\Delta\omega\leq 0, \tag{31}\]  
Similarly, in this stage, the D controller parameter \(K_{\rm d}\) should satisfy:  
\[-\left(2H+K_{\rm q}K_{\rm d}\right)m=-T_{\rm J}m\leq T_{\rm J}\frac{{\rm d} \Delta\omega}{{\rm d}t}=-T_{\rm D}\Delta\omega, \tag{32}\]  
Similarly, the controller parameter design is also discussed according to two different cases, that are \(\Delta\omega<0\) and \(\Delta\omega>0\).  
**Case A**: \(\Delta\omega<0\) and ROCOF is less than 0 when the dynamic process is located in Interval II (Figure 7).  
During this interval, ROCOF is less than 0, the grid frequency drops rapidly and gradually approaches the steady-state point \(\omega_{0}\). In order to accelerate the recovery process and make the grid frequency drop from the frequency peak to the steady state point as quickly as possible, there is no need to provide additional inertia effects in this interval.  
According to (31), when \(\Delta\omega<0\), the P controller parameter \(K_{\rm p}\) should still satisfy the constraint in (26). Therefore, the P controller parameter \(K_{\rm p}\) in this interval can be designed according to (27) as in the case of Interval IV. Similarly, the D controller parameter \(K_{\rm d}\) is designed to be 0, and the ESS does not provide inertia support so as to reduce the ESS capacity. Meanwhile, this design can also meet the constraints in (32), which can ensure that ROCOF does not exceed the threshold during the transient process.  
**Case B**: \(\Delta\omega>0\) and ROCOF is less than 0 when the dynamic process is located in Interval III.  
In this interval, ROCOF is less than 0 and the grid frequency drops rapidly and gradually deviates from the steady-state point. To shorten the oscillation process and to prevent the frequency deviation from exceeding the threshold, it is necessary to increase the inertia in this interval and the primary goal of the ESS is to suppress the ROCOF. Therefore, the design principle in this interval is the same as in Interval I, and the corresponding parameters \(K_{\rm p}\) and \(K_{\rm d}\) can still be set according to (25).  
In summary, the ESS controller parameters \(K_{\rm p}\) and \(K_{\rm d}\) can be set according to the following rules:  
\[K_{\rm p}=\begin{cases}0&\Delta\omega\times{\rm ROCOF}>0\\ -\frac{D}{K_{\rm q}}&\Delta\omega\times{\rm ROCOF}<0\end{cases}, \tag{33}\]\[K_{\text{d}}=\begin{cases}0&\Delta\omega\times\text{ROCOF}<0\\ \frac{DK}{mK_{\text{q}}}&\Delta\omega\times\text{ROCOF}>0^{{}^{\prime}}\end{cases} \tag{34}\]  
The physical meaning of the above design rules is that when the grid frequency deviates from the steady-state point, the inertia support provided by the ESS will be greater when the value of the ROCOF constraint is smaller or the maximum frequency deviation is larger. When the grid frequency moves to the steady-state point, the ESS should promote this positive process, and provide a certain amount of negative damping torque to weaken the damping effect of the power system. It should try to create an undamped free-motion environment for the grid frequency dynamic to accelerate the frequency recovery process.