Fully Discrete Class D Amplifier (WIP)

Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.
Tubes work just fine for PWM -- downsides are mainly that it's a hassle to use a lot of tubes, so you don't usually get as nice waveforms. Example: instead of building a comparator out of a diff pair, CCS, mirror, VAS and optional output, you might short-cut to just the diff amp (with resistive tail), and maybe a cathode follower if you need it to drive things. Even so, it's easy to get performance comparable to a similar transistor circuit; I've measured 150ns edges from a sweep tube under simple conditions, which isn't too bad.

Tim
 
Yea.. I think its good they're challenging us but I feel like there was no build up of classes to warrant this project..

Anyway, I'm not sure why my input for that circuit outputs no sound but a function generator outputs noise. :/ I'm guessing it's not enough power lol but isn't that the point of a power amp @_@
 
This might be a stupid question but, I bought a 3.5mm jack that I have as an input (coming from my computer) and the output going to an 8Ohm speaker. I start playing music, should my speaker be outputting sound? It seems my input voltage is too low because plugging this straight to a function generator at 4Vpp I can hear the frequency noise properly. I'm so lost ): This is the worst project I've ever been assigned :confused: :(

Any help would be appreciated ):
 
It's Alive!!

So I've still been working on this project (lol no choice but to work on it to graduate!) and I've finally got it to the point where I can actually hear music through the speakers!

What I noticed before is that audio from headphone jacks give very little voltage so I had to throw in a pre-amp in there and mix matching the right caps finally got something going!:wave2s:

Attached are my up to date schematic and here's a video of it in action (here)

Sound quality wise, it seems to sound nicest at about 5V. When the music becomes more heavy the higher tones seem to sound less appealing (symbals specifically on the drums) Any advice to make this better? To be honest, I'm just happy it sort of works lol
 

Attachments

  • ThisisCurrent.PNG
    ThisisCurrent.PNG
    77.2 KB · Views: 584
  • Graph.png
    Graph.png
    120.5 KB · Views: 572
It looks like your M3 does never turn ON properly.
In order to get symmetric signal magnitudes to the your input of the switching stage you should chose R5<R47.
Background: Q40 is turned ON from +8V through R5+R47, while Q43 is turned ON from -8V through R47+UcedropofQ1.
Give it a try and check if something turns better when you change R5 from 100k to 18k.
In fact you have chosen very high values for R5 and R47 anyway, so in a second step slowly reducing their both values might be a good idea.
 
@Soldermizer
My professor actually allows vaccum tubes to be used in my project but they're quite outdated aren't they? Here's his specifications and his mention of vaccum tubes for reference (here)

Thanks everyone for the advice!

So you are only allowed to use BJT, FET, or VACUUM TUBES for Class D amp? I mean, what else could possibly be used to make a Class D amp?
 
It looks like your M3 does never turn ON properly.
In order to get symmetric signal magnitudes to the your input of the switching stage you should chose R5<R47.
Background: Q40 is turned ON from +8V through R5+R47, while Q43 is turned ON from -8V through R47+UcedropofQ1.
Give it a try and check if something turns better when you change R5 from 100k to 18k.
In fact you have chosen very high values for R5 and R47 anyway, so in a second step slowly reducing their both values might be a good idea.

Wow thanks for the feedback! I'll try this out tomorrow at school. Helps a lot. PSPICE simulation already looks nicer. I don't want to trouble you but how do you conclude these things X_x? If it's too long to explain I'd understand.

So you are only allowed to use BJT, FET, or VACUUM TUBES for Class D amp? I mean, what else could possibly be used to make a Class D amp?

Haha, I'm not sure but everything needed to be a discrete component. I'm pretty sure this would have been a lot easier if I had the chance to use an IC for the comparator and the triangle wave form generator X_x. Vaccum Tubes, I don't even know how they work to be honest.
 
...how do you conclude these things X_x?

