Home >Documents >B2 Spice Version 5

B2 Spice Version 5

Date post:07-Oct-2014
Category:
View:1,328 times
Download:15 times
Share this document with a friend
Transcript:

B Spice Version 5USERS MANUAL

2

Manual by Thien Nguyen, Christopher Hsiong and Jon Engelbert

1996 - 2005, Beige Bag Software, Inc. [email protected] www.beigebag.com (734) 332-0487

T A B L E

O F

C O N T E N T S

Introduction ......................................................................................................................................... 1 About B2 Spice v5 ......................................................................................................................... 1 System Requirements ................................................................................................................... 2 Package Contents.......................................................................................................................... 2 Technical Support .......................................................................................................................... 2 Installation ...................................................................................................................................... 2 About the user documentation ...................................................................................................... 2 Legal Notes .................................................................................................................................... 3 Please note:............................................................................................................................... 3 Copyright / Proprietary Protection............................................................................................. 3 License Grant ............................................................................................................................ 3 Limited Warranty ....................................................................................................................... 3 No Liability for Consequential Damages .................................................................................. 3 Overview ............................................................................................................................................. 4 Toolbox........................................................................................................................................... 4 Add Parts ................................................................................................................................... 4 Circuit Parameters..................................................................................................................... 4 Tests and Simulations ............................................................................................................... 4 Animation ................................................................................................................................... 5 Project Management ................................................................................................................. 5 Wizards ...................................................................................................................................... 5 Graph and plot control............................................................................................................... 5 Virtual Instruments ......................................................................................................................... 5 Wiring ............................................................................................................................................. 6 Windows ......................................................................................................................................... 6 Toolbars ......................................................................................................................................... 7 Choosing and Placing parts........................................................................................................... 7 Function ..................................................................................................................................... 8 Manufacturer.............................................................................................................................. 8 Name ......................................................................................................................................... 8 Part Palette................................................................................................................................ 8 Working with other applications..................................................................................................... 8 Modifying the Parts database........................................................................................................ 9 Schematic editing overview ........................................................................................................... 9 How to place parts..................................................................................................................... 9 Set model properties ................................................................................................................. 9 Set device properties................................................................................................................. 9 Change a symbol....................................................................................................................... 9 Wiring......................................................................................................................................... 9 Move, delete, duplicate parts .................................................................................................. 10 Undo/Redo............................................................................................................................... 10 Naming and numbering nodes................................................................................................ 10 Controlling part display............................................................................................................ 10 Combiners, Splitters and Rippers ........................................................................................... 10 Borders .................................................................................................................................... 10 Title Box and print displays ..................................................................................................... 10 Grids ........................................................................................................................................ 11 Autosave.................................................................................................................................. 11 Wizards......................................................................................................................................... 11 Tutorials ............................................................................................................................................ 12 Analog Tutorial #1 ........................................................................................................................ 12 Tutorial #1: Step 1 ................................................................................................................... 12 Tutorial #1: Step 2 ................................................................................................................... 12 Tutorial #1: Step 3 ................................................................................................................... 13 Tutorial #1: Step 4 ................................................................................................................... 14 Tutorial #1: Step 5 ................................................................................................................... 14 Tutorial #1: Step 6 ................................................................................................................... 16 Tutorial #1: Step 7 ................................................................................................................... 17 Tutorial #1: Step 8 ................................................................................................................... 20

T A B L E

O F

C O N T E N T S

Analog Tutorial #2.........................................................................................................................21 Tutorial #2: Step 1....................................................................................................................21 Tutorial #2: Step 2....................................................................................................................21 Tutorial #2: Step 3....................................................................................................................22 Tutorial #2: Step 4....................................................................................................................22 Tutorial #2: Step 5....................................................................................................................24 Tutorial #2: Step 6....................................................................................................................25 Tutorial #2: Step 7....................................................................................................................26 Tutorial #2: Step 8....................................................................................................................27 Tutorial - Creating a Part from a Circuit .......................................................................................28 Step 1 - Setting up the circuit for part creation. ......................................................................28 Step 2 - Creating the part ........................................................................................................29 Step 3 - Modifying the new part...............................................................................................29 Tutorial - Creating a Parameterized Subcircuit Part....................................................................30 Step 1 - Create a Parameterized Subcircuit Model Type. ......................................................30 Step 2 - Make a simulation model using the Parameterized Subcircuit Model you just created......................................................................................................................................32 Step 3 - Create a new Part with the simulation model............................................................33 Digital Tutorial #1..........................................................................................................................34 Insert an input...........................................................................................................................34 Insert two more input ports ......................................................................................................34 Insert a 3-input nand gate, an Inverter, and an output port....................................................35 Draw the wires..........................................................................................................................35 Test the circuit ..........................................................................................................................35 Save the Circuit ........................................................................................................................36 PCB Tutorial..................................................................................................................................36 How to add a new PCB package.............................................................................................36 Eagle to B2 Spice Tutorial............................................................................................................40 Draw the Eagle schematic .......................................................................................................40 Import into B2 Spice.................................................................................................................41 Run a Test................................................................................................................................42 Tests and Simulation.........................................................................................................................44 Simulation .....................................................................................................................................44 Simulations ...............................................................................................................................44 Simulation Stimuli.....................................................................................................................45 Setting up probes for simulations ............................................................................................46 Simulation Options ...................................................................................................................46 Tests..............................................................................................................................................48 Test Stimuli...............................................................................................................................49 Distortion Test ..........................................................................................................................51 AC Sweep Test ........................................................................................................................52 Noise Test ................................................................................................................................52 AC Sensitivity Test...................................................................................................................53 DC Bias Test ............................................................................................................................54 DC Sensitivity Test...................................................................................................................55 DC Sweep Test ........................................................................................................................55 DC Transfer Function (TF) Test ..............................................................................................56 Device Parameters Test ..........................................................................................................57 Model Parameters Test............................................................................................................57 Transient Test ..........................................................................................................................58 Network Analysis......................................................................................................................60 Parameter Sweeping ...............................................................................................................60 Monte Carlo Test......................................................................................................................62 Tips for simulation success ..........................................................................................................65 Operating point success ..........................................................................................................65 Transient Success....................................................................................................................66 Special notes for the Opamp ...................................................................................................66 Toolbox ..............................................................................................................................................67 Add Parts Tab ...............................................................................................................................68

T A B L E

O F

C O N T E N T S

