A controller for a wind turbine comprising: a processor ; an input/output interface ; and a memory including instructions that, when executed by the processor , cause the processor to: i) select a setting x i from a list of settings X 1 ,... ,X N ; ii) operate the turbine according to setting X i for a period of time t 1 ; iii) record a power output signal over t 1 ; iv) repeat steps i) to iii) for another setting in X 1 ,... ,X N until all N settings have been used; v) repeat steps i) to iv) for a number of cycles c ; vi) calculate a summarised power output for each setting over all cycles, wherein a summarised power output is a cumulated power output value or an average power output value; vii) compare the summarised power outputs across settings and determine whether any setting X* results in a power output that is higher, by a difference threshold, than other settings tested; wherein the processor also executes instructions to record data indicative of the wind speed from one or more sensors for each period t 1 , and wherein the power output data is separated into wind speed bins according to the measured or estimated wind speed during each t 1 , and the summarised power output computed at step vi) is computed separately for each wind speed bin. a processor ; an input/output interface ; and a memory including instructions that, when executed by the processor , cause the processor to: i) select a setting x i from a list of settings X 1 ,... ,X N ; ii) operate the turbine according to setting X i for a period of time t 1 ; iii) record a power output signal over t 1 ; iv) repeat steps i) to iii) for another setting in X 1 ,... ,X N until all N settings have been used; v) repeat steps i) to iv) for a number of cycles c ; vi) calculate a summarised power output for each setting over all cycles, wherein a summarised power output is a cumulated power output value or an average power output value; vii) compare the summarised power outputs across settings and determine whether any setting X* results in a power output that is higher, by a difference threshold, than other settings tested; i) select a setting x i from a list of settings X 1 ,... ,X N ; ii) operate the turbine according to setting X i for a period of time t 1 ; iii) record a power output signal over t 1 ; iv) repeat steps i) to iii) for another setting in X 1 ,... ,X N until all N settings have been used; v) repeat steps i) to iv) for a number of cycles c ; vi) calculate a summarised power output for each setting over all cycles, wherein a summarised power output is a cumulated power output value or an average power output value; vii) compare the summarised power outputs across settings and determine whether any setting X* results in a power output that is higher, by a difference threshold, than other settings tested; wherein the processor also executes instructions to record data indicative of the wind speed from one or more sensors for each period t 1 , and wherein the power output data is separated into wind speed bins according to the measured or estimated wind speed during each t 1 , and the summarised power output computed at step vi) is computed separately for each wind speed bin. <EOS>