## 3 Analysis and Control of Electromechanical Oscillation  
When the power system is disturbed, the torque balance of the rotor of the equivalent SG is broken, and the electromechanical oscillation will occur, which can be described by the power angle curve in Figure 5. Assume that the input power of the equivalent SG at the starting time is \(P_{0}\), suddenly jumps to \(P_{1}\) at a certain time, and reaches a new stable state after an oscillation process. According to the swing equation of the rotor of the equivalent SG, the power angle curve during the oscillation process can be divided into four stages, as shown in Figure 5.  
After the system is disturbed and the electromechanical oscillation occurs, the grid frequency response curve of the equivalent SG is shown in Figure 6. When the damping of the power grid is not large enough, the first time period (corresponding to \(a\to a^{\prime}\) in Figure 5) is the accelerating process. When the equivalent SG runs to point \(a^{\prime}\), the grid frequency reaches the maximum value. Due to the inertia effect of the power system, the equivalent SG will run beyond point \(a^{\prime}\) to point \(a^{\prime\prime}\), leading to the transient response with oscillation. In the above-mentioned process, if the power system accelerates too fast, that is, the ROCOF is too large [23], the frequency deviation of the power grid will be too large (corresponding to the period \(t_{1}\), \(t_{3}\), and \(t_{5}\) in Figure 6), and the oscillation amplit  
Figure 5: Power angle curve of the equivalent SG.  
increase. \(a^{\prime\prime}\) in Figure 5 is closer to the critical stable point of the system, that is \(\pi/2\), at which the stability margin of the power system decreases or even loses stability.  
The drastic frequency change and violent power oscillation will trigger the action of relay protection of the power system, which will lead to the tripping-off of generators. Therefore, during the electromechanical oscillation process, it is necessary to guarantee that the ROCOF, the frequency deviation, and other key parameters are less than the protection thresholds of the power system, so as to ensure that the amplitudes of frequency oscillations and power oscillations are less than the limits the power system can withstand.  
Therefore, the control of electromechanical oscillations must ensure that the power system meets the following frequency deviation constraint and the ROCOF constraint:  
\[|\omega(t)-\omega_{0}|\leq K, \tag{12}\]  
\[\left|\frac{\mathrm{d}\omega(t)}{\mathrm{d}t}\right|\leq m, \tag{13}\]  
where, \(K\) is the frequency deviation threshold, and m is the ROCOF threshold of the power grid.  
To reduce the maximum amplitude of power and frequency oscillations, a feasible solution is to make the ESS controller adjust its parameters online and in real time according to the operating state of the power system. Therefore, the ESS can flexibly change the inertia effect and the damping ability of the SG-based power system and provide the desired inertia and damping support for the power system to reduce the amplitudes of frequency and power oscillations, optimize the electromechanical oscillation process, and ensure that the relay protection is not triggered. The real-time operating state of the power system can be reflected by the real-time electromagnetic power, the frequency deviation, and ROCOF of the power system.  
Under the premise of meeting the above basic requirements, if the ESS still has remaining capacity, its further operation goal is to compress the oscillation amplitude, reduce the oscillation cycles, shorten the oscillation time, and increase the stability margin of the system.