You are here

D.I.Y. amp

Customising, building or repairing your own gear? Need help with acoustic treatment or soundproofing? Ask away…

D.I.Y. amp

Postby Folderol » Tue Aug 06, 2013 9:25 pm

After something like a 5 year delay I've got working on building my (discrete component) amplifier again. With two channels now complete (and apparently stable over 0-50W) I find I've enough bits left over and enough heatsink real estate for a sub driver too. Now I don't actually have a Sub box, but you never know...

The filter design I'm going for is a 2nd order state-variable one which seems to tick all the boxes for something middle-of-the-road and only needs a total of 4 switchable elements to cover a range of crossover frequencies. I'm thinking of covering the range 70-150Hz with an 'off' position for normal stereo without the sub.

Anyone got any thoughts on this.

P.S.
Why self-build a discrete amp? Because it's fun :D
User avatar
Folderol
Jedi Poster
Posts: 11372
Joined: Sat Nov 15, 2008 1:00 am
Location: The Mudway Towns, UK
Yes. I am that Linux nut.
Onwards and... err... sideways!

Re: D.I.Y. amp

Postby vinyl_junkie » Wed Aug 07, 2013 8:34 pm

Interesting stuff, can't say I have any real input but I'd like to read more about your 2ch amp you made :-D
vinyl_junkie
Frequent Poster
Posts: 1593
Joined: Tue Jun 24, 2003 12:00 am
Location: Kent, UK

Re: D.I.Y. amp

Postby Folderol » Thu Aug 08, 2013 9:54 pm

A bit disappointed that nobody had any thoughts on the crossover frequency range :frown:

However, the design of the amp itself is a based on a combination of ideas gleaned from Practical Wireless and Wireless World from a long time ago. It flies in the face of accepted practice, is a power hog and quite uneconomic :tongue:

Not having done any serious audio hardware work for very many years my remaining test gear is rather primitive, except the sig. gen. which I built in the early 70s and after 40 years still works - and I'm insanely proud of it :D

However... The amp -1dB points are 16Hz and 30kHz. Hum and noise is -80dB. THD @ 1KHz half power into 8ohms is < 0.1%. No idea about crosstalk yet.

If anyone really is sufficiently interested I could probably put a schematic up somewhere.

The output and driver transistors are way over specified. This means that even at full power they are still running in a pretty linear part of their gain characteristic. It also means that nothing more than a simple fuse is needed for S/C protection.

The output transistors are current driven not voltage. This could limit the top end due to charge storage, but in practice doesn't seem to. The advantage is that while transistors are extremely sensitive to temperature when driven from a voltage source, they are far more forgiving when current driven. Indeed, the ones I used show only a 20% increase in collector current over the temperature range 30-60 deg C - this is measured at the middle of the tab with no heatsink so is likely to be pretty close to the actual junction temperature.

The complementary drivers for these are configured so that there is 20dB gain over the entire combination, and bias stabilisation is done at the level of the drivers, the bias transistor being identical to the NPN driver (all these parts are in close proximity on the heatsink).

This whole output module is running in class AB, with the quiescent current set higher than normal @ 100mA - this is done not only for distortion reasons but also so that the temperature doesn't change dramatically over the working power range.

The local feedback resistors dissipate about 7W in total, which means there is always some resistive load, which hopefully will help damp any highly reactive speaker - certainly a 1kHz square wave looks good with a quite inductive dummy speaker - slight rounding on the leading edge and no overshoot or ringing.

The drivers are fed from a single-ended circuit with an undecoupled emitter resistor on the pre-driver (for want of a better term) giving significant local feedback, this transistor has a total supply voltage of 40V but only has to deliver about 6V P:P swing. This in turn is fed from a pre-amp transistor which gets 100% DC feedback from the output and is partially decoupled to give an overall gain of 40dB.

Having a single-ended stage like this would suggest an increase in even harmonic distortion, but in practice a simple twin T notch filter showed mostly 3rd harmonic.

So much for the instrument readings. I haven't actually heard it yet, as there is still no input circuit that I can safely connect to a decent audio source.
User avatar
Folderol
Jedi Poster
Posts: 11372
Joined: Sat Nov 15, 2008 1:00 am
Location: The Mudway Towns, UK
Yes. I am that Linux nut.
Onwards and... err... sideways!

Re: D.I.Y. amp

Postby Hugh Robjohns » Fri Aug 09, 2013 10:32 am

Folderol wrote:A bit disappointed that nobody had any thoughts on the crossover frequency range :frown:


