• The Vendor's Bazaar forum is for commercial offers and transactions. Only unmoderated members can post here.

    diyAudio provides this forum for the convenience of our members, but makes no warranty nor assumes any responsibility. We do not vet any members. Use of this facility is at your own risk. Customers can post any issues in those threads as long as it is done in a civil manner. All diyAudio rules about conduct apply and will be enforced.

TDA7294 BTL amp with trafo input

This thread is a follow-on to my thread last year on getting TDA1521 to play nicely in parallel with lower gain. In short, it wouldn't cooperate so I decided to switch the design over to TDA7294. Yesterday we got the first in-a-box prototype up and running. Here's a pic to whet your appetite :

TDA7294BTL_20240507095053.jpg


Probably the most unusual thing about this amp is its power supply, a hybrid of linear (a standard toroid) with a high powered buck regulator. The reason the power supply isn't an off-the-shelf switching brick is because I wanted to avoid common-mode noise which comes as standard with such a choice. I did much of the development work on the buck regulator last year but its still not quite optimized - you may note the buck regulator's output inductor isn't tied down to the PCB because its very much a work in progress. Some of the back story to the PSU is told in last year's thread. I've attached the amp board schematic, there's nothing much out of the ordinary there except perhaps for it being a single rail design and the provision for an external bank of supply rail caps. This prototype has about 85,000uF of rail capacitance per channel by virtue of its two out-board cap banks. Having a buck reg means the soft start is built in so with this amp there can't be such a thing as too much rail capacitance.... 😎

(More to come later)
 

Attachments

I've been working on the speaker protection board for this amp and having looked at one or two designs - a particular thank you Andrew at Hifisonix for your story of blowing up your B&Ws, that was rather memorable - I've decided to go with a microcontroller to do the heavy lifting rather than use the ubiquitous uPC1237 IC. The output switches will be solid state, rather than relays.

The choice of microcontroller has taken me quite some time as I've delved into the rabbit hole which is ADCs on MCUs. If you go over to Mouser and look at ADCs as separate chips you'll notice they're more expensive than buying an MCU with an ADC on it. I have been wondering what the economics of this must be. Turns out that economics apart, there is a good reason for a separate ADC in many cases because of their susceptibility to noise. The smaller pin-count packages for MCUs tend not to bring out vital pins - the ADC supply for one, the ADC Vref for another and this leads to noise from the CPU getting into the ADC via the power supply and/or the reference voltage. How I know this is from running some fairly simple test code on the ultra-low cost PY32F00A. As I figure it pays to have enough pins on the package to dedicate one or more to keeping the ADC relatively free of noise I've not gone with the cheapest option (which is the PY32F002A in TSSOP20 at 0.5rmb a pop) rather the STM32G030 in a 48pin LQFP (at somewhere around 1.5rmb). I'm still waiting for that board to come in from Taobao but have run some test code on its smaller sibling (32pin LQFP). I'm a bit wary of the soldering challenge on the 48pin package as I've not done anything that tiny before - I wonder if JLC have it available.

The ADC has lots of channels so it'll be possible to monitor more than just the four outputs to speakers for DC offset, the internal supply voltages can be kept under observation too so that turn-on and turn-off hopefully can be managed silently.
 
Timed out on editing the previous post .... Found which pins are connected on the board - PC13 is the LED and PA15 goes to the push button marked 'KEY'. All other pins are left floating, except PA11 and PA12 which go to the USB typeC. PA13 and PA14 are the debug pins.

Incidentally here's the Ali link to this board which I don't recommend buying as the price is so unreasonable : https://www.aliexpress.com/item/1005006773710389.html. On the other hand, the full-fat member of the family's board is the same price so somewhat better value (STM32G0B0) : https://www.aliexpress.com/item/1005007119419873.html. This top-of-the-range edition has a lot more RAM and two I2S ports so is one of the few Cortex M0+ MCUs which is suited to doing audio processing, especially if overclocked which is apparently quite possible.
 
  • Like
Reactions: uptownsquash
I figured I'd do some simulation of the offset sensing circuitry to get a feel for what the parameters should be. The issue is - we need to be able to distinguish between a DC offset at the speaker terminals and a normal (AC) audio signal. Clearly we don't want to disconnect the speakers during a high level music transient with a ton of bass content but we still need to react quickly (no more than a few hundred mS I suspect) to disconnect if there's really a high level of DC present. For helping to discriminate between the two conditions it would seem that a low-pass filter is called for. Examining other people's published designs I note that this is a common feature. But what kind of filter - is a high or low order for example the most suitable?

