No, R is just an open-source math program, nothing to do with Ayumi... However, he does provide instruction on SPICE model building, I used Google Translate to read the document, in which, he gave several examples, so you can follow along. Here is the translated document. It may take some time to learn to use R and pctube, but once you get it, the process is pretty straight-forward.
Sorry, it does not appear straight forward at all to me. And it doesn't help that the docs are translations from Japanese.
A step by step procedure from someone that understands the process and writes in English would be much appreciated by many I am sure.
Here is the step by step procedure to create SPICE models for the triode, the 12AU7 tube is used as an example below:
1. Save the data points in CSV format with three columns: Eg, Ep, Ip, please note that more data points do not necessarily increase the model's accuracy;
2. Launch R, and change the working directory to where the pctube.r file is stored on your PC - File -> Change dir...;
3. In R, load pctube.r - File -> Source R code..., select pctube.r;
4. At the R command prompt, type: Ip.cal("12AU7.csv", "t12AU7", Cgp=1.5e-12, Ci=1.6e-12, Co=0.4e-12), with the capacitance values taken from the datasheet;
5. Ip.cal will generate a curve fitted Ep-Ip characteristic graph on the screen, check for any obvious error (usually due to bad data entries);
6. At the R command prompt, type r2spice(t12AU7, "12AU7", "12AU7", Cgp=1.5e-12, Ci=1.6e-12, Co=0.4e-12), this will generate three varieties of SPICE models - PSPICE, SIMetrix and TINA. The models can be found in your work directory.
Bada bing, bada boom... you got your models.
1. Save the data points in CSV format with three columns: Eg, Ep, Ip, please note that more data points do not necessarily increase the model's accuracy;
2. Launch R, and change the working directory to where the pctube.r file is stored on your PC - File -> Change dir...;
3. In R, load pctube.r - File -> Source R code..., select pctube.r;
4. At the R command prompt, type: Ip.cal("12AU7.csv", "t12AU7", Cgp=1.5e-12, Ci=1.6e-12, Co=0.4e-12), with the capacitance values taken from the datasheet;
5. Ip.cal will generate a curve fitted Ep-Ip characteristic graph on the screen, check for any obvious error (usually due to bad data entries);
6. At the R command prompt, type r2spice(t12AU7, "12AU7", "12AU7", Cgp=1.5e-12, Ci=1.6e-12, Co=0.4e-12), this will generate three varieties of SPICE models - PSPICE, SIMetrix and TINA. The models can be found in your work directory.
Bada bing, bada boom... you got your models.
Last edited:
jazbo,
In the example data table of input to R, is the first column required?
i.e. I am referring to the numbers 1-51.
If I can figure this out and get it working, I will make two models, one with very few data points, and one with many data points, and see if there is much difference in the end-result.
In the example data table of input to R, is the first column required?
i.e. I am referring to the numbers 1-51.
If I can figure this out and get it working, I will make two models, one with very few data points, and one with many data points, and see if there is much difference in the end-result.
Last edited:
jazbo,
is the first column required?
i.e. I am referring to the numbers 1-51.
No, those are just line numbers for easy reference, you only need three columns: Eg, Ep, Ip.
Have fun!
Just a couple of notes regarding Ayumi's models:
1) The 12AX7 Plate curves shown on his web site show a very abrupt decrease in Ip on the 0V curve. See the attached curves for comparison.
2) All the models included in the two zip files on his web site are not in a syntax compatible with PSpice.
1) The 12AX7 Plate curves shown on his web site show a very abrupt decrease in Ip on the 0V curve. See the attached curves for comparison.
2) All the models included in the two zip files on his web site are not in a syntax compatible with PSpice.
Attachments
Last edited:
Ayumi's 12AX7 model is based on Philips, not GE, but it really does not matter much (except for proper grid modeling which most other models like Koren and Munro lack) since +-20% tolereance is not un-common for tubes. I was mistaken, one variant of the model supports SPICE 3f4 not PSPICE.
Sorry,
I had the wrong graph. His current is about right, but the abrupt cutoff of Ip on the 0V curve is a little disappointing.
I have been checking various datasheets, and they seem to correlate well. So Philips, GE, it should not matter much.
So there is no PSpice syntax output from Ayumi's modeling? Ay, that could be a problem.
I had the wrong graph. His current is about right, but the abrupt cutoff of Ip on the 0V curve is a little disappointing.
I have been checking various datasheets, and they seem to correlate well. So Philips, GE, it should not matter much.
So there is no PSpice syntax output from Ayumi's modeling? Ay, that could be a problem.
6HS8 model
Hi everybody !
Did somebody have a 6HS8 model ?
This is a very strange sharp-cutoff twin pentode with a common cathode, grid #1 and grid #2. It is used sometime as a remote two channel volume control but it have other very nice characteristics (look at the curves).
I just buy 5 of them on eBay for tests and they are on the 1$ ESRC special list ...
I also look for a 6J6A model ?
Another strange tube, a twin medium-mu triode with a common cathode ... This tube can be use in a phase splitter, a two channel mixer or both triode in parallel to increase the current. But it is not a very linear tube to use as an amplifier.
Alain
Hi everybody !
Did somebody have a 6HS8 model ?
This is a very strange sharp-cutoff twin pentode with a common cathode, grid #1 and grid #2. It is used sometime as a remote two channel volume control but it have other very nice characteristics (look at the curves).
I just buy 5 of them on eBay for tests and they are on the 1$ ESRC special list ...
I also look for a 6J6A model ?
Another strange tube, a twin medium-mu triode with a common cathode ... This tube can be use in a phase splitter, a two channel mixer or both triode in parallel to increase the current. But it is not a very linear tube to use as an amplifier.
Alain
Hi jazbo,
Yes, that should work, thanks.
This should also work:
IF(V(x)<0, 0, V(x))
reads: IF Vx<0, THEN Value=0, ELSE Value=Vx
Try also MAX(V(x),0)
Return the maximum, V(x) or 0 ...
And if x is negative MIN(V(x),0)
Here are the 3 csv files I tried uploading before. This is detailed data extraction of the GE 12AX7 Plate curves.
This is the best 12AX7 model I have, made by Wayne Clay using the Adrei Frolov curve captor :
.SUBCKT 12AX7A P G K
* Made by Wayne Clay using the Adrei Frolov curve captor from a unknown datasheet
* Spice 3F4 model - Rydel 5 parameters - mean fit error 0.0364781mA
Bp P K I=((0.001162961073m)+(0.0001179305949m)*V(G,K))*uramp((89.27317344)*V(G,K)+V(P,K)+(50.06656412))^1.5*V(P,K)/(V(P,K)+(1.191219264))
Cgk G K 1.6p
Cgp G P 1.6p
Cpk P K 0.33p
RCP P K 1G
.ENDS
I generate the curves with my SiMetrix simulator and fit them on the GE graph :
An externally hosted image should be here but it was not working when we last tested it.
It almost fit like a glove on a hand, specially in the most useful area, the bottom left corner ...
I always do that when I use a new model for my simulations.
Last edited:
Hi everybody !
Did somebody have a 6HS8 model ?
I also look for a 6J6A model ?
Alain
6HS8 is indeed a bizarre tube, good luck finding or making a model for it...
Here is a model for the 6J6, I think made by Stephie Bench:
Code:
.subckt 6J6 1 2 3
+ params: mu=38.9 ex=1.484 kg1=780 kp=162 kvb=1176 rgi=2000 vct=.384
+ ccg=2.6p cgp=1.5p ccp=1.6p
e1 7 0 value=
+{v(1,3)/kp*log(1+exp(kp*(1/mu+v(5,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 5 6 {rgi}
v1 5 2 {vct}
d3 6 3 dx
.model dx d(is=1n rs=1 cjo=1pf tt=1n)
.ends
Try also MAX(V(x),0)
Return the maximum, V(x) or 0 ...
I like it. Thanks.
This is the best 12AX7 model I have, made by Wayne Clay using the Adrei Frolov curve captor :
.SUBCKT 12AX7A P G K
* Made by Wayne Clay using the Adrei Frolov curve captor from a unknown datasheet
* Spice 3F4 model - Rydel 5 parameters - mean fit error 0.0364781mA
Bp P K I=((0.001162961073m)+(0.0001179305949m)*V(G,K))*ur amp((89.27317344)*V(G,K)+V(P,K)+(50.06656412))^1.5 *V(P,K)/(V(P,K)+(1.191219264))
Cgk G K 1.6p
Cgp G P 1.6p
Cpk P K 0.33p
RCP P K 1G
.ENDS
LTspice works with this model as long as you change "ur amp" to "uramp" and the ^ character to **.
- Home
- Amplifiers
- Tubes / Valves
- Vacuum Tube SPICE Models