MicroSim Tutorial Simulation program Test and Refine your design before ever touching a piece of...

Preview:

Citation preview

MicroSim Tutorial

Simulation program Test and Refine your design before ever touching a piece of hardware.

Pspice A/D, Pspice A/D, 是 是 Pspice Pspice 的 的 Windows Windows 版版 ,,而 而 Pspice Pspice 是 是 SPICE SPICE 軟體的一支軟體的一支 ,,SPICE SPICE 軟體是一種專門針對電路模擬分析軟體是一種專門針對電路模擬分析的軟體的軟體 , , 原本原本 PSPICE PSPICE 是一套 是一套 DOS DOS 版的軟體版的軟體 ,,是由 是由 SPICE 2 SPICE 2 所發展出來所發展出來 ..

SPICE SPICE2PSPICE

IS-SPICE

HSPICE

Pspice A/D

SPICE SPICE 的全名是的全名是Simulation Program with Integrated Circuit Simulation Program with Integrated Circuit

Emphasis,Emphasis,

由上面的全名可以知道是專門為積體電路進由上面的全名可以知道是專門為積體電路進行模擬分析的程式行模擬分析的程式 , , 由於積體電路越來越複由於積體電路越來越複雜雜 , , 難以利用紙筆分析結果難以利用紙筆分析結果 , , 所以利用電腦所以利用電腦軟體分析這些越來越複雜的電路軟體分析這些越來越複雜的電路 , , 可以在最可以在最快的時間內快的時間內 , , 得到最正確的結果得到最正確的結果 ..

利用元件符號編輯器利用元件符號編輯器 ,,

可以產生符號元件庫可以產生符號元件庫 (.(.slb)slb) 和模擬資料庫和模擬資料庫 (.(.lib),lib),

由這兩個資料庫檔案才能建立電路圖由這兩個資料庫檔案才能建立電路圖 ,,

透過 透過 Schematics Schematics 功能的電路圖編輯器功能的電路圖編輯器 ,,

呼叫符號元件庫和模型資料庫中的元件呼叫符號元件庫和模型資料庫中的元件和模型和模型 ((Model), Model), 即可以建立電路檔案即可以建立電路檔案 (.(.sch).sch).

電路檔案必須 電路檔案必須 Extract Netlist,Extract Netlist,

產生執行 產生執行 Pspice Pspice 所需的檔案所需的檔案(.(.cir, .net cir, .net 和 和 ..als),als),

把上面檔案送入 把上面檔案送入 Pspice Pspice 電路模擬器電路模擬器 ,,

模擬分析電路模擬分析電路 ,,

會產生兩種會產生兩種輸出方式 輸出方式 ::

文字輸出檔文字輸出檔 (.(.out)out)

和圖形資料檔和圖形資料檔 (.(.dat),dat),

其中圖形資料檔其中圖形資料檔 (.(.dat)dat)可以利用 可以利用 Probe Probe 功能產生圖形功能產生圖形 ,, 提供使用者分提供使用者分析析 ..

檔案 代表內容

.slb 儲存元件符號 (symbol) 的資料庫檔案

.lib 儲存元件模型 (Model) 的資料庫檔案

.sch 儲存利用電路圖編輯器產生的電路圖

.cir 儲存參考到 netlist, alias 和 model 檔案的電路圖 , 可以直接送入 Pspice 分析結果 , 這是 Pspice 軟體最重要的檔案.net 儲存所有元件和它們之間的連接情況 (netlist)

.als 儲存電路節點的名稱 , 模型的特性值及元件的別名

.out 儲存文字輸出結果

.dat 儲存圖形資料結果 , 可以送入 Probe 中 , 分析圖形

 • Draw the schematic of the circuit.• Change the values of the

components and sources.• Add any probe or marker.• Setup analysis• Run simulation.• Add the traces in the probe.

Procedure For simulation in schematics

Schematic Circuit•A part is a basic circuit element, such as a resistor or power source. Each part is associated with a part name and is stored in a library.

Part

ConnectionReference

Value

V1=10VR1=1KGND_EARTHAnalysis/Setup/Bias Point DetailAnalysis/Display Result on Schematic/Enable

•Connections are made primarily by wire segments and bus strips.

