Top Banner

of 47

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript

PSpice DocumentationA brief Introduction

PSpice Documentation

DOCUMENTATION ON PSPICE TOOLINDEXSr. no. 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. Topic HISTORY OF PSPICE INTRODUCTION TO THE TOOL COMPARATIVE STUDY OF DIFFERENT VERSIONS VENDORS PROVIDING PSPICE LIMITATIONS OF THE TOOL HARDWARE REQUIREMENTS CONSTRUCT OF THE TOOL INSTALLATION PROCEDURE CONCLUSION MY EXPERIENCE WITH THE TOOL Page No. 3 4 6 10 10 11 12 43 45 46

1. HISTORY2

PSpice DocumentationPSPICE originated with the name SPICE. SPICE was originally, an analog circuit simulator that was developed at the University of California at Berkeley. PSpice is one of the many commercial derivatives of SPICE and has been developed by OrCAD.

History of SPICESPICE is a computer program designed to simulate analog electronic circuits. It original intent was for the development of integrated circuits, from which it derived its name: Simulation Program with Integrated Circuit Emphasis. The origin of SPICE traces back to another circuit simulation program called CANCER. Developed by professor Ronald Rohrer of U.C. Berkeley along with some of his students in the late 1960's, CANCER continued to be improved through the early 1970's. When Rohrer left Berkeley, CANCER was re-written and re-named to SPICE, released as version 1 to the public domain in May of 1972. Version 2 of SPICE was released in 1975 . Instrumental in the decision to release SPICE as a public-domain computer program was professor Donald Pederson of Berkeley, who believed that all significant technical progress happens when information is freely shared. I for one thank him for his vision. A major improvement came about in March of 1985 with version 3 of SPICE (also released under public domain). Written in the C language rather than FORTRAN, version 3 incorporated additional transistor types (the MESFET, for example), and switch elements. Version 3 also allowed the use of alphabetical node labels rather than only numbers. Instructions written for version 2 of SPICE should still run in version 3, though. Many different versions of SPICE are available from many different vendors. Common SPICEs include HSPICE, PSPICE, and B2SPICE. SPICE takes a circuit netlist and performs mathematical simulation of the circuit's behavior. A netlist describes the components in the circuit and how they are connected. SPICE can simulate DC operating point, AC response, transient response, and other useful simulations. Since its development was based on U.S. public funds, thus SPICE2, the successor of SPICE belongs to public domain and so its name PSPICE.

2. INTRODUCTION

3

PSpice DocumentationToday, there are several software packages available for the design and simulation of analog and/or digital circuits. Electronics Workbench (EW), Electronic Circuit Analysis (ECA), and Simulation Program with Integrated Circuit Emphasis (SPICE) are the most populated among them. Electronics Workbench is a design tool that provides all the components and instruments necessary to create board-level designs on a computer. It has complete mixed analog and digital simulation and graphical waveform analysis. It was developed by Interactive Image Technologies Ltd. Of Ontario, Canada, and is available in both Windows and Macintosh versions. The Electronic Circuit Analysis Program was developed by Tatum Laboratories of Ann Arbor, Michigan, in the early 1980s. It is primarily an analog circuit simulator with AC, DC, Fourier, Transient, Monte Carlo, and Worst-Case analysis modes. The original simulation program with integrated circuit emphasis was developed at Berkeley in the early 1970s as discussed in the history of SPICE. PSpice is a program which is interactive and written in C programming language. It is widely used in colleges and universities in studying electronic circuit analysis and design. OrCAD PSpice is a simulation program that models the behavior of a circuit containing any mix of analog and digital devices. Used with OrCAD Capture for design entry, you can think of PSpice A/D as a software based breadboard of a circuit that you can use to test and refine your design before even touching a piece of hardware. If you are an Electronics / Telecommunication / Computer / IT Engineer, and your work/study involves designing and analysis of electronic circuits, then knowledge of PSpice can prove extremely rewarding. As a student of Electronics, in particular, you will be able to verify what you have beeb learning in theory and try & test new circuits at home, all on your home PC, free of cost. The most invaluable use of PSpice is in large scale projects wherein testing of circuits at every stage of development may not be feasible, due to cost and other related factors. Moreover, PSpice lets you analyze circuits for many possible worst scenarios that may be very tedious to test practically. Because the analog and digital simulation algorithms are built into the same program, PSpice A/D simulates mixed-signal circuits with no performance degradation because of tightly coupled feedback loops between the analog and digital sections. PSpice A/D can perform the following types of analyses: AC, DC, and transient analyses, so you can test the response of your circuit to different inputs4

PSpice Documentation Parametric, Monte Carlo, and sensitivity/worst-case analyses, so you can see how your circuits behavior varies with changing component values Digital worst-case timing analysis to help you find timing problems that occur with only certain combinations of slow and fast signal transmissions

Models PSpice A/D includes model libraries that feature over 11,300 analog and 1,600 digital models of devices manufactured in North America, Japan, and Europe. Among these libraries are numerous models with parameters that you can tweak for a given device. These include independent temperature effects. PSpice A/D also supports analog and digital behavioral modeling, so you can describe functional blocks of circuitry using mathematical expressions and functions. The range of models built into PSpice A/D include not only those for resistors, inductors, capacitors, and bipolar transistors, but also the following: transmission line models, including delay, reflection, loss, dispersion, and crosstalk nonlinear magnetic core models, including saturation and hysteresis six MOSFET models, including BSIM3 version 3.1 and EKV version 2.6 five GasFET models, including Parker-Skellern and TriQuints TOM2 model IGBTs digital components with analog I/O models

