8
Powersim Inc. www.powersimtech.com PSIM Tutorial How to Use the SPICE Module June 2016

Tutorial - SPICE Module in PSIM 2016 0620a Transistor (model) MOSFET (model) P-MOSFET (model) Tutorial – How to Use the SPICE Module - 3 - Powersim Inc. 2. Running SPICE Example

Embed Size (px)

Citation preview

Page 1: Tutorial - SPICE Module in PSIM 2016 0620a Transistor (model) MOSFET (model) P-MOSFET (model) Tutorial – How to Use the SPICE Module - 3 - Powersim Inc. 2. Running SPICE Example

Powersim Inc.

www.powersimtech.com

PSIM Tutorial How to Use the SPICE Module

June 2016

Page 2: Tutorial - SPICE Module in PSIM 2016 0620a Transistor (model) MOSFET (model) P-MOSFET (model) Tutorial – How to Use the SPICE Module - 3 - Powersim Inc. 2. Running SPICE Example

Tutorial – How to Use the SPICE Module

- 2 - Powersim Inc.

www.powersimtech.com

1. Overview

The SPICE Module is an add-on option in PSIM. Powered by CoolSPICE from CoolCAD Electronics LLC., the SPICE Module provides a SPICE simulation engine in the PSIM environment, and gives PSIM the capability to simulate SPICE circuits and models.

This tutorial provides a quick guide to use the SPICE Module. Further detailed information will be provided in a separate user manual.

Note that not all PSIM elements are supported for SPICE simulation. To see which elements are supported, make sure that under Options >> Settings >> Advanced, the box “Show image next to elements that can be used for SPICE” is checked. With this box is checked, the elements supported by SPICE will be marked with the image (for SPICE) next to the element in the Element menu.

If the box “Show image next to elements that can be used for code generation” under Options >> Settings >> Advanced is also checked, the elements that are supported by SPICE and SimCoder for code generation will be marked with the image (for SimCoder and SPICE).

Most of the elements with marks mentioned above work in either PSIM simulation or SPICE simulation. The following elements, however, support SPICE device models and will work in SPICE only when the model level is defined as SPICE:

Diode npn Transistor (model) pnp Transistor (model) MOSFET (model) P-MOSFET (model)

Page 3: Tutorial - SPICE Module in PSIM 2016 0620a Transistor (model) MOSFET (model) P-MOSFET (model) Tutorial – How to Use the SPICE Module - 3 - Powersim Inc. 2. Running SPICE Example

Tutorial – How to Use the SPICE Module

- 3 - Powersim Inc.

www.powersimtech.com

2. Running SPICE Example

To illustrate the process of SPICE simulation, we will use the circuit “Buck Converter with MOSFET IRF450.psimsch” as an example. This example is located in the sub-folder “Examples\SPICE”in the PSIM directory.

To keep the original example unchanged, we will create a new folder “C:\PSIM_SPICE\Test”, and use this folder as the working folder in this tutorial, and we will copy the example file into this new folder.

In PSIM, load the example “Buck Converter with MOSFET IRF450.psimsch” as shown below. It is a basic buck converter circuit. The pulsed voltage source for the MOSFET gating can be replaced with a PWM control circuit for future design.

 

Page 4: Tutorial - SPICE Module in PSIM 2016 0620a Transistor (model) MOSFET (model) P-MOSFET (model) Tutorial – How to Use the SPICE Module - 3 - Powersim Inc. 2. Running SPICE Example

Tutorial – How to Use the SPICE Module

- 4 - Powersim Inc.

www.powersimtech.com

3. Defining SPICE Models Using the SPICE Directive Block

In this example circuit, the switching device is an N-channel MOSFET. To use a SPICE model instead of a PSIM model, select the element Element >> Power >> Switches >> MOSFET (model). Then, double click on the MOSFET block, and set the “Model Level” to SPICE Model. Fill the spaces for “SPICE Model Name” and “SPICE Instance Parameters”. Here as show in the picture below, a SPICE model of IRF450 from International Rectifiers is used.

