40
Introduction to PSpice John Evans IT/CE September, 1999

PSpice Intro v8

Embed Size (px)

Citation preview

Page 1: PSpice Intro v8

Introduction to PSpice

John Evans IT/CESeptember, 1999

Page 2: PSpice Intro v8

Introduction to PSpice 2

A brief history of time… (1)

MicroSim - 1980s(?) - 1997/8 OrCAD “merges” with MicroSim 1997/8 OrCAD merges with Symmetry 1998

– OrCAD doesn’t merge with Symmetry 1999

Cadence buys OrCAD 1999

Page 3: PSpice Intro v8

Introduction to PSpice 3

A brief history of time… (2)

Last MicroSim version - v8 First OrCAD version - v9 This used “Capture” - the OrCAD schematic

capture program. Not introduced at CERN. v9 to be introduced at CERN after Windows

upgrade. OrCAD will use “MicroSim” schematics for next two years.

Page 4: PSpice Intro v8

Introduction to PSpice 4

Where are we going to today?

Use Schematic capture – to enter schematic and set up simulation parameters before running

PSpice (simulation engine) – and then look at results in

Probe

Also available at CERN:

– Parts (modelling program)

– Stimulus Editor (to produce “custom” voltage/current/digital sources)

– Optimizer (can automatically vary circuit component values to satisfy design criteria)

Page 5: PSpice Intro v8

Introduction to PSpice 5

Set-up PSpice

Run set-up from Windows menu– Makes “default” directories for temp files,

backup files and user libraries.– Copies required files over to PC

• msim.ini (contains all library paths, controls “look” of the programs)

• msim.prb (used while running Probe)

Page 6: PSpice Intro v8

Introduction to PSpice 6

Freq1.sch (1)

Enter the circuit shown.– Use components:

• VDC

• R

• C

• VAC (VSIN)

• AGND

• OP-07

• Bubble

Use the commands…

Page 7: PSpice Intro v8

Introduction to PSpice 7

Freq1.sch (2)

Get new parttoolbar -

menu - Draw/Get new part

keyboard - ctrl-G

Flip/rotate partmenu - Edit/Flip/rotate

keyboard - ctrl-F, ctrl-R

Cut/Copy/Paste partmenu - Edit Cut/Copy/Paste

keyboard - ctrl-X, ctrl-C,ctrl-V

Page 8: PSpice Intro v8

Introduction to PSpice 8

Freq1.sch (3)

Wire circuit– Draw/Wire

– ctrl-W

use space bar/RMB Change resistor values Change Ref(erence)

Des(ignators) Label node v_out Change VDC values Label bubble connectors

Page 9: PSpice Intro v8

Introduction to PSpice 9

Set-up VAC source

Set-up VAC*– DC=0

• used to find initial DC solution

– ACMAG=1

• source p-to-p value during AC analysis

– ACPHASE=0

• reference for phase measurements

*VSIN can also be used for AC analysis - see Appendix 1 for set-up explanation

Page 10: PSpice Intro v8

Introduction to PSpice 10

Set-up AC analysis and Probe

From Menu

– Analysis/Setup… or Toolbar -

Click “AC Sweep”

– Enter as shown

– Click “OK”

Page 11: PSpice Intro v8

Introduction to PSpice 11

Set-up Probe and Run Analysis

Set-up Probe– From Menu

• Analysis/Probe Setup…

– Under Data Collection tab, select “All”

N.B. other options allow to limit size of .dat file

Run Analysis– From Menu

• Analysis/Simulate

– From keyboard• F11

– From Toolbar -

Page 12: PSpice Intro v8

Introduction to PSpice 12

Some Probe commands Add Trace

– Trace/Add

– Insert

reduce traces shown,

use voltage markers

Add Y-axis– Plot/Add Y-axis

– Ctrl-YN.B “>>” indicates the active axis

Display manipulation functions–

or

– from the menu

• View/Fit,In,Out,Areaor

– from the keyboard

• Ctrl N,I,O,A To re-scale axes

– double-click on any axisor

– Plot X(Y)-Axis Settings...

Page 13: PSpice Intro v8

Introduction to PSpice 13

Exercise: Measure the f3dB point of v_out using the cursors

In Probe:– Trace/Add, DB(V(v_out))

– To make cursors active - select

– Place one cursor on nominal 0dB point

– Move other cursor until “dif” shows difference of 3dB

Page 14: PSpice Intro v8

Introduction to PSpice 14

Exercise: Measure the f3dB point of v_out using a goal function

N.B. to see a detailed explanation of this goal function and its parameters, select:– Trace/Goal Functions, LPBW, View– The g.f. can also be evaluated from this window (select Eval instead of View)

In Probe:Trace/Eval Goal Function…

Select: LPBW(1,db_level)

Select: V(v_out)

Enter 3 from the keyboard

Click on OK