Turns out as we want a fast response, a low order (first order) RC lowpass is about the best. Good I thought, its also the simplest. I ran a sim playing a full-level 20Hz sinewave into my RC filter in LTSpice and tweaked the values so that the filter output didn't exceed 500mV. This number was chosen fairly arbitrarily - I figured that a 500mV DC signal wouldn't stand any chance of harming a speaker long-term. Its also very roughly the threshold used by the UPC1237 speaker protection IC. But then I wondered if my 20Hz sinewave was sufficiently a 'torture test' for the circuit and went in search of some bass-heavy music to use as stimulus to double check I was in the right ballpark. This turned out a bit harder than I imagined. Having Googled for bass heavy tracks I found the typical electronica didn't have much below around 40Hz. An ambience techno track did a bit better but still nothing much in the 20Hz region. So I turned to organ music - a 64ft pipe should do the trick shouldn't it? I set up LTSpice to play a .wav file into the RC filter and captured a YT organ recording featuring a 64ft pipe. On Audacity's FFT this showed content down to 7Hz so I was hopeful I'd found the ultimate torture track. However, this did not trigger the threshold in practice as I think its amplitude was too low. Eventually I figured that movie soundtracks were likely a rich seam to mine and recalled we used a THX recording to rattle subwoofers in a former job. This turns out to be quite a treat and so far the only real life track that has reached the threshold to trigger my DC-detect circuit. Here it is :


Audacity shows it starts part-way into a (roughly) 13Hz sine at close to full level. Has anyone found a more challenging recording? If so, do please share - for now I'm using this to set the threshold for my DC-detector.
 
Taking a break from the software for a while, I decided to have a look at the output switch arrangements. Its already a given that I'll use a photovoltaic isolator and some low resistance MOSFETs but how to choose those?

First up, here's a plot from the Toshiba photovoltaic isolator TLP3905 :

image_2024-06-16_120634079.png


Along the bottom is the current into the IR LED (input) and the Y-axis is the output voltage. The first point of note is - it needs a high impedance load to get plenty of volts out. Which is fine as the MOSFET gates are very high impedance. The higher the voltage we can get into the MOSFET gates the lower their on-resistance is going to be so we won't want to use too low a value of load resistor to get the lowest distortion in practice when driving speaker currents through the FETs.

The downside of using a high value resistor as load is it slows down the turn-off process. That resistor is the way the MOSFET gates are discharged once there's no current into the IR LED. I ran an LTSpice sim and found that with 1Mohm into some ~20mohm FETs I could expect the turn off to take around 2mS - the time constant of 2nF with 1Mohm. While the FET's turning off its dissipating power (it has both current flowing through it and voltage across it) so I went to the SoA graphs of some candidate FETs to see whether a 2mS turn-off could present some potential overheating issues. And it turns out that it can, depending on the current being switched. The best case fault current is with an 8ohm speaker, with this amp that'll likely lead to 5A in the worst case condition where one output terminal goes to the +ve rail and the other is at 0V. But if the speaker turns out to be 4ohms, that'll double to 10A. This can definitely be a problem for some of the 20mohm FETs I looked at as their SoAs are curtailed by what's called 'Spirito instability'. Going up an order of magnitude in die area to get much lower Rds(on) figures tends to increase the Cgs in proportion which slows down the switching and hence doesn't much help.

Fortunately there is a fairly simple and cheap solution - employ a helper transistor to speed up the discharge of the gate capacitance as is often used in MOSFET driver circuits designed for high speed applications like classD amps and buck regulators. Including a BC857C and a schottky diode reduced the turn-off time by two orders of magnitude so its doubtful if any MOSFET will be troubled by that. Now all that's left is to decide how low an on-resistance is going to be needed.

Incidentally - the STM32G030 module I'm using turns out to have a hidden gotcha - the pin rows are not spaced an integer multiple of 0.1" apart which is very annoying if you want to plug it into a breadboard or some perfboard. I got around it by using SMD style dual row pin sockets so I could solder them about 0.85" apart.
 
Last edited:
  • Like
Reactions: uptownsquash