My very first Class D pwm (switching) amplifier.

Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.
IVX, sorry, but you must have done your calculations bad. 2*pi*R*C=21KHz, aprox. (R=2.2KOHm, C=3.3nanoF).
How do you calculate the feedback loop gain?

I expected to have a gain of 22 (22k/1k), but it is lower, about 9. I suspect that in order to consider it as an ideal opamp with negative feedback and inverting topology, you must assume that the open-loop gain is infinite, and in this case, it isn't by far, it is about 10 (depending on the triangle amplitude and supply rails).
 
Hi Sergio

As far as I remember your Triangle is 6 V pp (and 250 kHz) is this true ?

Do you want to use it fullrange ?

The NFB factor could be increased significantly by increasing the forward gain of your amp. As soon as that is achieved the gain can be calculated as if your circuit was an inverting opamp stage: Gain = R2/R1.

Regards

Charles
 
Yes, my triangle has approx. 5Vpp, so for a 5Vpp input I would get the maximum amplitude. Assuming that my rails are +/-30v, the open-loop gain is then approx. 30/2.5=12

To increase the open-loop gain of my amp, I guess I can do two things:
a) Increase the gain of the opamp (for example, making R2=100K -and reducing C1 accordingly-), the overall open-loop of the circuit is 100*12=1200. Then my simulations show that the gain is almost only determined by -R1/R6, as I wanted.

b) Reducing the amplitude of the triangle.

I think that (a) is the way to go, isn't it?

Thanks
 
"Yes, my triangle has approx. 5Vpp, so for a 5Vpp input I would get the maximum amplitude. Assuming that my rails are +/-30v, the open-loop gain is then approx. 30/2.5=12"

Sorry, I have to multiply also by the gain of the opamp stage, that is 2.2K/1K=2.2, so the total open-loop is 12*2.2=26.4, which is far less than infinite.

As I remember, the gain of an amplifier with negative-feedback is A/(1+A*beta), where A is the open-loop response and "beta" is the NFB factor. Usually, as with opamps, A is very high, so G=1/beta, approx.
In the case of my amplifier, A is only 26.4, so the above assumption (that leads to the typical formula R2/R1 in a non-inverting opamp) is false and hence R2/R1 is not applicable unless the open-loop gain is increased significantly.

Is this correct?

Thanks
 
Is this correct?

Yes it is !

For PWM designs that are not self-oscillating the unity-gain point can be about half the switching frequency. I.e. it could be at around 125 kHz. I would place it at 100 kHz approx to have some margin for PSU voltage deviations and capacitor tolerances left.

Therfore you should decrease your C1 accordingly. The value of R2 can be set according to your taste. Maybe you prefer really high NFB around the bass frequency range then you should use a large R2. If you can live with less NFB then you can choose R2 sothat you have the same NFB up to 10 or 20 kHz. This could have some sonic merits but has to be tried out first to be sure. This would not mean very much work because it is only one resistor that has to be changed.

Regards

Charles
 
Sorry, but I don't understand you completely:

Thanks for your explanations, Charles. You would make a good teacher

Thanks Sergio, but I don't understand how this two statements would match ? :confused: ;)


With unity-gain point I mean the frequency at which the total gain of the closed LOOP has dropped to 1. BTW: the difference between the actual phase-shift and 360 degrees (or 180, depending how you look at it) is the so-called phase margin.

Because a switching amp is a sampling device, the sampling theorem applies. The actual sampling frequency is however not always the switching frequency (it is depending on the input-level as well), but you are on the safe side if you take the switching frequency as the sampling frequency and half of it as Nyqvist frequency.

If you choose 1 nF for your C1 then this frequency would be at 87 kHz approx.
When you lower the frequency, the loop gain is rising inversely proportional, down to a frequency determined by R2. For an R2 of 100 k Ohms this would be at 19 kHz approx and the feedback factor would be about 4.5 (up to 19 kHz where it gradually starts to drop with rising frequency).
If you make R2 470 k this would happen at 4 kHz approx and the feedback factor would be about 21. If you leave it away completely, the feedback factor could reach infinity at 0 Hz (theoretically of course). I would not suggest doing that since it might make your amp latchup-prone in case of clipping.

Regards

Charles
 
Well, I have been simulating what you say and something doesn't match:

With R2=470K and C1=1nF: the closed loop "cutoff (-3dB)" frequency is about 117KHz, with the 0dB point at about 475KHz.
(this with R6=1k and R1=22K)

With R2=100K and C1=1nF: results are almost the same.

Are you assuming something that is not in the schematic? By the way, how did you calculate the 0dB point of 87KHz for C1=1nF?

