Make PCB's From LTspice

Assorted info that will be of use, spec sheets, docs etc. Non informational postings will be removed.
Post Reply
User avatar
Mike H
Amstrad Tower of Power
Posts: 17429
Joined: Sat Oct 04, 2008 5:38 pm
Location: The Fens
Contact:

Make PCB's From LTspice

Post by Mike H » Sat Feb 05, 2011 1:32 pm

FreePCB is free on't internet and can generate gerber plots.

LTspice can generate a PCB net list.

FreePCB can import net lists.

The two are not exactly compatible however, but the LTspice version only needs a small bit of editing so that FreePCB can readily make sense of it.

Firstly though, the LTspice schematic needs to be like that for a sub circuit, that would include labelled input and output nodes for the external 'pins' of a subckt. In other words it has to be complete in terms of everything that should go onto the PCB, including pads for external connections.

However FreePCB doesn't recognise LTspice labelled nodes (as directions 'input', 'output' etc.) as external connections, to it they're just named net nodes, or connections that join things together in the circuit.

Pads to which external connection wires have to connect can be added by adding them by hand to the *PARTS* section of the net list, however you also have to add each one to the correct node line in the *NET* section, which defines which components connect to which other.

To make this more unambiguous, I created a 'PCB pad' object for LTspice ~ it's symbol is on the left, it's equivalent subckt schematic on the right:

Image

The subckt file for this object is merely:

.subckt pcbpad P
R1 P 0 1G
.ends

This is a component with one connection only. Use this in the places where a labelled external connection node would normally be. Further, you can change its label from 'U' whatever to whatever else you like; this will be the legend that FreePCB will use on the final PCB.


Export the LTspice PCB net list thus:

Image

The resulting ASCII file takes the form:

Code: Select all

*PADS2000*
*C:\Program Files\LTC\LTspiceIV\My Drawings\Over-Volts clamp-2 PCB master.asc Thu Feb 03 14:58:20 2011*
*PART*
M1	mosfet1
R1	4.7k
C1	10n
. . . etc.

*NET*
*SIGNAL* N007
M1.1 RL1.5 R3.2
*SIGNAL* N010
M1.2 C1.1 ZD1.2 R2.1
. . . etc.
*END*
First you must change: *PADS2000* to read: *PADS-PCB*

Next, the component value (or transistor name, whatever) after each component reference in the *PARTS* section must be changed to an equivalent FreePCB footprint symbol name. These are the shapes of the components as they will appear on the PCB.

You are quite likely going to have to create footprint symbols for things that FreePCB hasn't got in its library, do this first.

Warning ~ it's quite possible that the pin numbering sequence for standard LTspice symbols and FreePCB symbols will be different. For example:

LTspice transistor symbol: 1 - collector; 2 - base; 3 - emitter.

FreePCB transistor symbol: 1 - emitter; 2 - base; 3 - collector.

Also I've found this with plastic package power transistors and MOSFET's ~ in this case the centre pin is collector or drain, that should be pin one for a FreePCB symbol then, to match LTspice, the leftmost pin then becomes pin 2 (base or gate) and the rightmost becomes pin 3 (emitter or source). The easiest way to deal with this is load an existing FreePCB symbol, and save it as a different name and with the pin numbers rearranged to match the LTspice connections.


Modifying the *PARTS* list ~

Original LTspice version:
*PART*
M1 mosfet1
R1 4.7k
C1 10n
ZD1 zener1
R2 10k
VDR1
VDR2
VDR3
RL1
R3 100
HT
RS
E
NO
NC
COM

Note the last six are the new pcb pads objects, with reference names altered from the default 'U1', 'U2' to 'HT', 'RS' etc.


Modified version of the listing for FreePCB:
*PART*
M1 TO-220_MOSFET
R1 Resistor_0-5watt
C1 DiscCap_02in
ZD1 Diode_06in
R2 Resistor_0-5watt
VDR1 DiscCap_03in
VDR2 DiscCap_03in
VDR3 DiscCap_03in
RL1 Relay_Tianbo_DPCO
R3 Resistor_0-5watt
HT Pad_1-3mm
E Pad_1-3mm
RS Pad_1-3mm
NO Pad_1-3mm
NC Pad_1-3mm
COM Pad_1-3mm

So written after the reference labels, these are all names of existing footprint symbols in FreePCB.


Import the net list into FreePCB thus:

Before you can import you have to select 'New' from the 'File' menu and give the new design a name. Then:

Image


... and then, as if by magic, TA-DA!!

Image


All you have to do then (I say "all") is move the things around to wherever you want. The violet lines are the "ratlines" which is the net list connects the components together. Provided the symbol pin numbers match the LTspice sequence AND the actual real life component package then it should be right. But double-check!

Finally, the ratlines are repositioned to make the inter-connecting tracks.

Another note ~ where using electrolytic capacitors, always use the LTspice 'polycap' symbol, this should ensure the polarity comes out the right way round on the PCB.


 
 
"The beer was so flat it could have been served in an envelope...."

User avatar
Mike H
Amstrad Tower of Power
Posts: 17429
Joined: Sat Oct 04, 2008 5:38 pm
Location: The Fens
Contact:

Post by Mike H » Sat Feb 05, 2011 1:42 pm

Some indefinite period of time later, we end up with this:

Image


The heatsink and corner holes are added separately but are also footprints in the library.


 
 
"The beer was so flat it could have been served in an envelope...."

User avatar
Mike H
Amstrad Tower of Power
Posts: 17429
Joined: Sat Oct 04, 2008 5:38 pm
Location: The Fens
Contact:

Post by Mike H » Sat Feb 05, 2011 1:56 pm

PNG impressions of gerber output files (it's an option in FreePCB):

Bottom track (mirrored):

Image


Solder resist:

Image


Top silk screen:

Image


 
 
"The beer was so flat it could have been served in an envelope...."

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest