The invention relates to a method and a device for controlling an
inverter of a vehicle, comprising the following steps: determining information about a heating demand of a battery (20) of the vehicle, which battery is electrically and thermally coupled to the
inverter (10), controlling the
inverter (10) in a first mode, and controlling the inverter (10) in a second mode, the inverter (10) is actuated in a first mode in which a current provided by the battery (20) flows through an
electric motor (30) of the vehicle, which
electric motor is electrically coupled to an AC terminal of the inverter (10), and in a second mode which represents an idle load of the inverter (10), the inverter (10) is actuated, the inverter (10) has a first mode in which an idle current flowing through a reverse
diode (40) of a
semiconductor switch (S1, S2, S3, S4, S5, S6) of the inverter (10) causes a heating of the battery (20) thermally coupled to the inverter (10), and wherein the inverter (10) is actuated in such a way that the inverter (10) is switched between the first mode and the second mode at least until a heating requirement of the battery (20) is met, the
electric motor (30) is arranged such that the
average current flowing through the electric motor (30) corresponds to a
direct current that does not cause torque in the electric motor (30), and a respective
switching time for repeatedly switching between the first mode and the second mode is determined depending on the heating demand of the battery (20).