Part

ConnectionReference

Value

V1=10VR1=1KGND_EARTHAnalysis/Setup/Bias Point DetailAnalysis/Display Result on Schematic/Enable

•References are unique names for parts. Unlike the generic part names (such as VDC and R), references are different for each instance of the same part.

Part

ConnectionReference

Value

V1=10VR1=1KGND_EARTHAnalysis/Setup/Bias Point DetailAnalysis/Display Result on Schematic/Enable

•Values give the magnitude of each part instance. As an option, a name can be associated with each value.

Part

ConnectionReference

Value

V1=10VR1=1KGND_EARTHAnalysis/Setup/Bias Point DetailAnalysis/Display Result on Schematic/Enable

•Run simulation

Part

ConnectionReference

Value

V1=10VR1=1KGND_EARTHAnalysis/Setup/Bias Point DetailAnalysis/Display Result on Schematic/Enable

Output fileEach time Pspice performs an analysis it automatically generates an output file.

Netlist field.* Schematics Netlist *V_V1 $N_0001 0 10VR_R1 0 $N_0001 1K

Alias Field.* Schematics Aliases * .ALIASESV_V1 V1(+=$N_0001 -=0 )R_R1 R1(1=0 2=$N_0001 ).ENDALIASES

Small signal bias solution.**** SMALL SIGNAL BIAS SOLUTION TEMPERATURE = 27.000 DEG CNODE VOLTAGE NODE VOLTAGE NODE VOLTAGE NODE VOLTAGE ($N_0001) 10.0000 VOLTAGE SOURCE CURRENTS NAME CURRENT V_V1 -1.000E-02 TOTAL POWER DISSIPATION 1.00E-01 WATTS

Design Entry

1. To open a Design Manager :

To open the Evaluation Version

 Double-Click on the Pspice-Evaluate Version icon

To open the Full Version

 Double-Click on the [Pspice8] Design Manager icon

Schematics

PSpice A/D

Parts

Probe

Stimulus Editor

TextEdit

Schematics is a design entry program you need to prepare your circuit for simulation. This means:

•Placing and connecting part symbols,

•Defining component values and other attributes,

•Defining input waveforms,

•Enabling one or more analyses, and

•Marking the points in the circuit where you want to see results.

Schematics is also the control point for running other programs used in the simulation design flow.

使用者利用此功能 , 可以建立一個所需要的電路檔案 , 本功能是 Pspice A/D 軟體的人機介面 , 電路檔案呼叫 Pspice A/D 分析 , 利用 Probe 觀看模擬分析結果的圖形 .

PSpice A/D

此功能是 Pspice A/D 軟體的核心部份 , 有了此功能才會有其他功能的出現 , 利用前面 Schematics 功能產生的電路檔案 , 輸入本軟體中 , 進行模擬分析 .

The Parts utility is a model extractor that generates model definitions for PSpice to use during simulation.

雖然 Pspice A/D 軟體提供了大量元件符號資料庫 , 但是使用者可能希望建立自己的元件庫 , 以提供自己的電路使用 , 所以可以利用本功能來建立自己的元件庫 . 但是評估版只能設計二極體元件 , 所以並不適合使用 .

Probe is a graphical results analyzer. When PSpice completes the simulation, Probe plots the waveform results so you can visualize the circuit’s behavior and determine the validity of your design.

觀察分析結果

The Stimulus Editor is a graphical input waveform editor that lets you define the shape of time-based signals used to test your circuit’s response during simulation.

可以產生電路訊號 , 提供電路使用 , 但是評估版只能提供類比訊號的正弦波和數位訊號的時脈 .

2. To create/open a schematics file :

Click on the Schematics icon on Design Manager to open MicroSim Schematics.

Select File/New or click on the new file icon to create new file. 

Select File/Open or click on the open file icon to open existing file.

 

 

Select Draw/Get new part [Ctrl+G] or click on the get new part icon to get new part.

Part Browers Advanced windows is shown below.

In the Part Name text box, type name of the component e.g. VDC.

Click Place & Close icon.

Move the component to the correct position on the schematic.

Right-click to cancel placement.

