SWCAD

July 7, 2018 | Author: MrToxic01 | Category: Spice, Amplitude, Series And Parallel Circuits, Transistor, Direct Current
Share Embed Donate


Short Description

Download SWCAD...

Description

Electronics Principles & Applications Seventh Edition Charles A. A. Schuler

spice/SwitcherCad erCad III I II LTspice/Switch (revised 1/30/2008)

©2008 The McGraw-Hill Companies, Inc. All rights reserved.

LTspice/SwitcherCad

III

 A free freewar ware e SPICE SPICE III circui circuitt simulat simulator or writte written n by Mike Mike Engelhardt at Linear Technologies http://www.linear.com/  ± SPICE SPICE I and SPICE SPICE II were were written using using the FORTRAN FORTRAN programming language. SPICE III was was written written using the C programming language (U.C. Berkeley, 1985). http://bwrc.eecs.berkeley.edu/Classes/IcBook/SPICE/)) http://bwrc.eecs.berkeley.edu/Classes/IcBook/SPICE/  LTspic LTspice e was was writ written ten to suppo support rt circui circuitt design designers ers who evaluate or use Linear Technology products.  ± It includes includes an extensiv extensive e library library of Linear Linear Technology Technology devices.  It has schematic capture and is much easier to use than traditional text-based SPICE.  ± Traditional Traditional SPICE SPICE requires requires a text file called called a netlist  that describes the circuit to be simulated. ± With schematic capture, capture, the user can enter ente r a circuit using schematic symbols and wires via a graphical user  interface.

LTspice/SwitcherCad

III

 Is powerf powerful ul and and fast, fast, but is not not as as intui intuitiv tive e for  for  beginners as simulators such as Multisim  ± Requires Requires more more knowledg knowledge e about SPICE directives directives and terminology  ± Has a limited (mostly (mostly proprietar proprietary) y) device device library library  ± LTspice LTspice has only basic basic behavioral behavioral gates gates for digital circuits. It is expandable, but this requires knowledge about SPICE and device behavior.

 Is worth orth lea learni rning abou aboutt  ± Since it is free, fast, and powerful, powerful, itit is one of of the most widely used circuit simulators at this time.  ± Many professionals professionals consider consider it to to be superior superior to to some commercial simulators.

LTspice/SwitcherCad

III is a free download dow nload and can be found on the Linear Technology website: http://www.linear.com/designtools/software/switchercad.jsp

It¶s easy easy to ³draw´ ³dr aw´ a circuit.

Get

started by clicking File and then New Schematic, Schematic, or hold down the Control key and a nd then press the ³N´ key (Ctrl+N).

Drawing

a circuit «

is easier if the grid grid is active. Click on View and then Show Grid rid.. Or, you can type Ctrl+G.

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 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 lef t mouse button again. To cancel or quit a component type, click 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.

