To provide a motor controller capable of controlling a motor in safety without impairing safe operation range of a motor drive portion even if the motor controller is faulty or commercial power supply is interrupted.
The motor controller comprises a controlling means which issues a command on the number of revolutions of a fan motor; a motor drive portion which drives the fan motor, a motor control portion which controls the motor drive portion, a number of revolutions command converting means to voltage which converts the command on the number of motor revolutions issued from the controlling means to the motor control portion into voltage, a first direct-current power source which supplies power to the number of revolutions command converting means to voltage, a second direct-current power source which supplies power to the controlling means, and a first voltage detecting means which monitors voltage drop in the first direct- current power source. In addition, a command voltage control portion is provided which turns on and off the output of the number of revolutions command converting means to voltage in correspondence with the output of the first voltage detecting means. Thus, if the voltage level of the first direct-current power source drops, the output of the number of revolutions command converting means to voltage can be quickly turned off.