I don't see why, your stated intention is perfectly fine! ;) Most systems crossover somewhere between 85 and 110Hz, lower if the 'satellite speakers' are 'full range'.

H
User avatar
Hugh Robjohns
Moderator
Posts: 28362
Joined: Fri Jul 25, 2003 12:00 am
Location: Worcestershire, UK
Technical Editor, Sound On Sound

Re: D.I.Y. amp

Postby Folderol » Sun Aug 11, 2013 10:06 pm

Thanks for the confirmation anyway Hugh :)

Oh, and there's a typo in the above ramble :blush:

The quiescent current is 200mA not 100!

{mutter}{mutter} I'm sure someone keeps moving the keybiard while I'm typing!
User avatar
Folderol
Jedi Poster
Posts: 11372
Joined: Sat Nov 15, 2008 1:00 am
Location: The Mudway Towns, UK
Yes. I am that Linux nut.
Onwards and... err... sideways!

Re: D.I.Y. amp

Postby Folderol » Tue Aug 13, 2013 7:40 pm

I've actually heard the beast for the first time this evening, so thought I'd give you an update.

There is still no proper pre-amp, just an input buffer and volume control, not even basic tone controls.

First the bad news. There is a very faint buzz (rather than hum) slightly more from the LH channel, which is closest to the mains TX - rather points to radiated field. I'll have a go a screening but am not too optimistic. Hum and noise measures at -80dB, but that is relative to 50W, and I'm sitting just over a metre from my nearfields :roll:

I might also drop the gain by about 10dB and make it up on the first stage buffer. If the amp is stable like that (should be) it might also improve distortion figures slightly.

Now the good news. It sounds gorgeous! Up to now I've been working using a domestic HiFi plugged into my nearfields. Not a cheap one but a Nakamichi Receiver2. Nevertheless my amp sounds much cleaner. I haven't an A/B switch setup so can't do anything resembling blind comparisons, but playing a few reasonably good commercial tracks, detail and stereo positioning seem better - and I'm not one for audio superlatives.

A surprise was the total absence of switch on or off thump. The reason I was surprised is that the output relays come on immediately with the power and switch off in a quite leisurely manner as the supply fades. Eventually they will be controlled by an arduino acting as a speaker management system.

However, the next stage will be building the crossover filters and preamp, with simple bass and treble controls. I'll take a step on the dark side here and use OpAmps ;)

I don't know how long this will take as I can only work on this during quiet times in the workshop. I don't want things to get too quiet though otherwise I could be out of a job :shock:
User avatar
Folderol
Jedi Poster
Posts: 11372
Joined: Sat Nov 15, 2008 1:00 am
Location: The Mudway Towns, UK
Yes. I am that Linux nut.
Onwards and... err... sideways!

Re: D.I.Y. amp

Postby vinyl_junkie » Tue Aug 13, 2013 9:06 pm

Nice one, glad it sounds good!

Can't say I'm a big fan of output relays or eq's though, but then I am a very lucky person where the output relays in all my amps like to fail and go crackly.

What kind of input switching are you using? Solid state or a proper switch?

What kind of speaker loads can the amp handle? Some bastard speakers I've had in the past had a nominal impedance of 4 ohms and I read the load could drop to 2 ohms at low frequencies hence requiring quite a bit from the amp.

Also damping factor.. These are things that go over my head but I like to read about them hahah
vinyl_junkie
Frequent Poster
Posts: 1593
Joined: Tue Jun 24, 2003 12:00 am
Location: Kent, UK

Re: D.I.Y. amp

Postby Hugh Robjohns » Tue Aug 13, 2013 11:43 pm

Folderol wrote:I might also drop the gain by about 10dB and make it up on the first stage buffer. If the amp is stable like that (should be) it might also improve distortion figures slightly.


Good plan. I was surprised when you said overall gain was 40dB. Most commercial pro amps have a voltage gain somewhere between 25 and 30 dB in my experience.

H
User avatar
Hugh Robjohns
Moderator
Posts: 28362
Joined: Fri Jul 25, 2003 12:00 am
Location: Worcestershire, UK
Technical Editor, Sound On Sound

Re: D.I.Y. amp

Postby Folderol » Thu Aug 15, 2013 8:52 pm

Back again.
Some parts failed to turn up at work this afternoon, so I had to abandon the job and find something else to do :)

The relays I've used are these. They are reasonably cheap, have good current rating and with standard industrial spade terminals quick and easy to replace.

Switching is ordinary contacts. With something as simple as this what's the point of doing anything else?

