I'm having trouble running simulations using transformers with a center tap and have done some digging and can't seem to find an example of how to set this up properly. I'm pretty new to SPICE simulations and most of it is pretty intuitive so far but this is the one thing I can't seem to iron out and I'm sure it's just something simple. Simulation output and netlist is below.
Circuit: transformer test
Error: unknown subckt: xt5 r2_2 r1_2 volprobe1 0 c2_1 xfmr-tap_xt5 1e15
=======================================
Transformer Test
XT5 R2_2 R1_2 VOLPROBE1 GND C2_1 XFMR-TAP_XT5
V1 R2_2 R1_2 SIN(0V 120 60hz 0 0 0) AC 1 0
R3 C2_1 VOLPROBE1 1K
R2 GND R2_2 1G
R1 GND R1_2 1G
C2 C2_1 GND 4700p
C1 GND VOLPROBE1 4700p
.param pi = 3.141593
.func LIMIT(x, y, z) {min(max(x, min(y, z)), max(z, y))}
.func PWR(x,a) {(MAX(ABS(x), 1e-313))**a}
.func PWRS(x,a) {sgn(x) * PWR(x,a)}
.func stp(x) {u(x)}
.func log10(x) {ln(x)/ln(10)}
.func SQRT(x) {(MAX(x, 1e-313))**0.5}
.func INT(x) {sgn(x)*floor(ABS(x))}
.func URAMP(x) {max(x,0)}
.func POW(x,a)
+ {(((a-(int(a)))==0)||(sgn(x)>=0))*( max(exp(ln(uramp(x))*a),0) +
+ (2*(0.5-ABS((int(a))-2*int(a/2))))*max(exp(ln(uramp(-1*x))*a),0) )}
* Authors: L.G. Meares and Charles E. Hymowitz
*
* Updated to add R1 - R5 to provide DC paths to
* ground in case any winding is left floating
* by mistake.
*
* signality.co.uk 140920
*
* Windings: 1-2 : 3-4 : 4-5
* | | |
* | | |
* Turns ratio: 1 :RATIO:RATIO
**
.SUBCKT XFMR-TAP_XT5 1 2 3 4 5
E1 7 8 1 2 2
F1 1 2 VM1 2
RP 1 2 1MEG
RS 6 3 1U
VM1 7 6
F2 1 2 VM2 2
E2 9 5 1 2 2
R5 8 4 1U
VM2 9 8
*
.param rval=1e15
R1 1 0 {rval}
R2 2 0 {rval}
R3 3 0 {rval}
R4 4 0 {rval}
R5 5 0 {rval}
.ENDS
.control
tran 1m 200m 0
probe V(VOLPROBE1)
quit
.endc
.END
=================================
https://easyeda.com/editor#id=51PpYyK64