Parts by Function..................................................................................................................... 68 Parts by Manufacturer ............................................................................................................. 68 Parts by Name......................................................................................................................... 69 Parts Palette ............................................................................................................................ 70 Live Circuit Parameters Panel ..................................................................................................... 70 Animation ..................................................................................................................................... 72 Workspace ................................................................................................................................... 74 Project Menu............................................................................................................................ 74 Schematic Menu...................................................................................................................... 74 Graph Menu............................................................................................................................. 75 Wizards......................................................................................................................................... 75 Edit Graph .................................................................................................................................... 76 Edit Graph - Basic ................................................................................................................... 76 Edit Graph - Text ..................................................................................................................... 77 Edit Graph - Axes .................................................................................................................... 79 Edit Graph - 3D........................................................................................................................ 84 Edit Graph - Circle................................................................................................................... 84 Edit Graph - Histogram ........................................................................................................... 85 Legend.......................................................................................................................................... 85 Edit Plots ...................................................................................................................................... 86 Edit Plots - Edit Plot................................................................................................................. 86 Edit Plots - Plot List ................................................................................................................. 87 Adding Custom Plots............................................................................................................... 88 Virtual Instruments............................................................................................................................ 90 Virtual Ammeter ........................................................................................................................... 90 Distortion Meter ............................................................................................................................ 91 Frequency Plotter......................................................................................................................... 92 Function Generator ...................................................................................................................... 93 Gain Meter.................................................................................................................................... 94 Oscilloscope................................................................................................................................. 95 Power Supply ............................................................................................................................... 97 Transient Signal Recorder ........................................................................................................... 98 Voltage Meter (Voltmeter) ......................................................................................................... 100 Wattage Meter (Wattmeter) ....................................................................................................... 101 Toolbars .......................................................................................................................................... 104 Main Toolbar .............................................................................................................................. 104 Schematic Toolbar ..................................................................................................................... 105 Graph Toolbar ............................................................................................................................ 107 Windows.......................................................................................................................................... 109 Schematic Window .................................................................................................................... 109 Graph Window ........................................................................................................................... 109 Table Window ............................................................................................................................ 111 Text Window .............................................................................................................................. 111 Netlist Window ........................................................................................................................... 112 Graphs and Tables ......................................................................................................................... 114 Graphs........................................................................................................................................ 114 Graph Types .......................................................................................................................... 114 Editing the Graph properties ................................................................................................. 115 Editing Existing Plots and Adding New Plots ....................................................................... 115 Graph editing shortcuts ......................................................................................................... 116 Adding plots from other circuits and simulation.................................................................... 116 Moving around the graph ...................................................................................................... 116 Zooming................................................................................................................................. 117 Measurements in the graph .................................................................................................. 117 Text fields in the graph .......................................................................................................... 118 Printing................................................................................................................................... 118 Copying the graph picture..................................................................................................... 119 Digital timing diagrams .......................................................................................................... 119 FFT Fast Fourier Transform............................................................................................... 119

T A B L E

O F

C O N T E N T S

Tables .........................................................................................................................................119 Circuit Probing .................................................................................................................................120 How to place probes ...................................................................................................................120 Probe sub-types: Db, Mag, Ph-deg............................................................................................121 Cross Probing .............................................................................................................................121 Symbol Editor ..................................................................................................................................122 Creating a Mosfet Symbol ..........................................................................................................122 Editing an Existing Symbol.........................................................................................................123 Change a Font ............................................................................................................................124 Variable Edit Field.......................................................................................................................124 Setting Conditional Properties and Digital Operations ..............................................................124 View Pin Names .........................................................................................................................125 Setting Pin Names ......................................................................................................................125 Working with CadSoft Eagle PCB ..................................................................................................127 Introduction to Eagle PCB integration........................................................................................127 How to import an existing Eagle Schematic into B2 Spice .......................................................128 How to build a schematic in Eagle and export it to B2 Spice for simulation.............................130 How to export a circuit back to Eagle Schematics ....................................................................135 How to export a B2 Spice circuit to Eagle PCB.........................................................................138 Packages ....................................................................................................................................142 Working with the Database.............................................................................................................144 What to do before modifying the database................................................................................144 Suggestions for class use ..........................................................................................................144 Suggestions for team projects....................................................................................................144 Creating a Part or Device from "Scratch" ..................................................................................144 How to Add a New Process Model ............................................................................................145 Adding a Manufacturer ...............................................................................................................145 Adding a New Category .............................................................................................................145 Deleting Parts, Models, Symbols, and Process Models ...........................................................145 Editing a Manufacturer ...............................................................................................................145 Setting Part Pins .........................................................................................................................146 Setting Simulation Model Parameters .......................................................................................147 Setting Simulation Model Pins ...................................................................................................147 Creating a New Device when the Simulation Model is already in the database......................148 How to Create a New Symbol from Your Simulation Model .....................................................148 Create a Simulation Model Using "Import Simulation Model" ...................................................149 Creating a New Device From Process Model Text Files ..........................................................150 Creating a Device from a Subcircuit Model Using the New Device from the Text File feature .....................................................................................................................................................150 Creating a New Simulation Model..............................................................................................151 Resolving Spice language incompatibilities...............................................................................152 Polynomial controlled sources ...................................................................................................152 Altering the Database from B2 Spice.........................................................................................152 Scope of Database Changes .....................................................................................................153 Incompatible model types...........................................................................................................153 Altering Devices from the B2 Spice Main Program ...................................................................153 Working with Printed Circuit Board (PCB) information..............................................................153 Creating a new Package........................................................................................................153 Assigning Packages to a Part................................................................................................154 Editing Package information ..................................................................................................155

I N T R O D U C T I O N

IntroductionCongratulations on purchasing the best value in integrated circuit design, simulation, and analysis software. B2 Spice v5 contains a mixed mode simulator based partly on the Berkeley SPICE simulator and partly on the Georgia Tech XSPICE simulator. This means that you are getting industrial strength accuracy. Built upon the proven performance of B2 Spice A/D 2000 and B2 Spice A/D v4, V5's almost complete rewrite now brings you improvements and additions that will greatly expand the programs functionality and usefulness. From new graphing to virtual instruments and scenario editors, V5 is now more powerful and cost effective than ever before. The parts database is made up of parts from Analog Devices, Burr Brown, Comlinear, Motorola, National Semiconductor, Texas Instruments, Apex, Amp, Elantec, Maxim, Linear Technology, Zetex, and many more. V5 also adds new interactive devices, such as switches and fuses that you can control and have change with the changing circuit conditions. After you have completed the installation, we suggest you jump right into the tutorials to get acquainted with B2 Spice v5. The best way to learn a programs capabilities is to get down and dirty with it. We have a few Tutorials and sample circuits to get you started. Load up some sample circuits and choose Run Test Batch from the Simulation menu. Follow along with the tutorials. This will get you oriented. Then dive into the Toolbox and Virtual Instruments. Try the parts selection from the Parts Chooser, setting up tests and virtual instruments. Right click on components in the schematic and double click on them. These will pull up dialogs and menus. For the graph, click and double-click and control-click on plot names in the menu. We have put a lot of work into making the program easy to use and flexible. If theres something you cant figure out how to do, drop us an email and well try to help.

About B2 Spice v5B2 Spice v5 is intended to help you design analog, digital, and mixed mode circuits. Rather than working on your circuit design with physical components, which require expensive test equipment and a lab, B2 Spice v5 allows you to perform realistic simulations on your circuit without clipping wires or splashing solder. With B2 Spice v5, editing and simulating circuits is a quick, easy, even enjoyable process. B2 Spice v5 supports the full Spice 3F5 set of commands, options, and models. This includes simulations such as DC Sweep, AC Sweep, Transient, Sensitivity, Pole-Zero, Fourier, Distortion analysis, and more. Models include no less than six distinct MOSFET models including BSIM3 and BSIM4, models for switches, several transmission line models, and much more. B2 Spice v5 is an application with two separate subprograms: the B2 Spice main program, and the Database Editor. The B2 Spice main program is most frequently used. Youll use it to create and edit your circuits, to set up the simulations, to run the simulations, and to view the results. The Database Editor is used for defining new parts or modifying those already in the parts bin. Each subprogram is covered in its own section. The program features a large database of devices that should be sufficient for most circuits, and can be customized to meet your design needs. Some of these are catalogued in the Technical Reference section, along with the standard parameters and those available for customizing. The Database Editor section will explain how you can add more devices into the database. B2 Spice v5 comes in various versions. Different versions will have features and abilities that others do not need. These differences will be discussed in the user manual.

