AC to DC Power Supply

return to diyAudio Wiki Main Page
back up

This is a simple framework to model the behavior of an AC to DC power supply, useful for looking at inrush current behavior, capacitor charging, and power supply droop under load. It can easily be extended with more sophisticated models, for example a thermistor in place of R1, a "real" relay model, models of specific diodes, ESR for the capacitors, etc.

The AC line source is modeled as a +/-170V sine wave (120Vrms) sourced by V1. Inrush current limitation is accomplished using a 4.7 ohm resistor that is
shorted by a relay after 2 sec. The relay is modeled using a voltage controlled switch, V2 provides the voltage and delay.

The transformer is simply 3 coupled inductors. Adjust the values for L1, L2, and L3 as described in the model to set the output voltage - currently +/- 80V. You will have to fudge the values a little bit from the ideal values due to the K factor which should be between 0.95 and 0.99. (Caveat: I do not have any measured data to suggest if the values for L1, R1, etc. are reasonable.)

Diodes in the bridge are the default model, pick your favorite. Reservoir capacitance is also the default model with no ESR or other details, this can be added if you wish.

A Class B amplifier load on the power supply outputs V+ and V- is modeled using V3, ideal diodes, and ideal current sources. V3 can be set to a sinewave of any desired frequency, set the delay to turn it on after the caps are fully charged. Assuming V3 will swing +/- 1V, set the gain of the current sources for the maximum desired output swing across Rload. In this case I wanted 80% of the rail voltage across 4 ohms, so each current source is set to 16.

Now here's the cool part, you can drive V3 with a .wav file to look at power supply droop while playing music full blast. Set V3 function to None, then ctrl-right click and on the Value line enter
wavefile = "<path to .wav file>"

for example: wavefile = "C:\Documents and Settings\user\Music\1812_Overture.wav"

The result of this is shown in the jpg "railDroopWithMusic", a zip folder of the LTspice file is also attached.

Unfortunately the .wav starts playing at T=0 of the simulation, I do not know any way to control this. It helps to have some blank time at the beginning of whatever file you choose to allow the power supply rails to come up.

This page has been seen 2,159 times.

Wiki