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

 4th July 2005, 01:42 PM #3 Robert McLean   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
valveitude
diyAudio Member

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.

 4th July 2005, 09:22 PM #5 Robert McLean   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
valveitude
diyAudio Member

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.

 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 bembel Tubes / Valves 19 10th January 2010 05:56 PM porcatroya Tubes / Valves 0 5th May 2008 06:41 AM Prune Software Tools 6 16th October 2004 03:22 PM doigtee Tubes / Valves 6 12th July 2003 11:42 AM G Solid State 5 14th September 2002 03:33 AM

 New To Site? Need Help?

All times are GMT. The time now is 12:13 PM.