Electronics-Related.com
Forums

For Paul Schoen and John Fields - autotransformer SPICE models.

Started by Fred Abse June 8, 2013
Following the exchanges on SEB, about autotransformers, and turns ratio,
I wrote these models.

The subckts should run on any SPICE which supports .param and rser/rpar.

The .asy files are for LTspice. The symbols should pick up the subckts
without any need for a .lib directive.


The first is simpler, requiring primary inductance, turns ratio, and
primary resistance.

The second example attempts to incorporate separate copper and iron
losses, and leakage inductance.

These could start as a base for developing multi-tapped, or compound
(auto plus double-wound) transformer models. I think Paul uses those.

TURN OFF WRAPPING BEFORE COPYING!

autotransformer.sub:
Goes in /lib.sub


* Autotransformer with single tap.
*
* Params: TR Turns Ratio pri/sec
*		  Lpri Inductance of primary
*		  Rpri Resistance of primary
* 		  Resistance of secondary is
*		  automatic from turns ratio
* Primary means start to finish
* Secondary means tap to finish
*
.SUBCKT AUTOTRANSFORMER Start Tap Finish
L1 Start Tap {(1-(1/TR))**2*Lpri} Rser={(1-1/TR)*Rpri}
L2 Tap Finish {(1/TR)**2*Lpri} Rser={(1/TR)*Rpri}
K1 L1 L2 1
.ENDS


autotransformer.asy:
Goes in /lib/sym

Version 4
SymbolType BLOCK
RECTANGLE Normal -63 -52 64 56
TEXT -56 -32 Left 2 Params:
TEXT -19 -17 Left 2 TR
TEXT -18 -4 Left 2 Lpri
TEXT -19 9 Left 2 Rpri
WINDOW 0 -1 -56 Bottom 2
WINDOW 3 2 59 Top 2
SYMATTR Value AUTOTRANSFORMER
SYMATTR Prefix X
SYMATTR ModelFile C:\Program Files\LTC\LTspiceIV\lib\sub\autotransformer.sub
SYMATTR Description Single-tapped autotransformer.
PIN 64 -32 RIGHT 8
PINATTR PinName Start
PINATTR SpiceOrder 1
PIN 64 0 RIGHT 8
PINATTR PinName Tap
PINATTR SpiceOrder 2
PIN 64 32 RIGHT 8
PINATTR PinName Finish
PINATTR SpiceOrder 3

autotransformer_advanced.sub:
Goes in /lib/sub

* * Autotransformer with single tap.
*
* Params: TR Turns Ratio pri/sec
*		  Lpri Inductance of primary
*		  LI Leakage Inductance
*		  RCu Copper losses
* 		  RFe Iron Losses
*
* Primary means start to finish
* Secondary means tap to finish
*
.SUBCKT AUTOTRANSFORMER_ADVANCED Start Tap Finish
L1 N001 Tap {(1-(1/TR))**2*Lpri} Rser={(1-1/TR)*RCu} Rpar={(1-1/TR)*RFe}
L2 Tap 0 {(1/TR)**2*Lpri} Rser={(1/TR)*RCu} Rpar={(1/TR)*RFe}
Lleakage Start N001 {Ll} Rser=0 Rpar=0
K1 L1 L2  1
.ENDS

autotransformer_advanced.asy:
Goes in /lib/sym

Version 4
SymbolType BLOCK
RECTANGLE Normal -97 -72 112 40
TEXT -91 -45 Left 2 TR Turns Ratio
TEXT -91 -33 Left 2 Lpri Inductance of primary
TEXT -91 -19 Left 2 LI Leakage Inductance
TEXT -91 -6 Left 2 RCu Copper losses
TEXT -91 6 Left 2 RFe Iron Losses
TEXT -91 -57 Left 2 Params:
WINDOW 0 7 -72 Bottom 2
WINDOW 3 8 24 Top 2
SYMATTR Value AUTOTRANSFORMER_ADVANCED
SYMATTR Prefix X
SYMATTR ModelFile autotransformer_advanced.sub
PIN 112 -48 RIGHT 8
PINATTR PinName Start
PINATTR SpiceOrder 1
PIN 112 -16 RIGHT 8
PINATTR PinName Tap
PINATTR SpiceOrder 2
PIN 112 16 RIGHT 8
PINATTR PinName Finish
PINATTR SpiceOrder 3



-- 
"For a successful technology, reality must take precedence 
over public relations, for nature cannot be fooled."
                                       (Richard Feynman)
Thanks. These may be very useful, but I haven't tried them yet.

Paul=20

On Sat, 08 Jun 2013 06:44:25 -0700, Fred Abse
<excretatauris@invalid.invalid> wrote:

