(ialstAbs(t)) based on the measured voltage level and the prefixed parameter (iaMaxAbs) corresponding to a maximum absolute active current (ia(t)) for regeneration by means of the following equation: iaIstAbs(t)=coV*IaMaxAbs, wherein V is a weight coefficient that depends on the voltage Vdc(t) and a nominal DC-link voltage Vdcnom and on a highvoltage limit Vhigh; calculate a current value (Ai) indicative of the difference between said active current (ia(t)) and said maximum allowable regeneration current (ialstAbs(t)); performing a proportional-integral function on said current value (Ai) to calculate said torque limit (Tref_lim). 41. Method according to claim 40, comprising: - comparing said torque target (Tt) with said torque limit (Tref_lim), - set the torque reference (Tref(t)) with the torque limit (Tref_lim(t)), when said motor speed ( ) is positive and said torque target (Tt(t)) is lower or equal to said torque limit (Tref_lim(t)). 42. Method according to claims 41, comprising: set the torque reference (Tref(t)) with the torque limit (Tref_lim(t)), when the motor speed is negative and the torque target (Tt(t)) is greater than, or equal to the torque limit (Tref_lim(t)).