A method of performing scalar-based control of a motor connected to a power converter via at least one passive electrical reactance component (15, 17, 19), wherein the at least one passive electrical reactance component includes a filter, a transformer, or a cable having a length of the order of kilometres, wherein the method comprises: estimating a motor current (i m) at terminals of the motor to thereby obtain an estimated motor current (im), controlling the power converter based on the estimated motor current (im), and measuring a power converter current (i c), characterized in that the method comprises prior to controlling, generating a voltage perturbation based on the estimated motor current ( i m ∗), wherein the controlling is based on the voltage perturbation, wherein the estimating involves utilising a model (23, 25, 27) of the at least one passive electrical reactance component (15, 17, 19), and wherein the method comprises: comparing a natural frequency (F R) of a simplified model of the at least one passive electrical reactance component and the motor with a nominal speed of the motor, wherein the controlling is based on the estimated motor current only if the natural frequency (F R) is within a predetermined range from the nominal speed, and wherein in case the natural frequency (F R) is outside the predetermined range the controlling is based on the measured power converter current (i c). wherein the method comprises: estimating a motor current (i m) at terminals of the motor to thereby obtain an estimated motor current (im), controlling the power converter based on the estimated motor current (im), and measuring a power converter current (i c), characterized in that the method comprises prior to controlling, generating a voltage perturbation based on the estimated motor current ( i m ∗), wherein the controlling is based on the voltage perturbation, estimating a motor current (i m) at terminals of the motor to thereby obtain an estimated motor current (im), controlling the power converter based on the estimated motor current (im), and measuring a power converter current (i c), characterized in that the method comprises prior to controlling, generating a voltage perturbation based on the estimated motor current ( i m ∗), wherein the controlling is based on the voltage perturbation, wherein the estimating involves utilising a model (23, 25, 27) of the at least one passive electrical reactance component (15, 17, 19), and wherein the method comprises: comparing a natural frequency (F R) of a simplified model of the at least one passive electrical reactance component and the motor with a nominal speed of the motor, wherein the controlling is based on the estimated motor current only if the natural frequency (F R) is within a predetermined range from the nominal speed, and wherein in case the natural frequency (F R) is outside the predetermined range the controlling is based on the measured power converter current (i c). comparing a natural frequency (F R) of a simplified model of the at least one passive electrical reactance component and the motor with a nominal speed of the motor, wherein the controlling is based on the estimated motor current only if the natural frequency (F R) is within a predetermined range from the nominal speed, and wherein in case the natural frequency (F R) is outside the predetermined range the controlling is based on the measured power converter current (i c).