In your SIM results I saw that the signal behind the switching stage is not going high. So I concluded M3 never turns ON properly.
Consequently I started to look what in the circuit is different of driving M3 vs M4. This leads you to Q40 and Q43 and their base drive.
Q40 is turned ON from +8V through R5+R47, while Q43 is turned ON from -8V through R47+UcedropofQ1.
If you want to have the available base drive currents similar you have to fullfil:
abs( 8V / (R5+R47)) similar abs (-8V + UcedropofQ1) / R47)
abs means 'absolute value of'
Now guess Ucedropof about 0.5V
==> 8V / (R5+R47) similar 7.5V / R47

This would lead you to an even larger ratio of R47 vs R5,
but I did not want to have R5 to low, because also the gate drive of Q1 is weak and its capability to pull down R5 is limited.

Furtheron when looking to typical properties of small signal BJTs, you will find that your drive impedances are pretty high for driving them at reasonable speed, that's why I additionally proposed to reduce both in second step.
How much you can reduce R5&R47 is limited by the pull down capabilities of Q1. If necessary - in a third step you could reduce R63 to extend amount of possible impedance reductions.

A fourth step might be a DC adjustment.
Without that you most likely will have a high DC component at the speaker.
Adjustment is possible through variation of R77 and/or R117

A fifth step could be asking your tutor why he expects that you would able to debug his circuit. ...just a guess that the circuit is from him.. ;)
In case step5 bears risks for your graduation, skip step 5 or schedule it after you have passed your graduation.
 
So I've tried your suggestions and I've lowered majority of the resistors you had mentioned.

Trying it out on the board it sounds really poppy and sometimes non existent X_x.

I actually made this whole circuit ): excluding the amplifying stage which I borrowed from a fellow user here :/. I had a mind set that a class D involves a triangle wave, (middle of the circuit) and a differential amplifier (left of circuit). The triangle and the input are then compared and the result is placed in the amplifying stage. :/ ): So if anyone is to blame it's me lol but I'm trying!
 
...hm, if you are able to do the circuit and even calculate some values, I am wondering why are so lost in debugging it. Normally if some has an opinion how to settle the schematic, he also has an opinion how the signals should look and is able to measure, see deviations, dig deeper and find the reason for the deviation (at least in lucky situations like your's, where the circuit does not immediately blow).
Anyway, in order to go on in a reasonable way, you have to measure and analyse the signals on the real board.
And check after every mod, if the mod had the intended effect.
It must be done in small steps.
Typically one starts with checking the supply rails.
Then you should check the triangle.
Then the output of the comparator.
Then the signal which you are feeding to your gate drivers.
Then the output of the half bridge and gate signals.

Where ever the signals do not look like they should - dig deeper.
 
Yeah, I'm trying my best :/ I'm not too good with analog circuits. I'm more comfortable in the digital level since practically all my classes have been digital for my comp eng. major (hence why the professor gave me an analog individual senior design project).

I've taken all your input into consideration and here's my updated schematic (attached.) R47 since R5 is 18.2k should be roughly 180k but for some reason it just doesn't sound as clean as 100k. Changing it to 47k also had more distortion as well X_x.

It's really weird though because at 5V it plays fine despite the lack of some bass and weak volume. BUT once I wrap my fingers on the top of C24 the audio gets louder AND I get a much cleaner bass. :confused: I felt like I had magic hands hehe. Though I'm not sure how I can keep that bass and louder audio without touching it. :eek: That's my next goal.

Here's a video of what's happening HERE
 

Attachments

  • Capture.PNG
    Capture.PNG
    75.8 KB · Views: 602
  • Graph.png
    Graph.png
    169.5 KB · Views: 584
The low volume and poor bass is fitting to your input gain stage values.
In simplified view the gain of the input stage is defined by the impedances of R77 and C24. C24=380pF has a high impedance at audio frequencies and furtheron shows a 1/f impedance, which increases the gain of the input stage towards higher frequencies . When touching a 380pF the way you did, your fingers form a parallel impedance to C24 and change the transfer function of the gain stage.
Try to substitute C24 by a series connection of a cap and resistor.
Reasonable starting points would be 1uF (towards the signal generator) and 10k (towards the base of Q77).

R47 is already pretty high with 100k. Going to 180k results in weak driving signals for your gate drive circuit.
The ratio of 100k/18k should be OK.
You could try to step down both in small steps and search fro an optimum.
 
Last edited:
This is fantastic!

Thanks so much Chocoholic! You've been incredible help and I don't think I would be where I am now if not for your help!

It's sounding as good as I can probably make it right now and I'm off to step two and soldering it on a board. Here's a video to show where it is now (here).

Thanks so much!
 

Attachments

  • Schem.PNG
    Schem.PNG
    94.6 KB · Views: 539
  • wave.PNG
    wave.PNG
    208.3 KB · Views: 496
Great!
....glad to see that you made the race. :)
Wishing you good luck with your prof.
Asking a digital native who is studying computer electronics to design and build a discrete classD amp, that's a tough project.
And it was positively brave from you to chose such an alien project.
It is always good to see and learn about topics, which are beyond the main stream of your particular discipline.
Enjoy :cool:
 
