An ultrasonic surgical apparatus and method, the apparatus including a signalgenerator outputting a drive signal having a frequency, an oscillatingstructure,receiving the drive signal and oscillating at the frequency of the drivesignal, and abridge circuit, detecting the mechanical motion of the oscillating structureandoutputting a signal representative of the mechanical motion. The ultrasonicsurgicalapparatus also includes a microcontroller receiving the signal output by thebridgecircuit, the microcontroller determining an instantaneous frequency at whichtheoscillating structure is oscillating based on the received signal, anddetermining afrequency adjustment necessary to maintain the oscillating structureoscillating at itsresonance frequency, the microcontroller further determining the quality (Qvalue) ofthe signal received from the bridge circuit and determining material typecontacting theoscillating structure.