Now PSpice is developed towards industry requirements. It is integrated in the complete systems design flow from OrCAD and Cadence Allegro. It also supports many additional features, which were not available in the Berkeley code like Advanced Analysis with automatic optimization of a circuit, encryption, Model Editor, supports parameterized models, has several internal solvers, auto-convergence and checkpoint restart, magnetic part editor and Tabrizi core model for non-linear cores.

3. COMPARATIVE STUDY OF DIFFERENT VERSIONS AVAILABLE

5

PSpice DocumentationPSpice is sold in three different versions: PSpice A/D, PSpice A/D Basics, and PSpice. In addition, PSpice A/D also comes in an Evaluation and a Student version. Each version offers particular features and functionality at a given price range to suit the needs of different customers. This Help system documents the main product PSpice A/D. Limitations that apply to the other versions are noted where they apply. The Student Version of PSpice is be distributed freely providing all copyrights are observed and the software is not redistributed under another name. The two versions which are comprehensively used are PSice A/D 9.1 and PSpice A/D 9.2 with little improvements over the other versions. We have given comprehensive descriptions of the above two versions and comparison with version 8. PSpice A/D overview PSpice A/D simulates analog-only, mixed analog/digital, and digital-only circuits. PSpice A/Ds analog and digital algorithms are built into the same program so that mixed analog/digital circuits can be simulated with tightlycoupled feedback loops between the analog and digital sections without any performance degradation. After you prepare a design for simulation, Orcad Capture generates a circuit file set. The circuit file set, containing the circuit netlist and analysis commands, is read by PSpice A/D for simulation. PSpice A/D formulates these into meaningful graphical plots, which you can mark for display directly from your schematic page using markers. PSpice A/D Basics overview PSpice A/D Basics provides the basic functionality needed for analog and mixed-signal design without the advanced features in the full PSpice A/D package. PSpice overview PSpice simulates analog circuits only, not mixed signal or digital circuits. Otherwise, PSpice offers essentially the same set of features and functionality as that provided by PSpice A/D. The following table identifies which significant features are included with PSpice A/D, PSpice A/D Basics, or PSpice. Another version of PSpice A/D, called PSpice A/D Lite, is also available. This product is intended for use by students, and is provided for evaluation purposes as well. The limitations of PSpice A/D Lite are listed after this table. For the most current information about the features and functionality available in the different versions of PSpice, contact PSpice Customer Support. Comparison of PSpice versions Features PSpice A/D (standard)6

PSpice A/D (Basics)

PSpice

PSpice Documentation

Benefits of Integration with OrCAD Capture graphical design entry (schematic capture) simulation setup using dialog boxes Cross-probing multi-window analysis of PSpice data sets marching waveforms in PSpice board layout package interfaces yes yes yes yes yes yes yes yes yes yes yes yes yes yes yes yes yes yes

Notable PSpice analysis and simulation features DC sweep, AC sweep, transient analysis noise, Fourier, temperature analysis parametric analysis Monte Carlo, sensitivity/worst-case analysis analog behavioral modeling (ABM) propagation delay modeling constraint checking (such as setup and hold timing) digital worst-case timing charge storage on digital nets PSpice Stimulus Editor PSpice Model Editor performance analysis (goal functions) interactive simulation preemptive simulation save/load bias point Notable PSpice devices and library model7

yes yes yes yes yes yes yes yes yes yes yes yes yes yes yes

yes yes no no yes no no no no no no* no no yes** no

yes yes yes yes yes no no no no yes yes yes yes yes yes

PSpice Documentation

JFETs, BJTs SCRSs, thyristors PWMs resistor, capacitor, and inductor .MODEL support ideal, non-ideal lossy transmission lines coupled inductors coupled transmission lines nonlinear magnetics voltage- and current-controlled switches analog model library digital primitives digital model library Purchase options PSpice Optimizer network licensing

yes yes yes yes all yes yes yes yes 14,000+ all 1,600+

yes no no yes ideal yes no no yes 12,000+ most*** 1,600+

yes yes no yes all yes yes yes yes 14,000+ none 0

yes yes

no no

yes yes

Other options PSpice Device Equations Developers Kit (DEDK)**** Miscellaneous specifications unlimited circuit size yes Yes***** yes yes no yes

* Limited to text editing and diode device characterization. ** Only allows one paused simulation in the queue. *** PSpice A/D Basics does not include bidirectional transfer gates.

8

PSpice Documentation**** Available to qualified customers - contact PSpice Customer Support for qualification criteria. ***** Depends on system resources.

Release 9.1, Web Update 1 improvements PSpice A/D Release 9.1, Web Update 1 offers several enhancements and improvements over previous versions, as listed below. Changes to the limits in PSpice and Probe. Improved cursor control when displaying large numbers of traces. Ability to copy histogram data to the Windows clipboard. Alternate display mode for PSpice. Option to set the Probe window so that it remains visible at all times, for constant display of waveforms when working in the schematic editor. Improvements to how Probe prints waveforms. Reintroduction of Schematics as an alternate front-end tool for PSpice.

Release 9.2 improvements PSpice A/D Release 9.2 offers several enhancements and improvements over previous versions, as listed below. Cross-probing between the front-end design entry tool and PSpice at lower-level circuits of a hierarchical design. Support for measuring power consumption on particular devices, using markers or expressions. Enhancements to the options for limiting data collection on large simulations. Plot window templates for restoring the display of frequently used plot windows with multiple arguments within Probe. Preemptive simulation that provides a Simulation Manager for full control of multiple (batch) simulations.

9

PSpice Documentation Interactive simulation that provides options for pausing a simulation, changing certain runtime parameters, and then continuing the simulation with the new parameter settings.

