Method of estimating a relay parameter for acquiring data for relay-based controller tuning of a controller controlling a system, comprising: starting acquiring controller output data and system output data when detecting a steady state of system output (x) while controller output is fed to the system as system input; determining, based on controller output constraint (PLOUT, PHOUT) and on the acquired controller output data and system output data, a relay amplitude (RAMP) representing an amplitude of a relay signal to be added to steady state controller output to obtain a sum signal to be fed to the system as system input during the acquiring data for relay-based controller tuning, wherein a first step relay amplitude (RAMP1) is set as follows: RAMP 1 = f 1 * ABS Y _ WIN, wherein f1 is between 0.08 and 0.12, Y_WIN is a controller output averaged over a moving window having fixed width, wherein a second step relay amplitude (RAMP2) is set as follows: RAMP 2 = MAX RAMP 1, ABS f 2 * X _ MU * G − 1, wherein X_MU is a system output averaged over increasing number of samples, G -1 is an inverse of the gain of the controller, f2 is between 0.08 and 0.12, wherein the controller output constraint comprises an upper limit controller output (PHOUT) and a lower limit controller output (PLOUT), wherein a third step relay amplitude (RAMP3) is set as follows: RAMP 3 = MAX RAMP 2, PRAMP _ MIN, wherein PRAMP _ MIN = 5 * HYS * MAX G − 1, ABS YMAX / ABS X _ MU, HYS is relay hysteresis, YMAX = f 3 * MIN Yss − PLOUT, PHOUT − Yss, f3 is between 0.85 and 0.95, Yss is a steady state controller output, wherein the relay amplitude (RAMP) is obtained according to: RAMP = MIN RAMP 3, ABS YMAX. starting acquiring controller output data and system output data when detecting a steady state of system output (x) while controller output is fed to the system as system input; determining, based on controller output constraint (PLOUT, PHOUT) and on the acquired controller output data and system output data, a relay amplitude (RAMP) representing an amplitude of a relay signal to be added to steady state controller output to obtain a sum signal to be fed to the system as system input during the acquiring data for relay-based controller tuning, wherein a first step relay amplitude (RAMP1) is set as follows: RAMP 1 = f 1 * ABS Y _ WIN, wherein f1 is between 0.08 and 0.12, Y_WIN is a controller output averaged over a moving window having fixed width, f1 is between 0.08 and 0.12, Y_WIN is a controller output averaged over a moving window having fixed width, wherein a second step relay amplitude (RAMP2) is set as follows: RAMP 2 = MAX RAMP 1, ABS f 2 * X _ MU * G − 1, wherein X_MU is a system output averaged over increasing number of samples, G -1 is an inverse of the gain of the controller, f2 is between 0.08 and 0.12, X_MU is a system output averaged over increasing number of samples, G -1 is an inverse of the gain of the controller, f2 is between 0.08 and 0.12, wherein the controller output constraint comprises an upper limit controller output (PHOUT) and a lower limit controller output (PLOUT), wherein a third step relay amplitude (RAMP3) is set as follows: RAMP 3 = MAX RAMP 2, PRAMP _ MIN, wherein PRAMP _ MIN = 5 * HYS * MAX G − 1, ABS YMAX / ABS X _ MU, HYS is relay hysteresis, YMAX = f 3 * MIN Yss − PLOUT, PHOUT − Yss, f3 is between 0.85 and 0.95, Yss is a steady state controller output, wherein the relay amplitude (RAMP) is obtained according to: RAMP = MIN RAMP 3, ABS YMAX. f3 is between 0.85 and 0.95, Yss is a steady state controller output, wherein the relay amplitude (RAMP) is obtained according to: RAMP = MIN RAMP 3, ABS YMAX.