• 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.

Alternate spice models

Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.
If I want to sim a valve I don't have a model for, can I use another with similar gm and rp, or two in parallel with a similar combined gm and rp? are there other parameters that need to be considered.

I don't need absolute perfection, and I don't expect this to give accurate HF rolloff information or overload behaviour.


In an unrelated matter, does anyone know whether a 6J7 is a 'pentodised' 6J5, or is it just similar?
 
approximate spice models

You can certainly do what you suggest, ie use the model of a similar tube, if you dont have the model for the exact tube you want, or if you dont have sufficient data to create a model for the precise tube you want.

But there is an alternative alternative. Most spec sheets give at least mu and gm (or rp, or all 3 ), at some particular operating point, ie current I at gid voltage Vg and plate volatge Vp. Given that basic information, and given the approximate equation for a triode of I = K * (mu*Vg+Vp)^x, then with a bit of calculus and algebra values for K and x can be calculated to give the desired values of gm and mu at the operating point I, Vg,Vp.

The formulas for x and K are

x = gm*(mu*Vg+Vp)/(mu*I)
and
K = I * (mu*Vg+Vp)^(-x)

if gm is not given, but rp is, then calculate gm as gm = mu/rp

if mu is not given, then just use x = 1.5, that should be close enough.

here is the resulting spice model. You mention 6J5 in your post, so I use that as an example.

Note that this is a simplified model, mu is perfectly constant, all the plate curves are perfectly parallel, so it is not completely realistic.

********************
*
* approximate model
* given mu and gm at a dc operating point I, Vp, Vg
* then parameters can be calculated for a fit at that point.
* this is useful for tubes for which there is a short form data sheet,
* but no plate curves.
*
* assuming I = K*(mu*Vg +Vp)^x,
*
* then x = gm*(mu*Vg+Vp)/(mu*I)
*
* and K = I * (mu*Vg+Vp)^(-x)
*
* default parameters are for 6J5 with mu = 20 and gm = 2600e-6
* at Vg = -8, Vp = 250, I = 9e-3
*
*
.SUBCKT Tube A G K
+ PARAMS: Mu=20 K= 2.59255e-5 x = 1.3
+ Cak=3.6p Cag=3.4p Cgk=3.4p
Bp A K I={K} * ({Mu}*V(G,K)+V(A,K))**{x}
C1 A G {Cag}
C2 A K {Cak}
C3 G K {Cgk}
.ENDS Tube


When I run this model, and a model derived from published plate curves, I find very close agreement for grid voltages in the range of -5 to -10 volts and currents of 5 to 15 mA. Even outside that range the fit is not too bad.
 
If it's a triode you need to simulate, there's "curve captor", a program that takes input from a gif file of a published characteristics curve (you do have to plot by hand many points, but the program takes it from there) and makes a variety of spice models for you. See http://sourceforge.net/projects/curvecaptor/ and this thread http://www.diyaudio.com/forums/showthread.php?s=&threadid=56327&perpage=10&pagenumber=1

But maybe I did it already, see http://home.netcom.com/~wb2jia/tubes/spice3.txt
http://home.netcom.com/~wb2jia/tubes/spice4.txt
http://home.netcom.com/~wb2jia/tubes/spice2.txt
http://home.netcom.com/~wb2jia/tubes/spice.txt

I've been using circuitmaker, a 3f4 spice simulator.
 
Thanks for the explainations Robert McLean, you seem to know your stuff. You've helped me to get a hold on the simplicity of some triode modelling. I'm new to the model files but your example makes it look fairly straight-forward (on a fundamental level, that is) ;)

wa2ise, I'm curious to see you've already compiled some examples. I'd like to learn the language (one day) but I feel I'd get more done if I just used pre-existing models. Can I use your text files as they are, in Circuitmaker 2k? just re-extension them as lib? or do I need to extract the model of interest?

I am initially interested in a 6J7 model and a triode strapped 46. I am inclined to use a 45 model for that, do you think I could?

Also it's good to know I could make models for anything I haven't thought of yet.
 
I think I'll give the tracer a try.

I have had a problem getting your models to work with my version of CM, wa2ise. Well, I've only tried the 45 as yet. It's probably just my inexperience ;)

Spice gave me an error to do with the last (8 parameter) line - parameter value out of range or wrong type.

I tried changing the pin assignments to ensure I didn't get them wrong (all 6 combos) but the message is the same for all.

BTW, I'm assuming the simmed circuit has to treat the 45 as indirectly heated and I can use the standard triode symbol.
 
My simulator is a spice 3f4 type, you may have a PSpice version, and there's more than 2 flavors. The code for one doesn't work for the others. I don't know the languages all that well, I just "hack" the code until the simulated curvetracer yields curves that look like those published. That is done by changing some of the numbers in a preexisting working model.
 
Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.