To correct an error of a rotational position of a motor after power supply is stopped.SOLUTION: A motor controller is provided with: a rotational position calculation unit which calculates a rotational position of a motor which rotates a rotor; an operating state control unit which controls a supply state of operating power of the rotational position calculation unit; a deviation calculation unit which calculates deviation of the rotational position of the rotor on the basis of a stop target rotational position of the rotor, and the rotational position of the rotor before supply of the operating power to the rotational position calculation unit is stopped after supply of drive current to a coil is stopped; a storage control unit which stores the deviation in a storage unit; a rotational position control signal generation unit which generates a rotational position control signal for controlling the rotational position of the rotor on the basis of the deviation stored in the storage unit, and the stop target rotational position of the rotor; and a drive current output unit which outputs the drive current to the coil on the basis of the rotational position control signal after the supply of the operating power of the rotational position calculation unit is restarted by the operating state control unit.SELECTED DRAWING: Figure 2【課題】電力供給が停止された後のモータの回転位置の誤差を補正すること。【解決手段】モータ制御装置は、ロータを回転させるモータの回転位置を算出する回転位置算出部と、回転位置算出部の動作電力の供給状態を制御する動作状態制御部と、ロータの停止目標回転位置と、コイルへの駆動電流の供給が停止された後、回転位置算出部への動作電力の供給が停止される前のロータの回転位置とに基づいて、ロータの回転位置の偏差を算出する偏差算出部と、偏差を記憶部に記憶させる記憶制御部と、記憶部に記憶させた偏差と、ロータの停止目標回転位置とに基づいて、ロータの回転位置を制御する回転位置制御信号を生成する回転位置制御信号生成部と、動作状態制御部により回転位置算出部の動作電力の供給が再開された後に、回転位置制御信号に基づいて、コイルに駆動電流を出力する駆動電流出力部とを備える。【選択図】図2