An electric power converter comprising: a converter having switching elements, for converting AC power from an AC power supply into DC power; a capacitor connected in parallel to a DC side of said converter; an inverter having switching elements and being connected in parallel with said capacitor, for driving and controlling a permanent-magnet synchronous motor; a discharge circuit connected in parallel with said capacitor; a supply-side switch interposed between the AC power supply and an AC side of said converter; a motor-side switch interposed between said inverter and the permanent-magnet synchronous motor; a power-voltage sensor for measuring voltage of the AC power supply; a capacitor-voltage sensor for measuring voltage across said capacitor; an input-current sensor for measuring AC current to said converter; an output-current sensor for measuring AC current from said inverter; and a system controller for controlling said supply-side switch, said converter, said discharge circuit, said inverter, and said motor-side switch by receiving input signals from said power-voltage sensor, said capacitor-voltage sensor, said input-current sensor, and said output-current sensor, wherein said system controller, when a voltage measured by said capacitor-voltage sensor becomes equal to or lower than a first predetermined value, turns off all switching elements of said converter and all switching elements of said inverter; when the voltage measured by said capacitor-voltage sensor becomes equal to or lower than a second predetermined value that is smaller than the first predetermined value, turns off said supply-side switch; and when the voltage measured by said capacitor-voltage sensor becomes higher than the second predetermined value, does not turn off said supply-side switch and wherein said system controller sets the second predetermined value, based on voltages measured by said supply-voltage sensor or output voltage frequency of said inverter. a converter having switching elements, for converting AC power from an AC power supply into DC power; a capacitor connected in parallel to a DC side of said converter; an inverter having switching elements and being connected in parallel with said capacitor, for driving and controlling a permanent-magnet synchronous motor; a discharge circuit connected in parallel with said capacitor; a supply-side switch interposed between the AC power supply and an AC side of said converter; a motor-side switch interposed between said inverter and the permanent-magnet synchronous motor; a power-voltage sensor for measuring voltage of the AC power supply; a capacitor-voltage sensor for measuring voltage across said capacitor; an input-current sensor for measuring AC current to said converter; an output-current sensor for measuring AC current from said inverter; and a system controller for controlling said supply-side switch, said converter, said discharge circuit, said inverter, and said motor-side switch by receiving input signals from said power-voltage sensor, said capacitor-voltage sensor, said input-current sensor, and said output-current sensor, wherein said system controller, when a voltage measured by said capacitor-voltage sensor becomes equal to or lower than a first predetermined value, turns off all switching elements of said converter and all switching elements of said inverter; when the voltage measured by said capacitor-voltage sensor becomes equal to or lower than a second predetermined value that is smaller than the first predetermined value, turns off said supply-side switch; and when the voltage measured by said capacitor-voltage sensor becomes higher than the second predetermined value, does not turn off said supply-side switch and wherein said system controller sets the second predetermined value, based on voltages measured by said supply-voltage sensor or output voltage frequency of said inverter.