I'm trying to derive an accurate formula for the output of an error amplifier in the class D amplifier I'm simulating. Most literature on the error amplifier/integrator in class D amplifiers glosses over the technical details and and some even contradict eachother in how it works.
In the previous question I asked here, we found the transfer function of an ideal summing integrator:
$$ V_{\text{OUT}} = \frac{V_{\text{FB}}}{\omega R_{\text{FB}} C} + \frac{V_{\text{IN}}}{\omega R_{\text{IN}} C}$$
I tried applying this to my simulation but come up short. My understanding, based on the simulation is that the circuit integerator acts as a filter to the sum of the two inputs with a -3dB frequency at roughly 41kHz. I'll attach pictures of the simulated results below at 1kHz but i increased frequency until i got 3dB attenuation and it was around 41kHz.
My question is, how can the equation above be accurate when it depends on frequency and a lower frequency means a higher gain? At 1kHz using the values of the simulation below at t = π/2:
$$ V_{\text{OUT}} = \frac{-1.6}{2 \times \pi \times 1kHz \times 5.9k \times 220pF} + \frac{0.95}{2 \times \pi \times 1kHz \times 3.6k \times 220pF}$$
$$= -5.28V$$
This does not match the plotted value of roughly -3.7V. This calculation becomes more wrong as the frequency changes. In the time domain, the integral equation also does not make sense with huge numbers generated by the time constant 1/RC. How can I mathematically express the output of the error amplifier in the below circuit better?
Circuit is a unipolar PWM switching class D amplifier at 500kHz.
To be clear: Green is input, Red is feedback signal and contains 1MHz triangle wave ripple. I assume this ripple is caused by the 1/RC relationship on the differential amplifier (U1) where the square wave inputs are attenuated and integrated. And blue is the output of the error amplifier/integrator (U2).
Edit: From the advice of Sunnyskyguy EE75, i'll attempt to construct a transfer function based on the loop shown below.
G1 is the preamplifier gain that is not included in the simulation.
H1 is the differential amplifier gain:
$$H_1 = -\frac{R_2}{R_1}V_{\text{OUT}}$$
Vout is a peak to peak sine wave of roughly 12V so this makes sense with resistors R2 = 1k, R1=6.8k looking at the waveform.
G_PWM is simply Vint as a ratio of the carrier signal which is a triangle wave 500kHz +/-4.2V:
$$G_{\text{PWM}} = \frac{\left \lvert V_{\text{INT}}\right \rvert}{4.2} \times V_{\text{DD}} $$
Gint is still unknown to me.
VN is noise introduced from switching/deatime.
Best Answer
Ignoring the voltage gain of the Half bridge and just making a feedback loop of the filters;
I get a feedback loop with a fixed low gain <1 proportional to the 500kHz carrier with k1 from R ratios and T1,2,3 from RC products.
I did not bother with the equations but rather direct into simulation with a slider for signal frequency.
e.g. above signal levels have input carrier Vc ~ 10Vp and output PWM = 15Vp with analog signal on 2nd stage as "output= ~4*Vc" so a net gain of 0.4 Vc. using 15V PWM supply peak.