Installing and using LTspice IV (now including LTXVII), From beginner to advanced

Well, that was quick off the mark, Karl! However, what may make it more useful for those want to understand how real supplies do actually work, is to add parasitics for the smoothing cap, and a transformer with real behaviours, rather than an ideal voltage source ... I appreciate that this is "advanced" modelling :eek:, but at least it points new users to understanding that making assumptions can lead one astray - unless the modelling is reasonably close to reality then any conclusions drawn from the simulations can be very misleading ...
 
Administrator
Joined 2007
Paid Member
Hi Frank,

That is advanced modelling indeed and I'll be honest, its an area I haven't looked at (or even seen on any such simulations around here :)) As I mentioned at the start... I'm very much learning too :D

Its easy to add a little series impedance to the supply to replicate sagging under load but modelling a transformer and then driving it such that it behaves as a real one :eek:

Stick with where its going... we're not done yet.

(To model a transformer and its driving voltage source accurately I imagine would be a monumental task... leakage inductance, inter winding capacitance, the combined interactions, saturation behaviour... so that the output reflects accurately for example mains hash and noise. And then model a driving voltage source with all that noise and hash and spikes present. Is that do-able ? Any examples ?)
 
Very much so. The busy people at the LTspice user group have done many examples of transformers behaving as closely to the real thing as one would typically want, and then the mains voltage on the primary side can be made as dirty as one likes by adding voltage sources in series with the nominal sine wave, representing the harmonics, etc.

In this thread, http://www.diyaudio.com/forums/power-supplies/216409-power-supply-resevoir-size.html, all these considerations were discussed in excrutiating detail, and gootee in particular contributed great reems of useful data, and a spreadsheet ...
 
Administrator
Joined 2007
Paid Member
Thanks Frank. That's a long thread and I do appreciate there are some extremely experienced users out there.

I'm going to stick with my original plan for this thread and keep building on working examples because that is (from the questions I have been asked) where the beginners are struggling. The more you learn, and the more you find your own ways of doing stuff, and the stuff you are talking about is right at the top level of modelling.
 
Administrator
Joined 2007
Paid Member
Adding and simulating a voltage doubler and regulator.

We can begin to eleborate on the simple PSU. Here is the design brief. We are making a simple amplifier but would like to run the VAS stages and front end from a stabilised and smoothed rail. The main rail is around 28 volts DC (off load) and our target for the auxiliary rail is +40 volts DC. How do we do it ? and can we simulate it ?

Taking our simple PSU above as a base we can now add to it. I've moved the load resistor to the bottom to clear screen space and tidy things up. The regulator is going to be a classic text book two transistor design.

For those that want to try and create this, here is the circuit diagram. For those that want to skip that and just simulate it, the file is attached to this post.



Notice there are four "net" labels attached to relevant points in the diagram. These will be used to make looking at the 'scope traces more understandable. The 1N750 zener is in LT's library. To place a zener on the diagram open the "component" library as we have done before and look for "zener". Right click the finally placed device and select 1N750 from the list. The blue text saying "4.7 Volts Zener" is a user added note. You can add any text by using the .Aa option. The other options and drop downs in the Window are self explanatory.



Make sure your simulation time is set to say 2 seconds and run the simulation. Probe in sequence the four points of interest. You should see this.



