Presentation is loading. Please wait.

Presentation is loading. Please wait.

INTRODUCTION Spice.

Similar presentations


Presentation on theme: "INTRODUCTION Spice."— Presentation transcript:

1 INTRODUCTION Spice

2 Simulation Program with Integrated Circuit Emphasis
SPICE Simulation Program with Integrated Circuit Emphasis

3 SPICE is a program which can be used to simulate analog electronic circuits

4 Analog filter circuits have a parameter called a ‘Transfer Function’ which maps input to output with relation to frequency v_in circuit v_out

5 Analog filter circuits have a parameter called a ‘Transfer Function’ which maps input to output with relation to frequency

6 Analog filter circuits have a parameter called a ‘Transfer Function’ which maps input to output with relation to frequency

7 Analog filter circuits have a parameter called a ‘Transfer Function’ which maps input to output with relation to frequency

8 Analog filter circuits have a parameter called a ‘Transfer Function’ which maps input to output with relation to frequency

9 Analog filter circuits have a parameter called a ‘Transfer Function’ which maps input to output with relation to frequency

10 A netlist is a text version of the circuit which describes the components and values for the computer to interpret and solve

11 A netlist is a text version of the circuit which describes the components and values for the computer to interpret and solve

12 A netlist is a text version of the circuit which describes the components and values for the computer to interpret and solve

13 A netlist is a text version of the circuit which describes the components and values for the computer to interpret and solve

14 A netlist is a text version of the circuit which describes the components and values for the computer to interpret and solve

15 A netlist is a text version of the circuit which describes the components and values for the computer to interpret and solve

16 A netlist is a text version of the circuit which describes the components and values for the computer to interpret and solve * Basic DC circuit V R k R k V R k .OP .END

17 A netlist is a text version of the circuit which describes the components and values for the computer to interpret and solve * Series_RLC Circuit V1 1 0 SIN(0 5 1k) AC 1 R L mH C uF .AC DEC k .END

18 WHAT IS SPICE? Spice is a software program that simulates electronic circuits and outputs the circuits’ basic characteristics such as: Voltage Current Resistance at any location in the circuit HSpice is a version used in Unix PSpice is a version used in Windows T-Spice simpler tool meant for smaller circuits – this is what you will use in the lab LT spice is free OptiSPICE is the best because it was written by your professor.

19 WORKFLOW Create an Spice input file that describes the circuit
Run Spice Inspect the output

20 THE NETLIST - A netlist describes the circuit to the program
- Node 0 is always GROUND node name value R_R C_C u V_V dc ac 1.0 sin( )

21 THE INPUT FILE Title “my filter circuit” .options ingold=2
R_R C_C u IC=0 V_V1 2 0 dc 0.0 ac 1.0 sin( ) .print ac V(1) .ac LIN e+06 .op .END The title must be the first line in the netlist (in order to recognize the options command) - R1 = 100Ω (Ohms) - C1 = uF (micro Farads) with initial condition of 0 - V1 = sine wave with 1Hz frequency, 0 to 1V magnitude - Print ac voltage at node 1 - Want 100 frequency points from to 1e+06

22 LTSpice – demo later

23 Others might be available
Hspice (not likely and difficult to use) Instructions likely obsolete PSpice Not sure we have full licence Tspice Might be ok – netlist based I think. OptiSpice – the best (it’s mine).

24 BIPOLAR JUNCTION TRANSISTOR
Input Voltage Output Voltage 3-terminals: Collector, Base, and Emitter Common Emitter Amplifier input = base with respect to the emitter output = collector with respect to the emitter Most commonly used configuration for transistor-based amplifiers as it produces the highest voltage, current, and power gain.

25 BJT

26 OUTPUT FROM HSPICE

27 SOME USEFUL NETLIST STATEMENTS
Analysis Types: Operating Point (.OC) - Voltage at each node and current from voltage sources AC Analysis (.AC) - Small signal model output at different frequencies Transient (.TRAN) - Circuit output as time passes Scale factors: T : E+12 G : E+9 MEG : E+6 K : E+3 M : E-3 U: E-3 N: E-9 P: E-12 F: E-15

