A method and apparatus to operate a surgical instrument in response to a thermal condition being detected that warrants curtailment of further operation. When the thermal condition is reached, command signals are generated that cause a needle of the surgical instrument to either have its vibrational speed slowed, have its vibrational movement stopped, or have it withdrawn from its relative position. The detection is of infrared radiation wavelengths and is carried out with either a thermal imaging device of a thermal recognition device. A corresponding temperature of the detected infrared radiation wavelengths is compared to a critical temperature to determine whether the thermal condition has been reached.