A motor control apparatus, characterized by: a position detector configured to detect a position of a motor configured to drive a drive mechanism; a speed operator configured to acquire the position of the motor so as to calculate a first speed of the motor; a position controller configured to acquire a difference between the position of the motor and a position command so as to generate and output a first speed command; a speed controller configured to acquire a difference between the first speed command and a second speed of the motor so as to generate and output at least one of a first torque command and a first thrust command, the second speed of the motor comprising a phase advanced relative to a phase of the first speed of the motor; a first phase compensator comprising a first lowpass filter used to advance the phase of the second speed of the motor relative to the phase of the first speed of the motor, the first phase compensator being configured to acquire the first speed and the at least one of the first torque command and the first thrust command so as to output the second speed of the motor, the first lowpass filter comprising a time constant calculated using a polynomial comprising a speed loop gain of the speed controller as an independent variable; an inertia variation inhibitor comprising a disturbance observer (31; 31A), the disturbance observer (31; 31A) being configured to estimate at least one of a disturbance torque and a disturbance thrust, the inertia variation inhibitor being configured to acquire the first speed and at least one of a second torque command and a second thrust command, configured to add the disturbance torque to the first torque command so as to generate the second torque command or configured to add the disturbance thrust to the first thrust command so as to generate the second thrust command, and configured to output at least one of the second torque command and the second thrust command; and at least one of a torque controller (4; 4A) and a thrust controller (4; 4A), the torque controller (4; 4A) being configured to acquire the second torque command so as to control a torque of the motor, the thrust controller (4; 4A) being configured to acquire the second thrust command so as to control a thrust of the motor, characterized in that said disturbance observer (31; 31A) comprises a resonance inhibition model configured to inhibit a mechanical resonance of the drive mechanism, wherein the resonance inhibition model of the disturbance observer (31; 31A) comprises an inverse system relative to a resonance inhibition nominal model, the resonance inhibition nominal model comprising a frequency characteristic control device comprising a plurality of time constants determined based on a plurality of frequency set values, the plurality of frequency set values being used to change a change rate of a gain of a frequency characteristic of a rigid body nominal model. a position detector configured to detect a position of a motor configured to drive a drive mechanism; a speed operator configured to acquire the position of the motor so as to calculate a first speed of the motor; a position controller configured to acquire a difference between the position of the motor and a position command so as to generate and output a first speed command; a speed controller configured to acquire a difference between the first speed command and a second speed of the motor so as to generate and output at least one of a first torque command and a first thrust command, the second speed of the motor comprising a phase advanced relative to a phase of the first speed of the motor; a first phase compensator comprising a first lowpass filter used to advance the phase of the second speed of the motor relative to the phase of the first speed of the motor, the first phase compensator being configured to acquire the first speed and the at least one of the first torque command and the first thrust command so as to output the second speed of the motor, the first lowpass filter comprising a time constant calculated using a polynomial comprising a speed loop gain of the speed controller as an independent variable; an inertia variation inhibitor comprising a disturbance observer (31; 31A), the disturbance observer (31; 31A) being configured to estimate at least one of a disturbance torque and a disturbance thrust, the inertia variation inhibitor being configured to acquire the first speed and at least one of a second torque command and a second thrust command, configured to add the disturbance torque to the first torque command so as to generate the second torque command or configured to add the disturbance thrust to the first thrust command so as to generate the second thrust command, and configured to output at least one of the second torque command and the second thrust command; and at least one of a torque controller (4; 4A) and a thrust controller (4; 4A), the torque controller (4; 4A) being configured to acquire the second torque command so as to control a torque of the motor, the thrust controller (4; 4A) being configured to acquire the second thrust command so as to control a thrust of the motor,