• 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

Hi,

I am looking for a few people to beta-test the vacuum tube modeling software I wrote (for my own use), to iron out bugs before I do a public code release. Basically, it can build Spice-compatible models and do simple bias point/signal analysis calculations from the traced tube data (either from datasheet curves or obtained elsewhere). See attached screenshots for examples...

It is developed on Unix platform, but as it is written in Tcl/C should be portable to Windows (any takers?). Documentation is non-existant at the moment.

If interested, email me at [email protected]. Replies might be slow (sorry...).
 

Attachments

  • loadline.png
    loadline.png
    32.9 KB · Views: 4,604
It requires Tcl/Tk for GUI, m4 for macro processing, standard C compiler (tested with gcc and icc), and FFTW libraries for distortion analysis (www.fftw.org). All of these are available on many Unix clones...

Models are macro-based and can be easily adopted to your favourite flavour of Spice. You do not need Spice installed to run Curvecaptor - it has simple waveform analysis build in (at much better precision, too :)).

For the impatient: I am attaching the Spice libraries for a few of my favourite tubes build from datasheets I traced. (If you electricute yourself using these - don't complain.)
 

Attachments

  • tubelib.zip
    25.7 KB · Views: 897
Tube models

Hi Andrei,

Looks like a great job! I wouldn't know how to port it into PC, otherwise I would be happy to test.

I did my own software using Matlab to model tubes and calculate SET input and output stages in real time while dragging the loadline all over the graph. I used the regular Koren's model, I found however, that in some cases the model collapses and the best parameters give out real and imaginary components when plugged into the equation to model the curves. It doesn't happen with all triodes, but some. Using only the real part of the answer give a good approximation, but some anomalies happen at the bottom of the curves (not of much importance as I would never operate tubes there).

You used an 8 parameter model. I wondered if you modified Koren's model to solve similar anomalies of the model with some tubes. If that's the case, could you comment on the additional parameters and pass along the model?

Thanks,

Rada

PS: I found that Engauge Digitizer (from SourceForge) does a great job fo digitizing the curves in a semi-automated fashion.

PSII: Feel free to e-mail at [email protected] if you consider this deviates from the objective of the original post.
 
andrei said:
It requires Tcl/Tk for GUI, m4 for macro processing, standard C compiler (tested with gcc and icc), and FFTW libraries for distortion analysis (www.fftw.org). All of these are available on many Unix clones...

Andrei sent me files for curvetracer... now i just need to figure how to compile (OS X) & ensure that my X11 has the right libraries....

dave
 
Yes, original 5-parameter Koren model
Code:
Ip = K * [Vp * log(1.0 + exp(Kp + Kp*mu*Vg/sqrt(1000.0*Kv + Vp*Vp)))/Kp]^gamma
sometimes runs into trouble because of the square root term. Actually, most improvement to fits in Koren model comes from the Kp parameter, which can model remote cutoff in triodes quite well. Dropping the square root gives the simpler 4-parameter model,
Code:
Ip = K * [Vp * log(1.0 + exp(Kp + Kp*mu*Vg/Vp))/Kp]^gamma
which is almost as good as the original, but more robust. Just adding more parameters will not necessary make the model better. I spent a fair amount of time trying various functional forms and trying to find degrees of freedom which will help to fit "difficult" tubes. The model that performs best overall adds four parameters to 4-parameter Koren model above
Code:
Ip = K * [Vp * log(1.0 + Kc + exp(Kp + Kp*(mu+nu*Vg/1000.0)*Vg/sqrt(Kv*Kv+(Vp-Vc)*(Vp-Vc))))/Kp]^gamma
Depending on a tube, the fit might be improved by a factor of two, or hardly at all.

4-parameter Koren model is probably good enough for calculating working point and signal amplitudes. The reason for more complex models is to try to get the distortion analysis right. Simple models give unrealistically small distortion figures.

In Curvecaptor, you can choose the model from a menu and see the differences in fits.
 
Tried the models in tubelib.zip and they mostly work well. My spice program Circuitmaker barfed on "exp" and the m and k after a string of numbers. It did work when I replaced "exp" with 2.818^" (am I correct that I want "e to the X" here? as I saw "ln" which I think means "log to e" instead of "log of 10".) Oh, my spice program didn't barf on "ln". Also had to repplace "m" with "e-3" and "k" with "e3".

That's one thing I've hated about software writing is the stupid compilers barfing on syntax. And different compilers want differing syntaxes and I can never remember which wants what. :bawling:

it can build Spice-compatible models

If you or someone else can make a version that can run on a windows PC I'd love to get a copy. (Yes I realize some hate windoze but that's what I got here. I'm a "luser", ie, just a program user and not a software pro.) :D
 
andrei said:
BTW, I just checked that the Curve Captor GUI basically runs under Windows XP (there are a few glitches that I will have to take care of), so Windows binary release might be feasible. I have also tested it on Sun workstations running Solaris.


Hola a todos. Andrei,

Your Curve Captor seems very interesting for me.

I have run your models in pspice (orcad / microsim) and some parameters are unknown (uramp).

I am another user of windoze...

Hasta luego.
 
By popular demand, Windows version is now available :). You will need to install Tcl/Tk first. Download it from ActiveState website. It is nicely packaged and has all the documentation included. Then download the Curve Captor WinXP binary distribution here. I have included m4 binary, so you don't need to download anything else. No fancy installer yet - just unzip somewhere and start curvecaptor binary.

I am attaching 6SN7 data files to play around with. Try opening 6SN7.dat first and generate a model. If you want to see how the traced curves look, open 6SN7.gif and load markers from 6SN7.crv

This is the first Windows port I've done - there might be bugs. Email me if there is trouble.
 

Attachments

  • 6sn7.zip
    38.8 KB · Views: 359
Oh yes, PSpice syntax is incompatible with the standard 3F4. Since the models are macro based, it is simple to change the syntax. I am not using PSpice myself, so this has been low priority for me. I'll make a PSpice version once I get a hold of PSpice reference manual. In the future release, I'll probably add a Spice dialect selector dialog...
 
errors in tcl

Hi Andrei,

When I push button "Build Model" an error message is shown:

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)


Regards.