What is SPICE
#166
I'm trying to get my head around modelling power supply transformers, and there's something I'm not quite grasping. I've got one of Mike's VT1414 Tx's that I'm going to use for a simple SE guitar amp (AX84 clone) and getting the inductance ratio's (hence voltage ratio's) is proving tricky.
Spec's are, Input 0-240, (DCR = 13.3R), Output 0-275, 100mA, (DCR=72R).
Stepping through my logic:
Turns ratio: 240:275 = 1:1.1458
therefore inductance ratio is 1:1.1458^2 = 1:1.312
When I plug these into spice with a simple 5k load I only get about 267v out of it and to get me up into the 275 region I'm having to empirically up the inductance ratio to about 1.42
Should I be bothered by this or is there (probably) an error in my logic?
Cheers
Simon C
Spec's are, Input 0-240, (DCR = 13.3R), Output 0-275, 100mA, (DCR=72R).
Stepping through my logic:
Turns ratio: 240:275 = 1:1.1458
therefore inductance ratio is 1:1.1458^2 = 1:1.312
When I plug these into spice with a simple 5k load I only get about 267v out of it and to get me up into the 275 region I'm having to empirically up the inductance ratio to about 1.42
Should I be bothered by this or is there (probably) an error in my logic?
Cheers
Simon C
- Mike H
- Amstrad Tower of Power
- Posts: 19648
- Joined: Sat Oct 04, 2008 5:38 pm
- Location: The Fens
- Contact:
#167
First of all your inductances are much too low. At the mo you've got 1 Henry for the primary.
If it's a reasonably large mains TX like this then I would tend to make the primary at least 100H.
So L1 should be 100 minimum, making L2 131.2.
Also, if it's a VT1414, the secondary will be overwound by 10% to compensate for losses (regulation percentage).
This makes sense once you include DC resistances for both windings. Which I presume you haven't put in yet.
So with the extra 10% (turns) added I would figure:
Primary: 100(H), say 10 - 20 Ohms or so for the DCR.
Secondary: 158.76 (H),
from: (275 / 240) x 1.1 = 1.26 (turns/Volts ratio), ^2 = 1.5876 (impedance/inductance ratio).
the DCR for L2 is then -
27.5 (10% of 275) / 100mA (max. current) = 275 Ohms ('Rser' for L2).
This will be more realistic so that off-load the secondary Volts will be higher than expected, as happens in reality, but should be 275 when loaded to 100mA.
EDIT: that's for single 275V winding, if you're using both in parallel then of course it's 200mA and divide that DCR by 2.
If you want to be hyper-fussy, and if it matters, you could also add a resistor across L1 to represent the magnetisation current, which is what the transformer consumes from the mains even with secondaries open-circuit, as it's a split bobbin type the coupling is a bit inefficient so I could make a wild guess at say 80 - 120mA.
HTH
If it's a reasonably large mains TX like this then I would tend to make the primary at least 100H.
So L1 should be 100 minimum, making L2 131.2.
Also, if it's a VT1414, the secondary will be overwound by 10% to compensate for losses (regulation percentage).
This makes sense once you include DC resistances for both windings. Which I presume you haven't put in yet.
So with the extra 10% (turns) added I would figure:
Primary: 100(H), say 10 - 20 Ohms or so for the DCR.
Secondary: 158.76 (H),
from: (275 / 240) x 1.1 = 1.26 (turns/Volts ratio), ^2 = 1.5876 (impedance/inductance ratio).
the DCR for L2 is then -
27.5 (10% of 275) / 100mA (max. current) = 275 Ohms ('Rser' for L2).
This will be more realistic so that off-load the secondary Volts will be higher than expected, as happens in reality, but should be 275 when loaded to 100mA.
EDIT: that's for single 275V winding, if you're using both in parallel then of course it's 200mA and divide that DCR by 2.
If you want to be hyper-fussy, and if it matters, you could also add a resistor across L1 to represent the magnetisation current, which is what the transformer consumes from the mains even with secondaries open-circuit, as it's a split bobbin type the coupling is a bit inefficient so I could make a wild guess at say 80 - 120mA.
HTH
"No matter how fast light travels it finds that the darkness has always got there first, and is waiting for it."
- Mike H
- Amstrad Tower of Power
- Posts: 19648
- Joined: Sat Oct 04, 2008 5:38 pm
- Location: The Fens
- Contact:
#168
Here's something I worked out earlier that might be useful, a set of params that work out the alternative ratios and such from simply Volts ratio and regulation percent:
Params for converting turns ratio to inductance ratio for a transformer
Schematic directive:
* Transformer Data
.param mains = 240 ; Volts r.m.s., primary
.param mainspk = mains * 1.414 ; Volts peak, primary (can then apply {mainspk} to sine V-source)
.param Vsec = 350 ; Volts r.m.s., secondary
.param Imax = 200m ; Amps max., secondary
.param Regulation = 10 ; percent
*
.param reg2 = Regulation / 100
.param PrimaryL = 200 ; Henries (L1 value = {PrimaryL})
.param Vsec2 = Vsec * (1 + reg2) ; adds overwind %
.param SecRser = (Vsec * reg2) / Imax ; Secondary DCR
.param TurnsRatio = mains / Vsec2
.param SecL = PrimaryL / (TurnsRatio ** 2) ; (L2 value = {SecL})
K1 L1 L2 1
Equivalent netlist:
L1 N005 0 {PrimaryL} Rser=10
L2 N001 0 {SecL} Rser={SecRser}
V1 N005 0 SINE(0 {mainspk} 50 1) Rser=1m
Numbers in bold: your custom values
Params for converting turns ratio to inductance ratio for a transformer
Schematic directive:
* Transformer Data
.param mains = 240 ; Volts r.m.s., primary
.param mainspk = mains * 1.414 ; Volts peak, primary (can then apply {mainspk} to sine V-source)
.param Vsec = 350 ; Volts r.m.s., secondary
.param Imax = 200m ; Amps max., secondary
.param Regulation = 10 ; percent
*
.param reg2 = Regulation / 100
.param PrimaryL = 200 ; Henries (L1 value = {PrimaryL})
.param Vsec2 = Vsec * (1 + reg2) ; adds overwind %
.param SecRser = (Vsec * reg2) / Imax ; Secondary DCR
.param TurnsRatio = mains / Vsec2
.param SecL = PrimaryL / (TurnsRatio ** 2) ; (L2 value = {SecL})
K1 L1 L2 1
Equivalent netlist:
L1 N005 0 {PrimaryL} Rser=10
L2 N001 0 {SecL} Rser={SecRser}
V1 N005 0 SINE(0 {mainspk} 50 1) Rser=1m
Numbers in bold: your custom values
"No matter how fast light travels it finds that the darkness has always got there first, and is waiting for it."
#169
Thanks Mike,
It was the 10% overwind that was throwing out my calcs. I know that I should be using around 100H for the primary, but purely to get the voltage ratio's working I left it at 1 in case something else was happening I hadn't factored into my thinking. I've also been having a read up on Steve Bench's site about Tx's so I've got a better understanding now of what the maths is doing in the background, especially with multiple windings on a shared core.
My DCR's came from measuring the Tx itself, I'm now trying to get my head around why the DCR for L2 would rise under load, is this because the resistance of the primary is reflected into the secondary?, or is this the reactance component kicking in?
Thanks for the parameter list, that will save me having to program my own
I'll give it another try over the weekend.
Cheers
Simon
It was the 10% overwind that was throwing out my calcs. I know that I should be using around 100H for the primary, but purely to get the voltage ratio's working I left it at 1 in case something else was happening I hadn't factored into my thinking. I've also been having a read up on Steve Bench's site about Tx's so I've got a better understanding now of what the maths is doing in the background, especially with multiple windings on a shared core.
My DCR's came from measuring the Tx itself, I'm now trying to get my head around why the DCR for L2 would rise under load, is this because the resistance of the primary is reflected into the secondary?, or is this the reactance component kicking in?
Thanks for the parameter list, that will save me having to program my own

I'll give it another try over the weekend.
Cheers
Simon
- Mike H
- Amstrad Tower of Power
- Posts: 19648
- Joined: Sat Oct 04, 2008 5:38 pm
- Location: The Fens
- Contact:
#170
It doesn't rise under load, the Voltage drops as the current increases because of the DCR. Which is fixed. (Ohms law.)
Having said that it might increase with temperature, but that's getting too sophisticated
Having said that it might increase with temperature, but that's getting too sophisticated

"No matter how fast light travels it finds that the darkness has always got there first, and is waiting for it."
#171
OK, the sim is much happier about on-load voltages etc now with the overwind included.
There's one bit I'm being very slow about, as you said the calculated DCR is 275 ohm to give 100mA, but the measured DCR on the actual Tx is 72 ohm. Am I missing something here?
Cheers
Simon
There's one bit I'm being very slow about, as you said the calculated DCR is 275 ohm to give 100mA, but the measured DCR on the actual Tx is 72 ohm. Am I missing something here?
Cheers
Simon
- Mike H
- Amstrad Tower of Power
- Posts: 19648
- Joined: Sat Oct 04, 2008 5:38 pm
- Location: The Fens
- Contact:
#172
Right OK, the thing is, the transformer is not 100% efficient, hence the need for an overwind to compensate, so with that added, the simplest way to make it come out right is adjust the DCR to match. The resistance then equates to DCR plus losses.
Another way of doing it, and is more like what happens in reality to be honest, is to reduce the coupling factor in the 'K' statement (making the last digit less than '1'), but needs some experimental trial and error to set it.
So yes you could try 72 for the secondary DCR and something like 0.995 for the coupling value, and tweak it as necessary until the output is correct.
HTH
Another way of doing it, and is more like what happens in reality to be honest, is to reduce the coupling factor in the 'K' statement (making the last digit less than '1'), but needs some experimental trial and error to set it.
So yes you could try 72 for the secondary DCR and something like 0.995 for the coupling value, and tweak it as necessary until the output is correct.
HTH
"No matter how fast light travels it finds that the darkness has always got there first, and is waiting for it."
- IslandPink
- Loony Bin!
- Posts: 9913
- Joined: Tue May 29, 2007 7:01 pm
- Location: Denbigh, N.Wales
#173
Going back to basic set-up of Spice to handle valves ;
I decided to go to Stephie's database and method for drop-down menus as described in :
http://www.intactaudio.com/forum/viewtopic.php?t=523
Especially as there have been a number of updates until quite recently of all the triodes, in particular .
Anyway, I'm not getting very far with the set-up of the models into the program . I think I put all the relevant files in the directories as described, but the instructions aren't enough for me to understand how to get it all working . I've made some progress in undertstanding a couple of things - like finding the 'Attributes' menu for instance, but had to abort and give up for now .
I got lost when he's explaining about .inc files that need to be put into the Attributes menu - what are those ?
More soon .
I decided to go to Stephie's database and method for drop-down menus as described in :
http://www.intactaudio.com/forum/viewtopic.php?t=523
Especially as there have been a number of updates until quite recently of all the triodes, in particular .
Anyway, I'm not getting very far with the set-up of the models into the program . I think I put all the relevant files in the directories as described, but the instructions aren't enough for me to understand how to get it all working . I've made some progress in undertstanding a couple of things - like finding the 'Attributes' menu for instance, but had to abort and give up for now .
I got lost when he's explaining about .inc files that need to be put into the Attributes menu - what are those ?
More soon .
"Forever fair ... and I'm touching your hair. I wish we could be dreaming .... in this dream" ( Morrison )
- Mike H
- Amstrad Tower of Power
- Posts: 19648
- Joined: Sat Oct 04, 2008 5:38 pm
- Location: The Fens
- Contact:
#174
No that's much too complicated for a new comer.
If you use my files you can -
Plonk a triode or tetrode symbol onto schematic using the place a component toolbar button.
IT MUST BE one I made called 'triode_new..' 'tetrode_new..' etc., NOT the native LTspice symbols!
These symbols are in the Misc section of components.
Right mouse button click on symbol.
Double-click 'SpiceModel' line to get select list of valves.
Symbol files must be in
LTC > LTspiceIV > lib > sym > misc
Model files must be in
LTC > LTspiceIV > lib > sub
At least the model (.txt) files must be somewhere in the LTspiceIV directory structure, or in other words, be accessible by LTspice for the double-click to work to get the list.
Usually if the double-click doesn't show a list it's because LTspice can't find the model file.
Or, your computer doesn't want to do it for some reason.
If you use my files you can -
Plonk a triode or tetrode symbol onto schematic using the place a component toolbar button.
IT MUST BE one I made called 'triode_new..' 'tetrode_new..' etc., NOT the native LTspice symbols!
These symbols are in the Misc section of components.
Right mouse button click on symbol.
Double-click 'SpiceModel' line to get select list of valves.
Symbol files must be in
LTC > LTspiceIV > lib > sym > misc
Model files must be in
LTC > LTspiceIV > lib > sub
At least the model (.txt) files must be somewhere in the LTspiceIV directory structure, or in other words, be accessible by LTspice for the double-click to work to get the list.
Usually if the double-click doesn't show a list it's because LTspice can't find the model file.
Or, your computer doesn't want to do it for some reason.
"No matter how fast light travels it finds that the darkness has always got there first, and is waiting for it."
- Mike H
- Amstrad Tower of Power
- Posts: 19648
- Joined: Sat Oct 04, 2008 5:38 pm
- Location: The Fens
- Contact:
#175
OK a blow-by-blow explanation in pictures:
In schematic view, click to place new component -

Make sure in 'Misc' section (double-click)

Select valve symbol - must be either: 'triode_new', 'triode_new2', tetrode_new', 'tetrode_new2', 'tetrode_new3'

Place on schematic -

To change valve type, right mouse button click on symbol (cursor should be pointing hand here not arrow).

In schematic view, click to place new component -

Make sure in 'Misc' section (double-click)

Select valve symbol - must be either: 'triode_new', 'triode_new2', tetrode_new', 'tetrode_new2', 'tetrode_new3'

Place on schematic -

To change valve type, right mouse button click on symbol (cursor should be pointing hand here not arrow).

"No matter how fast light travels it finds that the darkness has always got there first, and is waiting for it."
- Mike H
- Amstrad Tower of Power
- Posts: 19648
- Joined: Sat Oct 04, 2008 5:38 pm
- Location: The Fens
- Contact:
#176
Double-click on SpiceModel (centre column) ....

... to change this text box into a combo type list box (changes colour). Then need to click on the down arrow symbol on the right end ....

.... to actually open the list. (Combo list boxes always work like this.)
Choose valve, key Enter key ....

.... click OK ....

.... it am be changed


... to change this text box into a combo type list box (changes colour). Then need to click on the down arrow symbol on the right end ....

.... to actually open the list. (Combo list boxes always work like this.)
Choose valve, key Enter key ....

.... click OK ....

.... it am be changed

"No matter how fast light travels it finds that the darkness has always got there first, and is waiting for it."
- IslandPink
- Loony Bin!
- Posts: 9913
- Joined: Tue May 29, 2007 7:01 pm
- Location: Denbigh, N.Wales
#177
Mike
It sounds like almost the same process as Steve ( sorry Stephie ) describes. Also the database files and the symbol files are placed in the same directories .
Let me have a go with the data I've obtained, first , but using all your excellent and comprehensive advice - it should help a lot
If it doesn't work out I'll go right back to the start with the database files you suggest .
Nick said it worked out easily for him using the Stephie bench stuff to give drop-down menus as you've show - it should be very similar .
It sounds like almost the same process as Steve ( sorry Stephie ) describes. Also the database files and the symbol files are placed in the same directories .
Let me have a go with the data I've obtained, first , but using all your excellent and comprehensive advice - it should help a lot

If it doesn't work out I'll go right back to the start with the database files you suggest .
Nick said it worked out easily for him using the Stephie bench stuff to give drop-down menus as you've show - it should be very similar .
"Forever fair ... and I'm touching your hair. I wish we could be dreaming .... in this dream" ( Morrison )
- IslandPink
- Loony Bin!
- Posts: 9913
- Joined: Tue May 29, 2007 7:01 pm
- Location: Denbigh, N.Wales
#178
Mike, one of the issues that has me trying to hang on to the Stephie Bench models is that her list has the valves I'm likely to need. For instance the Tetrodes.txt has D3a, 6E5P, 12GN7 and some other nice things . The triode_nh.txt also has 6N1P in there, which Norman's data does not .
Not being a software person particularly, I'm not sure if I could somehow use your .asy files and drop-down menu method with Stephie's valve data (?) .
Not being a software person particularly, I'm not sure if I could somehow use your .asy files and drop-down menu method with Stephie's valve data (?) .
"Forever fair ... and I'm touching your hair. I wish we could be dreaming .... in this dream" ( Morrison )
#179
Under it all the models are just text, so you can mix and match once you have it going.,
Little known fact, coherent thought can destructively interfere with itself leaving no thought at all, that’s why I prefer incoherent thought.
- IslandPink
- Loony Bin!
- Posts: 9913
- Joined: Tue May 29, 2007 7:01 pm
- Location: Denbigh, N.Wales
#180
Thanks Nick . I'll have another go tomorrow - just got sidetracked watching the doc. about Feynmann & the space shuttle - So many characters & scenarios I recognise from my life as an engineer ... 

"Forever fair ... and I'm touching your hair. I wish we could be dreaming .... in this dream" ( Morrison )