4. VENDORS PROVIDING PSPICEMany manufacturers of electronic devices provide PSpice models for simulating circuits that use their components. In most cases, and with little or no special modification, these vendor-supplied models can be used directly with PSpice. To obtain a PSpice model for a specific device that is not included with the standard PSpice libraries, contact the manufacturer directly. PSpice is embedded in the demo suite of Cadence Design Systems Tools comments which is mounted on Windows platforms and is available as free demo CD. A student version of PSpice 9.1 can be downloaded free of charge on the cadence site www.orcadcommunity.com. The PSpice 9.2 lite version can also be downloaded from the same site. The PSpice version was available for download on http://www.pspice ,com/download/91pspstu.exe but you will be directed to cadence site as this site has been integrated with the official PSpice site.

5. LIMITATIONS OF THE TOOL

PSpice 9.2 has the following limitations:

Circuit simulation limited to circuits with up to 64 nodes, 10 transistors, two operational amplifiers or 65 digital primitive devices, and 10 transmission lines (ideal or non-ideal) with not more than 4 pairwise coupled lines Device characterization using the PSpice Model Editor limited to diodes Stimulus generation limited to sine waves (analog) and clocks (digital) Sample library of approximately 39 analog and 134 digital parts10

PSpice Documentation

Displays only simulation data created using the demo version of the simulator PSpice Optimizer limited to one goal, one parameter and one constraint Designs created in Capture can be saved if they have no more than 30 part instances In the Simulation Manager, only one simulation may be running or paused at a time. In the full version one simulation may be running and multiple simulations may be paused. Transient analyses can be extended using the RunFor box in the toolbar, but modifying runtime settings will not be supported (the Edit Runtime Settings dialog in the Simulation menu). In the full version you can do both.

6. MINIMUM HARDWARE REQUIREMENTS

Intel Pentium 90MHz or equivalent processor Windows 95, Windows 98 or Windows NT 16MB RAM (32MB recommended) 90MB of free hard disk space CD-ROM drive Mouse or similar pointing device

The hardware requirements are same for both versions.

7. CONSTRUCT OF TOOLThe PSpice 9.1 edition consists of : Capture11

PSpice Documentation PSpice AD PSpice Design manager PSpice message viewer PSpice Model Editor PSpice Optimizer PSpice Stimulus Editor PSpice Schematics

Capture Capture is a versatile design entry product you can use to create schematics for analog or mixed signal designs, printed circuit board layout designs, and programmable logic designs. First, create your flat or hierarchical design in the schematic page editor, then use Captures tools to quickly annotate it and prepare it for the next stage of development.

PSpice AD PSpice is a simulation program that models the behavior of a circuit. PSpice simulates analog only circuits, whereas PSpice A/D simulates any mix of analog and digital devices. Used with Orcad Capture for design entry, you can think of PSpice as a software-based breadboard of your circuit that you can use to test and refine your design before manufacturing the physical circuit board or IC.12

PSpice Documentation

Figure 2- PSpice AD window PSpice Design Manager Design Manager lets you manage design files and their dependencies as one unit. It has powerful file management features that let you perform file management activities on entire designs, as well as archive and restore entire designs for portability and storage. You can easily browse your design for file relationships within a dedicated workspace. Design Manager works very closely with the Design Journal feature in PSpice Schematics. Combining Design Managers file management and archiving functions with Design Journals design analysis and historical record keeping functions, provides maximum capability for design management, documentation, and tracking.

13

PSpice Documentation

Figure 3- PSpice Design Manager PSpice Message Viewer The Message Viewer allows you to see and act on messages generated by OrCAD applications. Message Viewer shows the messages for each design on a separate window. When you close the design, the Message Viewer window for that design saves and closes as well.

14

PSpice Documentation

Figure 4- PSpice Message Viewer PSpice Model Editor You can use the Model Editor to determine the model parameters for many standard device types, such as bipolar transistors, and to create the subcircuit models for more complex device types, such as operational amplifiers. You can create accurate models and parts for off-the-shelf devices by converting information from the device manufacturer's data sheet into PSpice model parameter values, without taking measurements of a real device. Then you can include the new, custom device model as part of your own model library. You may want to use a model based on typical values from the data sheet for most of your simulation work, then create best/worst-case models for checking your design. The advantage of modeling devices rather than merely using their data sheet values is that for more complex devices, especially semiconductor devices, the physical model for transistor behavior views the transistor from the inside, while the manufacturers measurements show the transistor behavior from the outside. Converting data sheet values to physical model parameters produces more accurate PSpice simulation results. Simpler devices, such as resistors, may only need the resistance value to have a complete model.15

PSpice DocumentationThe Model Editor closely approximates each of the device characteristics from the most relevant subset of the model parameters. Some of these curves will not match precisely the results of the PSpice simulation. PSpice Optimizer PSpice Optimizer is a circuit optimization program that improves the performance of analog and mixed analog/digital circuits. The PSpice Optimizer is fully integrated with other Orcad programs. This means you can design your circuit with Orcad Capture, simulate and analyze results with PSpice and optimize performance within the same environment. PSpice Stimulus Editor Stimulus Editor is used to create analog and digital input signals or stimuli for use in simulation. The parts of the screen include the plot window, the toolbar, and the status bar.

Figure 5 PSpice Stimulus Editor PSpice Schematics Schematics is a schematic capture front-end program with a direct interface to other PSpice programs and options. You can perform the following tasks, all in one environment, using Schematics: design and draw circuits simulate circuits using PSpice16