>Following the exchanges on SEB, about autotransformers, and turns ratio, >I wrote these models.
--- Thanks. :-) -- JF
On Jun 8, 4:44=A0pm, Fred Abse <excretatau...@invalid.invalid> wrote:
> Following the exchanges on SEB, about autotransformers, and turns ratio, > I wrote these models. > > The subckts should run on any SPICE which supports .param and rser/rpar. > > The .asy files are for LTspice. The symbols should pick up the subckts > without any need for a .lib directive. > > The first is simpler, requiring primary inductance, turns ratio, and > primary resistance. > > The second example attempts to incorporate separate copper and iron > losses, and leakage inductance. > > These could start as a base for developing multi-tapped, or compound > (auto plus double-wound) transformer models. I think Paul uses those. > > TURN OFF WRAPPING BEFORE COPYING! > > autotransformer.sub: > Goes in /lib.sub > > * Autotransformer with single tap. > * > * Params: TR Turns Ratio pri/sec > * =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 Lpri Inductance of primary > * =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 Rpri Resistance of primary > * =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 Resistance of secondary is > * =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 automatic from turns ratio > * Primary means start to finish > * Secondary means tap to finish > * > .SUBCKT AUTOTRANSFORMER Start Tap Finish > L1 Start Tap {(1-(1/TR))**2*Lpri} Rser=3D{(1-1/TR)*Rpri} > L2 Tap Finish {(1/TR)**2*Lpri} Rser=3D{(1/TR)*Rpri} > K1 L1 L2 1 > .ENDS > > autotransformer.asy: > Goes in /lib/sym > > Version 4 > SymbolType BLOCK > RECTANGLE Normal -63 -52 64 56 > TEXT -56 -32 Left 2 Params: > TEXT -19 -17 Left 2 TR > TEXT -18 -4 Left 2 Lpri > TEXT -19 9 Left 2 Rpri > WINDOW 0 -1 -56 Bottom 2 > WINDOW 3 2 59 Top 2 > SYMATTR Value AUTOTRANSFORMER > SYMATTR Prefix X > SYMATTR ModelFile C:\Program Files\LTC\LTspiceIV\lib\sub\autotransformer.=
sub
> SYMATTR Description Single-tapped autotransformer. > PIN 64 -32 RIGHT 8 > PINATTR PinName Start > PINATTR SpiceOrder 1 > PIN 64 0 RIGHT 8 > PINATTR PinName Tap > PINATTR SpiceOrder 2 > PIN 64 32 RIGHT 8 > PINATTR PinName Finish > PINATTR SpiceOrder 3 > > autotransformer_advanced.sub: > Goes in /lib/sub > > * * Autotransformer with single tap. > * > * Params: TR Turns Ratio pri/sec > * =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 Lpri Inductance of primary > * =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 LI Leakage Inductance > * =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 RCu Copper losses > * =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 RFe Iron Losses > * > * Primary means start to finish > * Secondary means tap to finish > * > .SUBCKT AUTOTRANSFORMER_ADVANCED Start Tap Finish > L1 N001 Tap {(1-(1/TR))**2*Lpri} Rser=3D{(1-1/TR)*RCu} Rpar=3D{(1-1/TR)*R=
Fe}
> L2 Tap 0 {(1/TR)**2*Lpri} Rser=3D{(1/TR)*RCu} Rpar=3D{(1/TR)*RFe} > Lleakage Start N001 {Ll} Rser=3D0 Rpar=3D0 > K1 L1 L2 =A01 > .ENDS > > autotransformer_advanced.asy: > Goes in /lib/sym > > Version 4 > SymbolType BLOCK > RECTANGLE Normal -97 -72 112 40 > TEXT -91 -45 Left 2 TR Turns Ratio > TEXT -91 -33 Left 2 Lpri Inductance of primary > TEXT -91 -19 Left 2 LI Leakage Inductance > TEXT -91 -6 Left 2 RCu Copper losses > TEXT -91 6 Left 2 RFe Iron Losses > TEXT -91 -57 Left 2 Params: > WINDOW 0 7 -72 Bottom 2 > WINDOW 3 8 24 Top 2 > SYMATTR Value AUTOTRANSFORMER_ADVANCED > SYMATTR Prefix X > SYMATTR ModelFile autotransformer_advanced.sub > PIN 112 -48 RIGHT 8 > PINATTR PinName Start > PINATTR SpiceOrder 1 > PIN 112 -16 RIGHT 8 > PINATTR PinName Tap > PINATTR SpiceOrder 2 > PIN 112 16 RIGHT 8 > PINATTR PinName Finish > PINATTR SpiceOrder 3 > > -- > "For a successful technology, reality must take precedence > over public relations, for nature cannot be fooled." > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0(Richard Feynman) There is only one problem. It wont stay in Google groups. Quote: "Note: The author of this message requested that it not be archived. This message will be removed from Groups in 6 days (Jun 15, 4:44 pm)."
On Sun, 09 Jun 2013 02:10:03 -0700, LM wrote:

> There is only one problem. It wont stay in Google groups. > Quote: "Note: The author of this message requested that it not be > archived. This message will be removed from Groups in 6 days (Jun 15, > 4:44 pm)."
That's just as intended. It will persist, anyway, now you've quoted the whole thing. If you're serious about usenet, get a proper news feed, and newsreader. There are plenty of free news servers. -- "For a successful technology, reality must take precedence over public relations, for nature cannot be fooled." (Richard Feynman)
On Sun, 09 Jun 2013 11:23:15 -0700, Fred Abse
<excretatauris@invalid.invalid> wrote:

>On Sun, 09 Jun 2013 02:10:03 -0700, LM wrote: > >> There is only one problem. It wont stay in Google groups. >> Quote: "Note: The author of this message requested that it not be >> archived. This message will be removed from Groups in 6 days (Jun 15, >> 4:44 pm)." > >That's just as intended. > >It will persist, anyway, now you've quoted the whole thing. > >If you're serious about usenet, get a proper news feed, and newsreader. >There are plenty of free news servers.
And for a free newsreader (and email client) i highly recommend pan; also free. I won't be paying for another edition of Agent. ?-)
On Sat, 08 Jun 2013 06:44:25 -0700, Fred Abse wrote:


Just noticed:

> * LI Leakage Inductance
That should be Ll (ell ell) Doesn't make any difference to the model working, it's in a comment line. That'll teach me to use all upper case ;-) -- "For a successful technology, reality must take precedence over public relations, for nature cannot be fooled." (Richard Feynman)