Fun And Games With Spice

Subjects that don't have their own home
User avatar
Mike H
Amstrad Tower of Power
Posts: 20157
Joined: Sat Oct 04, 2008 5:38 pm
Location: The Fens
Contact:

#61

Post by Mike H »

Second demo:

See: g3-demo-as-input-2.gif

G3 connected to cathode ('normal' connection), but still with same input.

See: g3-demo-as-input-2-plot.gif

Green: anode output Volts.

Blue: G3 input.

Pink: forward G3 current.

Violet: anode current.

Red: screen current.

I double-checked the 'equations' (arf), there isn't a mistake. It follows the rules until g3 becomes forward conductive. Then Ia drops, instead of increasing. According to the Google books, this is because g3 is 'robbing' the anode of current, i.e. instead of it all going up the anode, it's going up the suppressor instead. How about that? (Quote re: RF modulation by suppressor grid: "the suppressor grid must never be positive.")
Attachments
g3-demo-as-input-2-plot.gif
g3-demo-as-input-2.gif
g3-demo-as-input-2.gif (7.16 KiB) Viewed 4890 times
 
"No matter how fast light travels it finds that the darkness has always got there first, and is waiting for it."
User avatar
Mike H
Amstrad Tower of Power
Posts: 20157
Joined: Sat Oct 04, 2008 5:38 pm
Location: The Fens
Contact:

#62

Post by Mike H »

So will this work?

The basic premise must be true else the following wouldn't be possible. This is straight from a book I've got, how to build your own oscilloscope, c. 1951 - 1957.

It's a simple one-valve timebase ramp generator. No explanation for how it works, just build it like this etc. except: "the valve used must be a high gain type, hence the EF36 was chosen."

See: ramp-oscillator.gif

The output is:

See: ramp-osc-plot1.gif

Spice has a bit of a problem maintaining a constant mark-space ratio and it does 'wander about' a bit, but it basically runs.

For years it's been doing my head in trying to figure out how it works. Bu-ut, once given the fact that changes of g3 Volts not only changes Ia, but also Ig2 but in the opposite direction, it starts making more sense. Hoorah!!

OK this is how it works ~ C1 is being charged through R2 and G3 (not R4 ~ or not much). This is because G3 is conducting in the forwards direction.

This makes G3 positive, or as much as it can be. This makes G2 current low. Charging continues until an appreciable Voltage difference appears across C1. G3 Volts is dropping in sympathy.

G3 Volts reaches 0V. Meanwhile Ig2 has been increasing because Vg3 is dropping. A point is reached when G2 conducts more heavily, dropping more Volts across R2. The standing charge on C1 then causes G3 to go more negative. This causes G2 to turn on harder, pushing G3 more negative, which causes G2 to turn on harder, pushing G3 more negative, which ~ you get the general idea. It's positive feedback. The result is a massive negative pulse on G3.

See: ramp-osc-plot2.gif

Green: G2 Volts.

Pink: G3 Volts.
Attachments
On the fly-back ~ green: G2 Volts, pink: G3 Volts.
On the fly-back ~ green: G2 Volts, pink: G3 Volts.
ramp-osc-plot2.gif (9.42 KiB) Viewed 4884 times
The output ramp waveform.
The output ramp waveform.
ramp-osc-plot1.gif (9.29 KiB) Viewed 4884 times
The EF36 ramp waveform oscillator, exactly as per the book schematic (Capacitors for only one range shown).
The EF36 ramp waveform oscillator, exactly as per the book schematic (Capacitors for only one range shown).
ramp-oscillator.gif (6.28 KiB) Viewed 4884 times
 
"No matter how fast light travels it finds that the darkness has always got there first, and is waiting for it."
User avatar
Mike H
Amstrad Tower of Power
Posts: 20157
Joined: Sat Oct 04, 2008 5:38 pm
Location: The Fens
Contact:

#63

Post by Mike H »

This pulse on G3 is sufficient to drive the anode current to zero (red plot):

See: ramp-osc-plot3.gif

This means the ramp capacitor C2 is recharged through R1 and grid G1 (forward conducting again). G1 may well be positve at this point but the anode is ignoring it because it's being cut off by the intervening G3.

C1 discharges via R2 & R4 and through the supply rails, ending the G3 pulse. It's a Miller integrator so, having had normal operations restored, the anode tries to go negative but is prevented by the charge on C2 holding down the signal grid. C2 charge leaks away via R5 and U2, hence anode Volts produces the descending ramp waveform.