1

I N T R O D U C T I O N

System Requirements A Pentium II or later processor is required. 256 Mb RAM minimum. Windows 98, ME, 2000, XP or NT4 or later is recommended.

Package ContentsThe B2 Spice v5 package contains: The B2 Spice v5 CD-ROM (unless you downloaded it from our web site.) The Windows CD-ROM contains the set-up programs, and all of the files needed to setup your system for Windows platforms. The CD should also contain any updates to the documentation. This User Manual This manual includes installation instructions, tutorials, reference descriptions for all menus, troubleshooting advice, a comprehensive device library. The Registration Form (unless you ordered from us directly, in which case we automatically register you.)

Technical SupportIf you have access to electronic mail, send comments to [email protected] If you ordered directly from us, then you are automatically registered. Otherwise send a fax to us at (734) 3320392, or call (734) 332-0487. The best way to get technical support is by email. If you are having trouble and it occurs with a particular circuit, please email ([email protected]) the circuit along with your questions or bug reports. Phone support hours vary. Technical support is not available for student customers unless they are reporting a bug. However, if you use our forum on our web site then someone should be able to help you. Also, visit our web site at www.beigebag.com for the latest patches and more.

InstallationIf you are using Windows 98 or NT4.0 or later, B2Spice supports the Windows Autoplay feature. Simply insert the CD-ROM into your drive and the CD should automatically run the install program. Select the directory you wish to install the program into and the installer will install everything that is required to run B2 Spice. If for some reason the autoplay doesn't automatically run the install program, run setup.exe from the top level of the CD-ROM.

About the user documentationThere is more user documentation in the help file than you will find in the manual. In addition, you will find additional material on the CD-ROM such as sample circuits and some explanations of how they work. And you will find even more on our web site, such as a user forum and resources web page. This user manual and help file is set up to make it easy for you to get to what you need. It includes information on every menu item in the program and discussions on how to perform various tasks. 2

I N T R O D U C T I O N

Changes and additions Due to the lead-time involved with printing, there will be differences between the printed manual and the final program. Please check the CD or Program Directory for Errata and changes made after the user manual was printed.

Legal NotesPlease note:Beige Bag stands for Beige Bag Software. Software refers to the computer program contained in the sealed package, as well as all updates. Documentation refers to the user manual and other written materials accompanying the software. Product = Software + Documentation.

Copyright / Proprietary ProtectionThis Product is owned by Beige Bag or its suppliers and is protected by the United States and International copyright laws and international trade provisions. You must treat the Product like any other copyrighted material. This license and your right to use the Product terminate if you violate any part of this agreement. In the event of termination, you must immediately destroy all copies of the Product or return them to Beige Bag. Beige Bag is the sole copyright owner of B2Spice and B2Logic. Beige Bag certifies that it is the sole and exclusive owner of both above mentioned software programs and accompanying user manuals.

License GrantBeige Bag grants you a nonexclusive license to use one copy of the software on one computer for archival purposes, or copy the Software onto the hard disk of your computer and retain the original for archival purposes. You may not: Copy the documentation, modify, translate, or merge the Software with another program, except for your personal use on a single computer; reverse engineer, disassemble, decompile, or make any attempt to discover the source code of this Software; sublicense, rent, or lease any portion of the Product.

Limited WarrantyBeige Bag warrants the disks on which the Software is distributed to be free from defects in materials and workmanship and that the Software will perform substantially in accordance with the Documentation for a period of ninety days from your receipt of the Product. This warranty (with the exception of material defective disks) only applies to those customers within the United States and Canada who purchased the program at the professional price. This warranty gives you specific legal rights. You may have others, which vary from state to state. Defective disks will be replaced to all customers.

No Liability for Consequential DamagesThe Program is provided "as is" without warranty of any kind, either express or implied, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose. The program should not be relied on as the sole basis to solve a problem whose incorrect solution could result in injury to person or property. If the program is employed, it is at the user's own risk and Beige Bag Software explicitly disclaims all liability for such misuse.

3

O V E R V I E W

OverviewB2 Spice v5 allows you to enter a circuit design in the schematic editor, run simulations on the circuit, and view simulation results. B2 Spice v5 has now merged B2 Spice A/D v4s distinct pure digital and mixed mode environments into one seamless simulator. Pure digital circuits can now be simulated interactively without the need to switch modes. Analog circuits now have interactivity also, in the form of the live circuit Parameters panel and interactive analog elements, as well as the Animation feature. Overall, this makes for much improved performance and ease of use.

ToolboxOne of the big additions in B2 Spice version 5 is the new Toolbox. The Toolbox allows you quick access and navigation to all your project properties, parts in the current project, parts in your custom palette, and all the parts in the database. It also contains all the instruments and tests. With it, you can quickly select parts, control simulations and set virtual instruments needed to analyze your circuit.

Add PartsIn B2 Spice v5, the ability to choose parts has been greatly improved. Now in addition to the standard database browser where you can choose your part by name, or filter by category or keyword, you can now also select the exact part that you want by function, manufacturer, or name from a pop up menu. Clicking on the "Add Parts" tab allows you to scroll through parts grouped by function, or by manufacturer or name. But the newest development is a Parts Palette" that allows you to store your most often used part, or parts that exists in your company's inventory for quick and easy access. You can add and remove parts as your requirements change. The first time that you go to select a part, the program will seem to hang, but is in fact pulling data from the parts database. This might take a few seconds and is completely normal. More importantly, this will only happen THE FIRST time you select a part. Once the program fills in the data, subsequent device selections will take an unnoticeable amount of time. The Parts Palette is an area that allows users to populate with their most commonly used parts for quick access. You can add any part from the database and remove them at will. The palette will remain filled even after the program is closed. For further discussion of choosing and placing parts, please see the section on Choosing and Placing parts.

Circuit ParametersThe Parameters tab contains a list of all the parts in your circuit that allow value changes, such as resistors, capacitors, etc... Next to each part is its current value. The purpose of this area is to allow quick value changes to part values as a Simulation is running. For more information, please refer to the section on the Parameter Tab.

Tests and SimulationsIn B2 Spice v5, Tests and Simulations are now two distinct modes. Simulations refer to a constant Time-Domain simulation that starts at 0 seconds and ends only when you pause or reset the simulation. Simulations allow the interactive change of device parameters and the instant monitoring of results in via Animation or Virtual Instruments.

4

O V E R V I E W

Tests are pre-defined analyses that you can run on your circuit to see how it behaves under various domains. DC, Operating Point, AC, Transient are some examples of tests that you can run. Each test can be selected, set up, and run from the pull down menu in the "Tests" tab in the Toolbox. Unlike Simulations, Tests are NOT interactive and results are displayed in a Graph or Table, NOT the Virtual Instruments. For detailed descriptions on each Test, refer to the section on Tests. For a discussion on simulations, see the Simulation section.

