Welcome to Solid State Guitar Amp Forum | DIY Guitar Amplifiers. Please login or sign up.

August 10, 2022, 07:26:31 PM

Login with username, password and session length

Recent Posts

 

Adafruit PAM8302 Amplifer

Started by Carriage, July 12, 2022, 04:22:47 AM

Previous topic - Next topic

Carriage

I've built a couple of pedals in recent times, an 8" speaker cab plus a ruby amp and have been thinking about building a more complex amp but not too keen on doing mains powered at this stage. From a comment by joecool85 in a honey amp thread I found out about the PAM8302 board by adafruit and have been playing around in LTSpice to build a preamp for it.



Basically it's tubescreamer type clipping but with filter rolloff at around 10Hz and 10kHz. R28 is a gain pot (500k) This is followed by a runoffgroove tonemender tonestack, which I think is a modded Fender/Marshall/Vox. Pots are R7/R8, R9 and R10. Then some clipping diodes to soft limit if there's a big signal coming in and then a 5x boost in case of small/clean signals. R14 is master volume.

I have no idea if it's going to sound good but I'm currently working up a parts order to build a prototype. My current thinking is maybe to breadboard it but maybe build the various modules/stages on stripboard with some sockets for components and screw terminals so I can swap modules out.

Loudthud

The diodes D9 and D10 really don't clip the signal, they just add what looks like crossover distortion. The Tube Screamer really doesn't make a good preamp.

Carriage

I've heard it described as soft clipping but yeah it's not really clipping per se. It does give what ends up looking like crossover with large input signals iirc but relatively smooth for lower inputs.

What makes you say the TS doesn't make a good preamp? Do you have alternative suggestions?

Interestingly the input sensitivity for an 8ohm load is only about 300mV if you want it to stay clean (if I calculated correctly). Apparently that's within the realm of hot humbuckers so it's sort of more putting a pedal in front of it rather than needing a real preamp.


Attached is the output of that stage with varying gain with a 100mV input signal
You cannot view this attachment.

Loudthud

The Tube Screamer doesn't make a good preamp because you almost can't turn the gain down far enough to get a clean signal. When you do, the gain is less than one and you have no headroom. Most of the time you are feeding a distorted signal through a tone stack. What's that supposed to sound like ?

The first thing you need to do is get away from the 9V power supply. Can you find any kind of wall wort AC transformer in your country ? Something like 16 or 24 VAC ?

Variable gain solves a lot of problems in the first stage. Look at the Marshall Lead 12.

Carriage

Thanks for the info.

I was under the impression that preamp distortion was typically before the tonestack. Is that incorrect? No headroom/not much room on gain knob before it gets dirty does make sense. Given parts are cheap I might give it a go anyway so I can learn what it sounds like.

I can find a 24VAC 1A supply locally. However, I was looking at 9V for a couple of reasons. First, the power amp is 5V supply, 1.3W (1%THD) at 8ohm and with a input sensitivity of about 300mV so I thought that this is quite a limitation on the headroom anyway. Second, its kind of fun to get something running off the same power supply as the pedals. Third, not that I cant afford to buy a wallwart it's another cost. It was something I was thinking about if I build another amp.

With the Marshall lead 12 I've found two different schematics. One that seems to use op amp distortion and the other clipping LEDs. Is there one you meant in particular or are they both of interest?

Carriage

I may have been mistaken about one of the schematics I found, so I've sorted that out

Tassieviking

I have seen at least 3 different Marshall 12 watt amp schematics, one has what looks like clipping diodes.
And then there are the 12 watt Reverb models as well to consider.
There are no stupid questions.
There are only stupid mistakes.

phatt

#7
Quote from: Loudthud on July 12, 2022, 04:46:59 AMThe diodes D9 and D10 really don't clip the signal, they just add what looks like crossover distortion. The Tube Screamer really doesn't make a good preamp.
Hi Loudthudman,
Just to clarify, D9&D10 are surely a Limiter?  ??? 
I can't see how they could work to impart any kind of Xover dist
on the signal. They would need to be back to back in series
with the signal to cause Xover. Maybe that is what was meant?

