¿ªÔÆÌåÓý

introduction of a new vacuum tube spice model approach


 

Hello World

I'm proud to introduce a set of?new spice model approaches for vacuum tubes.

They represent the merge of the very best apporaches found in the web.

Benefits of this 2-year-project:

1) My vacuum diode model considers the initial velocity effect, with smooth transistion to the Langmuir Child's law.

2) My triode model containes this new vacuum diode apporach for modeling the grid current. The Grid current is on a new accuracy level.

2) My tetrode/pentode model is an enhancement of my new triode model. Hence, it also delivers correct currents when connected as triodes.

Up to now, I have fitted 6 triodes to measured data:


Any feedback comments?/ improvement proposals?are welcome!

kind regards, Adrian Immler


 

Gruesse Adrian,

Wenn ich die Zeit kreigen, werde ich deine modellen ausprobieren und an dich feedback zurueck geben.? Vorsicht, es koente eine Weile dauern.


 

Hallo analogspiceman

Danke schon jetzt im Voraus f¨¹r dein Ausprobieren und dein Feedback - das ist wertvoll f¨¹r mich.

Lieber Gruss, Adrian


 

Hello Adrian,

Your model contains an interesting function that you describe as "min-function, but with smooth transitions."

.func smin(x,y,k) {pow(pow(x+1f, -k)+pow(y+1f, -k), -1/k)}

The parameter k controls how gradual (smooth) the transitions are between the two inputs.? The larger the parameter k is, the tighter will be the transition between the two inputs.? You suggest k=8 as a typical value.

Also, the function clearly is intended for only positive inputs (the output for negative inputs is nonsensical).

LTspice includes a relatively new min function to provide smooth transitions between the inputs called uplim:

uplim(x,y,z) "Similar to min(x,y) but with a continuous first derivative transition width z."

This function is intended to be an improved min function in that it avoids convergence problems because it is continuous with a continuous first derivative.? Unfortunately, it works differently than your smin function so that a simple substitution would give different results.? However, a new smin function can be created to use uplim.

.func smin(x,y,k) {uplim(x,y,min(x,y)*1.8/k}

This version of smin runs noticeably faster and works with negative inputs.

Regards -- a.s.


 

Hello again Adrian,

I just read through your paper.? When I attempted to access it at work (Win 7), my browser (latest 64 bit Firefox) warned me that the link was dangerous and would not let me view it.? However, when I tried just now at home (Win 10 Pro) with the same browser, it worked fine and I finally got to see your paper.? Until now, I could only examine the generic triode model on your homepage.

I commend you on your outstanding work in analyzing the history of triode models and in the models themselves both from the perspective of performance and of basic physics.? Well done.? I would recommend that you solicit volunteers to review your paper and models for English writing errors, for suitability to LTspice and for technical content.

So far, I like what I see, although it will take some days (probably spread over weeks due to work and other conflicts) to fully digest it all to my satisfaction.? You have created a reasonably LTspice-friendly model and have correctly created internal electrode reference nodes (the voltage sources) that are then used by the output current sources - excellent approach!

I haven't fully checked the voltage b-sources, but please be cautioned that they should be carefully written to be continuous in both value and derivative.? To do otherwise invites convergence problems (this is not so important for the current b-sources because the shunt capacitances will dominate and linearize them as the time step is reduced during transient convergence troubles).

Many years ago I had the opportunity to live and work in Switzerland and was sad to come back home after only three years (my wife thought our children, who we put in the local schools - were becoming too Swiss and she worried about her mother as well).? We have been back to visit again, of course.? It is much like my home (except we have the sea) and I sometimes regret not having had the chance to become a citizen (if my family were willing).

I very much liked your closing paragraph in your paper, both for your acknowledgement of your wife and of the Almighty.

Regards - a.s.


 

Hi analogspiceman


Thanks for yout tip!

I did not know this LTspice uplim function. When I will have time, I will try this function how suitable it is for use in triode models.


kind regards, Adrian Immler


 

Hi analogspiceman


Thanks for your detailed feedback!


Oh yes, my english is not my strength - and I first intended to let my paper check by others, but then I decided to let this be. I want to be authentic, with strengths and weaks, no need for polishing ;-).


The warnings have to do with the dropbox where I have deposited my paper and the triode spice models. Unfortunately, simplesite does not provide a means for depositing files in the cost-free basic setup.


Kind regards and be blessed, Adrian Immler


 

I think they are done like:

.func limit(x, l, u)???? min(max(x, l), u)? ; == min(max(l, x), u) == limit(l, x, u)

.func dnlim(x, l, z)???? if(x-l-z < 0, l + z*exp((x-l-z)/z), x)? ; == max(x, l) if z == 0
.func uplim(x, u, z)???? if(u-x-z < 0, u - z*exp((u-x-z)/z), x)? ; == min(x, u) if z == 0

.func dulim(x, l, u, z)? uplim(dnlim(x, l, z), u, z)


---In LTspice@..., <analogspiceman@...> wrote :

Hello Adrian,

Your model contains an interesting function that you describe as "min-function, but with smooth transitions."

.func smin(x,y,k) {pow(pow(x+1f, -k)+pow(y+1f, -k), -1/k)}

The parameter k controls how gradual (smooth) the transitions are between the two inputs.? The larger the parameter k is, the tighter will be the transition between the two inputs.? You suggest k=8 as a typical value.

Also, the function clearly is intended for only positive inputs (the output for negative inputs is nonsensical).

LTspice includes a relatively new min function to provide smooth transitions between the inputs called uplim:

uplim(x,y,z) "Similar to min(x,y) but with a continuous first derivative transition width z."

This function is intended to be an improved min function in that it avoids convergence problems because it is continuous with a continuous first derivative.? Unfortunately, it works differently than your smin function so that a simple substitution would give different results.? However, a new smin function can be created to use uplim.