To use a SPICE model for the diode D1, follow the same steps as for the MOSFET: Double click on the diode D1, and set the Model Level to SPICE Model. Fill the spaces for “SPICE Model Name” and “SPICE Instance Parameters”. In this example, a SPICE model of 1N4004 is used.

To define the SPICE model statement, use the SPICE Directive block. This block can be found in Element >> SPICE >> SPICE Directive Block.

In this block, one can enter any SPICE directives which are not found in the PSIM menu. All the content in this block will be inserted in SPICE netlist for simulation and for netlist generation.

In the example circuit, the model definitions in the SPICE Directive Block for the diode and the MOSFET are shown. The model name in the directive block must be the same as in the corresponding element parameter dialog box. The MOSFET model name is “MOS_IRF450_N” and the diode model name is “D_1N4004”. Their SPICE models are defined with “.model” in the directive block.

The definition of the SPICE Directive Block is shown below.

Page 5: Tutorial - SPICE Module in PSIM 2016 0620a Transistor (model) MOSFET (model) P-MOSFET (model) Tutorial – How to Use the SPICE Module - 3 - Powersim Inc. 2. Running SPICE Example

Tutorial – How to Use the SPICE Module

- 5 - Powersim Inc.

www.powersimtech.com

4. Defining SPICE Models in a Library File

One can also define SPICE models through a library file. The library file will be accessible from PSIM if the folder is included in the SPICE Model Path. To include the folder, go to Options >> Set Path, and click on Add Folder under SPICE Model Path to add the folder, as shown below.

Click on Reload Models and Save to refresh and save the setting.

One can add multiple folders to the path.

Page 6: Tutorial - SPICE Module in PSIM 2016 0620a Transistor (model) MOSFET (model) P-MOSFET (model) Tutorial – How to Use the SPICE Module - 3 - Powersim Inc. 2. Running SPICE Example

Tutorial – How to Use the SPICE Module

- 6 - Powersim Inc.

www.powersimtech.com

Once the SPICE model search path is saved, load the models in the libraries by clicking on the browser button on the right of the SPICE Model Name input field. Devices in the search path libraries will be listed as shown below.

In this case, there is no need to provide the model definition in a SPICE Directive Block. PSIM will find the model from the library automatically.

Page 7: Tutorial - SPICE Module in PSIM 2016 0620a Transistor (model) MOSFET (model) P-MOSFET (model) Tutorial – How to Use the SPICE Module - 3 - Powersim Inc. 2. Running SPICE Example

Tutorial – How to Use the SPICE Module

- 7 - Powersim Inc.

www.powersimtech.com

5. Setting up SPICE Simulation

To set up the simulation parameters, double click on the Simulation Control block (the clock image), and go to the SPICE tab. The dialog window is shown below.

There are three types of SPICE analysis: transient analysis, ac analysis, and dc analysis. Select “Transient” analysis for this example. The parameters for transient analysis “Time Step”, “Max Step”, “Start Time”, and “End Time” should be specified accordingly.

Page 8: Tutorial - SPICE Module in PSIM 2016 0620a Transistor (model) MOSFET (model) P-MOSFET (model) Tutorial – How to Use the SPICE Module - 3 - Powersim Inc. 2. Running SPICE Example

Tutorial – How to Use the SPICE Module

- 8 - Powersim Inc.

www.powersimtech.com

6. Running SPICE Simulation

To run SPICE simulation, either select Simulate >> Run SPICE Simulation or click on the Run SPICE icon on the toolbar as highlighted below.

To generate the SPICE netlist, select Simulate >> Generate SPICE Netlist.

If SPICE netlist is already created either manually or from another SPICE software, one can load the netlist by selecting File >> Open SPICE Netlist File. Then simulate the SPICE netlist file by running the SPICE simulation in the same way as before.

To create a new SPICE netlist manually, select File >> New SPICE Netlist File.