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

Vacuum tube modeling software - beta testers wanted

Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.
:bigeyes: A lot of bloodshed here too....

child killed: illegal instruction
child killed: illegal instruction
while executing
"exec $backend -$type -m << [$t get 0.0 end]"
(procedure "model" line 9)
invoked from within
"model $wd.text"
invoked from within
".n.f1.buttons.model invoke"
("uplevel" body line 1)
invoked from within
"uplevel #0 [list $w invoke]"
(procedure "tk::ButtonUp" line 24)
invoked from within
"tk::ButtonUp .n.f1.buttons.model"
(command bound to event)


error I got when using 6SN7.dat to build a model.
PC is a Pentium III running Windows 2000 Pro.
 
new version of Curvecaptor for WinXP

Hola a todos,

Andrei is travelling now and he can't login to Diyaudio Forum, so he asked me if I would tell you a link to a new version of Curvecaptor suitable for testing under Win_XP plattforms.


Lasts results are Ok when running under these conditions:

- Win XP Professional - SP2
- AMD Athlon XP 2000+ Processor

Download Curvecaptor from:

http://sourceforge.net/projects/curvecaptor/

Saludos,

Luis Cardaba.
 
it works now!

The latest version works well. My machine is a Pentium III running Windows 2000 Pro. Below are a few models I did with the new version today (a few low B+ voltage tubes for people who haven't gotten used to high voltage just yet):

These I did using AF's software
**********************************

* 12u7 Spice 3F4 model low voltage space charge dual triode
.SUBCKT X12u7 P G K

Bp P K I=(0.001972003403e-3)*uramp(V(P,K)*ln(1.0+(0.001530503245)+exp((0.03859673121)+(0.03859673121)*((564.8225939)+(-114911.4871e-3)*V(G,K))*V(G,K)/sqrt((15.44447752)^2+(V(P,K)-(8.343447975))^2)))/(0.03859673121))^(1.148627719)

CPK P K 0.0000000000004

CGK G K 0.0000000000016

CGP G P 0.0000000000015

.ends X12u7

********************************************************************************
* below is a 12AX7 style triode running on 80% of its normal heater voltage, improves linearity. The 12AV6, ignoring its diodes, is half a 12AX7.

* 12av6-10vh Spice 3F4 model
.SUBCKT X12av6-10vh P G K
Bp P K I=(0.008002535364e-3)*uramp(V(P,K)*ln(1.0+(0.1781769699)+exp((4.808478051)+(4.808478051)*((80.28638516)+(-6220.101955e-3)*V(G,K))*V(G,K)/sqrt((71.2061203)^2+(V(P,K)-(51.18537952))^2)))/(4.808478051))^(1.174758456)

Cgk G K 2.2P
Cgp G P 2P
Cpk P K 0.8P

.ends X12av6-10vh

************************************************************************************
*Below is a detector diode running on 2/3 normal heater voltage, improves detector performance.

* 5896 4v on 6.3 heater not valid over 30ma; with contact potential
.SUBCKT X5896-4hv P K
Bp P K I=(1.259102866e-3)*uramp(V(P,K)+(0.6788214279))^1.5
.ends X5896-4hv

**********************************************************************************

* 12FM6 Space charge low voltage triode
.SUBCKT X12FM6 P G K
Bp P K I=(0.001097962853e-3)*uramp(V(P,K)*ln(1.0+(0.06123349699)+exp((0.02161200134)+(0.02161200134)*((23.7503614)+(-156710.2813e-3)*V(G,K))*V(G,K)/sqrt((-6.356755714)^2+(V(P,K)-(6.569413423))^2)))/(0.02161200134))^(1.51472413)

CPK P K 0.0000000000004

CGK G K 0.0000000000016

CGP G P 0.0000000000017

.ends X12FM6

*********************************************************************************

My Circuitmaker 3F4 spice simulator turns out to be okay with "exp" but barfs
on "m" and "k" at the end of numbers. I sub "e-3" and "e3"
respectively and it works. Also Circuitmaker barfs on N^X when X is less than 1. Doing 1.5453^0.6 makes it barf, but a work around
that does work is to do sqrt(1.5453^1.2). This reminds me of why
software writing aloways drove me nuts; stupid stuff like this!
 
Well, I'm back...

First of all, sorry for the mix-up with Windows binaries, Pentium 4-specific optimization was applied generating instruction set missing on other processors.

The next version (0.9.1) is in the works. It will remove limitations of Windows port (disabled distortion analysis) and add support for user Spice dialect selection (3F4, PSpice, and LTSpice so far). If you want your favourite Spice included, email me with the description of the syntax it uses.

Tetrode/pentode support is possible, but I have not seen many models around - only the simple ones. Might be a bit of try-and-fail work to get the model that is flexible enough to fit well. I am postponing this until after 1.0 release is out.
 
Pentode models

Hi Andrei,

I used the Koren pentode model with mixed results. The fitting is tricky and I couldn't get it to cenverge very well (I used Matlab fsolve).

Did you explored other models? If so, are they online somewhere, or published? I'd like to know if there is something.

Cheers,


Rada
 
Andrei,
Thanks so much for the software. I have been using Teodoro Marinucci's excel sheet to create models (appears to be gone now:( ), yours looks to have great potential. I look forward to your LTspice output code.

I really like how Teodoro breaks out the parameters/values from the equation as this makes it easy to tweak (trial and error) to get as close as possible in LTspice. -If your LTspice output can be done this way, it would be really helpful for me.

example:


*Attempt by Luap at a 12u7 using koren calq
*
.SUBCKT 12u7kor 1 2 3 ; P G C;
+ PARAMS: MU=21.95 EX=1.1 KG1=1082.66 KP=68.5 KVB=490.4 RGI=1000
+ CCG=2.3P CGP=2.2P CCP=.9P ; ADD .7PF TO ADJACENT PINS; .5 TO OTHERS.

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 ; TO AVOID FLOATING NODES IN MU-FOLLOWER
C1 2 3 {CCG} ; CATHODE-GRID; WAS 1.6P
C2 2 1 {CGP} ; GRID-PLATE; WAS 1.5P
C3 1 3 {CCP} ; CATHODE-PLATE; WAS 0.5P
D3 5 3 DX ; FOR GRID CURRENT
R1 2 5 {RGI} ; FOR GRID CURRENT
.MODEL DX D(IS=1N RS=1 CJO=10PF TT=1N)
.ENDS
*


I would be glad to make some suggestions when you are ready (I assume it's a bit early) ...just let me know.

Luap
 
Luap said:
Andrei,
Thanks so much for the software. I have been using Teodoro Marinucci's excel sheet to create models (appears to be gone now:( ), yours looks to have great potential. I look forward to your LTspice output code.


Luap


Hi Luap,


Have you Teodoro Marinucci Excel sheet?

I would like to download it, because Marinucci's web is shut down.

Regards.
 
As far as I know, PARAMS construct is PSpice-specific, and is absent in standard Spice 3F4. I am not sure about LTSpice (Linear Technology SwitcherCAD) - I'll double check the docs. As for tweaking by hand, it is easy to do with Curve Captor - the model parameters string in Device Model tab is editable. Just change the parameter values and hit Redraw button to see the adjusted curves. Getting a better fit than the optimizer might be hard, though...

I have not worked on pentode models yet, so I don't have anything to say about that for now...

Also, to be a proper Windows program, you have to have an icon :). Check out the new spiffy graphics I've done. Flames and suggestions welcome...
 

Attachments

  • tubefit.png
    tubefit.png
    9.7 KB · Views: 1,278
Yeah, they are Pspice models, LTspice is compatible with pspice models, but gives errors on curly brackets etc(probably why I have to tweak them) . One of the things nice about your program is it displays the curves, Teodoro's just generates the params from the capture, then I plug them into LTspice and create my own tube chart. I use Photoshop to do overlays of the spice model with the bogey chart to refine the model.

I don't trust my model until I get a reasonable fit, using this method. I guess if your tool will make the model without the need to tweak, then the Params layout wouldn't be needed.

-Luis,
send me an email with "TM-spicefiles" as the subject

luapacoli (at) mindless (dot) com

Luap
 

Attachments

  • 6sj7_chart_koren.jpg
    6sj7_chart_koren.jpg
    74.4 KB · Views: 1,320
This is so cool...

Andrei,

I just did my first model with your software, and I'm impressed. It's so easy to work with and the results seem to be pretty accurate. Thanks for putting this together and making it available.

I noticed that tubefit does seem to offer a type "4" and "5". Is there any code behind these options? Can I create models for pentodes?

Thanks again for your work,

Karl Heinz
 
Spice dialect selector has been added

That is a nice feature, though Circuitmaker (at least the version I have) still barfs on values lower than 1.0 for ^. If you try to do (somenumber)^(0.654) it barfs. A work around is to double the 0.654 and then take the square root. Or square root of the square root if it was between 0.25 and 0.499999 (PITA but software tends to be like that :) )

