An ultrasonic surgical apparatus and method, the apparatus including a signal generator outputting a drive signal having a frequency, an oscillating structure, receiving the drive signal and oscillating at the frequency of the drive signal, and a bridge circuit, detecting the mechanical motion of the oscillating structure and outputting a signal representative of the mechanical motion. The ultrasonic surgical apparatus also includes a microcontroller receiving the signal output by the bridge circuit, the microcontroller determining an instantaneous frequency at which the oscillating structure is oscillating based on the received signal, and determining a frequency adjustment necessary to maintain the oscillating structure oscillating at its resonance frequency, the microcontroller further determining the quality (Q value) of the signal received from the bridge circuit and determining material type contacting the oscillating structure.