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 representing a power level to be supplied to the power grid by the wind turbine;
- controlling the wind turbine in order to produce a variable output power according to the power reference value while maintaining a constant torque on the generator;
- in the case that the variable output power of the wind turbine exceeds the power reference value while maintaining the constant torque on the generator, storing excess produced energy in the energy storage system and supplying a power level being equal to the power reference value to the power grid;
- and
- in the case that the variable produced output power of the wind turbine is below the power reference value while maintaining the constant torque on the generator, retrieving stored energy from the energy storage system and supplying a power level being equal to the power reference value to the power grid.