28 SOME USEFUL NETLIST STATEMENTS
Components: SOME USEFUL NETLIST STATEMENTS Netlist Name Component Type Example Rname Resistor Rname N+ N- Value Cname Capacitor Cname N+ N- Value <IC=Initial Condition> Lname Inductor Lname N+ N- Value <IC=Initial Condition> Vname Voltage Source Voltage source: Vname N+ N- <DC=> DCValue Iname Current Source Current source: Iname N+ N- <DC=> DCValue Qname Bipolar Transistor Qname C B E BJT_modelName Mname MOSFET Mname ND NG NS <NB> ModName <L=VAL> <W=VAL> Sweep Distributions: - DEC : Log distributions of points - LIN: Linear distribution of points

29 LTSpice - demo

30 Principles & Applications
Electronics Principles & Applications 8th Edition Charles A. Schuler LTspice IV McGraw-Hill ©2013 by The McGraw-Hill Companies, Inc. All rights reserved

31 LTspice IV is a free download and can be found on the Linear Technology website:

32 It’s easy to “draw” a circuit.
Get started by clicking File and then New Schematic, or hold down the Control key and then press the “N” key (Ctrl+N).

33 Drawing a circuit … is easier if the grid is active. Click on View and then Show Grid. Or, you can type Ctrl+G.

34 Delete tool It is easy to place grounds and basic components. Click on the desired component and then move the mouse to position it and then left click to place it. You will find that the connectors (square blue boxes above) snap to the nearest grid points. To place another component of the same type, move to the next location and click the left mouse button again. To cancel or quit a component type, click the right mouse button. It is often more time efficient to place all of the resistors, then the capacitors, and so on. Use the scissors (delete tool) to remove components and wires.

35 After a component has been selected, it can be rotated by holding down the Control key and then pressing the R key. Here, D1 was placed first (by left-clicking in the desired location on the schematic) followed by Control+R and then D2 was placed followed by Control+R again and so on.

36 Rotated components Mirrored components Control+E was used here before placing Q2 on the above schematic. Note that Q2 is the mirror image of Q1. Control+E is the mirror command. Control+R and Control+E are keyboard shortcuts. Rotated and mirrored

37 Additional components are available by clicking on the gate symbol or by pressing the F2 key. Suppose you need a voltage source. Choose “voltage” from the component symbol list and then place the source on the drawing area with a left click. Right click the source to specify the voltage. To specify a sinusoidal voltage source, select Advanced after right clicking. or

38 Specifying a SINE ac voltage source
Amplitude and Frequency (V1, as shown here, is a 44-V dc source.)

39 Unconnected nodes can cause Netlist errors.
Use the pencil tool to connect the components. Left click a terminal (blue box) and then move the mouse to the connecting terminal and left click again. The crosshairs below are positioned to connect R4 to R5. The blue boxes disappear after they are connected. Unconnected nodes can cause Netlist errors.

40 Tool Bar Summary Place Diode Place Inductor Place Capacitor
Place Resistor Label Node Place Circuit Element Place Ground Draw Wire Simulate Move Zoom In Drag Pan Undo Zoom Out Find Redo Auto Scale Delete Rotate Copy Mirror Paste Place Comment Place SPICE Directive

41 You must specify component values.
Place a resistor and right click it to enter its values. Or, click Select Resistor to view a Standard list. You must specify component values.

42 Right click the resistor label to enter a new reference designator
Right click the resistor label to enter a new reference designator. You can specify vertical text.

43 SPICE directive for dc analysis
CMRR SPICE directive for dc analysis

44 The DC operating point selection provides all node voltages and device currents.
When you click OK, the SPICE directive .op is placed on the schematic.

45 A ground is required for simulation.

