Making Spice Models for tubes - diyAudio
Go Back   Home > Forums > Amplifiers > Tubes / Valves

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
Reply
 
Thread Tools Search this Thread
Old 23rd November 2011, 04:46 PM   #1
Irakli is offline Irakli  United States
diyAudio Member
 
Irakli's Avatar
 
Join Date: Aug 2004
Location: washington, DC
Blog Entries: 1
Default 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.

Comments and ideas are welcome
Attached Files
File Type: txt EL86_TR.txt (19.6 KB, 98 views)
__________________
My System
  Reply With Quote
Old 23rd November 2011, 04:51 PM   #2
Irakli is offline Irakli  United States
diyAudio Member
 
Irakli's Avatar
 
Join Date: Aug 2004
Location: washington, DC
Blog Entries: 1
Here is the image of the digitized plate curves
Attached Images
File Type: jpg Digitizedcurves.jpg (166.0 KB, 399 views)
__________________
My System
  Reply With Quote
Old 23rd November 2011, 05:10 PM   #3
Irakli is offline Irakli  United States
diyAudio Member
 
Irakli's Avatar
 
Join Date: Aug 2004
Location: washington, DC
Blog Entries: 1
Reproduction of the EL86 plate curves in LTSpiceIV using the model from the previous post. The setup is also shown.
Attached Images
File Type: jpg EL86platecurves.jpg (133.4 KB, 380 views)
File Type: jpg EL86setup.jpg (97.1 KB, 376 views)
__________________
My System
  Reply With Quote
Old 23rd November 2011, 08:47 PM   #4
Zoran is offline Zoran  Serbia
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
__________________
###
  Reply With Quote
Old 26th November 2011, 07:34 PM   #5
Irakli is offline Irakli  United States
diyAudio Member
 
Irakli's Avatar
 
Join Date: Aug 2004
Location: washington, DC
Blog Entries: 1
Thanks, Zoran.

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

Last edited by Irakli; 26th November 2011 at 08:02 PM. Reason: add text
  Reply With Quote
Old 26th November 2011, 08:10 PM   #6
diyAudio Member
 
Join Date: May 2009
Quote:
Originally Posted by Irakli View Post
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
  Reply With Quote
Old 26th November 2011, 09:55 PM   #7
diyAudio Member
 
Sch3mat1c's Avatar
 
Join Date: Jan 2003
Location: Milwaukee, WI
Send a message via ICQ to Sch3mat1c Send a message via AIM to Sch3mat1c
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
Projects and Resources
  Reply With Quote
Old 26th November 2011, 10:23 PM   #8
Irakli is offline Irakli  United States
diyAudio Member
 
Irakli's Avatar
 
Join Date: Aug 2004
Location: washington, DC
Blog Entries: 1
Quote:
Originally Posted by highfieldrebel View Post
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
File Type: jpg 6N1Pcurves.jpg (140.0 KB, 324 views)
__________________
My System
  Reply With Quote
Old 26th November 2011, 11:31 PM   #9
TheGimp is offline TheGimp  United States
diyAudio Member
 
TheGimp's Avatar
 
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?
  Reply With Quote
Old 27th November 2011, 12:10 AM   #10
diyAudio Member
 
Join Date: May 2009
Quote:
Originally Posted by Sch3mat1c View Post
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
  Reply With Quote

Reply


Hide this!Advertise here!
Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Spice Models for Tubes w Screen Grid by Gurski jackinnj Tubes / Valves 0 26th January 2011 07:47 PM
Spice models stinius Solid State 0 18th November 2008 09:07 PM
Any spice models around for AA5-esque battery tubes? aletheian Tubes / Valves 2 30th March 2007 12:35 AM
Spice Models Bonsai Solid State 5 24th September 2003 09:44 AM


New To Site? Need Help?

All times are GMT. The time now is 01:06 AM.


vBulletin Optimisation provided by vB Optimise (Pro) - vBulletin Mods & Addons Copyright © 2014 DragonByte Technologies Ltd.
Copyright 1999-2014 diyAudio

Content Relevant URLs by vBSEO 3.3.2