The amp is designed for 8ohm speakers. The output stages can easily handle as low as 4ohms, but the power supply would sag a bit so I don't know exactly how much undistorted power you'd get out. Also the mains Tx is only rated at 200VA so would get unhappy if it was run with sustained high power bass.

Damping factor? Adequate :) I'd have a hard job actually measuring the output impedance.

I did drop the gain by 10dB. Hum is now only discernible with your lug 'ole right by the speakers. I have to cart the amp to work to make changes, then bring it home in order to get a quiet enough background to check the results!

I was expecting distortion to drop as well, but it didn't make much difference (which was rather a surprise). However,decoupling the emitter of that pre-driver, thus increasing the open-loop gain, dropped distortion by a further 6dB.
User avatar
Folderol
Jedi Poster
Posts: 11372
Joined: Sat Nov 15, 2008 1:00 am
Location: The Mudway Towns, UK
Yes. I am that Linux nut.
Onwards and... err... sideways!

Re: D.I.Y. amp

Postby Folderol » Thu Aug 22, 2013 7:28 pm

Warning
Amplifier Porn!

I wonder if it's possible to change the title :roll:

As promised here are some drawings and pictures.

The workshop scope is a digital one, which is not ideal for looking at audio traces. Also I can't find a way of stopping splurting all sorts of unwanted info over the traces when I save them so I resorted to camera shots. The images are quite large so to save forum space I've just listed the clickable html links

First the Chassis, as built so far. It's a bit untidy but then there is still a lot of work to do. Output relays are underneath the chassis as close as practical to the fuses.

http://www.musically.me.uk/images/Chassis.JPG

Next the all important distortion trace. 1kHz at half power. Note that the lower trace is actually fed from a 40dB gain stage in the notch filter, so the level is really 100th of that shown (makes it nice and easy for percentage calculations). Before I decoupled the second transistor this was mostly odd order harmonics, now (although less overall) it's more even order. There is also that residual hum showing.

http://www.musically.me.uk/images/1kHz_THD.JPG

Then there is a 1kHz square wave, at near, but not quite, full power. Nice clean trace - sorry I moved the camera :blush:

http://www.musically.me.uk/images/1kHZ_Square.JPG

Next we have a 6V P:P triangle wave. Were are looking for crossover distortion here. Wiggles around the mid-point - can't see any :)

http://www.musically.me.uk/images/1kHz_Triangle.JPG

Last trace, a 10kHz square wave just under half power. Nice gentle rounding, no overshoot. What is also interesting is that the trace looks exactly the same with an 8ohm resistive load and an 8ohm dummy speaker.

http://www.musically.me.uk/images/10kHz_Square.JPG

No doubt you'd love to know what high tech equipment I used, so here is my trusty signal generator. Built in the 1970s then modernised in the 1980s (I fitted an LED power indicator).

http://www.musically.me.uk/images/Sig_Gen.JPG

... and the precision, cutting edge notch filter :)

http://www.musically.me.uk/images/Notch_Filt.JPG

Some drawings you say?

One channel of the amp itself.

http://www.musically.me.uk/drawings/Amp.pdf

And the part developed PSU:

http://www.musically.me.uk/drawings/PSU.pdf

Quite a lot to still be going on with :roll:
User avatar
Folderol
Jedi Poster
Posts: 11372
Joined: Sat Nov 15, 2008 1:00 am
Location: The Mudway Towns, UK
Yes. I am that Linux nut.
Onwards and... err... sideways!

Amplifier Porn

Postby Hugh Robjohns » Fri Aug 23, 2013 10:18 am

Folderol wrote:I wonder if it's possible to change the title

You should be able to change the title in the Subject box at the top of the response page when you reply to a post -- your new post and all others related to it will take on the new thread title. And failing that, the mods can change it at any time for you.

H
User avatar
Hugh Robjohns
Moderator
Posts: 28362
Joined: Fri Jul 25, 2003 12:00 am
Location: Worcestershire, UK
Technical Editor, Sound On Sound

D.I.Y. amp - Speaker Management

Postby Folderol » Thu Sep 05, 2013 7:05 pm

I have been too busy at work to do anything on the audio side, but have been able to lash up an Arduino with a few switches, pots etc. to fake inputs. There is a 4 line 20 column LCD display attached, and I've been working on this at home during free moments.

The final assembly will be an Arduino on a carrier PCB containing additional logic, amplifiers and a DC-DC converter.