46 After a DC operating point analysis, moving the cursor over the schematic reveals the various node voltages, currents, and the dissipations in each component. These values are displayed in the lower left portion of the screen. Summing the dissipations in this circuit produces zero. The negative signs at V1 and V2 indicate that they are power sources. -24V 40W Placing the cursor here shows the current and the dissipation in R5, as shown below. 9.6W -12V -88W 1.2W 28.8W 12W -3.6W DC operating point (I(R5) = 200 mA Dissipation = 1.2 W

47 It is also possible to display the dc voltage at one or more nodes on the schematic. Run the simulation and then right-click any empty area on the schematic and select View Place .op Data Label as shown below.

48 Then, move the rectangular cursor to the desired node and click it
Then, move the rectangular cursor to the desired node and click it. The dc voltage at that node will be displayed on the schematic. Repeat the procedure to add nodes.

49 After you have one or more nodes selected, you can change circuit values and re-run the simulation to see the effect on the selected dc node voltages. R2 has been changed from 20 ohms to 10 ohms.

50 The next three slides show the procedure.
Waveforms Waveforms are what one sees on an oscilloscope (graphs of instantaneous voltages versus time). Waveforms can be viewed via the transient analysis option. Click on Simulate, Edit Sim Command, and then select the Transient tab. The next three slides show the procedure.

51 Load the circuit from the file menu.
Then, click run. Reference: Schuler, 7th edition, page 247 … the stiff current source has been replaced with a resistor. Probe both the base and the collector of Q2. Without the stiff current source, the CMRR is notably poorer.

52 A small differential signal plus a large common-mode signal
Move the cursor to the desired node. When the cursor changes to a probe, click the left mouse button to view the waveform.

53 Can you see the 60 Hz common-mode component at the collector of Q2?
Move the cursor to the collector. Left click and now two waveforms are shown.

54 The next slide demonstrates the value of simulation when evaluating circuit performance.
The differential amplifier circuit is much improved with a stiff current source. The common-mode rejection ratio (CMRR) is remarkably better. The common mode signal cannot be seen in the output. Circuit simulators make it easy and fun to investigate issues such as this.

55 The 60 Hz common-mode signal is too small to be seen here.
Stiff current source

56 Remember, waveforms are available via transient analysis.
You must specify the time duration of a transient analysis by specifying a Stop Time. Often, this is all that is required. You can also specify the Time to Start Saving Data. Useful in circuits where the start-up period is not important. You can also specify the Maximum Timestep.

57 Go to Simulate and then click on Edit Simulation Cmd.
CMRR Go to Simulate and then click on Edit Simulation Cmd. The time duration of a transient analysis is like choosing the time base setting on an oscilloscope.

58 For a basic analysis, this is often all that needs to be specified.

59 In this circuit, the common-mode signal is 60 Hz
In this circuit, the common-mode signal is 60 Hz. A 60 Hz signal has a period of roughly 17 milliseconds. Thus, a Stop Time of 20 milliseconds is a reasonable choice.

60 Box Expanded waveform measurements are easy. Hold the left mouse button down and drag a box around the area of interest. Before you release the button, the measurements are available here: dx = 500 us (2 kHz) dy = 4.7 V

61 When you release the mouse button, the area inside the box will be zoomed to fill the waveform display. Restore the original waveform by right-clicking in the waveform area and then selecting Zoom to Fit or simply press Ctrl+E.

62 To obtain an accurate frequency measurement, draw a box around several cycles and then draw a second box to capture one cycle.

63 This box captures one cycle
This box captures one cycle. (The peaks are easier to identify than the zero crossings.) The output frequency of this Wien bridge oscillator is predicted by 1/(2πRC), thus we can expect an output at 1.59 kHz. 1.572 kHz

64 To obtain the voltage difference across two nodes, move the cursor to the first node and left click when it changes to a red voltage probe and then without releasing the mouse button, move to the second node and when the cursor changes to a black voltage probe, release the mouse button.

65 Ctrl+Left Click here To determine the Average and RMS values of a waveform, hold down the Control key and left click the waveform’s label.


Download ppt "INTRODUCTION Spice."

Similar presentations


Ads by Google