A method of determining a reference output power for an energy storage system in a wind power generation system, comprising: filtering an actual wind power output ( P w (t)) to obtain a desired power output ( P set (t)) delivered to a grid; determining a reference output power ( P Bref1 (t)) for the energy storage system from the actual wind power output ( P w) and the desired power output ( P set (t)) delivered to the grid; and adjusting the reference output power for the energy storage system based on a change in predicted wind power output at the next time point, characterized in that the adjusting the reference output power for the energy storage system based on a change in predicted wind power output at the next time point comprises any one of: increasing the reference output power for the energy storage system if an increase in the predicted wind power output is larger than a predetermined increase threshold ( P wa); and decreasing the reference output power for the energy storage system if a decrease in the predicted wind power output is larger than a predetermined decrease threshold ( P wa), wherein the increasing the reference output power for the energy storage system further comprises determining the reference output power ( P Bref3) for the energy storage system as the difference between the minimum of the maximum allowable total power outputs under power output ramping rate limit and under energy storage system output power amplitude limit and the actual wind power output ( P w (t)). filtering an actual wind power output ( P w (t)) to obtain a desired power output ( P set (t)) delivered to a grid; determining a reference output power ( P Bref1 (t)) for the energy storage system from the actual wind power output ( P w) and the desired power output ( P set (t)) delivered to the grid; and adjusting the reference output power for the energy storage system based on a change in predicted wind power output at the next time point, characterized in that the adjusting the reference output power for the energy storage system based on a change in predicted wind power output at the next time point comprises any one of: increasing the reference output power for the energy storage system if an increase in the predicted wind power output is larger than a predetermined increase threshold ( P wa); and decreasing the reference output power for the energy storage system if a decrease in the predicted wind power output is larger than a predetermined decrease threshold ( P wa), increasing the reference output power for the energy storage system if an increase in the predicted wind power output is larger than a predetermined increase threshold ( P wa); and decreasing the reference output power for the energy storage system if a decrease in the predicted wind power output is larger than a predetermined decrease threshold ( P wa), wherein the increasing the reference output power for the energy storage system further comprises determining the reference output power ( P Bref3) for the energy storage system as the difference between the minimum of the maximum allowable total power outputs under power output ramping rate limit and under energy storage system output power amplitude limit and the actual wind power output ( P w (t)).