I used your program to create a spice model of a space charge tetrode, the 12K5. This was a tube that used a B+ of 12.6V and used in old car radios as an audio driver. Its G1 was connected to B+ to draw current off the cathode and to create a "space charge" to give the electrons enough oomph to want to head to a plate with 12V on it. "S" in the model. G2 is the control grid ("G" in the model). The voltage on G1 pretty much is a linear function as to how much current the cathode will give off, and I multiplied it by some constant to model different voltages applied to G1. Also G1 has current on it, more or less linear.

Here's a space charge tetrode. G1 is the space charge grid, g2 is control grid:

* 12k5 space charge grid tetrode control grid is G2, G1 is space charger
.SUBCKT X12k5 P G S K
Bp P K I=(V(S,K)/12.6)*(7.558351405e-3)*sqrt(uramp(V(P,K)*((ln(1.0+(-0.006442986038)+exp((1.176225304)+(1.176225304)*((11.74977827)+(-2149.490118e-3)*V(G,K))*V(G,K)/sqrt((0.4617143016)^2+(V(P,K)-(-0.302112214))^2)))/(1.176225304))^(1.0))))

Bs S K I=0.69E-2*V(S,K)

.ends X12k5

This tube might work as a headphone amp.
 
WoW!!

Andrei,
Thanks for getting the Pspice and LTspice support up so quick!
The curves draw up real nice within curve captor, but the first few times in LTspice I got bad results checked the error log ran the schematic again and ...bang-boom dead-on results!

(I'm not really sure why my first test were so wrong, same models, same schematic? just win98 doing its thing, probably)

Anyway ...You're my hero!

Thanks again,
Luap
 

Attachments

  • 12u7overlay_chart.gif
    12u7overlay_chart.gif
    53.7 KB · Views: 1,269
andrei said:
I am a bit confused though, as according to the CircuitMaker reference, this should not be happening.

Circuit Maker has a few bugs and instabilities the Altium really doesn't care about and have no intentions of fixing (that's what they told me). They tend to be front-end related, hence part of the proprietary code and you can do squat about it :mad:
 
Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.