Download 101101/Thomas Munther

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Resistive opto-isolator wikipedia , lookup

Current source wikipedia , lookup

Voltage optimisation wikipedia , lookup

Immunity-aware programming wikipedia , lookup

Switched-mode power supply wikipedia , lookup

Buck converter wikipedia , lookup

Mains electricity wikipedia , lookup

Power MOSFET wikipedia , lookup

Rectiverter wikipedia , lookup

Opto-isolator wikipedia , lookup

Two-port network wikipedia , lookup

Transcript
101101/Thomas Munther
IDE-Department
Halmstad University
Laboratory 1
Tutorial ORCAD CAPTURE CIS withPCB and PSPICE
Start from All Programs-> Cadence-> Release 16.3-> OrCAD Capture CIS
Then choose according to Figure 1.
Figure 1
Figure 2
Create a new project. See figure 2 !
Under File-> New-> Project save as ”My_First_Project”
1
Suggestion of name and location for the project is given in Figure 3.
Figure 3
Select to create a project that starts from scratch.
Figure 4
2
OK , when the choice in Figure 4 is finally made we end up with a project window that shows
the hierarchy of the project and an empty page. The empty page is where we will drag and
drop our parts and connect them in order to get an electric circuit. See figure 5 !
Figure 5
We will now try to achieve an active filter of first order using an OP-amp, resistors and a
capacitor. Eventually it should look like Figure 14.
Enter Place-> Parts
Your right part of the window changes.
3
Now you can see which libraries are available for drawing (Capture). None !!
Figure 6
To add libraries enter Directory Pspice and select all.
Figure 7
4
Our working window has now changed. Look on the right side !
Figure 8
There are quite a few available libraries now as you can see in Figure 8. Each library contains
different parts (components). Try to localize a resistor. Enter R under “Part” and press return.
It gives immediately a suggestion of a resistor. You should use one from the library
R/ANALOG ! Place three resistors in the empty page (Schematic Window).
Do the same procedure with the capacitor ( C/ANALOG), but only once here !
Then select an OP-amp (uA741).
5
It is very important that you notice, when you select your part it also has two small icons on
the right of the symbol. If you hold the cursor above the icon you can see what it means.
The left icon means the part can be used for simulation (Pspice) and the right icon for PCB
Layout.
Figure 9
Connect the parts like in Figure 10. To place the wire in the circuit in Figure 10.
Choose “Place wire” !
R1
U1 7
3
+
V+
OS2
1k
OUT
2
-
uA741
4
OS1
V-
5
6
1
R2
1k
C1
1n
R3
1k
Figure 10
If you have something that looks like Figure 10. Then we can continue. We need a GROUND
and SUPPLY VOLTAGE for the OP-amp. The GROUND is found under Place->Ground in
the menu. This opens a new window. See Figure 11. Select 0/CAPSYM !
We will use both positive and negative SUPPLY VOLTAGE for the OP-amp, so you will
need to select two DC Voltages. These are known as VDC/SOURCE.
6
Figure 11
Make connections with wire once again and now our circuit should look like Figure 12.
Also change DC voltage Value. Double-click on the symbols or the value to change them
from 0 to 12V.
V1
R1
U1 7
3
+
12
V+
OS2
1k
OUT
2
-
uA741
4
OS1
V-
5
6
1
0
V2
12
R2
1k
C1
1n
R3
1k
0
Figure 12
We have still not connected the SUPPLY VOLTAGE pins of the OP-amp with DC Voltages
outside. To avoid an external wire into the OP-amp and make the circuit a bit messy we could
actually assign the pins instead. Use Place-> Power and select VCC/CAPSYM. Place four of
them like in figure 13.
7
VCC
VCC
R1
3
U1 7
+
V1
12
V+
OS2
5
1k
6
OUT
2
-
4
uA741
1
OS1
V-
0
V2
12
-VCC
R2
9k
C1
100n
R3
1k
-VCC
0
Figure 13
Please notice that I have changed some of the values of the parts as well.
Our circuit is almost ready for simulation. What we lack is signal input.
The line I have placed in (Figure 13) the circuit is to clarify the purpose of the circuit. The left
part is a first order Low Pass filter with a cutoff frequency f=1/(2πR1*C1) approximately
1600 Hz and the right part of the circuit is a non-inverting amplifier with a voltage
amplification 1+R2/R3.
Now let’s move on and add a signal source, VAC/SOURCE. See Figure 14 !
VCC
VCC
3
+
OS2
1k
OUT
2
uA741
V3
-
V1
12
7
U1
V+
R1
4
OS1
V-
5
6
1
0
1Vac
0Vdc
V2
12
-VCC
R2
9k
C1
100n
R3
1k
-VCC
0
Figure 14
The signal source has an amplitude of 1 Volt ( no DC Voltage) and the frequency is not
stated. What we shall do now is to make a frequency sweep and see the response of the circuit
with our input signal and for different frequencies.
8
Enter Pspice-> New Simulation Profile.
Suggest a name. See Figure 15 !
Figure 15
Then make some simulation settings enter Pspice-> Edit Simulation Profile
Do the same settings like figure 16. This gives some kind of Bode Plot simulation starting
from 100Hz and ending at 100kHz. We will use 10 calculation points for each decade.
That means we will have 10000 calculation points in total in our plot.
The x-axis scale will be logarithmic.
Figure 16
And finally before we start the simulation we need to choose which voltages/currents that we
would like to have presented in the output plot.
Select Voltage/Level Marker and put these on the input and output voltage in the circuit like
in Figure 17. You will find this button in the tools menu. Hover the cursor above the icons or
look in figure 18 how to access it.
9
VCC
VCC
3
+
OS2
1k
OUT
2
uA741
V3
1Vac
0Vdc
-
V1
12
7
U1
V+
R1
4
OS1
V-
5
6
1
V
0
V
V2
12
-VCC
R2
9k
C1
100n
R3
1k
-VCC
0
Figure 17
Figure 18
Voltage/Level Marker
Run Pspice
Start the simulation. Run Pspice !
10
The simulation presents the voltages at the input and output markers. See figure 19 !
If you do not know which marker belongs to what plot. Return to schematic to see the color of
the marker you have placed in the schematic.
Figure 19
I think this is in line with what we can expect from the circuit. This is a Low Pass filter and
the cutoff frequency is approximately 1600Hz. The frequencies that are supposed to be
unaffected to their amplitude are amplified by a factor 10. This seems correct enough !
We will now use another input source to the circuit and perform another simulation.
Use VSIN/SOURCE instead for VAC. Notice it has a small PSPICE icon next to right of the
symbol. VSIN has three parameters: VOFF,VAMPL and FREQ. The first one is the DC
Voltage, the second is the amplitude of the sine wave and the third is the frequency of the sine
wave.
Try the following:
VOFF= 0
VAMPL= 1
FREQ= 1000
Click on parameters and enter the values above !
Edit the simulation profile: Pspice-> Edit Simulation Profile
See Figure 20 !
Time Domain (Transient) means that we display the voltages like function versus time.
How long time should we display ?
Well what frequency do we use, in our case 1000Hz. That means a period of 1msec.
Appropriate simulation time is maybe 5 periods that is 5 msec.
How often should we calculate voltages ?
11
I choose 1μsec as a maximum step between calculations. That means that we have more than
5000 calculation points in our plots. It gives smooth sine wave curves in the plot. As can be
seen in Figure 21.
Figure 20
Start the simulation !
The result is displayed in Figure 21.
Figure 21
12
What we can see in Figure 21 is no surprise. Actually we can see the same in Figure 19 for the
frequency 1000Hz. The amplitude for the output voltage is approximately 8.5 Volt. Precisely
the same.
Let’s have a look on the project window. Open up all folders and maximize the window !
You can see the path to all parts that you have used in the project.
The output from schematic in order to simulate the circuit, the netlist. Click on it to see what
node (connection points) references the software uses for simulation. You can also see the
simulation settings that you have used during simulation. Actually the same as in Figure 20.
Figure 22
Netlist
* source MY_FIRST_PROJECT
R_R1
N01666 N00173 1k TC=0,0
R_R2
N00192 N00221 9k TC=0,0
R_R3
0 N00192 1k TC=0,0
C_C1
0 N00173 100n TC=0,0
X_U1
N00173 N00192 VCC -VCC N00221 uA741
V_V1
VCC 0 12
V_V2
0 -VCC 12
V_V3
N01666 0
+SIN 0 1 1000 0 0 0
13
Sometimes the only way to findout why a simulation do not work is to study the session log
when we create a netlist for the project.
Suppose we remove a wire like in figure 23 and run the simulation once more.
VCC
VCC
3
+
OS2
1k
OUT
2
-
OS1
V-
4
uA741
V3
VOFF = 0
VAMPL = 1
FREQ = 1000
V1
12
7
U1
V+
R1
5
6
1
0
V2
12
-VCC
V
V
R2
9k
C1
100n
R3
1k
-VCC
0
Figure 23
The session log states:
-------------------------------(3.00, 3.10)
Creating PSpice Netlist
Writing PSpice Flat Netlist C:\temp\My_First_ProjectPSpiceFiles\SCHEMATIC1\SCHEMATIC1.net
ERROR [NET0075] Unconnected pin, no FLOAT property or FLOAT = e U1 pin '-'
In this case it is quite easy to understand what is wrong, but sometimes it can be a logical fault or
possibly uncertainty of circuit operation and that makes it much more difficult.
Let us continue with some other possibilities to watch from simulation. Remover Voltage markers
from figure 23 and correct the fault from the previous execution.
Enter Pspice-> Bias Points-> Enable Bias Power Display
VCC
VCC
3
+
OS2
1k
OUT
2
6.356pW
uA741
V3
-
V1
12
7
U1
V+
R1
4
5
6
0
V2
12
-VCC
VOFF = 0
VAMPL = 1
FREQ = 1000
-16.04mW
1
OS1
V-32.08mW
R2
9k
C1
100n
-16.04mW
0W
R3
1k
0
3.350pW
-VCC
3.657pW
Figure 24
What you can see in Figure 24 is the DC Power consumption (+ sign) and those who has
negative power consumption, actually delivers power like our two DC –voltages V1 and V2.
14
OK you could notice that the power consumption for the OP-amp is about 32 mW more or
less exactly the same power delivered from V1 and V2, the DC supply for the OP-amp.
Now let’s find out what is inside the model for OP-amp. Click inside the OP-amp. It changes
colour and then use the right mouse button and choose: Edit Pspice Model
See in Figure 25 what is displayed !
Figure 25
Turn off “Enable Bias Power Display” and turn on “Enable Bias Voltage Display”instead.
Now you can see the Bias Voltage in the whole circuit. See figure 26 !
The only DC voltage of any significance is from the DC-supply, V1 and V2.
There should not be any major surprise to you in the displayed voltages.
Capacitors are ignored when looking for a DC path.
VCC
VCC
3
+
OS2
1k
OUT
2
uA741
-79.73uV
V3
VOFF = 0
VAMPL = 1
FREQ = 1000
-
V1
12
7
U1
V+
R1
4
OS1
V-
5
6
12.00V
1
12.00V
0
V2
12
-VCC
R2
113.2uV
0V
0V
9k
C1
100n
-12.00V
R3
1k
-60.47uV
-VCC
-12.00V
0
0V
Figure 26
15
Finally turn off the “Enable Bias Voltage Display” and turn on “ Enable Bias Current
Display”. See Figure 27.
Of course Kirchoff Current Law should apply and it does as you can see.
VCC
VCC
3
+
OS2
1k
OUT
2
uA741
79.73nA
V3
-
V1
12
7
U1
V+
R1
4
5
6
1
OS1
1.337mA
V79.73nA
-VCC
VOFF = 0
VAMPL = 1
FREQ = 1000
0
79.76nA
C1
100n
V2
12
1.337mA
R2
-19.29nA
9k
-1.337mA
R3
1k
-VCC
19.29nA
1.337mA
79.73nA
0
Figure 2760.47nA
Close the current project and open a new one. We will try to and make an own part.
Create your own device for simulation
Naturally one can’t find all the components manufactured in the world within the libraries of
Cadence. But for your disposal many manufacturers provides models of their components for
simulation purposes. For instance Analog Devices has an operational amplifier, OP amp
which we will create. The device is 8616 and consists of two op amps.
Figure 28
The device is manufactured in different sizes, hole- and surface-mounted. The figure above
comes from a datasheet and illustrates the fact that the device can be both as SOIC and
MSOP.
SOIC = Small-Outline Integrated Circuit
MSOP = Mini Small Outline Package
We will return and look into how the device physically looks like later.
Now we will try to make our own device for simulation by copying the features from a
similar device and save these within our device.
First we make our own libarary where we can save our component. Mark the project window
16
and press File->New->Library. The project should now contain a library called library1.olb
Figure 29
Mark the library and press save as. Save the library in a suitable directory.
Click add part and choose LM158 in the library OPAMP. Add the component to the working
space.
Figure 30
17
This is an OP amp with the same pin configuration and two amplifiers within the same device.
(Parts per Pkg: 2) Look in the figure above !
Place the component somewhere on the workspace. The component is also in the design
cache. Check this ! See Figure 31.
Figure 31
Mark the component LM158 in Design Cache and click Edit->Copy . See above !
Choose the created library tutorial.olb and select Edit->Paste.
The component LM158 is now copied to its own library where we can do whatever we choose
do (C:\temp ). Remove LM158 from the workspace to avoid mixing it up with the original
component.
Now mark LM158 in your own library.
Click Rename and save it as AD8616. Doubleclick on AD8616 and change its value to
AD8616. Close the edit window and save. See Figure 32
Click on the workspace and then on the place part button. Now you have the component
AD8616 in your library named to library1.olb
Localized in the directory C:\temp
18
Figure 32
We can see the two icons indicating it can be used for layout and simulation, but right now
there is no existing model that we can use. Press OK and add to the workspace.
The correct simulation template (model) can we find on the Analog Devices website: .
http://www.analog.com/
Search for AD8616. If everything is OK the information about AD8616 should be shown.
Click on the link Download “ All Spice Models”
Extract the zipped files and save them as a directory AD
I really got all Pspice models from Analog Devices here. If I open them up I see that they are
text-files.
We should try to connect a text-file “ad8616” to our graphical model that we recently
created.
Start with the making of a library by selecting File->New->PSpice Library. This opens the
PSpice Model Editor. Click Model->Import and import the file “ad8616”
The PSpice Model Editor should now look like:
19
Figure 33
Choose File->Save As and save on a suitable directory (C:\temp).
It is saved as: ad8616.cir in our directory.
Please notice the order of input, output and Voltage supply. The numbers are not to be mixed
up with pin-numbers or anything else. You must see to that this order is the same as for our
graphical model.
Doubleclick on our graphical model AD8616 and this opens the property editor.
Check the order in the field PSpice Template once again !
It should be: X^@REFDES %+ %- %V+ %V- %OUT @MODEL
X^@REFDES = reference to a PSpice template saved with the same name as in the field
Implementation. Change in Implementation to AD8616 . See the figure 34!
20
Figure 34
After ”%” the name for the pin is given. This is checked by a right mouse-button click on the
graphical device and selecting Edit Part.
Check the names on the pins by a double-click on them. See the figure window 35 below !
21
Figure 35
In this example one can see that pin number 8 has the name V+. This is consistent with what
we said earlier about the order must be the same.
* Node Assignments
*
*
*
*
*
*
*
.SUBCKT AD8616
noninverting input
|
inverting input
|
|
positive supply
|
|
|
negative supply
|
|
|
|
output
|
|
|
|
|
|
|
|
|
|
1
2
99
50
45
X^@REFDES %+ %- %V+ %V- %OUT @MODEL
Compare this with a function call in the programming language C.
In programming one must be careful with the order of the arguments. It has nothing to do with
names of the variables.
It is a difficult error to discover because there is no warning for this when you simulate the
model.
22
Close the PSpice Model Editor and Edit part. Check that the our graphical model refers to
correct simulation model (template) by double-clicking on our part in the schematic window
and select Edit PSpice Model . It should now look like Figure 36 below if the PSpice Model
Editor has opened the correct file.
Figure 36
When it does we know that it uses the correct model in the simulation.
If it responds can’t find the model. Check the names (AD8616).
Close PSpice Model Editorn !
Simulation of your own device
We will now use our component in a circuit in order to make simulations with it. Make the
schematic below:
Figure 37
In the schematic we have used the fact that we can name the connections (net) . The
schematic becomes easier to understand and to follow. Name the connections with the button
Place Net Alias. We have inserted: “in”, “out” and “VCC” as net aliases.
23
Put a probe on “out” and simulate the circuit with the following settings:
Figure 38
The result should be:
Figure 39
What is it ? I guess you can easily understand it is a Low Pass Filter. Can you tell what order
and cut-off frequency we have in our filter ?
Remove the probe from the schematics and click Trace->Add Trace and enter in the field
Trace Expression :
20* LOG10(ABS(V(out)/V(in)))
24
Also take a look on the netlist. This is used for simulation and gives short information about
each component, node points, values and so on.
This can be done by choosing Pspice-> View Netlist !
Create a adapted project for layout.
Close the project and create a new one. Choose Schematic this time.
Figure 40
25
Make your own components
We will now try to make a device that is not included in the library of Cadence.
First we make our own library where we save our device. Mark the project and press File>New->Library .
Our project should now look like Figure 41 below and with a library library1.olb .
Figure 41
Mark the library and press save as. Save the library in a suitable directory.
Make sure that the library is active and press Design->New Part
Figure 42
26
Place 4 pins (place pin) and mark the outside with place rectangle
Figure 43
I save the symbol as Black Box in Library2. I use the tools Place Pin Array and Place
Rectangle to design the symbol in Figure 43.
Press save and close the window ! The device should now be searchable in Place Parts
and it is. It can of course be used in schematics drawing but not yet for simulation or to
produce PCB layout Localize the library where you saved your part “Black Box” and place it
on your empty page.
U1
1
2
In0
In1
Out0
Out1
3
4
Black Box
OK let us move on to another circuit. Close the project and open a new project.
27
Start a new project. Sofar we have gotten a bit more familiar with Schematics and Pspice.
We have also learned how to make our own part symbol and add a part that is not included
within Cadence libraries and also link a Pspice Model to this part. Many suppliers provide
in some cases symbol, Pspice Model and Footprint for a component. Without a correct
footprint for a part we cannot produce a PCB Layout. Then we must make it ourselves with
some help from data sheet from the part supplier.
We would like to make the PCB Layout for the circuit below. I think you recognize from
earlier. Open your project.
VCC
VCC
3
V1
12
7
U1
V+
R1
+
5
OS2
1k
OUT
2
uA741
V3
-
4
OS1
V-
6
1
0
1Vac
0Vdc
V2
12
-VCC
R2
9k
C1
100n
R3
1k
-VCC
0
Figure 44: First order Active LowPass Filter
When you start to draw the schematics you can see that some parts lack the Layout symbol.
For instance the DC-supply will be external and not on the board therefore we need
connectors for DC-supply and ground. The same is true for the input and output signal.
So we need to make or import footprints(and symbols) for some parts in the Low Pass Filter.
First we will make symbols to replace Input signal source and DC Supply and the ground and
make it possible to have external connection to our board. See Figure 45 !
Both symbols are in Library1.olb .
J7
IN
GND
CONN2_IN
J8
1
2
1
2
+VDC
-VDC
CONN2_VDC
J9
1
2
+VDC
-VDC
CONN2_VDC
Figure 45: Home-made input Connector
Our circuit from Figure 44 has now been changed to something according to Figure 46.
28
U4
1
2
+VCC
-VCC
Conn2_VDC
U3
2
3
+
1k
OS2
OUT
2
Conn2
uA741
-
V-
GND
1
OS1
5
1
2
Out
GND
6
1
Conn2_out
4
Vin
U1
V+
R3
7
U2
R1
C1
1n
1k
R2
1k
0
Figure 46
If we continue with the problem that some of our parts haven’t any footprints like “Conn2”
and “Conn3”. The resistors, capacitors have footprints but the names are not valid and the
same goes for AD8616.
So we must either find appropriate footprints from the supplier or make them ourselves with
some help from the datasheets.
To be able to change these footprints we must also switch
Options-> CIS Configuration
Figure 47
Choose Browse and localize the library: FlowCAD_Library
Then OK!
29
Let us see if we can do something about it. Double-click on a resistor and open up its property
window. Change Property PCB Footprint to: res_th_a_rm10_16x2_54
This means a through-hole-mounted resistor.
Do the same for the three other resistors.
Figure 48
Repeat this for the capacitors but write: capp_th_r_50_125_25
and for the circuit AD8616 write: DIP8_7_62
Making of a footprint
Finally we have to get some footprints for input, output and supply connectors.
When this is done we can continue and make the board.
Save things sofar and you may leave ORCAD Capture CIS Open and we will move on to
ORCAD PCB Editor.
From ALL Programs ->Cadence -> Release 16.3 -> ORCAD PCB Editor
30
If we return to the schematic in Figure 46 and open up the symbol Conn2, Conn2_VDC and
Conn2_out: add the footprint CONN2. Now let us create it !
When we create a footprint the first thing is to place the pins and number 1 is always square
and the other in our case will be round.
Select Layout-> Pins , Choose Options (to the right). Click the “ …” button next to field for
Padstack. Select padstack: Th0_7C1_3S ( this is pin1)
Repeat this for pin 2 but choose padstack: Th0_7C1_3C
The distance between each pad should be 100 mil. Can be seen here.
Add an assembly outline. First change the grid size in working area.
Setup-> Grids , Change in the Non-etch section : spacing both for x and y: 25 mil
Choose “Grid on” . OK!
Then Add-> Line , draw a box round the padstacks it should have a size 100x200 mil.
See below!
31
We should also add label and text to our footprint.
Select Layout-> Labels->RefDes
Click inside the assembly outline and write ” J*” .
Repeat this but now for Layout -> Labels-> Device
Click inside the assembly outline and write “devtype”.
Then finally: File-> Create Symbol --- save it as CONN2
Return to ORCAD Capture CIS and change in the schematics click on the symbols that have
2 connectors and denote its footprint as CONN2. There are three of them.
END OF LAB1
32