1st Tutorial on PSpice
- 格式:pdf
- 大小:272.82 KB
- 文档页数:8
第二章PSPICE使用本章通过对一个共射极放大电路的仿真分析,学习PSpice软件的使用方法,掌握PSpice 软件分析电子电路的基本过程。
使用PSpice软件的步骤是:第一步:通过电路图编辑程序(Schematics Editor程序)输入编辑电路图;第二步:在电路图编辑程序中设置电路的分析方式和参数;第三步:运行电路仿真分析程序(PSpice程序);第四步:运行图形后处理程序(Probe程序)查看输出图形或查看电路输出文件。
第一节认识Schematics电路图编辑程序一、启动Schematics程序PSpice软件7.1版本是Windows应用程序,因此,应先启动Windows操作系统,Windows 操作系统可以是Windows 3.x 或Windows 95或Windows 98,本书都是在Windows 98操作系统下完成的,并且假定读者已掌握Windows 98操作系统的使用,如果读者尚没有掌握Windows 98操作系统的使用,应先了解Windows 98操作系统;如果读者使用的是Windows 3.x 或Windows 95操作系统,则在Windows系统操作上会略有不同,但PSpice显示的内容都是一样的,相信不应该出现什么大的困难。
使用PSpice软件总是从输入电路图开始,除非你已经直接在电路描述文件中输入了电路所需的数据,因此,使用PSpice软件通常是从Schematics电路图编辑程序开始的。
而且在Schematics电路图编辑程序中可以设置电路的分析方式和参数,可以通过菜单命令启动电路仿真分析程序(PSpice程序)及图形后处理程序(Probe程序)。
假定已经安装了PSpice软件的7.1版本,并且已经启动了Windows 98操作系统,则启动Schematics电路图编辑程序有三种方法:1. 选择开始菜单上的程序组>>MicroSim Eval 7.1程序组>>Schamatics程序项。
Pspice8.0快速入门手册目的:帮助初学者了解Pspice8.0的简单操作及使用方法,较深入的探讨还是好参考其他书籍及读者自行学习。
步骤:一、放置所需元件(包括电源)二、连接导线三、设定要执行的模拟内容四、设定Probe五、执行模拟六、利用Probe观察模拟结果七、将数据取出用其它软件画图八、补充说明开始模拟电路之前,必须先用[Schematic]将电路图画出来。
一、放置元件(包括电源)1、先开启[Schematic],点选[Draw/Get New Part],或按工具栏上的图标:2、即可打开如下对话框:(这是Advanced选单,Basic选单则无Search功能)你可以直接在Part Name处键入元件名称,例如需要一个电阻则键入R。
或你可以电选Libraries,再从其中点选。
你如果用的是 Pspice教学免费版,提供的Lebraries有限,但已能满足学习需求,不用担心。
常用的Librares内容如下:ANALOG.slb 常用的被动元件BREAKOUT.slb 可改变参数的基本元件SOURCE.slb 电源及信号源PORT.slb 接地及连接器ERAL.slb 常用的半导体元件(这是免费版专属元件库)3、确定元件后,按[Place]即可将元件拖放到电路图上,按一下鼠标左键,就可以将元件放在图面上,按右键则结束。
放完元件后,按的Close钮关闭对话框。
要改变元件的方向,可点选该元件,在执行[Edit/Rotate]菜单命令(快捷键Ctrl+R)或[Edit/Flip](快捷键Ctrl+F)。
4、要改变元件的参数(或称Attributes),可双击该元件,打开元件属性对话框。
如下图是一电阻,在1处点选VALUE,在2处键入需要的电阻值即可,然后按[Save Arrr],在按[OK]钮完成。
回到文件顶端二、连接导线1、利用连线工具(Draw Wire)画导线。
2、点选画线工具后,即可看到一个铅笔状的指示。
OrCAD PSpice 培训教材深圳光映计算机软件有限公司培训目标:熟悉PSpice的仿真功能,熟练掌握各种仿真参数的设置方法,综合观测并分析仿真结果,熟练输出分析结果,能够综合运用各种仿真对电路进行分析,学会修改模型参数。
一、PSpice分析过程二、绘制原理图原理图的具体绘制方法已经在Capture中讲过了,下面主要讲一下在使用PSpice时绘制原理图应该注意的地方。
1、新建Project时应选择Analog or Mixed-signal Circuit2、调用的器件必须有PSpice模型首先,调用OrCAD软件本身提供的模型库,这些库文件存储的路径为Capture\Library\pspice,此路径中的所有器件都有提供PSpice 模型,可以直接调用。
其次,若使用自己的器件,必须保证*.olb、*.lib两个文件同时存在,而且器件属性中必须包含PSpice Template属性。
3、原理图中至少必须有一条网络名称为0,即接地。
4、必须有激励源。
原理图中的端口符号并不具有电源特性,所有的激励源都存储在Source和SourceTM库中。
5、电源两端不允许短路,不允许仅由电源和电感组成回路,也不允许仅由电源和电容组成的割集。
解决方法:电容并联一个大电阻,电感串联一个小电阻。
6、最好不要使用负值电阻、电容和电感,因为他们容易引起不收敛。
三、仿真参数设置1、PSpice能够仿真的类型在OrCAD PSpice中,可以分析的类型有以下8种,每一种分析类型的定义如下:直流分析:当电路中某一参数(称为自变量)在一定范围内变化时,对自变量的每一个取值,计算电路的直流偏置特性(称为输出变量)。
交流分析:作用是计算电路的交流小信号频率响应特性。
噪声分析:计算电路中各个器件对选定的输出点产生的噪声等效到选定的输入源(独立的电压或电流源)上。
即计算输入源上的等效输入噪声。
瞬态分析:在给定输入激励信号作用下,计算电路输出端的瞬态响应。
April 2016© 2013Cadence Design Systems, Inc. All rights reserved.Portions © Apache Software Foundation, Sun Microsystems, Free Software Foundation, Inc., Regents of the University of California, Massachusetts Institute of T echnology, University of Florida. Used by permission. Printed in the United States of America.Cadence Design Systems, Inc. (Cadence), 2655 Seely Ave., San Jose, CA 95134, USA.Product PSpice contains technology licensed from, and copyrighted by: Apache Software Foundation, 1901 Munsey Drive Forest Hill, MD 21050, USA © 2000-2005,Apache Software Foundation. Sun Microsystems, 4150 Network Circle, Santa Clara, CA 95054 USA © 1994-2007, Sun Microsystems, Inc. Free Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA © 1989, 1991, Free Software Foundation, Inc. Regents of the University of California, Sun Microsystems, Inc., Scriptics Corporation, © 2001, Regents of the University of California. Daniel Stenberg, © 1996 - 2006, Daniel Stenberg. UMFPACK ©2005,TimothyA.Davis,UniversityofFlorida,(**************.edu).KenMartin,WillSchroeder,Bill Lorensen © 1993-2002, Ken Martin, Will Schroeder, Bill Lorensen. Massachusetts Institute of Technology, 77 Massachusetts Avenue, Cambridge, Massachusetts, USA © 2003, the Board of Trustees of Massachusetts Institute of Technology. All rights reserved.Trademarks: Trademarks and service marks of Cadence Design Systems, Inc. contained in this document are attributed to Cadence with the appropriate symbol. For queries regarding Cadence’s trademarks, contact the corporate legal department at the address shown above or call 800.862.4522.Open SystemC, Open SystemC Initiative, OSCI, SystemC, and SystemC Initiative are trademarks or registered trademarks of Open SystemC Initiative, Inc. in the United States and other countries and are used with permission.All other trademarks are the property of their respective holders.Restricted Permission: This publication is protected by copyright law and international treaties and contains trade secrets and proprietary information owned by Cadence. Unauthorized reproduction or distribution of this publication, or any portion of it, may result in civil and criminal penalties. Except as specified in this permission statement, this publication may not be copied, reproduced, modified, published, uploaded, posted, transmitted, or distributed in any way, without prior written permission from Cadence. Unless otherwise agreed to by Cadence in writing, this statement grants Cadence customers permission to print one (1) hard copy of this publication subject to the following conditions:1.The publication may be used only in accordance with a written agreement between Cadence and itscustomer.2.The publication may not be modified in any way.3.Any authorized copy of the publication or portion thereof must include all original copyright,trademark, and other proprietary notices and this permission statement.4.The information contained in this document cannot be used in the development of like products orsoftware, whether for internal or external use, and shall not be used for the benefit of any other party, whether or not for consideration.Disclaimer: Information in this publication is subject to change without notice and does not represent a commitment on the part of Cadence. Except as may be explicitly set forth in such agreement, Cadence does not make, and expressly disclaims, any representations or warranties as to the completeness, accuracy or usefulness of the information contained in this document. Cadence does not warrant that use of such information will not infringe any third party rights, nor does Cadence assume any liability for damages or costs of any kind that may result from use of such information.Restricted Rights: Use, duplication, or disclosure by the Government is subject to restrictions as set forth in FAR52.227-14 and DFAR252.227-7013 et seq. or its successor.ContentsBefore you begin. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 Welcome . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 How to use this guide . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 Symbols and conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 Related documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 What this user’s guide covers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 PSpice overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 Add-on options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 PSpice Smoke Option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 PSpice Advanced Optimizer Option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 PSpice Advanced Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 SLPS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 If you don’t have the standard PSpice A/D package . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 Comparison of the different versions of PSpice . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 If you have PSpice Lite . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 Minimum hardware requirements for running PSpice: . . . . . . . . . . . . . . . . . . . . . . . . 32 PSpice Samples and T utorials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 Part one: Simulation primer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 1Things you need to know . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 Chapter overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 What is PSpice? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 Analyses you can run with PSpice . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 Basic analyses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 Advanced multi-run analyses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 Analyzing waveforms with PSpice . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 What is waveform analysis? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 Using PSpice with other programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 Using design entry tools to prepare for simulation . . . . . . . . . . . . . . . . . . . . . . . . . . 47What is the PSpice Stimulus Editor? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 What is the PSpice Model Editor? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 Files needed for simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 Files that design entry tool generates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 Other files that you can configure for simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 Files that PSpice generates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 Directory structure for analog projects in Capture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 How are files configured at the design level maintained in the directory structure for analog projects? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 How are files configured at the profile level maintained in the new directory structure for analog projects? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 What happens when I convert an analog project that uses a design from another project or from another location? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 What should I do if the schematic for a converted analog project uses FILESTIM n parts from the SOURCE library? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 Design Entry HDL libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64 Reference Libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 Local libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 PSpice model libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69 The cds.lib file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69 Encrypting PSpice Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 Using PSpiceEnc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 Using Model Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 722Simulation examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 Chapter overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 Example circuit creation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76 Using Capture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76 Using Design Entry HDL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 Using Design T emplates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93 Finding out more about setting up your design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95 Running PSpice . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95 Performing a bias point analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96 Using the simulation output file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98 Finding out more about bias point calculations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99DC sweep analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99 Setting up and running a DC sweep analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99 Displaying DC analysis results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101 Finding out more about DC sweep analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107 T ransient analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108 Finding out more about transient analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115 AC sweep analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116 Setting up and running an AC sweep analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116 AC sweep analysis results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120 Finding out more about AC sweep and noise analysis . . . . . . . . . . . . . . . . . . . . . . . 122 Parametric analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123 Setting up and running the parametric analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126 Analyzing waveform families . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130 Finding out more about parametric analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133 Performance analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134 Finding out more about performance analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136Part two: Design entry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1383Preparing a design for simulation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139 Chapter overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139 Checklist for simulation setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140 T ypical simulation setup steps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140 Advanced design entry and simulation setup steps . . . . . . . . . . . . . . . . . . . . . . . . . 141 When netlisting fails or the simulation does not start . . . . . . . . . . . . . . . . . . . . . . . . 142 Using parts that you can simulate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143 Vendor-supplied parts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144 Passive parts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152 Breakout parts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153 Behavioral parts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154 Simulating asymmetric parts in PSpice . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155 Simulating homogenous parts in PSpice . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156 Specifying values for part properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157 Using global parameters and expressions for values . . . . . . . . . . . . . . . . . . . . . . . . . . 158Global parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158 Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162 Defining power supplies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170 For the analog portion of your circuit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170 For A/D interfaces in mixed-signal circuits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170 Defining stimuli . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172 Analog stimuli . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172 Digital stimuli . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176 Things to watch for . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178 Unmodeled parts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178 Unconfigured model, stimulus, or include files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182 Unmodeled pins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184 Missing ground . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184 Missing DC path to ground . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1854Creating and editing models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187 Chapter overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187 What are models? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189 How are models organized? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190 Model libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190 Model library configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191 Global vs. design vs. profile models and libraries . . . . . . . . . . . . . . . . . . . . . . . . . . 191 Nested model libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192 PSpice-provided models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193 Model library data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193 Device characteristic curves-based models vs. Template-based models . . . . . . . . 195 T ools to create and edit models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197 Ways to create and edit models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198 Using the Model Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200 Ways to use the Model Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201 Running the Model Editor alone . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202 Starting the Model Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203 Creating models using the Model Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203 Creating models based on device characteristic curves . . . . . . . . . . . . . . . . . . . . . 203Creating models based on PSpice templates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209 Importing an existing model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212 Enabling and disabling automatic part creation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213 Running the Model Editor from the schematic editor . . . . . . . . . . . . . . . . . . . . . . . . 215 Model creation examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218 Example: Creating a PSpice model based on device characteristic curves . . . . . . . 219 Example: Creating template-based PSpice model . . . . . . . . . . . . . . . . . . . . . . . . . . 228 Editing model text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234 Example: editing a Q2N2222 instance model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236 Using the Create Subcircuit Format Netlist command (Capture only) . . . . . . . . . . . . . . 237 Changing the model reference to an existing model definition . . . . . . . . . . . . . . . . . . . 239 Reusing instance models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 240 Reusing instance models in the same schematic . . . . . . . . . . . . . . . . . . . . . . . . . . 241 Making instance models available to all designs . . . . . . . . . . . . . . . . . . . . . . . . . . . 241 Configuring model libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243 The Configuration Files tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244 How PSpice uses model libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245 Adding model libraries to the configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248 Changing the model library scope from profile to design, profile to global, design to global and vice versa . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 249 Changing model library search order . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250 Changing the library search path . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252 Handling smoke information using the Model Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . 254 Adding smoke information to PSpice models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254 Creating template-based PSpice models with smoke information . . . . . . . . . . . . . . 256 Using the Model Editor to edit smoke information . . . . . . . . . . . . . . . . . . . . . . . . . . 256 Examples: Smoke . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257 Adding smoke information to the D1 diode model . . . . . . . . . . . . . . . . . . . . . . . . . . 257 Adding smoke information to the OPA_LOCAL operational amplifier model . . . . . . 259 Smoke parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 260 Diode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 261 Bipolar Junction Transistors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 262 Magnetic Core . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 264 Ins Gate Bipolar T ransistor (IGBT) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 264 Junction FET . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 266 Operational Amplifier . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 268MOSFET . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270 Voltage Regulator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 271 Darlington T ransistor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2735Creating parts for models. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275 Chapter overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275 What’s different about parts used for simulation? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 276 Ways to create parts for models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277 Preparing your models for part creation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279 Starting the Model Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 280 Using the Model Editor to create parts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281 Batch mode of part creation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281 Interactive mode of part creation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281 Creating Design Entry T ool parts for all models in a library . . . . . . . . . . . . . . . . . . . . . . 282 Using batch mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 282 Using interactive mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284 Setting up automatic part creation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289 Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 290 Creating parts in the batch mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 290 Creating parts using interactive mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 296 Basing new parts on a custom set of parts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 300 Editing part graphics (Capture only) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303 How Capture places parts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303 Defining grid spacing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 304 Attaching models to parts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 306 MODEL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 306 Defining part properties needed for simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 308 PSPICETEMPLATE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 310 IO_LEVEL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319 MNTYMXDL Y . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320 PSPICEDEFAULTNET . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3216Analog behavioral modeling. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323 Chapter overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323 Overview of analog behavioral modeling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 324 The ABM part library file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325 Placing and specifying ABM parts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 326 Net names and device names in ABM expressions . . . . . . . . . . . . . . . . . . . . . . . . . 326 Forcing the use of a global definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 327 ABM part templates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 328 Control system parts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 329 Basic components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 332 Limiters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 333 Chebyshev filters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 334 Integrator and differentiator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 338 T able look-up parts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339 Laplace transform part . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 344 Math functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 348 ABM expression parts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 349 An instantaneous device example: modeling a triode . . . . . . . . . . . . . . . . . . . . . . . 353 PSpice-equivalent parts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 356 Implementation of PSpice-equivalent parts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 357 Modeling mathematical or instantaneous relationships . . . . . . . . . . . . . . . . . . . . . . 358 Lookup tables (ET ABLE and GT ABLE) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 362 Frequency-domain device models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 364 Laplace transforms (LAPLACE) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 364 Frequency response tables (EFREQ and GFREQ) . . . . . . . . . . . . . . . . . . . . . . . . . 366 Cautions and recommendations for simulation and analysis . . . . . . . . . . . . . . . . . . . . . 369 Instantaneous device modeling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 369 Frequency-domain parts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 370 Laplace transforms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 370 T rading off computer resources for accuracy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 374 Basic controlled sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 375 Creating custom ABM parts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 375。
3rd Tutorial on PSpiceSimple Subcircuits in PSpiceOne of the more useful concepts in PSpice is the use of subcircuits to group elements into clusters in order to replicate the clusters without having to re-enter all the elements each time. This is very useful for several reasons. First is the labor savings of replacing many lines of circuit data with a single subcircuit call. Second, the use of a subcircuit usually improves clarity by removing confusing clutter. The user can suppress printing unwanted details internal to a subcircuit, thus making the output easier to understand. If desired, the user can place often-used subcircuits into an include file so that the main source file for the problem is kept simple. Then the definition of the subcircuit is out of sight entirely.Coding a SubcircuitEach subcircuit used in a study must have a unique name. This is true of any other circuit element. Also, there must be a list of at least two nodes that can be connected to elements external to the subcircuit. A subcircuit can have many external node connections, if needed. Later, we will find that parameters can be passed to a subcircuit in order to allow unique behavior and responses from an instance of a subcircuit.The initial line of a subcircuit section must begin with ".SUBCKT," followed by the name and then the external node list. After that, optional features (not to be discussed yet) can be added. The best method of understanding the use of a subcircuit is by example. Below, we find a cluster of components that can be combined into a subcircuit.Note that nodes 5, 12 and 18 have external connections. Therefore, they must be included in the node list in the subcircuit definition. Nodes 10 and 13 do not have external connections and need not be (indeed should not be) included in this node list. They are internal nodes and will be used to help define the subcircuit. Now, we can code the above subcircuit as follows. Note that the code could be embedded into the rest of the code for the main circuit or could be placed in a separate include file.* name nodelist.SUBCKT Example_1 5 12 18Iw 10 12 DC 10ARa 5 12 5.0Rb 5 13 4.0Rc 12 13 2.0Rd 5 18 8.0Re 13 18 3.0Rf 10 13 1.0Rg 10 18 6.0.ENDSNote that the subcircuit section must be terminated with a ".ENDS" command.Invoking a SubcircuitAll subcircuit calls are made by declaring a part with a unique name beginning with "X," followed by the node list and then the subcircuit name. The node list in the calling statement must have the same number of nodes as the node list in the subcircuit definition. To demonstrate the use of the calling statement, we present the following main circuit which contains two instances of the above subcircuit. X1 and X2 are the two instances of the subcircuit "Example_1." For added clarity, the subcircuit's defined external nodes are shown in parentheses. Note that these nodes are mapped into the main circuit by different names.The code for the above circuit with the subcircuit included follows:Subcircuit Example No. 1* name nodelist.SUBCKT Example_1 5 12 18Iw 10 12 DC 10ARa 5 12 2.0Rb 5 13 5.0Rc 12 13 2.0Rd 5 18 8.0Re 13 18 3.0Rf 10 13 1.0Rg 10 18 6.0.ENDSVs 1 0 DC 50VRa 1 2 1.0 ; different from Ra aboveRb 3 4 3.0 ; different from Rb aboveRc 7 0 25.0 ; different from Rc aboveRd 6 0 45.0 ; different from Rd above* nodelist nameX1 2 7 3 Example_1X2 4 6 5 Example_1.ENDScope of Element Names and Nodes in a SubcircuitScope of names and nodes is local to a subcircuit. In the main circuit of which the above subcircuit is a part, there is a node 5 and there are resistors with the names of "Ra," "Rb," "Rc," and "Rd," and PSpice can keep these apparent duplications separated. If the subcircuit were invoked as "X1," for example, PSpice would consider the subcircuit parts as "X1.Ra," "X1.Rb" and so on. Additionally, the internal node numbers would be treated as "X1.5," "X2.5," "X2.13" and so forth. Thus PSpice maintains uniqueness of element names and node numbers.Nesting of SubcircuitsSubcircuit calls may be nested as long as they are not circular. In other words, you can have a part name starting with "X" within a .SUBCKT/.ENDS block provided that the "X" part definition does not call on that block for its own definition.However, subcircuit definitions may not be nested. I.e., you can't have one .SUBCKT/.ENDS block nested within another.An Op-Amp ExampleAt this stage of knowledge about PSpice, we can model a simple op-amp as a subcircuit. Alas, we will not be able to show its saturation characteristics until we explain the use of the "TABLE" feature of PSpice. However, we can do a credible job of modeling an op-amp as long as it isn't allowed to saturate. The figure below illustrates this simple model of an op-amp.In an ideal op-amp, Ri, the input resistance, and A, the open-loop gain, are infinite. Also, Ro, the output resistance, is zero. Here, we will use "typical" values of a practical op-amp. Let A = 100,000, Ri = 500 kΩ, and Ro = 50 Ω. After all, PSpice doesn't accept infinity as a number and resistors cannot be set to zero. We will also use text for node designations here. Also, note the internal node "int" that is not included in thenode list. The key part to the op-amp is the voltage-controlled dependent voltage source designated as part "Ex" in the listing. For a more complete description of this part, see Tutorial No. 2, where dependent sources are introduced. Code to define the subcircuit follows..SUBCKT OpAmp p_in n_in com outEx int com p_in n_in 1e5Ri p_in n_in 500kRo int out 50.0.ENDSThe main circuit with which we will test this op-amp subcircuit follows. We will use a simple inverting amplifier circuit for which we can verify the results by inspection.Subcircuit Example No. 2 - Inverting OpAmp.SUBCKT OpAmp p_in n_in com outEx int com p_in n_in 1e5Ri p_in n_in 500kRo int out 50.0.ENDSVg 1 0 DC 50mVRg 1 2 5kRf 2 3 50kRL 3 0 20kX1 0 2 0 3 OpAmp.ENDThe output file (edited to remove excess lines, etc.,) is as follows:Subcircuit Example No. 2 - Inverting OpAmp**** CIRCUIT DESCRIPTION.SUBCKT OpAmp p_in n_in com outEx int com p_in n_in 1e5RI p_in n_in 500kRo int out 50.0.ENDSVg 1 0 DC 50mVRg 1 2 5kRf 2 3 50kRL 3 0 20kX1 0 2 0 3 OpAmpSubcircuit Example No. 2 - Inverting OpAmp**** SMALL SIGNAL BIAS SOLUTION TEMPERATURE = 27.000 DEG CNODE VOLTAGE NODE VOLTAGE NODE VOLTAGE NODE VOLTAGE( 1) .0500 ( 2) 5.017E-06 ( 3) -.4999 (X1.int) -.5017VOLTAGE SOURCE CURRENTSNAME CURRENTVg -9.999E-06TOTAL POWER DISSIPATION 5.00E-07 WATTSJOB CONCLUDEDTOTAL JOB TIME .19Discussion of ResultsHad this op-amp been ideal, the closed loop gain would have been -10 -(Rf / Rg). Then the output voltage would have been -0.5V. Instead, we calculated -0.4999V. Also, an ideal op-amp would have produced a voltage of zero at the negative input. Instead, we see about 5 microvolts. These discrepancies are due to the more realistic model of the op-amp. Yet the difference is small. It seems that the concept of using the ideal op-amp model does not lead to excessive error in this case.The advantage of using the subcircuit in PSpice is now apparent. We could have replicated the subcircuit many times, using only one line of code per replication. Later, we will add to our knowledge of the features of subcircuits.Back to Main PageLast Modified: 10/02/2009 02:58:13。
Pspice教程(基础篇)Pspice教程课程内容:在这个教程中,我们没有提到关于网络表中的Pspice的网络表文件输出,有关内容将会在后面提到!而且我想对大家提个建议:就是我们不要只看波形好不好,而是要学会分析,分析不是分析的波形,而是学会分析数据,找出自己设计中出现的问题!有时候大家可能会看到,其实电路并没有错,只是有时候我们的仿真设置出了问题,需要修改。
有时候是电路的参数设计的不合理,也可能导致一些莫明的错误!我觉得大家做一个分析后自己看看OutFile文件!点一.直流分析直流分析:PSpice可对大信号非线性电子电路进行直流分析。
它是针对电路中各直流偏压值因某一参数(电源、元件参数等等)改变所作的分析,直流分析也是交流分析时确定小信号线性模型参数和瞬态分析确定初始值所需的分析。
模拟计算后,可以利用Probe功能绘出V o- Vi曲线,或任意输出变量相对任一元件参数的传输特性曲线。
首先我们开启Capture / Capture CIS.打开如下图所示的界面( Fig.1)。
( Fig 1)我们来建立一个新的一程,如下方法打开! ( Fig.2)( Fig.2)我们来选取一个新建的工程文件!我们可以看到以下的提示窗口。
(Fig.3)(Fig.3)我们可以给这个工程取个名字,因为我们要做Pspice仿真,所以我们要勾选第一个选项,在标签栏中选中!其它的选项是什么意思呢?Analog or Mixed A/D 数模混合仿真PC Board Wizard 系统级原理图设计Programmable Logic Wizard CPLD或FPGA设计Schematic 原理图设计接下来我们看到了Pspice工程窗口,即我们的原理图窗口属性的选择。
(Fig.4)(Fig.4)我们在Creat based upon an existing project 下可以看到几个画版工程选项!其中包括:新的空的画版,带层次原理图的画版等等。
PSPICE库的生成与注册随着设计的复杂度越来越高,用PSPICE对电路进行仿真的需求就越来越多,随之产生如何将PSPICE模型和原理图SYMBOL链接起来就成了关键的一步,本文将就这一问题和大家作一个探讨。
下面分2种情况进行讨论:, k# O. v$(一) 无PSPICE模型,无SYMBOL,用PSPICE产生SYMBOL 并建立连接关系。
(二) 已有PSPICE和SYMBOL如何建立连接EDA365专业PC 首先大家知道PSPICE的模型库后缀名为lib, Symbol的后缀名为olb. 针对第一种情况:1.从网上下载PSPICE模型保存,以ON SEMICONDUCTOR的MJD44H1.LIB为例2.启动PSpice Model Editor模型编辑器,打开MJD44H1.LIB3.File\Export to Capture Part Library PCB论坛/ I7 p7 ?) r( V* _( y+ A4.点OK,系统自动生成元件外型(Symbol)库5.启动Capture CIS,File/Open/Library,打开MJD44H1.olb,查看Symbol,如需修改,自行编辑元件外型并保存。
EDA layout设计|高6.用记事本打开..C:\Cadence\SPB_15.7\tools\pspice\library\nom.lib,加入.lib"MJD44H1.LIB",注册MJD44H1.LIB;(有了第6.步,就不会出现ERROR -- Model ...... used by...... is undefined)建立元器件模型成功# q1 N7 i- M% K g8 h: mNotes:如想将多个类似的PSPICE模型集合在一起,下载后可以将后缀名LIB,改为MOD,启动PSpice Model Editor模型编辑器,model\import导入多个MOD文件,然后save as。
1st Tutorial on PSpiceIntroductionThe following information concerns the text-edited version of MicroSim PSpice, version 8. It is offered here solely for the purpose of helping undergraduate students complete their classroom assignments in computer-aided circuit analysis at the University of Texas at Arlington. No other use of these notes is supported by the University of Texas at Arlington.File Types Used and Created by PSpiceThe basic input file for PSpice is a text (ASCII) file that has the file type "CIR." In the beginning, this will be created by hand as the primary method of getting the circuit we want modeled into the PSpice program. Later, when we use the schematic capture program, it will create the *.CIR file for us, along with several auxiliary file types. Do not use a word processor to create these *.CIR files unless you "Save as" text or as ASCII. You can use Notepad to edit these files, but the best editor for this purpose is the one that is provided by MicroSim, called "TextEdit."The output file always generated by PSpice is a text (ASCII) file that has the file type "OUT." I.e., if you submit a data file to PSpice named "MYCIRKUT.CIR," it will create an output file named "MYCIRKUT.OUT." This output file is created even if your run is unsuccessful due to input errors. The cause for failure is reported in the *.OUT file, so this is a good place to start looking when you need to debug your simulation model. You examine the *.OUT file with the TextEdit or Notepad programs. When everything works properly, you will find the output results in this file if you are running a DC analysis. If you are running a transient analysis or a frequency sweep analysis, there will be too much data for the *.OUT file. In these cases, we add a command to the *.CIR file that tells PSpice to save the numerical data in a *.DAT file.The aforementioned *.DAT file is by default a binary (i.e., non-ASCII) file that requires a MicroSim application called PROBE for you to see the data. PROBE is installed with PSpice from the CD-ROM. If you want, you can change the default storage format to ASCII. This is not recommended because it requires more disk space to store the data in ASCII code. Later, we will describe the procedure for invoking PROBE and creating the *.DAT file. A companion file to the *.DAT file is the *.PRB file which holds initializing information for the PROBE program.Another common method used by experienced PSpice users is the use of *.INC (include) files. These enable us to store frequently used subcircuits that have not yet been added to a library. Then we access these*.INC files with a single command line in the *.CIR file. Very convenient.Other files used with PSpice are *.LIB files where the details of complex parts are saved; we may discuss this later, but it is unlikely that we will engage in LIB file alterations until you are taking advanced courses. When we begin using the schematic capture program that is bundled with PSpice, we will encounter some additional file types. These are the *.SCH (the schematic data, itself), *.ALS (alias files) and *.NET (network connection files).Some Facts and Rules about PSpicePSpice is not case sensitive. This means that names such as Vbus, VBUS, vbus and even vBuS are equivalent in the program.All element names must be unique. Therefore, you can't have two resistors that are both named"Rbias," for example.The first line in the data file is used as a title. It is printed at the top of each page of output. Youshould use this line to store your name, the assignment, the class and any other information appropriate for a title page. PSpice will ignore this line as circuit data. Do not place any actual circuit information in the first line.There must be a node designated "0." (Zero) This is the reference node against which all voltages are calculated.Each node must have at least two elements attached to it.The last line in any data file must be ".END" (a period followed by the word "end.")All lines that are not blank (except for the title line) must have a character in column 1, the leftmostposition on the line.Use "*" (an asterisk) in column 1 in order to create a comment line.Use "+" (plus sign) in column 1 in order to continue the previous line (for better readability ofvery long lines).Use "." (period) in column 1 followed by the rest of the "dot command" to pass specialinstructions to the program.Use the designated letter for a part in column 1 followed by the rest of the name for that part (nospaces in the part name).Use "whitespace" (spaces or tabs) to separate data fields on a line.Use ";" (semicolon) to terminate data on a line if you wish to add commentary information on that same line.The above basic information is essential to using PSpice. Learn and understand these issues now to facilitate your use of the program.References1. Spice: A Guide to Circuit Simulation and Analysis Using PSpice; Tuinenga, Paul W.; © 1992,1988 by Prentice-Hall, Inc.; ISBN: 0-13-747270; (my favorite)2. Computer-Aided Analysis Using SPICE; Banzhaf, Walter; © 1989 by Prentice-Hall, Inc.; ISBN: 0-13-162579-9; (another good reference)3. SPICE for Circuits and Electronics Using PSpice; Rashid, Muhammad H.; © 1990 by Prentice-Hall, Inc.; ISBN: 0-13-834672; (supports electronics well)4. SPICE for Power Electronics and Electric Power; Rashid, Muhammad H.; © 1993 by Prentice-Hall, Inc.; ISBN: 0-13-030420; (best for power electronics)Node Designations in PSpiceThe original SPICE program developed decades ago at U. C. Berkeley, accepted data only on BCD punch cards. That's why it was not case sensitive; developers have preserved this lack of case sensitivity for backward compatibility. In the original SPICE program, users were expected to designate nodes by number. Most users used small integers, and the numbers did not have to be contiguous. Today, most spice programs accept ordinary text for node designations. If you want to declare a node as "Pbus," you can. The only restriction seems to be that you can't embed spaces in a node name. Use the underscore ("_") character to simulate spaces.Out of habit, most users of PSpice still use small integers as node designations. This often improves the readability of a PSpice source file or output file. In general, you should avoid extremely long textual names for node designations. Naming a node "Arlington_Junior_Chamber_of_Commerce" makes your files look choppy and hard to read. Also, you will sometimes have to type that long cumbersome name when you are performing analysis on the output data file. My suggestion is to use small integers as node designators for most cases. However, use short descriptive names for nodes whenever clarity is improved. "T1_col," when used to designate the collector node of transistor, T1, carries a lot more meaning than "37."Large and Small Numbers in PSpicePSpice is a computer program used mostly by engineers and scientists. Accordingly, it was created with the ability to recognize the typical metric units for numbers. Unfortunately, PSpice cannot recognize Greek fonts or even upper vs. lower case. Thus our usual understanding and use of the standard metric prefixes has to be modified. For example, in everyday usage, "M" indicates "mega" (106) and "m" stands for milli (10-3). Clearly, this would be ambiguous in PSpice, since it is not case sensitive. Thus, in PSpice, a factor of 106 is indicated by "MEG" or "meg." "M" or "m" is reserved for 10-3. Another quirk of PSpice is the designation for 10-6. In most publications, the Greek letter, μ, is used for this multiple. Since there can be no Greek fonts (or any other special font designations) in PSpice, the early developers of PSpice borrowed a trick from those who used typewriters. Before the IBM Selectric typewriter was introduced, most writers of technical papers had to improvise for Greek letters. Since the Latin letter "u" (at least in lower case) sort of resembled the lower case Greek μ, it was widely used as a substitute for μ. Hence, either "U" or "u" stands for 10-6 in PSpice. Without further background explanations, these are the metric prefix designations used in PSpice: Number Prefix Common Name1012 - "T" or "t" tera109 - "G" or "g" giga106- "MEG" or "meg" mega103 - "K" or "k" kilo10-3 - "M" or "m" milli10-6 - "U" or "u" micro10-9 - "N" or "n" nano10-12 - "P" or "p" pico10-15 - "F" or "f" femtoAn alternative to this type of notation, which is in fact, the default for PSpice output data, is "textual scientific notation." This notation is written by typing an "E" followed by a signed or unsigned integer indicating the power of ten. Some examples of this notation are shown below:656,000 = 6.56E5-0.0000135 = -1.35E-58,460,000 = 8.46E6The Most Basic PartsHere, we present the simplest circuit elements. Knowing how to model these ideal, linear circuit elements is an essential start to modeling more complex circuits. In each case, we will only present the most fundamental version of the part at this time. Later we will show you more sophisticated uses of the part models.We begin with the DC version of the ideal independent voltage source. This is the default form of this class of part. The beginning letter of the part name for all versions of the ideal independent voltage source is "V." This is the character that must be placed in column 1 of the line in the text file that is used to enter this part. The name is followed by the positive node designation, then the negative node designation, then an optional tag: "DC" followed by the value of the voltage. The tag "DC" (or "dc" if you prefer) is optional because it is the default. Later, when we begin modeling AC circuits and voltage sources that produce pulses and other interesting waveforms, we will be required to designate the type of source or it will default back to DC. One of the interesting uses of ideal independent voltage sources is that of an ammeter. We can take advantage of the fact that PSpice saves and reports the value of current entering the positive terminal of an independent voltage source. If we do not actually require a voltage source to be in the branch where we want to measure the current, we simply set the voltage source to a zero value. It still calculates the current in the branch. In fact, we require an independent voltage source in a branch where that branch's current is the controlling current for a current-controlled dependent source.Examples:*name +node -node type value commentVa 4 2 DC 16.0V; "V" after "16.0" is optionalvs qe qc dc 24m ; "QE" is +node & "qc" is -node VWX 23 14 18k ; "dc" not really neededvwx 14 23 DC -1.8E4 ; same as aboveVdep 15 27 DC 0V ; V-source used as ammeterResistorsAlthough PSpice allows for sophisticated temperature-dependent resistor models, we will begin with the simple, constant-value resistor. The first letter of the name for a resistor must be "R." The name is followed by the positive node, then the negative node and then the value in ohms or some multiple of ohms. The value of resistance will normally be positive. Negative values are allowed in order to permit an alternative model of an energy source. A value of zero, however, will produce an error. Later, we will introduce special resistor models that will permit additional analysis methods to be used.The resistor is not an active device, so the polarity of its connection has no effect on the values of the voltages and currents reported in the solution. However, the current through a resistor is reported as that which flows from the node on the left to the node on the right in the source code line in which the resistor is entered. Thus .PRINT statements and PROBE queries that report resistor current may show negative values of current depending on the order in which you list the resistor's two nodes in the *.CIR file. If you want to see the resistor's current as a positive value, reverse the order of the nodes on the resistor's line in the *.CIR file and re-run the analysis. Nothing else will be affected and both solutions can be correct.Examples:*name +node -node value commentRabc 31 0 14k ; reported current from 31 to 0Rabc 0 31 14k ; reported current changes signrshnt 12 15 99m ; 0.099 ohm resistorRbig 19 41 10MEG ; 10 meg-ohm resistorThe name of an ideal independent current source begins with the letter "I" in column 1 of the data file. As with the independent voltage source, we begin by introducing only the DC form of this part, but several other forms exist. Since the current source, is an active element, it matters greatly how it is connected. Designated current flows into the node written on the left, through the current source, out the node written on the right. As with the independent voltage source, the default type is DC. Remember that the so-called +node on a current source may have a negative voltage with respect to the so-called -node. This is due to the fact that the circuit external to the current source determines its voltage.Examples:*name +node -node type value commentIcap 11 0 DC 35m ; 35mA flows from node 11 to 0ix 79 24 1.7 ; "DC" not neededI12 43 29 DC 1.5E-4 ;I12 29 43 dc -150uA ; same as aboveCircuit Example 1Example_1 EXMPL01.CIRVs 1 0 DC 20.0V ; note the node placementsRa 1 2 5.0kRb 2 0 4.0kRc 3 0 1.0kIs 3 2 DC 2.0mA ; note the node placements.ENDThe output file EXMPL01.OUT is below. This has been edited to remove extra lines.Example_1 EXMPL01.CIR <== Title LineVs 1 0 20.0V ; note the node placementsRa 1 2 5.0kRb 2 0 4.0kRc 3 0 1.0kIs 3 2 2.0mA ; note the node placementsExample_1 EXMPL01.CIR <== Title LineNODE VOLTAGE NODE VOLTAGE NODE VOLTAGE NODE VOLTAGE( 1) 20.0000 ( 2) 13.3330 ( 3) -2.0000 <==ResultsVOLTAGE SOURCE CURRENTSNAME CURRENTVs -1.333E-03 <== Current entering node 1 of VsTOTAL POWER DISSIPATION 2.67E-02 WATTSJOB CONCLUDEDTOTAL JOB TIME .26This was the bare-bones minimum problem we could ask of PSpice. Note that we obtained the node voltages which is sufficient information to calculate the resistor currents. However, there is another command that we can use to get even that done by PSpice.Use of the .PRINT CommandOne of the many "dot commands" in PSpice is the .PRINT command. It has many uses, but we will concentrate here on using it for printing DC voltages and currents. The .PRINT command can be repeated as often as necessary in an analysis. You can list as many items on a line as you wish.However, we must keep in mind that the .PRINT command was designed to work with a DC or an AC sweep. This is a method of varying a parameter over a range of values so that we get a batch of cases solved all at once. Often, we do not actually want to run a sweep over many values of a parameter. We can circumvent the sweep by setting its range so that it can only run one value. Usually, a DC sweep is made by changing the values of a source; although we will later learn to sweep over other circuit parameters. For now, let's look at the syntax for a DC sweep command with the default linear type range..DC Sweep_Variable Starting_Value Stopping_Value IncrementFor our example problem, we choose the voltage source and set the sweep variable range so that it cannot run more than one value:.DC Vs 20.0 20.0 1.0Since the starting value equals the stopping value, the analysis will only run for one case, i.e., for Vs at 20 volts. Remember that the only reason we are running the DC sweep statement is to enable the .PRINT command. The .PRINT command will not work unless there is a sweep going on. Note: What you enter in the .DC statement overrides any voltage value you may have placed in the part listing for the source.Printing DC VoltagesIn addition to printing the node voltages in which you type the letter "V" with the node number in parentheses, you can print the voltage between any pair of nodes; ergo, V(m,n) prints the voltage from node "m" to node "n.".PRINT DC V(1) V(2) V(3) ; prints the node voltages.PRINT DC V(1,2) ; prints the voltage across Ra.PRINT DC V(3,2) ; prints the voltage across IsPrinting DC CurrentsTo print currents, you type the letter "I" with the element name in parentheses. Note that the reported current is that which flows into the element from the node listed on the left in the *.CIR file, through the element, and out the node listed on the right in the *.CIR file. If you want to change the sign of the reported current in a resistor, then swap the two nodes for that resistor..PRINT DC I(Ra) ; prints the currents from + to - of Ra .PRINT DC I(Rb) I(Rc) ; prints the currents through Rb and RcPrint Commands can be Combined.PRINT DC V(1,2) I(Ra) ; voltage and current for Ra.PRINT DC V(2,0) I(Rb) ; V(2,0) same as V(2).PRINT DC V(3,0) I(Rc) ; V(3,0) same as V(3)Use .PRINT with Previous ExampleExample_2 EXMPL02.CIRVs 1 0 DC 20.0V ; note the node placementsRa 1 2 5.0kRb 2 0 4.0kRc 3 0 1.0kIs 3 2 DC 2.0mA ; note the node placements.DC Vs 20 20 1 ; this enables the .print commands.PRINT DC V(1,2) I(Ra).PRINT DC V(2) I(Rb).PRINT DC V(3) I(Rc).ENDThe output file EXMPL02.OUT is below. This has been edited to remove extra lines.Example_2 EXMPL02.CIRVs 1 0 20.0V ; note the node placementsRa 1 2 5.0kRb 2 0 4.0kRc 3 0 1.0kIs 3 2 2.0mA ; note the node placements.DC Vs 20 20 1 ; this enables the Print commands.PRINT DC V(1,2) I(Ra).PRINT DC V(2) I(Rb).PRINT DC V(3) I(Rc)Example_2 EXMPL02.CIR**** DC TRANSFER CURVES TEMPERATURE = 27.000 DEG CVs V(1,2) I(Ra)2.000E+01 6.667E+00 1.333E-03 <== data for RaExample_2 EXMPL02.CIR**** DC TRANSFER CURVES TEMPERATURE = 27.000 DEG CVs V(2) I(Rb)2.000E+01 1.333E+013.333E-03 <== data for RbExample_2 EXMPL02.CIR**** DC TRANSFER CURVES TEMPERATURE = 27.000 DEG CVs V(3) I(Rc)<2.000E+01 -2.000E+00 -2.000E-03 <== data for RcJOB CONCLUDEDTOTAL JOB TIME .13With a little bit of effort, we can get PSpice to do most of the work, most of the time. Note that using .PRINT has suppressed the default printing of all the node voltages. This is not a problem in our case because we printed all three node voltages anyway. Be sure that you include everything you need in the .PRINT statements.Back to Main PageLast Modified: 10/02/2009 02:58:13。