.func smin(x,y,k) {uplim(x,y,min(x,y)*1.8/k}

This version of smin runs noticeably faster and works with negative inputs.

Regards -- a.s.


 

Hi Markus


Thanks for your adice how to build this new LTspice-function in other spice languages!

I made several calculation time comparisons, and it seams that the new uplim function is in average 7% faster than my smin function.

In terms of fit quality, I clearly prefer my smin (blue curve), according to the comparison graphs below (here, k=4).


kind regards, Adrian Immler



 

Adrian,

Please don't attach graphics (or anything else!) to your messages here.

In this case, your graphic image did make it into the message posted on the Yahoo website, but it was not encoded properly for email, so it's missing from your message in my email.? When you wrote "the comparison graphs below", there was nothing below it to see.

Files, images, screen shots, etc. should always be uploaded into the areas meant for them on the group's website.? Image files should be uploaded into the Photos section (), but the Files section might be acceptable for small image files.

Regards,
Andy



 

Adrian,

Looking at your plot (embedded in your message), I'd say that the red curves are a little odd.? I think you're saying that those are the curves from LTspice's uplim/dnlim functions.

Is there something else going on with those curves, or is that shape entirely due to LTspice's uplim/dnlim functions?? It looks like the 2nd derivative wanders back and forth, more than it should (if it should at all).

It's been a few years since I played with the uplim/dnlim functions.? But looking at your curves now, I don't think the red curves look right.? (i.e., maybe it's bad in LTspice, and if so, I wonder if Mike would fix it.)

Andy



 

Andy,

Adrian's smooth-minimum function is defined as follows:

.func smin(x,y,k) = { pow(pow(x+1f, -k)+pow(y+1f, -k), -1/k) }

where both x and y must always be greater than zero.

A very similar function can be made using LTspice's uplim(x,y,z), but the smoothing zone has to depend on the minimum of x and y in order to nearly match Adrian's smin(x,y,k) function.? Also k and z are inverted to each other.

I don't know if Adrian used it, but here is what I came up with as a close match:

.func smin(x,y,k) = { uplim(x,y,min(x,y)*1.8/k }

Earlier in this thread Markus Gyger posted the equivalent of LTspice's uplim function:

.func uplim(x,y,z) = { if(y-x-z < 0, y - z*exp((y-x-z)/z), x) }

I checked and his function seems to be an exact match (thanks Markus - I will put this on the LTwiki).



---In LTspice@..., <ai.egrps@...> wrote :

Adrian,

Looking at your plot (embedded in your message), I'd say that the red curves are a little odd.? I think you're saying that those are the curves from LTspice's uplim/dnlim functions.

Is there something else going on with those curves, or is that shape entirely due to LTspice's uplim/dnlim functions?? It looks like the 2nd derivative wanders back and forth, more than it should (if it should at all).

It's been a few years since I played with the uplim/dnlim functions.? But looking at your curves now, I don't think the red curves look right.? (i.e., maybe it's bad in LTspice, and if so, I wonder if Mike would fix it.)

Andy



 

---In LTspice@..., <analogspiceman@...> wrote :
> .func uplim(x,y,z) = { if(y-x-z < 0, y - z*exp((y-x-z)/z), x) }
>
> I checked and his function seems to be an exact match (thanks Markus - I will put this on the LTwiki).

Thanks, A.S. -- I just wrote it that way so it's simple to put the common sub-expression into a .param or .func. Maybe these look nicer with the docs:

.func dnlim(x, y, z)? if(x-y < z, y + z*exp((x-y-z)/z), x)
.func uplim(x, y, z)? if(y-x < z, y - z*exp((y-x-z)/z), x)


 

Hi Andy

Thanks for your tip regarding graphics - I will consider that in future.
I yesterday compared the proposal of analogspiceman to mimic the smin function with the (little) faster uplim function. (the graphic contains a smin of a y=a*x^1.5 with three constant values) This gives acceptable results for larger k values (say more than 6). But for smaller k values (e.g. 4) there seems to be something wrong with the uplink variant according?analogspiceman.

Adrian



 

Hello everybody,

I just put all my created triode spice models in a zip file, so it is more convenient to download it.


Enjoy downloading and using for your tube projects!

kind regards, Adrian Immler


 

Hello Adrian,

I found your dropbox zip file download link, but not from the page you linked.? Not everyone has a dropbox account, so perhaps you may wish to place a copy of your triode models on our group website.

It looks like you have six triode models, each of under 5k in size.? Could you please upload your zip file of them to the tubes (valves) section of the LTspice Yahoo group:


Thank you for your contribution. -- a.s.


---In LTspice@..., <adrian_immler@...> wrote :

Hello everybody,

I just put all my created triode spice models in a zip file, so it is more convenient to download it.


Enjoy downloading and using for your tube projects!

kind regards, Adrian Immler


 

I think you can download the file from Dropbox without a Dropbox account, but you need to look for the "No thanks" link, and then after that the Download button works.? So it's not very direct.

Also the lack of a direct path to the file itself, from the link you provided, was a bit of a put-off.

You say it's a new ZIP file, however it appears to be a PDF.? So, have I gone to the wrong place?? Is there a ZIP file that has the models?? Or do we just download the PDF file and then copy-and-paste from that file?? That doesn't seem to be very convenient.

Color me confused....

Regards,
Andy



 

Hi analogspiceman

I found out that my shared link was not so direct as intended (it leads to the "my gen. spice models" while the download link is on a sub-site "...for vacuum tubes" of mine).

Sorry for confusion!

However, I just uploaded the zip of my models to the place you proposed:


kind regards, Adrian


 

Hi Andy

You are right, my shared link was not as direct as intended - sorry for that.

You mentioned a PDF instead of a zip... To be honest, that's now confusing me. Perhaps you mean the generic triode model spice code visible in the upper section of my homepage where I introduce my tube model paper?

However, I just added my zip to the other models collected here:


kind regards, Adrian


 

Adrian wrote, "You mentioned a PDF instead of a zip... To be honest, that's now confusing me."

For what it's worth -- I followed the link you gave () which brought me to a webpage with apparently no files or links to files on it.? So I clicked on the only thing that was related: "My gen. spice models ...for vacuum tubes".? That brought me to another page, with a lot of embedded text and graphics, and a link, labeled "Link".? Clicking on that link brought me to the PDF file on Dropbox.com.

Scrolling further down the webpage, I see now that there are 6 more links, each to a .txt file also on Dropbox.? But there is no .zip file that I could find.

Thanks for uploading it to this group's Files.

Regards,
Andy