PSpice A/D Simulation with PSpice Workbook Software Version 10x
Analog Simulation with PSpice Lab Workbook 368 3F Phone (02) 575-7342 Fax (02) 575-0333 http:\\wwwelecsemicom e-mail: software@elecsemicom Analog Simulation with PSpice page iii
Capture v Introduce v Simulation 1 Bias Point Analysis 11 DC Sweep 17 AC Sweep 23 Stimulus Editor 31 Transient Analysis 37 Parametric Analysis 43 Editing a model! subcircuit! simulation model symbol! Symbol Editor! Hierarchical blocks symbols! page iv Analog Simulation with PSpice
Introduction Spice (Simulation Program eith Integrated Circuit Emphasis) :,,, (simulation) SPICE, 1972 Berkely SPICE,,,,,,FET Pspice : SPICE 1972 Berkely SPICE PC Analog/Digital Pspice, CaptureStimuls editor,pspice A/D,Probe 11,000 Analog library 2,000 Digital library Vendor Pspice library model Simulation 1Schematic Entry -Schematic: -Stimulus Editor: 2 Analysis Setup &Simulate: -Pspice A/D: A/D 3Output -Probe:,,, -Text editor:netlist,output file text format Analog Simulation with PSpice page v
Simulation Goals: Lesson 1 schematic : symbol, wires, attributes, Source, design Schematics (Menu Bar) (Toolbar) (shortcuts) (Drawing Area ) Schematic Analog Simulation with PSpice page 1
Lesson 1-Entering a Design for Simulation Browser dialog Place/Part <SHIFT-P> Hot key Tool Bar Button Part Browser dialog 1 Part Name (Browser ) 2 OK symbol cursor 3 click page copy 4 click page 2 Analog Simulation with PSpice
Lesson 1-Entering a Design for Simulation Notes: click copy Recent Part box Part Browser Wild card Part Browser dialog wild card 4000 *4000*? parts browser help 1 click 2 Edit/Rotate <CTRL-R> Draw/Wire toolbar button <SHIFT-W> Hot key drawing mode cursor 1 click wire 2 click wire drawing mode 3 click click drawing mode Analog Simulation with PSpice page 3
Lesson 1-Entering a Design for Simulation Options/Display Options: COLOR GRID PAN/ZOOM SELECT, TEXT,TAB X / Y on /off properties ( DC voltage ) symbol ( click) Edit/Properties symbol Property Editor dialog page 4 Analog Simulation with PSpice
Lesson 1-Entering a Design for Simulation Property 1 Property 2 Apply 3 OK dialog Note: attribute asterisk attribute attributes Symbol Editor schematic click Set Attribute Value dialog Property Display Values Property Display Values 1 Property dialog 2 3display preferences, orientation, and justification 4 Apply Analog Simulation with PSpice page 5
Lesson 1-Entering a Design for Simulation netlister (label) Probe node Analog Behavioral Model (ABM) device node : 1 Property Editor dialog 2 node Net Alias 3 OK Note: Node,, %, &, ^, @, * page 6 Analog Simulation with PSpice
Lesson 1-Entering a Design for Simulation Exercise circuit voltage source 1 Place/Part (type <SHIFT-P >, toolbar button) 2 Part dialog VDC 3 Click OK <Enter> 4 source 5 resistors 1 Place/Part (<SHIFT-P>, toolbar button) 2 Add Part dialog R 3 OK 4 (R1) OK 5 <CTRL-R> resistor 6 (R2) 7 capacitor 1 Place/Part (<SHIFT-P>, toolbar button) 2 Add Part dialog C 3 OK <Enter> Analog Simulation with PSpice page 7
Lesson 1-Entering a Design for Simulation 4 <CTRL-R> capacitor 5 capacitor 6 NOTE <Pspice library file> Pspice model library,symbol library 1model library -analog/digital device definition file -file name: *lib -ASCII text file(model subcircuit ) - symbol library 2symbol library - file -file name: *olb -device page 8 Analog Simulation with PSpice
Lesson 1-Entering a Design for Simulation Components 1 Place/Wire (<SHIFT-W>,toolbar button) 2 Delete key Placing the analog ground symbol 1 Place/Part (<SHIFT-P>,toolbar button) 2 OK 3 ground symbol 4 1 C1 2 Property Editor reference box CAP1 3 OK <Enter> labels 1 V1 R1 2 Property Editor name box In 3 OK 4 R1, R2 CAP1 5 Property Editor name box Out 6 OK Voltage source 10V 1 source (0V) 2 Display Propert Value 10V 3 OK schematic 1 File/Save 2 FILE rcopj 3 OK Analog Simulation with PSpice page 9
Bias Point Analysis Goals: simulation menu, netlist, Lesson 2 Analysis Setup RC DC bias point analysis simulation DC bias Simulation Setting Pspice/Simulation Setting Bias Point Detail enabled Bias Point Detail outfile bias point Analog Simulation with PSpice page 11
Lesson 2-Bias Point Analysis Netlisting PSpice netlist PSpice/Create Netlist Electrical Rule Check (ERC) ERC errors netlist simulation Analysis/Examine Netlist Notes: netlisting simulation ERC netlisting commands <Pspice option> Optimizer : Option,,, Option page 12 Analog Simulation with PSpice
Lesson 2-Bias Point Analysis Simulating PSpice Pspice/Run,, Run simulation PSpice window Simulation Probe waveform Analog Simulation with PSpice page 13
Lesson 2-Bias Point Analysis Analysis/Examine Output errors, output file output file bias voltages dc circuit 2 voltage RC V1 negative V CAP1 = R 2 /(R 1 + R 2 ) x V1 page 14 Analog Simulation with PSpice
Lesson 2-Bias Point Analysis Exercise 1 rcopj 2 Analysis/Setup, toolbar button ( Bias Point enabled ) 3 Close 4 PSpice/Run simulation toolbar button ERC netlister 5 Probe window View/Output File output file Extra Credit 1 ground symbol simulate error? 2 Message Viewer error 3 message viewer 4 Highlight error <F1> Message Viewer troubleshooting errors Analog Simulation with PSpice page 15
DC Sweep Lesson 3 Goals: DC Sweep analysis, set up sources, Probe,markers DC Sweep analysis PSpice,, steady output file Probe DC Sweep Analysis setup 1 Simulation Setting dialog DC Sweep button DC Sweep dialog 2 3 Value List Value field list 4 5 nested sweep,nested Sweep button Nested DC Sweep dialog 2-4 Analog Simulation with PSpice page 17
Lesson 3-DC Sweep DC sweep DC attribute zero sources 1 source (0V) vlaue 2 value 3 OK markers Markers Probe trace node voltage level, node voltage markers voltage current, markers 1 PSpice/Marker menu 2 3 marker marker 3 node (voltage markers) pin hot spot (current markers) click 4 Voltage differential markers marker positive node negative node, marker 10V node 5V 5V markers 5V advanced markers 1 PSpice menu 2 Mark Advanced 3 marker type 4 marker marker Probe Probe waveform viewer software oscilloscope group delay, voltage, current, (AC Analysis only) node voltage currnet page 18 Analog Simulation with PSpice
Lesson 3-DC Sweep Probe Probe Setup tab display Probe PSpice/Edit Simulation Settings Probe Setup Options dialog Probe Startup tab simulation Probe Probe startup tab Probe starts dialog values Analog Simulation with PSpice page 19
Lesson 3-DC Sweep Data Collection tab simulation At markers only marker All voltage current None simulation CSDF checkbox probe data file simulation spreadsheet math program Edit/Copy command data export Excel simulation Probe setup page 20 Analog Simulation with PSpice
Lesson 3-DC Sweep Exercise sweep V1 0V 10V 1V 1 PSpice/Edit Simulation Setting 2 DC Sweep button 3 Swept Variable Type Voltage Source 4 Sweep Type Linear 5 NAME text box V1 field value V1 6 Start Value text box 0 7 End Value text box <Tab> 10 8 Increment text box <Tab> 1 9 OK 10 Close Analysis Setup dialog 11 Check PSpice/Edit Simlation Setting Probe Setup data Probe run 12 Run toolbar button simulation PSpice/Run menu item Probe Probe window marker trace markers blank Plot traces Trace/Add <Ins> toolbar Add Trace button 1Add Trace list box 1V(In) V(Out) trace Trace Expression box Traces display 2OK traces display Analog Simulation with PSpice page 21
Lesson 3-DC Sweep Markers Plot traces display traces marker 1 X V(In) 2 <Shift> key V(Out) traces 3 <Delete> key display traces 4 <Alt-Tab> Schematics window 5 PSpice/Markers/Voltage Level 6 node In marker 7 node Out marker 8 click placement mode 9 Probe window Probe display of DC Sweep page 22 Analog Simulation with PSpice
AC Sweep Lesson 4 Goals: AC analysis, AC sources, Probe, markers AC Sweep analysis, PSpice small-signal voltage Bode plot AC Sweep signal analysis 100 1V 100V nonlinear effects simulation Analog Simulation with PSpice page 23
Lesson 4-AC Sweep AC Sweep Analysis setup Analysis Setup dialog AC Sweep/Noise sweep type Total Pts Field points number linear sweep point number frequency swept Octave Decade sweeps points number octave decade point OK Exit Noise analysis blank page 24 Analog Simulation with PSpice
Lesson 4-AC Sweep AC Sweep analysis AC source, source AC attribute value AC sources, AC source DC source 1 VAC source 2 ACMAG attribute Porperty Editor list 3 Value field phase shift AC voltage current value filed vlaue format <AC magnitude> <Phase shift> 5 volts 90 degree phase shift 5V, 90 4 Apply button Probe Probe simulation table Suffix Meaning of Output Variables for AC analysis None Magnitude DB Magnitude in decibels G Group delay (-dphase/dfrequency) I Imaginary part M Magnitude P Phase in degrees R Real part Examples Meaning of Output Variables II(R13) Imaginary part of the current through R13 IGG(m3) Group delay of M3 s gate current IR(VIN) Real part if I (current) through VIN IAG(T2) Group delay of current at port A of T2 V(2,3) Magnitude of complex voltage across nodes 2 & 3 VDB(R1) Db magnitude of V across R1 VBEP(Q3) Phase of base-emitter V at Q3 VM(2) Magnitude of V at node 2 Analog Simulation with PSpice page 25
Lesson 4-AC Sweep Probe Function Description Available in PSpice A/D? ABS(x) x YES SGN(x) +1 (if x>0), 0(if x=0), -1(if YES x<0) SQRT(x) x1/2 YES EXP(x) e x YES LOG(x) ln(x) YES LOG10(x) log(x) YES M(x) magnitude of x YES P(x) phase of x(degrees) YES R(x) Real part of x YES IMG(x) Imaginary part of x YES G(x) Group delay of x (seconds) NO PWR(x,y) x y YES SIN(x) sin(x) YES COS(x) cos(x) YES TAN(x) tan(x) YES ATAN(x) tan -1 YES ARCTAN(x) d(x) Derivative of x with respect YES* to the x-axis variable s(x) Integral of x over the range YES** of the x-axis variable AVG(x) running average of x over NO the range of the x-axis variable AVGX(x,d) running average of x from NO X_axis_value(x)-d to X_axis_value(x) RMS(x) Running RMS average of x NO over the range of the x-axis variable DB(x) Magnitude in decibels of x NO MIN(x) Minimum of the real part of NO x MAX(x) Maximum of the real part of x NO * In PSpice A/D, this function is called DDT(x) ** In PSpice A/D, this function is called SDT(x) Note AC analysis Probe s magnitude display page 26 Analog Simulation with PSpice
Lesson 4-AC Sweep Exercise Clipper circuit 1 circuit R, C, VDC, VAC, D1N3940, EGND, BUBBLE reference designators caps resistors label 2 Markers/Advanced marker vdb 3 Clipperopj Analog Simulation with PSpice page 27
Lesson 4-AC Sweep AC sweep simulation 1 PSpice Edit Simulation Settings 2 Simulation Settings dialog box AC Sweep 3 AC sweep 4 OK Simulation Settings dialog box 5 Close Analysis Setup dialog box 6 PSpice menu Run, simulate toolbar button UNIT Scale Symbol Name 10 +12 T, t Tera- 10 +9 G, g Giga- 10 +6 MEG, Meg, meg Mega- 10 +3 K, k Kilo- C, c Clock cycle (digital) 10-3 M,m Milli- 254*10-6 MIL, Mil, mil mil 10-6 U,u Micro- 10-9 N,n Nano- 10-12 P,p Pico- 10-15 F,f Femto- page 28 Analog Simulation with PSpice
Lesson 4-AC Sweep Probe Probe marker net voltage db magnitude (20log10) Out Mid VDB(Mid), capacitance load resistor VDB(Out) bandpass response linear analysis AC 1V ( ) Analog Simulation with PSpice page 29
Lesson 4-AC Sweep Bode plot 1 Schematics PSpice/Markers/Mark Advanced 2 Out Vdb Vphase marker 3 Mid Vdb marker 4 Probe window plots 5 VP(Out) 6 Edit/Cut Cut toolbar button 7 Plot/Add Y Axis 8 Edit/Paste bode plot Bode Plot of Clipper s Frequency Response page 30 Analog Simulation with PSpice
Stimulus Editor Goals: stimulus source symbols /, stimulis (PWL, sin wave, clock, bus), configure & unconfigure stimulus file Stimulus Editor (StmEd) transient analog digital sources PSpice source SIN, PWL, SFFM, Exponential, Pulse, digital Signals stimuli ASCII file file configured schematic simulation stimulus file local global Schematics 3 stimulus symbols stimuls type Vstim StmEd voltage sources Lesson 5 Istim StmEd current sources Analog Simulation with PSpice page 31
Lesson 5-Stimulus Editor Digstim StmEd digital sources Simulation Settings dailog stimulus schematic stl directory file local stimulus file PSpice/Edit Simulation Settings Library tab dialog stimulus files configure page 32 Analog Simulation with PSpice
Lesson 5-Stimulus Editor Exercise 1 Sin Wave Stimulus 1 Schematics dsn pop-up New Schematic 2 VSTIM 3 STIMULUS= text 60_hz_sin 4 STIMTEST file 5 VSTIM Edit/PSpice Stimulus stimuls dialog 6 SIN radio 7 OK 8 dialog Offset 0 Amplitude 5 Frequency 60 amplitude peak-to-peak 9 OK 60Hz sine sin wave 10 File Save toolbar button 11 Schematics PSpice/Edit Simulation Setting Library tab Analog Simulation with PSpice page 33
Lesson 5-Stimulus Editor Exercise 2 Piecewise Linear Stimulus exercise exercise one Stimulus Editor 1 StmEd window 2 Stimulus/New 3 Name MYPWL 4 PWL radio button 5 OK button cursor 6 Axis Setting toolbar button 7 X 2m 8 Y 01 9 OK button 10 cursor window X Y 11 (2m, 0) data point square marker ( vertex) 12 (4m, 25) (6m, 2,5) (8m, 0) (10m, 0) (12m, -25) (14m, -25) (16m, 0) (18m, 0) (20m, 25) (22m, 2,5) (24m, 0) (26m, 0) (28m, -25) (30m, -25) (32m, 0) (34m, 0) (36m, 5) (38m, 2,5) (40m, 0) (42m, 0) 13 placement mode page 34 Analog Simulation with PSpice
Lesson 5-Stimulus Editor Correcting mistakes PWL stimulus points points ( vetices) Point 1 vertex 2, vertex 1 point 2 delete key delete Vertex 1 Add New Point toolbar button 2 new point 3 placement mode Analog Simulation with PSpice page 35
Transient Analysis Lesson 6 Goals transient analysis,stimulus Editor,Probe Transient analysis time domain simulation transient Probe oscilloscope Time x swept voltage current y Print Step VPRINT or VPLOT printing plotting Print Step Probe Final Time simulation transient simulations TIME=0 Final Time No-Print Delay time period Step Ceiling simulator step size waveform convergence error Detailed Bias Pt transient bias solution Analog Simulation with PSpice page 37
Lesson 6-Transient Analysis A note on Bias calculations: simulation DC bias calculation OP bias calculation transient analysis transient bias DC value ( source AC, DC, transient component) source TIME=0 OP bias calculation DC value transient bias e source TIME = 0 source Exercise 1 1 rcdsn 2 DC source Vstim source 3 attribute MYOULSE pulse source StmEd 4 StmEd file StmEd 5 PSpice/Edit Simulation Settings DC Sweep 6 Transient Analysis final time 5u Probe Print Step 7 OK 8 Close button setup dialog 9 Run toolbar button simulation 10 IN OUT net marker schematic markers ( simulate ), Probe traces (V(IN) V(OUT)) Add Trace toolbar button 11 schematic fil page 38 Analog Simulation with PSpice
Lesson 6-Transient Analysis waveforms ramps steady state Probe display of transient RC simulation Analog Simulation with PSpice page 39
Lesson 6-Transient Analysis Exercise 2 1 rcdsn LF411, Bubble, VDC refergators component values 2 File/Save As opampdsn 3 transient analysis stimulus file PSpice/Edit Simulation Settings library tab 4 simulation run 5 Probe Add Trace toolbar button I(CAP1) 6 Plot/Add Y Axis Y 7 trace I(CAP2) 8 Plot/Axis Settings Y labels 9 pulldown box Y list 1 10 CAP1 Current 11 Y list 2 12 CAP2 Current 13 OK dialog page 40 Analog Simulation with PSpice
Lesson 6-Transient Analysis Note: Y >>,, Multiple Y axis plot Analog Simulation with PSpice page 41
Parametric Analysis Lesson 7 Goals: global parameter, parametric simulation Probe, Parametric analysis Parametric analysis parameter parameters voltage source, current source, temperature, model parameter, global parameter Parametric analysis parameter parameter list linear, octave, decade sweep A parametric analysis basic analysis type AC Sweep, DC Sweep, transient simulations enabled parametric analysis parameter simulation global parameter model parameter parametric DC Sweep Probe parametric analysis curves parametric analysis global parameter component value, model value, Analog Behavioral Modeling expression analysis specification (AC Sweep, DC Sweep, or transient) parametric analysis specification design simulate Probe Analog Simulation with PSpice page 43
Lesson 7-Parametric Analysis Exercise Opampsch global parameter 1 Place/Part 2 PARAM part name 3 Ok 4 PARAM component placement mode 5 PARAMETERS : symbol attribute 6 NAME1 CVAL Apply button 7 VALUE1 1n Apply button 1n 8 OK dialog box page 44 Analog Simulation with PSpice
Lesson 7-Parametric Analysis attribute value global parameter 1 CAP2 ( 1n) 2 {CVAL} 3 OK model parameter component (resistors, capciture,inductors ) simulation { } PSpice, 1n { CAP2} CAP2 PSpice CVAL CVAL parameter simulation PSpice/Edit Simulation Seetings 1 Parameter Analysis 2 Global Parameter radio button sweep parameter 3 Name parameter {} 4 Linear radio button linear sweep 5 Start Value parameter 100p 6 End Value 700p 7 Increment 25p 8 OK dialog parametric analysis 9 transient analysis configure Run Analog Simulation with PSpice page 45
Lesson 7-Parametric Analysis Probe CAP2 25 transient analysis 25 list option OK 25 traces 1 <alt-tab> 2 PSpice/Markers/Mark Current into Pin 3 CAP2 marker 4 <alt-tab> Probe 25 traces CAP2 100p 700p 1 X I(CAP2) <delete> 25 traces 2 Add Trace toolbar button 3 space trace command I(CAP2)@25 I(CAP2) @1 trace list I(CAP2) command box field peak value Pobe peak search 25 1 1 Add Trace toolbar button 2 Trace command I(CAP2)@25 I(CAP2)@1 3 OK 4 Toggle Cursor toolbar button 5 I(CAP2)@25 I(CAP2)@1 page 46 Analog Simulation with PSpice
Lesson 7-Parametric Analysis 6 Cursor Peak toolbar button cursor box Y 144084u CAP2 700pF,CAP2 144uA CAP2 100pF Probe Performance Analysis Performance Analysis search commands functions Add Trace search command CAP2 capacitance performance analysis PSpice A/D & Basics+ User s Guide performance analysis Extra Credit: Probe use Trace/Performance Analysis/Wizard I(CAP2) Y PLOT CVAL Analog Simulation with PSpice page 47
Analog Simulation with PSpice page 49