AP0161 Using SIMetrix SIMPLIS Circuit Simulation
AP0161 Using SIMetrix SIMPLIS Circuit Simulation
SIMetrix/SIMPLIS is a popular Circuit Simulation package. SIMetrix/SIMPLIS is a combination of two independent circuit simulators: SIMetrix, a SPICE-based simulator with numerous enhancements including custom models for power transistor devices; and SIMPLIS, a fast simulator that uses piecewise linear approximations and includes useful analysis modes for switching power supply circuits.
Summary
This Application Note provides detailed information on using Catena Softwares SIMetrix/SIMPLIS Circuit Simulation package in Altium Designer.
1. Direct Simulation from Altium Designer using SIMetrix/SIMPLIS 2. Using models from the SIMetrix/SIMPLIS model library, not only in the native SIMetrix and SIMPLIS simulators but in also in Altium Designers built-in simulator 3. Exporting Schematics containing simulation models to SIMetrix/SIMPLIS format. To use any of these features, you need the SIMetrix/SIMPLIS application (release 5.3j or higher) and a valid license. This document assumes some familiarity with SIMetrix/SIMPLIS. Refer to the following documentation for more detailed information about simulation: Defining & running Circuit Simulation analyses tutorial for instructions on using Advanced Sim Simulation Models and Analyses Reference a comprehensive reference on Advanced Sim, SPICE models, and analysis modes The Catena website for more information on SIMetrix and SIMPLIS.
Getting Started
To use the SIMetrix/SIMPLIS Circuit Simulator in Altium Designer, you must declare the location of SIMetrix/SIMPLIS application: Select the DXP Preferences command which brings up the Preferences dialog Navigate to the SIMetrix Interface tab under the Simulation folder
Type the installation path in the SIMetrix/SIMPLIS installation location field or click the detect the location of the application
button to automatically
The Clear existing graph sheets and group data before running a new simulation checkbox controls whether to clear results from the last execution of the SIMetrix/SIMPLIS waveform viewer, or to let these results display on top of each other. This checkbox is enabled by default The Display graph sheets in SIMetrix instead of Altium Designer checkbox gives you the option of using the SIMetrix waveform viewer instead of Altium Designer. Enable this option if you are generating SIMetrix or SIMPLIS netlists from Altium Designer, or the generated netlists wont display anything when you run them in SIMetrix/SIMPLIS. This checkbox disabled by default.
The first time you use a SIMetrix/SIMPLIS simulator, Altium Designer will launch the SIMetrix/SIMPLIS application. You will see the small SIMetrix/SIMPLIS Command Shell dialog appear in the top left corner of your screen. The dialog can be minimized but not closed for SIMetrix/SIMPLIS features to function.
A Quick Tour
Once you have declared the installation location of your SIMetrix/SIMPLIS installation, you are ready to use this feature. Select File Open Project, which brings up the Choose Project to Open dialog Navigate to \Examples\Circuit Simulation\Boost Converter folder of your installation and open the Boost Converter.PrjPCB project. If you have installed Altium Designer in a custom location, navigate to this project accordingly In the Projects panel, open the Boost Converter.SchDoc Schematic Document. This is a simple DCDC converter circuit
Note: There is a SIMetrix/SIMPLIS equivalent of this circuit in your SIMetrix/SIMPLIS installation under C:\Program Files\SIMetrix53\examples\SIMPLIS\Boost_Converter\Startup.sxsch. If you have installed the SIMextrix/SIMPLIS application in a custom location, navigate to this file accordingly. View this file to see how SIMetrix/SIMPLIS and Altium Designer concepts match up. In order to run a simulation, you need to provide every component with a Simulation model. Many of the components have been placed from existing libraries such as Miscellaneous Devices.IntLib. If a library component has a Simulation model that works in Advanced Sim, then it is likely to work in SIMetrix and SIMPLIS without modification. The Model Compatibility section describes some exceptions in handling simulation models. Some components have been placed from a library called SIMetrix Devices.IntLib which is part of the project and can be seen in the Projects Panel under Libraries\Compiled Libraries. This library contains Simulation models sourced from the SIMetrix/SIMPLIS model library. As with Advanced SIM models, SIMetrix and SIMPLIS models can also be added to your project directly or compiled into your own integrated library. Refer to the document, Building an Integrated Library for more information about building your own libraries.
The approach you choose will depend on the complexity of the component, the availability of suitable models and the level of detail required in your simulation. Circuit simulation can sometimes be complex and the option to get a second opinion on a difficult circuit which has accuracy or convergence issues is a favourable capability. In the Boost Converter.SchDoc, examine the Component Properties of the two MOSFET components, Q1 and Q2. Each component has two Simulation models: IRF530 and SIMetrix_IRF530.
Figure 2: The IRF530 Simulation models for the component in the Component Properties dialog
The IRF530 Simulation model comes from the component manufacturer and is compatible with all three simulators. SIMetrix_IRF530 is from the SIMetrix/SIMPLIS model library and uses a proprietary SIMetrix feature to model the nonlinear capacitance between gate and drain terminals. This feature is said to improve accuracy and performance in SIMetrix but is not currently compatible with Advanced Sim. Alternatively, examine the Component Properties of the UC3842 component, U1. This is a relatively complex component so it requires native models for each of the three simulators: UC3842B for Advanced Sim, SIMetrix_UC3842 for SIMetrix, and SIMPLIS_UC3842 for SIMPLIS. Refer to the Simulation Models section for more detailed information.
Setting Up Simulation
To setup the simulation in SIMPLIS, select the Design Simulate SIMPLIS command. The Analyses Setup dialog appears as shown in Figure 3.
Figure 3: Choosing options in the Analyses Setup dialog for SIMPLIS simulator
This Analyses Setup dialog is split into two sections. The left hand side of the dialog allows you to configure your Analyses/Options. The right hand side of the dialog changes depending on the Analyses/Option selected. General Setup allows you to select the signals to display on the right hand side of the dialog. For this example we are interested in the output voltage V_OUT and the current through a few components. The set of analysis types in the left hand side of this dialog are different in each simulator. SIMPLIS supports three types: Periodic Operating Point Analysis, Transient Analysis and AC Small Signal Analysis. This simulation is a Transient Analysis. To view the analysis parameters, click on Transient Analysis.
The parameters that can be set for each analysis type are different in each simulator. Transient Analysis in SIMPLIS has three parameters: a Start Time, a Stop Time, and a Step Time. You can set a default Transient Start, Stop and Step Time by enabling the Use Transient Defaults checkbox. The defaults are calculated based on the time periods of the sources in your circuit. In this example, the last transition representing a sudden change in load occurs 8ms after the power up, so the default would be to run the simulation for over 8ms. To see the output voltage settling for a little while longer than this, populate the Stop Time with a value of 10ms manually. Altium Designer remembers the settings you populate in the Analyses Setup dialog. Each time you run a simulation, the settings are remembered from your last simulation. This is true for parameters that the different simulators have in common, if you switch simulators, making it easy to run the same simulation in SIMPLIS and Advanced Sim and compare the results. Note: Ensure that you always have the project file containing the schematic with simulation data open as any simulation settings you choose from Free Documents in the Projects panel will be lost when you close the file. The Design Simulate menu has two more options: Mixed Sim for running Advanced Sim, and SIMetrix for running SIMetrix. This example works with all three simulators. Due to the different approximations made by each simulator, the results are slightly different. This is most noticeable in the graph of the current through the diode D1 shown below. Fortunately in this example, these differences have little effect on the stability of the output voltage.
It is important to understand the approximations made by your simulator. Remember that accuracy and simulation speed can sometimes be a delicate trade-off. You might like to experiment with the model for the D1 component and with the Advanced Options available in each simulator to get a feel for the different simulation models.
In Altium Designer, simulation results are displayed in a Simulation Data File with a *.sdf file extension.
SIMetrix/SIMPLIS Commands
This section describes the SIMetrix and SIMPLIS specific commands available in Altium Designer. If these commands are missing, ensure you have declared the location of your SIMetrix/SIMPLIS installation, as described in the Getting Started section.
Running Simulations
To run simulations, choose from the following commands: For Advanced Sim: Design Simulate Mixed Sim For SIMetrix: Design Simulate SIMetrix For SIMPLIS: Design Simulate SIMPLIS. All commands bring up the same Analyses Setup dialog. In General Setup for SIMetrix and SIMPLIS, the Collect Data For field is locked for Node Voltages, Supply and Device Current. In SIMetrix, the available analysis types are: Transient Analysis DC Sweep Analysis AC Small Signal Analysis Noise Analysis Pole-Zero Analysis Transfer Function Analysis. Periodic Operating Point Analysis Transient Analysis AC Small Signal Analysis. Refer to your Catena documentation for detailed descriptions on these analysis types.
Advanced Options for the three simulators are different. SIMPLIS has only a few advanced options. The only one you are likely to need is IGNORE_UNITS, which is enabled by default. SIMetrix and Advanced Sim, however, provide quite a few advanced options to control your simulations accuracy and convergence. Some Advanced Sim and SIMetrix options (like ABSTOL and VNTOL) are identical, and have much the same effect in both simulators. Settings for these options are shared between the two simulators. Others are similar but not identical so you have to set a differently-named option for each simulator. For example, the number of steps to use if you have to use the GMIN stepping algorithm is called GMINSTEP in Advanced Sim and GMINSTEPITERLIMIT in SIMetrix. Refer to the Advanced Simulation in SIMPLIS section in this document and the SIMetrix and SIMPLIS documentation for each simulator for more information about Advanced Options. SIMetrixs multi-step analysis types (Device Sweep, Parameter Sweep, Model Parameter Sweep, Temperature Sweep, Frequency Sweep, Snapshot, and Monte Carlo) are not supported in this release of Altium Designer. To use these analysis types, you can export your Schematic to SIMetrix/SIMPLIS format (see below) and run them from the SIMetrix/SIMPLIS application.
Advanced Sim
To generate an Advanced Sim Netlist in Altium Designer: Select the Design Netlist For Project XSpice command Open the netlist which is saved in a .nsx file, displayed under the Generated\Advanced Sim Netlists in the Projects Panel Select the Simulate Run command to run this netlist. To run the Advanced Sim Netlist in Altium Designer:
SIMetrix
To generate a SIMetrix netlist in Altium Designer:
Select the Design Netlist For Project SIMetrix command Select the Simulator Run Netlist command and navigate to find your file
SIMPLIS
To generate a SIMPLIS netlist in Altium Designer: Select the Design Netlist For Project SIMPLIS command Select the SIMPLIS Run Netlist command To run the SIMPLIS netlist, open the SIMetrix/SIMPLIS application The file names for both SIMetrix and SIMPLIS netlists have the file extension *.net so be careful not to overwrite a netlist file with output from the two different simulators. Remember to enable the Display graph sheets in SIMetrix instead of Altium Designer option in DXP Preferences, or the generated netlists wont actually display anything when you run them in SIMetrix/SIMPLIS.
Simulation Models
Until now, all the Simulation models you have seen were preloaded from integrated libraries. This is the easiest way to use Simulation models as all the work of setting up the models was done in the Library Editor. Eventually you will want to set up your own Simulation models, either because you cant find a particular component in any library, or because you want to make your own integrated libraries. The method in both cases is the same. SIMetrix/SIMPLIS Simulation models are very similar to Altium Designer models so you will find a brief description here focusing on the SIMetrix/SIMPLIS-specific features. Refer to the Simulation Models and Analyses Reference for more in-depth information.
In addition, the appearance of the Parameters tab for the common SIMetrix Electrolytic Capacitor and Lossy Inductor components is similar to those of the built-in model Kinds. When you change the Level parameter, the parameters that are not used at that detail level are grayed out. The Initial Voltage and Initial Current parameters are especially important for SIMPLIS remember that a blank initial condition is quite different from an initial condition of 0. Each initial condition field actually corresponds to two model parameters named IC and USE_IC. Again, you will only see these if you enable the Component Parameter option for an Initial Voltage or Initial Current.
Figure 10: Entering the values for the Initial Conditions manually
This release of Altium Designer does not automatically populate initial condition parameters from successful SIMPLIS simulations as it does with SIMetrix/SIMPLIS. If SIMPLIS fails to converge on an initial operating point, you may have to populate some initial conditions manually. Try using information from previous simulation runs, from other simulators, from exporting your Schematic to SIMetrix/SIMPLIS or from your own knowledge of the circuit.
SIMetrix/SIMPLIS application folder (usually C:\Program Files\SIMetrix53\support\models). SIMetrix/SIMPLIS model files can be used like Advanced Sim model files. They can be: 1. Added to your project in the Projects panel 2. Added to your installed libraries in the Libraries panel 3. Declared in the In File or Full Path fields of the Sim Model dialog accessed by double-clicking on your Simulation Model in the Component Properties dialog 4. Compiled into an integrated library. Advanced Sim model files have file extensions *.ckt and *.mdl, and usually contain one model each. SIMetrix/SIMPLIS model files all have file extensions *.lb, and each one contains dozens or even hundreds of models. If you click on the Model File tab at the bottom of your SIM Model dialog, you will see where your model is in the file by scrolling the view down to the beginning of the model. An important difference is that Altium Designer gives all SIMetrix and SIMPLIS models names beginning with SIMetrix_ or SIMPLIS_. This helps you recognize which models are intended for which simulator and also helps you tell your models apart. For example, the UC3842 component has two models in the SIMetrix/SIMPLIS model library: one called SIMetrix_UC3842 and another called SIMPLIS_UC3842. If the SIMetrix or SIMPLIS model name already begins with SIMetrix_ or SIMPLIS_ , then Altium Designer doesnt add the prefix again. SIMPLIS_XOR is SIMPLIS_XOR in Altium Designer, not SIMPLIS_SIMPLIS_XOR which would be redundant.
Model Compatibility
Finding models compatible with your simulator may be difficult. There are many different simulators available and if you try to use a model designed for a different simulator, your simulation may behave erratically. With three different simulators that you might want to use, the problem of finding models for every component (not to mention the time it would take to set them all up) could become time consuming. Fortunately, if you are missing a native Advanced Sim, SIMetrix, or SIMPLIS model for a component, then Altium Designer will convert the best model you have available to your target simulator. This lets you mix and match Advanced Sim, SIMetrix, and
Version (v1.1) Apr 21, 2008
10
SIMPLIS models. For many components, you will only need one model. For complex or critical components, you can attach specialized models that have been tuned for each simulator. Altium Designer can convert many different kinds of models. There are still a few models that it cannot convert due to limitations in the simulator or because the feature has not been implemented yet. If you try to set up a model that is incompatible with one or more simulators, Altium Designer will warn you with the following message: This model may be incompatible with SIMPLIS in the Sim Model editor dialog, under the model location,
Altium Designer does not prevent you from using the model in that simulator. You may experience errors either from Altium Designers model conversion process or from the target simulator. The following model types are currently incompatible with Advanced Sim: 1. SIMetrixs proprietary code models (ad_converter, adc_schmitt, da_converter, d_init, d_logic_block, d_open_c, and d_open_e). 2. SIMetrixs proprietary MOSFET model (NMOS and PMOS LEVEL=17). 3. SIMetrixs saturable inductor models (CORE and CORENH). The following model types are currently incompatible with SIMetrix: 1. Uniform Distributed RC models (URC) 2. Altium Designer SimCode models (simcode, xadc, xdac, xdav, and xsimcode) The following model types are currently incompatible with SIMPLIS: 1. Equation Voltage and Current Sources (B) 2. Single Frequency FM Voltage and Current Sources (SFFM) 3. JFETs (NJF and PJF) 4. MESFETs (NMF and PMF) 5. Lossless Transmission Lines (T) 6. Lossy Transmission Lines (LTRA) 7. Uniform Distributed RC models (URC) 8. SIMetrixs saturable inductor models (CORE and CORENH). The source of the incompatibility can be from the model file or the Netlist Template. For example, an Equation source wont be compatible with SIMPLIS, whether have you explicitly selected the model Kind Voltage Source/Equation, or used a General/Spice Subcircuit or General/Generic Editor model file that contains a SPICE B statement.
Version (v1.1) Apr 21, 2008
11
Figure 13: Choosing which Model Library to use from the Browse Libraries dialog
Next to Libraries, select a model file or a library from the list box. Only model files and libraries in your project and your installed or buttons. Once you have selected a file, scroll down libraries are in the list, but you can also browse by clicking on the list of models and click on the name of the model you want. To narrow your search, type part of the model name in the Mask field. Once you have found the model, click the OK button. Altium Designer will populate the models Name, Description, Kind, and Sub-Kind fields for you.
12
2. If there is no SIMPLIS model, the SIMetrix model is used instead. The reason for this is that SIMetrix models are generally better suited for conversion to SIMPLIS than average SPICE models 3. Alternatively, the current (Advanced Sim) model is used. These rules have been designed to choose the best model for each simulator. If you find that you need to switch models on a component frequently, consider creating a library with multiple versions of that component, each with a different set of Simulation models.
For more information about SIMPLIS analysis modes, refer to your Catena documentation.
SIMPLIS Devices.IntLib
SIMPLIS Devices.IntLib is a library of components with primitive SIMPLIS models. Primitive in this case means that each component corresponds to exactly one of the model statements from Chapter 4 in the SIMPLIS Reference Manual. SIMPLIS devices cannot be used in a real circuit, they are useful for modelling. You can use them in a circuit to model certain effects that you know how to approximate with piecewise linear functions. You can use them when drawing up a SIMPLIS model for a complex component as an Altium Designer Schematic. SIMPLIS devices are of course designed for SIMPLIS and they are also compatible with other simulators. Altium Designer can automatically convert all SIMPLIS primitives into equivalent models for Advanced Sim and SIMetrix. The results you get in these simulators wont be as fast or accurate as in SIMPLIS.
13
Self-Oscillating Converter
Open an example of a circuit using SIMPLIS devices and AC Analysis. select File Open Project and when the Choose Project to Open dialog appears, navigate to C:\Program Files\Altium Designer\Examples\Circuit Simulation\Self-Oscillating Converter folder and open the Self-Oscillating Converter.PrjPCB project. This is a DCDC converter circuit. The Simulation models in this circuit have been set up with SIMPLIS in mind so you wont get useful results in Advanced Sim or SIMetrix without some modification. The SIMPLIS PERIODIC_OP component X1 is connected to the gate terminal of the MOSFET Q1. Whenever this voltage goes above VREF (2.5 V by default), it signals a switching event to SIMPLIS. Run the simulation to see the result. The Show Progress option has been turned on so you can see the number of cycles it takes for the circuit to reach its periodic operating point. The piecewise linear inductor component L2 models the saturation effect in the transformer TX2. This is a well-known property of real transformers where the inductance of the coils is not a constant, but falls off when the core starts to saturate. In this example, it has been placed as a component in parallel with the primary winding of the transformer, but it can almost as easily be incorporated into the transformers model file. The piecewise linear function itself has been approximated from knowledge of the core materials permeability. SIMPLIS does not yet provide an automatic method for creating a piecewise linear approximation from this knowledge. The piecewise linear fit is a trade-off between simulation accuracy and performance. The model file of the optocoupler component U1 may look a little strange because it was created by generating a netlist from the gen_opto Schematic used in several Transim circuit templates. There are many different ways to model this component, again trading off accuracy and performance.
Full-Bridge Converter
For another example of a circuit using AC Analysis, select File Open Project and when the Choose Project to Open dialog appears, navigate to C:\Program Files\Altium Designer\Examples\Circuit Simulation\ Full-Bridge Converter folder and open the Full-Bridge Converter.PrjPCB project. This is another DCDC converter circuit. This circuit has been set up with SIMPLIS in mind, so make sure you run this one in SIMPLIS. The SIMPLIS PERIODIC_OP component X1 in this example is connected to the clock synch output of the UC1825 controller device U1. For this example we need to divide the clock down by two, so the signal has been fed through a Toggle Flip-Flop first (The PERIODIC_OP component also has a Divide By Two parameter that does the same thing) Run the simulation to see the result. The signals in Transient Analysis might look erratic but this is because the default scale on the vertical axis shows the most detail. Try changing the scale by clicking on the axes or adding signals to the simulation and displaying multiple waves on the same plot by using Add Wave To Plot on the right-click menu. The initial conditions on the capacitor and inductor components are essential for SIMPLIS to find the initial operating point. Try varying some of the initial conditions to see the effect this has on SIMPLIS.
14
Troubleshooting
Catena Software has been most helpful in modifying SIMetrix/SIMPLIS to allow it to be driven directly from Altium Designer. SIMetrix/SIMPLIS release 5.3j is still a new interface so you may experience occasional timeouts. For example, if you have a dialog open in SIMetrix/SIMPLIS, it may not respond to Altium Designer, and you will eventually see the Timed out message. If you ever see this message, close any open dialogs in SIMetrix/SIMPLIS, and try the operation again. Altium and Catena are aware of this problem, and it should be rectified in a future release.
Figure 15: Timed out error issue in Altium Designer with SIMetrix
15
Revision History
Date 14-Oct-2007 21-April-2008 11-Aug-2011 Version No. 1.0 1.1 Revision New document release Page Size updated to A4. Updated template.
Software, hardware, documentation and related materials: Copyright 2011 Altium Limited. All rights reserved. You are permitted to print this document provided that (1) the use of such is for personal use only and will not be copied or posted on any network computer or broadcast in any media, and (2) no modifications of the document is made. Unauthorized duplication, in whole or part, of this document by any means, mechanical or electronic, including translation into another language, except for brief excerpts in published reviews, is prohibited without the express written permission of Altium Limited. Unauthorized duplication of this work may also be prohibited by local statute. Violators may be subject to both criminal and civil penalties, including fines and/or imprisonment. Altium, Altium Designer, Board Insight, DXP, Innovation Station, LiveDesign, NanoBoard, NanoTalk, OpenBus, P-CAD, SimCode, Situs, TASKING, and Topological Autorouting and their respective logos are trademarks or registered trademarks of Altium Limited or its subsidiaries. All other registered or unregistered trademarks referenced herein are the property of their respective owners and no trademark rights to the same are claimed.
16