LTspice Tools and Applications

From LTwiki-Wiki for LTspice
Revision as of 03:24, 9 December 2012 by Lewispaul (talk | contribs) (Created page with "== How to convert SPICE Netlist to an LTspice schematic == Schematic Builder to automate the first steps below. <br> Before you start, make working ...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

How to convert SPICE Netlist to an LTspice schematic Schematic Builder to automate the first steps below.

Before you start, make working copy of the netlist and then clean it up by doing any reordering of lines or shortening of node/net names that will make them easier to work with. For example, nets with names like "n023" and "n001" can usually be safely shortened to "n23" and "n1" (sometimes I do this in a word processor with find and replace). Also, it is a good idea to move all comments to the end of the working netlist (if not delete them altogether).

At this point, I like to import the netlist into LTspice, either directly onto the schematic (if the netlist is short) or into a separate LTspice netlist window.

Now go through the netlist line by line and place a component of the corresponding type on the schematic (arrange these in rows by component type such that you build up rows of all the same type). It is important to do this in exactly the same order as the net- list because this will greatly ease cross checking when you think you have finished. (Also, all of the SPICE text, such as model statements, etc. should be copied and pasted in at the end.)

As you place each component, edit its reference designator to agree with the corresponding netlist reference designator.

As you place each component, place a net-label/node-name directly on each pin of the component (of course, these should agree with their names in the netlist, too). Don't bother with wires yet as these will just be trouble to move around later.

Once all the components are placed, view the SPICE Netlist (it's a drop-down menu item) and verify that it agrees *exactly* with the original netlist (it will, if you followed these instructions carefully). Correct any errors as needed until agreement is perfect. This "schematic" should actually be able to run at this point.

(This above section is what is automated by the SchBuilder.)

So far you have just been playing the part of a robot, but now comes the fun part where human judgement is required. Move the components around on the schematic to group them such that the pins that have the same net names are close to each other and that signal flow makes sense. Use the Highlight Net tool (right mouse button click on a pin or net) to make sure no connection is overlooked.

Only when the parts are reasonably well placed is it time to start drawing in the wires and adjust the look of the schematic.

Be sure to check occasionally that the two netlists continue to match.

Because both netlists and schematics are just ascii text files, the first part of this process should be fairly straightforward to automate in software. Grouping components and connecting them for least total wire length might be harder, but still possible (I would try an approach using the so-called "synthetic annealing" algorithm). However, finishing the schematic to human sensibilities would seem beyond the reach of any canned program, but having a utility that did the first two steps would be a big time saver and well worthwhile. (from analogspiceman, used by permission)