After a component has been selected, it can be rotated After by holding down the Control key and then pressing the R key key.. Here, D1 was placed first (by left-clicking l eft-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.

Rotated components

Mirrored components

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

The menu command ToolsControl PanelDrafting OptionsHot Keys allows you to define your own keyboard shortcuts.

 Additional components are available by clicking on the gate symbol or  or by by pressing the F2 key. key. Suppose Suppo se you need a voltage source. Choose ³voltage ³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. voltage . To specify specif y a sinusoidal voltage source, select Advanced select Advanced after right clicking.

or 

Specifying a SINE ac voltage source

Amplitude Amp litude and a nd Frequency (V1, as shown here, is a 44-V dc source.)

Use the pencil tool to connect connect the components. Left click a terminal (blue box) and then move the mouse m ouse to the connecting terminal and left click again. The crosshairs crosshairs below are positioned to connect R4 to R5.

The

blue boxes disappear after they are connected.

Unconnected nodes can cause Netlist errors.

Place Diode Place Inductor 

Tool

Bar  Summary

Place Capacitor  Place Resistor 

Place Circuit Element

Label Node Place Ground Draw

Wire

Simulate Zoom In

Move Drag

Pan Find

Zoom Out  Auto Scale Delete

Undo Redo Rotate Mirror 

Copy Paste

Place Comment Place SPICE

Directive

Place a resistor  and right click it to enter its values.

 You

Or, Or, click c lick Select Resistor  to view a Standard list.

must specify component values.

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

Models are required.  Missing issing models models will will gen gener erat ate e erro error  r  messages.  ± The next next slide slide shows shows an exam example. ple.  ± LTspice LTspice does does not have have a model for for the 1N4001 diode.

 Ther There e are are seve severa rall way ways s to add add mode models. ls.

You can expand the component data base (add models).  For example example,, suppo suppose se that that you want want to simulat simulate e a circ circuit uit using a BFR540 transistor and that you have the SPICE model saved in text format via Windows Notepad (go (go to Start, Programs, Accessories to launch this basic text editor ).  ± Load Load the the SPIC SPICE E model model into into Windows Notepad and then Copy it to the clipboard using Control+A followed by Control+C. ± Use Windows Notepad with File Type set to All to All Files to open open the the file file C:\Program Files\LTC\SWCADIII\lib\cmp\standard.bjt, scroll to the end of that file, and then paste the model from f rom the clipboard (Control+V) and then Save the file.  ± The next next time time that that you you run LTspice, LTspice, the the BFR540 BFR540 will be avail available able as a choice when selecting an NPN BJT transistor as shown on the next slide.

CMRR

Here it is!

 A SPICE model for the BFR540 .MODEL + + + + + + + + + + + + + + +

BFR540 NPN IS = 1.04516E-015 BF = 1.84359E+002 NF = 9.81774E-001 VAF = 4.16981E+001 IKF = 1.00000E+001 ISE = 2.32436E-013 NE = 2.02825E+000 BR = 4.39917E+001 NR = 9.92532E-001 VAR = 2.09773E+0 2.097 73E+000 00 IKR = 1.66296E-001 ISC = 1.29849E-016 NC = 1.06486E+000 RB = 5.00000E+000 IRB = 1.00000E-006

+ + + + + + + + + + + + + + + .ENDS

RBM = 5.00000E+000 RE = 3.53552E-001 RC = 1.34000E+000 EG = 1.11000E+000 1.11000E+000 XTI = 3.00000E+000 CJE = 1.97895E-012 VJE = 6.00000E-001 MJE = 3.32695E-001 TF = 7.45719E-012 XTF = 1.14072E+001 VTF = 3.15854E+000 ITF = 1.56917E-001 CJC = 7.93745E-013 VJC = 1.85522E-001 MJC = 8.41656E-002

 Also, a SPICE model can be added directly to the schematic.

 Adding a model to a schematic  Copy Copy the the mod model el to the the cli clipb pboa oard rd..  ± Left click and and hold hold and drag drag over over the model and and then then capture capture it with Contr ol+C  ol+C . e.g. .MODEL 1N4001 D IS=29.5E-9 RS=73.5E3 N=1.96 CJO=34.6P VJ=0.627 +M=0.461 BV=60 IBV=10U

 Click on .op on the toolbar   Past Paste e the the mod model el into into the the win windo dow w.  ± Contr ol+V  ol+V . Click OK.

  Plac Place e the the model model on on your your schem schemati atic c wit with h a left cli click ck..  This method method is often often preferr preferred ed when when shar sharing ing circui circuits ts with with others.  ± The nece necessa ssary ry mode modell or mode models ls are i mbedded in the circuit  file. file.

Where does one obtain obtain SPICE models?  Search Search the Intern Internet et « many many are are avail availabl able e as free downloads or can be copied to the clipboard and then pasted into Windows Notepad (or onto your schematic via .op on the toolbar). Some links are provided at the end of this presentation.  Sear Search ch devi device ce manuf manufact actur urer ers¶ s¶ web websi site tes. s.  Modif odify y an exis existi ting ng mode model. l.  Create your ow own.  ± Softw Softwar are e is avail availabl able. e. http://www.intusoft.com/spicemod.htm

 Or, Or, you can can use use a subc subcir ircu cuit it..

Subcircuits (.SBCKT)  Are Are oft often en used used whe when n repe repeti titi tion on occu occurs rs..  ± Better than cluttering cluttering the schematic schematic with redundant redundant information

 Also Also can be used used to repl replac ace e a comp complilica cate ted d device such as an OP-AMP, a DIAC or a TRIAC.  The next next slide slide shows shows a commo common n dimmer dimmer circui circuitt where the DIAC and TRIAC functions are defined by subcircuits.  ± LTspice LTspice has has pre-defined pre-defined schematic schematic symbols symbols for  DIACS and TRIACS, but no corresponding models.

More about models and subcircuits Models given as .MODEL statements are for intrinsic SPICE devices such as diodes and an d transistors. The .MODEL statement gives the parameters for the specific component. The general behavior of the device is already known by SPICE « only the parameters need to be given to finish fin ish specifying the component's componen t's electrical characteristics. On the other hand, models given by .SUBCKT statements define the modeled component by a collection of intrinsic SPICE devices. For example, the SPICE model of an opamp would be given as a subcircuit. In the previous slide, the SPICE models of a DIAC and a TRIAC were specified as subcircuits.

LTspice is useful for analyzing circuits designed by others.  It is somet sometime imes s only only neces necessar sary y to use use it it to review and experiment with circuit files that have already been created.  ± Many can be found in the the LTspice LTspice subdirectories.  ± Some example examples s are available available for download download.. This is an outstanding example: http://cmosedu.com/cmos1/book.htm

How to run an existing circuit file  From the File menu, select Open Open.. Make sure the file type is set to Schematics Schematics..  Some Some good good ex exampl amples es are are avai availa labl ble e in C:\ProgramFiles\LTC\SwCADIII\examples\Educational (created on your hard drive when you install LTspice).  Some Some appr approp opri riat ate e exam exampl ples es for for the the McGraw-Hill basic skills series are available on the website: http://highered.mcgrawhill.com/sites/0073106941/student_view0/lt_spice_instru ctions_and_support_files.html (You probably have these files if you obtained this presentation presentat ion from the McGrawHill site.)  The next next slide slide shows shows a circui circuitt from Schuler Schuler¶s ¶s book. book. To view the dc voltages and currents, a dc analysis is selected by first clicking on Simulate Simulate,, then Edit Simulation Cmd. Cmd.  ± The SPIC SPICE E direc directi tive ve is .op .op..

CMRR

SPICE directive for dc analysis

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.

A ground is required for simulation.

 After a DC operating point analysis, ana lysis, moving the cursor over the schematic reveals the various node voltages, 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

9.6W

-12V

-88W

1.2W

28.8W 12W

DC

Placing the cursor here shows the current and the dissipation in R5, as shown below. -3.6W

operating point (I(R5) = 200 mA Dissipation = 1.2 W

Waveforms  Wavef Wavefor orms ms are are wha whatt one one see sees s on on an an oscilloscope (graphs of instantaneous voltages versus time).  Wave Wavefo form rms s can can be be view viewed ed via via the the transie transient nt analys analysis is option. option. Click Click on Simulate,, Edit Sim Command, Simulate Command, and then select the Transient tab.  The The next next thre three e slide slides s show show the the proce procedu dure re..

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. W ithout the stiff  current source, the CMRR is notably poorer.

Load the circuit from the file menu.

Then, click run.

 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.

Can you see the 60 Hz common-mode com mon-mode component at the collector of Q2?

Move the cursor to the collector. collector. Left click and now two two waveforms are shown.

The next slide demonstrates the value of simulation when evaluating circuit performance.  The The diff differ eren enti tial al ampli amplifi fier er cir circui cuitt is much much improved with a stiff current source.  The The common common-m -mode ode rejec rejectio tion n ratio ratio (CM (CMRR RR)) is remarkably better.  ± The common common mode mode signal signal cannot be seen in in the output.

 Circui Circuitt simul simulat ator ors s make make it easy easy and and fun fun to to investigate issues such as this.

The 60 Hz common-mode signal is too small to be seen here.

Stiff current source

Remember, waveforms waveforms are are available via transient analysis.  You must specify the time duration of a transient analysis by specifying a Stop Time. Time.  ± Often, Often, this is is all that that is requ require ired. d.

 You can can als also o spe speci cify fy the the Time to Start Saving Data.  ± Useful in circuits circuits where where the start-up start-up period period is not important.

 You can can als also o spe speci cify fy the the Maximum Timestep. Timestep.

CMRR

Go

to Simulate and then click on Edit Simulation Cmd. Cmd.

The time duration of a transient analysis is like choosing the time base setting on an oscilloscope.

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

In this circuit, 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.

Box

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

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

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

This box captures one cycle. (The peaks are easier to identify than the zero crossings.)

1.572 kHz

The output frequency of this Wien W ien bridge oscillator is predicted by 1/(2RC), thus we can expect an output at 1.59 kHz.

To obtain the voltage difference across two nodes, move m ove the cursor to the first f irst ithout  node and left click when it changes to a red voltage probe and then w ith ng  the mouse butt on, on, move to the second node and when the cursor  rel easi  easi ng  changes to a black voltage probe, release the mouse button.

Ctrl+Left Click here

To determine dete rmine the t he Average Average and RMS values of a waveform, hold down the Control key and left click the waveform¶s label.

The Fourier transform  Conve Converts rts from from the the time time doma domain in to the the freque frequency ncy domain (the signal spectrum)  ± Schu Schule ler, r, 7 th edition, page 500  The FFT FFT (fast (fast Fourie Fourierr trans transfor form) m) is avail availabl able e in LTspice.  ± After a waveform waveform is plotted, plotted, right click click in the waveform window and select FFT FFT.. Choose the node of interest and then click OK OK.. Left click the node label in the FFT window and then use the keyboard arrow keys to make accurate measurements of frequency and amplitude for the various spectral components. Left click and hold to draw a box around a part of the graph to expand it.

FFT (frequency domain) display

Time

domain display

Expanded FFT display Note: you can increase the simulation time for  better frequency resolution. Resolution = 1/Time

Simulation time = 0.001 seconds Resolution = 1 kHz

Simulation time = 0.01 seconds Resolution = 100 Hz

In addition to increasing the simulation simula tion time, you can turn off data compression for f or better resolution resolut ion (Tools (Tools  Control Panel  Compression). The next next slide shows a significant improvement in dynamic range with data compression turned off.

Default

data compression

No data compression

FFT with no data compression (approaching a 120 dB range)

FFT with default data compression (90 dB range)

The option plotwinsize determines the number of data points to compress com press in one window. Set plotwinsize to zero to disable compression. Data compression will always be turned off, regardless of the control panel settings (an advantage when sharing circuits with others).

Individual waveforms waveforms can be placed onto different plot panes.  Right Right click click in the the wave wavefo form rm pan pane e and and then then select Add select Add Plot Pane. Pane.  The The nex nextt slide slide shows shows the the usef usefuln ulnes ess s of  of  this feature.  ± With all five five waveform waveforms s on one plot pane, the the display is confusing.  ± Separate Separate plot plot panes panes make it it easy to see the divide-by-two divide-by-two action of each flip-flop.

Input (TRIG)

Threshold

waveform

Output

There are three important waveforms here.

555 one-shot

Three plot panes add clarity.

 A dc offset is also available.  The nex next sl slide ide sho shows a D/A converter.  The input input wav wavefo eforms rms were were separ separate ated d by by righ righttclicking on the node name, e.g. V(b1), as shown s hown below, and adding a dc offset of +2 volts.  It also also show shows s how how color colors s can can be be chosen chosen by usin using g ToolsColorPreferencesSelected ItemWaveformBackgroundGridAxis

V(b1)+2

dc offset

+6 dc offset +4 dc offset +2 dc offset 0 dc offset

Separate plot plane

Current waveforms  Moving oving the the cur curso sorr to the the insid inside e are area a of a component, after a transient analysis has been run, displays the current waveform in that component.  When When the the cur cursor sor morph morphs s to to a cur curre rent nt probe:  ± left click click to see see the current current wavef waveform. orm.

 This This is is illus illustr trat ated ed in the the next next slide slide..

The current probe, like the voltage probe, shows time variations after  a transient analysis. analysis. Here, the current in R1 averages 2 mA (which was measured earlier in a dc analysis) and the current fluctuations in R1 are easy to see.

Current waveforms can be obtained after a transient analysis by moving the cursor to the inside of a device. When the cursor changes to a current probe, left click the mouse to obtain the current waveform. waveform. To display the current in a wire, Alt-left click the wire. Current probe icon

The current in Q1 is constant.

The constant current source is doing its job!

e.g., Alt+click Alt+click here. h ere. To display a power p ower waveform (instantaneous (instantane ous power), hold down the Alt key and left lef t click on the component com ponent of interest (after the cursor has changed to a thermometer).

Ctrl+left-click

To determine the average power  dissipation, Control+left-click on the label.

 AC Analysis  Provi Provides des the freque frequency ncy respon response se of a circu circuit it  ± Both the amplitude amplitude and the phase angle are are graphed graphed as a function of frequency (Bode plot).



Go

to Simulate Simulate,, Edit Simulation CMD, and then click on the AC the AC Analysis tab.  ± You You mus mustt ente enterr the the Number of points per sweep per sweep interval, the Start Frequency and a Stop Frequency. Frequency.  ± You can can also choose various various sweep sweep intervals intervals.. 

Octave ctave,, Decade ecade,,

or Linear 

 Amplitude  AC Analysis Analysis provides the frequency frequ ency response of a circuit. One of the signal sources must be designated as the input by specifying an AC Amplitude for Small signal AC analysis. Run the simulation and then probe the output for the Bode plot.

Phase

Output Input

Spice directive

Ctrl+left-click the label to measure bandwidth.

Here, the only change is the transistors. transistors. This illustrates the need for proper SPICE models when investigating issues such as bandwidth. The BFR540 is a high-frequency transistor. transistor.

2N3904

BFR540

The .measure directive  Is use useful ful to to find find instan instantan taneou eous s val values ues and and valu values es over  over  intervals Keyword

Operation

performed over interval

 AV  AVG

Compute the average value of

MAX

Find the maximum value of

MIN

Find the minimum value of

PP

Find the peak-to-peak value of

RMS INTEG

Compute the ro root me mean sq square value of of View->View Run->View->View SPICE Error Log will show the instantaneous value at 1 ms.

vi: v(exponential_a)=0.632013 at 0.001

Here, bandwidth is measured. (8.5 Hz to 2.8 MHz)

Configuring LTspice  Ther There e are are many many user user opti option ons. s.  ± SPICE SPICE options options (e.g (e.g.. integratio integration n method) method)  ±

Drafting

 ±

Data

options including font properties

saving defaults

 ± Comp Compre ress ssio ion n  Hint: turn compressi compression on off for the the least least distortion distortion for for analog analog circuit simulations.

 ± Most options are availa available ble via the control control panel.

 The next next two two slides slides illustr illustrate ate some config configura uratio tion n choices.

Tools

p

Control Panel

p

Operation

LTspice generates genera tes several kinds of files. To save disk d isk space sp ace and avoid clutter clut ter,, these files can be deleted automatically.

Tools

p

Color Preferences

LTspice allows color  choices for waveform plots and the background on which they are plotted. Also, the axes and grid colors are selectable

Support for LTspice  The The nex nextt slide slide shows shows an exa exampl mple e of of the the built-in help system.  The The help help file file is is a downlo download adab able le and and printable document: http://ltspice.linear.com/software/scad3.pdf   Ther There e are are nume numero rous us other other reso resour urce ces. s. Check the Links slide at the end of this presentation.

Press F1 for the Help System. You can download the User¶s Manual from: http://ltspice.linear. com/software/scad 3.pdf 

The help files explain many things: for example, how to model transformers.

Some ³gotchas´ and hints  ³M´ ³M´ and ³m´ are interpr interpreted eted the same by SPICE. SPICE. Thus, Thus, a resistor value of 10M is the same as 10m (ten milliohms milliohm s or 10-3). 

± Use 10ME G (or 10E6) to specify ten megohms. Do not enter ³1F´ or ³1f´ as the capacitance

for a onefarad capacitor (enter ³1´). ³F ³F´ and ³f  ³f ´ designate the prefix femto (10-15).  SPICE SPICE will will not allow allow volta voltage ge sour sources ces in para parallel llel,, even even when of the same value.  ± Add Add ser serie ies s resi resist stan ance ces. s.

 SPICE SPICE will will not allow allow curr current ent sources sources in seri series, es, even even when of the same value.  ± Add Add para parall llel el resis resista tance nces. s.

Prefixes are case i nsensitive: T = t, G = g, and so on         

T = terra = 1012 G = giga = 10 9 MEG = meg = 106 K = kilo = 103 M = milli = 10-3 U = micro = 10-6 N = nano = 10-9 P = pico = 10-12 F = femto = 10-15

LTspice leading characters           

A special functions device B arbitrary behavioral source C capacitor  D diode E voltage dependent voltage source F current dependent current source G voltage dependent current source H current dependent voltage source I independent current source J JFET transistor  K mutual inductance

              

L inductor  M MOSFET transistor  O lossy transmission line Q bipolar transistor  R resistor  S voltage controlled switch T lossless transmission line U uniform RC-line V independent voltage source W current controlled switch X subcircuit invocation Z MESFET transistor  * comment + continuation of prior line . simulation directive

spice/SwitcherCad witcherCad LTspice/S

III final

notes  Like Like many many mode modern rn softw softwar are e too tools ls  ± it is relativ relatively ely easy to begin begin using but but one must spend spend some time to discover and then master the most powerful features.

 As free freewa ware re goe goes, s, itit is outst outstan andi ding ng!!  ± It is relat relativ ively ely bugbug-free free..  ± It is compa compact ct and very very fast. fast.  ± It is regular regularly ly updated. updated.

 A tip for stud tudents:  ± Knowing Knowing how to use use a professiona professionall level circui circuitt simulator looks great on your resume!

Links http://www.intusoft.com/models.htm#freemodels http://www.penzar.com/links.htm http://ee.cleversoul.com/simulation.html http://www.cadence.com/orcad/index.html http://cmosedu.com/videos/videos.htm http://cmosedu.com/cmos1/book.htm http://www.anasoft.co.uk/Spice3F5Manual.html http://www.onsemi.com/site/support/models http://www.coilcraft.com/modelsswcad.cfm http://tech.groups.yahoo.com/group/LTspice/ http://ltspice.linear.com/software/scad3.pdf 

I would like to acknowledge  Helmu Helmutt Senne Sennewa wald ld for for making making many many helpful suggestions that have significantly improved this presentation.

View more...

Comments

Copyright ©2017 KUPDF Inc.
SUPPORT KUPDF