I use 3 of the analogue inputs to monitor the Left, Right and Sub channel outputs, and a further 2 for monitoring the DC supply rails. 8 digital outputs are used for the data lines to a 4 row, 20 column LCD display and a further 2 are control lines for this.

So, that's 15 inputs and outputs from a maximum possible 20, but I also wanted to have 4 digital inputs and 5 outputs, as well as being able to still use the serial port (which itself takes out another 2).

There were three solutions to this that came to mind.

Use an Arduino Mega - over 50 lines available on that, but massive overkill.
Use a second Arduino for the display - frees up 10 lines but adds complexity.
Matrix some of the lines - support chips needed.

I went for the last option as being cheap, fairly easy to implement, requiring only one programmed plug-in chip, enabling me to take the chip out and breadboard it if I wanted to, and above all... more interesting!

How to go about this?

In the first place the LCD data lines are only needed when the display is being changed. Realistically this can't be very fast as the display is quite slow to visibly respond. I actually update it every 10th of a second (100mS), so when the display is dormant I use just one more precious output to enable an 8 bit digital latch. This reads, then stores whatever is on the data lines at the time the enable is pulsed, so I now have three more outputs than I need - it's always nice to have spares. The chip costs about 50p, and requires no further components.

That leaves me with 2 spare lines, not including the serial ones, but I want 4 more inputs so had to use a different trick. There are shift register chips that can have 8 digital inputs read in at once, then sent out one at a time every time a 'clock' line is pulsed. This is what I used. The line that enables data transfer to the output latch is used to read in the inputs to the shift register at the same time. After this, one of the control lines of the dormant LCD is pulsed very quickly 8 times, and each time, the shift register output is read by another of our dwindling supply of lines. But I now have 4 more inputs than I needed, and still one unused line on the Arduino. Oh, and this chip also costs about 50p and needs no further support.

So much for the hardware, now the control functions I've set up.

The program in the Arduino is continually reading the Left, Right and Sub levels into analogue inputs. It manages a reading speed of just under 3kHz. By using op-amps to create artificial zero points I can read + & - peak levels pretty acurately, as well as long term averaged (just under 1S) DC levels. Every 100mS there is just a brief hiccup in order to read the supply rails into two more analogue inputs and do the processing and display stuff. Although the supplies are only about 32V, I've callibrated the inputs for 40V to give some wiggle room.

I now have a display of the actual supply voltages, and warning messages if they become too low or fail. There are peak level bargraphs of 15 (approx 3dB) steps for the outputs. Also a warning message if any of the outputs develop a DC bias above 0.5V and which way it is going. Finally, a clipping level warning message that takes into account the real rail voltage (not what it's supposed to be) and whether its the + or - one. The clipping waveform could quite possibly be asymetric.

I have software to read switch inputs for Sub, Phones and Mono, then provide the correct operations with appropriate messages. Also, delayed switching of output relays until all voltages are correct, and instant disconnection if any one goes seriously wrong. Finally there is another input monitoring the mains (via a safety isolator), with instant disconnection of outputs at switch-off.

As icing on the cake, I'm considering preventing speaker/phones connection if any channel is already being driven fairly hard by whatever is connected to the inputs at the time the amp is switched on. This is purely to protect my ears! The bargraphs will make it obvious which channels are being driven, along with a warning message. Once the level has been reduced the relays will click over and then the inputs can be driven as hard as wanted.


Some more pictures. Supply assumed to be +-40V. DC inputs were faked, but real audio used for the bargraphs.

All OK, but negative rail lowish

http://www.musically.me.uk/images/Display_OK.JPG

Negative rail low enough to be a problem (less than 25V) making the outputs clip. If it's less than 19V (the point where the amp's DC stability starts to deteriorate) it is shown as 'DEAD' and all relays are opened.

http://www.musically.me.uk/images/Display_Low.JPG

Switched to phones.

http://www.musically.me.uk/images/Display_Phones.JPG

Oh dear, we have a DC offset. This voltage is just on the threshold of making the RH channel shut down.

http://www.musically.me.uk/images/Display_DC.JPG

Running Phones in mono - there's that slightly low negative rail again :)

http://www.musically.me.uk/images/Display_Mono.JPG

Mains just disappeared or was switched off. Normally there is a 2 second delay at switch on with just the 'Speaker Manager' legend. In this state all relays are open.

http://www.musically.me.uk/images/Display_power.JPG

