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

Making Spice Models for tubes

Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.
Hi All,

I needed a spice model for EL86 tube (triode mode). there are several models on the web but all of them use the simulation method based on some kind of formula. I wanted the model which is derived directly from the datasheet. Since I could not find one, I made it. I use LTSpiceIV and the model might be the program specific, but the methodology is very general and can be used for creating spice models for any triode and simulation programs.
I will describe the process of creating the model step by step.


1. The model is shown in the attached file. In nutshell, the triode is modeled as a voltage controlled current source. The output current is evaluated based on Vgk, Vpk and triode plate characteristics. Plate characteristics are loaded in the model as the points and the spice program does the interpolation. None of the tube constants (u, gm or Rp) are used. The model is simple and can be easily modified for other tubes.
Here are the essential elements of the model with comments and explanations:

a) Connections are Plate (P), Grid (G) and Cathode (K).

b) Dummy voltage source E1 is used to generate the voltage equivalent of V(p,k). E1 is used as an input voltage for the current sources (see below).
E1 n001 0 value {V(P,K)}

c) Dummy voltage dependent current sources (G0 - G12) are used to generate currents representing each I(Vgk=constant) plate curve. There are as many current sources as the curves in the tube plate characteristics. In the EL86 datasheet there are 13 curves (Vgk=0, Vgk=-2.5 .... Vgk=-30). The data comes directly from the plate curves. The curves are the plate current I(mA) vs plate to cathode voltage Va(V) at different grid voltages Vgk (V). The input voltage for each GX current source is E1
Here is the example of the current source for vgk=-5V:
G2 n102 0 n001 0 table (0 0
+ 38.652482 0.000709
+ 41.331757 0.001694
+ 44.011032 0.002561
......
+ 168.794326 0.200355 )

d) Current dependent current source GPK is used to generate output plate current. Current source interpolates current based on the lookup table.
GPK P K value={Table (V(g,k),-40,0,-30,I(G12),-27.5,I(G11),-25,I(G10),-22.5,I(G9),-20,I(G8),-17.5,I(G7),-15,I(G6),-12.5,I(G5),-10,I(G4),
+-7.5,I(G3),-5,I(G2),-2.5,I(G1),0,I(G0))}

e) I(Vp, Vgk=0) curve is used for all positive Vgk voltages. This assumption is not true for the real triode. However, it is quite useful for simulation of the receiving type tubes which should be operated with Vgk<0. In the simulation, plate current saturates when Vgk>0 and waveform is intentionally distorted. You can remove or modify this condition easily to alter tube behavior in the positive Vgk region.

f) Cutoff grid voltage is defined somewhat arbitrarily as an interpolation of the Ip(Vpk) points to Ip=0 at maximum Vpk (in this case Vpk=300V). For EL86 this happens approximately at Vgk=-40V.

Now what's left is to fill the model with the data derived from the plate curves.

2. I obtained the electronic image of the plate curves from the datasheet. My digitizer program (see below) takes jpg, tif and png but does not take pdf files as an input. So, there is an extra step of converting pdf to jpg file.

3. I used GetData graph digitizer from here Digitize graphs and plots - GetData Graph Digitizer - graph digitizing software. You can use any other program, but I like GetData for its simplicity. I imported jpg file to the program and semi-manually digitized all curves. It took me about an hour to get everything right. Digitizer outputs the data in several tabulated formats. I used Excel format for data output file.

4. The last step was to open file in Excel and copy-paste the appropriate data columns in my model text file. To edit the model file I used LTSpiceIV text editor, but notepad works as well.

Comments and ideas are welcome :)
 

Attachments

  • EL86_TR.txt
    19.6 KB · Views: 175
Here is the image of the digitized plate curves
 

Attachments

  • Digitizedcurves.jpg
    Digitizedcurves.jpg
    166 KB · Views: 552
Good job indeed...
I am using N. Koren methods. In practice there is just slight differences if present at all
against true tube type. Very nice that part with digitizer graph. it is always hard to input numerous datas. I am using photoshop image formatted like Va and Ia and reading pixels coordinates from pointer tool. that is little bit faster and more accurate then handy from the graph only. But that idea with digitizer is good. Cheers
 
Nice work on DC parameters, those curves look great. How well does it model reverse bias? Cutoff region, leakage? Dynamic parameters like capacitance, inductance, transit time?

By your description, I'm guessing it's a static-only model. That's great for DC bias, but that's easy to evaluate from the datasheet; AC and transient are far more interesting, and probably the objective here -- to produce accurate amplifier simulations.

My experience with DC transfer functions is they slow down the simulation, if they don't break it completely. The reason is, the derivative of the function doesn't go down or level off as frequency (or input rate of change) increases. This can be especially troublesome for nonlinear functions; I've seen ATANH generate divide-by-zero and singular matrix errors. It's tempting to implement a generic gain-of-10 stage as a simple multiplier, but that has no physical realization -- where does the voltage and current come from, how does it slew instantly? I'd happily give up some DC accuracy in a tube model if it has physically significant behavior. Presumably, transit time provides an upper pole, which like the charge storage in a semiconductor junction, varies with applied current and voltage, which SPICE is already well suited to model.

Tim
 
The problem I have with Koren models is that all the ones I've tried do not model screen current. So I have to fudge the circuit by using a voltage divider from B+ to gnd to set the screen voltage rather than just a series resistor from B+ to screen.

Does anyone have a fix for this?
 
By your description, I'm guessing it's a static-only model. That's great for DC bias, but that's easy to evaluate from the datasheet; AC and transient are far more interesting, and probably the objective here -- to produce accurate amplifier simulations.

I understand what you're saying, but for me as a relative novice the quiescent points are really useful to check for errors in a build. If Irakli's method makes it easier to find a build mistake then that's great
 
Other question/problem I have with regards to the tube models is that the ones I have come across do not have a equivalent Noise resistance at the input for simulating S/N ration in the circuits I work on (RIAA).
Does anyone know how I can add a Equivalent Noise Resistance of 350 ohm (Worst Case) to the spice model of the 6N23P below?

Many thanks in advance

.SUBCKT 6N23P 1 2 3 ; P G K ; P G C (Triode) 26-Oct-2001
+ PARAMS: MU=33.04 EX=1.220 KG1=212.4 KP=183.83
+ KVB=300.0 VCT=0.00 RGI=2000
+ CCG=3.6P CGP=1.5P CCP=2P
E1 7 0 VALUE=
+{V(1,3)/KP*LOG(1+EXP(KP*(1/MU+(V(2,3)+VCT)/SQRT(KVB+V(1,3)*V(1,3)))))}
RE1 7 0 1G
G1 1 3 VALUE={(PWR(V(7),EX)+PWRS(V(7),EX))/KG1}
RCP 1 3 1G ; TO AVOID FLOATING NODES IN MU-FOLLOWER
C1 2 3 {CCG} ; CATHODE-GRID;
C2 2 1 {CGP} ; GRID-PLATE;
C3 1 3 {CCP} ; CATHODE-PLATE;
D3 5 3 DX ; FOR GRID CURRENT
R1 2 5 {RGI} ; FOR GRID CURRENT
.MODEL DX D(IS=1N RS=1 CJO=10PF TT=1N)
.ENDS
 
Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.