• WARNING: Tube/Valve amplifiers use potentially LETHAL HIGH VOLTAGES.
    Building, troubleshooting and testing of these amplifiers should only be
    performed by someone who is thoroughly familiar with
    the safety precautions around high voltages.

Tube modeling/LTSpice questions

This is my first post here, so please be gentle. I've searched around the forums, and either the posts didn't exist or I am really terrible at coming up with the proper search terms(probably the latter).

First of all, my goal is to design and build a stereo single-ended tube amp from scratch. I'm a software architect and my electronics engineering extends, unused, back about 2 decades ago. The rust extends through the paint and most of the body, and is barely salvageable.

My training 20 years ago barely touched on tubes, mostly transistors. Finally, I'm trying to do my modeling on LTspice. I've seen mixed reactions to this on the forum, so hopefully someone can help me out.

e57hnz0.jpg


A couple problems I have to start, and hopefully someone can give me a kickstart.

1) The way that LTspice models transformers. I'm sure anyone knows that it links through the K directive and you must provide inductance for all the coils. I e-mailed Edcor(seems to be the cool guys to use) about their power and output transformer values and they replied that they don't even know - at least they were able to get me the turns ratios for their output transformers. I didn't get that far yet, I was trying to model a power transformer just based on turns ratios. The problem is that LTspice requires inductance to define the coils, so I had to make up some numbers based on unknown characteristics. You can see that in the schematic. I was not able to find some typical values to make this work out like I wanted. I have no idea what typical inductance values a power transformer may have, my training only involved turn ratios.

2) I wanted to use a tube rectifier in my model - specifically the 5AR4. I saw, attached to this forum, the .inc model for this rectifier, but I'm unable to find a schematic symbol that works with it. Has someone made this and I've missed it?

3) This may take a bit of an LTspice expert to look at, not that I am one at all, and it may dive into #1 and my gap of knowledge after 20 years of non-practice. In the schematic, I have L4 pumping out to nets H1 and H2, supposed to heat up the filament. This just isn't working. The plate voltage stays flat. The voltage and current oscillate at 60Hz. The analysis across the lines show ~6Vac and ~200mA, about 1.2W. It just isn't "heating up" in the model. If I provide a direct AC voltage source(inserted into the schematic instead of sourcing off of the transformer), it "heats up" after about 4.5 seconds and works normally after that. I am having a lot of trouble figuring out what the difference is to the software.

Anyway, I'm welcoming all sorts of feedback(solicited and unsolicited). I'm looking at this as a learning adventure and to refresh a passion I've had and long lost.

Thanks to anyone who replies.
 
Hi,

I use a spreadsheet developed by Robert McLean for modelling output transformers, should give you pointers for mains transformers as well. Thread is here:

SPICE Transformer Model Spreadsheet

Thread about mains transformers here. Just need to get the primary inductance high enough for 50/60 Hz operation:

Power transformer inductances

I don't usually bother modelling power supplies in spice, PSUD2 is easier and has options for tube rectifiers:

PSUD2


It's not often useful modelling tube heaters, most models available don't include them. If you post the .asc file I'm sure someone will put you on the right track.
 
2) I wanted to use a tube rectifier in my model - specifically the 5AR4. I saw, attached to this forum, the .inc model for this rectifier, but I'm unable to find a schematic symbol that works with it. Has someone made this and I've missed it?
You can download tube models include some tube diodes. This model required a tube symbol (TubeDiode.asy) see attached. If you use ideal diode then the symbol would be just a ordinary diode, with the model name, from Spice model pages. Read this LTspice: Simple Idealized Diode | Analog Devices
.model GZ34 D(Is=1e-2 RS=36 Cjo=30p vj=2 N=80 bv=1500 mfg=TFK type=vacuum )
.model 6X4 D(Is=1e-2 RS=121 Cjo=20p vj=2 N=256 bv=1250 mfg=RCA type=vacuum )
.model 5R4GY D(Is=1e-2 RS=150 Cjo=30p vj=2 N=305 bv=3100 mfg=RCA type=vacuum )
.model EZ81 D(Is=1e-2 RS=53 Cjo=5p vj=2 N=163 bv=330 mfg=Mazda type=vacuum )
.model 5U4G D(Is=1e-2 RS=168 Cjo=30p vj=2 N=249 bv=1550 mfg=TungSol type=vacuum )


