Michael Zedler said:
Hello,
I've google/google groups'ed a bit but anyhow I cannot make an *ideal*
transformer to work. The file
--
ideal transformator
.control
ac dec 20 1k 1g
plot vdb(3)
.endc
.subckt transformer 1 2 3 4
vsense 1 2 dc 0
e1 1 2 3 4 1
f1 3 4 vsense -1
.ends
v1 1 0 dc 0 ac 1
r1 1 2 10
X1 2 0 3 0 transformer
r2 3 0 1k
.end
--
makes Macspice hang... Please note that for my purpose I cannot use 'K'
coupled inductors. DC behaviour of the ideal transformer is of no
interest.
Cheers,
Michael
Hello Michael,
It looks similar to the ideal transformer from this article.
http://www.elecdesign.com/Articles/Print.cfm?ArticleID=6204
I have made a subcircuit from this example:
Plese change the voltage ratio "10" to the desired value.
For a 1: transformer replace the 10 by 1 and the -10 by -1.
* prim: (+)1 (-)2
* sec: (+)3 (-)4
* ratio Vsec/Vprim = 10
..SUBCKT TRAFO 1 2 3 4
F1 1 2 VSENSE -10
E1 30 4 1 2 10
VSENSE 3 30 0
..ENDS
Best regards,
Helmut
PS: If you have some kind of Windows emulator, you could try LTspice.
It also runs with WINE in Linux. LTspice has a state of the art graphical
interface for schematics and waveforms.
http://www.linear.com/designtools/software/switchercad.jsp
http://tech.groups.yahoo.com/group/LTspice/
A full blown version of the ideal trafo with parameter passing for LTspice
* prim: (+)1 (-)2
* sec: (+)3 (-)4
..SUBCKT TRAFO 1 2 3 4 N1={N}
* N1 = N = Vsec/Vprim
F1 1 2 VSENSE {-N1}
E1 30 4 1 2 {N1}
VSENSE 3 30 0
..ENDS
How a netlist for a TRAFO-instance could look in LTspice:
XU1 10 0 50 0 TRAFO N=1
Normally one would use a symbol in the schematic of course.
Symbol file, name it trafo.asy
Version 4
SymbolType BLOCK
RECTANGLE Normal 80 64 -48 -80
TEXT -22 -48 Left 0 TRAFO
WINDOW 39 17 24 Center 0
SYMATTR Prefix X
SYMATTR SpiceModel TRAFO
SYMATTR Description Ideal Transformer
SYMATTR SpiceLine N=1
PIN -48 -64 NONE 8
PINATTR PinName 1
PINATTR SpiceOrder 1
PIN -48 48 NONE 8
PINATTR PinName 2
PINATTR SpiceOrder 2
PIN 80 -64 NONE 8
PINATTR PinName 3
PINATTR SpiceOrder 3
PIN 80 48 NONE 8
PINATTR PinName 4
PINATTR SpiceOrder 4