AnimationAnimation allows the graphical and text representation of the circuit state on the schematic using wire/part colors as well as symbols and text to represent the voltage, current, and power states of the circuit while a simulation is running. More details about the Animation can be found in the Animation section.

Project ManagementThe Workspace tab allows you total control over the all the files associated with a circuit. The Workspace is set up in a collapsible tree-based structure. Each project can be expanded to show all the files associated with that project, including the circuit itself, the simulations, simulation results, and associated graphs. You can add new files or close existing files in the Workspace by highlighting the project or file and going to the File menu and choosing the appropriate command.

WizardsNew for B2 Spice v5 is the implementation of a new Wizard. The idea behind the wizards is easy circuit creation. Just select the type of circuit that you wish to create, fill in a few choices and the rest of the work is done for you. You can select to place the new circuit directly into your existing circuit or place it in to a new blank circuit to start a design.

Graph and plot controlWhen a graph window is active, the Toolbox will contain 3 additional tools: "Edit Graph", "Legend" and "Edit Plots". All aspects of the graph are controlled from these tool tabs. The Edit Graph tab controls the appearance of the graph itself, including the size, color and text on the graph, as well as the plot colors. The "Legend" tool tab allows you to view the various plots on the graph and information relevant to the plots. The "Edit Plots" tool tab controls the plots in the graph and how they appear. Here you can add and remove plots from the graph, as well as making custom plots from a built in library of functions.

Virtual InstrumentsNew to B2 Spice v5 is the addition of virtual instruments. Now you can select a variety of instruments to display the circuit state as the Tests are run. The Instruments are shown on the right side of the B2 Spice's window. If the instruments are not being shown, click on the "Show Instruments" button at the top of the screen.

5

O V E R V I E W

To add more instruments, click the Add Meter button and select the desired instrument from the drop down box. The Collapse All button minimizes all the displayed instruments to just their title bars. The Expand All button expands all displayed instruments. To set up a particular instrument, click the SETUP button inside the instrument window. Instruments can be added in a variety of ways. The most direct way is to use the Add Meter button to add them to the instrument panel. This method requires that the instrument's nodes and connections be set up. The other method involves selecting the device equivalent of the instrument from the Parts Chooser in the Toolbox, placing it on the schematic and connecting it to the rest of the circuit. This automatically places the related instrument into the instrument panel and the connections are already set up. For instance, if you placed and connected a voltmeter device in the schematic, a pre-configured voltmeter virtual instrument will automatically be placed in the panel. For more detailed information for each instrument refer to the Virtual Instruments section.

WiringThere are several ways to wire up a circuit. The standard method is to select the wire drawing (diagonal line) tool, then use it to lay down the wire one segment at a time. Click with the left mouse button to start a segment and click again with the left mouse button to end a segment. To end the entire wire, either click with the right mouse button or double-click with the left button. See the B2 Spice Toolbars section in the Help File for more information on the wire tool. Another method for drawing wires is to click and hold on a pin with the selection arrow cursor and then drag a wire from it. This would save you from having to switch back and forth between the wire tool and selection tool. If there already is a wire from a pin, you can drag more of the wire from the pin using the same method. You can switch to the selection arrow at any time by holding down the shift and control keys. Wires can be automatically drawn at 90-degree increments. Once this feature is turned on from the Edit->Schematic Options->General menu or the toolbar button, wires will be drawn at the nearest 90 degrees to where the wire was ended. Once wires are drawn, they can be manipulated like any part. Wires can be selected, dragged and deleted. Wire corners can be dragged and repositioned also. Click on a wire section to select it. Shift clicking on wires will select multiple wires. The entire wire can be select at once by double clicking on any part of the wire. Once selected, the wire(s) can be moved like any other part. Pressing the delete button will delete the selection from the circuit.

WindowsB2 Spice v5 has changed the way that windows are arranged and appear. The biggest difference is that now all windows are "tabs" in a larger Project window. Projects contain all the files associated with a particular circuit, including any graphs, netlists, and other related files. All Project files will appear in one window with the different Project files as Tab at the top left of the window. If you load a new circuit, it will automatically open in a new Project Window. More than one Project can be open at once. In the picture below, the main Project window contains the circuit (tut2), a graph (tut2-Transient-0Graph), and the Log Window.

6

O V E R V I E W

To switch between to a different view, just click on the Tab that you wish to view. If you right click on a window tab, you will get the following menu:

From the pop-up menu, you can choose to close the Tab, add a new Tab, or rename the Tab. For more specific information on each type of window, refer to the specific windows section below. Schematic Window Graph Window Table Window Text Window Netlist Window The Project window can be arraigned so that the Tabs are displayed side by side or one atop another. To do so select the layout you wish from the Layout button in the toolbar.

Any layout chosen will arrange the Tab windows as indicated by the icon in the menu only for that project. If there are not enough tabs to split as chosen by the Layout button, the program will leave that pane empty. You can then fill it up with new tabs that you create. You can also drag existing windows to the empty frames. To move windows, drag the window tab to the window that you wish to move the existing window to.

ToolbarsB2 Spice v5 is now mainly controlled by the Toolbox and Toolbars. Toolbars are icons that are shortcut to menu commands, and are located below the menus.

B2 Spice has one main toolbar, common to all modes of operation, to control file and simulation functions. It also has two Window-specific toolbars to control the functions available for that window, depending on which window is currently active. For detailed descriptions on each toolbar and what the buttons do, please refer to the Toolbar section.

Choosing and Placing parts7

O V E R V I E W

B2 Spice v5 builds upon B2 Spice A/D v4's already easy and efficient ways of selecting parts and introduces new tools to make part selection as quick and easy as ever. The newest method for placing parts is the Add Part tab in the Toolbox. In the Add Parts tab, parts can be browsed and selected in 4 ways:

FunctionThis is the default selection method, where parts are grouped by function in pop-up menus. Navigation is as easy as following the functions down to the specific function you want, which will then bring up a Parts Browser window with the desired function pre-filtered.

ManufacturerA list of available manufacturers is available from the top window. Clicking on a Manufacturer name will filter the available parts list to show only the parts from a specific manufacturer. Double-clicking on a desired part will select the part for placing on the schematic.

NameParts can be filtered by the first letter in their names by clicking on the number or letter at the top of the window. Double-clicking on a desired part will select the part for placing on the schematic.

Part PaletteThe parts palette is a customizable list of parts that you can fill up with your preferred parts. Just select the part from the list of database parts and click a button to fill the palette. The palette is persistent so any changes you make will be carried over even after restarting the program. In addition to the Add Parts tab, you can choose from a list of the most commonly used parts directly from the Common Parts menu. This menu is a quick way of selecting a generic or popular example of a type of part. It also contains the basic parts common to most circuits, such as resistors, capacitors, and inductors. In the Common Parts menu is a Choose Part command, which brings up a dialog box that allows you to quickly filter the database using a list of part functions. Typing in a name or part of a name in the filters and clicking the "Apply Filter to Database" button will show a list of parts containing the desired text. Selecting a function from any one of the function boxes will also further filter the parts list. Or you can type in a name in the Device Name field and click on the "Find" button to quickly filter the database for a part exactly matching the name.

