Preferably, the method comprising the step of determining said active current by computing a minimum current between said first and second active currents. Preferably, the method comprising the step of determining two maximum absolute correction signals on the basis of said second active current and said d-q axis- wise duty cycles. Preferably, the method comprising the step of determining an instantaneous maximum allowable regeneration current based on a measured voltage level and a parameter indicative of a maximum absolute active current for regeneration. Preferably, the method comprising the step of determining an instantaneous maximum allowable regeneration current based on the following equation wherein where cov(t) is a weight coefficient that depends on: said DC-link capacitor voltage Vdc(t), a nominal DC-link voltage (Vdcnom), and a predetermined high-voltage limit (Vhigh). Preferably, the method comprising the step of determining a negative fraction of correction to be applied according to an empirical saturated-cubic equation: Preferably, the method comprising the step of determining unconstrained axis- wise corrections as a fraction of the maximum correction by the following equation: