# Pulse transformer in LTspice giving DC offset

I wanted to simulate a pulse transformer in LTspice. It steps up the input 12 -12 pulses to 120V -145 pulses means it has some dc offset. How to correct it?

• Let it run for a couple of cycles more. May 10, 2017 at 19:24
• Add a sniff of series resistance, then let it run for a couple of cycles more. May 10, 2017 at 19:30
• I see no DC offset. What I see are asymmetric peak values that are due to the fact that the duty cycle is not 50%. May 10, 2017 at 20:15
• Yup! Dave has nailed it. You need to look at Webers (volt-seconds.) These will be balanced.
– jonk
May 10, 2017 at 20:17
• Yeah, its definitely the pulse rise\fall time, make it symmetrical May 10, 2017 at 22:10

The problem with using LTSpice's pulse waveform is that if you don't specify the rise and fall times, I think it uses $\frac{1}{20}$th of the cycle time, for each of the rise and fall times. It also accepts your cycle time and your ON time, literally. So the off time will be what's left over.

The best thing to do with LTSpice here is to specify everything accurately. In your case, try:

Vinitial: -12
Von:       12
Tdelay:    0
Trise:     100n
Tfall:     100n
Ton:       {1/50k-200n}
Tperiod:   {1/25k}


That should make it very close to symmetrical, I think.

Note that I've subtracted the rise and fall times from the ON time.

Suppose you want to leave the frequency open as a parameter. Then you can add a spice line to your schematic that says:

.param F=25k RISE=0.001 FALL=0.001


And then do the following:

Vinitial: -12
Von:       12
Tdelay:    0
Trise:     {RISE/F}
Tfall:     {FALL/F}
Ton:       {(0.5-RISE-FALL)/F}
Tperiod:   {1.0/F}


Or something like that. (The RISE and FALL values, as shown, are just the proportion of the total time you want to use.)