• 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.
I have tried several times to get curve captor working on my Linux box without success. The Tcl part is no problem. My main problem is compiling the tubefit.c prog.

Any tips for getting this going?

Cheers

Ian
Oh, you give me a good indication there ...

The 3 files I download have no extentions ... I discover accidentally I have to add the ".tlc" extention to the "curvecaptor" file or the "ActiveState ActiveTcl" don't find it ... It was in the windows XP file association list ...

I was trying to make my first Spice model for a 6DJ8, I put the X and Y axis "markers" on, then a lot of "x" on the curves and I save them and load them back with no problems.

But when I get to the "Capture Curve" step, there was a bug, I get this message :

An externally hosted image should be here but it was not working when we last tested it.


Maybe, it is just because the "tubefit" file have no ".c" extension ... :confused:

I will try that and come back with the results ...

Alain. :)
 
Hi ,
I have downloaded the CurveCaptor 0.9.1 an then installed it, but after excecuting the command m4.exe, appears a DOS windows.... Now What ??
Could anybody say me where to find some basic "How to Use" guide, please ?
I have seen the trhead, but I can not found information about that.
Many thanks in advance.
The "models.m4" is not an executable file, it is just a "macros" file ...

To have the "CurveCaptor" program running, I have to add the ".tcl" extention to is file or nothing happen ... But I still have a bug when get to the "Capture Curve" step, maybe a file opening problem ...

Of course, you have to download and install the ActiveState ActiveTcl software first ...

Cheers,

Alain. :)
 
Last edited:
Here's the details of the error I get ...

An externally hosted image should be here but it was not working when we last tested it.


I use Windows XP service pack 2 ... Intel Pentium III 547 MHz ...

Anybody have an idea why it don't work on my computer ?

Cheers,

Alain. :)


Hi Alain,
Which version of curvecaptor are you using? There is a precompiled Windows version available at sourceforge (curvecaptor-0.9.1-winxp.zip). Its sounds like you are trying to use the source code only version (curvecaptor-0.9.1.tar.gz). The source code version needs to be compiled and is primarily meant for Linux.

Curve Captor - Browse /curvecaptor/0.9.1 at SourceForge.net

~Mike
 
I have tried several times to get curve captor working on my Linux box without success. The Tcl part is no problem. My main problem is compiling the tubefit.c prog.

Any tips for getting this going?

Cheers

Ian

Hi Ian,
You need the GCC compiler collection and MAKE installed to compile tubefit.c. Are you getting a error when you try to compile it? What flavor of Linux are you using?
I use Debian. If you're using Deb or one of its derivatives (like Ubuntu) I can email you a compiled tubefit executable to try.

~Mike
 
There was 3 files zipped, the "curvecaptor" file codes really all look like C but I think Tcl is some kind of C ... I can read it all with any text editor but the Crimson editor I download yesterday is very good, all the different kinds of code have different colors.

The "models.m4" file is a "macros" file used by the compiler or interpretor and the "tubefit" file just look as a binary datafile ...

I will have to study a little bit the Tcl language to understand all the codes, it is slightly different from the old C and C++ I use to work with,

TCL is not based on C at all. It is much more like a shell script. But as you say all programming languages share common concepts and mostly differ in syntax.

M4 is a text based macro language, not binary. Although it may be so "dense" that you don't make sense of it. One can write readable M4 but not all of it is.
M4 is not a sequence of steps. It is more like algebra then programming. The idea is that you make a series of substitutions and transformations, M4 is the rules for doing so.
Part of the readability problem with the M4 is that it is generating Spice models which themselves are quite cryptic. Generalized macros of spice might appear "double cryptic" or maybe "cryptic squared"? But make sense if you know both Spice and M4.
See here for more info
http://en.wikipedia.org/wiki/M4_(computer_language)
 
I have tried several times to get curve captor working on my Linux box without success. The Tcl part is no problem. My main problem is compiling the tubefit.c prog.

