MicroSim PSpice Optimizer Analog Performance Optimization Software User’s Guide MicroSim Corporation 20 Fairbanks Irvine, California 92618 (714) 770-3022
Version 8.0, June, 1997. Copyright 1997, MicroSim Corporation. All rights reserved. Printed in the United States of America. TradeMarks Referenced herein are the trademarks used by MicroSim Corporation to identify its products. MicroSim Corporation is the exclusive owners of “MicroSim,” “PSpice,” “PLogic,” “PLSyn.
Contents Before You Begin Welcome to MicroSim . . . . . . . . . MicroSim PSpice Optimizer Overview How to Use this Guide . . . . . . . . . Typographical Conventions . . . . Related Documentation . . . . . . . . If You Have the Evaluation Version . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
iv Contents Changing the Constraint and Rerunning the PSpice Optimizer Using Standard Component Values . . . . . . . . . . . . . . Producing Reports . . . . . . . . . . . . . . . . . . . . . . . Saving Results . . . . . . . . . . . . . . . . . . . . . . . . . Updating the Schematic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-16 2-18 2-18 2-19 2-19 Chapter 3 Using the PSpice Optimizer Chapter Overview . . . . . . . . . . . . . . . . . . . . .
Contents Viewing the Optimization Log . . Viewing Derivatives . . . . . . . . Finalizing the Design . . . . . . . . . Using Standard Component Values Saving Results . . . . . . . . . . . Updating the Schematic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . v . . . . . . . . . . . . . 3-28 . 3-28 . 3-29 .
vi Contents Defining Optimization Parameters . . . Defining the Analysis Type . . . . . . Running an Initial Circuit Analysis . . Activating the PSpice Optimizer . . . . Viewing the Parameter Description . . Defining the Goals and Constraints . . Checking that the Design Will Simulate Starting the Optimization . . . . . . . . Changing a Goal to a Constraint . . . . Saving Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Contents vii Fitting the Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-10 Appendix AError Messages Appendix Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-1 Error Message Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . A-2 File Types Used by Appendix Bthe PSpice Optimizer Appendix Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . File and Program Relationships . . . . . . . . . . . . . . . . . . . . . . . . .
Figures Figure 1-1 Figure 2-1 Figure 2-2 Figure 2-3 Figure 2-4 Figure 2-5 Figure 2-6 Figure 2-7 Figure 2-8 Figure 2-9 Figure 2-10 Figure 3-1 Figure 3-2 Figure 3-3 Figure 3-4 Figure 3-5 Figure 3-6 Figure 3-7 Figure 4-1 Figure 4-2 Figure 4-3 Figure 4-4 Figure 5-1 Figure 5-2 Figure 5-3 Figure 6-1 Figure 6-2 Figure 7-1 Figure 7-2 Figure 7-3 Figure 8-1 Figure 8-2 Optimization Design Flow . . . . . . . . . . . . . . . . . Diode Biasing Design Example . . . . . . . . . . . . . .
x Figures Figure 8-3 Figure 8-4 Figure 8-5 Figure B-1 Optimization Results for the BJT Model Fitting Example . . . . . . Probe Display after Optimization is Complete . . . . . . . . . . . . MicroSim Program and File Interactions Important to Optimization Sample External Data File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-11 8-11 . B-2 .
Tables Table 1-1 Table 1-2 Table 3-1 Table 3-2 Table 8-1 Table 8-2 Optimization Problems . . . . . . . . . . . . . . . . . . . . . . Valid Operators and Functions for PSpice Optimizer Expressions Edit Parameter Dialog Box Controls . . . . . . . . . . . . . . . Edit Specification Dialog Box Controls . . . . . . . . . . . . . . Error Message Descriptions . . . . . . . . . . . . . . . . . . . . Summary of PSpice Optimizer-Related File Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Before You Begin Welcome to MicroSim Welcome to the MicroSim family of products. Whichever programs you have purchased, we are confident that you will find that they meet your circuit design needs. They provide an easy-to-use, integrated environment for creating, simulating, and analyzing your circuit designs from start to finish.
xiv Before You Begin MicroSim PSpice Optimizer Overview The MicroSim PSpice Optimizer is a circuit optimization program that improves the performance of analog and mixed analog/digital circuits. The PSpice Optimizer is fully integrated with other MicroSim programs. This means you can design your circuit with MicroSim Schematics, simulate with MicroSim PSpice A/D (or MicroSim PSpice), analyze results with MicroSim Probe and optimize performance within the same environment.
How to Use this Guide xv How to Use this Guide This guide is designed so you can quickly find the information you need to use the PSpice Optimizer. This guide assumes that you are familiar with Microsoft Windows (NT or 95), including how to use icons, menus, and dialog boxes. It also assumes you have a basic understanding about how Windows manages applications and files to perform routine tasks, such as starting applications and opening, and saving your work.
xvi Before You Begin Related Documentation Documentation for MicroSim products is available in both hard copy and online. To access an online manual instantly, you can select it from the Help menu in its respective program (for example, access the Schematics User’s Guide from the Help menu in Schematics). Note The documentation you receive depends on the software configuration you have purchased. The following table provides a brief description of those manuals available in both hard copy and online.
If You Have the Evaluation Version xvii The following table provides a brief description of those manuals available online only. This online manual... Provides this... MicroSim PSpice A/D Online Reference Manual Reference material for PSpice A/D. Also included: detailed descriptions of the simulation controls and analysis specifications, start-up option definitions, and a list of device types in the analog and digital model libraries.
Things You Need to Know 1 Chapter Overview This chapter introduces the purpose and function of the PSpice Optimizer, the optimization process, and related terms. What is the PSpice Optimizer? on page 1-2 describes optimizer capabilities and the criteria designs must meet for successful optimization. Using the PSpice Optimizer with Other MicroSim Programs on page 1-4 presents the high-level design flow for optimization and how other MicroSim programs are integrated into each design phase.
1-2 Things You Need to Know What is the PSpice Optimizer? The MicroSim PSpice Optimizer is a circuit optimization program that improves the performance of analog and mixed analog/digital circuits. Run optimizations The PSpice Optimizer performs iterative simulations, while adjusting the values of design parameters until performance goals, subject to specified constraints, are nearly or exactly met. Constraints can include simple bounds on parameter values and nonlinear functions.
What is the PSpice Optimizer? 1-3 Designs that You Can Optimize A design that you can optimize must meet the following criteria: • It works; that is, it simulates with PSpice to completion and behaves as intended. • One or more of its components have a variable value, and each value that is varied relates to an intended performance goal. • An algorithm exists to measure its performance as a function of the variable value.
1-4 Things You Need to Know Using the PSpice Optimizer with Other MicroSim Programs Because you can use Schematics, PSpice, and Probe to design and simulate at the system, subcircuit, or component level, use the PSpice Optimizer to optimize at whatever level is most appropriate. The PSpice Optimizer is fully integrated with other MicroSim programs.
Terms You Need to Understand 1-5 Terms You Need to Understand Optimization Optimization is the process of fine-tuning a design by varying design parameters between successive simulations until performance comes close to (or exactly meets) the ideal performance. The PSpice Optimizer solves four types of optimization problems as described in Table 1-1.
1-6 Things You Need to Know Parameter A parameter defines a property of the design for which the PSpice Optimizer attempts to determine the best value within specified limits. A parameter can: • Represent component values (such as resistance, R, for a resistor). • Represent other component attribute values (such as slider settings in a potentiometer). • Participate in expressions used to define component values or other component attribute values.
Terms You Need to Understand 1-7 External specifications An external specification is composed of measurement data, which are defined in an external data file that is read by the PSpice Optimizer. Target value A target value is the ideal operating value for a characteristic of the design as defined by a goal or constraint specification. Goal A goal defines the performance level that the design should attempt to meet (e.g., minimum power consumption).
1-8 Things You Need to Know Constraint A constraint defines the performance level that the design must fulfill in which the target value exceeds, falls below, or equals a specified value (e.g., an output voltage that must be greater than a specific level). The constraint specification includes: • The name of the constraint. • A target value and an acceptable range. • A circuit file to simulate. (See note on previous page.) • An evaluation for measuring performance.
Terms You Need to Understand 1-9 Each aspect of a design’s performance is found by either: • first performing the appropriate simulation, then running Probe to measure characteristics of the resulting waveform(s), or • evaluating PSpice Optimizer expressions. In many cases (particularly if there are multiple conflicting specifications), it is possible that the PSpice Optimizer will not meet all of the goals and constraints.
1-10 Things You Need to Know Refer to the Goal Function wizard in Probe and your PSpice user’s guide for information on how to develop and specify goal functions. Here are some quick tips. In Probe: • To test the value returned by a specified goal function, select Eval Goal Function from the Trace menu. • To see the waveforms and marked points used to evaluate a goal function, select Display Evaluation in the Probe Options dialog box (from the Tools menu, select Options to display this dialog box).
Terms You Need to Understand 1-11 Table 1-2 Valid Operators and Functions for PSpice Optimizer Expressions Operator Meaning + addition - subtraction * multiplication / division ** exponentiation exp ex log ln(x) log10 log 10 (x) sin sine cos cosine tan tangent atan arctangent Note Unlike trace functions and Probe goal functions, PSpice Optimizer expressions are evaluated without using a simulation or Probe.
Primer: How to Optimize a Design 2 Chapter Overview This chapter guides you through the basic steps needed to setup and run an optimization using a simple diode biasing design. Optimizing a Diode Biasing Circuit—the Objective on page 2-2 describes the sample circuit and its ideal operating characteristics. Why Use Optimization? on page 2-3 explains why fine-tuning your design using the PSpice Optimizer saves time.
2-2 Primer: How to Optimize a Design Optimizing a Diode Biasing Circuit—the Objective Assume that you want to design a circuit that drives a current of 1 mA (±5 µA) through a diode (D1N914) using a 5 Vvoltage source and a series resistor to control the current through the diode. A circuit such as this is shown in Figure 2-1. Figure 2-1 Diode Biasing Design Example Your objective is to find a value for resistor R1 so that current through diode D1 falls in the range 0.995 mA to 1.005 mA.
Why Use Optimization? 2-3 Why Use Optimization? To solve the problem manually, you could assign an arbitrary value to R1, manually calculate the current, then make an educated guess to adjust the values until a satisfactory solution is found. Or, you might use a simulation to sweep the value for R1 with a DC Sweep analysis, carefully analyzing the results to find the best solution.
2-4 Primer: How to Optimize a Design Phase One: Developing the Design Phase 1 is also the time to investigate: • The effects of individual components by replacing component values with parameters or parameterized expressions. Before optimizing, you must have a working circuit. This means first drawing the schematic, then iteratively simulating with PSpice and adjusting the design until the circuit operates with the intended behavior.
Phase One: Developing the Design 2 From the Draw menu, use Wire to connect the symbols as shown in Figure 2-1. 3 From the Edit menu, use Attributes to set V1’s DC attribute to 5v. 4 From the File menu, select Save As and enter mydiode.sch in the File Name text box. The PSpice Optimizer Advantage To determine a value for R1 manually, you can set up a parametric analysis of a DC sweep where: • the value of R1 steps from 4 k to 5 k in increments of 0.
2-6 Primer: How to Optimize a Design Phase Two: Setting Up the Optimization Now that preliminary design development is complete, you are ready to define the optimization parameters, goals, and constraints.
Phase Two: Setting Up the Optimization 2-7 Defining Design Parameters To define parameters for optimization, you must: • Identify the parameters to adjust for optimization and assign a unique name to each one. • Set up each parameter as a global optimization parameter using the Schematic Editor and the OPTPARAM symbol. • Select which components in the design are affected by the parameter and, for each component, replace its value (e.g.
2-8 Primer: How to Optimize a Design Setting Up Goals and Constraints Before you can evaluate and improve the circuit’s performance, you must answer these questions: • What operating characteristics do I want to measure? • How do the parameters affect the operating characteristics? Once you’ve answered these questions, you are ready to: • Set up the analyses needed to evaluate the performance measures. • Develop the performance measure algorithms.
Phase Two: Setting Up the Optimization a 2-9 To fix the voltage of V1, fill in the DC Sweep dialog box as shown. The DC Sweep settings are: Swept Var Type = Voltage Source Sweep Type= Value List Name = V1 Values = 5v b Click OK to return to the Setup Analysis dialog box. c Select the DC Sweep check box to enable it. 3 Clear all other analysis check boxes. 4 Click OK. Developing performance measures To measure performance you must define an evaluation algorithm for each specification.
2-10 Primer: How to Optimize a Design Defining specifications: goals and constraints Now that you’ve completed the preliminary groundwork, you are ready to define the properties for goals and constraints. So far, you have performed all steps in Schematics. To finalize setup, you must specify the goal for the diode design example using the PSpice Optimizer.
Phase Three: Running an Optimization Phase Three: Running an Optimization Now that you have defined the parameters, specifications, and evaluations for the design, you are ready to optimize, adjust, and finalize your design.
2-12 Primer: How to Optimize a Design Running the PSpice Optimizer You can use the PSpice Optimizer to: This is useful when initially validating the circuit or when restarting optimization after adjusting parameters or specifications. This is useful when exploring design tradeoffs by tweaking parameter and specification values. • Optimize the circuit to completion (from the Tune menu, select Auto).
Phase Three: Running an Optimization Starting Parameter Values Evaluate Performance Compare to Specifications Satisfied? Yes Done No Iteration Limit Reached? Yes Done No Evaluate Derivatives Compute New Parameter Values Convergence Fails? Yes Done No Figure 2-5 PSpice Optimizer Automatic Optimization Process 2-13
2-14 Primer: How to Optimize a Design To start optimizing the diode design In the diode example, the derivative at R1=5 k is –1.62 x 10 -7, or 1 From the Tune menu, select Auto and click Start. The PSpice Optimizer performs several simulations. For each iteration of the parameter values, the optimizer calculates overall performance and graphically displays the results.
Phase Three: Running an Optimization 2-15 The constraint type specifies the required relation between what is evaluated (as defined in the Evaluate text box) and the target value (defined in the Target text box). To define the constraint for power dissipation in R1 The power dissipated in R1 must be less than or equal to 4 mW±400 uW. Define the constraint by doing the following: 1 In PSpice Optimizer, from the Edit menu, select Specifications. 2 In the Specifications dialog box, click Add.
2-16 Primer: How to Optimize a Design progress indicator has a tick mark 1/4 of the way up. The vertical bar within the indicator is below the tick mark; this means that the constraint is currently satisfied. 5 From the Tune menu, select Auto and click Start to start optimization. After a number of iterations, the optimization ends without satisfying the goal.
Phase Three: Running an Optimization 2-17 To change the Pc constraint type to “greater than or equal” 1 In PSpice Optimizer, double-click the lower right-hand corner of the Pc box. 2 In the Edit Specifications dialog box, change Type to >= target. 3 Click OK. To run the optimization with the modified constraint 1 Test performance with the updated constraint: a From the Edit menu, select Reset Values. b From the Tune menu, select Update Performance.
2-18 Primer: How to Optimize a Design See Using Standard Component Values on page 3-29 for more information, including how the PSpice Optimizer uses tolerances and limits when standardizing values. Using Standard Component Values When an optimization completes successfully, the optimizer displays the new parameter values in the PSpice Optimizer window. However, each calculated value might not correspond to an actual value that is available with off-the-shelf components.
Phase Three: Running an Optimization Figure 2-9 Report Summary for the Diode Optimization Saving Results When you have finished optimizing, you can save all of the optimizer data, including the current values for all parameters and specifications. To save the optimizer data for the diode design 1 From the File menu, select Save. The PSpice Optimizer updates the mydiode.opt file. All of the options settings are also saved.
2-20 Primer: How to Optimize a Design To update the diode schematic with the current parameter values 1 From the Edit menu, select Update Schematic. Recall that R1Val was initially set at 5.0 k in the schematic file. When you select Update Schematic, the PSpice Optimizer sends a message to Schematics to update the schematic file. Schematics writes the new parameter value of 3.9 k to the OPTPARAM symbol on the schematic (as the current value). Figure 2-10 shows the updated schematic for the diode design.
Using the PSpice Optimizer 3 Chapter Overview This chapter describes in general terms how to complete any task using the PSpice Optimizer, including: • How to activate the PSpice Optimizer and load a design, page 3-2. • How to interact with the PSpice Optimizer window, page 3-5. • How to add and edit optimization parameters, page 3-10. • How to add and edit goals and constraints, page 3-13. • How to measure and optimize performance, page 3-18. • How to explore design tradeoffs, page 3-20.
3-2 Using the PSpice Optimizer Activating and Loading the PSpice Optimizer This section describes how to: • Start the PSpice Optimizer. • Set special startup options. • Load a design. Activating the PSpice Optimizer Start the PSpice Optimizer program either from: • Schematics, or • the Windows 95 Start menu. From Schematics Tools menu To activate the PSpice Optimizer from Schematics 1 In Schematics, from the Tools menu, select Run Optimizer.
Activating and Loading the PSpice Optimizer 3-3 From the Windows 95 Start Menu From the Windows 95 Start menu, there is a program folder which contains Windows 95 shortcuts for all installed MicroSim programs, including the PSpice Optimizer. To activate the PSpice Optimizer from the Windows 95 Start menu 1 From the Windows 95 Start menu, select the MicroSim program folder and then the PSpice Optimizer shortcut to start optimizer. The optimizer activates without an optimization setup.
3-4 Using the PSpice Optimizer To automatically load an optimization file after startup 1 In the PSpice Optimizer command line, add the name of the optimization file as follows: OPTIMIZE optimization_file_name The following command line example shows how to start the optimizer at all times with an initialization file named myinit.ini and an optimization file named mydesign.opt: OPTIMIZE mydesign.opt -i myinit.
The PSpice Optimizer Window 3-5 The PSpice Optimizer Window The PSpice Optimizer window contains three areas: • specifications area • parameters area • error gauge area Figure 3-1 illustrates their position in the window.
3-6 Using the PSpice Optimizer Specifications Area The specifications area can show up to eight specification boxes where each box represents either a goal or a constraint. Figure 3-2 illustrates the fields contained in each box. enable/disable check box progress indicator current value edit specification hot spot initial value Figure 3-2 Example of a Specification Box For more information on the enable/disable check box, see Excluding Parameters and Specifications from Optimization on page 3-24.
The PSpice Optimizer Window 3-7 Progress indicator As mentioned above, the progress indicator shows red while the specification is violated, and changes to green when the specification is satisfied. You can monitor progress as the optimization runs by watching the progress indicator and observing the height of the vertical black bar relative to the tick mark(s) to the right.
3-8 Using the PSpice Optimizer Parameters Area The parameters area can show up to eight parameter boxes. Figure 3-2 illustrates the fields contained in each box. enable/disable check box current value edit parameter hot spot initial value Figure 3-3 Example of a Parameter Box For more information on the enable/disable check box, see The following sections explain the initial and current value fields in the parameter box. Excluding Parameters and Specifications from Optimization on page 3-24.
The PSpice Optimizer Window 3-9 Error Gauge Area The error gauge area has an error indicator and shows information reflecting the overall condition of the optimization. The error gauge shows how far the goals are from their target values. Initially, the indicator displays 100%. As the optimization proceeds, the error falls as the goals approach their target values. The PSpice Optimizer displays the RMS of the normalized value of the goals in the RMS Error field.
3-10 Using the PSpice Optimizer Adding and Editing Parameters This section describes how to create and change optimization parameters using the PSpice Optimizer. This means you can also edit the properties of parameters that you defined in a schematic. Note You are limited to eight parameters per optimization file. This limit includes parameters that you have defined but disabled for a given run. Adding a Parameter You can also define parameters in Schematics using the OPTPARAM symbol.
Adding and Editing Parameters 3-11 3 In the Edit Parameter dialog box, set the controls as described in Table 3-1. Table 3-1 Edit Parameter Dialog Box Controls Control Name Meaning Name Parameter name; for a new parameter, doubleclick <> and enter a text string that is unique to the current optimization file. Current Value Latest parameter value; for a new parameter, set Current Value equal to Initial Value. Initial Value Starting value for the parameter.
3-12 Using the PSpice Optimizer 6 When finished, click OK to return to the Parameters dialog box. Note You cannot copy a parameter description from one optimization file to another. Instead, save an entire optimization file under a new name, then edit the new version as needed. Selecting a Parameter to Edit You can change the properties of an existing parameter at any time using the Edit Parameter dialog box.
Adding and Editing Specifications Adding and Editing Specifications This section describes how to create and change specifications—that is, goals and constraints—using the PSpice Optimizer. Note You are limited to eight specifications per optimization file. This limit includes specifications that you have defined but disabled for a given run. Adding a Specification There are two ways to add a specification using the PSpice Optimizer: • Create the specification from scratch.
3-14 Using the PSpice Optimizer 3 In the Edit Specification dialog box, set the controls as described in Table 3-2. Table 3-2 Edit Specification Dialog Box Controls Control Name Meaning Name Specification name; for a new specification, double-click <> and enter a text string that is unique to the current optimization file. Reference • Select Internal when defining the specification’s target value and range in this dialog box.
Adding and Editing Specifications Table 3-2 Edit Specification Dialog Box Controls Control Name Meaning File Name of the file that contains the measured data. X Column Name Heading for the data column in File containing the independent (X) values. Y Column Name Heading for the data column in File containing the dependent (Y) values Tolerance Tolerance value used when standardizing component values.
3-16 Using the PSpice Optimizer To create a specification based on an existing specification 1 In the PSpice Optimizer, from the Edit menu, select Specifications. 2 Select the specification that you want to copy and click Copy. Notice that the Insert button is now enabled (no longer grayed out) 3 Click Insert to add a copy of the selected specification to the parameter list. The optimizer inserts the new specifications immediately above the highlighted specification.
Adding and Editing Specifications 3-17 Defining an Evaluation for an External Specification When defining evaluations for external specifications, use the ‘!’ symbol within the evaluation as a placeholder for data in the external file. For each of the subgoals in the external file, the PSpice Optimizer first replaces the ‘!’ character with the X column data value (defined in the X Column Name text box in the Edit Specification dialog box), and then proceeds with evaluation.
3-18 Using the PSpice Optimizer Selecting a Specification to Edit You can change the properties of an existing specification at any time using the Edit Specification dialog box. To display the Edit Specification dialog box for a goal or constraint 1 Do one of the following: • In the specifications area of the PSpice Optimizer window, double-click the lower right-hand corner of the box for the specification you want to edit.
Measuring and Optimizing Performance 3-19 To optimize your design 1 From the Tune menu, select Update Performance. Tune menu The PSpice Optimizer measures the design’s performance using both the initial and current values for each of the parameters. The optimizer updates the initial and current fields, respectively, for each specification, and sets the progress indicators showing how closely these initial measures match each of the target values. 2 From the Tune menu, select Auto and click Start.
3-20 Using the PSpice Optimizer 2 3 Create a Probe display configuration. a In Probe, add the traces (from the Trace menu, select Add) and modify the axes (from the Plot menu, select X Axis Settings or Y Axis Settings) to appear as you want them to when monitoring intermediate results. b From the Tools menu, select Display Control. c In the New Name text box, enter a name for the Probe display and click Save. d Click Close. Define the Probe display to use when optimizing.
Exploring the Effect of Parameter and Specification Changes • 3-21 Add new or edit existing parameter definitions and specification descriptions. Testing Performance when Changing Current Values In the PSpice Optimizer window, you can quickly examine the effects of a small change to either a parameter’s current value or a specification’s current value. Recalculation modes When changing current values, you can choose between automatic and manual recalculation of performance.
3-22 Using the PSpice Optimizer Note Because the performance of the design usually depends on the parameters in a highly nonlinear way, the results are typically reliable only for small changes in values. See “Ensuring reliable results when tweaking values” on page 3-24 for the steps you can take for best results. Automatically recalculating performance The PSpice Optimizer automatically recalculates performance after each change provided that: • Automatic recalculation is selected (the default).
Exploring the Effect of Parameter and Specification Changes 3-23 Manually recalculating performance When you want to change multiple values before recalculating performance, disable recalculation. As with automatic recalculation, derivative data is required. To test performance using manual recalculation 1 2 Disable automatic recalculation. a From the Options menu, select Recalculate. b In the When frame, select Manual. c Click Close. From the Tune menu, select Update Derivatives.
3-24 Using the PSpice Optimizer Ensuring reliable results when tweaking values Because the PSpice Optimizer uses derivative data to estimate what will happen when a parameter or a specification is changed, and because the design usually depends on the parameters in a highly nonlinear way, results are typically reliable only for small changes in values. Once you have significantly changed values, resimulate and recompute the derivatives before adjusting values any further.
Exploring the Effect of Parameter and Specification Changes Note When you exclude a specification from optimization, the PSpice Optimizer still reevaluates its performance when you update the parameters or derivatives. It is also included in the matrix of partial derivatives.
3-26 Using the PSpice Optimizer 3 If you want to run a complete optimization: a From the Tune menu, select Auto. b Click Start. Saving Intermediate Values You can save a set of parameter and specification values, and then continue to investigate performance. To save intermediate values Edit menu 1 From the Edit menu, select Store Values. The PSpice Optimizer copies the current values to the initial values for all specifications and parameters.
Viewing Result Summaries • settings for each of the parameters, specifications, and options • performance results • partial derivatives • Lagrange multipliers To generate an optimization report 1 3-27 File menu From the File menu, select Report. The PSpice Optimizer generates the report and saves it to an ASCII file named design_name.oot. The optimizer also displays the report in the text editor configured for your installation (Notepad, by default).
3-28 Using the PSpice Optimizer • If you are not using MicroSim TextEdit, use the Print command for the text editor showing the report. Viewing the Optimization Log The PSpice Optimizer automatically creates an audit trail of optimization progress and saves the information to a file named design_name.olg. You can use this file as a debugging tool when an optimization fails to converge.
Finalizing the Design Finalizing the Design This section describes how to use the PSpice Optimizer to: • Standardize component values once the optimization is complete. • Save results. • Back-annotate the schematic with the final component and parameter values.
3-30 Using the PSpice Optimizer To compute standard component values based on the most recent optimization Edit menu 1 From the Edit menu, select Round Calculated. The PSpice Optimizer replaces the parameter values with the standardized values only if the new values remain within the specified limits.
Finalizing the Design Updating the Schematic Once the optimization is complete and you have optionally standardized component values, you can update the underlying schematic with the final parameter values. To back-annotate the schematic with the latest parameter values 1 In the PSpice Optimizer, from the Edit menu, select Update Schematic. The optimizer writes the optimized parameter values to the schematic file. On the schematic, the new values appear in the Current column of the OPTPARAM symbol.
Understanding Optimization Principles and Options 4 Chapter Overview This chapter explains optimization concepts and how you can influence the outcome of an optimization. The concepts covered in this chapter include: constrained optimization, function characteristics, convergence and the effect of starting points, and how the PSpice Optimizer computes derivatives and scales target values.
4-2 Understanding Optimization Principles and Options Goals versus Constraints Goals and constraints represent the ideal behavior of a design. In practice, this behavior is often unattainable. If there is more than one goal, the PSpice Optimizer combines the errors by summing the squares of the normalized values.
Constrained Optimization When using the PSpice Optimizer, you can set up this problem in one of three ways: • Consider Ve and Re as equally important; set up both as goals. • Consider Ve as the most important requirement to meet, even at the expense of Re; set up Ve as a constraint and Re as a goal. • Consider Re as the most important requirement to meet, even at the expense of Ve; set up Re as a constraint and Ve as a goal.
4-4 Understanding Optimization Principles and Options general, constraints are given much greater weight than the goals. This approach has a number of pitfalls. In particular: • If a very large value is used for the weight of the constraints, numerical problems occur. • If a more reasonable value is used, the result is not a true solution of the original problem.
Constrained Optimization The power consumption of the cell is the goal (the characteristic to be minimized) and the gain-bandwidth product is the inequality constraint. To continue the example, consider the dependence of power consumption and gain-bandwidth product on bias current in one of the amplifier stages. Power consumption is proportional to the bias current, while the gain-bandwidth product is proportional to the square root of the bias current.
4-6 Understanding Optimization Principles and Options Active and Inactive Constraints An active constraint is one which affects the solution of the optimization problem—that is, the solution would probably be different if the constraint were removed. Equality constraints are always active (e.g., a constraint of the form Vout = 3.75 V is always active). Inequality constraints are considered active if the solution violates the constraint or if it is equal to the constraint (e.g.
Characteristics of Functions 4-7 the units of the Lagrange multipliers are the reciprocal of the units of their associated constraint. Example: A multiplier associated with a width constraint has units of meter-1. Characteristics of Functions The success of an optimization depends highly on the behavior of the functions related to each specification.
4-8 Understanding Optimization Principles and Options • Increase simulator accuracy (e.g., reduce RELTOL). The first proposed technique is preferred because it does not affect the time required to run each simulation (usually the determining factor in how long an optimization run takes). Global and Local Minima The curve in Figure 4-2 shows a 1-dimensional function with 2 minima. Point M1 is a local minimum; it satisfies the conditions for a minimum, but there is another minimum which is smaller.
Convergence more efficient to find the approximate location of the desired solution (perhaps by performing a number of analyses sweeping out ranges of the parameters) before starting the optimization process. Convergence When running an optimization, the PSpice Optimizer varies the parameter values and measures the resulting performance. For each subsequent iteration, the optimizer chooses each parameter step to reduce the error between the design’s measured and specified target performance.
4-10 Understanding Optimization Principles and Options more of the parameters are limited by the specified upper or lower bound for that parameter. In other words, the optimizer finds a solution (if one exists) even if one or more parameters are at their limit. However, solving this kind of problem is intrinsically more difficult than performing unconstrained minimization.
Derivatives 4-11 Example: If there are two specifications, each of which requires a DC analysis of the same circuit file, the optimizer will run a single simulation for each parameter, then load the data file (.dat) into Probe and evaluate the perturbed values of f. If there are M specifications (all using the same analysis type and the same circuit file) and N parameters, then forming the Jacobian takes: • N simulations, and • M Probe goal function evaluations per simulation.
4-12 Understanding Optimization Principles and Options When, for a given parameter, the difference between its initial value and the value of interest is large (that is, the relative difference is much bigger than Delta), modify its initial value and restart the simulation.
Default Options Target Value Allowed Range Measured Value collector-base capacitance 10 pF ±1 pF 8 pF collector resistance 10 k ±1 k 12 k Specification 4-13 Then the scaled values are: ( 8pF – 10pF ) --------------------------------- = –2 1pF and 25k – 10k ------------------------ = 15 1k , respectively. Since these numbers are close enough in magnitude, the PSpice Optimizer can combine them without losing numerical significance.
4-14 Understanding Optimization Principles and Options The optimizer uses gradient-based optimization algorithms that use a finite difference method to approximate the gradients (gradients are not known analytically). To implement finite differencing, the optimizer: 1 Perturbs each parameter in turn from its current value by an amount h. 2 Evaluates the function at the perturbed value. 3 Subtracts the old function value from the new. 4 Divides the result by h. Note There is a tradeoff.
Default Options To control parameter perturbation when calculating derivatives 1 Enter a value in the Delta text box that defines a fraction of the parameter’s total range. Example: If a parameter has a current value of 10–8, and Delta is set to 1% (the default), then the PSpice Optimizer perturbs the parameter by 10–10. The 1% default value is suitable for the accuracy of typical simulations.
4-16 Understanding Optimization Principles and Options Specifying a Probe Display (Probe File and Display Options) The Display option defines the name of the Probe display the PSpice Optimizer uses to display simulation results. The Probe File option specifies a nondefault .prb file in which the Probe display information has been stored. To use a specific Probe display when optimizing Refer to online Help in Probe for information on using Probe Display Control options.
Advanced Options 4-17 Advanced Options This section describes the advanced configuration options for the PSpice Optimizer. To display the Advanced Options dialog box 1 From the Options menu, select Defaults. 2 Click the Advanced Options button. Controlling Cutback (Cutback Option) The PSpice Optimizer saves option settings to the .opt file so that they remain with the optimization’s parameter and specification settings.
4-18 Understanding Optimization Principles and Options show discontinuous behavior for small parameter changes. This can be caused by accumulation of errors in iterative simulation algorithms. Goal Function Figure 4-4 demonstrates a typical case. The effect of the glitch is serious—the optimizer can get stuck in the spurious local minimum represented by the glitch. Glitch The optimizer’s threshold mechanism limits the effect of unreliable data.
Advanced Options Choosing an Optimization Method for Single Goal Problems (Least Squares/ Minimization Options) The PSpice Optimizer implements two general classes of algorithm to measure design performance: least squares and minimization. These algorithms are applicable to both unconstrained and constrained problems.
4-20 Understanding Optimization Principles and Options To set the optimization method for a single goal 1 Do one of the following: • Click the Least Squares button to minimize the square of the deviation between measured and target value. • Click Minimize to reduce a value to the smallest possible value. If your optimization problem is to maximize a single goal, then set up the specification to minimize the negative of the value. Example: To maximize gain, set up the problem to minimize –gain.
Tutorial: Optimizing a Design (Passive Terminator) 5 Tutorial Overview The following tutorial takes you through the steps needed to setup and run an optimization starting with the simple terminator example provided with your MicroSim programs. In this tutorial, you will: • Verify the schematic setup: • Check that component values are parameterized. • Check that optimization parameters are defined. • Check the analysis settings. • Check the goal specification settings. • Run the optimization.
5-2 Tutorial: Optimizing a Design (Passive Terminator) The Passive Terminator Design Figure 5-1 shows a simple terminator that you could use, for example, for one line of a backplane. The top end of R1 connects to a +5 v DC supply; the lower end of R2 connects to ground. The center point of the two resistors provides the line termination. This design must meet two specifications: • Voltage at the junction of the two resistors (Vcenter) must lie within a specified range.
Loading the Design into Schematics 5-3 Loading the Design into Schematics To begin, set up a schematic with: • parameters for the resistor values, and • a way to measure the performance of the two specifications. Your MicroSim installation includes a schematic for the passive terminator design. To load the passive terminator schematic 1 From the Windows 95 Start menu, select the MicroSim program folder and then the Schematics shortcut to start Schematics. 2 From the File menu, select Open.
5-4 Tutorial: Optimizing a Design (Passive Terminator) Setting Component Values to Expressions The parameters varied between iterations must relate to the components you are optimizing. For this example, R1 and R2 resistor values are already parameterized. To see how the resistor values are set up to use optimization parameters The curly braces are PSpice syntax for an expression. You can specify any expression that PSpice can evaluate. 1 Double-click the symbol graphics for R1 or R2.
Defining Optimization Parameters 5-5 Defining Optimization Parameters Next, set up the optimization parameters that the PSpice Optimizer will vary between iterations; these are the same parameters used in the value expressions for R1 and R2. For this example, R1val and R2val are already defined using an OPTPARAM symbol as shown below. To see the settings for R1val and R2val 1 On the schematic, double-click OPTIMIZER PARAMETERS. By default, the settings for R1val are displayed.
5-6 Tutorial: Optimizing a Design (Passive Terminator) Defining the Analysis Type For each specification, set up an analysis which PSpice will run for each iteration of the optimization. This example is already set up for a 1-point DC analysis, with the supply set to 5 V. To see the analysis settings 1 From the Analysis menu, select Setup. 2 Click DC Sweep and verify the settings. 3 Click Cancel to return to the Analysis Setup dialog box. 4 Verify that DC Sweep is the only enabled analysis.
Activating the PSpice Optimizer Activating the PSpice Optimizer Assuming the circuit simulated successfully, you are now ready to activate the PSpice Optimizer and complete optimization setup. To activate the PSpice Optimizer 1 In Schematics, from the Tools menu, select Run Optimizer. The PSpice Optimizer window displays the current optimization file, term.opt, in the title bar. The two parameters, R1val and R2val, appear in the parameters area.
5-8 Tutorial: Optimizing a Design (Passive Terminator) Viewing the Parameter Description The PSpice Optimizer automatically loads the parameter descriptions defined earlier in Schematics. To verify the parameter descriptions 1 From the Edit menu, select Parameters. 2 To see R1val settings. a In the Parameters list, click R1val. b Click Change to display the Edit Parameter dialog box. 3 Click Cancel to leave the parameter unchanged. 4 Optionally repeat steps 2 and 3 for R2val.
Defining the Goals and Constraints Defining the Goals and Constraints To review, the specifications for this example are: • Voltage, Vcenter , at the junction must be 3.75±0.1 V. • Thevenin equivalent resistance, Requiv, must be 100±1 Ω. One way to handle the optimization problem is to treat both specifications as a goal.
5-10 Tutorial: Optimizing a Design (Passive Terminator) Notice that Vc is described as a goal (Constraint check box is cleared). The analysis type is DC and the evaluation to measure performance is the trace function V(Vc)—as in the preliminary test simulation. 3 Click Cancel to leave the specification unchanged. 4 To see the settings for the Rt goal, click Rt, then click Change. Again, the analysis type is DC, and the evaluation to measure performance is the trace function V(Vr).
Checking that the Design Will Simulate 5-11 Checking that the Design Will Simulate Before running a full optimization, you should run a single iteration to make sure the design still simulates (by selecting Update Performance from the Tune menu). The PSpice Optimizer performs the simulations and trace function evaluations required to find the current value for each active specification, and updates their initial values. For this example, an initial iteration has already been run.
5-12 Tutorial: Optimizing a Design (Passive Terminator) The optimizer repeats this process until it achieves success, failure, or you terminate the process (from the Tune menu, point to Auto and select Terminate). For this example, let the process run to completion. This takes 5 more simulations. As the optimization proceeds, the vertical gauge and numeric display fields in the error gauge area (far left in the PSpice Optimizer window) show updated values.
Changing a Goal to a Constraint 5-13 Changing a Goal to a Constraint Try examining what happens when you change one of the specifications from a goal to a constraint. For an example, see See Goals versus Constraints on page 4-2 for more information. To change a goal to a constraint 1 Edit a specification: a In the PSpice Optimizer window, double-click the hotspot (lower right-hand corner) in either the Vc or Rt specification box. b Select the Constraint check box.
Tutorial: Exploring Design Tradeoffs (Active Filter) 6 Tutorial Overview The following tutorial shows you how to use the PSpice Optimizer to explore design tradeoffs. Using the simple active filter example provided with your MicroSim programs, you will: • Review the optimization setup in Schematics: parameter definitions and parameterized expression assignments. • Review the goal and constraint setup in the PSpice Optimizer. • Change a parameter value to see the effect on goal and constraint values.
6-2 Tutorial: Exploring Design Tradeoffs (Active Filter) The Active Filter Design The filter has three adjustable resistors. These resistors adjust center frequency, bandwidth, and gain. In this case, the adjustments are interdependent. Requirements for the filter are: • Center frequency (Fc) must be 10 Hz with 1% accuracy. • 3 dB bandwidth (BW) must be 1 Hz with 10% accuracy. • Gain (Gain) must be 10 with 10% accuracy.
The Active Filter Design 6-3 The Parameters The three variable resistors—Rfc, Rbw, and Rgain—are implemented as potentiometers. The potentiometer symbol has an attribute called SET which describes the slider position—a value between 0 and 1. To optimize slider position, the optimization parameters afc, aBW, and AGain are assigned to the SET attribute for the symbols Rfc, Rbw, and Rgain, respectively. The parameters are shown in the OPTPARAM symbol on the schematic.
6-4 Tutorial: Exploring Design Tradeoffs (Active Filter) The PSpice Optimizer window shows the three parameters (aFc, aBW and aGain) and the three corresponding goals (Fc, BW, and Gain). The goals are defined as follows: Setting Center Frequenc y Bandwidt h Gain Name Fc BW Gain Target 10 1 10 Range 0.1 0.
Testing Performance 6-5 Testing Performance Initial performance has already been measured for the active filter ensuring that the design simulated as expected, that current values for the goals were calculated, and that initial values were updated. Initial performance calculated to: Goal Current/Initial Value Target Value Fc 8.322 Hz 10 Hz BW 0.7122 Hz 1 Hz Gain 14.
6-6 Tutorial: Exploring Design Tradeoffs (Active Filter) Tweaking Parameters Once the derivatives are calculated, you can use the PSpice Optimize to explore how small changes in the parameters affect the performance of the design. To examine the performance effect when changing aGain from 0.5 to 0.4 new parameter value updated goal values 1 Highlight the current value for aGain, and type 0.4. 2 Press J. The value of the Gain specification changes from the initial value of 14.
Testing Performance Tweaking Goals and Constraints The PSpice Optimizer gives you the advantage of doing something not possible on the bench: changing the performance results and seeing what parameter values would produce these results. To investigate the parameter changes when changing Gain to a new target value of 10. 1 Make sure that automatic recalculation is selected. a From the Options menu, select Recalculate. b In the When frame, click Auto. c Click OK.
6-8 Tutorial: Exploring Design Tradeoffs (Active Filter) Completing Optimization To finish exploring the active filter design, run an optimization. To start optimizing 1 From the Tune menu, select Auto and click Start. The PSpice Optimizer finds a set of parameters for which the specifications are met. Figure 6-2 shows the results.
Tutorial: Using Constrained Optimization (MOS Amplifier) 7 Tutorial Overview The following tutorial shows you how to use the PSpice Optimizer to set up and run constrained optimization. Using the MOS amplifier example provided with your MicroSim programs, you will: • Review the optimization setup in Schematics: parameter definitions and parameterized expression assignments. • Review the goal and constraint setup in the PSpice Optimizer including the evaluations used to measure performance.
7-2 Tutorial: Using Constrained Optimization (MOS Amplifier) The CMOS Amplifier Design For this optimization, the CMOS amplifier requirements are: • Minimize power consumption. • Maintain gain at 20. • Maintain 3 dB bandwidth at 1 MHz or greater. To load the CMOS amplifier design 1 From the Windows 95 Start menu, select the MicroSim program folder and then the Schematics shortcut to start Schematics. 2 From the File menu, select Open. 3 Move to the directory containing m2.
The CMOS Amplifier Design The Parameters For this example, there are three circuit values that you must optimize, and three corresponding parameters that the PSpice Optimizer will vary: • channel length for M1 (W1) • channel width for M1 (L1) • bias current for M3 and M4 (Iref) Parameterized expression assignments In the schematic, you can see the parameterized component values for MOSFET M1 (W={W1}, L={L1}) and the current source I1 ({Iref}).
7-4 Tutorial: Using Constrained Optimization (MOS Amplifier) To display the Optimizer Parameters dialog box, doubleclick the OPTPARAM symbol in the schematic.
The CMOS Amplifier Design Gain The amplifier design is set up to measure the spot gain at 1 kHz (assuming that the bandwidth is much greater than this) by performing an AC analysis and then applying the Probe goal function: YatX(V(Vout), 1k) to the simulation results. YatX is provided with your MicroSim programs.
7-6 Tutorial: Using Constrained Optimization (MOS Amplifier) The Goals and Constraints The example circuit is set up with predefined goals and constraints which you can view using the PSpice Optimizer. To activate the PSpice Optimizer 1 In Schematics, from the Tools menu, select Run Optimizer. The PSpice Optimizer window shows the three parameters (W1, L1, and Iref) and the three specifications. Power is defined as a goal, and gain and bandwidth are defined as constraints as shown below.
Setting the Method for a Single-Goal Optimization The Power settings as they appear in the Edit Specification dialog box are shown below. 7-7 To display the Edit Specifications dialog box, double-click the lower right-hand corner of the specification box of interest in the PSpice Optimizer window. double-click here When finished browsing, click Cancel.
7-8 Tutorial: Using Constrained Optimization (MOS Amplifier) Performing the Optimization You are now ready to run the optimization. To optimize the amplifier design 1 From the Tune menu, select Update Performance to calculate initial performance. The results are as shown in Figure 7-2. Figure 7-2 Updated Performance Values for the Amplifier Example 2 From the Tune menu, select Update Derivatives to compute the partial derivatives of each goal and constraint with respect to each parameter.
Performing the Optimization Notice that the performance indicators change as the optimization proceeds. When complete, optimized values should appear as shown in Figure 7-3. Figure 7-3 Optimized Values for the Amplifier Example This optimization stops after reaching the maximum number of allowed iterations. Even so, power consumption is minimized (the objective) within the iteration limits.
Tutorial: Fitting Model Data (Bipolar Transistor) 8 Tutorial Overview The following tutorial shows you how to use the PSpice Optimizer to fit a parameterized model to a set of measured data points. Using the bipolar transistor example provided with your MicroSim programs, you will: • Review the bipolar transistor test case: schematic, parameter definitions and parameterized expression assignments, analysis, and external file with measured data. • Review the goal setup in the PSpice Optimizer.
8-2 Tutorial: Fitting Model Data (Bipolar Transistor) Using the PSpice Optimizer to Fit Data to Model Parameters The PSpice Optimizer can fit a parameterized model to one or more sets of data points. The source for this external data might be: • Results from measuring a real device (e.g., using a semiconductor curve tracer). • A manufacturer’s data sheet. • A PSpice simulation. To fit a model using the PSpice Optimizer, you need a text file containing the measured values and the measurement points.
The Bipolar Transistor Test Case 8-3 The Bipolar Transistor Test Case This tutorial fits parameters to a bipolar transistor (BJT) model using measured data for Ic and Ib versus Vbe at constant Vce. To load the BJT design 1 From the Windows 95 Start menu, select the MicroSim program folder and then the Schematics shortcut to start Schematics. 2 From the File menu, select Open. 3 Move to the directory containing bjtpar.
8-4 Tutorial: Fitting Model Data (Bipolar Transistor) The Parameters Refer to Q devices in the online The model parameters to fit are: Is, Ikf, Br, Bf, Ise, and Ne. These parameters are a subset of the parameters PSpice uses to determine the BJT’s DC characteristics. (To fit all of the BJT model parameters, you would need more measured data than is provided in this tutorial.) MicroSim PSpice A/D Reference Manual for more information on the parameters used for bipolar transistor models.
The Bipolar Transistor Test Case The Analysis The BJT example is set up for a DC sweep of the voltage source which provides a range of values for Vbe. These values should match the measurement points contained in the external data file. Ic and Ib are measured at values of Vbe starting from 0.4 V, incrementing by 0.01 Vto a maximum of 0.82 V. The External File of Measured Data There are two measured curves: Ic and Ib. Each of these has an associated PSpice Optimizer specification.
8-6 Tutorial: Fitting Model Data (Bipolar Transistor) The Goals and Constraints The example circuit is set up with predefined goals which you can view using the PSpice Optimizer. To activate the PSpice Optimizer 1 From the Tools menu, select Run Optimizer. The PSpice Optimizer window shows the six parameters (Is, Ikf, Br, Bf, Ise, and Ne) and the two specifications (Ic and Ib). Ic and Ib are defined as a goals as shown below.
The Bipolar Transistor Test Case Mappings to the external data file Note the reference to the external data file, 3055.mdp, and the values assigned to X Column Name and Y Column Name. The column values map to the column names defined in 3055.mdp, such that the X column gives the data points at which the Y column values were measured. For the BJT example, the Y column contains measured collector current corresponding to the specified base-emitter voltages in the X column.
8-8 Tutorial: Fitting Model Data (Bipolar Transistor) Example: If Evaluate is set to YatX(Ic(Q1),!) and if the X column of the external data file contains the values (1v, 2v, 3v), then the PSpice Optimizer will form the Probe goal function expressions YatX(Ic(Q1),1v), YatX(Ic(Q1),2v), and YatX(Ic(Q1),3v), and send each one to Probe for evaluation against the simulation results.
Monitoring Progress with Probe 3 8-9 Define the display configuration to use when optimizing. For the BJT example, this is predefined. To verify the display name: a In the PSpice Optimizer, from the Options menu, select Defaults. The display name, icibe, appears in the Display text box and the DC analysis type is selected. b 4 When finished, click Cancel. Measure performance and redisplay the traces in Probe: a In the PSpice Optimizer, from the Tools menu, select Update Performance.
8-10 Tutorial: Fitting Model Data (Bipolar Transistor) Fitting the Data The PSpice Optimizer looks for a set of parameters which minimizes the total squared error between the measured and simulated curves. When using external data, the optimizer uses the relative error at each measured point. This means that all points have equal weight, regardless of the absolute value. This is essential for fitting semiconductor curves, where the currents may range over many orders of magnitude.
Fitting the Data Figure 8-3 Optimization Results for the BJT Model Fitting Example The Probe plot in Figure 8-4 compares fitted and measured curves, and shows the percent relative error in Ic and Ib.
Error Messages A Appendix Overview This appendix lists and explains the error messages you might encounter while using the PSpice Optimizer, and, where appropriate, what action to take.
A- 2 Error Messages Error Message Descriptions Table 8-1 Error Message Descriptions Error Message Description [11002] No More Resets No improvement was made by going back to the last good step and recalculating derivatives. Try refining the specifications. [11003] Mismatched Parentheses Check for mismatched parentheses in the evaluation expression. [11004] Undefined Symbol A symbol in a PSpice Optimizer expression was not recognized.
Error Message Descriptions A-3 Error Message Description [11011] Can't Start Probe Try running Probe (with the PSpice Optimizer window still open). From the Windows 95 Start menu, select the MicroSim program folder and then the Probe shortcut. Open a .dat file after simulation. Observe any messages that come up. Here are typical problems and resolutions: • “insufficient memory”; at least 8 MB is required and 16 MB is recommended. • “Can not obtain a license”.
A- 4 Error Messages Error Message Description [11020] Evaluation Field Required The Evaluate text box in the Specification dialog box must contain a valid Probe output variable, Probe goal function, or PSpice Optimizer expression. Refer to application examples in the your PSpice user’s guide. [11021] Column Name Required The first line of an external data file must contain names for each column of data.
Error Message Descriptions A-5 Error Message Description [11033] Need At Least 1 Enabled Goal At least one goal must be used in an optimization. An optimization can not be performed with constraints only. [11034] Max External Items = 250 A maximum of 250 lines of data can be used in the external data file. [11035] Missing External Column The first line of an external data file must contain names for each column of data.
File Types Used by the PSpice Optimizer B Appendix Overview This appendix describes how MicroSim programs, used to capture and optimize your design, interact and share information with each other. File and Program Relationships on page B-2 illustrates and describes the data flow amongst MicroSim programs. File Type Summary on page B-6 explains the contents of each file type.
B- 2 File Types Used by the PSpice Optimizer File and Program Relationships MicroSim Schematics .opt .cir .mdp external data optimization MicroSim setup PSpice Optimizer circuit description .par MicroSim Probe goal function descriptions .prb evaluations optimization parameters MicroSim PSpice A/D simulation results .
File and Program Relationships Typically, you capture your design using Schematics and use this as the basis for optimization with the PSpice Optimizer. Each schematic produces a single circuit file (design_name.cir) which is created when either you: • select Create Netlist or Simulate in the Analysis menu, or • select Run Optimizer in the Tools menu. In the latter case, Schematics also produces: • An optimization file (design_name.
B- 4 File Types Used by the PSpice Optimizer Measuring Performance Using Information in the Circuit File and .prb File Remember that for a simulation-based optimization, you must define how to evaluate performance. This means that, for each specification (goal or constraint), you must define the following. What circuit file to use Typically, an optimization uses only one schematic/circuit file—based on the schematic that is active when you activate the PSpice Optimizer.
File and Program Relationships B-5 Defining Specification Criteria in the External Data File The external data file contains the measured data used in the optimization (e.g., when fitting data to model parameters). Data is formatted as labeled columns of values. Typically, the first column contains the independent values at which all other data was measured; this corresponds to the X Column Name in the optimizer’s Edit Specification dialog box.
B- 6 File Types Used by the PSpice Optimizer File Type Summary Table 8-2 briefly describes all of the file types that the PSpice Optimizer uses directly. Table 8-2 Summary of PSpice Optimizer-Related File Types File Type Source Description .cir .net .als generated by Schematics or user-entered with a text editor Circuit file, netlist file, and alias file, respectively. Define components and connectivity, analysis directives, and simulation control directives for the circuit.
Optimizing a Netlist-Based Design C Appendix Overview This appendix describes how to set up and run an optimization for a design defined in a circuit file. Optimizing without a Schematic on page C-2 gives an overview on optimizing a netlist-based design. Setting Up the Circuit File on page C-3 describes the steps that you must complete using a text editor to parameterize the circuit file for optimization.
C- 2 Optimizing a Netlist-Based Design Optimizing without a Schematic Although the PSpice Optimizer is designed to optimize a Schematics-based design, you can optimize a design for which a netlist, but no schematic, is available. To optimize your design without using Schematics 1 Implement your design as a circuit file in PSpicecompatible format. 2 Create a separate file containing the optimization parameter definitions.
Setting Up the Circuit File Setting Up the Circuit File To use the PSpice Optimizer to optimize a design defined as a netlist 1 Decide on the design parameters you want the optimizer to vary. 2 Place parameter definitions (.PARAM) in a separate parameters file (.par). 3 Include the parameters file in the circuit file using the .INC command. 4 Replace component values that are dependent on the parameters with expressions.
C- 4 Optimizing a Netlist-Based Design To make the parameter definition in the .par file available to PSpice 1 Insert a .INC command anywhere after the first line of the circuit file using the syntax: .INC parameters_file_name where parameters_file_name is the same file in which you entered the .PARAM statements for the circuit. Example: To myamp.cir, add the following statement anywhere after the first line in the file: .INC “myamp.
Setting Up and Running the PSpice Optimizer 3 C-5 Add a specification definition for each goal and constraint: a From the Edit menu, select Specifications. b Click Add. c Fill in the dialog box. In the Analysis frame, be sure to enter the name of the circuit file you parameterized earlier. 4 Run the optimization. a From the Tune menu, select Update Performance. b From the Tune menu, select Auto and click Start.
C- 6 Optimizing a Netlist-Based Design Example: Parameterizing the Circuit File The following circuit file (call it dbias.cir) contains the netlist for a voltage source/resistor/diode series combination. * diode bias circuit .LIB V1 1 0 5v R1 1 2 5k D1 2 0 D1N914 .DC V1 LIST 5V .Probe .END Suppose you want to optimize the bias current in a voltage source/resistor/diode series combination. Specifically, your goal is to achieve a current of 1 mA through the diode.
Index Symbols !, 3-17 .als file, B-6 .cir file, B-3, B-6 .dat file, 4-11 .mdp file, B-5, B-6 .net file, B-6 .olg file, 3-28, B-6 .oot file, 3-27, B-6 .opt file, 3-2, 3-30, B-3, B-6 .par file, B-3, B-6, C-3 .
Index-2 including a parameters file (netlist-based design), C- 4 Circuit File text box, 3-15 component values tolerance, 3-29 using standard, 3-29 constraint, 1-6, 1-8 active, 4-6 bound, 4-4 compared to goals, 4-2 equality, 4-5 inactive, 4-6 inequality, 4-4 nonlinear, 4-4 progress indicator, 3-7 target value, 1-7 See Also specification Constraint check box, 3-14 convergence, 4-9 Copy, Parameters command (Edit menu), 3-11 Copy, Specifications command (Edit menu), 3-16 current value changing interactively, 3
Index-3 MOS amplifier, 7-1 parameterizing a diode-biasing circuit file, C-6 passive terminator, 5-1 exploration, design, 3-20 active filter example, 6-1 ensuring reliable results, 3-24 tweaking values, 3-21 expression, PSpice Optimizer, 1-9, 1-10 external data file (.
Index-4 N Name text box, 3-11, 3-14 netlist file (.net), B-6 netlist-based design, C-2 New command, File menu, 3-4 nonlinear constraint, 4-4 O Open command, File menu, 3-4 opt_0.dat file, B-6 opt_1.dat file, B-6 optimization, 1-5 aborting, 3-19 adding/editing parameters and specifications, 3-25 and specification functions, 4-7 choosing least squares or minimization, 4-19 constrained least squares, 1-5 constrained minimization, 1-5 constrained vs.
Index-5 creating for netlist-based designs, C-3 including in a circuit file (netlist-based design), C-4 Parameters, Recalculate command (Options menu), 3-23 performance, 1-8 derivative calculations, 3-21 evaluating, 3-19 excluding parameter and specifications, 3-24 measuring when adding/editing parameters and specifications, 3-25 recalculating automatically, 3-22 manually, 3-23 saving results, 3-30 scaling measured values, 4-12 tweaking values, 3-21 Print command, File menu, 3-28 Probe, 1-4, 1-9 .
Index-6 current value, 3-7 initial value, 3-7 internal current value, 3-6 initial value, 3-6 progress indicator, 3-7 progress indicator, 3-7 Start command, Auto submenu (Tune menu), 3-19 starting points and global and local minima, 4-8 and parameter bounds, 4-10 feasible, 4-5 improving convergence, 4-9 infeasible, 4-5 Store Values command, Edit menu, 3-26 subgoal progress indicator, 3-7 T Target text box, 3-14 target value, 1-7 scaling raw measurements, 4-12 Terminate command, Auto submenu (Tune menu), 3-1