Working with other applicationsThere are several ways in which B2 Spice can work with other applications. You can import netlists that were generated by other circuit schematic programs and run simulations on them from the netlist interface. Conversely, you can save circuits as netlists and then open them in other circuit simulation programs. You can import models for spice parts using the database editor. You can make reports by copying text and graphics from schematics and graphs and tables and then paste it into other applications. Also with B2 Spice v5, you can export to a variety of PCB programs. See the PCB section for more information. In addition, we've added support for importing and exporting directly from CadSoft's Eagle PCB. Now with just a few clicks, you can export your design directly to Eagle Schematics or PCB Layout. From there it's just a matter of routing and sending your design off for manufacturing. 8

O V E R V I E W

You can also import Eagle schematics into B2 Spice for simulation and verification before sending it back to Eagle for Layout and routing. Simulation and PCB design have never been so easy. For more information, see the "Working with Eagle PCB" section as well as the tutorial on B2 Spice and Eagle data exchange.

Modifying the Parts databaseUsing the Database Editor application thats part of the B2 Spice v5 system, you can import models and parts into the parts database, modify and add symbols, change categories and manufacturers and more. You can also modify the parts database directly from the B2 Spice by storing changed symbols and models and parts back to the database.

Schematic editing overviewThe schematic editor allows you to enter your circuit design. When building a new circuit, you will add parts into the circuit window by choosing them from menus or the Toolbox and you will draw wires to connect the devices. Also, you will set properties for the devices to customize their behavior.

How to place partsThere is a set of parts in the Common Parts menu. Simply choose a part from the menu. You can also use the Toolbox window on the left. In the Toolbox, you can select parts by choosing them from a variety of filters in the Parts tab, or you can select a part from a customizable Palette that you can fill with your most commonly used parts. After you choose a part it will follow your cursor around the circuit window. To place the part, click the left mouse button.

Set model propertiesDouble click on a part to set its model properties. This also allows you to set the name of the device

Set device propertiesRight click on the part, and then choose Edit Device Properties from the floating menu. This opens a window that allows you to name the part, edit its symbol, and choose a new behavior for the part and more.

Change a symbolYou can move the symbols name and property fields around by simply dragging them. Edit the symbol in more detail by right clicking on the symbol and selecting Edit Symbol. This will bring up the symbol in a separate window for editing. Also, you can choose from a set of pre-defined alternate symbols by right clicking on the symbol and choosing Select alternate symbol. After changing a symbol, you have the option of saving it back to the database so that next time you choose that part, it will have the new symbol.

WiringDrag a wire from a pin of a device and a wire will follow it. Let go and the wire will stay in the circuit. For precise wiring, use the wire drawing tool. Left clicks lay out the wire a segment at a 9

O V E R V I E W

time, and to end the wire, use the right-click or double click. Wires can be drawn with 90-degree angles by choosing checking the Use Perpendicular Wires Only checkbox in the Edit>Schematic Options->General menu. Wires can also be set to snap to the grid by choosing checking that option in the Edit->Schematic Options->General menu. For more detailed information, please see the help file's Technical Reference Section on Wiring.

Move, delete, duplicate partsTo move, delete or duplicate parts, you must first select it with the arrow selection tool by clicking on it. To move the part or parts, simply drag the selected parts to the new position and let go of the mouse button. To copy and paste parts, just use the appropriate Edit menu commands or Ctrl-C to copy and Ctrl-V to paste. To delete a part, press the delete key.

Undo/RedoB2 Spice v5 has unlimited levels of undo and redo. To undo any changes to the schematic, press the CTRL-Z keys simultaneously or use the Edit->Undo menu command. To redo any undone changes, press the CTRL-Y keys or use the Edit->Redo menu command.

Naming and numbering nodesMarkers can be used to name a node or explicitly set a node name. Place the marker and double click on it to access the properties. Type in a name or number for the marker and the wire will take on the markers name or number. Node names and numbers can also be controlled by either right clicking on the wire and selecting rename node/wire, or double clicking on the node name itself when node names are enabled.

Controlling part displayFrom the Edit menu, the Schematic Options command has a variety of options that control how parts are displayed in your circuit. These options, as the name suggests, allow you to show or hide the text that is displayed with the part. You can move part text fields that are external to the part itself, like its name or value field, by dragging it. You can also customize the font that the part text is displayed in. You can rotate parts using control-R combination. Each symbol can be scaled up or down in size by right-clicking on the part and selecting Scale symbol size. With some symbols, you can select a predefined alternate symbol by right-clicking on the part and selecting Select alternate symbol. Or for a complete custom part, choose Edit Symbol after right clicking on a part.

Combiners, Splitters and RippersCombiners and splitters allow you to distribute a multiple bit pin to single bit pins. They come in 2 or 4 pins for both in and out directions. By default, wires are distributed automatically B2 Spice from least to greatest bit. To customize wire distribution, double click on the combiner and splitter to set the wires manually.

BordersYou can turn off the borders by going to the Edit->Schematic Options menu or going to the View menu and unchecking the appropriate item.

Title Box and print displays10

O V E R V I E W

The Title Box is on by default. To hide the titlebox and the print area lines, go to the Edit>Schematic Options menu or going to the View menu and unchecking the appropriate item. You can edit the text in the Title Box by going to the Edit->Title Block Fields. You can also choose how the title block will print out in the same dialog box.

GridsB2 Spice v5 s circuit grid can be turned set to any resolution or turned off entirely. To turn off the grid, uncheck the Show Grid checkbox in the Edit->Schematic Options or View menu. The grid display can also be toggled from the toolbar.

AutosaveYour circuits are now automatically saved at certain intervals. In the event that you are forced to quit before you could save your work, just restart the B2 Spice program and any unsaved circuit will automatically open up as a recovered document. Make sure you resave these circuits using the Save As command before doing any more work. You can turn off autosave or modify the save period by going to the File->Program Options menu.

WizardsNew for B2 Spice v5 is the implementation of a circuit Wizard. The idea behind the wizards is easy circuit creation. Just select the type of circuit that you wish to create, fill in a few choices and the rest of the work is done for you. You can select to place the new circuit directly into your existing circuit or place it in to a new blank circuit to start a design. The Wizard appears on the left side of the program window in the Toolbox. If it is not showing, click on the Wizard tab to activate it.

11

T U T O R I A L S

TutorialsThe following Tutorials are designed to familiarize you with the Operations and Capabilities of B2 Spice v5. Complete circuits are also included in the Circuits folder installed in the main program directory.

Analog Tutorial #1A Simple B2 Spice Circuit During this tutorial, you will build a linear circuit consisting of a voltage source and two resistors. The purpose of this tutorial is to help you become comfortable with B2 Spice v5B2 Spice, which includes the Schematic Editor (to draw the circuit) and the Virtual Instruments. A picture of the finished circuit for this tutorial is shown below.

To complete the tutorial, go through the following steps: Open the B2 Spice Program: Place the Devices Draw the Wires Set the Component properties Set up the Virtual Instruments Test the circuit Simulate the circuit. Save the Circuit

