To provide a motor controller where the tolerance range for not letting an overcurrent flow to the switching transistor of a regenerative circuit at power regeneration can be set widely.
This power regenerating circuit is composed of a regenerative circuit part 3 which is constituted of a bridge-wired switching element and converts DC power into AC power, a line voltage detector 4 which is connected to the AC power source and output the line voltage of an AC power source in its own combination of each phase, a phase application phase decider 5 which decides the phase to be supplied with power of the regenerative circuit part, based on the line voltage, a zero cross judger 6 which outputs a commutation signal when the absolute value of the line voltage falls under the preset voltage value, a timer 8 which outputs a preset period regeneration stop command after the commutation signal is inputted, and a control signal generator 9 which generates a control signal to control it so that the regenerative circuit may perform the power regenerative actin, based on the current application command, when a regenerative action command is inputted and a regeneration stop command is off.