# Can I connect the primary of two coupled inductors (transformer) directly to mains voltage in parallel or do I need intermediary circuitary?

Examining a voltage regulator schematic, I believe I can connect the primary side of a step down transformer to mains voltage directly to step it down on the secondary, but PSpice doesn't let me simulate that same exact circuit(transformer with bridge rectifier) claiming I can't have a voltage source and inductor loop without a series resistor to break it. I don't know if this is just a PSpice limitation or if connecting the primary of a transformer directly to mains without resistors is a bad idea?

In PSpice, the two inductors are coupled using Place->PSpice Component->Passive->Coupling.

Background: The goal is to rebuild a voltage regulator using discrete components. I am trying to go from a 120 V 60 Hz to 12 Volts. Once I can step down and clip the negative wave correctly, I'll add the capacitive filter to smoothify or make the waveform more DC like.

• You should probably at least have a fuse in series with the 230V side of the transformer so you don't start a fire if something goes wrong. – user4574 Apr 22 '20 at 14:47

I don't know if this is just a PSpice limitation or if connecting the primary of a transformer directly to mains without resistors is a bad idea?

Put a 1 milli ohm resistor in series to break apart the inductor and the pure voltage source. It's a common enough trick to have to do on nearly all simulators.

The thing is this: a pure voltage source doesn't exist so it's no big deal adding the resistor like everyone else. Make it 1 micro-ohm if you want or a pico ohm. Even try 0 ohms - sometimes that works.

But, as per the comment by @user4574, the real circuit needs a fuse to protect the wiring infra-structure in the building.

• Thanks, that worked perfectly. Totally agree about the fuse as well. – LearningEE Apr 22 '20 at 15:12
• Also take note what Spehro said about the peak voltage of 120 volts RMS being $\sqrt2$ higher - you need to set the peak voltage in a SPICE voltage source. – Andy aka Apr 22 '20 at 15:19
• Yes, inductors and voltage sources are ideally zero resistance, so cause the simulator to fail, but in reality are small resistance, so you should put a sniff of R in there anyway. I often get bitten with 'floating node' when I use transmission lines for much the same reason, a parallel 100M makes the simulator happy. – Neil_UK Apr 22 '20 at 16:45

A real transformer will have a resistance of perhaps hundreds of ohms on the primary and tens of ohms on the secondary so your transformer model should reflect that.

You should have a fuse as noted in the comments, in a real circuit, and that fuse will have a bit of resistance.

Your voltage source appears to be incorrect- SPICE voltage sources are specified in terms of peak voltage and your mains is specified in terms of RMS, so you'd want $$\\sqrt{2}\$$ larger voltage to model what comes out of the wall.

I don't know if this is just a PSpice limitation

Yes and no. PSpice simulates ideal circuit elements. That's "ideal" as in Platonic, unreachable, unreal circuits. I'm not sure what sort of analysis you're doing, but PSpice should do transient analysis just fine; it's probably unhappy about finding the DC operating point.

At any rate, the expected behavior of a simulator is to simulate ideal components, because no one knows to what level of accuracy your simulation requires, and how it can be ideal or how it needs to model reality more closely.

So your job, when using a simulator like PSpice, is to know how real components differ from ideal. When you're lucky, this means modeling those real components as collections of ideal components. Typically, for a transformer this means modeling the primary and secondary resistances, and the leakage inductance (by using a coupling factor that's less than unity). When you're not lucky, it means writing a nonlinear model by hand, or making up a circuit with amplifiers and diodes and such (essentially making an analog computer) that does the heavy lifting.