An oscillation sensor for a regulator that provides dynamic control of a
connection/disconnection of a compensation capacitance. The compensation
capacitor is disconnected under normal operation and is automatically
connected if oscillation is detected in the output and regulator's error
amplifier. In this way, oscillations are stopped in the regulator almost
immediately after it occurs. Also, once the circuit is stable again, the
compensation capacitor is quickly disconnected again. Consequently, the
compensation capacitor does not adversely affect the overall performance
of the regulator.