There are more tube diode model here:

Vacuum Diode Models for Spice Simulations @ PAEng
Spice Models
 

Attachments

Last edited:
Why are you MODELING the B+ transformer?

The HEATER winding???

Math for making DC out of AC is trivial. It is in-exact because we don't have exact values for the transformer, but especially since the "wall voltage" is never what the winder used for figuring.

And for resistance-coupled amplifiers it is NOT critical.

DC voltage gets a little more critical on Power amplifiers where you want to end up near but not over some melt-down limit. (Cheat: find a Fender/Marshall/Dynaco tubeamp with the same tubes and OT loading, buy the replacement transformer.)

The C-L-C filter output ripple can be roughed-out on a napkin, and that was the usual way it was done (after studying/plagiarizing similar plans). There is now PSUD software.

Breadboard (an actual hunk of plywood) is a great time-saver.
 
I'll agree with PRR here. It's not a good use of your time and effort to model the power supply in LTspice. It's much better to model it in PSUD2, which is devoted to just that. It's easy and so far has been surprisingly accurate for me.

For PSUD2, there is a passage in Morgan Jones "Valve Amplifiers" devoted to designing a power supply in that app. If I have the power transformer in hand, I measure the DC resistances of the primary and secondary, enter that into PSUD2, and if I've given it the correct information to work with, it spits out a model that predicts reality pretty well.

The audio circuits are best done in LTspice, but again, it's very dependent on good models and good commands. If you're just looking for LTspice to give you the DC operating conditions then it does a very good job. Just remember that the tube models (and all the other device models) are idealized, so your results *will* vary.

I'd say start with something simple, like a low power single-ended amp for speakers, or even a headphone amp.

