Yesterday I played around a little with a hysteresis oscillator (relaxation oscillator) using a loudspeaker as the feedback device, rather than a resistor, as shown in the schematic below:
I was hoping that I could get the oscillator to resonate at a predictable frequency, based on the gain or the phase shift of the voltage divider consisting of the loudspeaker and the capacitor. Of course, a relaxation oscillator that relies on the hysteresis of a Schmitt trigger is emphatically not a linear circuit, and there is no reason to think that using a loudspeaker instead of a resistor for the feedback element will simplify anything.
I did have a few questions:
- Would it oscillate? (I saw no reason it shouldn’t.)
- At what frequency would it oscillate? Was there any relationship to the gain or phase shift of the loudspeaker and C1 voltage divider?
- How stable was the frequency?
- Would it be loud enough to hear on the loudspeaker?
Before even wiring up the circuit, I ran some gnuplot scripts with my model of the loudspeaker to see what the gain and phase of the voltage divider would be:
Note that the loudspeaker+capacitor provides a bigger phase change at high frequency and a faster rolloff in gain than an RC filter would. I was hoping that the resonant peaks at high frequency might capture the oscillator and provide a moderately stable output.
To avoid load on the oscillator from a multimeter (used to measure frequency) or oscilloscope, I buffered the output with a couple more Schmitt triggers.
|electrolytic||measured with Fluke 8060A|
|ceramic||measured with Fluke 8060A|
|ceramic||measured with Bitscope oscilloscope|
The frequencies were not stable, but shifted unpredictably within a fairly wide range. The Fluke 8060A meter is not capable of frequency measurements above about 100kHz, so I used the FFT on the Bitscope USB oscilloscope for the higher frequencies. For the Bitscope measurements, I took whichever frequency seemed to come up most often—usually the lowest frequency.
The audio-range frequencies 27Hz to 3.4kHz were clearly audible on the loudspeaker (even annoying at the higher frequencies), and the fluctuations in frequency were audible also—they are not an artifact of the measuring equipment.
Looking at the input and output of the oscillating Schmitt trigger for a moderately large capacitor is instructive:
The current limitation on the Schmitt trigger output seems to be the controlling factor here, so we should be modeling this as a current source and capacitor, with the feedback impedance being irrelevant until it gets large enough that the Schmitt trigger output is voltage-limited instead of current-limited.
I tested this by replacing the loudspeaker by a 22Ω resistor, and got a very similar result (though without the voltage spikes from switching the loudspeaker inductance):
If we look at the voltage across the resistor, we can measure the current:
With a 3.9Ω feedback resistor, I again see waveforms consistent with a ±18.5mA current limit (dropping gradually to ±15mA before it switches to the other phase). I can get the same triangle wave at the input if I use a wire for the feedback, with the output only a few mV different from the input (for a wire resistance equivalent to about 130mΩ). The period is about the same also, indicating that the current is what is determining the charging time of the capacitor, not the feedback resistor.
With a 200Ω feedback resistor, I see a little current limitation just as the output switches, but it becomes voltage-limited soon after. The period increases, as we would expect when the voltage limitation reduces the current.
So the loudspeaker in the feedback loop was not very interesting—it was behaving much like any other low-impedance feedback. At least, that is what is happening with low frequencies, where the loudspeaker is reasonably modeled as an 8Ω resistor.
With a 10nF capacitor and a 22Ω feedback resistor the oscillator oscillates at 1.27MHz, but with the loudspeaker only at 589kHz, so the loudspeaker is behaving more like a large impedance at these frequencies. The output with the 22Ω resistor is a triangle wave, but with the loudspeaker is a square wave (with a little high frequency ringing). I can’t see these frequencies well on the Bitscope oscilloscope, so I had to switch to my analog Kikusui COS5060 60MHz oscilloscope. With 47Ω and no oscilloscope load, I get a frequency around 965kHz, with 22Ω around 1.13MHz, with 81Ω around 768kHz, with 100Ω 687kHz, with 120Ω around 613kHz, with 150Ω around 526kHz, and with the loudspeaker around 590kHz. So the loudspeaker is behaving like a 125–130Ω impedance around 590kHz, which is consistent with the measurements made of the loudspeaker impedance around that frequency. Similarly with a 3.3nF capacitor, I get 150Ω 1.23MHz, 180Ω 1.1MHz, 200Ω 1.03MHz, 220Ω 972 kHz, and loudspeaker 987kHz. The output waveforms with the 220Ω or loudspeaker as feedback are fairly good square waves, so the oscillator feedback is voltage limited, not current limited.
So it looks like the simple analysis of the oscillator as being either a current-limited or a voltage limited output suffices for modeling the relaxation oscillator—the phase changes don’t seem to matter much, just how fast the capacitor charges or discharges, which depends mainly on the magnitude of the impedance.
Incidentally, the fluctuations in frequency for the oscillator occur with the resistors and the loudspeaker alike, and so don’t seem to be due to any physical or electrical properties of the loudspeaker. They also occur with both electrolytic and ceramic capacitors.