A method of controlling a device having a full wave rectifier connected to a generator, a DC bus connected to the output of the full wave rectifier, an inverter connected to the DC bus, an inductor unit connected to the output of the inverter, and a first contactor unit selectively connecting and disconnecting the inductor unit to and from a grid, the method comprising the steps of:
- commanding the inverter to perform online voltage control;
- detecting a fault condition indicating a fault in the device or the grid
- opening the first contactor;
- clearing a time counter;
- setting a mode to an offline mode;
- and
- commanding the inverter to perform offline voltage control;
- said opening, clearing, setting and commanding offline voltage control steps being performed when said detecting step detects the fault condition or continues to detect the fault condition.