Method for controlling an inverter comprising a power stage comprising electronic switches, the inverter being connected to an electric traction machine of a vehicle, in which, In a nominal operating mode, the inverter is controlled by a devicecontrol powered by a so-called low voltage power supply, abbrev. BT, and in which, when a loss of low voltage power supply occurs, the inverter is disconnected from a high voltage power supply, abbrev. HT, whose electrical voltage is higher than that of the low power supply tension, and the control device is electrically powered by an auxiliary power supply which comprises an electrical capacity, the inverter comprising said electrical capacity, and in which the control device applies to the inverter a safety operating mode among: - a safety operating mode called active short circuit mode, abbrev. ASC, in which certain electronic switches of the inverter are closed so as to put phases of the short-circuited electrical machine, the ASC mode being associated with an active discharge and said electrical capacity; and - a safety operating mode called free-wheel mode, abbrev. FW, in which all electronic switches are open, which sets the electric machine into freewheeling, the method being characterized in that; the input voltage of the auxiliary power supply is determined throughout the operation of the inverter according to one of the safety operating modes, and, while the control device applies the ASC mode to the inverter, if the input voltage of the auxiliary power supply drops below a minimum voltage given, said given minimum voltage (Ud) being greater than a minimum operating voltage of the control device, the control device then applies the FW operating mode to the inverter, and while the controller applies the FW mode to the inverter, if the input voltage of the auxiliary power supply rises to a predefined voltage threshold (Uth), the controller then applies the ASC operating mode to the inverter and step a) is repeated. In a nominal operating mode, the inverter is controlled by a devicecontrol powered by a so-called low voltage power supply, abbrev. BT, and in which, when a loss of low voltage power supply occurs, the inverter is disconnected from a high voltage power supply, abbrev. HT, whose electrical voltage is higher than that of the low power supply tension, and the control device is electrically powered by an auxiliary power supply which comprises an electrical capacity, the inverter comprising said electrical capacity, and in which the control device applies to the inverter a safety operating mode among: - a safety operating mode called active short circuit mode, abbrev. ASC, in which certain electronic switches of the inverter are closed so as to put phases of the short-circuited electrical machine, the ASC mode being associated with an active discharge and said electrical capacity; and - a safety operating mode called free-wheel mode, abbrev. FW, - a safety operating mode called active short circuit mode, abbrev. ASC, in which certain electronic switches of the inverter are closed so as to put phases of the short-circuited electrical machine, the ASC mode being associated with an active discharge and said electrical capacity; and - a safety operating mode called free-wheel mode, abbrev. FW, in which all electronic switches are open, which sets the electric machine into freewheeling, the method being characterized in that; the input voltage of the auxiliary power supply is determined throughout the operation of the inverter according to one of the safety operating modes, and, while the control device applies the ASC mode to the inverter, if the input voltage of the auxiliary power supply drops below a minimum voltage given, said given minimum voltage (Ud) being greater than a minimum operating voltage of the control device, the control device then applies the FW operating mode to the inverter, and while the controller applies the FW mode to the inverter, if the input voltage of the auxiliary power supply rises to a predefined voltage threshold (Uth), the controller then applies the ASC operating mode to the inverter and step a) is repeated.