Part Name DescriptionB GaAsFETC CapacitorD DiodeE Voltage-controlled voltage sourceF Current-controlled current sourceG Voltage-controlled current sourceH Current-controlled voltage sourceI Simple AC current source; DCJ JFETK Non-linear, magnetic coreL InductorM MOSFETQ BJT bipolar transistorR ResistorS Voltage-controlled switch breakout deviceT Transmission LineV Voltage sourceW Current-controlled switch breakout device

3. Changing the value of a component: 

Double-click on the attribute value to change the values of a component e.g. 0V.

In the Set Attribute Value dialog box, type the correct value. Then Click OK.

 

Or Double-click on the component to change the other values of a component.

3. Changing the value of a component: 

比例代號 代表值F 1e-15=10-15

P 1e-12=10-12

N 1e-9=10-9

U 1e-6=10-6

MIL 25.4e-6=25.4x10-6

M 1e-3=10-3

K 1e3=103

MEG 1e6=106

G 1e9=109

T 1e12=1012

4. Changing the reference number of a component:

Double-click on the current reference number e.g. V1 to change the reference number of a component.

5. Edit the component :         Moving a component:

Click on the component once to select it. Drag the component to a new location.

        Rotating a component:

Click on the component once to select it. Select Edit/Rolate [Ctrl+R] to rotate the component in 45 degree. 

        Flipping a component:

Click on the component once to select it. Select Edit/Flip [Ctrl+F] to flip the component. 

        Deleting a component:

Click on the component once to select it. Select Edit/Delete [DELETE] to delete the component.

6. Wiring :

Select Draw/Wire [Ctrl+W] or click on the draw wire icon to wire the components together.

Press Right-Click mouse or [ESC] to finish wiring.

         Labeling a wire

Double-click on the wire to select it. In the Set Attribute Value window type the label of the wire.

7. Adding a Current Source :

   IAC - Simple AC current source  IDC - Simple DC current source  IPULSE - Pulse current source  IPWL - Piecewise linear current source  

8. Adding a Voltage Source :   

VAC - AC Voltage Source  VDC - DC Voltage Source  VPULSE - Voltage Pulse Source  VSRC - AC or DC Voltage Source  VSTIM - Voltage source for StmEd 

ACMAG=?ACPHASE=?

DC=?

V1=?, V2=?, TD=?, TR=?, TF=?, PW=?, PER=?

指數波形電源 VEXP (Exponential delay voltage source) V1=?, V2=?, TD1=?, TC1=?, TD2=?, TC2=?

分段線性電源 VPWL (Piecewise linear voltage source) T1=?, V1=? …….

單頻調頻電源 VSFEM (Single-Frequency FM voltage source) VOFF=?, VAMPL=?, FC=?, MOD=?, FM=?

弦波電源 VSIN (Transient sine voltage source) VOFF=?, VAMPL=?, FREQ=?, TD=?, DF=?, PHASE=?

電壓控制電壓源 E (Voltage-controlled voltage source) E=GAIN=?

電壓控制電流源 G (Voltage-controlled current source) G=GAIN=?

電流控制電壓源 H (Current-controlled voltage source) H=GAIN=?

電流控制電流源 F (Current-controlled current source) F=GAIN=?

9. Changing the settings for current / voltage sources : 

 

 

TD - Time delay 延遲時間

TR - Rise Time 上升時間

TF - Fall Time 下降時間

PER – Period 週期

PW - Pulse width 脈波寬度

VOFF - Offset voltage漂移電壓

FREQ – Frequency弦波頻率

VAMP- Amplitude峰值電壓

10. Adding Connection bubbles : 

Select Draw/Get new part [Ctrl+G] or click on the get new part icon to get new part.

In the Part Name text box, type bubble.

Place the connection bubble in the circuit.

         Adding connection bubbles

Bubbles are components used to connect one part to another without using wire connection.

 

11. Adding Probes :

        Adding a marker to a node

Voltage and current markers are used to probe the voltage or current.

After simulation, PSPICE automatically plot the results.

Voltage marker

Select Markers/Mark Voltage/Level [Ctrl+M] or click voltage marker icon to place the voltage marker. 

Current marker

Select Markers/Mark Current into Pin or click current marker to place the current marker. Voltage

Differential marker

