A method for controlling an drive unit (1, 1a, 1b) of a vehicle connected to an AC-supply line, the drive unit (1, 1a, 1b) comprises an AC/DC-converter converting electric power to a target value between the AC-supply line and at least one electric motor of the vehicle, and a DC-link transferring electric power between the AC/DC-converter and the electric motor, and a control unit, the method comprises: - measuring a physical quantity of at least the AC-supply line, - controlling the AC/DC-converter by executing at least one regulating function based on the measured physical quantity, characterized in that: said regulating function comprises a high regulating level converting electric power to the target value with a first accuracy and a low regulating level converting electric power to the target value with a second accuracy, the first accuracy being higher than the second accuracy, wherein the control unit comprises a plurality of regulating functions comprising a first group comprising a high regulating level and a second group comprising a high regulating level and low regulating level, wherein the method further comprises: - receiving information on whether the vehicle is in an operational or a non-operational mode, - setting the regulating function of the second group to the high regulating level if the vehicle is in the operational mode, - setting the regulating function of the second group to the low regulating level if the vehicle is in the non-operational mode, and - executing the regulating function based on the measured physical quantity and the set regulating level. - measuring a physical quantity of at least the AC-supply line, - controlling the AC/DC-converter by executing at least one regulating function based on the measured physical quantity, said regulating function comprises a high regulating level converting electric power to the target value with a first accuracy and a low regulating level converting electric power to the target value with a second accuracy, the first accuracy being higher than the second accuracy, wherein the control unit comprises a plurality of regulating functions comprising a first group comprising a high regulating level and a second group comprising a high regulating level and low regulating level, wherein the method further comprises: - receiving information on whether the vehicle is in an operational or a non-operational mode, - setting the regulating function of the second group to the high regulating level if the vehicle is in the operational mode, - setting the regulating function of the second group to the low regulating level if the vehicle is in the non-operational mode, and - executing the regulating function based on the measured physical quantity and the set regulating level. - receiving information on whether the vehicle is in an operational or a non-operational mode, - setting the regulating function of the second group to the high regulating level if the vehicle is in the operational mode, - setting the regulating function of the second group to the low regulating level if the vehicle is in the non-operational mode, and - executing the regulating function based on the measured physical quantity and the set regulating level.