However, just like when first learning Photoshop or Pro Tools, it's best to know how your modeled equipment works in the real world before trying to simulate it in the virtual world. Definitely buy something like Morgan Jones "Valve Amplifiers" or Merlin Blencowe's "Designing High Fidelity Tube Preamps" and learn about load lines, etc. Then you can use your knowledge of how the devices work (and don't work) when you use LTspice. Otherwise, the software will tell you about all sorts of crazy things that look like they'll work better than anything ever invented, but will just melt down or blow up on power on if you build them. "But it looked so good in simulation...!"

Have fun with it!

PS - Most spice models of indirectly heated tubes (the usual kind) don't bother with the heaters (filaments). Unless you're working with directly heated tubes (which I wouldn't recommend starting off with) you don't need to worry about the heaters. Just give them the correct voltage, wire them up correctly, and they'll work as expected. It's the layout and wiring that's important (real life stuff again).
 
Last edited:
This is all excellent information. Since I wrote it I was questioning the wisdom of even putting the PSU in there. The original models I had from Duncan Amps had the heater in it, and someone just provided a link to the "heater-less" model.

I'm definitely not using LTSpice to try to come up with a "perfect" design, as it is too perfect. My real intent here is to play around with values, get a rough idea of how it changes things(particularly DC analysis). Also to double check my math and other assumptions. Nothing beats real world experimentation, and I plan on getting my hands on some coils and tubes once I at least feel comfortable with the basics.

PSUD2 looks awesome, although I would want to refresh myself on that math as well. I appreciate the book recommendations - that was actually going to be my next question.

Thanks again to everyone! This is definitely enough to get my going.
 
What I would add..is to not worry about the precision of the tube models...The models out there are generally close enough.... I would be concerned with the Power supply... You can easily model a current dependent voltage source... The power supply in most amps is not regulated and can droop significantly in many cases... I have seen 500V supplies dip to 430V at full power output on a well known amp.. As for output transformers.... I usually model the BH loop as well as the leakage, winding capacitances..resistance..for starters..sometimes have to take it much further into proximity losses.. and AC skin effect... but for most audio stuff a simplified model will work in the beginning, until your curiosity starts to grow... Lets say a typical 100W PT will be around 7mA at 120V input of magnetizing current...this is middle of the road for that size... 45H to 60H primary inductance for a 100W PT is average...
 
Last edited:
What I would add..is to not worry about the precision of the tube models...The models out there are generally close enough....

The fun part in my modeling tests is that, like someone said, something could be "tolerable" in the simulations and may blow up in real life. I've already simulated a few situations where I've clearly far exceeded the nominal limitations(and even maximum limitations) of a tube and SPICE was all too happy to push it through.

I've ordered the books recommended and can't wait to freshen up on my theory.
 
I agree, it's not worth your time to simulate the power supply. PSU simulators and some napkin math is a little more practical for a simple linear power supply like this.

You should know that you made a mistake in simulating it, however. You entered in 120 V for the amplitude on the AC source, when it should be about 170 V. The reason is that LTspice works off of peak voltages, not RMS voltages.
 
I wanted to post a new thread, but I'm not sure if it's worth it. This might be the beginning of a line of stupid questions, as I'm trying to jog my memory with my electronics training. I bought the books recommended. I'm reading Designing High-Fidelity Valve Preamps, on Fundamentals of Amplification section 3.6.2 - The AC Load Line. The schematic involves an ECC83 with a 100k Ra resistor, tapped in between an unknown Co and Rl in series to ground, with another tap between Co and Rl.

In it, it mentions how the AC currents flow in Rl and Co. Then it goes into calculating it in parallel with Ra. I am having trouble seeing how this is. It would seem to me that the voltage drop between the plate and Ra is a parallel combination of Rk plus the apparent tube resistance, in parallel with Rl and the impedance of Co, with Ra being the common resistor.

I feel like I'm missing something in my knowledge here, where I've never calculated a voltage divider(with reactance or not) where one end was on + and the other end on ground, using the parallel method. Either the book doesn't cover that or I'm missing something very important in my memory.

Not looking for handholding, I truly want to thoroughly understand this stuff, but if someone can point me in the right direction(keyword) or give me a little intuition, I would greatly appreciate it.
 
Last edited:
garbage in = garbage out

I got pretty frustrated simulating the bias supply in a Pro Junior, which is a little weird, compared to spreadsheet.

Eventually I figured out I had forgotten the average DC output of a half-wave rectifier is much less than from a full-wave rectifier. So I had a wrong coefficient in my spreadsheet. I probably hadn't ever used that formula since a class 43 (?) years ago. I thought...who uses half-wave rectifiers anymore anyway?

Everything was close enough when I could figure out I could trust my simulation. It's easy to get useless results. You gotta be able to recognize them as genuinely useless if they are you get.
 
Last edited:
If you read books by people who simulate amps, they tell you how to choose your battles...one model will not work ideally for small signals, large signals and overdrive.

You may create different models or different simulation conditions with the same model for different phenomena you're trying to simulate. Figuring out how to do that can be the topic of a book. (Richard Kuehnel's Our Books)

It's readable, but it'll take some practice and patience. Then you have to define the problem you're trying to solve.
 
In it, it mentions how the AC currents flow in Rl and Co. Then it goes into calculating it in parallel with Ra. I am having trouble seeing how this is. It would seem to me that the voltage drop between the plate and Ra is a parallel combination of Rk plus the apparent tube resistance, in parallel with Rl and the impedance of Co, with Ra being the common resistor.
.

The AC impedance of an ideal power supply is ZERO ohm.
I.e. it can be replaced by a dead short for AC considerations.
Seen tis way the (series connection of internal tube resistance plus kathode resistor) is in parallel with the (external plate resistor) and also in parallel with the (load resistor).
Note that if Rk is bypassed with a sufficiently large capacitor, this will also be a short AC wise and Rk drops out of the equation, too.
 
Re your original question about spice sim of a power trafo:
It can be done and I do it regularly if the ps is complex like half wave, full wave, doubler on the same trafo.
You can determine the primary inductance simply by measuring the magnetisation current, which is the idle primary ac current without load.
That gives you the ac impedance at 60 Hz of the primary winding z=v/i ignoring the dc resistance for the moment.
Now remember that the ac impedance of an inductor is z=2*pi*L , and calculate L(primary) from that.
L (secondary) can be derived from that using the square (!) of the winding ratio.
Now put the Ls and the measured DC resistances into the parameter field of the inductors in spice, a reasonable K factor smaller but close to 1 and hit the sim button.
And remember, that LTspice wants to know the peak value of your mains voltage, 170v for 120 nominal rather than the rms.
 
Now remember that the ac impedance of an inductor is z=2*pi*L , and calculate L(primary) from that.
.

correction ...! wrong formula of course, frequency is missing !
should read: z=2*pi*f*L

if you do the measurents and calculate Lpri you will get something more like 40 Hy rather than the 400 micro H which you used in your sim ... probably explains your result ...