General points:
- The high-frequency parts should be as closely together as possible (more on PCB design here).
- AD modulation (3.1 here).
- Full-Bridge topology (Fig 5b here).
Input is inserted to the circuit with a 3.5 mm mono jack plug:
An active low-pass filter of 2nd (Butterworth coefficients and Sallen-Key topology, this page is helpful) with a corner frequency of around 30 kHz shall filter input device noise while not compromising the input signal in the audible 20 Hz to 20 kHz range. This removes unwanted high frequency components that may deteriorate the modulation (if the noise is close to or higher than the modulation frequency) and produce electromagnetic inference throughout the circuit. The supply voltage for the NE5532 is +6V and -6V (as for the rest of the circuit).
After low-pass filtering (and amplifying with a gain of 2), the signal is ac-coupled to the modulator/comparator using a simple capacity of 5 μF. This assures that the input to the comparator is centered around 0 V as will be the input from the triangle generator. Frequencies of 20 Hz and above are barely affected by this.
For the pulse width modulation a triangle or sawtooth signal of usually 100kHz to 500 kHz is used. The shape of the triangle/sawtooth is of high importance, as non-linearities will lead to systematic distortions of the audio signal, independent of the modulation frequency. (Put precisely though, the flanks don't have to be linear if the frequency is high enough, but the duty must be proportional to the height.)
For this project, a simple opamp-driven multivibrator circuit was used:
** COMING SOON **
This way, formidable triangle waves of frequencies up to 400k could be produced. Note that the usage of the high performance opamp CA3130 was necessary in order to archieve this frequencies (an LM358 failed for much lower frequencies while an NE5532 did better but failed at producing sharp peaks).
The resistors and the capacity were chosen such that a 125kHz triangle with an amplitude of about 1V resulted. The frequency was relatively small, as a faster modulation would have led to problems in the remaining circuit, which is not well adepted for too high frequencies.
Since the amplitude of the modulation signal in relation to the audio input determines, how strong the actual amplification of the class D amplifier will be, a non-inverting opamp-amplifier (NE5532) is used on the original triangle. The amplitude of the triangle may then be adjusted with an potentiometer governing R1.
Remark: The triangle generated here is actually part of the charging curve of the 5μF film capacitor, but an early cutoff makes it very triangluar-ish.
The filtered audio input V1 and the generated triangle V2 are compared to yield the pulse width modulated (PWM) signal Q (high if V1 > V2, low otherwise) and its inverse Qi. For this task the comparator lm311 is used.
The most interesting part of the class D amplifier is the output stage, where (1) the actual amplification happens and (2) the signal is low-pass-filtered to (at least partially) remove the high-frequency components of the modulated signal. Two designs are common: Half-bridge or full-bridge (see e.g. here).
Design questions:
- BTL output (full-bridge) or single-ended (half-bridge).
- MOSFET gate drivers / dead-time generation
The output filter should be adjusted for high currents, so it must have a small resistance to prevent power loss. Therefore an LC (common mode/ hybrid) topology with Butterworth coefficients is used (second order, passive). Filter designs for different speaker impedances can be found here. Points regarding the Material Selection:
- Pay attention to DC current rating of L.
- Use LC output filter without ceramic capacity.
- Active Low-Pass Filter Design
- Class-D LC Filter Design
- Understanding output filters for Class-D amplifiers
- Circuit board layout guidelines for Class-D amplifiers
- Class D audio amplifiers: theory and design
- Class D Audio Amplifier Basics
- Class D Audio Amplifiers: What, Why, and How
- Design and analysis of a basic class D amplifier
- The Class-D Amplifier
- Design Considerations for Class-D Audio Power Amplifiers
- Sallen-Key Low-pass Filter Design Tool