Tutorial - How To Use The SPICE Module
Tutorial - How To Use The SPICE Module
Tutorial - How To Use The SPICE Module
© Altair Engineering, Inc. All Rights Reserved. / altair.com / Nasdaq: ALTR / Contact Us
Altair PSIM Tutorial / How to Use the SPICE Module
1. Overview
The SPICE Module is an add-on option in PSIM. The SPICE Module makes it convenient to run
LTspice simulation in the PSIM environment.
This tutorial is written for users who already have some experiences in both PSIM and SPICE
simulations. It provides a quick guide on how to use the SPICE Module in PSIM. For further details,
please refer to SPICE Module User Manual.
Before running LTspice simulation, user must install LTspice on the computer, and specify the
location of LTspice executable file by clicking PSIM menu Options >> Set Path. At the bottom of this
dialog, as shown in the picture below, use the Browse button to find and enter the path and filename
for the LTspice executable file. Then, click Save and then Close the dialog.
© Altair Engineering, Inc. All Rights Reserved. / altair.com / Nasdaq: ALTR / Contact Us 2
Altair PSIM Tutorial / How to Use the SPICE Module
In this circuit,
© Altair Engineering, Inc. All Rights Reserved. / altair.com / Nasdaq: ALTR / Contact Us 3
Altair PSIM Tutorial / How to Use the SPICE Module
For this example, the transient analysis will be performed with the settings as shown below.
LTspice simulation is run in the LTspice engine. Only the content of the .log file generated from
LTspice will be displayed in PSIM’s message window. During the time while LTspice simulation is
running, there is no status or progress information passed from LTspice to PSIM for display. At the
end of LTspice simulation, PSIM’s message window will refresh the message from the .log file
generated by LTspice, and the content of .raw file can be displayed in SimView the same way as
PSIM simulation.
© Altair Engineering, Inc. All Rights Reserved. / altair.com / Nasdaq: ALTR / Contact Us 4
Altair PSIM Tutorial / How to Use the SPICE Module
© Altair Engineering, Inc. All Rights Reserved. / altair.com / Nasdaq: ALTR / Contact Us 5
Altair PSIM Tutorial / How to Use the SPICE Module
• Select Elements >> Power >> Switches >> Diode and place the diode in the circuit.
• In the diode parameter dialog, select the Model Level as “SPICE Model”.
• The button beside the SPICE Model Name would open the search dialog for SPICE model
files in PSIM’s SPICElib folder. User may search and find whether or not the model is
already in the libraries. If it is already included, user may select it from the list and there is
no need to write it in the directive block.
• If the model can not be found in the libraries, in the SPICE Model Name, enter the name
“DRFN20TF6S”.
© Altair Engineering, Inc. All Rights Reserved. / altair.com / Nasdaq: ALTR / Contact Us 6
Altair PSIM Tutorial / How to Use the SPICE Module
• Write the “.model” directive and all the parameters in the SPICE Directive Block, as shown
below:
The content of the SPICE Directive Block can be saved into a file by clicking the “Save to file”
button.
The “Syntax Check” function check syntax of the PSpice netlist against LTspice format. If the
netlist is already in LTspice format, or any other SPICE format, the syntax will not be checked here,
but will be checked by LTspice when “Run LTspice Simulation” is performed.
In the SPICE Netlist Check dialog, there are following function buttons:
© Altair Engineering, Inc. All Rights Reserved. / altair.com / Nasdaq: ALTR / Contact Us 7
Altair PSIM Tutorial / How to Use the SPICE Module
• From PSIM element list, select Elements >> Power >> Switches >> MOSFET and place
the block in the circuit.
• In this block’s parameter dialog, select the Model Level as “SPICE Subcircuit”,
• In the space for SPICE subcircuit name, enter “SCT2280KE”. The button beside the name
would open the search dialog for SPICE subcircuit files in PSIM’s SPICElib folder. User may
search and find if the subcircuit to be used is already included. If it is not included, user must
write the netlist in the directive block.
To accommodate different node numbers of subcircuit for MOSFET, PSIM provides the options for
3, 4, and 5 nodes devices. The node sequences are:
© Altair Engineering, Inc. All Rights Reserved. / altair.com / Nasdaq: ALTR / Contact Us 8
Altair PSIM Tutorial / How to Use the SPICE Module
• Select Elements >> SPICE >> SPICE Subcircuit Netlist Block to place a block in the circuit.
• Double click the block to open the parameter dialog.
• In the “Model” box, enter the subcircuit name “SCT2280KE” to load it into the circuit.
• To modify the image of this subcircuit, select the image from the “Image” list or click “Edit
Image” to create a new image for this subcircuit. Please make sure the node sequence in the
image must be the same as in the subcircuit definition.
• Connect the wires.
• If the subcircuit parameters in the specific circuit is different from the default values, set the
desired number of parameters and the value of each parameter.
• Save the PSIM circuit under the name “Buck Converter with MOSFET
SCT2280KE_sub.psimsch”.
• Run simulation and verify the result of this implementation is the same as the previous one.
© Altair Engineering, Inc. All Rights Reserved. / altair.com / Nasdaq: ALTR / Contact Us 9
Altair PSIM Tutorial / How to Use the SPICE Module
Please be aware that when using the SPICE Subcircuit Netlist Block, if the image of the subcircuit is
different from the default image, it will not be saved for future usage. To save this type of subcircuit
block together with the image, a PSIM element can be created. The detailed procedure of creating
a PSIM element is in the document “SPICE Module User Manual”.
On the “Parameters” tab, both models’ parameters must be entered. The PSIM file will save the
information for both models.
• Select “SPICE subcircuit” and enter the desired subcircuit name and parameters.
• Then, select “Level 2”, and enter all parameters from manufacture’s datasheet of the same
part name in the SPICE subcircuit definition.
© Altair Engineering, Inc. All Rights Reserved. / altair.com / Nasdaq: ALTR / Contact Us 10
Altair PSIM Tutorial / How to Use the SPICE Module
PSIM will save both model information in the same file. User may run choose to run either simulation
without making any change in the circuit.
This table provides the following information to help users to select correct elements and model
levels for different simulation:
© Altair Engineering, Inc. All Rights Reserved. / altair.com / Nasdaq: ALTR / Contact Us 11
Altair PSIM Tutorial / How to Use the SPICE Module
• Which elements are multi-level and which ones are not. And for multi-level elements, which
levels are for PSIM simulation and which levels are for SPICE simulation.
• The model levels of multi-level elements can be selected and changed in this table directly,
and it has the same effect as if they were changed through each element’s property dialog
window.
• Elements can be enabled/disabled by checking/unchecking the Enable checkbox.
• If the checkbox Highlight Elements is checked, all the elements listed in display will be
highlighted in the schematic.
The display can list elements in the circuit in the following ways:
• In PSIM, select Options >> Set Path, and the search path dialog is shown as below.
• Click on “Add Folder” in the section “SPICE Model Path”, then browse for the file location
“C:\PSIM_SPICE Tutorial\SPICE Models” and add it.
• Click on “Reload Models” to refresh the search path.
• Click on “Save” and then “Close” to exit the dialog.
© Altair Engineering, Inc. All Rights Reserved. / altair.com / Nasdaq: ALTR / Contact Us 12
Altair PSIM Tutorial / How to Use the SPICE Module
To check what models and subcircuits are available for SPICE simulation use, select View >> SPICE
Model List or View >> SPICE Subcircuit List. Once the models and subcircuits can be seen in
those lists, there is no need to write them in the SPICE Directive Block.
© Altair Engineering, Inc. All Rights Reserved. / altair.com / Nasdaq: ALTR / Contact Us 13
Altair PSIM Tutorial / How to Use the SPICE Module
If a model file is placed in the “SPICElib” subfolder or in a folder that is in the PSIM search path, the
is no need to use the SPICE Directive Block for the model or subcircuit netlist. Also, the file’s
extension can be anything and does not have to be .lib or .txt.
If, by chance or intentionally, the name of the model or subcircuit in the SPICE Directive Block is the
same as one in the search path, the definition in the SPICE Directive Block in the PSIM schematic
will take the precedence and will be used.
© Altair Engineering, Inc. All Rights Reserved. / altair.com / Nasdaq: ALTR / Contact Us 14
Altair PSIM Tutorial / How to Use the SPICE Module
• Open the example circuit “Buck Converter with MOSFET SCT2280KE_sub.psimsch” which
contains the SPICE Directive Block and the SPICE Subcircuit Netlist Block.
• Double click the SPICE Directive Block to open its parameter dialog. Click the “Save to file”
button to save the content into a file ““My SPICE Subckt,txt”, and save it in the folder
C:\PSIM_SPICE Tutorial\SPICE Subs.
• Select Edit >> Edit Library >> Edit Library >> Edit Library Files, and click the button New
Library (If you have created your own library before, and would save your new SPICE
elements in your own library, select your library, click the button Edit Selected Library, and
skip next three steps).
• Type the new library name to be displayed in PSIM’s Elements menu: “User SPICE
Elements”.
• Type the library file name: “My SPICE File”. Click OK to add this new file into the library list.
• Select this new library name “My SPICE File.lib”, then, click the button for “Edit Selected
Library”. The PSIM’s image library editor would open as shown below.
© Altair Engineering, Inc. All Rights Reserved. / altair.com / Nasdaq: ALTR / Contact Us 15
Altair PSIM Tutorial / How to Use the SPICE Module
• Click the button New SPICE Element. All the models and subcircuits in the files which
already are put into the PSIM searching path would be displayed. If the user’s files are not
listed, please follow the procedure in Section “4.1 Setup Search Path” and then, come back
here.
• For our tutorial example, double click the file name “My SPICE Subckt.txt” and all the
subcircuits in this file would show.
• Double click on “Si4628DY”, and the editor for SPICE Library Element would open. In this
editor, the subcircuit’s definition, name, nodes, and parameters and their default values are
generated automatically.
© Altair Engineering, Inc. All Rights Reserved. / altair.com / Nasdaq: ALTR / Contact Us 16
Altair PSIM Tutorial / How to Use the SPICE Module
• Click Save Image Library to update the library, then, click Update Menu button to update
the PSIM Elements menu for the display of this newly created element.
• Now this new PSIM element is ready to be used for in PSIM schematics for SPICE simulation.
To use this newly created PSIM element for SPICE simulation, in the example circuit “Buck -
MOSFET SI4628DY (SPSN).psimsch”
© Altair Engineering, Inc. All Rights Reserved. / altair.com / Nasdaq: ALTR / Contact Us 17