A voltage detector is connected to a connection terminal connected to one
phase of an AC output of an inverter through a diode. A removable charge
power supply is connected to said connection terminal and another
connection terminal. A charge-power-supply connection judging circuit
judges whether the charge power supply is or isn't connected, based on a
charge power supply voltage detected by a voltage detector. A mode change
control circuit outputs switch signal by the result of said judgment. By
receiving this switch signal, the inverter controller switches the
operation of the inverter between the Motor Drive mode or the Battery
Charge mode.Thereby, a motor drive device detects a connecting status of
an external charge power supply and steadily switches the operation of
the inverter between the Motor Drive mode or the Battery Charge mode.