An apparatus for controlling a compressor includes a stroke calculator for
calculating a stroke estimate value of a compressor based on a value of a
current applied to a motor of the compressor and a value of a voltage
applied to the motor of the compressor; an operation frequency reference
determining unit for integrating the stroke estimate value to output an
integrated stroke value, detecting a mechanical resonance frequency of
the compressor based on the integrated stroke estimate value and the
current value, and determining the detected mechanical resonance
frequency as an operation frequency reference value; and a controller for
varying a current operation frequency of the compressor according to the
determined operation frequency reference value.