@ Carriage,
As for smart design the tube Screamer is actually good design practice. It has a Buffer stage in front of the first opamp.Early ones were just a BJT follower but later ones used an opamp stage.
They knew quite well that *NOISE is the enemy of high gain circuits* and that is why they used it.

I'll use your Schematic as reference, If R1 is 1Meg and R28 is 500k then you will pay a noise penalty, at high volume it can become unusable.

Any opamp with HiZ input and high gain (such as yours) will be noise prone.
The TS input buffer takes care of the HiZ input and then the gain stage sees a much lower input sensitivity.
The Equivalent R1 in a TS circuit is usually 10k. Not as much Gain but far less noise and a far more usable range of Distortion.

If you care to note, look at many of the so called bootweak guru designs of similar circuitry and they remove the buffer simply to get more gain, dirt or grit. Yes of course it's MORE BUT the noise floor will make that extra dirt unuseable,,
meantime the xperts tell you you need a noise gate.

In reality it's just a poor understanding of the art of smart design. Yes in some circumstances N-gates might help but logic suggests, tiss far better to design out problems rather than bandaid the flaws.
Most of the pro circuit use a hiZ buffer front end if you look around.

As to distortion before tone, that can go either way. With these guitar audio paths it can often come down to personal taste. experiment and find what works for you.

Note;
If your power amp is only 1 Watt then you will have little clean head room for any decent clean sound. Which is likely what Loudthud was eluding to.
Plus; I urge anyone wishing to build stuff, go get a Bread board and test it all first. You will learn a heck of a lot more than just poking resistors into a pcb. That's a 90% chance you will be building land fill.
Keep going,, be warned this stuff is very addictive. ;)
HIH,, Phil.


joecool85

#8
I'm glad someone else is enjoying playing with the PAM8302a boards from Adafruit - they're cheap, decent quality, and provide 1.25w on 8ohm speaker or 2w on 4ohm speaker, which is pretty great.  And real easy on batteries because it's class d.

At one point I had thought about making a class d version of the Honey Amp using this board or similar.  This idea has been put to the back burner indefinitely, but I do have plans for a larger class d amp in the works.

Also, I'm not a fan of a Tube Screamer as preamp but if it sounds good to you, there isn't any technical reason not to do it.  As a good starting point, I recommend something more like the Marshall Gov'nor: https://www.electrosmash.com/marshall-guvnor-analysis
Life is what you make it.
Still rockin' the Dean Markley K-20X
thatraymond.com

Loudthud

Quote from: phatt on July 14, 2022, 07:51:00 AMHi Loudthudman,
Just to clarify, D9&D10 are surely a Limiter?  ??? 
I can't see how they could work to impart any kind of Xover dist
on the signal. They would need to be back to back in series
with the signal to cause Xover. Maybe that is what was meant?

You know how the equation for gain of non-inverting opamp is 1+(Rf/Ri). Well that "1+" means the input signal is added to whatever distortion the diodes create. If you look at the output simulation @Carriage posted in reply #2, you see the top of the wave is just the input signal added to a more of less square wave, so it looks like soft clipping. If the input signal gets bigger, the top and bottom of the output just get bigger. This is not the kind of "dead zone" crossover distortion you are used to seeing, it's kind of the opposite where the area near zero crossing is expanded. Run a Clean Boost pedal into a TS and it just sounds louder and cleaner than it did without the boost, but with a gravely undertone. Not what I want my guitar to sound like.


tonyharker

Just to clarify the PAM8302 are not made by Adafruit.  They are made in China and available from ALI Express for cents not dollars if you are willing to wait weeks for delivery.

Carriage

#11
Quote from: joecool85 on July 14, 2022, 12:03:52 PMAlso, I'm not a fan of a Tube Screamer as preamp but if it sounds good to you, there isn't any technical reason not to do it.  As a good starting point, I recommend something more like the Marshall Gov'nor: https://www.electrosmash.com/marshall-guvnor-analysis

