From datasheet to SPICE model: Koren fitting of the 6BX7-GT
A SPICE simulator cannot work directly from a printed graph: it needs a function able to return current for any voltage pair inside the domain of interest.
In this work, the 6BX7-GT curve family is described by a Koren-style model, and a single set of five parameters is estimated simultaneously on all curves.
1. From graph to function
The starting data are digitized points \((V_{ak},V_{gk},I_a)\) taken from the characteristic curves. The solver searches for a parameter vector
\[
\boldsymbol{\theta}=(\mu,K_p,K_{vb},K_{g1},E_x)
\]
such that the current computed by the model is as close as possible to the digitized current for all 439 points in the dataset.
2. The equation actually implemented in triode.koren_v1
The source file triode_koren_v1.m now makes it possible to describe the model without ambiguity. The function receives \(V_{ak}\) in volts, \(V_{gk}\) in volts, and directly returns \(I_a\) in milliamperes.
The first computed term is
\[
d=\sqrt{\max(K_{vb}+V_{ak}^2,\varepsilon)}.
\]
Then
\[
z=K_p\left(\frac{1}{\mu}+\frac{V_{gk}}{d}\right).
\]
The usual expression \(\ln(1+e^z)\) is evaluated in the numerically stable form
\[
S(z)=\max(z,0)+\ln\left(1+e^{-|z|}\right),
\]
which is algebraically equivalent to the softplus \(\ln(1+e^z)\), but avoids numerical overflow when \(z\) is large and positive.
The intermediate quantity is therefore
\[
E_1=\max\left[0,\frac{V_{ak}}{K_p}S(z)\right],
\]
and the current returned by the plugin is
\[
I_a[\mathrm{mA}]=\frac{2000}{K_{g1}}E_1^{E_x}.
\]
This is not a generic transcription of the Koren model: it is the effective form used by the GX-TXT solver.
3. How it differs from Koren’s canonical form
In Norman Koren’s published formulation, triode current is written as
\[
I_p=\frac{E_1^X}{K_{g1}}\left[1+\operatorname{sgn}(E_1)\right].
\]
In the positive physical region, the factor in brackets is equal to 2. The plugin performs two equivalent operations for the intended use:
- it forces \(E_1\ge 0\) through an explicit clamp;
- it returns current in mA, so the factor 2 from Koren’s formula is multiplied by 1000.
This is why the implemented function contains the factor 2000. The source also sets any non-finite result to zero. These are important details because they distinguish the theoretical model from its actual numerical implementation.
4. Practical meaning of the five parameters
4.1 μ
\(\mu\) governs the control ratio between grid and anode. In the term \(1/\mu\), increasing \(\mu\) reduces the direct contribution of plate voltage relative to grid action. In the family of curves this parameter mainly affects spacing and relative position.
4.2 Kp
\(K_p\) appears both in the softplus argument and in the factor \(V_{ak}/K_p\). For this reason it is not a simple gain factor: it modifies how the model passes from the near-cutoff region into conduction and contributes to the knee shape.
4.3 Kvb
\(K_{vb}\) appears under the square root together with \(V_{ak}^2\). Its effect is therefore more visible at low and intermediate plate voltages, where it modifies curvature and the transition toward the region in which the \(V_{ak}^2\) term dominates.
4.4 Kg1
\(K_{g1}\) is mainly a current-scaling parameter: for the same remaining parameters, increasing \(K_{g1}\) decreases current. It should not, however, be interpreted as a physical resistance; it is a coefficient of the phenomenological model.
4.5 Ex
\(E_x\) is the exponent applied to \(E_1\). It changes the curvature of the current-voltage law and therefore the way current rises when the tube moves deeper into conduction.
These effects are not independent: several parameters can partially compensate one another. This is one reason why a global fit and residual inspection are preferable to simply observing a single curve.
5. The global fit used in the project
In the module runtime, the dataset is curve_family.primary, with bindings X_V → V_ak, Vg_V → V_gk, and Y_mA → I_a. The required solver is lsqnonlin, with a maximum of 2000 iterations and a tolerance of \(10^{-8}\).
The residual used in the optimization is simply
\[
r_i=I_{a,\mathrm{model},i}-I_{a,\mathrm{measured},i}.
\]
and the objective function is the sum of squared residuals:
\[
\min_{\boldsymbol{\theta}}\sum_{i=1}^N r_i^2.
\]
So this is a global fit not weighted by relative current: all points contribute through their error in mA. Regions with higher current may therefore weigh more, in relative terms, than regions close to cutoff.
6. Fitted values for the 6BX7-GT
Using 439 points, the fit produced:
| Parameter | Value |
|---|---|
| \(\mu\) | 10.820464 |
| \(K_p\) | 77.041052 |
| \(K_{vb}\) | 663.247799 |
| \(K_{g1}\) | 485.544748 |
| \(E_x\) | 1.303942 |
The fitted value of \(\mu\), about 10.82, is close to the typical value 10 reported in 6BX7-GT datasheets. This agreement is useful as a plausibility check, but it does not mean the other parameters have a direct physical interpretation equivalent to a datasheet quantity.
7. Measured data and model curves
Visually, the agreement is good over the whole family. The global metrics confirm this impression:
- RMSE = 1.088 mA;
- MAE = 0.863 mA;
- \(R^2=0.99647\);
- residual sum of squares = 520.03 mA².
A high \(R^2\) is not enough by itself to declare the model “perfect”. A model may explain almost all the variance and still preserve systematic errors in some regions.
8. Residuals: where the model is wrong and in which direction
If the model reproduced the data without residual structure, the points would fluctuate randomly around zero. Here, coherent patterns can instead be observed inside some families: the five-parameter model captures the general shape very well, but not every detail of the digitized curves.
The sign of the residual is especially useful: a positive residual indicates a predicted current that is too high, while a negative residual indicates a predicted current that is too low.
9. Parity plot
The parity plot compresses all families into a single figure. It is excellent for seeing global errors, but it hides where they occur. For this reason it should be read together with the residual plot and family-by-family metrics.
10. Error by grid family
The family with the lowest RMSE is \(V_{gk}=-35\) V, about 0.642 mA. The worst one is \(V_{gk}=0\) V, about 2.015 mA. The −45 V and −20 V families also exceed 1.4 mA. This is more informative than the global RMSE alone because it shows where the model concentrates error.
Complete metrics by family
| Vgk [V] | n | RMSE [mA] | MAE [mA] | R² |
|---|---|---|---|---|
| -50 | 32 | 0.824 | 0.789 | 0.96669 |
| -45 | 32 | 1.407 | 0.987 | 0.97402 |
| -40 | 40 | 0.850 | 0.660 | 0.99542 |
| -35 | 40 | 0.642 | 0.556 | 0.99815 |
| -30 | 50 | 0.844 | 0.704 | 0.99747 |
| -25 | 56 | 0.879 | 0.734 | 0.99713 |
| -20 | 24 | 1.428 | 1.380 | 0.99442 |
| -15 | 47 | 0.867 | 0.794 | 0.99804 |
| -10 | 38 | 0.816 | 0.572 | 0.99834 |
| -5 | 44 | 1.118 | 0.944 | 0.99715 |
| 0 | 36 | 2.015 | 1.760 | 0.99138 |
11. Absolute and relative error
An error of 1 mA does not carry the same intuitive weight when current is 60 mA and when it is 1 mA. For this reason a relative-error graph is also useful. In the GX-TXT session, the threshold minimum_abs_y_for_relative_error is set to 1 mA: points whose absolute measured current is below 1 mA are excluded from this diagnostic, thus avoiding percentages dominated by division by values close to zero.
Near cutoff, percentages can still become very large even when the absolute error remains only a few milliamperes. The relative plot should therefore be interpreted together with the residuals in mA, not in place of them.
12. From fit to SPICE subcircuit
Once the five parameters have been obtained, the equation can be implemented in SPICE as a current source controlled by the instantaneous values of \(V_{ak}\) and \(V_{gk}\). The fit described here, however, represents only the static plate-current behavior.
A more complete SPICE model may additionally require:
- grid-to-cathode, grid-to-plate, and plate-to-cathode capacitances;
- grid current when the grid enters positive conduction;
- possible parasitic resistances;
- leakage, noise, or other secondary effects, if they are actually needed by the application.
6BX7-GT datasheets report interelectrode capacitances on the order of a few picofarads, but those capacitances are not part of the triode_koren_v1 function used in the static fitting.
13. Interpolation and extrapolation
The domain covered by the dataset is much more important than the number of digits in the parameters. The fit is reliable mainly where data exist: the digitized families go from \(V_{gk}=0\) to −50 V and cover the plate-voltage region used during extraction.
Outside this domain the model continues, mathematically, to return a number, but that number is not automatically validated. In particular, it is prudent to avoid strong conclusions for positive grid, plate voltages far beyond the digitized graph, and the deep-cutoff region.
14. What “good fit” means
A good fit does not mean the model is a complete microscopic description of the tube. It means that, with five parameters and a smooth function, the model reproduces with limited error a chosen reference family of curves.
In the present case the global agreement is very good, but the residuals still show structure. This is exactly the kind of information that helps decide whether the model is already adequate for circuit simulation or whether it is worth introducing additional effects.
15. What should remain from this article
The key point is to distinguish three levels: the real tube, the points digitized from the datasheet, and the fitted mathematical function. The solver does not “discover the physics” of the tube: it finds the parameter set that minimizes a defined error. The quality of the result is judged through overlaid curves, residuals, global metrics, family-by-family metrics, and above all by respecting the data domain.
Technical sources
- Norman Koren, Improved vacuum tube models for SPICE, Part 1.
- GX-TXT, source file
triode_koren_v1.m, static Koren-style model. - GX-TXT,
fit_summary.txt,fit_parameters.csv,fit_predictions.csv, andfit_metrics_by_family.csv. - General Electric, 6BX7-GT Twin Triode, ET-T804, 2-52.
- RCA, 6BX7-GT Medium-Mu Twin Triode, tentative data, 6-56.