Tutorial #1: Step 1Open the B2 Spice Program After installing B2 Spice v5, go to the Windows START menu and navigate to the B2 Spice v5 menu and run B2 Spice v5. This will bring up a clean circuit window. The cursor will be in the form of the selection arrow. If the cursor is in the form of an hourglass, then the program is busy.

Tutorial #1: Step 2Place the Devices Pull down the Common Parts menu by depressing the mouse button while the arrow cursor is over the menu title, and while keeping the mouse button pressed down, move the cursor down to the entry named Resistor. When you release the mouse button, the ghost image of the resistor will be following the arrow. Click the mouse button where you want to place the resistor. After placing the device, it remains selected. This allows you to duplicate or rotate the device

12

T U T O R I A L S

immediately after placing it. Next, you will make a duplicate of this resistor. To duplicate the resistor, simply hit the space bar (this is a short-cut for the command Repeat Place Device in the Edit menu.) Place this second resistor to the right of the first resistor. Next, choose Ground from the Common Parts menu and place it at the bottom of the circuit. You will then need something to designate a node to be measured. There are several ways of doing this. The first and easiest way of doing so is to choose a Voltmeter (Horizontal) from the Common Parts menu and place it above the rightmost resistor. The voltmeter is not an active part of the circuit. Its only purpose is to probe a voltage signal. You should notice that when you place the voltmeter, a voltmeter Virtual Instrument is also placed in the virtual instrument panel. Equivalent virtual instruments are also placed when you place an ammeter in the circuit. NOTE that a Voltmeter Virtual Instrument can be inserted without having to place a voltmeter device in the schematic. You can then manually set up the voltmeter instrument's node numbers and obtain the same information. The second way of designating a node is by using a Marker device, also found in the Common Parts menu or from the Add Part tab, under Virtual Components. The marker has the advantage of being small and is also used to make virtual connections, designate subcircuit pins, and setting initial voltages and guesses. However, this does not add a Virtual Voltmeter into the instrument panel. For this Tutorial, we will be using the Marker / Voltage Probe. Select it from the Common Parts menu and place it Alternately, you can choose these devices from the Add Parts tab in the Toolbox window on the left of the screen. For instance, to select a resistor from the Parts Chooser Toolbox, click the Passive Components button to show the categories under it. Scroll down to the Resistors sub-menu and expand that to show all the devices, click on it. All the parts available in mixed mode can be found under the Part Chooser window. The Part Chooser window can be sorted by Function (the default sorting), Part Name, or Manufacturer by selecting the respective option at the top of the window.

Tutorial #1: Step 3Draw the Wires First, choose the wire drawing tool menus. from the toolbar at the top of the screen under the

To keep it simple, start by drawing a single segment wire. Click at the rightmost end of the resistor (R). Release the mouse button and move the mouse, and the wire will follow the cursor. Move to the left terminal of the second resistor, and double click there. (Alternatively, you can click once with the left button to complete the segment, and then click once with the right button to release the wire from the cursor.) After you are done with the wire, notice that at the points where the wire intersects the terminal of a device, there is a bold point where a connector is automatically inserted. Now draw a wire composed of multiple segments. Click where you want to start the wire, at the top terminal of ground. Then move left to the location where you want the first segment of the wire to end, and click once there. Continue drawing segments until you reach the ground, and then double click. The second wire should now be complete. If there is still a wire following the cursor around, then click with the right mouse button to get rid of it. Finish drawing the wires necessary to connect up the circuit so that it looks like the following figure.

13

T U T O R I A L S

To clean up the circuit, click on the Selection Arrow cursor in the Toolbar in the upper left corner of the circuit window. With the selection arrow, you can move devices, vertices, and segments. Simply position the selection arrow so that its tip is on top of any device, line segment, or vertex, then depress the mouse button, and drag the item with the mouse button still down. Release the mouse button when the item is where you want it to be. All wires are rubber banded when you move objects around. If you want to delete an object, select it with the selection arrow, then choose Delete from the Edit menu. If you need more help, please consult the section titled Schematic Editing in Detail.

Tutorial #1: Step 4Set the Component Properties Switch back to the Selection Arrow by depressing the current tool. Since the Selection Arrow is the default tool, it will be active when no other tool is active. You can also switch to the Selection Arrow temporarily by depressing the Shift-Ctrl keys. The cursor will remain the Selection Arrow until you release the keys. Using the Selection Arrow, double click on the leftmost resistor. This brings up a dialog box in which you can change the resistance and name of the resistor. Set its resistance to 1000 Ohms (you can type in 1K). A picture of the dialog box is shown below.

Next, you will set the second resistor's value. Right mouse button click on the rightmost resistor, and choose Edit Simulation Model, then set its resistance to 2K. Finally, double click on the Marker and name it N1 if it is not already named so. An important thing to note is that the node that the Marker is attached to will take the name of the Marker, and if more than one Marker is named the same, both will have a "Virtual" connection, meaning that the nodes will behave as if a wire is connecting them.

Tutorial #1: Step 5Set up the Virtual Instruments The first thing to consider is how the circuit will be simulated. There are two instruments that can inject a signal into the circuit - the Power Supply and the Function Generator. In this instance, we will use the Power Supply.

14

T U T O R I A L S

Click on the Add Meter button in the Instruments window and scroll down to the Power Supply and click once to insert it.

The Power Supply should now appear as a new instrument in minimal display. Click the Setup button in the power supply to expand the instrument for setup.

