LTspice sub-circuit

Thread Starter

kobi209

Joined May 28, 2017
19
Hi,
I want to simulate a DCDC controller in LTspice, which I build its subcircuit on my own.
This is my first time to create a sub-circuit in LT, so I used some guides on the net.
However, when I finished my subcircuit schematic and located all the net ports, saved as .asc, I try to save the Spice netlist.

On this netlist window though, I can't find the ".subckt ...." headline with all the pin names. Instead, it's just written "XU1 with sum non completed pin names. I see this window:

1609913692062.png

The schematic for this subcircuit is as follows:

1609913783202.png

Thanks!
 

eetech00

Joined Jun 8, 2013
2,160
Create a symbol for your circuit:
Hierarchy->open this sheets symbol
Click yes when prompted. A symbol will be created and saved in the current folder.

Then,
Open a new schematic sheet.
Place the new symbol on the sheet, then "view" the net list.
You will see that the netlist is now a subckt. Each "port" on the schematic is converted to a "pin" on the .subckt statement.
You can now copy and paste the subckt as you wish.
 

Thread Starter

kobi209

Joined May 28, 2017
19
Create a symbol for your circuit:
Hierarchy->open this sheets symbol
Click yes when prompted. A symbol will be created and saved in the current folder.

Then,
Open a new schematic sheet.
Place the new symbol on the sheet, then "view" the net list.
You will see that the netlist is now a subckt. Each "port" on the schematic is converted to a "pin" on the .subckt statement.
You can now copy and paste the subckt as you wish.
OK, will try it. Regarding a port for ground, when I open the symbol, I get only 7 pins, instead of 8 (the GND pin not included). How can I mark the gnd as a lable in order to get it on the symbol as a pin?
 

Thread Starter

kobi209

Joined May 28, 2017
19
Create a symbol for your circuit:
Hierarchy->open this sheets symbol
Click yes when prompted. A symbol will be created and saved in the current folder.

Then,
Open a new schematic sheet.
Place the new symbol on the sheet, then "view" the net list.
You will see that the netlist is now a subckt. Each "port" on the schematic is converted to a "pin" on the .subckt statement.
You can now copy and paste the subckt as you wish.
I have tried your suggestion, this is what I get (still no "subckt.."):
1609937464901.png
 

Thread Starter

kobi209

Joined May 28, 2017
19
hi k,
I get it OK.
Check these images.
AS a test open a new asc file , place the model asy file on the asc file
E
Not yet.. :(
Did you change something in the block attribute window? is it set to "Block" or "Cell"? what about perflix, value?
I the netlist window I don't see all the connections of the controller subcircuit, such as the switches, the amplifier etc. It's all empty:

1609943258244.png
 

ericgibbs

Joined Jan 29, 2010
11,546
hi kobi,
Can you recap on how you created your Model.?
I only get a Yellow fill colour if I use the NET list to create a model, my model colour is just White.?
E
 

ericgibbs

Joined Jan 29, 2010
11,546
hi kobi,
I would recommend that you search the LTS master file and delete any UCC28C44.asy files, then redo using eetech00's method.

You should finish showing a White asy model.

Lets know how it goes.

E
 

eetech00

Joined Jun 8, 2013
2,160
OK, will try it. Regarding a port for ground, when I open the symbol, I get only 7 pins, instead of 8 (the GND pin not included). How can I mark the gnd as a lable in order to get it on the symbol as a pin?
use a different name other than GND.
GND is a reserved word that is auto associated with net 0 (ground). I usually use VGND.
 

Thread Starter

kobi209

Joined May 28, 2017
19
hi kobi,
I would recommend that you search the LTS master file and delete any UCC28C44.asy files, then redo using eetech00's method.

You should finish showing a White asy model.

Lets know how it goes.

E
Hi Eric,

Finally got something. After many attempts, I got the .subckt netlist with the controller pins, only when I delete the "Prefix" field at the symbol attribute window, and then the symbol box is no colored:
1610025982263.png1610026027241.png
If I fill "Prefix" with "X", the symbil is yellow colored, and then the netlist not showng the ".subckt.."
 

ericgibbs

Joined Jan 29, 2010
11,546
hi kobi,
Many thanks for the feedback, pleased to hear you have found a method that works.

What is the next step in your project.
E
BTW: if you open the net list with LTS and click on the line .subckt, you will be prompted to Create a Model.
If you chose that method you get a Yellow model, thats located in the 'Auto generated' file F2 will open the folders
 

Thread Starter

kobi209

Joined May 28, 2017
19
hi kobi,
Many thanks for the feedback, pleased to hear you have found a method that works.

What is the next step in your project.
E
BTW: if you open the net list with LTS and click on the line .subckt, you will be prompted to Create a Model.
If you chose that method you get a Yellow model, thats located in the 'Auto generated' file F2 will open the folders
I'm still thinking that there is a problem. I have read in some guides, that Yellow symbols represent a sub-circuit, as required here, while white blocks represent hierarchical blocks, which are not the same.. I suspect it won't work as expected.

My next goal is to simulate my DCDC flyback converter, based on this controller.
 
Top