How To Create New Part In Orcad Capture
Kraig Mitzner , ... Dirk Müller , in Complete PCB Design Using OrCAD® Capture and PCB Editor (Second Edition), 2019
Method 4. Generating parts with the PSpice Model Editor
You can use the PSpice Model Editor to make Capture parts that can be used in schematic designs, circuit simulations, and PCB layouts. The difference between using the PSpice Model Editor and the Generate Part method (Method 3) is that you can work directly on and with the PSpice models with the Model Editor.
Start the PSpice Model Editor. Go to All Programs → Cadence Release 17.2-2016 → Model Editor. If there are multiple licenses available that could start the Model Editor, you will need to select a license option, such as PSpice A/D, and the proper editor, such as Capture. You will begin with a blank Model Editor session window. To open an existing PSpice library ( name .LIB), select Open from the File menu and navigate to /tools/PSpice/library. Select one of the libraries (e.g., bipolar.lib) and click Open; then select one of the models from the model list. Fig. 7.35 shows the Q2N696 BJT transistor model from the bipolar library. The Models List window pane shows all of the simulation models contained in the library, and it tells you whether it is a primitive model or a subcircuit model. The text window under the Models List displays the "code" that describes the selected model.
You can construct new models by using existing model listings as examples and/or the model descriptions found in the PSpice reference guide. The following sections describe how to download primitive models (models beginning with .model) from the Internet and how to create your own subcircuit models (models beginning with .subcircuit). The models can then be added to a PSpice library from which you can generate Capture part libraries as described. Creating custom primitive models is not described here.
Generating a Capture Part Library from a PSpice Model Library
Beginning with a PSpice library (.lib) open in the Model Editor (similar to Fig. 7.35), select Export to Part Library… from the Model Editor's File menu. You will be presented with the Create Parts for Library dialog box shown in Fig. 7.36. In the Enter Input Model Library: text box, use the Browse… button to find the PSpice library (*.LIB) for which you want to make parts. Use the second Browse… button to specify the location for the new Capture library (*.OLB). Remember that the PSpice models and the libraries that contain them are usually stored in the /tools/PSpice/library path, while the Capture parts that use the models are stored in the /tools/capture/library/PSpice path. Click OK once you have the input and output libraries and paths specified.
Note: A Capture part library (bipolar.olb) already exists in the /tools/capture/library/PSpice folder for the bipolar PSpice Model Library (bipolar.lib). The bipolar library is used here for demonstration purposes. If you perform the following procedure on an existing library, save the new library to a temporary or user folder so that you do not overwrite the existing library.
When the Model Editor has finished, it will display an information box similar to the one in Fig. 7.37. If the Model Editor is successful at generating the Capture part library, the last line will say 0 Error messages, 0 Warning messages. Click OK to close the information box.
The PSpice Model Editor generates Capture parts with correctly named and numbered pins, but the parts are generic boxes because the PSpice Model Editor describes only how the parts function, not what they look like. You need to use the Capture Part Editor to modify the graphical appearance of the parts, as described in the earlier examples. To view the new part library, start Capture and select Open → Library… from the File menu in the Capture session frame.
Making and/or obtaining PSpice libraries for making New Capture parts
Before you send a final board design to be manufactured, at some point in the design process you will want to simulate your design. A detailed explanation of PSpice model development and simulation process is outside of the scope of this text and many references are available on the subject. But in the interest of completeness, a brief explanation of how to add PSpice models to your Capture parts is discussed here.
PSpice contains many libraries, but manufacturers continually design new parts, which may not be included with your version of PSpice, so eventually you will want to be able to develop your own Capture parts that have simulation capabilities (and ultimately will be used in a board design).
A PSpice library contains primitive models (such as resistors and diodes) and subcircuit models (such as logic gates and op amps). Primitive models are basically limited to behavioral descriptions of single devices. Subcircuit models can describe the behavior of a single device, multiple devices, or complete circuit designs. Unless specifically noted, model in this text refers to both primitive and subcircuit models in general.
With regard to PSpice model libraries the models that the libraries contain begin as simple text files that have a .mod extension. A model is added to a library by importing it into the PSpice (.lib) library. Once the model is imported into the library, the original .mod file is no longer needed and can be deleted or archived in a separate folder.
Downloading libraries and/or models from the Internet
The easiest way to make a new PSpice model library is to download it from the manufacturer's website (when available). You can often download complete libraries, but sometimes OEMs (original equipment manufacturers) provide only individual models that you can add to your own libraries.
Here is an example. Suppose you were to use an RS2A fast recovery diode (Diodes Incorporated) in your design and need its PSpice model. By going to the Diodes Incorporated website (www.diodes.com/products/spicemodels/index.php), you can obtain the model for the RS2A diode as shown in Fig. 7.38. Copy the text as is from the Internet Explorer window and paste it into any simple text editor such as Notepad. Save the text file with a .mod file extension (e.g., RS2A.mod) to a convenient folder that is set up for your collection of model files.
Next start a new PSpice library for Diodes Incorporated parts. From the PSpice Model Editor File menu choose New. You will be presented with a blank Models List window pane and an unsaved library (Untitled1.lib). From the Model menu, choose Import. From the Open File dialog box, navigate to and select the RS2A.mod file. Click Open. The Models List window should now contain the new model as shown in Fig. 7.39. Save the new library in a user folder with a name such as DiodesInc.lib (select Save As… from the File menu). You now have a PSpice library (with only one part in this case) for which you can make a new Capture part.
Making a PSpice Model from a Capture project
In the event that a PSpice model (or even a generic spice model) cannot be located, you can make your own *.mod file. There are two ways to do this, depending on the type of model you are trying to make. If you need to make a primitive model for a device (e.g., a diode or P-channel MOSFET transistor), you need to compose a .mod file using a text editor then import the model into a library as just described. To make an accurate model, you need to be familiar with model parameters for the part and the "code" that PSpice understands. This is not described here, but you can read about the details in the PSpice Reference Guide. As a starting point you can also look at examples from the PSpice Breakout library (breakout.lib).
If you need to make a model for a nonprimitive part (an IC or a transformer, for example), you can compose a subcircuit model without having extensive knowledge of model parameters or PSpice code. You simply "draw" the circuit using Capture, have Capture write the subcircuit model for you, then save it as a PSpice library. Once you have the .LIB file, you can use Method 3 or 4 to make a Capture part with the model attached to it and attach a PCB Editor footprint if so desired.
An example of how to make a PSpice model and subsequent Capture part is given here for a transformer with a single primary winding and a center-tap secondary, similar to the one in Fig. 7.3 (except that the transformer in this example has a PSpice model—a PSpiceTemplate property—associated with it). Using this procedure you can specify the inductance and DC resistance of the windings and the coupling between the windings for a specific part as described in a data sheet.
The basic process is as follows:
- 1.
-
Use Capture to draw a circuit that you can simulate. The circuit will consist of inductors, resistors, and coupling coefficients.
- 2.
-
After the transformer "circuit" is simulated to verify it behaves correctly, simulation sources are deleted, and hierarchical ports are added to the schematic, which will become the leads (pins) of the transformer.
- 3.
-
Use Capture to create a PSpice library netlist file (.lib) for the circuit. Method 3 or Method 4 is used to generate a Capture part from the .lib file. In this example, we use Method 4 so that we can look at and modify the model prior to making a Capture part for it.
To make a .subcircuit model, open Capture and choose New → Project… from the session frame's File menu. From the New Project dialog box, choose PSpice Analog or Mixed A/D as shown in Fig. 7.40.
Select the location of the new project using the Browse… button at the bottom of the dialog box. If you plan on making more models in the future, it is a good idea to create a new folder just for model development. Once you have your models fully developed and tested, you can copy the finished libraries into the normal Capture and PSpice library folders.
After you click OK, the Create PSpice Project dialog box (Fig. 7.41) will be displayed. Check the Create based upon an existing project radio button and select either the empty.opj or the simple.opj project template. Different templates may be displayed depending on which version you have. For what we are going to do in this example, it really does not matter which template you start with. Click OK.
In the Project Manager window, expand the Design (.dsn) icon if it is not already expanded, and double click the SCHEMATIC1 folder (see Fig. 7.42). The name of the design (DesignName.dsn) will become the default name of the PSpice library (DesignName.lib), and the name of the root folder (FolderName) will become the name of the PSpice part model (.subcircuit FolderName…), so you want to change the name of the folder from SCHEMATIC1 to the name you wish for your part.
To rename the schematic folder, select the folder by left clicking once, then right click, and select Rename from the pop-up menu. Change the name of the schematic folder to the name that you want the part to have (e.g., S_Pri_CT_Sec for single-winding primary, center-tap secondary).
Double click on the PAGE1 icon to display the schematic page (see Fig. 7.42). Delete any parts or text provided by the template by dragging a box around (or across) the parts to highlight them, then hit the Delete key on your keyboard.
Place part buttonPlace four resistors from the Analog library (which have PSpice models associated with them) on the schematic page (see Fig. 7.45 later). The resistors are used to simulate the DC resistance of the windings and a dummy load resistor (RL). You can get the resistors from the Place Part dropdown list located on the toolbar at the top of the window frame or by selecting the Place Part button,
, on the toolbar at the right of the schematic page. If you use the Place Part button, you will be presented with the Place Part dialog box shown in Fig. 7.43. Select ANALOG from the Libraries: list then scroll down the Part List: and select part R. Notice that the parts in the Analog library have PSpice models and footprints associated with them, as indicated by the PSpice and PCB Editor icons located under the part preview box in the lower right corner of the dialog box. Click OK. Click on the schematic page in four places to place four resistors (see Fig. 7.45 later for reference).
Repeat this procedure to place three inductors (part L) on the schematic page. One inductor serves as the primary winding, and the other two serve as the secondary windings. The inductors will be used to define the inductance (the turns ratios) of the primary and secondary windings.
Next, place one K_Linear part from the Analog library on the schematic page. K_Linear defines the coupling coefficient of the windings.
Place a VSIN part on the schematic page so that we can test the operation of the transformer. VSIN is located in the SOURCE library.
Place Ground toolFinally, place three zero (0) ground references on the schematic page. Click the Place Ground tool,
, then select 0/SOURCE from the Place Ground dialog box, as shown in Fig. 7.44. If you don't see SOURCE in the Libraries list, push Add Library... button and select /PSpice/source.olb to add it. For schematic entry and PCB Editor, you can use any ground symbol, but for PSpice simulations you have to have at least one 0 reference ground.
Position and rename the components, wire the circuit, and change the values of the components as shown in Fig. 7.45. To change the reference designators (e.g., R1 or Rp1) or the component values (e.g., 10 Ω), double click the property you want to change. In the Display Properties dialog box, enter the appropriate value and click OK.
You can also modify a part's properties by double clicking the part (or click once to select it then right click and select Edit Properties… from the pop-up menu). A Property Editor spreadsheet will pop up, as shown in Fig. 7.46. If the properties are listed across in rows instead of vertically in columns, you can change the view by selecting the upper left-hand (corner) cell to highlight the entire spreadsheet, then right click and select Pivot from the pop-up menu. You can also specify how many items are listed by using the Filter by: dropdown list just above the spreadsheet cells. To display all pertinent properties, select the <Current properties> option located at the top of the list.
To modify and display the K_Linear coupling properties, double click the coupling part to bring up the spreadsheet. Make sure that either the Current properties or the OrCAD-PSpice filter option is selected. In the L1 cell, type Lp1 (or whatever you named your primary coil) then click the Display button, which is located just above the spreadsheet cells, to enable displaying Name and Value of this property. Enter Ls1 in the L2 cell and Ls2 in the L3 cell and click the Display button for both of these parameters too. The L1, L2, and so on cells establish which coils are coupled as part of the transformer. You can have additional or separate coupling coefficients for different sets of coils, but for this example we have all three equally coupled together using the single linear coupler. Once you finish, close the spreadsheet by clicking the X button in the upper right-hand corner of the spreadsheet.
Now we need to simulate the part with PSpice. You can perform several types of simulations with PSpice. In this example, we perform a time-domain analysis so that we can see the AC waveforms at the input of the transformer and at the RL.
To test the circuit we need to set up a simulation profile. To set up a simulation profile, choose Edit (or New) Simulation Profile from the PSpice menu. In the Simulation Settings dialog box (see Fig. 7.47), select the Analysis tab. In the Analysis type: dropdown list, select Time Domain (Transient). Set the rest of the parameters as shown in Fig. 7.47, then click OK.
Place voltage markers on the circuit to specify which voltages to display in the PSpice probe window. Click the Voltage/Level Marker probe button,
, on the toolbar and place a probe on the wire coming from VSIN (green marker) and one (red marker) on the wire going from the secondary winding to the RL.Start the simulation by clicking the Run PSpice button,
. PSpice runs the simulation and displays the results in a probe window, as shown in Fig. 7.48. The voltage curves show that the transformer functions as a 1:2 step-up transformer, since the output (red marker curve) is twice as high as the input (green marker curve). Additional tests (e.g., frequency response) could be performed to validate the circuit model further, but these are not discussed here.
Since the circuit model has been validated, we now prepare to make a PSpice model of the circuit. Begin by deleting the VSIN source, the RL, and all the ground references.
Place Port toolAdd ports to the schematic, which will serve as the leads of the transformer. Click the Place Port tool,
. Select the PORTBOTH-L port from the Place Hierarchical Port dialog box, as shown in Fig. 7.49. All the port symbols behave identically in Capture, PSpice, and PCB Editor. The only difference is the appearance on the schematic. Since the transformer is a passive device, we use the symbol that indicates that an applied signal can go in either direction. Click OK and place five of the ports on the schematic page (two for the primary and three for the secondary).
Reposition, connect, and label the ports as shown in Fig. 7.50.
Display the Project Manager window by minimizing the schematic page or ProjectName.opj from the Window menu. Select the Design icon then select Create Netlist from the Tools menu.
In the Create Netlist dialog box (Fig. 7.51), select the PSpice tab. Check the Create SubCircuit Format Netlist box and the Descend radio button. A default name will be given to the netlist. Modify the path and name as desired. Make sure the name ends with the .LIB file extension. Click OK.
You now have a PSpice library file with one model (the transformer) in it. You can use Method 3 or 4 to generate a Capture part library from this model or add it to an existing part library. To complete the example we use Method 4 so that we can take a look at the PSpice model generated by Capture.
Start the PSpice Model Editor again. From the File menu, select Open, and navigate to the transformer library that you made previously. Click on the S_Pri_CT_Sec model to display the model in the editing window, as shown in Fig. 7.52. Notice that the model type is .SUBCKT (a subcircuit). The name of the library is whatever you specified as the netlist file in the Create Netlist dialog box, and the name of the part is the schematic folder name in the Capture design (see Fig. 7.42). At this point you could modify the part to add specific requirements that will carry forward into the Capture part. Once the model editing (if any) is completed, generate the Capture part as described previously, using Method 3 or Method 4.
Note that, as shown in Fig. 7.52, the pin names and order in the Capture part (as indicated in the Pin Properties pane) and the PSpice template (as indicated in the Part Properties pane) must match the pin names and order in the PSpice model exactly or simulations will fail. The Implementation name must also match the model name in the PSpice model file. And finally, the part's pin numbers must match the pin (padstack) numbers in PCB Editor, which is governed by the part's data sheet. If the part's pin number is a letter instead of a number (e.g., A, for the anode of a diode), then the pad in PCB Editor must be named accordingly or the engineering change order will fail. Now, when you will want to use your custom part S_Pri_CT_Sec with its custom PSpice model in simulation, don't forget to add your appropriate custom LIB library to a PSpice simulation profile (Configuration Files/Library, use the upper Browse button to locate your LIB file and use the Add as Global button).
Adding PSpice templates (models) to preexisting Capture parts
Rather than using Method 3 or 4 to make a new part from the transformer PSpice library, you might wonder why we did not just add the PSpice model to the transformer already created in the first example (for which Method 1 was used). In older versions of OrCAD, this was somewhat of a challenging task (e.g., you have to know what "X^@REFDES %A %B %Y %VCC %GND @MODEL PARAMS:\[email protected][email protected]" means). Fortunately, it is a simpler matter with the newer versions.
In this example, we see how to add an existing PSpice model to an existing Capture part. We add a basic capacitor model to one of Capture's capacitor parts that has no model associated with it.
A basic capacitor (part C or CAP) from Capture's discrete.olb library has no PCB Editor footprint or PSpice model associated with it. We add a PSpice model to the part now. The location of the basic PSpice capacitor model that we use is in the PSpice Breakout library (breakout.lib).
To add a PSpice model to an existing Capture part, start Capture and select File → Open → Library and select the library with the part to which you want to add a PSpice model (use discrete.olb for this example). Find the capacitor (C or CAP, for example) in the Capture Library Part Manager and click the part's icon to select it. Right click and select Associate PSpice Model… from the pop-up menu.
At the Model Import Wizard dialog box (Fig. 7.53), use the Browse… button in the upper right-hand corner to find the PSpice model you want to associate with the Capture part. Locate and choose the library file "tools/PSpice/library/breakout.lib" in the Cadence installation folder. The wizard automatically searches through the PSpice library and lists all models in the Matching Models window that have the same number of pins as the Capture part you selected in the Part Library Manager. Select the CBREAK model and click Next.
The wizard then displays the Pin Matching tool shown in Fig. 7.54. This is where you connect the PSpice model pin to the Capture part pin. Click Finish when the pins are matched. The information box shown in Fig. 7.55 should be displayed, indicating that the capacitor now has a PSpice model attached to it.
How To Create New Part In Orcad Capture
Source: https://www.sciencedirect.com/topics/engineering/part-editor
Posted by: pursellthempailoved.blogspot.com
0 Response to "How To Create New Part In Orcad Capture"
Post a Comment