The first thing we need to set up is the node connections for the power supply. The power supply works by injecting its signal into the selected +V Positive node, selected by the drop down box. We want to inject the signal at the unconnected pin of the leftmost resistor. If the node numbers for the circuit are not already turned on, go to the toolbar and click on the Show Node button to display the node numbers on the schematic. We now see that the node number we want is 1. Select that from the drop down box. Then select No Connection (NC) for the negative node. Set the voltage (nominal) to 5V and leave the Type as Regulated. (see the Power Supply documentation for more information on the rest of the properties) Now we need to insert a Voltmeter to measure the output of the circuit. If you have already added a voltmeter to the circuit, then it should also appear in the virtual instruments window. If not, then go ahead and add one using the Add Meter button at the top of the instrument panel. You should see the following window (you might need to expand it by clicking on the down arrow on the right side of the meter's title bar)

15

T U T O R I A L S

The General tab controls the basic parameters of the voltmeter such as the nodes to be measured and the display settings. If the node numbers haven't been assigned automatically (done when you placed a voltmeter in the circuit) then set up the Voltage meter so that it's measuring from the node between the two resistors to Ground. You can leave the Range of the meter, which is the scale that the meter displays, at 100, or you can click on the Auto button to B2 Spice automatically pick a sensible scale. In this case, go ahead and click Auto. The Functionality tab controls the behavior of the voltmeter and how it treats the measurements. In this tab, you should leave the input at DC and the function at Instantaneous. Now run the simulation by clicking on the double green arrows Meter should show a steady 3.33V. in the toolbar. The Voltage

Tutorial #1: Step 6Using the Live Circuit Parameter control panel Now that we have the circuit at a steady state, we can now experiment with the Parameters tab in the Toolbox to see how the voltage at node N1 (the marker) changes in response to changes in other device values. B2 Spice v5 is one of the few programs that allow the interactive real-time changes in device parameters while a simulation is running, allowing you to immediately see the response to those changes. Go to the Toolbox on the left of the program window. Click on the Parameter tab to display the Live Circuit Parameter control panel. The display should look like the following:

16

T U T O R I A L S

The radio buttons at the top of the screen labeled All, Some, and Few control how many of the available parameters to display. The Few button displays only the most basic parameters, such as a device's model and it's main value. The some will list even more parameters and All will list all available parameters. For our purposes, Few is enough. Let us change the resistor R's resistance to see how it affects the voltage at node N1, as measured by the voltmeter in the Instrument panel. With the Simulation running (if it is not, press to restart the Simulation) click on the r.resistance box of the Live Circuit control the Run panel. This should make it active and allow you to change the resistor's value by using either the text box in the top section, or the slider to drag the value up or down. Let's first try changing the value by using the text box. Erase the existing value of 1K and type in 2K. Click on the return arrow next to the box or press the Enter key to accept the change. The voltmeter instrument should now be reading a steady 2.5V. Now change the resistor's value again, this time to 4K. The voltmeter should now be reading 1.67V. Clearly, raising the resistor's value will lower the voltage at node N1. Now use the slider to lower the resistor's value. Click on the slider bar and drag it down (to the left) slowly and watch what happens to the voltmeter reading. As expected, the voltage at node N1 rises. Continue sliding the bar until you hit the leftmost position of the slider. The value for the resistor is now at 400 and the voltmeter reading should be at 4.17V. What if we want to continue lowering the value with the slider? This is where the Recenter button comes in handy. Clicking on it will make the current slider position (and value) the new midpoint of the slider. Go ahead and click on it. The resistor's value should remain at 400 but the slider bar should now be in the middle again. Now you can continue lowering the resistor's value to see what happens. When we lower the resistor value to 40, the voltmeter now reads 4.9V - still rising, but not as quickly! You can continue to experiment with the various parameters in the Live circuit control panel to the effects on the circuit.

Tutorial #1: Step 7Test the Circuit The Simulation that we have used in the previous steps runs over the Time domain and runs continuously until stopped. If more advanced tests over non-transient domains are required, it is time to employ the Tests. There are a few things that should be mentioned again before proceeding. Tests require a source of some kind to stimulate the circuit. Any of the Virtual Instruments can be used for the non AC-based tests such as Transient, DC Sweep, Operating Point, etc... For AC-based Tests, an actual power device must be used in the schematic, set up as an AC source. For this section, we will need to add another device to the circuit - the Voltage Source. From the Common Parts menu, select the Voltage Source and place and rotate it. You can also access the voltage source by using the Add Parts tab and navigating to the Virtual Component->Voltage Sources->Ideal Voltage Source

17

T U T O R I A L S

Connect the source to the rest of the circuit and the circuit now looks like this:

Double click on the voltage source and make sure the Constant radio button is selected. For the value, enter 5 and click Accept New Value. Click OK to accept the changes. If you get a message saying the Device modifications are not allowed while the simulation is running, this means that the simulation in the previous step is either running or has been paused but not reset. To reset the simulation, click on the reset arrow in the simulation control area.

Go back to the circuit and double click on resistor R and change the resistance back to 1K. Go over to the Toolbox and click on the Tests tab to expand it. Locate the DC Bias test and check the first checkbox to enable a Basic DC Bias Test. Then click on the blue arrow next to the checkboxes to go to the Test setup. The box should look like the picture below:

18

T U T O R I A L S

Make sure that the Single Test tab is selected, as we do not want to run a Sweep or Monte Carlo analysis. Now click the Run button from the Test setup window and the voltmeter value should change to 3.333 Volts (or 3333 mV). The Operating Point Text window will appear after the simulation is complete. This shows the operating point results.

In this case, the DC operating point of the circuit is the steady state solution for the circuit. In general, the DC operating point is the solution of the circuit with all capacitors open, inductors shorted, and non-constant sources at their initial values. This is a good start, but how does the voltage across R2 vary with respect to the voltage generated by the voltage source? To answer this question, perform a DC Sweep Test. Activate the circuit window by going to the row of tabs at the top of the workspace and clicking on the circuit's name tab. (It may be called Circuit1, or tut1.ckt).

19

T U T O R I A L S

Click the Tests tab in the Toolbox if it's not already chosen. Check the Basic checkbox in the DC Sweep row in the Test tab and click on the blue arrow to set up the Test. In the setup window, select V1 for the source, dc for the Property box, and set the start, ending, and step values to 0, 10, and .5 respectively. If your voltage source is not named V, then enter the name of your voltage source for the name. Finally, click the the voltmeter's signal. button in the Tests window. The following graph will appear charting

Youll notice that as you move the mouse over the graph, the location of the cursor is listed in the status bar at the bottom of the graph. To read measurements from the graph, we need to use the Legend tab in the toolbox. Click on the Legend tab of the toolbox. A Legend will appear listing all the displayed plots in the graph. Next to each plot in the legend is a text box displaying the Y value of the current mouse position. At the bottom of the Legend is a text box listing the current X value of the mouse location. The graph has its own Toolbar with tools that you can use to further study the graph. Most important of those are the Tracking Crosshairs , which follow the currently selected plot, the

Measurement tool, which measures the points on the graph between two mouse clicks, and the Calipers, which mark locations on the graph. Note that the output voltage is 2/3 of the input voltage for any value of the input voltage. In later tutorials, you will learn more about displaying and customizing simulation results. For now, click on the graph to make it the active window, and select the Edit Graph tab on the toolbox and select the Basic tab. Here, you can change your graph settings such as setting the background color or showing the legend on the graph itself.

Tutorial #1: Step 8Save the Circuit Now choose Save... from the File menu. Since the circuit does not have a name yet, the computer will prompt you to name the circuit. Name it, then you can quit and take a break. To generate a text file including the full circuit specifications in the SPICE programming language, 20

T U T O R I A L S

go to the File menu and select Netlist Operations->Create Netlist as a text form. This is useful if you want to feed the circuit specifications into a different SPICE simulator.

Analog Tutorial #2Time and Frequency Analysis of an RLC Filter In the previous example, we saw how B2 Spice can help in the analysis of simple DC linear circuits. Now, we present a linear, time-varying, RLC circuit shown in the following figure. Using this circuit, you'll learn how to analyze frequency response and transient response.

Follow the steps below to complete this tutorial: Draw the Circuit Specify Component Values Connect Components with Wires Set up the Simulation Specifications Use the Virtual Instruments to measure the circuit Run the Transient Simulation Set up the AC Test Run the AC Test Perform DC Test

Tutorial #2: Step 1Draw the Circuit We assume that you have already tried Tutorial #1 and have the basic circuit editing skills. If you havent, you may want to look over Tutorial #1 now. From the Common Parts menu or the Add Parts tab, choose the components: capacitor, resistor, ground, marker, and inductor. In order to orient a component vertically, press ctrl-R before or after placing it, or if it is already placed, choose Rotate Clockwise from the Edit menu. Place the components on the screen, rotating the capacitor and the resistor. If you make a mistake placing a component, you can delete it by first clicking on it with the selection arrow tool to select it, then pressing the delete.

Tutorial #2: Step 2

21

T U T O R I A L S

Specify Component Values Enter the device parameters as illustrated in the table below. To set the device parameters for a device, double click on it with the selection arrow, then type in the values. Notice that the resistances of R4, the inductance of L2, the capacitance of C3, and the parameters specifying the voltage pulse waveform have all changed. INDUCTOR NAME Inductance Initial Current CAPACITOR NAME Capacitance Initial Voltage RESISTOR NAME Resistance MARKER NAME MARKER NAME L3 1U 0 C3 1N 0 R4 50 N1 N2

1n represents 1 nano-unit. It can also be entered as 1E-9, or 1NF. 1U is 1 micro-unit, which can also be entered as 1E-6. B2 Spice is case insensitive, so you could enter 1 micro-unit as 1e-6, or 1E-6. Actually, all lower case letters will be converted to upper case. Also, the type of the unit is ignored, so 1NF is equivalent to 1ns, which is equivalent to 1n. 1 n, however, will be interpreted as 1, since spaces are illegal in values.

Tutorial #2: Step 3Connect Components with Wires Use the wire drawing tool to draw the wires connecting the components. If you make a mistake, and you wish to delete a line, then you must first select it, then press the delete key. To select a small line, click on one of its endpoints with the selection arrow tool, and then click on the other endpoint while depressing the shift key. The circuit is hooked up and ready for analysis. For the first part of the tutorial, the marker will not figure into the simulation as we will be running a Simulation and using Virtual Instruments to measure the circuit response. For the second part of the tutorial, when we will be running Tests, the markers specify which signals will initially be graphed, although the set of plots in the graph can be changed at any time after the Test.

Tutorial #2: Step 4Set up and run the Simulation. Recall that a Simulation is a continuous Time domain simulation and runs until stopped or reset. Since simulations do not produce a graph, we will need to use Virtual Instruments in order to stimulate and measure the circuit. The first Virtual Instrument we need to employ is some sort of source to power the circuit. For this Simulation, we will be using a Function Generator. From the Add Meter drop-down box in the Instrument Panel, select a Function Generator Instrument. The Function Generator will be injected at node N1. If you're not sure what the node names are, turn on the Node Name display using the Node Name toggle toolbar button. Set the negative node of the Function Generator to ground, or 0. Change the waveform to Pulse, and leave the voltage at 1, the Frequency at 1KHz, and the DC Offset at 0. The Function Generator should now look like the picture below:

22

T U T O R I A L S

Now add an Oscilloscope to the Instrument Panel. Under the Traces tab, click the Input Trace 1 button to set up the first signal to measure on the oscilloscope. Set the input node to N1 and the ref node to 0. This will measure the voltage at node N1, which is where we are also injecting the source signal. Click on Input Trace 2 to set up the second signal. Set that input node to N2 and the ref to 0 and check the "Show" checkbox to display the signal. B2 Spice will try to automatically set the X and Y-axis ranges to fit the signal into the graph window so you can leave all the other settings in the other tabs as they are. The Oscilloscope setup should now look like this:

Now in the main toolbar, click the double green arrow to start the simulation. However, nothing displays in the scope. There might be flashes of a signal, but no solid signals. When this happens, it's likely that B2 Spice is having trouble automatically setting one or both of the axes settings. Let's look at the axes settings to see what's happening. Switch on the Vertical tab. The Vertical V/Div is automatically set at 1. We know that the reading at node n1 should be the signal injected by the Function Generator. Since the Function Generator's signal is set to 1V, the 1V/div for the Vertical V/div should at least display that signal. Switch to the Timebase tab. The Timebase s/div setting is where the X-axis range is set. It should be set to "Auto" by default, but if you look, the setting is continuously being changed, probably due to the fact that one or both of the signals is throwing off the period calculations made by B2 Spice. In these cases, we will need to manually set a Timebase setting. To override this, click on the "manual" button. Let's set the signal to at least show the injected 1KHz signal. The period for our 1KHz pulse is 1ms. Since our graph has 10 divisions, the setting for time/div is 1ms/10 = .1ms, or 100us. So enter 100u into the Timebase box and either press the Enter key or click on the enter arrow to accept the change. Otherwise, the data may show 100u but B2 Spice will still be using the old value. Now we should see a single pulse in the scope's graph.

23

T U T O R I A L S

Tutorial #2: Step 5If you closely study the signal in the scope, you'll notice that while the input signal injected by the Function Generator is a clean pulse, the output at node N2 is not. We need to be able to study just that region to see what is happening. One way of doing so is to export the scope screen to a graph by going to the scope's Export tab and clicking the Copy to Graph button, which will copy the contents of the scope to a new graph. Using the graphing tools, you can pan and zoom in on portions of the graph but you will see that the resolution isn't detailed enough to see what's happening. And if you try to decrease the step size for the simulation then the simulation will proceed too slowly. A good way around this is to use the Transient Signal Recorder to record just the first few nanoseconds of the pulse and output and study what is happening. Go back to the instrument panel and insert a Transient Signal Recorder from the Add Meter drop-down box. Set up the Recorder so that Trace 1 measures node N1,0 and Trace 2 measures node N2,0. Make sure that the "Show Trace 2" checkbox is checked for Trace 2. The Storage tab and the I-View tab allow specification of the Data Capture/Storage Intervals and the Interactive Viewing Intervals respectively. It's important to make a distinction between the two settings. The Data Capture Interval is what is being recorded and stored in memory. The Interactive Viewing Interval is how much of that memory is being shown on the display. Since we want to examine the short time after the pulse rises or falls, set the Data Capture Interval to "All" and the Interactive Viewing Interval to "Fixed". This will make the start and duration boxes active. Set the start to 0 and the duration to 2u. This will tell the Recorder to store all data generated by the simulation but only display the first 2us of data on the graph.

Now reset the Simulation if it's not already reset and set the step size to a finer 50ns. Then press the start button to run the Simulation. You should now see the following signal in the Recorder window:

24

T U T O R I A L S

From this we can see that the signal at node N2 overshoots its steady state value, and then oscillates and settles back down to the steady state value.

Tutorial #2: Step 6Set Up the AC Sweep Test The AC Sweep Test generates the frequency response of the circuit. Recall that for Tests, Virtual Instruments cannot be used so the Function Generator used in the previous Simulation will not work for this Test. We will need to add a Voltage Source to power the circuit. The voltage source will act as a sinusoidal signal (regardless of whether it is a pulse, sinusoid, exponential, single-frequency, piece-wise linear, or constant), and the frequency of that signal will be stepped through a range of frequencies while the response of the circuit is recorded at each step. From the Add Parts tab, select the Ideal Voltage Source from the Virtual Components>Voltage Sources menu. Place it and then rotate it by pressing Ctrl-R once. Connect it so that the circuit looks like the picture below:

Double click on the Voltage Source and set the following properties:

Click on OK to accept the changes to the Voltage Source. In the Tests tab of the Toolbox, select the AC Sweep Basic test. Expand the to the test setup page and enter 1MHz and 100MHz for the start and stop frequencies, Decade for Step Interval, and 5 for

Popular Tags:

Click here to load reader

Reader Image
Embed Size (px)
Recommended