Incidentally the G2 negative going pulse is used for flyback blanking of the CRT, while just sufficient negative going trigger pulses from the Y amp are introduced to G3 which 'push it over the edge' when it gets near the end of its C2 charging cycle.
Attachments
If G3 is sufficiently negative, anode current is cut off to zero.
If G3 is sufficiently negative, anode current is cut off to zero.
ramp-osc-plot3.gif (9.37 KiB) Viewed 4881 times
 
"No matter how fast light travels it finds that the darkness has always got there first, and is waiting for it."
User avatar
Mike H
Amstrad Tower of Power
Posts: 20157
Joined: Sat Oct 04, 2008 5:38 pm
Location: The Fens
Contact:

#64

Post by Mike H »

The pentode model(s):
Attachments
pentodes.zip
(1.73 KiB) Downloaded 365 times
 
"No matter how fast light travels it finds that the darkness has always got there first, and is waiting for it."
User avatar
Nick
Site Admin
Posts: 15707
Joined: Sun May 06, 2007 10:20 am
Location: West Yorkshire

#65

Post by Nick »

If I remember, this is the sort of games they used to play with multiple grid valves (hexodes and so on) as frequency changers/mixers/oscillators in superhet receivers.
Whenever an honest man discovers that he's mistaken, he will either cease to be mistaken or he will cease to be honest.
User avatar
Mike H
Amstrad Tower of Power
Posts: 20157
Joined: Sat Oct 04, 2008 5:38 pm
Location: The Fens
Contact:

#66

Post by Mike H »

Yes indeedy.

Hours of endless amusement to be had to be sure :lol:


BTW I discovered, re the G3 input circuit experiment, if you also put a higher frequency (say X10) into G1 simultaneously, amplitude modulation does actually take place as well as mixing the two together. Tho not hugely

The proper thing to do next of course is assemble an actual EF86 test bed and plot Vg3 against Ia and Ig2

BTW I was wrong about the radio book mention, it wasn't modulation by g3, it was actually a type of RF oscillator called a 'transitron circuit'
Attachments
Suppressor Grid1.gif
 
"No matter how fast light travels it finds that the darkness has always got there first, and is waiting for it."
User avatar
pre65
Amstrad Tower of Power
Posts: 21373
Joined: Wed Aug 22, 2007 11:13 pm
Location: North Essex/Suffolk border.

#67

Post by pre65 »

Hi Mike

Can the spice simulation help with the placement of G3 when running in triode mode ?

Where best to connect it to I mean.
The only thing necessary for the triumph of evil is for good men to do nothing.

Edmund Burke

G-Popz THE easy listening connoisseur. (Philip)
User avatar
Nick
Site Admin
Posts: 15707
Joined: Sun May 06, 2007 10:20 am
Location: West Yorkshire

#68

Post by Nick »

Not without deciding what you are trying to achieve.

There can only be one solution. try each, listen and if wanted measure, based on that decide what you prefer. or decide it doesn't matter. Then wonder if the result is applicable to any other valves, or the same valve at different operating points.
Whenever an honest man discovers that he's mistaken, he will either cease to be mistaken or he will cease to be honest.
User avatar
Mike H
Amstrad Tower of Power
Posts: 20157
Joined: Sat Oct 04, 2008 5:38 pm
Location: The Fens
Contact:

#69

Post by Mike H »

To the laboratory... Image


Back in a mo...

