Provided are an apparatus and method for controlling a motor which
compensates for a mechanical tolerance of the motor in a case where a
feedback sampling frequency increases in order to more precisely control
a brushless DC motor. The apparatus for compensating the mechanical
tolerance of the brushless DC motor includes: a speed controller
calculating a speed error that is a difference between a motor speed
measured in control sections and a reference speed using a back
electromotive force generated by the motor, and generating a motor
control input signal using the speed error of the control section; a
moving average calculator calculating a moving average value of the motor
control input signals in a predetermined moving average section including
recently generated motor control input signal whenever the motor control
input signals are generated; and a motor driver generating an electric
current for driving the motor corresponding to the moving average value.