Making Spice Models for tubes
 User Name Stay logged in? Password
 Home Forums Rules Articles diyAudio Store Blogs Gallery Wiki Register Donations FAQ Calendar Search Today's Posts Mark Forums Read Search

 Tubes / Valves All about our sweet vacuum tubes :) Threads about Musical Instrument Amps of all kinds should be in the Instruments & Amps forum

 Please consider donating to help us continue to serve you. Ads on/off / Custom Title / More PMs / More album space / Advanced printing & mass image saving
Irakli
diyAudio Member

Join Date: Aug 2004
Location: washington, DC
Making Spice Models for tubes

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.

Attached Files
 EL86_TR.txt (19.6 KB, 104 views)
__________________
My System

Irakli
diyAudio Member

Join Date: Aug 2004
Location: washington, DC
Here is the image of the digitized plate curves
Attached Images
 Digitizedcurves.jpg (166.0 KB, 430 views)
__________________
My System

Irakli
diyAudio Member

Join Date: Aug 2004
Location: washington, DC
Reproduction of the EL86 plate curves in LTSpiceIV using the model from the previous post. The setup is also shown.
Attached Images
 EL86platecurves.jpg (133.4 KB, 409 views) EL86setup.jpg (97.1 KB, 405 views)
__________________
My System

 23rd November 2011, 08:47 PM #4 Zoran   diyAudio Member   Join Date: Jan 2004 Location: Belgrade 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 __________________ ###
Irakli
diyAudio Member

Join Date: Aug 2004
Location: washington, DC
Thanks, Zoran.

I also added an 6N1P model.
Attached Files
 TubeSpiceModels.txt (32.6 KB, 113 views)
__________________
My System

Last edited by Irakli; 26th November 2011 at 08:02 PM. Reason: add text

highfieldrebel
diyAudio Member

Join Date: May 2009
Quote:
 Originally Posted by Irakli Reproduction of the EL86 plate curves in LTSpiceIV using the model from the previous post. The setup is also shown.
Nice job, could you plot one or two of your model's curves versus the model curves you found on the web?

Steve

 26th November 2011, 09:55 PM #7 Sch3mat1c   diyAudio Member     Join Date: Jan 2003 Location: Milwaukee, WI 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 __________________ Seven Transistor Labs, LLC Projects and Resources / Electronic Design and Consultation
Irakli
diyAudio Member

Join Date: Aug 2004
Location: washington, DC
Quote:
 Originally Posted by highfieldrebel Nice job, could you plot one or two of your model's curves versus the model curves you found on the web? Steve
Thanks.

Here is the plot of my model (green) vs. Duncan Monro (Duncan's Amp Pages) model (blue) for 6N1P.
Attached Images
 6N1Pcurves.jpg (140.0 KB, 352 views)
__________________
My System

 26th November 2011, 11:31 PM #9 TheGimp   diyAudio Member     Join Date: Aug 2009 Location: Johnson City, TN 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?
highfieldrebel
diyAudio Member

Join Date: May 2009
Quote:
 Originally Posted by Sch3mat1c 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

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is Off Forum Rules
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home Site     Site Announcements     Forum Problems Amplifiers     Solid State     Pass Labs     Tubes / Valves     Chip Amps     Class D     Power Supplies     Headphone Systems Source & Line     Analogue Source     Analog Line Level     Digital Source     Digital Line Level     PC Based Loudspeakers     Multi-Way     Full Range     Subwoofers     Planars & Exotics Live Sound     PA Systems     Instruments and Amps Design & Build     Parts     Equipment & Tools     Construction Tips     Software Tools General Interest     Car Audio     diyAudio.com Articles     Music     Everything Else Member Areas     Introductions     The Lounge     Clubs & Events     In Memoriam The Moving Image Commercial Sector     Swap Meet     Group Buys     The diyAudio Store     Vendor Forums         Vendor's Bazaar         Sonic Craft         Apex Jr         Audio Sector         Acoustic Fun         Chipamp         DIY HiFi Supply         Elekit         Elektor         Mains Cables R Us         Parts Connexion         Planet 10 hifi         Quanghao Audio Design         Siliconray Online Electronics Store         Tubelab     Manufacturers         AKSA         Audio Poutine         Musicaltech         Aussie Amplifiers         CSS         exaDevices         Feastrex         GedLee         Head 'n' HiFi - Walter         Heatsink USA         miniDSP         SITO Audio         Twin Audio         Twisted Pear         Wild Burro Audio

 Similar Threads Thread Thread Starter Forum Replies Last Post jackinnj Tubes / Valves 0 26th January 2011 07:47 PM stinius Solid State 0 18th November 2008 09:07 PM aletheian Tubes / Valves 2 30th March 2007 12:35 AM Bonsai Solid State 5 24th September 2003 09:44 AM

 New To Site? Need Help?

All times are GMT. The time now is 05:39 AM.