Select Markers/Mark Differential Voltage. Place the two marker + and - between the circuit.  

  Advanced marker 

Select Markers/Advanced… Place the marker on the circuit.

12. Enable Bias voltage display and Bias current display Icon 

  

After simulation, the DC values of voltage and current can be displayed using these functions.

Analysis Setup

Select Analysis/Setup or click on the setup analysis icon to setup analysis.

Analysis setup window will display.

DC currents and voltages are automatically calculated. It is default.

 DC Analysis

(Bias Point Detail)

Under Pspice, the steady state (DC) component is known as the bias point solution and is always calculated first. Since bias-point values do not change with the passage of time, they can be displayed as simple numeric constants.

Transfer Function

The transfer function is the ratio of output over input. 

 

   

Change one or more DC voltage source at the same time.

The output is with respect to the source being swept.

DC Sweep

是指輸入變數在某個範圍內 , 以遞增或遞減方式 , 計算電路的直流分析 .

 

   

DC Sweep

 Nested Sweep…… 巢式掃描

Sensitivity  

靈敏度分析是指電路中每一個電路元件參數變化時 , 對輸出電壓變數或輸出電流變數的影響情況 .分析結果是以文字輸出檔輸出 . (.out file)

Sensitivity is a tolerance problem. For example, we might use DC sensitivity analysis to tell us how each resistor in the circuit affects the Q point voltage. If we find that the Q point is very sensitive to a particular resistor, we might want to reduce that resistor’s tolerance from 10% to 1%.

AC Sweep Analysis determines the output with respect to the frequency.

AC Sweep Analysis

交流分析是利用訊號源做頻率變化 , 測量電路性能的改變情況 .

Noise AnalysisNoise function generates a noise density spectrum for each device over a range of frequencies and performs an RMS sum at the specified output node. (.out file)

Transient Analysis(Transient)

Transient analysis determines the output with respect to time.

Fourier AnalysisFourier analysis is the mathematical technique for switching between the time and frequency domains. (.out file)

Temperature Analysis

Determines the output affected from the tolerances of the components.

Monte Carlo/Worst Case Analysis

          Monte Carlo AnalysisDuring a Monte Carlo analysis, Pspice performs several runs of a DC, AC, or transient analysis, each time varying component values randomly within the tolerance range.          Worst Case AnalysisWorst Case Analysis does not use random variations in several runs of a DC, AC, or transient analysis, each time varying component values within the tolerance range.

Parametric Analysis

RUNNING SIMULATION  

 

Select Analysis/Simulate [F11] or click on the simulate icon to run simulation.

 

After simulation, the DC values of voltage and current can be displayed when using DC bias point analysis. And the Probe will automatically open and all of the value of marker will appear on the plot.

 

Message window will automatically open during simulation.

  

Viewing Results

MicroSim Probe is the waveform analyzer for Pspice simulations. In Probe, you can visually analyze and interactively manipulate the waveform data produced by circuit simulation.

        Traces to the plot from marker

When voltage or current markers were marked in the schematic, the plot will automatically display.

        Add Additional Traces to the plot

Select Trace/Add [Insert] to add new traces.

Then choose from the left column

or in the Trace Expression, type name of the expression.

 

        Add an Additional PlotSelect Plot/Add Plot to add a new plot.         Add a Title to the PlotSelect Edit/Modify Title to modify the title.

        Change Axis Settings

Select Plot/Y-Axis settings or double-click on the y-axis to change the Y-Axis settings.

 

Select Plot/X-Axis settings or double-click on the x-axis to change the X-Axis settings.

        Add a Text LabelsSelect Tools/Label/Text to add text label.          Add probe cursorsSelect Tools/Cursor/Display to add cursors on the plot.A probe cursor box will appear. Coordinates of cursor will display.

        Split two probe cursor (A1, A2)

One cursor is selected by left mouse button and the other cursor is selected by right mouse button. 

 

        Label a probe cursor coordinates

Using left mouse button or right mouse button to select the cursor,

Select Tools/label/Mark to label the cursor coordinates directly.

Example 1

Click on the Schematics icon on Design Manager to open MicroSim Schematics.