Would help a lot of you post the output from the C compiler where it prints the error. Is there a "Makefile" in there? (sorry I forget) If so edit to suit then type "make". If not then type"gcc tubefit.c -o tubefit" and see what happens. Either it works or you are missing some files on which tubefit.c depends.

Just cut and past any errors here.

Once enough people learn how to use this we should make an effort to create spice models for the 100 or so most used tubes
 
Hi Ian,
You need the GCC compiler collection and MAKE installed to compile tubefit.c. Are you getting a error when you try to compile it? What flavor of Linux are you using?
I use Debian. If you're using Deb or one of its derivatives (like Ubuntu) I can email you a compiled tubefit executable to try.

~Mike

I tried compiling this a long while ago and got all sorts of errors I could not fix. Now I am using 64 bit Ubuntu which is itself the first problem because make install gives me this:

Code:
ian@ian-desktop:/media/380C-0210/CTC/pdf/tube_data/curvecaptor/prog$ make install tubefit.c
gcc -O3 -march=i386 -mcpu=pentium4 -DHAVE_GETLINE -DVERSION='"0.9.1"' -DDATADIR='"/usr/local/share/valves"'  -c tubefit.c -o tubefit.o
`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.
tubefit.c:1: error: CPU you selected does not support x86-64 instruction set
tubefit.c:1: error: CPU you selected does not support x86-64 instruction set
make: *** [tubefit.o] Error 1

So first step is to flag 64 bit to make.

Cheers

Ian
 
Would help a lot of you post the output from the C compiler where it prints the error. Is there a "Makefile" in there? (sorry I forget) If so edit to suit then type "make". If not then type"gcc tubefit.c -o tubefit" and see what happens. Either it works or you are missing some files on which tubefit.c depends.

Just cut and past any errors here.

Once enough people learn how to use this we should make an effort to create spice models for the 100 or so most used tubes

I sorted the 64 bit flag b ut now I get the following error when doing make install

Code:
ian@ian-desktop:/media/380C-0210/CTC/pdf/tube_data/curvecaptor/prog$ make install tubefit.c
gcc -O3 -DHAVE_GETLINE -DVERSION='"0.9.1"' -DDATADIR='"/usr/local/share/valves"'  -c tubefit.c -o tubefit.o
tubefit.c: In function ‘matrix’:
tubefit.c:240: error: lvalue required as increment operand
tubefit.c: In function ‘grow_matrix’:
tubefit.c:251: error: lvalue required as decrement operand
tubefit.c:257: error: lvalue required as increment operand
make: *** [tubefit.o] Error 1


Cheers

Ian
 
tubefit.c: In function ‘matrix’:
tubefit.c:240: error: lvalue required as increment operand
tubefit.c: In function ‘grow_matrix’:
tubefit.c:251: error: lvalue required as decrement operand
tubefit.c:257: error: lvalue required as increment operand

This code is old and the guy who wrote it is long gone. Look at lines 240, 251 and 257.

I looked but can't fix it now. It's some poorly written overly complex junk. All the author is doing is computing how much space to allocate and he uses an expression that is not quite correct and the newer C compilers are more strict about this. I figure I just re-write the function. He is building a vector of pointers to vectors making a kind of square matrix but it is not written clearly enough. He is trying for some reason to do 8 things on one line of code. No reason for that.

The same problem in all three places

Just get rid of those -m.. compiler flags. The defaults work fine.
 
This code is old and the guy who wrote it is long gone. Look at lines 240, 251 and 257.

I looked but can't fix it now. It's some poorly written overly complex junk. All the author is doing is computing how much space to allocate and he uses an expression that is not quite correct and the newer C compilers are more strict about this. I figure I just re-write the function. He is building a vector of pointers to vectors making a kind of square matrix but it is not written clearly enough. He is trying for some reason to do 8 things on one line of code. No reason for that.

The same problem in all three places

Just get rid of those -m.. compiler flags. The defaults work fine.

The code is definitely obscure:

Code:
*(((unsigned long *)(m))++) = nr;

I am no C guru but I read this as:

set the contents of the address pointed to by m equal to nr then increment - I am not sure if m or the contents it points to get incremented but I think it is m.

So could we replace this by:

*((unsigned long *)(m)) = nr; m++;

Cheers

Ian
 
I used to suggest that too. But now I see that not everyone can afford a $600 computer ($600 is the current cost of a Mac Mini at Apple stores) . Especially when computers sell at Wallmart for half that price. I still do suggest it to anyone who can afford $600.

(BTW, it's "Mac" not "MAC")
I paid my "used" computer 200$ 8 years ago in a Montreal "flea market" ...

For that price, I get the tower with modem and sound card and also a 16" Hewlett Packard monitor ... And I paid only 20$ by month for my 49,296 bps Internet ... I am very happy with all this outfit ... :)

I found my EPSON EPL-6200 laser printer in the garbage and it is almost like new ... The only thing is it was working on 250VAC 50Hz, the neighbours who have it before just come from France and don't know how to use it in Canada since we run on 120VAC 60Hz ... So they put it on the sidewalk ... I first plug it to the stove 240V plug and it work very well, then I found a huge 120 / 240V step-up auto-transformer in my "junkbox" and use it for the printer since that time and everything work perfectly ...

There is no need to be rich to have a computer, just a bit resourceful ...

Alain. :D
 
Hi Alain,
Which version of curvecaptor are you using? There is a precompiled Windows version available at sourceforge (curvecaptor-0.9.1-winxp.zip). Its sounds like you are trying to use the source code only version (curvecaptor-0.9.1.tar.gz). The source code version needs to be compiled and is primarily meant for Linux.

Curve Captor - Browse /curvecaptor/0.9.1 at SourceForge.net

~Mike
Oh !

That explain everything ...

I just found the right one at : Sourceforge ... curvecaptor-0.9.1-winxp.zip

I will try it later tonight and give you some new's about.

But I will keep the other's files in case I install Linux on my computer, I already make a big space for it on one of my hard-disk drives ... Debian is good ?

Thank you very much.

Alain. :)
 

iko

Ex-Moderator
Joined 2008
FWIW I've been using the windows binary for a long time and built a small library of tube models that I was interested in. However, a note of warning. curvcaptor gives a few different equations on the last modeling page (Rydell, Koren, with different number of parameters). Anything from Koren above 4 parameters did not work correctly for me in ltspice. Might be a numerical problem, I think.
 
TCL is not based on C at all. It is much more like a shell script. But as you say all programming languages share common concepts and mostly differ in syntax.

M4 is a text based macro language, not binary. Although it may be so "dense" that you don't make sense of it. One can write readable M4 but not all of it is.
M4 is not a sequence of steps. It is more like algebra then programming. The idea is that you make a series of substitutions and transformations, M4 is the rules for doing so.
Part of the readability problem with the M4 is that it is generating Spice models which themselves are quite cryptic. Generalized macros of spice might appear "double cryptic" or maybe "cryptic squared"? But make sense if you know both Spice and M4.
See here for more info
http://en.wikipedia.org/wiki/M4_(computer_language)
I will look at that this winter, I like to undestand the Andrei program codes ...

I figure out since a long time some ways for a graphic processing program to automatically read the data of the curves with no need to put many markers on, just one at each corner ot the graphic ... It was for a loadlines interactive drawing program that can calculate everything automatically ...

But the Andrei program show me it is possible to make Spice models from curves too but I am not familiar with the maths involve to do that ...

I try only the bad version of the program but I find out there was no "undo" button ... So it is better not to make a mistake or all the markers have to be put on again ... It is a difficult task because there is no zoom or magnifier window ...

I have to experiment with it but I think there is no need to put a lots of marker on the X and Y axis, or there will be a pixel accuracy error ... Many time, there is only 4 or 5 pixels for each small grid, a maximum of 10 ... Those pixels round off the voltages and currents.

I also think it is important to put more "x" markers on the parts of the curves really curved and less in the straight parts ... But I will verify all that on my first tests, when I will be able to have the program running properly ...

I think the 6DJ8 model is hard to do, the curves of this tube are not very regulars ... The best model I found up to now is from Norman Koren but it is not perfect ...

Cheer,

Alain. :)
 
FWIW I've been using the windows binary for a long time and built a small library of tube models that I was interested in. However, a note of warning. curvcaptor gives a few different equations on the last modeling page (Rydell, Koren, with different number of parameters). Anything from Koren above 4 parameters did not work correctly for me in ltspice. Might be a numerical problem, I think.
I use a SIMetrix Spice simulator ... It is totally free, very easy to use and very powerful ... I can draw and simulate any schematics in minutes with this software, even the biggest ones. It really make a lot of kind of graphics, calculate distortion with Fourrier analysis, make frequency response curves, show all DC and AC currents and voltages curves or waves using probes, show the idle currents, voltages and dissipation of all the parts in a separate window, make "Monte Carlo" and multi-step analysis, and a lot more ... A really good and complete software I tell you, the best in the world I believe ... Beside that, ltspice is just a toy for kids ...

All the kinds of Spice models work with this software, I try yesterday some of the Andrei 8 parameters Koren models and it work very well, those Andrei models are almost perfects ... I can make back the triodes curves with SIMetrix with a very simple circuit and compare them point to point with the originals datasheets curves ...

The only thing to do is draw the tubes symbols yourself and add them to your own symbols library and associate the Spice models to them, but that is very easy to do, this software is really friendly user.

Cheers,

Alain. ;)
 
Hi Alain,
Which version of curvecaptor are you using? There is a precompiled Windows version available at sourceforge (curvecaptor-0.9.1-winxp.zip). Its sounds like you are trying to use the source code only version (curvecaptor-0.9.1.tar.gz). The source code version needs to be compiled and is primarily meant for Linux.
Fantastic ... Everything work perfectly now ... Thank you again !

I just make my first test, a Koren 8 parameters 6DJ8 model with not many markers. Then I load the model in my simulator and make back the curves to compare with the original ones. The loop is looped ...

I verify every curves at 25, 10, 5 and 0 ma and they where all less than 2V off except at four places, on the - 4V curve at 10ma , the point was at 161,5V instead of 165V, on the - 7V curve at 20ma, the point was at 290,5V instead of 282,5V and at 0ma the -1V curve was at 0V instead of 20V and the -2V curve at 49V instead of 52V ... But I think this is normal ...

The original Sylvania curves with the markers :

An externally hosted image should be here but it was not working when we last tested it.


I think it is easy when looking at this graphic to understand why the - 4V 10ma point was 3,5V off and the - 7V 20ma point was 8V off and all the other points at less then 2V off, most of them exactly on ...

The curves I make with my SIMetrix simulator and the Spice model I get from CurveCaptor :

An externally hosted image should be here but it was not working when we last tested it.


Now there are the models themself :
* 6DJ8 Sylvania macro model
.subckt 6DJ8 P G K
koren8(0.1376655926,-0.3258862304,7.232061705,33.07942083,315.1561919,40.25478086,8.515934564,1.204803474)
.ends 6DJ8 Sylvania

* 6DJ8 Sylvania Spice 3F4 model
.subckt 6DJ8 P G K
Bp P K I=(0.1376655926m)*uramp(V(P,K)*ln(1.0+(-0.3258862304)+exp((7.232061705)+(7.232061705)*((33.07942083)+(315.1561919m)*V(G,K))*V(G,K)/sqrt((40.25478086)^2+(V(P,K)-(8.515934564))^2)))/(7.232061705))^(1.204803474)
.ends 6DJ8 Sylvania
I will make other tests this coming weekend with the same caracteristic curves to see how I can do better ...

I will try with just a marker at each extremity of the X and Y axis and a lot more markers on the curves ... I think the Andrei program can evaluate very well the X and Y grid positions mathematically by itself, avoiding the pixels round off errors ...

One thing I like very much with this program is the possibility to load the curves markers positions from another source and let the Andrei program take care of the models calculations ... That is exactly what I need for some future projects ...

Bravo to Andrei ! :cheers:
Alain.
 
Last edited:
Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.