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

Tube Spice Model Problem

Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.
I have been learning LTspice, and have been able to download and use the Pspice models from Duncan Amps with no problems. The same can't be said of any of the Norman Koren models.

This is an example of a model that works fine:

* Connections: Plate
* | Screen Grid
* | | Control Grid
* | | | Cathode
* | | | |
.SUBCKT KT88 P S G K
Esp 2 0 VALUE={V(P,K)+24.49*V(S,K)+189.9*V(G,K)}
E1 3 2 VALUE={8.301E-7*(PWR(V(2),1.5)+PWRS(V(2),1.5))/2}
E2 3 4 VALUE={8.301 E-7*PWR(24.49*V(S,K),1.5)*V(P,K)/40}
E3 5 4 VALUE={(1-V(4,2)/ABS(V(4,2)+0.001))/2}
R1 5 0 1.0K
Gk S K VALUE={V(3,2)}
Gp P S VALUE={0.95*(V(3,4)*(1-V(5,4))+V(3,2)*V(5,4))}
Cgk G K 8.0P
Cgs G S 8.0P
Cgp G P 1.2P
Cpk P K 12P
.ENDS KT88

And here is the model for a 6C45P I need to work, but can't figure out how:

Pspice Model

.subckt vtomega 1 2 3 ; plate grid cathode

+ params: mu=47.4501 ex=2.374193 kg1=268.615545 kp=485.735371 kvb=501.503636 rgi=300

+ ccg=2.4p cgp=4p ccp=.7p

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

c1 2 3 {ccg}

c2 1 2 {cgp}

c3 1 3 {ccp}

r1 2 5 {rgi}

d3 5 3 dx

.model dx d(is=1n rs=1 cjo=10pf tt=1n)

.ends

Totally different syntax,I suscpect it has to to do with the .model statement at the end ( the manual states the the file will have either a .subckt or a .model statement, but not both, hmmm.

Any help would be welcome.

Thanx,
Casey Brown
 
Hi Casey

I am not sure to have understand your problem, however...

Duncan models are variation about the 1/2 Child's law.
Koren approach is more sophisticated and makes use
of the log(1+exp()) to better model tube behavior at low current.
Pay attention. Some software use different rules for log function,
for some implementation Log means "Log10" ( the inverse of 10^x) and ln means "log e" ( the inverse of exp() or e^x )

logically speaking the last form is to be used but someone identifies parameter using log10 so you have to try both and find the correct one.
d3 5 3 dx

.model dx d(is=1n rs=1 cjo=10pf tt=1n)
there is no problem here. It is a poor method to model grid
current.
you can find some Koren like models here
http://www.audiocostruzioni.com/forum/topic.asp?TOPIC_ID=1446


bye
Federico
 
I also use LTSpice, so I tested your subcircuit vtomega in the circuit I use for generating triode plate curves, and it ran fine.

Well then...I'm a doof:cannotbe: I figured it was somthing I was doing wrong.

Are you getting error messages ?

Yup. I get an "can't open vtomega.inc" message as soon as I start to run a simulation.

I just started playing with LTspice (my first spice) a few weeks ago. This is how I have been using third party models. First, I copy the model parameters into notepad and save it with the .inc extension (vtomega.inc) in the directory with my drawings. I place a triode symbol on the circuit,and open up its properties. I change the "Value" setting to match my .inc file (vtomega). I then open up the symbol editor and edit the pin designators to match the model..in this case, plate=1 grid=2, and cathode=3. Finally, I put an "include" statement on my drawing (.inc vtomega.inc).
This method works on all Duncan models, and no Koren models. Clearly I need to do something else, I just need to know what it is.

Thanx,
Casey
 
Well, I am afraid I cant explain your problem, or duplicate it here. You are doing everything correctly.

"cant open vtomega.inc" error should only come up if the file cant be found, ie path not correct, or maybe a slight mismatch in the file name and the name you typed into the triode value field.

Duncan model or Koren model would make no difference so far as that particular error message is concerned. In fact the model could be complete rubbish and you would not get that error. Any syntax errors in the model produce the error message "syntax error in bla bla bla" where bla bla bla is the erroneous line of code.

Incorrect pin order also does not produce your error message, although it does cause incorrect results

Sorry to ask obvious questions, but are you sure the file name and the name in the value field are exactly the same ? and that the Duncan model files and the Koren model files are in the same directory ? And that the file name and path in the inc statement matches the file name and path of the vtomega file ? Other than that I do not know what to suggest.
 
Hello Robert,

Well, I am afraid I cant explain your problem, or duplicate it here. You are doing everything correctly.

Welcome to "Bizzare-O- World" :clown:

Sorry to ask obvious questions, but are you sure the file name and the name in the value field are exactly the same ? and that the Duncan model files and the Koren model files are in the same directory ? And that the file name and path in the inc statement matches the file name and path of the vtomega file ?

Yes, yes, and yes :mad: I even copied the .inc file into the LTspice root folder to no effect. I finally inserted the model directly onto the drawing in a multiline command text. Ugly, but it works.

I spent the majority of the last 2 days dinking with this problem :scratch1: I'm going to spend whats left of my weekend actually USING the simulator, ugly or not.
 
Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.