Hello? How do you use ayumi's spice model in pspice? When I try to simulate a model in tubemodel_3.20. I got an error. I attach the following photograph about this.
Thank you
Thank you
Try seaching Vacuum Tube SPICE Models for some tips, but basically you need to modify the SPICE codes a little bit.
You will need to manually change the syntax as in the examples below.
I don't know how well these will perform in PSpice as I don't use that simulator. These two examples will run in LTspice, but you will need to change all instances of ^ to **. Micro-Cap doesn't like Ayumi's models, it will either fail to converge or throw up a "Matrix is singular" error.
Code:
*
* Generic triode model: 6J5WGT
* Copyright 2003--2008 by Ayumi Nakabayashi, All rights reserved.
* Version 3.10, Generated on Tue Feb 11 14:25:30 2014
* Plate
* | Grid
* | | Cathode
* | | |
.SUBCKT 6J5WGT_AN A G K
EGG GG 0 VALUE={V(G,K)+0.59726326}
EM1 M1 0 VALUE={(0.017464976*(LIMIT(V(A,K),0,1e16)+1e-10))^-0.62256803}
EM2 M2 0 VALUE={(0.70669113*(LIMIT((V(GG)+LIMIT(V(A,K),0,1e16)/16.794118),0,1e16)+1e-10))^2.122568}
EP P 0 VALUE={0.0010486074*(LIMIT((V(GG)+LIMIT(V(A,K),0,1e16)/23.764439),0,1e16)+1e-10)^1.5}
EIK IK 0 VALUE={STP(V(GG))*V(P)+(1-STP(V(GG)))*0.00060652877*V(M1)*V(M2)}
EIG IG 0 VALUE={0.00052430368*LIMIT(V(G,K),0,1e16)^1.5*(LIMIT(V(G,K),0,1e16)/(LIMIT(V(A,K),0,1e16)+LIMIT(V(G,K),0,1e16))*1.2+0.4)}
GIAK A K VALUE={LIMIT(V(IK,IG)-LIMIT(V(IK,IG)-(0.00059118276*LIMIT(V(A,K),0,1e16)^1.5),0,1e16),0,1e16)+1e-10*V(A,K)}
GIGK G K VALUE={V(IG)}
* CAPS
CGA G A 3.1p
CGK G K 3.2p
CAK A K 3.2p
.ENDS
Code:
*
* Generic triode model: 12AT7
* Copyright 2003--2008 by Ayumi Nakabayashi, All rights reserved.
* Version 3.10, Generated on Sat Mar 8 22:41:07 2008
* Plate
* | Grid
* | | Cathode
* | | |
.SUBCKT 12AT7_AN A G K
EGG GG 0 VALUE={V(G,K)+0.67585931}
EM1 M1 0 VALUE={(0.015420581*(MAX(0,(V(A,K)))+1e-10))^-1.768756}
EM2 M2 0 VALUE={(0.45889017*(MAX(0,(V(GG))+MAX(0,(V(A,K)))/35.090106)+1e-10))^3.268756}
EP P 0 VALUE={0.0031809222*(MAX(0,(V(GG))+MAX(0,(V(A,K)))/76.46733)+1e-10)^1.5}
EIK IK 0 VALUE={STP(V(GG))*V(P)+(1-STP(V(GG)))*0.0042575005*V(M1)*V(M2)}
EIG IG 0 VALUE={0.0015904611*MAX(0,(V(G,K)))^1.5*(MAX(0,(V(G,K)))/(MAX(0,(V(A,K)))+MAX(0,(V(G,K))))*1.2+0.4)}
GIAK A K VALUE={MAX(0,(V(IK,IG))-MAX(0,(V(IK,IG))-(0.0016530623*MAX(0,(V(A,K)))^1.5))+1e-10*V(A,K))}
GIGK G K VALUE={V(IG)}
* CAPS
CGA G A 1.5p
CGK G K 2.2p
CAK A K 0.5p
.ENDS
Why do people still use PSpice? 🙂
For one there is much that is not supported like Level 3 GASFET's. If you were working on a chip with 30 designers in 4 countries and 100,000 transistors you would appreciate an industrial strength suite of tools.
Micro-Cap is a PSpice "compatible" simulator. But... one of its quarks is that you need to change LOG to LN. As I have stated in my previous post, Micro-Cap does not like Ayumi's models. I've tried them in both MC6 and MC11 with the same result. Micro-Cap does not understand "URAMP" or "U". If you want to use Ayumi's models, I would not recommend Micro-Cap. They will work in LTspice and Tina TI without any problems that I've encountered (yet). 😉LTSpice, Simetrix, Micro-Cap, TINA... Pick one you like.
We are talking about lowly DIY designs... 😀For one there is much that is not supported like Level 3 GASFET's. If you were working on a chip with 30 designers in 4 countries and 100,000 transistors you would appreciate an industrial strength suite of tools.
I have converted some models for Micro-Cap and they seem to work fine, then again I don't use it all that much anymore. I had MC10 FWIW...Micro-Cap is a PSpice "compatible" simulator. But... one of its quarks is that you need to change LOG to LN. As I have stated in my previous post, Micro-Cap does not like Ayumi's models
Thank you , cogsncogs. I used your example 6j5. Pspice works normally now. Though an error had appeared (The error was "Line too long. Limit is 132 characters ...) I simply corrected error.
pcTube for MicroCAP
You can get pcTube (Ayumi) to generate models for MicroCAP:
saved a copy of the file pctube.r as pctube2.r
Create the dir's microcap & microcap/tubemodel:
added the following line to pctube2.r (between dir.create of spice (line 1943) and simetrix (line 1944))
dir.create("microcap/tubemodel", showWarnings=FALSE, recursive=TRUE)
added lines of code to pctube2.r to generate model for microcap:
copied the lines of code used to generate the model for SIMetrix (lines 2090 to 2052).
edited the copied lines of code for simetrix model generation; changing URAMP(x) to LIMIT((x),0,1E16) and U(x) to STP(x))
You can get pcTube (Ayumi) to generate models for MicroCAP:
saved a copy of the file pctube.r as pctube2.r
Create the dir's microcap & microcap/tubemodel:
added the following line to pctube2.r (between dir.create of spice (line 1943) and simetrix (line 1944))
dir.create("microcap/tubemodel", showWarnings=FALSE, recursive=TRUE)
added lines of code to pctube2.r to generate model for microcap:
copied the lines of code used to generate the model for SIMetrix (lines 2090 to 2052).
edited the copied lines of code for simetrix model generation; changing URAMP(x) to LIMIT((x),0,1E16) and U(x) to STP(x))
Code:
# Output model for MicroCAP Generic model
s <- NULL
s[1] <- "*"
s[3] <- "* Copyright 2003--2008 by Ayumi Nakabayashi, All rights reserved."
s[4] <- "* Thanks to Tooru Kuroda."
s[5] <- version
if (mode == "triode") {
s[2] <- Paste("* Generic triode model for Micro-Cap: ", mn)
s[6] <- Paste("*", pad, "Plate")
s[7] <- Paste("*", pad, "| Grid")
s[8] <- Paste("*", pad, "| | Cathode")
s[9] <- Paste("*", pad, "| | |")
s[10] <- Paste(".SUBCKT ", mn, " A G K")
s[11] <- Paste(".param GG {(V(G,K)+", p$Ego, ")}")
s[12] <- ".param EP {LIMIT(V(A,K),0,1T)}"
s[13] <- ".param EG {LIMIT(V(G,K),0,1T)}"
s[14]<- Paste(".param M1 {((", sig(c/2/p$muc), "*EP)^", sig(b), ")}")
s[15]<- Paste(".param M2 {((", sig(1.5/a), "*LIMIT((GG+EP/", p$muc, "),0,1T))^", sig(a), ")}")
s[16]<- Paste(".param P {(", sig(G.p), "*LIMIT((GG+EP/", sig(mum), "),0,1T)^1.5)}")
s[17]<- Paste(".param IK {(STP(GG)*P+(1-STP(GG))*", p$G, "*M1*M2)}")
s[18]<- Paste(".param IG {(", sig(Ig.ratio*G.lim), "*EG^1.5*(EG/(EP+EG)*1.2+0.4))}")
s[19]<- Paste("BIAK A K I=LIMIT((IK-IG-LIMIT((IK-IG-", sig((1-Ig.ratio)*G.lim), "*EP^1.5),0,1T)),0,1T)+1e-10*V(A,K)")
s[20]<- "BIGK G K I=IG"
s[21]<- "* CAPS"
s[22]<- Paste("CGA G A ", Cgpt, "p")
s[23]<- Paste("CGK G K ", Cgkt, "p")
s[24]<- Paste("CAK A K ", Cpkt, "p")
s[25]<- ".ENDS"
} else {
s[2] <- Paste("* Generic pentode model for Micro-Cap: ", mn)
s[6] <- Paste("*", pad, "Plate")
s[7] <- Paste("*", pad, "| Screen Grid")
s[8] <- Paste("*", pad, "| | Control Grid")
s[9] <- Paste("*", pad, "| | | Cathode")
s[10] <- Paste("*", pad, "| | | |")
s[11] <- Paste(".SUBCKT ", mn, " A G2 G1 K")
s[12] <- Paste(".param GG {(V(G1,K)+", p$Ego, ")}")
s[13] <- ".param EP {LIMIT(V(A,K),0,1T)}"
s[14] <- ".param EG {LIMIT(V(G1,K),0,1T)}"
s[15]<- ".param EG2 {LIMIT(V(G2,K),0,1T)}"
s[16]<- Paste(".param M1 {((", sig(c/2/p$muc), "*EG2)^", sig(b), ")}")
s[17]<- Paste(".param M2 {((", sig(1.5/a), "*LIMIT((GG+EG2/", p$muc, "),0,1T))^", sig(a), ")}")
s[18]<- Paste(".param P {(", sig(G.p), "*LIMIT((GG+EG2/", sig(mum), "),0,1T)^1.5)}")
s[19]<- Paste(".param IK {(STP(GG)*P+(1-STP(GG))*", p$G, "*M1*M2)}")
s[20]<- Paste(".param IG {(", sig(Ig.ratio*G.lim), "*EG^1.5*(EG/(EP+EG)*1.2+0.4))}")
s[21]<- ".param IK2 {((IK-IG)*(1-0.4*(EXP(-EP/(EG2+1e-10)*15)-EXP(-15))))}"
s[22]<- Paste(".param IG2T {(IK2*(", 1-p$g2.r, "*(1-EP/(EP+10))^1.5+", p$g2.r, "))}")
s[23]<- Paste(".param IK3 {(IK2*(EP+", -p$Ea, ")/(EG2+", -p$Ea, "))}")
s[24]<- Paste(".param IK4 {(IK3-LIMIT((IK3-(", sig((1-Ig.ratio)*G.lim), "*(EP+LIMIT((EG2-EP),0,1T))^1.5)),0,1T))}")
s[25]<- Paste(".param IP {LIMIT((IK4-IG2T-LIMIT((IK4-IG2T-(", sig((1-Ig.ratio)*G.lim), "*EP^1.5)),0,1T)),0,1T)}")
s[26]<- "BIAK A K I=IP+1e-10*V(A,K)"
s[27]<- "BIG2 G2 K I=LIMIT((IK4-IP),0,1T)"
s[28]<- "BIGK G1 K I=IG"
s[29]<- "* CAPS"
s[30]<- Paste("CGA G1 A ", Cgp, "p")
s[31]<- Paste("CGK G1 K ", Cgk, "p")
s[32]<- Paste("C12 G1 G2 ", Cg1g2, "p")
s[33]<- Paste("CAK A K ", Cpk, "p")
s[34]<- ".ENDS"
}
filename <- paste("microcap/tubemodel/", fn, ".mod", sep="")
cat("Writing", filename, "\n")
write(s, file=filename)
- Status
- Not open for further replies.
- Home
- Amplifiers
- Tubes / Valves
- How do you use Ayumi's SPICE model in PSpice?