I had a class-D amplifier working at the beginning of January, but I’ve changed the specs a bit since then (adding the LC filter) , and the students have a different comparator chip than I used then (they have an LM2903, not an LM311), so I tried re-implementing it last night and this morning.
For the LC filter to work well, we want to use a fairly high frequency for the PWM (over 50kHz and preferably near 100kHZ), but there is a tradeoff. Power is dissipated as heat in the FETs on every transition, because both the pFET and the nFET are simultaneously on as the gate voltage on the FETs passes through intermediate values. To keep the amplifier efficient and to keep the FETs cool, we want to spend as little time as possible in the intermediate voltages, which means few transitions and transitions that are as fast as possible.
As I mentioned in Class D works, “The LM2903 does have only a 20mA output current, rather than the 45mA output current for the LM311, which would mean a 330Ω pullup resistor, rather than 150Ω for the LM311 with a 6.6v supply … . That means somewhat slower rise times for the gates of the FETs, which is probably the limiting factor on the efficiency of the amplifier. I suppose I could add a class A stage with a bipolar transistor to drive the FET gates if I needed faster rise times, but I think that the current design is working well enough for a 1-week lab exercise, so I won’t mess with it unless I need to.”
I had not re-read those notes last night, and was having trouble getting a high enough PWM frequency for the LC filter to offer much reduction in signal. At the frequencies I wanted to use, the FETs got hot. The problem is that the gate capacitances of the two FETs are huge (around 675pF and 500–750pF according to the spec sheets, adding up to 1.2–1.4µF), so the rise and fall time of the signals is limited by how fast the comparator can charge and discharge that big a capacitance. Last night I was trying a pullup resistor of 1kΩ, which was clearly not providing enough current.
Today, I tried putting the two comparators of the LM2903 in parallel, providing twice as much pull-down current, and shrinking the resistor until the low voltage was about 0.8V (enough to turn off the nFET). The rise time to Vdd-1V is about 0.8µs and the fall time to 1V is about 1.2µs, so I might do better with a slightly larger pullup, to balance the rise and fall times. Of course, I’ve been doing my testing with just a 6.6v single-sided supply, and they’ll be doing their design with a 5v or 6V supply for the preamp and a separate ±9v dual supply for the power stage, so some of the parameters may change, but it looks like I can go up to about 100kHz now for the PWM frequency without the FETs overheating, even after running for an hour.
One problem that may be reduced with the bench supplies is the coupling of noise back into the power source. I’m seeing a 10mV fluctuation in my 6.6V that is synchronized to the FETs switching. At first I thought that this was causing big problems with the comparator, since the gate voltage waveforms had flat spots in the rise and fall that corresponded to the places where the noise on the power supply was biggest. But I now think that the problem is a different one: capacitive coupling between the gate and drain (called reverse-transfer capacitance on the data sheets). As the FETs change state, the voltage on the drain changes rapidly in the opposite direction to the change on the gate, and the capacitive coupling is enough to keep the gate voltage from changing much as the drain voltage changes. This capacitance is about 10% of the gate capacitance, so a 6v swing on the drain would make about a 0.6v swing on the gate, which is about what I’m seeing, and the flat spots on the gate transitions correspond precisely with the rise and fall of the drain voltage.
I’ve provided a couple of plots to show the waveforms at the FETs and at the loudspeaker.I’m wondering whether using the larger voltages needed for getting full power out of the loudspeaker will result in further slowing down of the gate voltage swing and more power dissipation in the FETs. I’ll probably have to take my breadboard into the lab on Monday, and try it with the bench supplies.
Another problem with the power amp lab is feedback squeal. The microphones are omnidirectional and the loudspeaker is generally close enough that by the time we get obvious amplification, the amplification is enough to cause feedback. Even with only enough gain to get about a 3.5V peak-to-peak swing on the loudspeaker I trigger squeal. For next year, I may want to think of a different sound source for them to amplify than a microphone.
The inductors I bought (AIUR-06-221K) are not shielded, and a 90kHz has significant energy out to about 3Mhz, so I wondered whether the amplifier would interfere with an AM radio. It turned out to be a little hard to test, because my MacBook Pro laptop interfered with the AM radio up to about a meter away. Eventually I put the inductor on a long piece of speaker cord, so that I could test the radio far enough from my laptop. The inductor interfered with the radio when it was within about 10cm—not nearly as much as the laptop, but you’d definitely want shielding before putting an amplifier like this into an AM radio.
I checked that the loudspeaker really was acting like an inductor at the PWM frequency, by putting it in series with a 0.25Ω resistor (two 0.5Ω in parallel). With no input to the amplifier, the waveform across the resistor was a very small square wave (with a lot of noise and harmonics) while the waveform across the loudspeaker+resistor was a triangle wave, 90° out of phase. When I whistled into the mic, the audio signals at the loudspeaker and resistor were in phase and with a ratio of about 29 (compatible with a 7Ω impedance for the speaker). The voltage was about 2.4V p-p across the speaker and the current about 350mA p-p through the speaker, so I was getting about 0.4W RMS into the speaker, a long way from its 10W limit.