Creating a symbol for a part In my PSpice books, there are a few symbols that did not come with the evaluation version (and indeed the full version too), and had to be created. Also, in a final year project (what prompted the production of this document), there will be occasions when your design uses a component not in existing libraries. The following procedure is a little bit tedious but well worth the effort in the end. We need to download the model, LM386.LIB, and the default symbol, LM386.OLB. I found the two LM386 power amplifier files at the site shown in Figure 1. Figure 1: Download the models Save these files into a directory of your choice, and then open the .OLB file as shown in Figure 2. Figure 2: Go to the directory where you saved the symbol and model information To display the downloaded default symbol-a rectangle with pins, select the symbol name from the Design Resources as in Figure 3. 1 Figure 3: Double left click as shown We should make the grid visible as it helps in constructing a new symbol. This is done from the Options/Preferences/Grid Display, shown in Figure 4. In the Part and Symbol Grid on the right hand side, set Pointer snap to grid to off. Figure 4: Setting the grid parameters The default symbol should appear as in Figure 5. Figure 5: Default symbol Remove the names on the inside of the symbol by selecting Options/Part Properties, as shown in Figure 6. 2 Figure 6: Remove the pin names-Options/Part Preferences The pin names inside the box are made invisible by setting the Pin Names Visible to False as shown in Figure 7. Figure 7: Set Pin Names Visible to False Next, remove the boundary box as shown in Figure 8 to leave a dotted outline. Figure 8: Make a triangle We can make the outline rectangle into a triangle for the power amplifier using the line tool from the right toolbar, but first move the outline box into a 6 x 6 grid by grabbing the dotted rectangular corners. Select a pin and move it to the desired location (use the downloaded IC data sheet-LM386.PDF as a guide). Select pin 6, and change the Pin Properties as shown in Figure 9. In this case, pin 6 is a power pin (get the pin information from the model, i.e. LM386.lib). You may also shorten the pin length from the Shape: box. 3 Figure 9: Changing pin parameters Use the Place line tool from the right hand toolbar to connect the pin to the triangle (make sure the snap to grid is off-see Figure 4). Figure 10: Draw the fill in line using the Line tool Note: Do not change the pin names. These names have to be the same pin names as in the model. You may rotate pin numbers using the keyboard, R. Use Notepad to look at the model LM386.lib. Using the text tool, add the negative (-) and positive symbols (+) to the inputs. The final symbol can be incorporated into the schematic shown in Figure 11. C3 10uF 2 V1 15Vdc 8 0 Vin + C1 5 LM386 3 VOFF = 0 VAMPL = 20mV FREQ = 1kHz 1 - I U1 V 6 220uF 7 4 C2 10u C4 0.05u R2 10 Rload 8 W 0 Figure 11: Final circuit 4 1.0A 0A -1.0A I(R1) 4.0W Output Power in Watts 2.0W SEL>> 0W W(R1) 5.0V 0V -5.0V 0s 1ms 2ms 3ms 4ms 5ms 6ms 7ms 8ms 9ms 10ms V(C1:2) Time Figure 12: Output waveforms You may wish to use a model for a speaker instead of the 8 Ω resistance. In that case, use the schematic in Figure 13. Importing a .LIB file for an existing symbol There are many symbols that have no model attached to them (right click, and if Edit PSpice Model is greyed out, then no model is attached). To download the model and symbol libraries, select the following Texas Instruments site and search for THS4131 http://focus.ti.com/docs/prod/folders/print/ths4131.html There is a zipped file containing the 4131.lib, the model file, and ths4131.olb, the symbol file at this location,. To add the downloaded symbol file in PSpice, start a new project by selecting NEW/ Library, as shown in Figure 1. Figure 13: Opening a library Double left click on the selected THS4131.olb as shown highlighted in Figure 14 5 Figure 14: The symbol library In this case, the proper symbol is supplied so there is no need to carry out the procedure outlined in the first section. To add the model library, THS4131.lib, select the Edit Simulation Settings icon and then select Configuration Files as shown in Figure 15. Press the Browse icon and locate the downloaded files. Then Add as Global, if you wish this symbol to be available for all schematics, or Add as Local, for the schematic under investigation. Figure 15 Create the following schematic in Figure 16. 6 C1 360pF R1 R3 44k2pos 5Vdc 3 44k2 pos V1 U2 1 2 Vocm 8 1Vac 0Vdc 0 R2 + 6 V3 4 5 V2 5Vdc neg 0 neg R4 THS4131 44k2 C2 44k2 360pF Figure 16 Carry out an AC analysis to observe the frequency response. 0 -10 -20 -30 -40 -50 1.0Hz 10Hz DB(V(OUT2)-V(OUT1)) 100Hz 1.0KHz 10KHz 100KHz 1.0MHz Frequency Figure 17 Note the differential output is plotted as DB(V(OUT2)-V(OUT1), using the dB() operator. Importing a .LIB file The file contains the model information and can also be named .MOD, or .CIR, as well. Open the library as shown in Figure 18. 7 Figure 18: Select the PSpice Model Editor from the main Windows menu. Using the Model Import Wizard, is the easiest way of importing a library. Figure 19: The Model Import Wizard Figure 20 8 Figure 21: The .lib contents 9
© Copyright 2026 Paperzz