Building a Class-D Amplifier Using the TPA3122D2 === ###### tags: `Circuit Design` ## Intro This home project is aiming for constructing an class-D amplifier to drive a speaker. The core of a Class-D amplifier circuit comprises various functional elements, including a triangular wave generator, gate driver, filter circuit, feedback loop, and more. To make life easier, I have opted for a integrated power amp IC, TPA3122D2, made by Texas Instruments. It combines all the necessary circuitry and reduces the time invested in the design phase. I'll demonstrate the step-by-step process of my work. The design is based on the demo board but few changes are made. ### Step 1: Define features Before starting our journey of designing the circuit, we should know what do we want to achieve. Knowing the goals at the beginning would help us aligned during the designing process. 1. Power Level (Loudness): 2 x 15w, 10%THD ## Schematic ![image](https://hackmd.io/_uploads/r1QZzDeUa.png) ### **Power Supply** Since we are driving a 4 $\Omega$, 10W speaker, the voltage can be calculated as below: \begin{split} P &= \frac{V^2}{R}\\ PR &= V^2 \\ 10\times4 &= V^2\\ V&=6.325 \end{split} This result is $V_{rms}$. To change to $V_{p}$ (Peak Voltage) and $V_{pp}$ (Peak to Peak), \begin{align} V_{p}=6.33\times\sqrt{2}=8.95 \end{align} \begin{align} V_{pp}=8.95\times2=17.9 \end{align} In datasheet, the recommended voltage supply is 17V for the single-ended output. ### **Output Filter** The filter is targeting to filter out signal that human can not hear, which is between 20Hz ~ 20kHz. Thus, a band-pass filter is needed. It can be built by cascading a ==low-pass filter== and a ==high-pass filter==. ![image](https://hackmd.io/_uploads/r1aaVlCQa.png =60%x) From the low-pass filter side, the LC filtering is used. To be noticed, $R_{filter}$ is used to damp the response from unwanted resonant. If L and C are chosen properly, no need to use the damping resistor. The high-pass filter is a RC circuit that blocks DC, the formula for selecting the capacitor value is \begin{align} f_c=\frac{1}{2\pi C_oR_L} \end{align} where $f_c$ is cut-off frequency. The recommended value from datasheet for each component is: $L_{filter}$ = $22\mu H$ $R_{filter}$ = $4.7k \Omega$ $C_{filter}$ = $0.68\mu F$ $C_{O}$ = $470\mu F$ It is simulated by LTSpice and the cut-off frequency locates at 85Hz and 40.8kHz. This setting eliminates some low frequency signal(bass). ![image](https://hackmd.io/_uploads/By_T67w4T.png) *LTSpice Schematic* ![image](https://hackmd.io/_uploads/SJKrKe9Ep.png) *Frequency Response* ### **But why those values are recommended** From the simulation, the values of each component looks fine, but how does the manufacturer recommend this values? Let's investigate on the inductor first. #### Inductor Parameters 1. Inductance 2. DC Resistance 3. Saturation Current 4. Temperature Rise Current 5. L vs I graph A real-world inductor will saturate. If current is over certain saturation value, the inductance will decrease significantly. The higher the inductance (more winding), the less linear the inductor. ## Ref 1. [15-W Stereo Class-D Audio Power Amplifier datasheet (Rev. A)](https://www.ti.com/lit/ds/symlink/tpa3122d2.pdf?ts=1700559882608&ref_url=https%253A%252F%252Fwww.ti.com%252Fproduct%252FTPA3122D2%253Futm_source%253Dgoogle%2526utm_medium%253Dcpc%2526utm_campaign%253Dasc-null-null-44700045336317122_prodfolderdynamic-cpc-pf-google-wwe_int%2526utm_content%253Dprodfolddynamic%2526ds_k%253DDYNAMIC%2BSEARCH%2BADS%2526DCM%253Dyes%2526gad_source%253D1%2526gclid%253DCjwKCAiAx_GqBhBQEiwAlDNAZoYKyxf-XC3ek3fflEZVYdzga7meMcu4WpbVcdqCFEJrLMsvu_Jr7xoC04cQAvD_BwE%2526gclsrc%253Daw.ds) 2. [Basic amplifier testing with an oscilloscope](https://audiokarma.org/forums/index.php?threads/basic-amplifier-testing-with-an-oscilloscope.866841/)