BTW:
Your output filter doesn't filter much.
The amount of HF at your speaker is so huge that it might already be stress for the tweeter.
You have a low switching frequency and a fast filter - not really fortunate.
When changing the filter, take care not to place the filter resonance close to the switching frequency....
 
Ohh that's what's going on? I figured something weird was going on when if I bypass the filter and connect it to the speaker it sounded the same.

D: I actually presented my soldered project to my professor already and he actually was shocked that it sounded pretty clear. He said he's never had a student that turned in something that didn't crackle or popped. It felt great!! Especially since it's not even that great X_x BUT I do still plan on working on it a bit more :D. I want to make it mobile and perhaps run on 2 9-Volt batteries ( 1 battery for + and - power).

Here's some pictures here of the soldered work. The box just adds to its grundgyness hehe.

I'll see what I can do with the filter as I'm not really sure how to go about that X_x. Slow it down? I recall trying out different caps for the filter and they all sounded relatively the same so I'm guessing I have to figure out a better inductor+cap combo ): . I was trying too hard not to buy a new inductor for convenience :/
 
Breadboard

Hi darkamikaze
Good to see you are up and going. Just a small trick, when starting up a new design, I always start on a bread board (see picture). It can actually work ok for first test and to make sure the design is ok (don't use high voltages and high currents on the bread board though). This makes it extremely easy to change component values and get the first shot right.
Then I go directly to prototyp on two layer pcb .... it's just so cheap to get manufacturednow, that nothing else makes much sense .... though there is some waiting time though :)
I have now sifted to ITEADStudio for pcb manufactory, and are waiting on my first batches. (before i used Olimex).
Keep the good work up.
Baldin :)
 

Attachments

  • IMG_3573 (Large).JPG
    IMG_3573 (Large).JPG
    138.5 KB · Views: 402
Finally you made a fashionate retro style casing. :cool:

I'll see what I can do with the filter as I'm not really sure how to go about that X_x. Slow it down?
The filter is not needed for the sound, but to keep the amount of HF at the output low.
To achieve this your LC resonance should be at least 3 times less than the switching frequency. For reasonable audio full range reproduction the LC resonance should be at least 25kHz or higher.
Most likely your switching frequency is to low to allow a properly filtered full range design.
1. Have a look to your switching frequency, what do you find?
2. Calculate the resonance of your filter..., what do you think?
3. Calculate or simulate the transfer function of your filter ...what do think?
Stepping through the points 1..2 and 3 you can easily learn from the search function in this forum and/or google.
It's OK to be a little bit lazzy and ask a lot, but not digging for this on your own is to lazzy :p

Nevertheless my congratulation that you impressed your prof.
 
Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.