## 4 ESS Controller Parameter Design for Electromechanical Oscillation Suppression
### ROCOF > 0
\[\Delta\omega\geq-K, \tag{21}\]  
Considering (20), we have  
\[-\frac{1}{K_{\rm q}}\bigg{(}2H+\frac{D}{m}\Delta\omega\bigg{)}\leq\frac{1}{K_{ \rm q}}\bigg{(}\frac{D}{m}K-2H\bigg{)}, \tag{22}\]  
Considering the constraints in (22), it can be known that in this period, the constraint of the D controller parameter \(K_{\rm d}\) given by (20) should satisfy:  
\[K_{\rm d}\geq\frac{1}{K_{\rm q}}\bigg{(}\frac{D}{m}K-2H\bigg{)}, \tag{23}\]  
Therefore, in order to satisfy the frequency deviation constraint given by (12) and the ROCOF constraint in (13), in this period, the total inertia of the power system should satisfy:  
\[T_{\rm J}=2H+K_{\rm q}K_{\rm d}\geq\frac{D}{m}K>0, \tag{24}\]  
To reduce the ESS capacity, the selected value of \(K_{\rm d}\) can be the lower limit value in (24). Obviously, a certain amount of safety margin should be reserved. Therefore, for Interval I of Figure 7, the corresponding control parameters \(K_{\rm p}\) and \(K_{\rm d}\) can be set as follows:  
\[\left\{ \begin{array}{c}K_{\rm p}=0\\ K_{\rm d}=\frac{DK}{mK_{\rm q}}\end{array} \right., \tag{25}\]  
**Case B**: \(\Delta\omega>0\) and ROCOF is greater than 0 when the dynamic process is located in Interval IV, as shown in Figure 7.  
In this period, when the ROCOF is greater than 0, the grid frequency rises rapidly and gradually approaches the steady-state point \(\omega_{0}\). In order to accelerate the recovery process and allow the grid frequency to climb from the frequency nadir to \(\omega_{0}\) as quickly as possible, there is no need to provide additional inertia effects in this period. According to (17), when \(\Delta\omega>0\), the P controller parameter \(K_{\rm p}\) should satisfy:  
\[K_{\rm p}\leq-\frac{D}{K_{\rm q}}, \tag{26}\]  
Therefore, in this period, the ESS can provide a certain amount of negative damping torque to the power system, so that the response curve of the grid frequency presents a divergent state in this period, prompting the transient frequency to return to the steady-state point \(\omega_{0}\) as soon as possible, that is to rush from T\({}_{3}\) to T\({}_{4}\) at the fastest possible speed. From another point of view, on one hand, excessive negative damping will lead to excessive output current and high capacity of the ESS; on the other hand, it will bring about drastic ROCOF, which will increase the inertia support provided by the ESS, and further intensify the capacity requirements for the ESS. In terms of cost and stability, the ESS should not provide excessive negative damping torque, and it only needs to meet the constraints in (12) and (13). Therefore, the P controller parameter \(K_{\rm p}\) can be set according to the upper limit of (26), namely:  
\[K_{\rm p}=-\frac{D}{K_{\rm q}}, \tag{27}\]  
Therefore, the equivalent damping coefficient of the power system can be close to 0, and the grid frequency can climb from the frequency nadir to \(\omega_{0}\) at the fastest speed as long as the ROCOF is guaranteed not to exceed the threshold in the transient process, which is easy to achieve. Substituting (27) into the constraint in (18) yields:  
\[K_{\rm d}\geq-\frac{2H}{K_{\rm d}}, \tag{28}\]  
Therefore, the parameter \(K_{\rm d}\) of the D controller satisfies (28), ensuring that the ROCOF does not exceed the threshold in the transient process. Similarly, to reduce the ESS capacity, in this period, the ESS does not provide inertia support, that is, the D controller parameter \(K_{\rm d}\) is 0. Therefore, in Interval IV of Figure 7, the corresponding parameters \(K_{\rm p}\) and \(K_{\rm d}\) can be set as follows:  
\[\left\{ \begin{array}{l}K_{\rm p}=-\frac{D}{K_{\rm q}}\\ K_{\rm d}=0\end{array} \right., \tag{29}\]