WinSpice Tutorial 1

masoompunchii856 2,101 views 28 slides Mar 04, 2015
Slide 1
Slide 1 of 28
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28

About This Presentation

WInSpice


Slide Content

1/23/2015 [email protected] 1 An introduction to SPICE BY: Muhammad Ahtsham FB : [email protected] Twitter: @GBA856 Linkedin : [email protected] Feel free to contact on Facebook or Email me at [email protected]

1/23/2015 [email protected] 2 Introduction and Advantages History and How it works Procedure of simulation in Spice Examples of Analysis Contents Of Presentation

1/23/2015 [email protected] 3 Introduction and Advantages

1/23/2015 [email protected] 4 Introduction and Advantages SPICE is the acronym of Simulation program with integrated circuit Emphasis. The concept of SPICE developed after Electronic Workbench that is the software to develop the circuit graphically and then simulate the required result. Workbench software is reliable and acquires less time in order to simulate any circuit but its needs to draw circuit as well. SPICE is a simulation program that does not require to draw any circuit rather it requires to write net list in a particular and specified manner.

1/23/2015 [email protected] 5 Introduction and Advantages SPICE does not need any graphical interface. SPICE evaluate or simulate the result through text-file description. SPICE is fairly easy to use for simple circuits, and its non-graphic interface actually lends itself toward the analysis of circuits that can be difficult to draw . Text file means that you can type the net list in a specified manner through the basic text editor programs such as Notepad and Word pad.

1/23/2015 [email protected] 6 History and How it works

1/23/2015 [email protected] 7 History of SPICE The origin of SPICE traces back to another circuit simulation program called CANCER in 1960s. The CANCER software continued to be improved till the upper age of 1970s. The CANCER software was then rewritten and renamed as SPICE and its first version was published in 1972 for public domain. The version 2 of spice was published in a public domain 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.

1/23/2015 [email protected] 8 History of SPICE A major improvement came about in March of 1985 with version 3 of SPICE (also released under public domain). Now SPICE is 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.

1/23/2015 [email protected] 9 How SPICE simulate any circuit. Programming a circuit simulation with SPICE is much like programming in any other computer language. Commands are typed as text in a file, save that file to the computer's hard drive, and then process the contents of that file with a program (compiler or interpreter) that understands such commands.

1/23/2015 [email protected] 10 How SPICE simulate any circuit.

1/23/2015 [email protected] 11 Types of Analysis SPICE Does:

1/23/2015 [email protected] 12 Procedure of simulation in Spice

1/23/2015 [email protected] 13 How to use SPICE. Download any SPICE software as PSPICE, LTSPICE, Win SPICE etc . Compose a new net list with a text editing program Commonly Notepad or WordPad ). Save that net list to a file with a name of your choice . Run SPICE on that net list and observe the results . If the results contain errors, start up the text editing program again and modify the net list.

1/23/2015 [email protected] 14 How to use SPICE. Run SPICE again and observe the new results . Once you've "debugged" your net list and are getting good results, run SPICE again, only this time redirecting the output to a new file instead of just observing it on the computer screen . Start up a text editing program or a word processor program and open the SPICE output file you just created. Modify that file to suit your formatting needs and either save those changes to disk and/or print them out on paper . The extension ". cir " as not mandatory as it also work on ".txt" or ". inp " extensions.

1/23/2015 [email protected] 15 NETLIST The net list file format required by SPICE is quite simple. A net list file is nothing more than a plain ASCII text file containing multiple lines of text, each line describing either a circuit component or special SPICE command. How to write netlist . There are two types of circuits i.e. DC and AC circuits. In this tutorial we will learn how to write net list of DC circuit . NOTE: We will use Win SPICE in this tutorial. You can get a free trail of Win SPICE at www.winspice.com

1/23/2015 [email protected] 16 How to write netlist . There are 5 steps to write the net list of SPICE. Comments; tells us of what circuit the net list is being written. Declaration of circuit components along with their types and values. To give input. To print output. End Statement. Note: From step 3 to 5, it is necessary to place dot (.) at the beginning of the statement.

1/23/2015 [email protected] 17 How to Write Comments Comments may be included into the net list in two ways: On a single line, using “*” as the first character. After a command line, element line, model line, etc., using “;”. Examples : *---------------- Example 1--------------* *---------------- Components----------* *---------------- Input-------------------* Etc .