PSpice Documentation analyze simulation results using the PSpice waveform viewer (Probe) graphically characterize simulation stimuli using the fully integrated Stimulus Editor, so stimulus definitions are automatically associated with the appropriate symbols graphically characterize simulation models using the fully integrated Model Editor utility (formerly known as Parts), so model definitions are automatically associated with the appropriate symbols interface to PSpice Optimizer for analog circuit performance optimization

An important prerequisite to building a schematic is the availability of the necessary devices in the form of symbols. Schematics has extensive symbol libraries and includes a fully integrated symbol editor for creating your own symbols or modifying existing symbols

Figure 6- PSpice Schematics

PSpice shortcut keysKey CTRL+A CTRL+C CTRL+SHIFT+C Mode or user interface item Zoom menu (on the View menu) Edit menu Cursor menu (on the Trace menu) 17 Function or menu command Area Copy Display

PSpice DocumentationCTRL+F CTRL+SHIFT+F CTRL+G CTRL+H CTRL+I CTRL+SHIFT+I CTRL+L CTRL+SHIFT+L CTRL+SHIFT+M CTRL+N CTRL+SHIFT+N CTRL+O CTRL+P CTRL+SHIFT+P CTRL+SHIFT+R CTRL+SHIFT+S CTRL+SHIFT+T CTRL+U CTRL+V CTRL+X CTRL+SHIFT+X CTRL+Y CTRL+SHIFT+Y F1 F3 ALT+F4 F12 INSERT DELETE Edit menu Cursor menu (on the Trace menu) Edit menu Edit menu Zoom menu (on the View menu) Cursor menu (on the Trace menu) Zoom menu (on the View menu) Cursor menu (on the Trace menu) Cursor menu (on the Trace menu) With a PSpice window active Cursor menu (on the Trace menu) File menu File menu Cursor menu (on the Trace menu) Cursor menu (on the Trace menu) Cursor menu (on the Trace menu) Cursor menu (on the Trace menu) With a waveform window active Edit menu Edit menu Cursor menu (on the Trace menu) With a waveform window active With a waveform window active Help menu Edit menu File menu With a waveform window active window With a waveform window active Edit menu Find Freeze Goto Line Replace In Point Redraw Slope Min Creates a new text file Next Transition Open Print Peak Previous Transition Search Commands Trough Restores the last deleted traces Paste Cut Max Add a Y axis Delete a Y axis Help Topics Find Next Exit Restores the last waveform Opens the Add Traces dialog box Delete

PSpice Toolbar in Capture

18

PSpice Documentation

File toolbar in PSpice

Edit toolbar in PSpice

19

PSpice Documentation

Simulate toolbar in PSpice

Probe toolbar in PSpice20

PSpice Documentation

Cursor toolbar in PSpice

21

PSpice Documentation

PSpice Model Editor shortcut keys and toolbarNOTE: PSpice Model Editor is not available in PSpice A/D Basics.

22

PSpice Documentation PSpice Model Editor shortcut keysKey CTRL+C CTRL+N CTRL+O CTRL+P CTRL+S CTRL+V CTRL+X F1 ALT+F4 DELETE Mode or user interface item Edit menu File menu File menu File menu File menu Edit menu Edit menu Help menu File menu Edit menu Function or menu command Copy New Open Print Save Paste Cut Help Topics Exit Delete

PSpice Model Editor toolbar

23

PSpice Documentation

PSpice Stimulus Editor shortcut keys and toolbarNOTE: PSpice Stimulus Editor is not available in PSpice A/D Basics. 24

PSpice Documentation

PSpice Stimulus Editor shortcut keysKey ALT+A CTRL+A CTRL+D CTRL+I CTRL+L ALT+N CTRL+N CTRL+O CTRL+P CTRL+T F1 ALT+F4 F12 CTRL+F12 SHIFT+F12 CTRL+SHIFT+F12 DELETE ALT+DELETE INSERT Mode or user interface item Edit menu View menu With a plot window active View menu View menu Stimulus menu View menu View menu View menu Edit menu Help menu File menu File menu File menu File menu File menu Edit menu Stimulus menu Stimulus menu Function or menu command Add Area Delete In Redraw Fit Out Previous Attributes Help Topics Exit Save As Open Save Print Delete Remove Get

PSpice Stimulus Editor toolbar

25

PSpice Documentation

CIRCUIT DESCRIPTIONS26

PSpice DocumentationA circuit is described by a computer by using a file called called circuit file, which is normally typed in by a keyboard. The circuit file contains the circuit details of components and elements, the information about the sources, and the commands for what to calculate and what to provide as a output. The circuit file is the input to the PSpice program, which, after executing the commands, produces the results in another file called output file. A circuit must be specified in terms of elements name, elements values, nodes, variable parameters, and sources. Consider the circuit shown in below that is to be simulated or calculated the voltage gain of the active band pass filter.

The description and analysis of a circuit require specifying the following: Element values Nodes Circuit Elements Element models Sources Types of analysis27

PSpice Documentation Output variables PSpice output commands Format of circuit files Format of output files

Element Values The element values are written in standard floating point notations with optional scale and unit suffixes. M means milli, not mega, 2 Mohms is written as 2MEG or 2MEGOHM. Nodes The location of an element is identified by the node numbers. Each element is connected between two nodes. Nodes numbers are assigned to a circuit in the above figure. Node 0 is predefined as ground. Circuit Elements Circuit elements are identified by names. A name must start with a letter symbol corresponding to the element, but after that it can contain either letters or numbers. For example a name of a resistor must start with R, an independent current source with I, and an independent voltage source with V. The format for describing passive elements is The passive element in the above circuit are described as follows The statement that R1 has a value of 5K and is connected between nodes 1 and 2 is R1 1 2 5K Similarly the other passive elements are stated as follows R2 3 4 1.5K R3 2 0 265K C1 2 4 0.01UF C2 2 3 0.01UF28