Select File/New or Click on the new file icon to create new file. Select Draw/Get New Part and select uA741, C, R, VDC, VSRC, GND_ANALOG. Double-click on the attribute value to change the values of a component. Select Draw/Wire and to connect the component. Select File/Save to save your file. Double-click VSRC (V3) to change AC to 1.

Select Analysis/Setup to setup analysis. And select Bias Point Detail. After simulation, the DC values of voltage and current can be displayed using these functions.

DC Sweep Select Analysis/Setup to setup analysis. And select DC Sweep. Change Name to V3,  Change Start, End and Increment Value to –10, +10 and 0.1. In order to simulate the circuit with the DC input voltage from -10 Volts to 10 Volts with a voltage increment of 0.1 Volts.

Select Analysis/Simulate [F11] to run simulation. MicroSim Probe Window will automatically display. Select Trace/Add in MicroSim Probe. Select V(U1:OUT) to add the output voltage of the Operational Amplifier. Select V(3:+) to add the positive terminal of the input source.

AC Sweep Select Analysis/Setup to setup analysis. And select AC Sweep. Only V3 is AC source. AC sweep is analysis from V3.Change type to DecadeChange Pts/Decade, Start Freq and End Freq to 10, 10 and 100K. The simulation will decade form with 10 points per decade with the frequency of the AC source swept from 10 Hz to 100 kHz.

Select Analysis/Simulate [F11] to run simulation. MicroSim Probe Window will automatically display. Select Trace/Add in MicroSim Probe. Select DB( ) from function or macro window and then select V(U1:OUT).

Transient

For a transient type analysis, one of possible input source is VPWL (Piecewise Linear Voltage Source). Select Draw/Get New Part and select VPWL. Double-click VPWL(V3). Change DC to 0, change AC to 0, and then change T1 = 0m           V1 = 0v T2 = 0.1m       V2 = 1v T3 = 5.0m         V3 = 1v T4 = 5.1m         V4 = 0v T5 = 7.0m         V5 = 0v T6 = 7.1m         V6 = -2v T7 = 9.0m         V7 = -2v T8 = 9.1m         V8 = 0v

Select Analysis/Setup to setup analysis. And select Transient. Change Print Step and Final Time to 10ns and 10ms.  

Select Analysis/Simulate [F11] to run simulation. MicroSim Probe Window will automatically display. Select Trace/Add in MicroSim Probe. Select V(U1:OUT) and V(V3:+). 

Exercise 1Exercise 1

2.sch

Exercise 2Exercise 2

3.sch

Exercise 3Exercise 3

4.sch

Exercise 4Exercise 4

5.sch

Exercise 5Exercise 5

6.sch

Loading effects

Exercise 6Exercise 6

7.sch

Exercise 7Exercise 7

Zener Diode

8.sch

Example2Example2GeneratorHalfwave rectifier

9.sch

Peak RectifierAdd a filter capacitor to smooth out the waveform.

10.sch

Low-Pass FilterAdd low-pass filter shorts the AC ripple to ground

11.sch

Voltage RegulatorZener regulator

12.sch

Voltage Regulation testTo test the voltage regulation characteristics by adding a nested sweep of the R4. 

13.sch

Transformer

14.sch

Example 3:

Bias Point Analysis 

DC Sweep Analysis

Transient AnalysisPlace a VSTIM symbol.Double-click the VSTIM symbol.

In the Set Attribute Value dialog box,

type SINE, then click OK.

The New Stimulus dialog boxand the Stimulus Editor appear.

AC Sweep Analysis

VAC

From the Markers menu, select Mark Advanced.Double-click Vdb.Place one Vdb marker on the output net,

and place another on the Mid net.

Place a Vphase marker on the output next to the Vdb

marker.

Parametric Analysis

From the Trace menu, select Add.In the Trace Expression text box, type the following:Vdb(Out)@1 Vdb(Out)@21

Click OK.

Monte Carlo AnalysisMonte Carlo Analysis

Click on R1 and Select Edit/ModelR=1 LOT=10% DEV=10%C=1 LOT=10% DEV=10%In Analysis/setupAC Sweep Type =Decade,Pts/Decade =5,Start freq.=1,End freq.=100k

Worst CaseWorst CaseAnalysisAnalysis

Fourier AnalysisFourier Analysis

