Improved vacuum tube models for SPICE simulationsPart 2: Listings and PSpice operation
by Norman L. Koren
Updated September 3, 2001
|
Search WWW Search www.normankoren.com |
As my principal pursuit is now photography, I won't have much time to update this article or answer difficult questions. LTspice can apparently be used for these models. |
TRIODE PLATE CHARACTERISTIC CURVESTriotest.cir
.DC LIN V_P 0 400 4 ; V_P IS THE SUPPLY VOLTAGE. I(VP) IS OUTPUT.
V_P 101 0 200 ; PLATE VOLTAGE
VP 101 102 0 ; DUMMY V SOURCE FOR POSITIVE PLATE CURRENT PLOT.VG 1 0 -1 ; GRID VOLTAGE.
R1 0 1 1G ; ASSURES THAT GRID IS NOT FLOATING.X1 102 1 0 12AX7 ; P G C
.STEP LIN VG 0 -4 .5 ; FOR 12AX7
* X1 102 1 0 12AU7 ; P G C
* .STEP LIN VG 0 -20 4 ; FOR 12AU7
* X1 102 1 0 6DJ8 ; P G C
* .STEP LIN VG 0 -4 .5 ; FOR 6DJ8.LIB C:\PSPICE\WORK\TUBE.LIB
.PROBE I(VG) I(VP)
.OPTIONS NOPAGE.END
* C:\Audio\TubeShar\Triotest.schTriotest.net* Schematics Version 6.3 - April 1996
* Sun Sep 02 10:40:50 2001** Analysis setup **
.DC LIN V_VP 0 400 4
.STEP LIN V_VG 0 -20 -4
.LIB c:\audio\tubeshar\tube97.lib* From [SCHEMATICS NETLIST] section of msim.ini:
.lib C:\AUDIO\TubeShar\TUBE.LIB
.lib nom.lib
.INC "Triotest.net"
.INC "Triotest.als".probe
.END
* Schematics Netlist *V_VG 1G 0 DC 0 AC 0
V_VP 1P 0
X_TU1 1P 1G 0 12AU7
Set TRIMODE to 0 for pentode mode, 40 for ultra-linear mode (40% tap), or 100 for triode mode. Set VG2NOM to the screen grid voltage in pentode mode or to the quiescent (no ac signal) plate voltage in ultra-linear mode. VG2NOM has no effect in triode mode.
PENTODE CHARACTERISTIC CURVESPent_P.cir* SET THESE TWO PARAMETERS FOR MODE (PENTODE, UL, TRIODE)
.PARAM TRIMODE = 100 ; % TRIODE MODE (0=PENT; 40=UL; 100=TRIODE)
.PARAM VG2NOM = 300 ; NOMINAL VALUE OF GRID 2 VOLTAGE.
.STEP LIN VG1 0 -75 -10 ; 15 -75 -15 ; STEPS FOR PLATE CURVES.PARAM T1 = {TRIMODE/100}, T2 = {1-T1} ; FRACTION TRIODE MODE...
V_P 101 0 400 ; PLATE VOLTAGE
VP 101 1 0 ; DUMMY V SOURCE FOR POSITIVE PLATE CURRENT PLOT.
EG2 102 0 VALUE={VG2NOM*T2+T1*V(101,0)} ; GRID 2 VOLTAGE
VG2 102 4 0 ; FOR G2 CURRENT MEAS.
VG1 2 0 0 ; CONTROL GRID VOLTAGE
VC 3 0 0 ; FOR CATHODE CURRENT MEAS.
X1 1 2 3 4 KT88 ; P G1 C G2
.DC LIN V_P 0 600 5 ; VB IS THE SUPPLY VOLTAGE. I(VB) IS OUTPUT.
.PROBE I(VC) I(VP) I(VG2) I(VG1)
.OPTIONS NOPAGE LIBRARY
.LIB C:\PSPICE\WORK\TUBE.LIB
.END
* C:\Audio\TubeShar\Pent_P.schPent_P.net* Schematics Version 6.3 - April 1996
* Sun Sep 02 12:29:32 2001** Analysis setup **
.DC LIN V_VP 0 600 5
.STEP LIN V_VG1 0 -50 -10* From [SCHEMATICS NETLIST] section of msim.ini:
.lib C:\AUDIO\TubeShar\TUBE.LIB
.lib nom.lib
.INC "Pent_P.net"
.INC "Pent_P.als".probe
.END
* Schematics Netlist *V_VG1 1G 0 DC 0 AC 0
V_VP 1P 0 DC 0 AC 0
V_VG2NOM $N_0001 0 DC 300 AC 0
E_E2 2G 0 VALUE { V($N_0001, 0)*1+V(1P)*0 }
X_TU1 1P 1G 0 2G 6550
TUBE LIBRARY.SUBCKT 6550 1 2 3 4 ; P G1 C G2 (PENTODE)
+ PARAMS: MU=7.9 EX=1.35 KG1=890 KG2=4200 KP=60 KVB=24
+ CCG=14P CPG1=.85P CCP=12P RGI=1K
RE1 7 0 1MEG ; DUMMY SO NODE 7 HAS 2 CONNECTIONS
E1 7 0 VALUE= ; E1 BREAKS UP LONG EQUATION FOR G1.
+{V(4,3)/KP*LOG(1+EXP((1/MU+V(2,3)/V(4,3))*KP))}
G1 1 3 VALUE={(PWR(V(7),EX)+PWRS(V(7),EX))/KG1*ATAN(V(1,3)/KVB)}
G2 4 3 VALUE={(EXP(EX*(LOG((V(4,3)/MU)+V(2,3)))))/KG2}
RCP 1 3 1G ; FOR CONVERGENCE
C1 2 3 {CCG} ; CATHODE-GRID 1
C2 1 2 {CPG1} ; GRID 1-PLATE
C3 1 3 {CCP} ; CATHODE-PLATE
R1 2 5 {RGI} ; FOR GRID CURRENT
D3 5 3 DX ; FOR GRID CURRENT
.MODEL DX D(IS=1N RS=1 CJO=10PF TT=1N)
.ENDS.SUBCKT 12AX7 1 2 3 ; P G C; NEW MODEL (TRIODE)
+ PARAMS: MU=100 EX=1.4 KG1=1060 KP=600 KVB=300 RGI=2000
+ CCG=2.3P CGP=2.4P CCP=.9P ; ADD .7PF TO ADJ PINS, .5 TO OTHERS.
E1 7 0 VALUE=
+{V(1,3)/KP*LOG(1+EXP(KP*(1/MU+V(2,3)/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.SUBCKT PAT-4006-CFB 1 2 3 4 5 6 7 8 9 10 11
* PLITRON PAT-4006-CFB OUTPUT TRANSFORMER
* OL NUMBERS CORRESPOND TO TRANSFORMER SCHEMATIC.
* RESISTANCES HAVE BEEN OMITTED FOR SIMPLICITY, BUT MAY BE ADDED.
LP1 1 2 35.325H ; PRIMARY
LP2 2 3 15.7HLP3 3 4 15.7H
LP4 4 5 35.325H
CP1 1 5 .342NF ; CAPACITANCE FROM SPECS
LP5 8 7 .2453125H ; 1/2 SPEAKER SECONDARY
LP6 7 6 .2453125H ; " "
LP7 11 10 .98125H ; 1/2 FBK WINDING
LP8 10 9 .98125H ; " "
KALL LP1 LP2 LP3 LP4 LP5 LP6 LP7 LP8 .9999987 ; = 1-1/(2*403600)
.ENDS
A. The control file: PASorgTC.cir
Note that it calls the netlist, PASorgTC.net, using an .INC statement. Commands are not case-sensitive.
* C:\PSPICE\Stphl\PASorgTC.schB. The netlist (circuit description): PASorgTC.net* Schematics Version 6.3 - April 1996 Sat Nov 25 20:09:33 2000
.PARAM PARTX={(EXP(4.60517*PAR1)-1)/99} PAR1=.5
** Analysis setup **
.ac DEC 20 .01 1MEG
.LIB C:\Pspice\WORK\Tube.lib
.OP
* From [SCHEMATICS NETLIST] section of msim.ini:
.lib nom.lib
.INC "PASorgTC.net"
.INC "PASorgTC.als".probe
.END
The typical format is elemant_name node_1 node_2 ... value(s). The order isn't critical.
* Schematics Netlist *C. The PSpice output file (edited for brevity) for frequency domain analysis: PASorgTC.outRT_RVOL 0 3G {(250K*(1-0.5))+.001}
RB_RVOL 3G LINE_IN {(250K*0.5)+.001}
R_R3C 0 3C 4.7k
R_R4G 0 4G 1.2MEG
R_R3P 3P $N_0001 470k
R_R4C 0 4C 1k
R_R4P 4P $N_0001 100k
R_RLFB 3C $N_0002 47k
R_RLOAD 0 LINE_OUT 50k
C_C3P 3P $N_0003 .1UF
C_COUT $N_0004 LINE_OUT 1UF
C_C4P 4P BC .22UF
R_R4GS $N_0003 4G 18k
C_C4F2 SF1 4G 4000PF
C_CLFB 3C $N_0002 33PF
C_C4F1 SF1 $N_0003 1500PF
R_R4F 0 SF1 3.3MEG
RT_RBASS $N_0004 BC {(750K*(1-(1-PAR1)))+.001}
RB_RBASS BC $N_0002 {(750K*(1-PAR1))+.001}
RT_RTREB $N_0006 $N_0007 {(400K*(1-(1-PARTX)))+.001}
RB_RTREB $N_0007 $N_0005 {(400K*(1-PARTX))+.001}
C_CTR2 $N_0006 0 .02UF
R_RTR1 3C $N_0007 1k
C_CTR1 $N_0005 $N_0002 .002UF
C_CBS1 $N_0002 BC .0075UF
C_CBS2 BC LINE_OUT .0075UF
V_VIN LINE_IN 0 DC 0 AC 1 SIN(0 .5 1K)
V_V+320 V+320 0 DC 320
X_TU3 3P 3G 3C 12AX7
X_TU4 4P 4G 4C 12AX7
v_V10 V+320 $N_0001 0
**** 08/18/101 17:12:08 ******** NT Evaluation PSpice (April 1996) ************ C:\PSPICE\Stphl\PASorgTC.sch
(... The .cir file is repeated here... )**** CIRCUIT DESCRIPTION(The entire netlist is repeated... )RT_RVOL 0 3G {(250K*(1-0.5))+.001}
...
v_V10 V+320 $N_0001 0**** RESUMING PASORGTC.CIR ****
.INC "PASorgTC.als"**** INCLUDING PASorgTC.als ****
* Schematics Aliases *(Aliases are listed here; not of much interest to the user.)_ _(V+320=V+320)
.ENDALIASES...
**** Diode MODEL PARAMETERS (... not of much interest; edited out...)
This is the important part: shows voltages and currents at critical locations.**** SMALL SIGNAL BIAS SOLUTION TEMPERATURE = 27.000 DEG C
******************************************************************************NODE VOLTAGE NODE VOLTAGE NODE VOLTAGE NODE VOLTAGE
( 3C) 1.5171 ( 3G) 62.59E-06 ( 3P) 168.2900 ( 4C) 1.2431
( 4G) .0012 ( 4P) 195.6900 ( BC) 1.5171 ( SF1) 0.0000
(V+320) 320.0000 ($N_0001) 320.0000 ($N_0002) 1.5171
($N_0003) .0012 ($N_0004) 1.5171
($N_0005) 1.5171 ($N_0006) 1.5171
($N_0007) 1.5171 (LINE_IN) 0.0000
(X_TU3.5) 64.60E-06 (X_TU3.7) .2832
(X_TU4.5) .0012 (X_TU4.7) .7422
(LINE_OUT) 0.0000VOLTAGE SOURCE CURRENTS
NAME CURRENTV_VIN 5.008E-10
V_V+320 -1.566E-03
v_V10 1.566E-03TOTAL POWER DISSIPATION 5.01E-01 WATTS
(Additional information on voltage and current sources follows; not of much interest... )TOTAL JOB TIME .61
After you've installed PSpice on your computer you must install or create the tube models. Although PSpice is up to level 9.1 as I write this, I use version 6.3 for this example because I'm familiar with it and because you can also get away with a few more parts than newer versions allow. I assume you've downloaded my models. You'll need to install two files: the tube symbols (TUBE.SLB) and SPICE models (TUBE.LIB). Both are installed from the Schematics program. Installing the symbol library (TUBE.SLB)-- From the Schematics screen, click Options, Editor Configuration..., Library Settings. The screen on the right appears. Enter the foll pathname of the file containing the schematics symbols, except for the extension, in the Library Name: window, C:\NORMK\AUDIO\TubeShar\TUBE in the example. Check the box to the left of Symbol to get the .slb file extension. Click OK, OK. |
Installing the SPICE model library (TUBE.LIB)-- From the Schematics Screen, click Analysis, Library and Include Files... The screen on the right appears. Enter the full pathname of the SPICE model file (including extension) in the File Name: window, C:\NORMK\AUDIO\TubeShar\TUBE.LIB in the example. Click Add Library*, OK, OK. PSpice should be ready to run with tubes! |
template=M^@refdes %d %g %s %s @MODELTemplate links the part to the model library: With appropriate substitutions, for example, IRF9140 for @MODEL, it appears in the netlist. A number on the schematic diagram replaces ? in refdes. To alter an attribute, click on it in the box on the right and edit it in the boxes on the upper left. The attributes of the 12AX7 that link it to its subcircuit in TUBE.LIB are:
refdes=M?PART=IRF9140
MODEL=IRF9140
template=X^@REFDES %P %G %C @MODELTo create a new library file, click on File, New, then File, Save as..., tube.slb (or a full path name of your choice). To insert a part into the new library file, draw it following instructions in the tutorial or modify an existing part (such as the IRF9410), then save it by clicking Part, Save to Library... Either type the library file name or use the usual Windows navigation techniques to locate it. Good luck and please do the tutorial.
refdes=TU?
PART=12AX7
MODEL=12AX7
Parts are entered into PSpice Schematics drawings by clicking on the little box with the "and" gate. You can enter "R", "L", "C", "BUBBLE", etc. for common parts, or click on Browse... to examine a library of parts. I recommend using the rubberband option, which can be set by clicking Options, Display Options..., Rubberband. Named nodes (1G, 1P, etc.), which are created by double-clicking on lines and entering a name, are required for voltages to be examined in Probe. Input files to Schematics have the three character extension .SCH. Clicking Analysis, Create Netlist creates files with extensions .CIR (the control file), .NET (the netlist), and .ALS (an alias file which speeds up analysis) which are used as inputs to PSpice. The .CIR and .NET files contain ASCII text in SPICE format, as described in Paul Tuinenga's excellent text10. Clicking Analysis, Simulate creates the netlist, runs Pspice, and loads Probe to display results. Press the Insert key to select a voltage or current for Probe display. You can use "VDB" or "VP" to display a voltage in dB or its phase in degrees. There are many more possibilities for controlling the display.
To step the grid voltage, click on Analysis, Setup..., Parametric... Set Swept Var. Type to Voltage Source, Sweep Type to Linear, Name: to VG1, Start Value to 0, End Value: to -75 (or as appropriate), and Increment: to -15 (or as appropriate), then click OK. You may set the plate voltage sweep while the Analysis Setup... box is still open. Click DC Sweep... Set Swept Var. Type to Voltage Source, Sweep Type to Linear, Name: to VP, Start Value to 0, End Value: to 600 (or as appropriate), and Increment: to 5 (or as appropriate), then click OK. The DC Sweep... and Parametric boxes should contain check marks. Finally, click Close. All voltage sources except VG2NOM are set to DC=0 in the schematic diagram. (Attributes can be viewed and changed by double-clicking on the symbol.) Grid and plate voltages are controlled by the DC Sweep... and Parametric... settings.
VG2NOM is the nominal screen grid voltage. It is 300V in Figure 5 (pentode mode) and 450V in Figure 7 (ultra-linear (UL) mode). (It has no meaning in triode mode, where screen grid voltage equals the plate voltage). E2 is an EVAL voltage-controlled voltage source that controls how the screen grid voltage tracks the plate voltage. For Ultra-Linear mode it is set to V(%IN+, %IN-)*.4+V(1P)*.6 . For pentode mode it is V(%IN+, %IN-). For triode mode it is V(1P). VP is set to zero: -I(VP) is the correct polarity for plate current plotted by Probe. When you have completed entering the schematic, click Analysis, Simulate. This will create a netlist, run PSpice, and then run Probe to display the results. Error messages can appear at any one of several stages of this process. They are unavoidable when you start out. Don't get frustrated. This is where real learning happens.
This page
created December 8, 2003 |
Images and text copyright (C) 2000-2012 by Norman Koren. Norman Koren lives in Boulder, Colorado. Since 2003 most of his time has been devoted to the development of Imatest. He has been involved with photography since 1964. Designing vacuum tube audio amplifiers was his passion between about 1990 to 1998. |