A method for controlling a wind turbine, the wind turbine comprising a rotor carrying a set of wind turbine blades and connected to an input shaft, an output shaft connected to a generator, the generator being arranged to supply power to a power grid, and an energy storage system for intermediate storage of energy produced by the generator, the method comprising:
- during full load operation, receiving a power reference value, Pref, representing a power level to be supplied to the power grid by the wind turbine;
- controlling the wind turbine in order to produce an output power which is at or near the power reference value, Pref, while maintaining a constant torque on the generator;
- in the case that the produced output power of the wind turbine exceeds the power reference value, Pref, storing excess produced energy in the energy storage system and supplying a power level being equal to the power reference value, Pref, to the power grid;
- and
- in the case that the produced output power of the wind turbine is below the power reference value, Pref, retrieving stored energy from the energy storage system and supplying a power level being equal to the power reference value, Pref, to the power grid.