1
\$\begingroup\$

I’m trying to reproduce an averaged switch model from Fundamentals of Power Electronics (Erickson & Maksimović) in LTspice. The book defines the subcircuit as:

****************************************************************
* Subcircuit: CCM1
* Application: two-switch PWM converters
* Limitations: ideal switches, CCM only, no transformer
****************************************************************
* Parameters: none
****************************************************************
* Nodes:
* 1: transistor positive (drain for an n-channel MOS)
* 2: transistor negative (source for an n-channel MOS)
* 3: diode cathode
* 4: diode anode
* 5: duty cycle control input
****************************************************************
.subckt CCM1 1 2 3 4 5
Et 1 2 value={(1-v(5))*v(3,4)/v(5)}
Gd 4 3 value={(1-v(5))*i(Et)/v(5)}
.ends
****************************************************************

The code simulates the large-signal, nonlinear averaged switch model shown below, obtained by averaging the switch network terminal waveforms large-signal, nonlinear averaged switch model obtained by averagingthe switch network terminal waveforms

The authors describe the subcircuit as follows: subscircuit description

Fig. 14.18 is the Averaged switch model CCM1: (a) the general two-switch network; (b) symbol for the aver- aged switch subcircuit model as shown below; Fig. 14.18 Averaged switch model CCM1: (a) the general two-switch network; (b) symbol for the aver-
aged switch subcircuit model

I have attempted to draw the schematic, matching the netlist described, in LTspice, as shown below. LTSpice schematic for averaged switch network

However, when I run the simulation, I'm getting this error: netlist generated

I'm new to LTSpice. I'm wondering how to implement a netlist like that in LTSpice. What could I be doing wrong? When running simulations, how should I decide whether to use voltage-controlled voltage sources and current sources, or their alternative controlling sources? Also, I would appreciate it if someone could point out relevant resources to help me master drawing and simulating in LTspice. I feel like I haven't mastered the basics yet, even after going through the tutorials on the LTspice website.

\$\endgroup\$
0

1 Answer 1

2
\$\begingroup\$

The voltage-controlled voltage and current sources you have selected, do not accept in-line equations. You have to select the analog behavioral models (ABM) by placing bi and bv sources:

enter image description here

These symbols accept in-line equations in the form of simple calculations or boolean IF-THEN-ELSE types. For instance, if you want to build a comparator with bv, you would write V=IF( V(P)>V(N),5,0) in its simplest form. It translates into: IF V(positive) greater than V(negative) THEN the output is 5 V ELSE 0 V.

In the CoPEC PSpice netlist, you will need to assemble the controlled sources a bit differently as below:

enter image description here

I have added an auto-bias circuitry to bring the duty cycle at the correct value to obtain 5 V in this example. Always consider the bias point before validating the results. For instance, I could I have 2 kV on the output and LTspice would have given me an ac plot but it would be bad.

The model is in the red dashed frame. You can copy it to another sheet and create an LTspice symbol (a .asy file). Once done, you can insert it back into the schematic and use it elsewhere.

You can freely download my new LTspice summer 2025 files collection here, there are plenty of examples if you want to learn or design switching converters.

\$\endgroup\$
4
  • \$\begingroup\$ Nice gift in the summer 2025 collection. Thanks! \$\endgroup\$ Commented Aug 16 at 19:36
  • 2
    \$\begingroup\$ @periblepsis, with pleasure! A book on describing these files is cooking as I type ^_^ \$\endgroup\$ Commented Aug 16 at 20:50
  • \$\begingroup\$ @VerbalKint, where will you be posting or sharing updates about the book once it’s ready? I’d love to check it out when it’s done to see how to come up with auto-bias circuitries like the one you drew. \$\endgroup\$ Commented Aug 18 at 4:41
  • 1
    \$\begingroup\$ @MICHAELMURITHI, hello, you can find more information on the auto-bias in this answer I gave on SE. The book should hopefully be finished by the end of this year and perhaps a release in Q2 next year. You can check my page time to time for updates. \$\endgroup\$ Commented Aug 18 at 7:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.