PSpice DocumentationRL 4 0 15K The active element opamp UA741 has to be included from the library file EVAL.LIB. the call to the library element is given in the following format .LIB EVAL.LIB The opamp element is denoted by X1 in the above figure and the format is The element X1 in the above circuit is thus finally included as follows X1 * * 0 Vi+ 3 Vi6 Vp+ 7 Vp4 Vout EVAL.LIB UA741

Call library file EVAL.LIB

.LIB

Sources Voltage (or current) can be dependent or independent. The format for the sources is For VCC assuming that node 6 is at higher potential with respect to node 0, the statement is VCC 6 0 DC 12V Similarly as VEE is considered to be at ve potential, the nodes specification is reversed VEE 0 7 DC 12V Types of analysis There are different types of analysis that is ac, dc, transient which can be performed in PSpice A/D. The details of all node voltages can be sent to the output file by the OP command whose format is given below .OP

Format of circuit files29

PSpice DocumentationA circuit file that can be read by PSpice can be divided into five parts: 1. Title, which describes the type of circuit or any comments. 2. Circuit description, which defines the circuit elements and set of model parameters. 3. Analysis description, which defines the type of analysis. 4. Output description, which defines the way output is to be presented 5. End of the program. The format of a circuit file is as follows Title Circuit description Analysis description Output description .END (end-of-file statement) Notes 1. The first line is the title line, and it may contain any type of text. 2. The last line must be the .END command. 3. The order of the remaining lines is not important and does not affect the results of the simulation. 4. A comment may be included anywhere, preceded by an asterisk (*). Within a statement, a comment is preceded by a semicolon. 5. A statement can be continued on the next line. A continuation line is identified by a plus (+) sign in the first column of a line. 6. PSpice statements can be either in uppercase or lowercase. 7. If you are not sure of any command or statement, the best thing is to run the circuit file by using that command or statement to determine what will happen. PSpice is user-friendly software, it gives an error message in the output file that identifies a problem. The circuit file is created in PSpice A/D by FileNewText File.

30

PSpice Documentation