The traces show the ripple on the various points and the reasonably clean +40 volts (this isn't as much an exercise in best circuit design as showing how to build a circuit up and simulate it). As before, this is a dynamic simulation and all the voltages and currents must be probed rather than seeing them as steady state values (remember... the .op or DCop pnt command is no good for dynamic simulations like this). You can zoom in on any part of the traces... so look at just the ripple of the regulated output.

It looks like this.



There is much you can do to test the effect of component changes. Try increasing and decreasing the caps. Try other transistors. A low gain 2N3055 for example. Notice how the 2N5550 that we are using doesn't melt or fail :D under excess current. I remember the first time I saw a slightly over biased output stage dissipating around 7kW per device and yet it worked beautifully in simulation. So simulation is just the start... you still need to apply the basics on device selection and so on.

Next, and we will attempt to test the regulator dynamically by attaching a varying load.
 

Attachments

  • Doubler.PNG
    Doubler.PNG
    53.9 KB · Views: 775
  • Text.PNG
    Text.PNG
    55.6 KB · Views: 199
  • Doubler Reg.PNG
    Doubler Reg.PNG
    47.2 KB · Views: 199
  • Doubler Ripple.PNG
    Doubler Ripple.PNG
    36.7 KB · Views: 207
  • Voltage doubler Simulation.asc
    3.7 KB · Views: 158
Administrator
Joined 2007
Paid Member
Hi Andrew,
I think you are seeing more of a limitation of the way LT (and the PC ?) handles the graphics. Pictures 3 and 4 are from the same run. Picture 4 just zooms in on a specific part of the trace to highlight the ripple more accurately.

If you run the attached file in that post and probe the four marked output tags in sequence and then zoom into the regulated output you will see the same. Nothing changes, only the effect of the way LT handles zooming in.
 
Looks like you are confirming that the remaining ripple is just as good as this version of the regulator can achieve with this level of ripple on the input.
Not a glitch due to drop out.

I think this does show that voltage doubling and even more so with tripling and quadrupling, creates a very ripply supply. Here with rCRC on the input, ripple still comes through on the output.

Use the sim to model and compare non doubled to doubled and tripled and quadrupled rectifiers.
 
Last edited:
Administrator
Joined 2007
Paid Member
Testing under load and dynamically.

Testing under load. Here is a quick and easy way. We can use a FET to switch the load across the supply to check how well the regulator functions. We can also modulate that switching function to test the dynamics of the regulator.

You will need to zoom out the circuit slightly to make room for the extra part... yes we only need one. Go to the component library and add an NMOS transistor. Now connect a second voltage source between gate and source as shown. Use the scissors and the "hand" to cut the load resistor and re attach it as shown.



Right click the transistor and select a suitable device. I'm using the IRF2807Z as a typical low Rds device. Now make the voltage source you just added into a pulse. Lets set it for a 2 second period. Now alter the <edit simulation> to give a longer run time of 10 seconds so that we can see more of what is going on.



We can see that the regulator isn't brilliant... and that is one for you to work on and improve :)

Now change the voltage source to a 1ms pulse (Ton = 0.5ms and TPeriod = 1ms) Change the stop time to just 200ms now, otherwise you will be waiting all day for it. For the amplitude... well as its a FET we are controlling a 0 to 10 volts setting shouldbe ideal. Run the sim again.



Now zoom in on the last few millisconds and look at the detail. You can see the hf ripple (our FET modulating the output) combined with the ripple we had before.

The file up to this point is attached.
 

Attachments

  • Voltage doubler Simulation Dynamic.asc
    4.1 KB · Views: 161
  • Dynamic Zoom.PNG
    Dynamic Zoom.PNG
    37.7 KB · Views: 235
  • Dynamic Regulation.PNG
    Dynamic Regulation.PNG
    31.1 KB · Views: 198
  • Regulation.PNG
    Regulation.PNG
    24.6 KB · Views: 884
  • NMOS.PNG
    NMOS.PNG
    13 KB · Views: 880
Administrator
Joined 2007
Paid Member
Looks like you are confirming that the remaining ripple is just as good as this version of the regulator can achieve with this level of ripple on the input.
Not a glitch due to drop out.

I think this does show that voltage doubling and even more so with tripling and quadrupling, creates a very ripply supply. Here with rCRC on the input, ripple still comes through on the output.

Use the sim to model and compare non doubled to doubled and tripled and quadrupled rectifiers.

By changing just the caps and series CRC resistor we can improve things a little.

Circuit.


Ripple.



Detail of Ripple. Note the output still climbing toward its final value (the effect of the 470uf and 4k7 time constant)

 

Attachments

  • Ripple2.PNG
    Ripple2.PNG
    48.2 KB · Views: 193
  • Ripple 3.PNG
    Ripple 3.PNG
    50.1 KB · Views: 196
  • Ripple4.PNG
    Ripple4.PNG
    28.8 KB · Views: 207
Mooly,
Thanks for putting this together!

LTspice was dormant on my system for many months because I couldn't get it to do what I wanted. In my opinion good software should be self explanatory but that is unfortunately not the case here.

This weekend, I decided to take some time and follow your instructions, and voila, I obtained the results I was looking for!
:)
 
Administrator
Joined 2007
Paid Member
Excellent, I'm pleased you are finding it helpful and of use. When I first attempted to use LT and started asking questions I found that a lot of knowledge was assumed... which I didn't have.

You will find that the more you learn, the "easier" it becomes and you will start figuring out the twists and turns your self.
 
Administrator
Joined 2004
Paid Member
Actually it is a marketing tool for use by Linear Tech's customers and prospective customers. It's free and not hobbled like most of the versions offered by competitors, and with experience can produce excellent results - this is its great strength.

It has an extensive library of LT parts (not spice models) as well as the ability to add an extensive custom spice parts library. I use it to simulate tube circuitry as well as other things.