Provided is a motor controller for controlling a motor system including a power converter, a smoothing capacitor and a three-phase AC motor. The motor controller includes a generation unit configured to generate a modulation signal by adding a third harmonic signal to a phase voltage command signal, and a control unit configured to control an operation of the power converter using the modulation signal. The third harmonic signal includes a first signal component that causes an absolute value of a signal level of the modulation signal to be greater than an absolute value of a signal level of the phase voltage command signal at a timing in which an absolute value of a signal level of a phase current becomes minimum in each phase.