Simulation Tutorial Instructions
Simulation Tutorial Instructions
Page 1 of 22
This tutorial starts by creating a simulation-ready schematic on which we will run our circuit simulation analyses. We will create a new project file first and then add a new blank schematic sheet.
To start the tutorial, create a new PCB project: 1. Select File New Project PCB Project from the menus, or click on Blank Project (PCB) in the New section of the Files panel. If this panel is not displayed, click on the Files tab at the bottom of the workspace panels. Alternatively, you could select Printed Circuit Board Design in the Pick a Task section of the Altium Designer Home Page (View Home) and then click on New Blank PCB Project. 2. The Projects panel displays. The new project file, PCB Project1.PrjPCB, is listed here with no documents added. 3. Rename the new project file (with a .PrjPCB extension) by selecting File Save Project As. Navigate to a location where you would like to store the project on your hard disk, type the name Filter.PrjPCB in the File Name field and click on Save. Next, we will create a schematic to add to the empty project file. This schematic will be for a Filter circuit. If you do not have the time to draw the schematic from scratch, open a similar project Filter.PrjPCB found in the Examples\Circuit Simulation\Filter folder of your Altium Designer installation.
http://wiki.altium.com/pages/viewpage.action?pageId=3080273
7/8/2011
Defining & running Circuit Simulation analyses - English documentation - The Altium W... Page 2 of 22
http://wiki.altium.com/pages/viewpage.action?pageId=3080273
7/8/2011
Defining & running Circuit Simulation analyses - English documentation - The Altium W... Page 3 of 22
4. We want to search for all references to LF411, so in the search text field at the top of the Libraries Search dialog, type LF411. The * symbol is a wildcard used to take into account the different prefixes and suffixes used by different manufacturers. 5. Click on Search and the query results display in the Libraries panel as the search takes place. The component we need is found in the NSC Operational Amplifier.IntLib library.
2. The Confirm dialog will display if the library has not been installed. 3. Click on Yes to install the library. An outlined version of the op amp appears "floating" on the cursor. You are now in part placement mode. 4. Before placing the part on the schematic, first edit its properties. While the op amp is floating on the cursor, press the TAB key to open the Component Properties dialog for this component.
http://wiki.altium.com/pages/viewpage.action?pageId=3080273
7/8/2011
Defining & running Circuit Simulation analyses - English documentation - The Altium W... Page 4 of 22
5. In the Properties section of the dialog, set the value for the first component designator by typing U1 in the Designator field. 6. Next, we will have a look at the SIM model that will be used when running the simulation. For this tutorial, we have used integrated libraries, which mean that the recommended models for circuit simulation are already included. Select LF411_NSC in the Models list in the Component Properties dialog and click on Edit to display the SIM Model - General / Generic Editor dialog.
7. Notice that the model file path name has been set and successfully found in the NSC Operational Amplifier.IntLib integrated library. Click on the Model File tab to display the contents of the model file. If no model file has been found, an error message will appear in this tab. Altium Designer simulator supports Spice 3F5 models, and most PSpice models.
http://wiki.altium.com/pages/viewpage.action?pageId=3080273
7/8/2011
Defining & running Circuit Simulation analyses - English documentation - The Altium W... Page 5 of 22
Altium Designer simulator supports Spice 3F5 models, and most PSpice models. 8. The Netlist Template (shown by clicking on the Netlist Template tab) will now be filled with data from the model file and can be viewed by clicking on the Netlist Preview tab.
Click OK until all dialogs are closed. You are now ready to place the op amp on the schematic sheet. 9. If you refer to the schematic diagram (Figure 1), you will notice that U1 is placed as a mirror of the symbol that is floating on the cursor. To flip the orientation of the op amp vertically before final placement, press the Y key. Position the component on the sheet and left-click or press ENTER to place it onto the schematic sheet. 10. Exit part placement mode by right-clicking or pressing the ESC key.
http://wiki.altium.com/pages/viewpage.action?pageId=3080273
7/8/2011
Defining & running Circuit Simulation analyses - English documentation - The Altium W... Page 6 of 22
folder that contains your project. You can then add this model and make modifications, if required, using the Sim Editor. For the sake of demonstration, we will add in another SPICE model, LF411C.ckt, located in the Examples\Circuit Simulation\Filter folder of your Altium Designer installation. 1. Copy LF411C.ckt and paste this file into the folder where your project files reside using Windows Explorer. 2. Add the model file to the project by selecting the project name (Filter.PrjPCB) in the Projects panel, rightclick and select Add Existing to Project. Choose the model file and click Open. The SPICE model file LF411C.ckt is added to the project under the Libraries\AdvancedSim Sub-Circuits folder in the Projects panel. Now we can add the model to the component in the schematic. This could also be done in the Schematic library for this component, if required. 3. Double-click on the op amp (U1) to open its Component Properties dialog. Delete the existing SIM model in the Models section by selecting it and clicking on Remove and confirming the deletion. 4. Click on Add in the Models List section to display the Add New Model dialog. 5. Select Simulation from the Model Type drop-down list and click OK. The SIM Model - General / Generic Editor dialog displays.
6. Select Spice Subcircuit from the Model Sub-Kind list to set the Spice Prefix to X and display the Model Location fields. The dialog name changes to reflect the Model Sub-Kind. 7. Type LF411C in the Model Name field (no extension required) and select the Model Location of Any to search all valid libraries for a matching model. Altium Designer stops searching for a model as soon as a match is found. For all models not tied to an integrated library, the search will proceed to model files added to the project and then to model files found on the Search Paths as set up in the Search Paths tab of the Options for Project dialog (Project Project Options). In this example, the search will find the model file LF411C.ckt located in the project folder. Whenever a model search does not find a match, an error will appear in the Model File tab. An interactive error will also appear in the Messages panel when you compile the project. 8. The final step is to check the pin mapping of the new model to make sure that it matches the pin numbering of the schematic component. Click on the Port Map tab of the SIM Model - General / Spice Subcircuit dialog.
http://wiki.altium.com/pages/viewpage.action?pageId=3080273
7/8/2011
Defining & running Circuit Simulation analyses - English documentation - The Altium W... Page 7 of 22
9. Modify the pin mapping to be the same as that used for the original SIM model (LF411_NSC) by selecting the matching pins from the Model Pin drop-down lists (see the dialog above for details). The way to work out the order of the pin numbers is to look at the Netlist Template tab. Note that the order for this model is 1, 2, 3, 4, 5. These correspond to the .SUBCKT header found in the Model File tab, even though these numbers may not match identically in other models as they do in this particular model file.
http://wiki.altium.com/pages/viewpage.action?pageId=3080273
7/8/2011
Defining & running Circuit Simulation analyses - English documentation - The Altium W... Page 8 of 22
Therefore, in the Model Pin column of the Port Map tab, you will see listed 1(1), 2(2), 3(3), 4(4), 5(5), where the first number is the model pin number (%1, %2, etc. from the Netlist Template) and the corresponding node name/number from the subcircuit header is enclosed in brackets. The actual numbers in the subcircuit header are not important; what is important is the order in which the connections appear in the Spice netlist. These must match the order in the header of the .SUBCKT, e.g. NonInverting Input (IN+), Inverting Input (IN-), Positive Power Supply (V+), Negative Power Supply (V-) and Output (OUT). The netlist header describes the function of each pin. Use this information to link them to the appropriate schematic pin. For example: 1(1) is the + input (non-inverting input), so links to schematic pin 3(IN+), and 5(5) is the output so links to schematic pin 6(OUT). 10. When you have modified the pin mapping, click OK until all dialogs are closed. Now we will continue with setting up our Filter schematic for simulation.
http://wiki.altium.com/pages/viewpage.action?pageId=3080273
7/8/2011
Defining & running Circuit Simulation analyses - English documentation - The Altium W... Page 9 of 22
Click OK to close the dialog and return to the Component Properties dialog. Click OK. 8. Position the resistor (refer to the schematic diagram Figure 1) and left-click or press ENTER to place the part. 9. Now place resistor R2. The designator will automatically increment when you click to place it. 10. Once you have placed the resistors, right-click or press ESC to exit part placement mode.
http://wiki.altium.com/pages/viewpage.action?pageId=3080273
7/8/2011
Defining & running Circuit Simulation analyses - English documentation - The Altium ... Page 10 of 22
4. In the Properties section of the dialog, click on the Comment field and select the =Value string from the drop down list and turn Visible off. 5. Let's check the SIM model CAP that has been added to the Models list from the integrated library. Select the model name in the Models list and click on Edit to display the Sim Model - General/Capacitor dialog. This capacitor does not require a model file and takes the required value from the Value parameter. 6. Click OK to return to the Component Properties dialog. Click OK to return to placement mode. 7. Position and place the two capacitors in the same way that you placed the previous parts, changing the value to 56pF for C2 and pressing the SPACEBAR to rotate the symbol. 8. Right-click or press ESC to exit placement mode.
Now we can add the voltage sources needed to power the design when simulating. 1. We will place the VDD power source first. Search for the component VSRC in the Libraries panel and then add the Simulation Sources.IntLib library to the Available Libraries list. Note that there are other simulation libraries available in the Library\ Simulation folder of your Altium Designer installation. As you place the power source, press TAB to edit its properties. 2. Click on the SIM model VSRC in the Models list in the Component Properties dialog and click on Edit. In the Sim Model - Voltage Source/DC Source dialog, check the Model Kind is set to Voltage Source and the Model Sub-Kind to DC Source. 3. Click on the Parameters tab to set up the voltage value required. Type 5V in the Value field and enable its Component Parameter option. This will automatically create the parameter 'Value' for you in the Component Properties dialog. Leave the other fields set to zero. Click OK until the dialogs are closed. Click to place this voltage source on the schematic. Right-click or press ESC to exit placement mode.
http://wiki.altium.com/pages/viewpage.action?pageId=3080273
7/8/2011
Defining & running Circuit Simulation analyses - English documentation - The Altium ... Page 11 of 22
4. Now place the VSS power source, remembering to set the model file parameter Value to -5V. 5. Finally add the Sinusoidal (excitation) Voltage Source, VSIN, also available from the Simulation Sources.IntLib. Press TAB to edit its properties before placing and change the frequency from 1KHz to 50KHz for this example. In the Component Properties dialog, click on the SIM model VSIN in the Models list and click on Edit.
In the Sim Model - Voltage Source / Sinusoidal dialog, check the Model Kind is Voltage Source and the Model Sub-Kind is set to Sinusoidal. 6. Click on the Parameters tab to set up the voltage value required. Type in the parameter values as shown in the Sim Model - Voltage Source / Sinusoidal dialog (see right). The Netlist Template is evaluated using this information and displayed in the Netlist Preview. Click OK until the dialogs are closed and click to place this voltage source on the schematic. Right-click or press ESC to exit placement mode. 7. Save your schematic [shortcut: CTRL + S].
http://wiki.altium.com/pages/viewpage.action?pageId=3080273
7/8/2011
Defining & running Circuit Simulation analyses - English documentation - The Altium ... Page 12 of 22
1. Select Place Power Port. Press TAB to set the power port settings in the Power Port dialog. 2. For the ports attached to the components' pins, type in the corresponding net name, e.g. VSS, and set the style to Bar. Click OK and place the power port by left-clicking or pressing ENTER. Use the SPACEBAR to rotate the port during placement. 3. Continue placing the power ports. Set the style to Power Ground and the net to GND when adding the power ports to the power sources (VIN, VDD and VSS). The OUT port is net OUT and has a Circle style. 4. When finished placing the power ports, right-click or press ESC to exit placement mode. Note, to place the power ports from a specialized toolbar, select View Toolbars Utilities and click on the required power port button.
http://wiki.altium.com/pages/viewpage.action?pageId=3080273
7/8/2011
Defining & running Circuit Simulation analyses - English documentation - The Altium ... Page 13 of 22
Altium Designer allows you to run an array of circuit simulations directly from a schematic. In the following sections of the tutorial, we will simulate the output waveforms produced by our Filter circuit. The simulation can be set up and run using the Simulate menu command or by clicking on the appropriate button on the Mixed Sim toolbar (displayed by selecting View Toolbars Mixed Sim).
1. With Filter.SchDoc open in the Schematic Editor, select Design Simulate Mix Sim, or click on the Setup icon in the Mixed Sim toolbar, to display the General Setup page of the Analyses Setup dialog. The Messages panel may display any warnings or errors about your schematic. Close the Analyses Setup dialog, fix any issues and close the Messages panel before selecting the Setup tool again. All the simulation options are set up here, including the analyses types you want to include in the simulation, the scope of the simulation (sheets to netlist) and the signals to be automatically displayed when the simulation is complete (active signals). These options are stored in the project file (when saved) and will be used in the creation of a SPICE netlist (*.nsx) which is used when the simulation is run. 2. First, we will set up the nodes in the circuit that we want to observe. In the Collect Data For field, select Node Voltage, Supply Current, Device Current and Power from the list. This option defines what type of data you want calculated during the simulation run, i.e. it saves data for the voltage at each node, the current in each supply and the current and power in each device. Set the SimView Setup to Show Active Signals. 3. In the Available Signals field, double-click on the IN and OUT signal names. As you double-click on each one, it will move to the Active Signals field. You can also select multiple signals from the Available Signals list by clicking and dragging the mouse over the signal list, or using the SHIFT and CTRL keys while clicking on signals. Then use the > button to move the signals to the Active Signals list. The simulation results for Active Signals automatically display in the Waveform Analysis window when the simulation is run.
http://wiki.altium.com/pages/viewpage.action?pageId=3080273
7/8/2011
Defining & running Circuit Simulation analyses - English documentation - The Altium ... Page 14 of 22
Press F1 when in each analyses setup page to view more detailed help. 4. Each individual analysis type (listed in the Analyses/Options section) is configured on a separate page of the Analyses Setup dialog. Click on the analysis name to activate the corresponding setup page.
2. Check that the Use Transient Defaults option is disabled, so that the Transient Analysis parameters can be modified. 3. To specify a 60u simulation window, set the Transient Stop Time field to 60u. 4. Now set the Transient Step Time field to 100n, indicating that the simulation should calculate a point every 100ns. 5. During simulation, the actual timestep is varied automatically to achieve convergence and the required accuracy. The Maximum Step field limits the variation of the timestep size, so set the Transient Max Step Time to 200ns.
http://wiki.altium.com/pages/viewpage.action?pageId=3080273
7/8/2011
Defining & running Circuit Simulation analyses - English documentation - The Altium ... Page 15 of 22
An AC analysis generates output that shows the frequency response of the circuit, calculating the smallsignal AC output variables as a function of frequency. The desired output of an AC small-signal analysis is usually a transfer function, e.g. voltage gain. The schematic must contain at least one AC source with a value entered for the AC Magnitude parameter in its SIM model. We have already set up the parameters of our sinusoidal excitation source (VSIN) to contain the AC Magnitude value, frequency and amplitude. See Setting up voltage sources for more information. 1. Make sure the AC Small Signal Analysis option is enabled in the Analyses Setup dialog. 2. Enter the parameter values as shown above. 3. When this analysis is run, an Operating Point analysis is run first to determine the DC bias of the circuit. The signal source is then replaced with a fixed amplitude sine wave generator and the circuit is analyzed over the specified frequency range, stepping in increments defined by the values in the Test Points and the Sweep Type fields.
http://wiki.altium.com/pages/viewpage.action?pageId=3080273
7/8/2011
Defining & running Circuit Simulation analyses - English documentation - The Altium ... Page 16 of 22
Transient Analysis waveforms For more information about using the Waveform Analyzer and the Sim Data panel, see Using the Waveform Analysis Window in the Performing Signal Integrity Analyses tutorial since both tools use the same window for displaying and manipulating waveforms.
http://wiki.altium.com/pages/viewpage.action?pageId=3080273
7/8/2011
Defining & running Circuit Simulation analyses - English documentation - The Altium ... Page 17 of 22
A Bode plot consists of two curves the log of gain and phase as functions of the log of frequency. The gain in decibels (dB) and the phase are plotted linearly along the y axis on a chart that has several cycles of a log scale on the x axis. Each cycle represents a factor of ten in frequency. We can create a Bode plot using the waveform functions available in the Edit Waveform dialog. 1. In the AC Analysis tab of the Waveform Analyzer window, we will display dB(in), dB(out), PHASE(in) and PHASE(out). 2. In the Waveform Analyzer window, click on net in. Right-click on the selected net and select Edit Wave (or select Wave Edit Wave). The Edit Waveform dialog displays. The selected wave appears in the Expression field. 3. Select the function from the Complex Functions list, i.e. Magnitude (dB). Click on Create to see the waveform dB(net_name), i.e. dB(in), on the plot. 4. To create dB(out), right-click on the plot and select Add Wave to Plot. The Add Wave to Plot dialog displays which works in the same way as the Edit Waveform dialog. 5. Repeat step 4 to create PHASE(in) and PHASE(out) on the second plot by selecting the Phase (Deg) complex function in the Add Wave to Plot dialog.
http://wiki.altium.com/pages/viewpage.action?pageId=3080273
7/8/2011
Defining & running Circuit Simulation analyses - English documentation - The Altium ... Page 18 of 22
6. These waveforms could be displayed on different Y axes, if required, by selecting Add to new Y axis in the Edit Waveform dialog. Note that if you remove the new Y axis, all waves that are plotted to this axis are removed as well as any measurement cursors attached to these waves. There is no Undo functionality. If you added a new Y axis, it would appear as shown to the right.
http://wiki.altium.com/pages/viewpage.action?pageId=3080273
7/8/2011
Defining & running Circuit Simulation analyses - English documentation - The Altium ... Page 19 of 22
4. Read off the X value of cursor B in the Measurement Cursors section of the Sim Data panel and you will find the 3dB point = 20kHz.
5. To clear the cursors, select the cursor marker, right-click and select Cursor Off.
http://wiki.altium.com/pages/viewpage.action?pageId=3080273
7/8/2011
Defining & running Circuit Simulation analyses - English documentation - The Altium ... Page 20 of 22
7. Click OK to run the simulation. Each primary sweep appears as a waveform with the notation <net_name_p<sweep_number>, e.g. out_p01, in a new plot in the AC Analysis and Transient Analysis tabs of the Waveform Analyzer window. Click on a sweep parameter name to display more information, e.g. clicking on out_p01 displays the sweep information underneath the plot.
You will notice below that the parameter sweep varies the frequency response around the cutoff frequency quite dramatically.
http://wiki.altium.com/pages/viewpage.action?pageId=3080273
7/8/2011
Defining & running Circuit Simulation analyses - English documentation - The Altium ... Page 21 of 22
To change the value of a SPICE option, e.g. the iteration value for ITL1: 1. Select the variable, e.g. ITL1. Type in the new value in the Value field, or choose the value by clicking on the scroll arrows that appear. 2. Press ENTER, or click in another field, and the Default (Def) option is then disabled. You could also choose a different integration method from this page, for example, if you have a circuit design with unexpected high frequency oscillations, you could change the standard Integration method from Trapezoidal to Gear. The Trapezoidal method is relatively fast and accurate, but tends to oscillate under certain conditions. The Gear methods require longer simulation times but tend to be more stable. Theoretically, the higher the Gear order, the more accurate the results but the simulation time increases.
http://wiki.altium.com/pages/viewpage.action?pageId=3080273
7/8/2011
Defining & running Circuit Simulation analyses - English documentation - The Altium ... Page 22 of 22
to the netlist. This is useful for advanced users who want to be able to modify settings directly in the netlist. Note that you can not add or configure setup information using the Analyses Setup dialog if the netlist already includes any setup information. If there is no simulation setup information contained in the netlist but there are schematic documents in the project, then the netlist is regenerated from the schematic documents and the project's setup information. This would only occur if you deleted the setup information from the netlist and then attempted to simulate from it. 3. Once you have added a netlist which has no setup information to a project, you can configure the analyses by selecting Simulate Setup. 4. To run a simulation, select Simulate Run from the menus. The simulation waveforms will display in a .sdf document. 5. Rename the netlist file so it is not overwritten next time you run a simulation. For more information about simulation, refer to the Simulation Models and Analyses Reference and the Digital SimCode Reference.
Attachments:93 Added by Confluence Administrator, last edited by Josie Di Costanzo on Jan 06, 2009
Labels:
tu0106
Copyright
http://wiki.altium.com/pages/viewpage.action?pageId=3080273
7/8/2011