Tube Spice Model Problem - 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 4th July 2005, 06:02 AM   #1
diyAudio Member
 
valveitude's Avatar
 
Join Date: Apr 2005
Location: Naches,WA
Default Tube Spice Model Problem

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
__________________
Experience is a wonderful thing. It enables you to recognize a mistake when you make it again.
  Reply With Quote
Old 4th July 2005, 08:39 AM   #2
diyAudio Member
 
Join Date: Nov 2003
Location: Genova, Italy
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.
Quote:
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/foru...?TOPIC_ID=1446


bye
Federico
  Reply With Quote
Old 4th July 2005, 01:42 PM   #3
diyAudio Member
 
Join Date: May 2005
Location: Stittsville, Ontario, Canada
I also use LTSpice, so I tested your subcircuit vtomega in the circuit I use for generating triode plate curves, and it ran fine.

So in what way is the model not working ? Are you getting error messages ? Is it not giving you the results you expect ?
__________________
Robert McLean
  Reply With Quote
Old 4th July 2005, 03:32 PM   #4
diyAudio Member
 
valveitude's Avatar
 
Join Date: Apr 2005
Location: Naches,WA
Quote:
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 I figured it was somthing I was doing wrong.

Quote:
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
__________________
Experience is a wonderful thing. It enables you to recognize a mistake when you make it again.
  Reply With Quote
Old 4th July 2005, 09:22 PM   #5
diyAudio Member
 
Join Date: May 2005
Location: Stittsville, Ontario, Canada
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.
__________________
Robert McLean
  Reply With Quote
Old 5th July 2005, 01:56 AM   #6
diyAudio Member
 
valveitude's Avatar
 
Join Date: Apr 2005
Location: Naches,WA
Hello Robert,

Quote:
Well, I am afraid I cant explain your problem, or duplicate it here. You are doing everything correctly.
Welcome to "Bizzare-O- World"

Quote:
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 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 I'm going to spend whats left of my weekend actually USING the simulator, ugly or not.
__________________
Experience is a wonderful thing. It enables you to recognize a mistake when you make it again.
  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
Need ECF80 / 6BL8 tube spice 3f4 model bembel Tubes / Valves 19 10th January 2010 05:56 PM
Help With 6v6 Spice Model porcatroya Tubes / Valves 0 5th May 2008 06:41 AM
SPICE model Prune Parts 6 16th October 2004 03:22 PM
Spice model doigtee Tubes / Valves 6 12th July 2003 11:42 AM
Spice model for LED? G Solid State 5 14th September 2002 03:33 AM


New To Site? Need Help?

All times are GMT. The time now is 05:34 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