The choice of that architecture is semi arbitrary in that lots of people like it as a pedal. I'm actually not a huge fan but that's more because I don't like the frequency shaping they do, but that's a filtering question not the clipping itself as far as I can tell. Guv'nor looks interesting I might try that out too. Really I need to have a play with things on a breadboard to see what I like the sound of. I was just starting with it more as an exercise in amp design at no cost in simulation

Quote from: Loudthud on July 14, 2022, 02:56:00 PMIf you look at the output simulation @Carriage posted in reply #2, you see the top of the wave is just the input signal added to a more of less square wave, so it looks like soft clipping.
Another way to think about this is that when the diodes are conducting the voltage drop across them will be roughly the forward voltage. Given they tie the other op amp input terminal (which should equal the input) and the output, the output will be input + V_f. High gain will make the part of the wave they're not conducting steep.
 
Quote from: tonyharker on July 14, 2022, 03:06:42 PMJust to clarify the PAM8302 are not made by Adafruit.  They are made in China and available from ALI Express for cents not dollars if you are willing to wait weeks for delivery.
Yeah, I actually ordered a clone off ebay which will take a little while to get here. In the meantime I'll probably use the flat channel on my yamaha THR if my other parts arrive first.

phatt

Quote from: Loudthud on July 14, 2022, 02:56:00 PM
Quote from: phatt on July 14, 2022, 07:51:00 AMHi Loudthudman,
Just to clarify, D9&D10 are surely a Limiter?  ??? 
I can't see how they could work to impart any kind of Xover dist
on the signal. They would need to be back to back in series
with the signal to cause Xover. Maybe that is what was meant?

You know how the equation for gain of non-inverting opamp is 1+(Rf/Ri). Well that "1+" means the input signal is added to whatever distortion the diodes create. If you look at the output simulation @Carriage posted in reply #2, you see the top of the wave is just the input signal added to a more of less square wave, so it looks like soft clipping. If the input signal gets bigger, the top and bottom of the output just get bigger. This is not the kind of "dead zone" crossover distortion you are used to seeing, it's kind of the opposite where the area near zero crossing is expanded. Run a Clean Boost pedal into a TS and it just sounds louder and cleaner than it did without the boost, but with a gravely undertone. Not what I want my guitar to sound like.

Thanks for the explanation,, sadly I'm still miffed. :-\
I appreciate these things can be hard to explain in a few words but I'm having trouble working out what you mean by "expansion near the zero crossing", because all traces still cross zero at the same time point. I hope that makes sense.
Although I'm not trained I've spent years learning how audio stuff works and never come across this one, no doubt there are still holes in my understanding. ???
Is there any literature you can point me to that covers this in depth?
I've read many books on electronics one being The Art of Electronics as well as building and repairing heaps of gear in the last 30+ years.
Cheers, Phil.

Loudthud

Do you have an oscilloscope and some kind of signal generator ? Do you have a smartphone ? Build the first stage of a Tube Screamer and run a signal into it. Turn the pot all the way down. The gain will be one. Turn the pot up slowly and watch the output on the scope. When it starts to look like the simulation above, turn up the generator amplitude.

Don't have a scope ? Get one.

phatt

Yes I have often wished I had more bench gear but at older age and
eyes failing It becomes harder to work on fine detail.
I'm happy to have been able learn enough to build a whole rig that I'm
very happy with and I'd rather sing and play music nowadays than to try
and reinvent the fuzz box. 8)

FWIW,
My understanding about this quirk is, it's just diode hash (often mentioned in pedal forums) as Grit,Fizz,Hash and like terms.
I think you will find that what you are hearing is diode switching.
Using this circuit as example (See Screen shot) you will find at levels below ~200mV you get a smooth flattening of the signal But once you increase the input signal those diodes obviously struggle. Hence the peaks display a jagged edge.
This is high freq hash from the diodes switching state.
And Yes as you have noticed when you increase the input it sounds like Gravel.
the bigger the input the worse it gets.
If the bandwidth is not limited at higher frequencies it can sound gawd damned awful, no longer musical. :-X

I get around this by using 3 OD pedals but Never turn the gain/dist knob too high on any of them.
This issue is not limited to TS circuits it seems to happen to most  Dirt circuits that use diodes in this manner.
Phil. You cannot view this attachment.