Mains regeneration - a DIY primer


A short digression on mains regeneration, as exemplified by the PS Audio Powerstation and Accuphase units. After the quick investigation shown on the mains-borne noise page I was sufficiently intrigued by the possibilities to try building such a unit on a small scale. For something that is conceptually quite simple, obtaining good performance is a lot less straightforward than you might expect. Let's start with the basic approach: since the mains carries a lot of noise, how about synthesising a better waveform, and using it to drive an amplifier producing a mains voltage output to power our audio devices. That gives three sectons to resolve in detail:

  • Generating the waveform,: an oscillator.
  • Amplifying it accurately to the desired output.
  • Driving real-world mains appliances, via a transformer.


    The oscillator section is comparatively simple: either use a PIC lookup table and DAC to synthesise a waveform and low-pass filter the output (easy, if you know what you are doing...and have the expertise/parts/programming ability) or pick the analogue route. A good Wien bridge design will give you distortion down around the 0.001-0.002% mark with a little care - it's actually quite easy to better the performance of the PIC /DAC approach. Wien oscillators drift slightly in frequency, but that's no problem, we only want low noise and harmonic output. More seriously the oscillator drifts in amplitude - and this our reference will be further amplified by maybe 10-20x by the output. This is a much bigger problem, since constant voltage (and no 'flicker') is a design requirement; it is no good having 240v output, -/+30v depending on temperature and the weather outside. Of course here is where the PIC/ DAC approach wins, but you *really* need to know what you are doing to better the distortion performance of even a simple Wien Bridge oscillator. The alternative is to spend a lot of time investigating temperature and component ppm stability - and fixing it. A third approach would be to use a quartz oscillator subdivided down to your chosen frequency, then brutally low-pass filtered to remove the harmonics (turn the square-wave output into a nice sine). Nice fixed amplitude, and constant frequency (though this is much less important) but unlikely to get the distortion down anywhere near the other two approaches.

    However the major problems arise with everything after the 'signal' stage:

    The power amplifier.This beast is going to run 24/7 with some expensive electronics depending on the output. IC chip amps are well worth a try for experimental purposes due to their low cost and in-built protection schemes. Whatever your solution, make sure the power supply, heatsinking and parts choice are up to it, and that the unit will shut down gracefully in any fault condition. You'll waste a lot of heat - and therefore money - here. The power amp needs very good distortion performance, low output impedance maintained to high frequency (say 50Khz) since output Z directly affects noise and distortion performance (of which, more below). The power-amp stage must also be unconditionally stable, immune to noise injection at the output, and designed to run at maximum output even into an inductive load (if your load is ever becomes disconnected, or you turn it off).

    The transformer linking the power amp output to the load is most critical, and dominates performance. Unless you are a genius, rich, or a combination of both, the amplifier will be feeding the output via a step-up transformer. A *good* one, or hysteresis and limited HF performance will destroy your low-distortion perfomance. This transformer must have good regulation i.e. low impedance - you need a big, good quality piece of iron much larger capacity in fact than the load it is to carry. The 'rich genius' solution would be to drive the output direct using high voltage poweramps - valves maybe, though that would be a sight to behold. Even the PS Powerplants for Euro voltages are only the US version with a step-up transformer... The unseen problem is that the step-up ratio directly increases the output impedance of the unit. For example, if your power amp stage has an output impedance of 0.1ohm at 50Hz and swings 24v RMS then the best output it can manage theoretically, supplying another piece of equipment, is 1ohm output impedance at 50Hz, because you need 10: 1 voltage step-up. If your output transformer is less-than grossly oversized, its own regulation problems will magnify this effect owing to hysteresis, winding resistance, imperfect coupling etc.

    This last issue is worth exploring further. There is a direct link between the transformer's HF performance and low-distortion output since the transformer works both ways. Noise generated by the load device will appear directly across the transformer output. An exceptionally wide bandwith device can transfer the noise to the power amplifer output; and since the poweramp has good high frequency response and a low output impednace, the noise is effectively removed. A transformer without very good HF performance will exhibit very poor coupling: instead of the low output impedance of the amplifier killing the noise (since noise current through low impedance = low noise voltage) the noise is reflected from the high HF impedance of the transformer back into the load. The net result is that the power supply to the component contains a lot more rubbish than if you had simply plugged it into the mains! Unless you can build an amplfier with 240VAC output swing (good luck and steady hands with that one...) the output transformer is unavoidable. It would be worth investigating valve-amplifier ouput transformers since these are specifically designed for extended LF and HF performance. You could add feedback at LF around the transformer, but this can't really extend beyond very low frequency, since the phase shifts would make loop stability a very tricky issue.

    The brief experiment: I had a lot of fun building such a device to power a source component (CD player) which required at least 15W at 240VAC, 50Hz. The plan was to lash-up a basic oscillator + power amp + trafo together and test it to identify major problems before investing a lot of money in parts. A relatively-refined Wien bridge oscillator (an opamp implementation of the original Hewlett circuit) was built for which distortion trimmed to c.0.0005% or less - essentially, beyond my ability to reliably measure with a soundcard and test software. A heavyweight 'test' PSU powered a bridged LM1875-based power amp stage with very good heatsinking and a refined layout, driving a 50VA transformer step-up to get 240V out. It actually worked first time (!), and none of the magic smoke escaped so I tested with a desktop halogen light (transformer type, not electronic ballast). Under load this assemblage developed just 0.04%THD+N at the output while driving 20W into the load. Pretty good, I thought, given the IC poweramp: the 'extra' distortion was entirely due to hysteresis effects in the step-up transformer. I did try substituting a monster transformer, but the difference was not significant. Either way, since my local mains supply averages 4.5% THD the DIY approach represented better than 20dB improvement. I could vary the oscillator 40-280Hz, and got better efficiency at higher frequencies as well as slightly lower distortion. Better and Better.

    Then I connected a 'normal' load, one which contains a transformer and rectifier bridge. And my lovely waveform went to pieces, no matter what I did.

    The reason, as described above, is simple enough. The load over a single cycle is highly non-linear - no current is drawn until the mains voltage exceeds that needed to charge the loads' PSU caps, whereupon the mains source is presented with a very low impedance for a short period of time (1-3ms). In other words, rectifiers and the PSU caps are horrible, non-linear loads, and the output impedance of my regenerator was just too high to deal with it - the result being a noisier waveform, measured anywhere in the load side, than just plugging into the mains. Oh, and ability to generate a 'balanced' output makes no difference if the waveform is basically s**t! The difference under load was so marked that I would really like to measure what happens at the output of PS-Audio unit when running a load like an amplifier (given the UK version uses a step-up transformer). Efficiency was also poor, but that is unavoidable using such a regenerator: the whole unit drew 48W just to supply a net 17W to the CD player. Actually that's not bad - worked out at better than 60% from the Class AB amp , and itincludes the other stages of waveform generation and filtering.

    Conclusion: just plug into the wall, use a dedicated spur if possible, and be grateful. Oh, and no 'filtering' devices; the clues why are contained above - anthing that raises impedance is a Bad Thing.


    Finally it's worth noting a theoretical alternative to this whole regenerator approach, which is to 'buck' the line noise. Here, the line voltage would be heavily filtered to produce an arbitrarily-accurate waveform, and the amplifer stage is used to drive a current of the difference between the reference output and the mains supply, essentially killing line noise. Whilst efficiency would be high - since only the difference is being supplied or sunk, not the whole load current - the detailed development of such a device would be definitely non-trivial.

    At home, my mains power sockets have an output impedance, at 50Hz - of less than 0.1ohm, which is easily demonstrated with a 3KW kettle and a voltmeter. They also cost nothing to run when I don't use them. I gave up on the DIY regenerator as a serious alternative....


  • For more information try searching the DIYAudio forum, where this subject has been discussed several times, with informed observations from people who have tried different approaches.
  • Any comments.?


    © the twisted pair 2002

  • 29.04.04 page added.