1/23/2015 [email protected] 18 Examples of Analysis

1/23/2015 [email protected] 19 DC Simple Circuit Example *-----DC Fist Example-----* Node 1 Node 0 General Form of writing source: Name of component + ve – ve type Value V1 1 0 dc 10V General form of writing Resistor: Name of Resistor + ve – ve Value R1 1 0 10k General form of giving input to SPICE: . Type name of source V0 V f sweep .dc V1 10V 10V 1 General form of printing output to SPICE: . Print dc I(name of according source) .Print dc I(V1) End Statement: .End

1/23/2015 [email protected] 20 DC Simple Circuit Example *-----Example 1-1-----* V1 1 0 DC 10V R1 1 0 10k .DC V1 10V 10V 1 .PRINT DC I(V1) .END *-----Example 1-1-----* I1 0 1 DC 1MA R1 1 0 100k .DC I1 1MA 1MA .PRINT DC V(1) .END

1/23/2015 [email protected] 21 DC Multiple Source Circuit Example Va 1 3 dc 12 Ia 0 2 dc 1 R1 1 2 80 R2 1 0 70 R3 2 3 60 R4 3 0 90 .dc Va 0 12 2 .dc Ia 0 1 0 .print dc v(1) v(2) v(3) .end

1/23/2015 [email protected] 22 DC Multiple Source Circuit Example V1 1 dc 24 V2 3 0 dc 15 R1 1 2 10k R2 2 3 8.1k R3 2 0 4.7k .dc V1 24 8 .dc V2 15 5 .print dc v(1) v(2) v(3) .end

1/23/2015 [email protected] 23 DC Multiple Source Circuit Example Vs1 4 3 dc 5 Vs2 2 1 dc 2 Is 5 6 dc 1m R1 2 7 1k R2 7 6 1k R3 6 5 1k R4 5 4 1k R5 3 2 1k R6 6 0 1k R7 4 0 1k R8 2 0 1k R9 7 0 1k .dc Vs1 0 5 .dc Vs2 0 0 .dc Ia 0 1 .print dc v(1) v(7) .end

1/23/2015 [email protected] 24 Dependent Source Circuit VCVS — Voltage Controlled Voltage Source The output voltage is given by a voltage gain Av multiplied by an input voltage v1. Such a source in SPICE is called an E source . (Fig a) VCCS — Voltage Controlled Current Source The output current is given by a trans conductance Gm multiplied by an input voltage v1. Such a source in SPICE is called a G source . (Fig b) CCVS — Current Controlled Voltage Source The output voltage is given by a trans resistance Rm multiplied by an input current i1. Such a source in SPICE is called an F source . (Fig c) CCCS — Current Controlled Current Source The output current is given by a current gain Ai multiplied by an input current i1. Such a source in SPICE is called an H source . (Fig d)

1/23/2015 [email protected] 25 Dependent Source Circuit Voltage controlled voltage source : Ename N1 N2 NC1 NC2 Value Voltage controlled current source : Gname N1 N2 NC1 NC2 Value Current controlled voltage source : Hname N1 N2 Vcontrol Value Current controlled current source : Fname N1 N2 Vcontrol Value N1 and N2 are the positive and negative terminals of the dependent source, respectively . NC1 and NC2 are the positive and negative terminals of the controlling voltage source, respectively.

1/23/2015 [email protected] 26 Dependent Source Circuit Example V1 1 dc 5 R1 1 2 68 R2 2 0 10 R3 3 0 100 G_Gm 3 2 0 0.5 .dc V1 5 5 1 .print dc v(1) v(2) v(3 ) .end

1/23/2015 [email protected] 27 Dependent Source (VCVS) Circuit Example V1 1 dc 5 R1 1 2 80 R2 2 0 90 R3 3 4 10 R4 4 0 57 E_a 2 3 2 0.5 .dc V1 5 5 1 .print dc v(1) v(2) v(3 ) .end

1/23/2015 [email protected] 28 End Of Ist Tutorial For History and Procedure of Spice Please visit 1st Tutorial For DC circuit Analysis please visit 1 st Tutorial For AC circuit Analysis please visit the 2 nd Tutorial For Learning output of Spice please visit 3 rd Tutorial