THE BECA LIBRARY On the Study Guide CD-ROM you will also find a directory called BECA LIBRARIES which contains four PSpice library files. These libraries contain custom parts that have been created for your convenience and edification. Text files describing each part can be found in the BECA PART READMES directory on the CDROM. These text files can be opened using the PSpice Text Editor, Notepad or Wordpad. To use the custom parts, you must install the BECA libraries into Schematics. Instructions are listed on page 25. Custom Parts Shown in Figure 4.2 are two parts in the BECA library that may be of some use in dc simulations - the CPL part and the instantaneous wattmeter. The CPL part is a constant power load. As the name implies, it draws constant power regardless of the voltage across it. Details on using the CPL part are given in the file CPL.TXT in the BECA PART READMES directory. Figure 4.2. The CPL (Constant Power Load) and Wattmeter parts in the BECA library. Power can be measured using the instantaneous wattmeter. It has three connections just like its real world counterpart. Look at the READMES file WATTMETER.TXT for instructions on using this part. In the BECA library, you’ll also find a quasi-ideal operational amplifier. Its Schematics symbol, equivalent circuit and Attributes box are shown in Figure 4.3. You can specify the op-amp’s gain, input and output resistances and supply voltages. VCC is the positive supply and VEE is the negative supply, which have been set to + 5 V in Figure 4.3c. As in a real op-amp, the output voltage in our quasi-ideal op-amp cannot exceed the supply voltages. Note that the output voltage will be referenced to the ground node (node #0) in the Schematics diagram. (a) (b) (c) Figure 4.3. The quasi-ideal op-amp in the BECA library: (a) the Schematics symbol, (b) the equivalent circuit and (c) the Attributes box. 24 Getting the BECA Library To get the BECA libraries into PSpice, copy all four library files from the CD-ROM to the MsimEv_8 subdirectory called UserLib. Including the BECA Library To use the BECA parts, Schematics must be permitted to access them. This process is called “including” the library. To include the BECA libraries: 1. 2. 3. 4. 5. 6. 7. 8. Open Schematics, go to the Analysis menu and choose Library and Include Files. The dialog box in Figure 4.4a will appear. Using the Browse button, select BECA.lib in the MsimEv_8/UserLib folder. Click OPEN. Back in the Library and Include Files window, click on the Add Library* button. Click OK. Now PSpice knows where the electrical models for the parts are located. Where are the BECA part symbols? In the Options menu, select Editor Configuration. The window in Figure 4.4b will open. Select Library Settings to open the Library Settings window in Figure 4.4c. Next, use Browse to select the file BECA.slb in the Msim_Ev.8/UserLib folder. Click OPEN. Back in the Library Settings window, click on Add*, then click OK. Back in Editor Configuration, click OK. Figure 4.4.a. Including the BECA parts library. You now have full access to the BECA parts. Figure 4.4b. The Editor Configuration window. Figure 4.4c. The Library Settings window. 25 MAXIMUM POWER TRANSFER SIMULATIONS Maximum power transfer simulations are easily done in PSpice. Consider the circuit in Figure 4.9. What is the maximum transferable power and what value of RL cause that to happen? We will let PSpice vary RL and plot the load power versus RL. We will then find the maximum power and read RL from the plot. The required Schematics diagram is shown in Figure 4.10. 40 15 V 30 20 RL Figure 4.9. Circuit for maximum power transfer simulation. Varying Component Values Using the PARAM Part Sweeping component values in dc simulations is a three step process. STEP 1: Component values become variables by using the PARAM part from the SPECIAL library. After placing a PARAM part in the schematic, double click on it to open its attribute box, seen in Figure 4.11. We can define three variables in the NAME1, NAME2 and NAME3 fields. In this case we need only one variable, so we click on NAME1 and type in RLOAD for the attribute value. Also in the PARAM attribute box are three values, VALUE1, VALUE2 and VALUE3, which set the values of the variables NAME1, NAME2 and NAME3 respectively. In Figure 4.11, VALUE1 has been set to 50 . This is the value of RLOAD when PSpice performs its initial dc simulation. We will define the range of RLOAD for the maximum power transfer plots later. Figure 4.10. PSPICE schematic for Figure 4.9. STEP 2: Now we must tell PSpice how the resistor RL and the variable RLOAD are related. Double click on the value Figure 4.11. PARAM part attribute box. of RL and change it to {RLOAD} as seen in Figure 4.10. Braces tell PSpice that the value of RL is an expression that must be evaluated. In particular, the value of RL = RLOAD. Note that the expression within the braces can be any mathematical function of the three variables defined in the PARAM part. STEP 3: Finally, we must set the range of RLOAD for our simulation. Since the other resistors in the circuit are in k’s, we will sweep the load from 1 to 100 in 1.0 steps. To do this, go to the Analysis menu and select Setup. When the Setup dialog box appears, select DC Sweep. This will open the dialog box in Figure 4.12. Obviously, there are several things we can vary. We want to vary the Global Parameter called RLOAD from 1 to 100 in steps of 1. These entries are shown in Figure 4.12. Click OK to return to the Setup box, then click CLOSE to return to the schematic. 28 To perform the actual simulation, choose Simulate from the Analysis menu. After some activity, a message box should respond with Simulation Finished and the PROBE screen in Figure 4.13 should open. If it doesn’t select Run Probe from the Analysis menu. Graphing the Transferred Power in PROBE In Figure 4.13 we see that the x-axis is already the variable RLOAD ranging from 1 to 100 . To plot transferred power on the y-axis, select Add from the Trace menu. The dialog box in Figure 4.14 opens displaying two columns of selectable items. On the left are all the branch currents and node voltages. Of interest to us are the entries V(Vout) and RLOAD. Note that deselecting the Alias Names option greatly simplifies the listing. On the right are all of the functions we can use. Let’s define the transferred power as Vout*Vout/RL. To enter this expression, click on V(Vout) in the left column of the box. You should see V(Vout) appear in the text line at the bottom of the dialog box. Finish the power expression and select OK. The resulting plot is shown in Figure 4.15. Figure 4.12. Using DC Sweep to vary RL. To extract accurate values from the PROBE plot, activate the cursor by selecting Cursor/Display from the Tools menu. Using the and keys, move the cursor to the power peak. Or, use the PEAK VALUE hot button. From Figure 4.15, we see that when RL is 43 , the transferred power maximizes at 144.2 mW. You can review each step of this simulation by running the Visual Tutor, MAXPOWER.EXE. Figure 4.13. The PROBE window ready to plot transferred power. 29