A motor controller (20, 20a to 20d) configured to control a motor according to a control cycle, the motor including a coil (330, 331, 340, 341, 350, 351) that generates a rotating magnetic field, and a rotor (320, 321) that is formed using a permanent magnet and rotates by the rotating magnetic field generated by the coil (330, 331, 340, 341, 350, 351), the motor controller (20, 20a to 20d) comprising: an obtaining unit (25, 32) configured to obtain a rotation position and an angular velocity of the rotor at a first time point; a compensation amount calculation unit (30, 30a to 30c) configured to calculate a compensation angle by which the rotor (320, 321) advances from the first time point to a second control cycle subsequent to a first control cycle including the first time point, based on an angular acceleration of the rotor (320, 321), the angular velocity of the rotor (320, 321) at the first time point and a time length of the control cycle; and a voltage controller (23, 23d, 24) configured to control a voltage to be applied to the coil (330, 331, 340, 341, 350, 351) such that a rotating magnetic field based on a rotation position of the rotor (320, 321) advanced by the compensation angle from the rotation position of the rotor (320, 321) at the first time point is formed in the second control cycle, wherein: the voltage controller (23, 24) is configured to control the voltage to be applied to the coil according to PWM control, the control cycle is a PWM cycle, the compensation amount calculation unit (30, 30a) is configured to calculate, as the compensation angle, an angle by which the rotor (320, 321) advances in a control delay time period from the first time point to a second time point in a middle of a pulse output time period in the second control cycle, characterized in that the compensation amount calculation unit is configured to obtain a target angular velocity of the rotor (320, 321), and calculate the angular acceleration of the rotor (320, 321) based on the target angular velocity and the angular velocity of the rotor (320, 321) at the first time point. an obtaining unit (25, 32) configured to obtain a rotation position and an angular velocity of the rotor at a first time point; a compensation amount calculation unit (30, 30a to 30c) configured to calculate a compensation angle by which the rotor (320, 321) advances from the first time point to a second control cycle subsequent to a first control cycle including the first time point, based on an angular acceleration of the rotor (320, 321), the angular velocity of the rotor (320, 321) at the first time point and a time length of the control cycle; and a voltage controller (23, 23d, 24) configured to control a voltage to be applied to the coil (330, 331, 340, 341, 350, 351) such that a rotating magnetic field based on a rotation position of the rotor (320, 321) advanced by the compensation angle from the rotation position of the rotor (320, 321) at the first time point is formed in the second control cycle, wherein: the voltage controller (23, 24) is configured to control the voltage to be applied to the coil according to PWM control, the control cycle is a PWM cycle, the compensation amount calculation unit (30, 30a) is configured to calculate, as the compensation angle, an angle by which the rotor (320, 321) advances in a control delay time period from the first time point to a second time point in a middle of a pulse output time period in the second control cycle, characterized in that the compensation amount calculation unit is configured to obtain a target angular velocity of the rotor (320, 321), and calculate the angular acceleration of the rotor (320, 321) based on the target angular velocity and the angular velocity of the rotor (320, 321) at the first time point. the voltage controller (23, 24) is configured to control the voltage to be applied to the coil according to PWM control, the control cycle is a PWM cycle, the compensation amount calculation unit (30, 30a) is configured to calculate, as the compensation angle, an angle by which the rotor (320, 321) advances in a control delay time period from the first time point to a second time point in a middle of a pulse output time period in the second control cycle, characterized in that the compensation amount calculation unit is configured to obtain a target angular velocity of the rotor (320, 321), and calculate the angular acceleration of the rotor (320, 321) based on the target angular velocity and the angular velocity of the rotor (320, 321) at the first time point.