Format of Output files The results of simulation are stored in an output file. It is possible to control the type and amount of output by various commands. If there is any error in the circuit file, PSpice will display a message on the screen indicating that there is an error and will suggest looking at the output file for details. The output falls into four types: 1. A description of the circuit itself that includes the net list, the device list, the model parameter list, and so on. 2. Direct output from some of the analyses without the .PLOT and .PRINT commands (explained later). 3. Prints and plots by .PLOT and .PRINT commands (including the output from the .DC, .AC, and .TRAN analyses. 4. Run statistics (i.e. the various kinds of summary information about te whole run, including time required by various analyses and the amount of memory used.31

PSpice DocumentationAnalysis Finding node voltages and currents

The circuit of figure is to be simulated on PSpice to calculate and print all node voltages and the current and power of all voltage sources. The circuit file is to be stored in file sample.cir, and the outputs are stored in file sample.out. The circuit file contains the following statements:Sample Band-Pass Active Filter * Input voltage of 1 V peak for frequency response VIN 1 0 AC 1 R1 1 2 5K R2 3 4 1.5k R3 2 0 265K C1 2 4 0.01UF C2 2 3 0.01UF RL 4 0 15K VCC 6 0 DC 12V VEE 0 7 DC 12V * Subcircuit call for UA741 which comes with the PSpice library files X1 0 3 6 7 4 UA741 * Vi+ ViVp+ Vp- Vout * Call library file EVAL.LIB .LIB EVAL.LIB .OP .END

The circuit file when saved has to be simulated by SimulateRun

The results are stored by default in an output file that has the same name as the input file but has an extension .out. The results of the output file is as follows32

PSpice DocumentationSample **** NODE Band-Pass Active Filter SMALL SIGNAL BIAS SOLUTION VOLTAGE NODE VOLTAGE NODE

TEMPERATURE = VOLTAGE

27.000 DEG C NODE VOLTAGE

( 1) 0.0000 ( 6) 12.0000 ( X1.8) 143.3E-06 (X1.12) 11.9600 (X1.54) -11.0000 (X1.99) 0.0000

( 2) 0.0000 ( 7) -12.0000 ( X1.9) 0.0000 (X1.13) -.5938 (X1.90) 88.98E-06

( 3) 19.25E-06 ( X1.6)-14.73E-09 (X1.10) -.6077 (X1.14) -.5938 (X1.91) 40.0000

( 4) 138.9E-06 ( X1.7) 143.3E-06 (X1.11) 11.9600 (X1.53) 11.0000 (X1.92) -40.0000

VOLTAGE SOURCE CURRENTS NAME CURRENT VIN VCC VEE X1.vb X1.vc X1.ve X1.vlim X1.vlp X1.vln 0.000E+00 -1.337E-03 -1.337E-03 -1.473E-13 1.100E-11 1.100E-11 8.898E-08 -4.000E-11 -4.000E-11 3.21E-02 WATTS

TOTAL POWER DISSIPATION JOB CONCLUDED TOTAL JOB TIME

.16

Performing AC analysis Suppose we have to perform AC analysis for 100Hz to 1MHz with a decade increment and 10 points per decade. The format for AC analysis is as shown below:.AC

The command is to be followed by a .PLOT command that will trace the output. It can also be followed by a .PROBE command that will start the graphical waveform analyzer. The complete code for active band pass filter is as shown below.Sample Band-Pass Active Filter * Input voltage of 1 V peak for frequency response VIN 1 0 AC 1 R1 1 2 5K R2 3 4 1.5k R3 2 0 265K C1 2 4 0.01UF C2 2 3 0.01UF RL 4 0 15K VCC 6 0 DC 12V

33

PSpice DocumentationVEE 0 7 DC 12V * Subcircuit call for UA741 which comes with the PSpice library files X1 0 3 6 7 4 UA741 * Vi+ ViVp+ Vp- Vout * Call library file EVAL.LIB .LIB EVAL.LIB * AC analysis for 100 Hz to 1 MHz with a decade increment and 10 * points per decade .AC DEC 10 100HZ 1MEGHZ * Plot the results of AC analysis: magnitude of voltage at node 4 .PLOT AC VM(4) .PROBE .END

After simulating the window shows waveform analyzer. Add traces by TraceAdd Trace. Type V(4) to plot the waveform of voltage at node 4 The result of the simulation is as shown below

Figure: Output of .PROBE command The plot of the result is obtained in output file. It is as shown below:**** 08/24/08 15:12:40 ************** PSpice Lite (Mar 2000) ***************** Sample Band-Pass Active Filter **** AC ANALYSIS TEMPERATURE = 27.000 DEG C

34

PSpice DocumentationFREQ VM(4)

(*)---------1.000E+02 1.259E+02 1.585E+02 1.995E+02 2.512E+02 3.162E+02 3.981E+02 5.012E+02 6.310E+02 7.943E+02 1.000E+03 1.259E+03 1.585E+03 1.995E+03 2.512E+03 3.162E+03 3.981E+03 5.012E+03 6.310E+03 7.943E+03 1.000E+04 1.259E+04 1.585E+04 1.995E+04 2.512E+04 3.162E+04 3.981E+04 5.012E+04 6.310E+04 7.943E+04 1.000E+05 1.259E+05 1.585E+05 1.995E+05 2.512E+05 3.162E+05 3.981E+05 5.012E+05 6.310E+05 7.943E+05 1.000E+06

1.0000E-03 1.0000E-02 1.0000E-01 1.0000E+00 1.0000E+01 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 9.235E-03 . * . . . 1.162E-02 . .* . . . 1.460E-02 . . * . . . 1.834E-02 . . * . . . 2.300E-02 . . * . . . 2.879E-02 . . * . . . 3.592E-02 . . * . . . 4.459E-02 . . * . . . 5.495E-02 . . * . . . 6.698E-02 . . * . . . 8.043E-02 . . *. . . 9.469E-02 . . * . . 1.088E-01 . . .* . . 1.218E-01 . . . * . . 1.327E-01 . . . * . . 1.410E-01 . . . * . . 1.465E-01 . . . * . . 1.495E-01 . . . * . . 1.499E-01 . . . * . . 1.479E-01 . . . * . . 1.433E-01 . . . * . . 1.360E-01 . . . * . . 1.260E-01 . . . * . . 1.138E-01 . . .* . . 9.995E-02 . . * . . 8.568E-02 . . * . . 7.195E-02 . . *. . . 5.949E-02 . . * . . . 4.867E-02 . . * . . . 3.959E-02 . . * . . . 3.216E-02 . . * . . . 2.619E-02 . . * . . . 2.149E-02 . . * . . . 1.788E-02 . . * . . . 1.518E-02 . . * . . . 1.328E-02 . . * . . . 1.208E-02 . . * . . . 1.153E-02 . .* . . . 1.160E-02 . .* . . . 1.221E-02 . . * . . . 1.313E-02 . . * . . . - - - - - - - - - - - - - - - - - - - - - - - - - - -

JOB CONCLUDED TOTAL JOB TIME

.11

More sample codes for practice is given below35

PSpice DocumentationFor Inverting amplifier using OPAMPExample 10-1 Inverting Amplifier * Input voltage is 1.5 V DC VIN 1 0 DC 1.5V R1 2 3 10K R2 4 0 6.67K RF 3 5 20K * Calling subcircuit OPAMP XA1 2 1 2 0 OPAMP XA2 3 4 5 0 OPAMP * Subcircuit definition for OPAMP .SUBCKT OPAMP 1 2 5 4 RIN 1 2 2MEG RO 3 5 75 * Voltage-controlled voltage source with a gain of 2E+5. The polarity of * the output voltage is taken into account by changing location of the * controlling nodes. EA 3 4 2 1 2E+5 * End of subcircuit definition .ENDS OPAMP * Transfer function analysis calculates and prints the dc gain, * the input resistance and the out resistance .TF V(5) VIN .END

For two stage BJT amplifierExample 8-6 Two-Stage BJT Amplifier VCC 10 0 DC 15V * Input voltage is 1 mV peak for frequency response VIN 1 0 AC 1MV * A dummy voltage source of 0 V to measure the input current VX 1 12 DC 0V RS 12 2 150 C1 2 3 10UF R1 10 3 200K R2 3 0 50K * Transistors Q1 and Q2 have model QM Q1 4 3 5 0 QM Q2 7 6 8 0 QM RC1 10 4 12K RE1 5 0 3.6K CE1 5 0 15UF C2 4 6 10UF R3 10 6 120K R4 6 0 30K RC2 10 7 6.8K RE2 8 0 3.6K CE2 8 0 25UF

36

PSpice DocumentationC3 7 9 10UF RL 9 0 10K * Model statement for NPN transistors whose model name is QM .MODEL QM NPN (IS=2E-16 BF=50 BR=1 RB=5 RC=1 RE=0 CJE=0.4PF + VJE=0.8 ME=0.4 CJC=0.5PF VJC=0.8 CCS=1PF VA=100) * AC analysis from 10 Hz to 10 MHz with a decade increment and 10 * points per decade .AC DEC 100 10HZ 10MEGHZ .PLOT AC VP(9) VM(9) .PROBE .END

The most commonly used commands are explained below:

.AC (AC analysis)PurposeThe .AC command calculates the frequency response of a circuit over a range of frequencies.

General form.AC +

Examples.AC LIN 101 100Hz 200Hz .AC OCT 10 1kHz 16kHz .AC DEC 20 1MEG 100MEG

.DC (DC analysis)Purpose The .DC command performs a linear, logarithmic, or nested DC sweep analysis on the circuit. The DC sweep analysis calculates the circuits bias point over a range of values for . Sweep type The sweep can be linear, logarithmic, or a list of values.

General form37

PSpice Documentation.DC [LIN] + + [nested sweep specification]

Examples.DC .DC .DC .DC VIN LIN VCE RES -.25 .25 .05 I2 5mA -2mA 0.1mA 0V 10V .5V IB 0mA 1mA 50uA RMOD(R) 0.9 1.1 .001

.TRAN (transient analysis)PurposeThe .TRAN command causes a transient analysis to be performed on the circuit and specifies the time period for the analysis.

General form.TRAN[/OP] +[no-print value [step ceiling value]][SKIPBP]

Examples.TRAN 1ns 100ns .TRAN/OP 1ns 100ns 20ns SKIPBP .TRAN 1ns 100ns 0ns .1ns .TRAN 1ns 100ns 0ns {SCHEDULE(0,1ns,25ns,.1ns)}

.END (end of circuit)PurposeThe .END command marks the end of the circuit. All the data and every other command must come before it. When the .END command is reached, PSpice does all the specified analyses on the circuit.

General form.END

Examples* 1st circuit in file ... circuit definition .END * 2nd circuit in file ... circuit definition38

PSpice Documentation.END

CommentsAll the circuit commands and description with one .END command

.PLOT (plot)PurposeThe .PLOT command causes results from DC, AC, noise, and transient analyses to be line printer plots in the output file. This command is included for backward compatibility with earlier versions of PSpice. It is more effective to print plots from within Probe. Printing from Probe yields higher resolution graphics and provides an opportunity to preview the plot before printing.

General form.PLOT [output variable]* + ( [ , ] )*

Examples.PLOT DC V(3) V(2,3) V(R1) I(VIN) I(R2) IB(Q13) VBE(Q13) .PLOT AC VM(2) VP(2) VM(3,4) VG(5) VDB(5) IR(D4) .PLOT NOISE INOISE ONOISE DB(INOISE) DB(ONOISE) .PLOT TRAN V(3) V(2,3) (0,5V) ID(M2) I(VCC) (-50mA,50mA) I.PLOT TRAN D(QA) D(QB) V(3) V(2,3) .PLOT TRAN V(3) V(R1) V([RESET])

.PRINT (print)PurposeThe .PRINT command allows results from DC, AC, noise, and transient analyses to be an output in the form of tables, referred to as print tables in the output file.

General form.PRINT[/DGTLCHG] [output variable]*

Examples.PRINT .PRINT .PRINT .PRINT .PRINT DC V(3) V(2,3) V(R1) I(VIN) I(R2) IB(Q13) VBE(Q13) AC VM(2) VP(2) VM(3,4) VG(5) VDB(5) IR(6) II(7) NOISE INOISE ONOISE DB(INOISE) DB(ONOISE) TRAN V(3) V(2,3) ID(M2) I(VCC) TRAN D(QA) D(QB) V(3) V(2,3)39

PSpice Documentation.PRINT/DGTLCHG TRAN QA QB RESET .PRINT TRAN V(3) V(R1) V([RESET]) The last example illustrates how to print a node that has a name, rather than a number. The first item to print is a node voltage, the second item is the voltage across a resistor, and the third item to print is another node voltage, even though the second and third items both begin with the letter R. The square brackets force the names to be interpreted as node names.

.PROBE (Probe)PurposeThe .PROBE command writes the results from DC, AC, and transient analyses to a data file used by Probe.

General form.PROBE[/CSDF][output variable]*

Examples.PROBE .PROBE V(3) V(2,3) V(R1) I(VIN) I(R2) IB(Q13) VBE(Q13) .PROBE/CSDF .PROBE V(3) V(R1) V([RESET]) .PROBE D(QBAR) The first example (with no output variables) writes all the node voltages and all the device currents to the data file. The list of device currents written is the same as the device currents allowed as output variables. The second example writes only those output variables specified to the data file, to restrict the size of the data file. The third example creates a data file in a text format using the Common Simulation Data File (CSDF) format, not a binary format. This format is used for transfers between different computer families. CSDF files are larger than regular text files. The fourth example illustrates how to specify a node that has a name rather than a number. The first item to output is a node voltage, the second item is the voltage across a resistor, and the third item to output is another node voltage, even though the second and third items both begin with the letter R. The square brackets force the interpretation of names to mean node names. The last example writes only the output at digital node QBAR to the data file, to restrict the size of the data file. WORKING WITH SCHEMATICS The stepwise method to create a schematic for simulation is illustrated below:40

PSpice Documentation

1. On your PC workstation, select Programs PSpice student Design

manager. Click on Design manager. If this your first time using PSpice, you need to create a workspace for your schematics. To do this, select FileNew WorkspaceNameCreate. Next select ToolsSchematics and the PSpice Schematics screen will pop up. Select the Draw and Get New Part options.

2. Select various parts required from the Draw and Get New Part list of the PSpice Schematics. Next Place each part in the workspace one at a time and close the Get New Part option

3. Arrange the parts the way they appear in the circuit to be simulated. Interconnect

the parts using the DrawWire feature of the PSpice. 4. Set attributes and/or change attribute value(s) if necessary. Set the names and values for different components by double-clicking on the components and name labels. However, remember to save each attribute individually.41

PSpice Documentation5. If a plot is desired, use AnalysisProbe Setup to initialize probe setup. 6. Use AnalysisSetup to initialize setup parameters.

7. Save the Schematics diagram as a file. Use the Save As feature of the Word. 8. Use AnalysisCreate netlist to make sure there are no wiring errors. 9. Use AnalysisSimulate to execute the program. 10. Use TraceAdd to plot the desired graph(s). 11. Use ToolsLabelText to add label(s) to the graph(s). 12. Use Tools LabelArrow to add arrows to the graph(s). 13. Print the circuit schematic and the desired graph(s). This whole procedure may look tedious but it is fun to execute. By solving more examples we can get a complete grip in designing a circuit.

8. INSTALLATION PROCEDUREDouble click the setup file to start installation. Few points to be noted for the installation process:

Figure7 - Startup

42

PSpice Documentation When prompted, choose both Capture and Schematics

Occasionally you may get messages complaining of file extensions not established. You may safely OK them and proceed: no need to worry.

Figure Error message After installation create a folder named Downloaded inside C:\Progarm files\OrCAD_Demo\Capture\Library\PSpice. Copy all the files from Useful_Libraries folder on the CD, to the new folder you just created. A Few Abbreviations in PSPICE f = fempto p = pico n = nano u = micro43

PSpice Documentation m = milli k = kilo meg = mega g = giga F = farad Hz = Hertz H = Henry ohm = ohm

Note: Labelling units (F, H, ohm, Hz) is optional in PSPICE.

References you can use Goody, Roy W., PSpice for Windows, A Circuit Simulation Primer, Prentice-Hall, 1995 Goody, Roy W., PSpice for Windows, Vol. II, Operational Amplifiers & Digital Circuits, Prentice-Hall, 1996. Herniter, Marc E., Schematic Capture with PSpice, Macmillan, 1994.

Kielkowski, Ron, Inside SPICE, Overcoming the Obstacles of Circuit Simulation, McGraw-Hill, 1994. Kielkowski, Ron, SPICE, Practical Device Modeling, McGraw-Hill, 1995.

Tuinenga, Paul W., Spice, A Guide to Circuit Simulation & Analysis Using PSpice, 2nd Ed., Prentice-Hall, 1992.

9. CONCLUSIONWith the help of this documentation one can know a great deal about PSpice tool. This documentation was prepared from many sources and a great deal on own. The constructs cover a great deal about working with Pspice A/D if you have to perform an experiment through coding. The various commonly used commands were also explained in brief.44

PSpice Documentation

Now you know the basics of PSPICE, but the only way to learn it well is to spend time using it and exploring all the functionality. Don't be afraid to use the help contents!

10.

MY EXPERIENCE WITH THE TOOL:

We were introduced to PSpice in Sem-3. From then I got very much interested in the tool because it gave us freedom of testing and simulating any kind of circuit that we want. Also it points out errors. What more do we electronics engineering students want. I think nothing is great than this for spending hours on breadboard and still finding the attempts unsuccessful due to various reasons. We started with Student version of PSpice 9.1 tool. Though its a limited version its more then useful for the students community. I am very much interested in buying the full version but decided to make full use of what is available. A new version namely OrCAD Lite 9.2 version is available which consists of PSpice 9.2. But I am finding it tough to handle because it does not supports interactive simulation. That we should complain to the OrCAD guys. Everything is easier on the older tool. Also many component ICs are not available in the student version. Though I may never have a use for them but having them would have felt better. PSpice is a comprehensive tool and that I am discovering day by day. It can be used for layout editing, parts editing and much more. Other thing which was troubling me that after creating schematics we have to make some settings viz. AC analysis, DC analysis and than after simulating we have to add traces and the various frequencies which are inputted. If we perform and want to simulate it later we have to again make the same settings. That trouble was overcome when I discovered that all the settings we make can be saved by executing Log Commands from file menu in simulation menu. When we have to execute the circuit later we can simply run the above commands. Reversibly we can also code the settings in notepad and save it as *.cmd file and run the same settings by Run Command.

45

PSpice DocumentationThe commands directory is also very vast. I could have included many more commands in this document but due to constraints I have to limit myself. But the commands I have enlisted are more than sufficient to start with PSpice. I am still learning the tool and find new things whenever I log into it. Its fun to learn and I am enjoying it. Really! Bye, -Ansari Azizurrehman Roll no.04 Batch A

MY EXPERIENCE WITH THE TOOL

Since its introduction in third semester, I have used this tool extensively for different electronics circuit. I personally feel that this empowers an Electronics Engineer with the power of software. This tool makes testing of electronics circuit very simple and straightforward. The simulation results displayed has a great resemblance to the actual results. Also it allows the circuit to be tested at different temperatures which is not possible in real life. Also errors are displayed and it is easier to correct them than to troubleshoot breadboard circuits. Also different types of diodes and transistors provide option to choose one from many. Also one of greatest feature of this tool is its Model editor which allows a device to be formed as per the data provided. But it has some shortcomings like limited number of components in PSPICE library; large number settings to be performed etc. Also the error window sometime provides unexplainable reasons for errors. Also the PSPICE 9.2 version is difficult to operate as compared to previous versions. I would like to conclude that every Electronics Engineer should have a profound knowledge of PSPICE and should use it to enhance their knowledge and creativity.

- Amravatiwala Abdul Hussain - Roll no.01 Batch A46

PSpice Documentation

47