Exercise 8Exercise 8

Multiplier

15.sch

Exercise 9Exercise 9NPN bipolar transistor

16.sch

Differential Amplifier

Exercise10Exercise10

17.sch

Inverting Summing Amplifier

Exercise11Exercise11

18.sch

Unity Gain Amplifier 

Exercise12Exercise12

19.sch

Integrator1Meg resister is used in simulation. 

Exercise13Exercise13

20.sch

Differentiator

Exercise14Exercise14

21.sch

Non-inverting Amplifier

Exercise15Exercise15

22.sch

Inverting Amplifier

Exercise16Exercise16

23.sch

Exercise17Exercise17

24.sch

Gain vs FrequencyWith different R2

Lowpass filter

Exercise18Exercise18

25.sch

Highpass filter 

Exercise19Exercise19

26.sch

Bandpass filter

Exercise20Exercise20

27.sch

Inverter

Example4Example4

28.sch

VPULSE

Propagation Delay

Exercise21Exercise21

29.sch

Clock

Example5Example5

30.sch

DigClock

STIM4 system bus

Exercise22Exercise22

31.sch

MOD-10 

Exercise23Exercise23

32.sch

 Shift Register

Exercise24Exercise24

33.sch

DIGITAL ANALYSIS Select DIGSTIM, GLOBAL in Part Browser

Example6Example6

34.sch

Digstim

Using Editor to create .stl file

Select Analysis/Library and Include File…Browse the .stl file Add stimulus file Select Analysis/SetupClick Transient AnalysisPrint step = 0.1usFinal Time = 20us

Worst Case Analysis

Click Digital Setup in Analysis/SetupTiming Mode = Worst-Case [Min/Max]

Default A/D Interface = Level 1

Flip-flip Initialization = All X

35.sch

Exercise25Exercise25

Double Click DSTIM3 UClock to open Stimulus Editor to edit UClock

Using Editor to add UClear and UInput signal in .stl file

Select Analysis/Library and Include File…Browse the .stl fileAdd stimulus file Select Analysis/SetupClick Transient AnalysisPrint step = 0.1usFinal Time = 20us

Example of schematic of LM380:

LM380LM380

No library, ERROR occurs.

Import library of LM380:Select Analysis/Library and Include Files.Click Browse icon and select the lm380.lib file.Click Add library icon to add lm380.lib.

 

http://www.cadencepcb.com/products/downloads/PSpicestudent/default.asp

Pspice.comPspice.com

http://www.aboutspice.com/

Author Goody, Roy W.

TitleOrCAD PSpice for Windows / Roy W. Goody.

Publisher Upper Saddle River, N.J. : Prentice Hall, c2001.

Edition 3rd ed.

LOCATION CALL NO. STATUS   UL  TK454 .G66 2001 v.1    DUE 21-05-02  UL  TK454 .G66 2001 v.2    DUE 21-05-02  UL  TK454 .G66 2001 v.3    DUE 23-05-02Subject PSpice for Windows.

Electric circuits -- Computer simulation.

Electronic circuits -- Computer simulation.

Note 2nd ed. under title: MicroSim PSpice for Windows. c1998.

Includes index.

Contents v. 1. DC and AC circuits -- v. 2. Devices, circuits, and operational amplifiers -- v. 3. Digital and data communications.

Author Lu, Qinyong.

盧勤庸 .

TitleDian zi dian lu mo ni : shi yong PSpice A/D / Lu Qinyong bian zhu.

電子電路模擬 : 使用 PSpice A/D / 盧勤庸編著 . Publisher Taibei Shi : Quan hua ke ji tu shu gu fen you xian gong si, [min guo] 89 [2000]

台北市 : 全華科技圖書股份有限公司 , [ 民國 ]89[2000]

Edition Xiu ding ban, 2 ban.

修訂版 , 2 版 .

LOCATION CALL NO. STATUS

  UL  TK454 .L796 2000    DUE 14-05-02

  UL  TK454 .L796 2000 CDROM 

  NOT CHCKD OUT

Subject PSpice. Electric circuit analysis -- Data processing.

                            

Electronic Workbench

TopSpice

WinSpice

MacroSim Digital Simulator

Recommended