Creating A Symbol For A Part: Figure 1: Download The Models
Creating A Symbol For A Part: Figure 1: Download The Models
Creating A Symbol For A Part: Figure 1: Download The Models
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.
+
-
U1
LM386
1
2
3
4
5
7
8
6
Rload
8
R2
10
V1 15Vdc
C1
220uF
C2
10u
0
Vin
FREQ =1kHz
VAMPL =20mV
VOFF =0
C3 10uF
C4
0.05u
0
I
W
V
Figure 11: Final circuit
4
Ti me
0s 1ms 2ms 3ms 4ms 5ms 6ms 7ms 8ms 9ms 10ms
V( C1: 2)
- 5. 0V
0V
5. 0V
W( R1)
0W
2. 0W
4. 0W
SEL>>
Out put Power i n Wat t s
I ( R1)
- 1. 0A
0A
1. 0A
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
-
+
Vocm
U2
THS4131
8
1
3
6
4
5
2
R1
44k2
R2
44k2
R3
44k2
R4
44k2
C1
360pF
C2
360pF
V1
5Vdc
V2
5Vdc
0
neg
pos
V3
1Vac
0Vdc 0
pos
neg
Figure 16
Carry out an AC analysis to observe the frequency response.
Fr equency
1. 0Hz 10Hz 100Hz 1. 0KHz 10KHz 100KHz 1. 0MHz
DB( V( OUT2) - V( OUT1) )
- 50
- 40
- 30
- 20
- 10
0
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