Hmmm. I don't seem to have a picture with the Sub channel active. That simply shows another bargraph below the right hand one. Labelled 'S'.
User avatar
Folderol
Jedi Poster
Posts: 11372
Joined: Sat Nov 15, 2008 1:00 am
Location: The Mudway Towns, UK
Yes. I am that Linux nut.
Onwards and... err... sideways!

Re: D.I.Y. amp

Postby zenguitar » Thu Sep 05, 2013 8:11 pm

This might help save some Arduino pins...

A piggy back I2C board for the display. Like this or a display with the board fitted like this.

And maybe look at an I2C port expander if you are still a few pins short.

Andy :beamup:
User avatar
zenguitar
Moderator
Posts: 10456
Joined: Thu Dec 05, 2002 1:00 am
Location: Devon
When you see a fork in the road, take it.
Yogi Berra

Re: D.I.Y. amp

Postby Folderol » Sat Sep 07, 2013 6:15 pm

Hi Andy,

Yes both of those would have given the I/O I wanted, but I really am a 'nuts-and-bolts' person so wouldn't have had anything like so much fun using pre-designed solutions. Besides, I rechecked the cost of the components I used - 79p total :)

Also, my first excursion into LCD display control was when the Arduino just come out and the default libraries weren't very reliable or flexible, so I developed my own - which I will fiercely defend as being the best ever :tongue:
User avatar
Folderol
Jedi Poster
Posts: 11372
Joined: Sat Nov 15, 2008 1:00 am
Location: The Mudway Towns, UK
Yes. I am that Linux nut.
Onwards and... err... sideways!

D.I.Y. amp - more developments

Postby Folderol » Fri Oct 11, 2013 7:56 pm

I've finally had time to do a bit more on this project. The control logic is now complete and quite thoroughly tested.

Here is the logic board itself sans Arduino.

http://www.musically.me.uk/images/Logic_Bare.JPG

I've deliberately photographed it at an angle so you can see how I've bent the pins to allow the oddball Arduino spacing to be matched to standard stripboard. The wiring is not as tidy as I would have liked, and although functionally the same as I described earlier, I had to make a couple of design changes. I've saved some board space by placing the serial input chip inside the Arduino footprint.


And here is the board with the Arduino in place, and the display and mains isolator connected.

http://www.musically.me.uk/images/Logic_Complete.JPG

I was able to capture this with an audio signal that was varying quite rapidly, and you can see the 'phantom' bar segment that results when this is close to the response time of the LCD.


This is the mains isolator/detector module I've used.

http://www.musically.me.uk/images/Logic_Isolator.JPG

It's a technique that I've used many times in enclosed environments. The optocoupler will turn on reliably when the incoming voltage reaches about 50V (either polarity), resulting in very short 'off' pulses when mains is there. The capacitor stops it responding to occasional random spikes. The 100k resistor is actually running at less than 1/2 watt, but I like to play safe when dropping substantial voltages. The 4 tiny holes you can just about see provide enough ventilation to keep it at a sensible temperature (a thermocouple probe reads 50 deg C after 3 hours) whilst protecting stray fingers etc. A simple external RC filter on the output ensures that there is solid indication, but a fast release at switch-off or if the mains dies for any reason.


Originally, I had intended to mount the board on the underside of the amplifier chassis, and screen the ribbon cable and display - mounted on the front panel. This was to keep all the digital noise away from the audio stuff. Unfortunately I made a 10mm error on the dimensions! The plan now is to make an aluminium tray that will sit above the 24V PSU. This has the benefit that I can take it right up to the front panel so it also screens the display, as well as a much shortened ribbon cable.


Finally, a fairly complete schematic of the logic.

http://www.musically.me.uk/drawings/Logic.pdf

An astute observer will notice I've wired in spare inputs and outputs. This means I can easily add other controls if I want to later, and just reprogram the Arduino. Also, I haven't shown the output relays or driver. I haven't yet made up my mind whether to to use individual transistors or an 8-wide driver chip.

A point to remember about the Arduino is that during the bootup period all I/O pins are high impedance so if being used as outputs they are undefined until everything is settled. For this, reason I fitted the resistor network to the data lines feeding the 74537 chip to ensure the outputs are definitely off during this time.


The amp itself has been running quite happily at home in its basic form for some time now without any problems. No RFI or clicks, pops etc when household stuff switches on and off. I'm hoping it won't be too long before I can make a final push on the preamp sections and then pretty up the front panel.
User avatar
Folderol
Jedi Poster
Posts: 11372
Joined: Sat Nov 15, 2008 1:00 am
Location: The Mudway Towns, UK
Yes. I am that Linux nut.
Onwards and... err... sideways!

Next