# Ideal DC Transformer in LTSpice

I am conducting some simulation work where I would like to incorporate the LTC3588-1 component model in LTSpice.

I have an electrical model of a physical system that requires the use of an ideal DC transformer. While I have used the model successfully in Simulink and SIMetrix, such a transformer is not available in LTSpice.

Could anyone please offer some advice about how an ideal DC transformer may be constructed in LTSpice?

For reference, documentation for the component I am trying to simulate is available for SIMetrix and Simulink

• Can you explain how you want this "ideal DC transformer" to behave? Jan 21, 2019 at 0:05
• I'd like a power conserving transformer that satisfies V1=NxV2 and I2=NxI1, with no inductance terms or saturation behaviour Jan 21, 2019 at 0:10
• Transformers don't pass DC. If you need a transformer, you must use AC. If you have DC but need to use a transformer, then you must make the DC somewhat AC like. The typical way is to chop the DC into pulses.
– JRE
Jan 21, 2019 at 6:59
• Ermmm I think he just wants an ideal DC-DC converter, regardless of "transformer" in his phrasing. Lossless cuk converter or something?
– K H
Jan 21, 2019 at 7:27
• Please note that the Ideal Transformer block included in Matlab "represents an Ideal AC Transformer or a DC-DC Converter" Jan 21, 2019 at 7:54

You probably mean a small-signal DC transformer, for use in .AC analysis. If so, the basic configuration is a current source at the input, dependent on the output current, and the output voltage source dependent on the input voltage:

Both obey the external parameter, D=Ton/T. This is fixed, however, so to make D variable, you need to replace it with a voltage:

If the waveforms will have sharp transitions & co, you may need to add a Cpar=<...> to the input source. Or, if the output voltage proves to be too "stiff", replace it with a current source, like this (note the changed sign in Bin):

This also adds the possibility of an output resistance, which makes the circuit behave more like it should in a real world. Be sure to not exaggerate with the values, for example try not to set Rout=1n, because that would mean there would be a division by 1n, or 1G, side by side with 1n, which would make a dynamic range of 1e18 -- this is an almost guaranteed method to bring out timestep too small errors. In general, 1000x less than what you'd expect should do anywhere. Add a grain of salt and you're done.

• I believe this is what I am after. I've managed to get it working in the base case, however, when I insert it into the rest of my circuit I am presented with an error. "ERROR: Node IN is floating and connected to current source BIN .OP point found by inspection." I'd appreciate if you could point out where I have gone wrong. The circuit is available at dropbox.com/s/cbgkrymohmlhpvx/Example.asc?dl=0 Jan 22, 2019 at 0:50
• @Jarvis It works for me. Try to reset your settings in the control panel. However, there are a few problems I see: D=250 is out of range, it should be [0..1] (width factor, Ton/T, on-time divided by period). You have a capacitor across a voltage source at the output. Unless you have a series resistance somewhere, that's useless, internal resistance of voltage sources is zero. Also, my examples may have used a sine source, but that was for exemplification, only. A DC trafo is meant for small-signal analysis of PWM converters of some kind. Series RLC (large L, small C) doesn't quite fit. Jan 22, 2019 at 6:16
• But I'll presume you know what you're doing. :-) For the input problem though, add Rpar=1meg, or higher, to the input current source, it will quiet the errors. Jan 22, 2019 at 6:17
• If someone doesn't understand why the ideal Tx can be modeled as dependent sources: Dorf & Svoboda's book show this figure as an equivalent circuit of an ideal Tx, considering the reference polarity of voltages and reference direction of currents, and the spatial relative orientation of the windings (i.e. the dots.) The eq. circ. can be derived using the equations that relate primary and secondary voltages and currents. Jun 3, 2020 at 1:23

## AC Transformer

There is not a build in AC Transformer in LTSpice Analog. You just need to use two inductances, coupled with a Spice instruction.

For an Regular AC Transformer:

• For a 1:$$\n\$$ turns ratio, set inductances in a 1:$$\n^2\$$ L ratio,
• Set a coupling factor $$\k\$$ between 0 and 1.
• Set both dots upwards, for preserving the sign of the voltage,
• Set a Serial Resistor for the Power Source SV1.

In addition, for a (Close to) Ideal Transformer:

• Set a coupling factor of 1, for no magnetic losses in the coupling,
• Set a very large $$\L1\$$ and $$\L2\$$ set of inductances.

Check this discussion about Ideal Transformer. Please note that in a simulator, set just a reasonably large value for $$\L1\$$ and $$\L2\$$ for modelling the effects you require to reproduce.

# Ideal Transformer

If you really need to recover the mathematical expressions for the Ideal Transformer, you should use a pair of (Controller) Behavioral Sources. One for the voltage, one for the current.

Voila. In this case, the block works both for AC and DC phenomena, as the mathematical expression indicates. Unfortunately this block is physically irrealizable with passive components.

• That explains how to make a regular transformer for AC. The question asked for a "DC transformer." Since there ain't no such beast, the question needs clarification.
– JRE
Jan 21, 2019 at 7:01