(It's a bit of a walk from here)

.
 
"No matter how fast light travels it finds that the darkness has always got there first, and is waiting for it."
User avatar
pre65
Amstrad Tower of Power
Posts: 21373
Joined: Wed Aug 22, 2007 11:13 pm
Location: North Essex/Suffolk border.

#70

Post by pre65 »

Mike H wrote:To the lavatory... Image


Back in a mo...

(It's a bit of a walk from here)

.
Outside bog ?
The only thing necessary for the triumph of evil is for good men to do nothing.

Edmund Burke

G-Popz THE easy listening connoisseur. (Philip)
User avatar
Mike H
Amstrad Tower of Power
Posts: 20157
Joined: Sat Oct 04, 2008 5:38 pm
Location: The Fens
Contact:

#71

Post by Mike H »

Fortunately no! Not since we've had the 'new' extension anyway. Tho I do remember having to 'nip out into the snow in the middle of the night' LOL

Oh-kay, well first problem is the basic model doesn't expect the screen to be connected to anode, so there's a bit of non-linearity. (distortion)

No wait, that's if Rk is much lower than the 'standard' 2.2k :?:

However the gain looks about right.

2.2k cathode resistor, 68k anode resistor.

g3 to cathode ~
Va = 169.1436V; Ia = !.679mA; Ig2 = 1.92mA.
Total added up: 1.92mA.

g3 to 0V ~
Va = 175V; Ia = 1.23mA; Ig2 = 0.552mA.
Total: 1.782mA. Which is nearly the same and would make sense if Ia & Ig2 are changed in opposite directions.

Change on signal amplification ~ sweet naff all that is discernible.

However connecting g3 to 0V means the ripple across the cathode capacitor, about 100-th of the g1 signal, is like put onto g3, logically this should be opposite polarity to the g1 signal so is like NFB, but it isn't, because the cathode ripple is badly distorted with a phase shift. So connecting g3 to 0V is problee not a good idea. Should be OK though if there was no bypass cap. Given the very low gain of g3 however the amount of such NFB would be miniscule.

Yes g3 'gain' while wired as triode is very low, about X1.6.
 
"No matter how fast light travels it finds that the darkness has always got there first, and is waiting for it."
User avatar
Mike H
Amstrad Tower of Power
Posts: 20157
Joined: Sat Oct 04, 2008 5:38 pm
Location: The Fens
Contact:

#72

Post by Mike H »

I should remind everybody that so far the 'numbers' are purely theoretical, I was just pushing them around until the behaviour 'looked about right'. Still don't know yet what a real EF86 would behave like.

.
 
"No matter how fast light travels it finds that the darkness has always got there first, and is waiting for it."
User avatar
Mike H
Amstrad Tower of Power
Posts: 20157
Joined: Sat Oct 04, 2008 5:38 pm
Location: The Fens
Contact:

#73

Post by Mike H »

I don't believe it!

Remember this? Nick's link:

Improved vacuum tube models for SPICE simulations
http://www.normankoren.com/Audio/Tubemo ... ticle.html

A bit heavy going for us thick bods (why can't just write down the spice lines and be done with it? LOL), OK for mathmeticians I guess, which is my crap subject, anyway I spent some hours before lunch translating the formulas to ack-tual spice syntax.

Just tried with the ECC82 version (as provided in table on that page), ran first time!


These are my 'notes': can someone else give 'em another eye-ball just in case I've missed something silver plaits ta:

.subckt <triode> A G K
or ~
.subckt <tetrode> A S G K
params: MU EX KG1 KG2 KP KVB CCG CPG CCP RGI (see notes below)

Triodes: EP = V(A,K); EG = V(G,K)
Pentodes: EP = V(A,K); EG = V(G,K); EG2 = V(S,K)

Triodes:
E1 = (EP/kP) * log(1 + exp(kP * (1/mu + EG/sqrt(kVB + EP**2))))
IP = (E1**EX/kG1) * (1 + sgn(E1))

becomes e.g.:
Ee1 E1 0 Value={(V(A,K)/{kP}) * log(1 + exp({kP} * (1/{mu} + V(G,K)/sqrt({kVB} + pwr(V(A,K),2)))))}
GIP A K Value={(pwr(V(E1),{EX})/{kG1}) * (1 + sgn(V(E1)))}


Pentodes (as tetrodes):
E1 = (EG2/kP) * log(1+exp(kP * (1/Mu+EG/EG2)))
IP = (E1 * EX/kG1) * (1 + sgn(E1)) * arctan(EP/kVB)
IG2 = (EG+EG2/mu)**1.5/kG2

becomes e.g.:
Ee1 E1 0 Value={(V(S,K)/{kP}) * log(1+exp({kP} * (1/{Mu}+V(G,K)/V(S,K))))}
GIP A K Value={(V(E1) * {EX}/{kG1}) * (1 + sgn(V(E1))) * arctan(V(A,K)/{kVB})}
GIG2 S K Value={pwr((V(G,K)+V(S,K)/{mu}),1.5)/{kG2}}



MU is the amplification factor,

EX (typical range from 1.3 to 1.4, but see below)

kG1 is a factor used to fit the equation to data (for anode current)

kG2 is a constant similar in function to kG1 (for screen current, pentode)

KP (kP) (behaviour region (A), see below)

KVB ("knee" of the characteristic curves, see below)

CCG cap. cathode to grid,

CPG cap. plate to grid,

CCP cap. cathode to plate.

EG is control grid voltage,

EP is plate voltage,

IP is plate current, (product)

EG2 is screen grid voltage

IG2 is the screen grid current (product)

RGI is the grid-to-cathode resistance that controls grid current when EG > 0. (No grid current flows
during normal operation, when EG < 0.) The numbers in Table 1 are rough estimates based on measurements
of similar tubes in old texts.3 Good up-to-date data is very scarce, and would be most welcome.

KP (kP) dominates the behavior of the new model in region (A), which is characterized by large negative
grid voltage, large plate voltage, and low plate current. Plate current is inversely proportional to KP
in this region. Determining KP for a given tube is done entirely by trial-and-error. Triode-mode curves
must be used to obtain an accurate estimate of KP for pentodes because published pentode curves tend to
have insufficient resolution in region (A).

3/2 = 1.5 (!)

KVB (kVB) relates to the "knee" of the characteristic curves, and is defined differently in the triode
and pentode equations. For pentodes, the knee is proportional to KVB, and is most visible in the
pentode-mode curves (Figure 3 for the 6550). Equation (5) does not give an accurate estimate of the knee
for all levels of grid voltage, EG. Fortunately, this is not a serious limitation because load lines for
practical designs pass close to the knee for EG = 0. (Otherwise there would be a serious impedance
mismatch.) The location of the knee for EG = 0 was used to determine KVB in Table 1. For triodes, the
knee is proportional to the square root of KVB, and is only apparent when the tube is operated with
positive grid voltage.

EX ~ To determine EX and KG1 (X and kG1), run the appropriate plate curve program (Appendix A1 or A2),
and observe plate current I(VP) using Probe. Adjust EX and KG1 so that curves for relatively low
negative grid voltages (e.g., Vg = 0 or -0.5 for the 12AX7 in Figure 2) match experimental data. Typical
values of EX range from 1.3 to 1.4. Line curvature increases with EX. The textbook value of 3/2 for EX
is appropriate for equations (1) and (2), where it gives a reasonable average representation of tube
operation, but is not really accurate in all regions. KG1 is inversely proportional to plate current for
given grid and plate voltages. It usually requires several runs to get a really good match for EX and
KG1. MU may need to be adjusted slightly in the process.


The prototype:

Code: Select all

.SUBCKT TRIODE A G K ; 12AU7/ECC82
+PARAMS: MU=21.5 EX=1.3 KG1=1180 KG2=0 KP=84 KVB=300 CCG=2.3P CPG=2.2P CCP=1.0P RGI=2k

Ee1   E1 0  Value {(V(A,K)/{kP}) * log(1 + exp({kP} * (1/{mu} + V(G,K)/sqrt({kVB} + pwr(V(A,K),2)))))}
GIP   A  K  Value {(pwr(V(E1),{EX})/{kG1}) * (1 + sgn(V(E1)))}

D3    5  K  DX ; FOR GRID CURRENT
R1    G  5  {RGI} ; FOR GRID CURRENT
CM1   G  K  {CCG}
CM2   A  G  {CPG}
CM3   A  K  {CCP}
RF1   A  0  1000MEG
RF2   G  0  1000MEG
RF3   K  0  1000MEG
.MODEL DX D(IS=1N RS=1)
.ENDS

What I'd like to do next is it would be nice to somehow produce a set of curves, hoping it could be done with the .STEP command
 
"No matter how fast light travels it finds that the darkness has always got there first, and is waiting for it."
User avatar
Nick
Site Admin
Posts: 15707
Joined: Sun May 06, 2007 10:20 am
Location: West Yorkshire

#74

Post by Nick »

What I'd like to do next is it would be nice to somehow produce a set of curves, hoping it could be done with the .STEP command
Look at the DC sweep simulation command
Whenever an honest man discovers that he's mistaken, he will either cease to be mistaken or he will cease to be honest.
Andrew
Eternally single
Posts: 4206
Joined: Thu May 24, 2007 2:18 pm

#75

Post by Andrew »

There's some stuff in here on that, yep found it, see http://www.audio-talk.co.uk/phpBB2/view ... c&start=75
Post Reply