Page 15: PSpice Intro v8

Introduction to PSpice 15

Adding parameters

Change C1 value to {c_val}N.B. name is unimportant but { } are mandatory

Add a PARAM symbol (Draw/Get New Part…/ Param)

Set up NAME1 and VALUE1 PARAM values (double-click on the symbol).

Click OK

Page 16: PSpice Intro v8

Introduction to PSpice 16

Set-up Parametric sweep

Setup a Parametric sweep (Analysis/Setup…/Parametric)

Click OK

Run AC analysis

Page 17: PSpice Intro v8

Introduction to PSpice 17

Parametric analysis results

When Probe opens, it will (typically) show:

The analysis results are split into “sections”. There is one section for each value of parametric sweep

Click on OK

Page 18: PSpice Intro v8

Introduction to PSpice 18

Exercises - Performance Analysis

Select Trace/Add. Plot DB(V(v_out)) Select Trace/Performance Analysis (or from the

toolbar). Click OK

- a new window appears. The X-axis is R, the parameter varied

Select Trace/Add. Plot (LPBW(V(v_out),3)) Select Plot/Add Plot Select Trace/Add. Plot 1/(LPBW(V(v_out),3))

Page 19: PSpice Intro v8

Introduction to PSpice 19

Transient.sch (1) Load transient.sch Complete by adding

IPWL*

(IPWL is a Piece Wise Linear current source)

Set-up IPWL by adding (time,current) points:(T1=0, I1=0),

(T2=10ms, I2=0),

(T3=10.1ms, I3=1)

*to set-up the ISTIM part, see appendix 3

Page 20: PSpice Intro v8

20

Set-up transient and exercises

Set-up transient run:

– Print step: 100ms

– final time: 20s

What range of values of R1 satisfies: – risetime I(L1) < 2s

– overshoot I(L1) < 10% ?

Hints:– Range is somewhere between 0.4 and 1.5 Ohms (set-up Parametric Analysis

in Schematics using Analysis/Setup…/Parametric…)

– In Probe, select Trace/Performance Analysis… , click OK

– Use GenRise() and Overshoot() goal functions

Page 21: PSpice Intro v8

21

Exercises

Exercise 1 Design a “perfect” non-inverting voltage op-amp using E (voltage-controlled voltage-

source). Verify using VPULSE (appendix 2) and transient analysis Design a “perfect” non-inverting voltage op-amp using A(nalog) B(ehavioral)

M(odelling) parts (found in ABM library) Design an imperfect non-inverting voltage op-amp (output limited to ”supply

voltage”).

Exercise 2 Design an attenuator with input

parameters IMP and ATT. Calculate values for R1,R2 such that:

– v_out = v_in - ATT dB

– The impedance seen from RS = IMP

– Add parameter checking

Page 22: PSpice Intro v8

Introduction to PSpice 22

Slow.sch

Load and simulate slow.sch

Zoom in on the output Replace the digital pullup

with a 1k resistor to +5V and re-simulate

What’s the difference?

Page 23: PSpice Intro v8

Introduction to PSpice 23

Digital simulation (1)

“PSpice” is two simulators - one analogue and one digital– The analogue one solves Kirchoff’s laws

– The digital one uses Boolean arithmetic

The digital simulator has an extensive library of “characterised” digital parts - these are mostly behavioural models only (which includes timing information)

To simulate “real” (analogue) input/output behaviour, find the transistor-level circuits– proprietary information

– very slow simulation speeds

Page 24: PSpice Intro v8

Introduction to PSpice 24

Digital simulation (2)

Digital device libraries are usually specified in families. Each device has its own timing model (typical, min., max.

times specified here) Each device has an I/O model. This will be shared by all

devices in the same logic family– The I/O model includes a nominal impedance representation for

each I/O pin. It also includes information on which type of AtoD and DtoA converter to use for each device. These converters are powered off the supplies defined by IPIN(supply).

The converters are ONLY USED when interfacing between the analogue and digital simulators!

Page 25: PSpice Intro v8

Introduction to PSpice 25

Digpower.sch (see Appendices 4, 5)

Page 26: PSpice Intro v8

Introduction to PSpice 26

Digital Setup

Timing mode– leave on Typical

Flip-flop initialization– depends on circuit

Default Interface– leave on Level 1

If you have lots of “unimportant” digital warnings - set Default A/D Interface to Level 2 (see Appendix 6)

Page 27: PSpice Intro v8

Introduction to PSpice 27

Setting Initial Conditions

Initial conditions can be set in the analogue simulator using:– IC on components– Setpoints– Nodeset– Save/Load Bias Point

(also see Appendix 7)

Page 28: PSpice Intro v8

28Introduction to PSpice

Page 29: PSpice Intro v8

Introduction to PSpice 29

Appendices

1) Setup VSIN 2) Setup VPULSE 3) Setup ISTIM 4) Default digital power supplies 5) Changing CMOS power supplies 6) Default A/D interface definitions 7) Setting Initial Conditions

Page 30: PSpice Intro v8

Introduction to PSpice 30

Appendix 1 - Setup VSIN

Set-up VSIN – DC=0

– AC=1*

– VOFF=2

– VAMPL=2

– FREQ=5

– TD=1

– DF=1

– PHASE=45

*AC Analysis only

Page 31: PSpice Intro v8

Introduction to PSpice 31

Appendix 2 - Setup VPULSE

Example – DC=0

– AC=1*

– V1=1

– V2=4

– TD=1

– TR=1

– TF=1

– PW=2

– PER=6

*AC Analysis only

Page 32: PSpice Intro v8

32

Appendix 3 - Setup ISTIM

Double click on Stimulus=– Enter name test

– Double click on ISTIM body to open STMED - Select PWL

Double-click on axis– Set X-axis to range 10.1ms,

resolution 0.1ms

– Set Y-axis to range 1, resolution 0.2

– Enter (time,value) points using the “pencil” :

(t1=0, I1=0), (t2=10ms, I1=0), (t3=10.1ms,

I3=1)

Save and exit Stimulus Editor N.B this saves the stimulus “test” in

transient.stl

Page 33: PSpice Intro v8

Introduction to PSpice 33

Appendix 4 - Default digital power supplies

Most digital parts and stimulii already have a default power supply.

The four default power supplies provided in the model library are:

– DIGIFPWR (TTL)– CD4000_PWR (CD4000

series CMOS)– ECL_10K_PWR (ECL10K)– ECL_100K_PWR (ECL

100K).

Page 34: PSpice Intro v8

Introduction to PSpice 34

Appendix 5 - Changing CMOS power supplies

Change default values for $G_CD4000_VDD/ $G_CD4000_VSS – Use the PARAM symbol

– Enter the required values for CD4000_VDD and CD4000_VSS Create a custom CMOS supply

– use the symbol CD4000_PWR

– Name VDD_NODE and VSS_NODE

– Give values to VOLTAGE and REFERENCE*– Change power pins on IC symbol to reference custom supply– See example digpower.sch

* VSS_NODE = REFERENCE Volts

VDD_NODE = (VOLTAGE + REFERENCE) Volts

Page 35: PSpice Intro v8

Introduction to PSpice 35

Appendix 6 - Default A/D interface definitions

Default A/D interfaceLevel 1 (AtoD1/DtoA1) - AtoD generates intermediate R,F, and X levels

Level 2 (AtoD2/DtoA2) - AtoD does not generate R,F, and X levels

Level 3 (AtoD3/DtoA3) => same as level 1*

Level 4 (AtoD4/DtoA4) => same as level 2*

N.B. DtoA1 is always the same as DtoA2

For HC/HCT parts, there are two different DtoA models

Simple (level 1 or 2) - assumes fixed supply of +5V at 25C

Elaborate (level 3 or 4) - valid from 2-6V, temperature derated

N.B. Elaborate is much slower than simple - don’t use unless required

Page 36: PSpice Intro v8

Introduction to PSpice 36

Appendix 7 - Setting Initial Conditions

(Following extracted from the “PSpice Reference Manual”)

IC Initial ConditionA voltage assigned to <node> (or a current assigned to an inductor) for the duration of the bias point calculation.The voltage between two nodes and the current through an inductor can be specified. During bias calculations, PSpice clamps the voltages to specified values by attaching a voltage source with a 0.0002 ohm series resistor between the specified nodes. After the bias point has been calculated and the transient analysis started, the node is released.

.NODESET This helps calculate the bias point by providing an initial best guess for some node voltages and/or inductor currents. Some or all of the circuit’s node voltages and inductor currents can be given the initial guess, and in addition, the voltage between two nodes can be specified.The command is effective for the bias point (both small-signal and transient bias points) and for the first step of the DC sweep. It has no effect during the rest of the DC sweep, nor during a transient analysis.Unlike the .IC (Initial Bias Point Condition) command, .NODESET provides only an initial guess for some initial values. It does not clamp those nodes to the specified voltages. However, by providing an initial guess, .NODESET can be used to break the tie in, for instance, a flip-flop, and make it come up in a required state.

If both the .IC command and .NODESET command are present, the .NODESET command is ignored for the bias point calculations (.IC overrides .NODESET).

Other methods of setting initial conditions are by using Save Bias Point and Load Bias Point options - refer to the PSpice Reference manual for more information.

Page 37: PSpice Intro v8

37Introduction to PSpice

Page 38: PSpice Intro v8

38

Exercise 1 “Solution”

Page 39: PSpice Intro v8

Introduction to PSpice 39

Exercise 2 “Solution” (no parameter checking)

Page 40: PSpice Intro v8

40

Exercise 2 “Solution” (with parameter checking)