P.S: If I don't understand some things at a glance doesn't mean that you are not making a great effort and are very patient spending so much time explaining these questions to us. That's why I said you could be a great teacher :)
 
I think you simulated the closed-loop gain of the whole amp, did you ?

I however was talking about the gain of the feedback LOOP alone (refering to the drawing within post # 259), which must be greater than one, in the operating frequency range, in order to behave as NFB at all (loop-gain = feedback-path-gain x integrator-gain x PWM-gain).
If you want to simulate this you have to disconnect R1 from the output node and feed the input signal there (don't forget to ground R6 in this case).

Regards

Charles
 
I agree with Sergio. Thanks for your help.:) I am putting more concentration now on the switching power supply. I am trying to improve its regulation but I don't want the output filter capacitance very large. That way if the speaker outputs on the amp are shorted, its mosfets can discharge the capacitors and retain their smoke. ;) By then, the current limiting in the power supply circuit can engage.
 
Well, I think I am starting to get it.
So, what I need in order to take the advantages of NFB is the gain of the feedback loop (from R1 to the output) to be higher than 0dB in the audio band. (by the way, I want it full-range). But I suppose that, the lower the gain at the switching frequency, the most accurate the feedback is, am I right?

With c1=3n3 and R2=22K the 0dB point of the FEEDBACK loop is at 25KHz and -26dB at 250KHz. Is this enough rejection for the feedback to act as such and be useful?

Then I close the loop and simulate the total input-output transfer function, and I want it to be flat at least in the audio band. With the above values, the CLOSED LOOP transfer function has a -3dB point of about 35KHz, and a gain of 21, that is about right.

Is this OK altogether?

Thanks, I am learning a lot and refreshing my knowledge of feedback.

Sergio
 
Hi Sergio

I would go for more NFB and then check if it has sonic merits if you reduce it.
The max -3db frequency of the loop should be at half the switching frequency (i.e. C1=1 nF for 87 kHz or slightly less for a larger f3).
This would result in a closed-loop f3 around 100 kHz (not taking the output filter into account of course).

If you prefer the closed-loop f3 of 35 kHz, then use an input filter instead of reducing forward gain !

Regards

Charles
 
Well, I think that the amp works well, I am going to design the definitive PCB.
One thing more: I have never used the diodes in parallel with the mosfets, once I tried and the waveform was worst. Is the amp expected to run safe under all conditions without them? If so, I will eliminate them from the board.

Best regards
 
In my previous tests I have used only a 2-pole output filter (33uH coil and 1uF capacitor). The result is -38dB rejection that leads to a 350mVrms ripple at 250KHz that is not pretty but doesn't disturb neither.
Although my final board was going to use a 4-pole + notch achieving more than 90dB of rejection I am re-considering simplifying the design simply by adding a notch to the 2-pole design, leaving it as in the draw below. It achieves more than 60dB of attenuation at 250KHz if properly tuned, which should leave about 30mVrms of ripple.

Is there something more that I should consider? I think that these figures are very good as the ripple at that frequency is not audible and produces only a minimal extra dissipation at the speaker. What do you think?

As you can see, I am trying to optimize the design. When I have finished it, I will provide the complete schematic here.

This is the new proposed filter:
 

Attachments

  • filter.jpg
    filter.jpg
    58.5 KB · Views: 884
Hi Sergio

I don't feel very comfortable about that. You won't achieve enough suppression of the higher harmonics (you should consider your neighbours, who like to listen to their radio, and all the airline passengers who want to arrive safely !!!).

Apart from that, the output filter is also a reconstruction filter and I doubt that simple notch filter can do this properly (If it would, all DACs would be followed by notch filters instead of LPFs). If combined with a notch-filter you don't need as large a inductor and cap as 30 uH and 1 uF however.

Regards

Charles
 
>>Apart from that, the output filter is also a reconstruction filter and I doubt that simple notch filter can do this properly (If it would, all DACs would be followed by notch filters instead of LPFs). If combined with a notch-filter you don't need as large a inductor and cap as 30 uH and 1 uF however.<<

OK, I am now with you in that it is better to use a 4-pole LC to reduce EMC. About the notch, Crest LT amplifier, for example, uses this technique, although with a higher order filter. Then what about my first design, a 4 pole filter with a capacitor in parallel with the second coil to form a notch?

Sorry if I insist, but what do you think about definitively removing the output diodes?
 
I will have alook at you first filter design.

The diode question depends on how well your FET's intrinsic diodes can deal with the inductor's freewheeling current (most important parameter is reverse recovery time).
You should not only take the sound into consideration in this case but reliability as well !

Regards

Charles
 
Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.