Download 100806/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
no text concepts found
Transcript
100920/Thomas Munther
IDE-Sektionen HH
Lab III
Simulation of Elektronics with Cadence (release 16.3)
Start the program by entering:
Programs-> Cadence -> Release 16.3 -> Orcad Capture CIS
( CIS=Component Information System )
Figure 1
Make the choice above.
Then choose a new project to be created and choose a simple name and save the file in a
suitable location on the desk. See figure 2 !
Figure 2
1
When this is done and by clicking OK we open up Orcad Capture. See figure 3 !
This contains a dotted field in the centre called Schematic. The dots or the grid will simplify
when we connect the different parts which we drag and drop into the field. In the Schematic
we will build our electronic circuit to be simulated.
Figure 3
We will start very simple by choosing a well-known circuit a first order Low-Pass Filter.
Enter Place in the menu and select a resistor and a capacitor. Drop these on the dotted
field.
2
Figure 4
How is this done ?
Write R in the field “part” then press return. Hopefully the software finds the component, if
not. Go to Search for Part . Write R in the field “Search for” and press return. Now should
the program localize the library where the component is to be found. Add this library . Place
the resistor in the schematic field and repeat this for the capacitor.
We could also simply add all the libraries to be searchable from the beginning by instead :
Enter Libraries and add all the libraries. This is found on the right above the part symbol.
3
See figure 5!
Figure 5
We should now have two components in the Schematic field. Like figure 6.
R1
1k
C2
1n
Figure 6
Add a ground symbol to the schematic and connect the components. This is done
By Place -> Ground and then choose 0/SOURCE. Connect the components by Place-> Wire.
Our circuit should approximately look like Figure 7 but not exactly :
4
LowPass Filter
R1
+
1k
+
In
Out
C2
1n
-
-
0
Figure 7
I have placed text together with signs in the circuit. Text can be placed by Place-> Text.
I want to make a simulation of this small circuit in order to do this I need a voltage source.
We will get the part VPULSE. Set the parameters as in figure 8 and change the component
values for R1 and C2 as in figure 8.
VPULSE is a Pulse Generator.
The parameters are as follows:
V1-Voltage Low
V2-Voltage High
TD- Time Delay
TR-Rise Time
TF- Fall Time
PW-Pulse Width
PER- Period
Low-Pass Filter
R1
In
1k
+
V1 = 0
V2 = 5
TD = 0
TR = 0
TF = 0
PW = 5
PER = 10
Out
+
V1
C2
1m
In
-
Out
-
0
Figure 8
Time Domain Analysis
If we have a circuit that looks like the one above.
The red text in figure indicates nodes (Net Alias) that are given specific names in order to
simplify for us to find these simulations.
We should then move and try to make a simulation of the circuit.
Enter the icon in the toolbar named “ New Simulation Profile”
We should name the profile. See figure 9 !
5
Figure 9
Then we should decide what kind of simulation to make. Choose the icon to right of the
previous one “ Edit Simulation Profile”. Make the same choices as in figure 10.
Figure 10
6
Start the simulation. VPULSE is a square wave generator with a pulse width of 50%.
That is the pulse is high for 50% of the period and low the other part. See the red curve
below. Output from the circuit is green and we can see a typical curve for a capacitor.
Figure 11
If we remove the Voltage markers and start the simulation again we will see that no plots are
done, but do not worry the simulations are done but the presentations are not. We can easily
obtain these by Trace-> Add Trace . Look for Simulation Output Variables: V(In) and
V(Out). Now we have the same plot as in figure 11.
7
Analysis of AC Circuits
We will analyze the circuit once again but we will change the Voltage Source to a sinusoidal
input. If we excite a linear time-invariant circuit with a sinusoidal input signal, the output
response will also be a sinusoidal with the same frequency. The output can have its amplitude
and phase affected. Use VSIN. It has three input parameters: Voff , Vampl and Freq.
The first is bias voltage (DC voltage). The second is amplitude of the sine wave and the last is
the frequency. Please also notice that I have changed the capacitor value from previous.
Low-Pass Filter
R1
In
Out
1k
+
C2
1u
V1
VOFF = 0
VAMPL = 1
FREQ = 100
+
In
Out
-
0
Figure 12
Use the same input as V1 above: 0 + 1sin(2п100t) [Volt]
Edit the simulation profile like figure 13 and run the simulation.
Figure 13
The result should look like figure 14 if we plot V(In) and V(Out).
8
Figure 14
Repeat the simulation of the circuit for frequency 10Hz and 1000Hz. Then of course you must
also adjust the simulation profile both “Run time” and “Maximum step size”.
You should understand the result of the simulation. If not consider how a capacitor behaves
for low and high frequencies.
Instead of repeating for each and every frequency and see how the circuit responses we can
actually make one frequency sweep in the signal source and then get a frequency response
plot for all simulated frequencies in a range starting from a start value to stop value.
Frequency Response
The presentation will be both for the amplitude (amplitude function) and the phase (phase
function). We can now study for any input sine wave the actual output within this frequency
range that we have simulated. We can decide the output amplitude and ouput phase.
Replace the input source with VAC instead. See figure 15 !
We have a sine wave input with an amplitude 1 Volt, but what frequency ?
The frequency is sweept over a range. This is decided inside the Simulation Profile.
Make the same settings as I have in figure 16.
9
Low-Pass Filter
R1
In
Out
1k
+
C2
1u
V1
1Vac
0Vdc
+
In
Out
-
0
Figure 15
Figure 16
Start the simulation and go to Trace-> Add Trace and write in Trace Expression:
V(Out)/V(in).
The result is shown in figure 17.
What can we see in the plot. ? Well in we apply a sine wave with a frequency 300 Hz.
Less than half the amplitude will end up over the capacitor. At 3000 Hz only 5% of the input
amplitude be over the capacitor and so on.
10
Remove the plot and go to Trace -> Add Trace and write a new expression in “Trace
Expression “ : P (V(Out)/V(in) )
This gives us the phase function and now we can see how much the output lags the input
voltage for different frequencies. The output voltage has a phase less than 60 degrees after
the input voltage at frequency 300 Hz.
Figure 17
Figure 18
11
Hopefully you understand a bit more of the software, but so far we have only used the
possibility to draw and simulate a very small circuit.
We will try to extend this to use parts in Electronics.
Exercise 1: Inverting Amplifier
Open up a new project in same way or open up a new page in the same project.
See figure 19 !
Figure 19
Now get the following part an Operational Amplifier OP 741. It is denoted as
“uA741/OPAMP”.
This a standard component with a wide-spread use.
3
U2 7
+
V+
OS2
OUT
2
uA741
-
4
OS1
V-
5
6
1
Figure 20
It has seven pins. If you do not know what each pin is just hold the cursor over the pin.
We can then see that pin 4 and 7 are thee Supply Voltage and pin 5 and 1 are the Offset
Voltage.
Notice when you get the part, there are several parts to choose from in the list. You should
when you browse for the part in the list see the symbol, but to the right of the symbol you can
see colourful icons ( 1, 2 or none). These indicate if the part can be used for simulation and
12
Layout ( can be checked with cursor ). This is very important that you choose the correct part
otherwise we will end up in a dead end .
I also get two resistors and a ground and make some wiring. Look in previous pages if you
have forgotten this.
R3
2k
uA741
2
R2
4
VOS1
-
1k
1
6
OUT
3
+ 7
U2
5
OS2
V+
0
Figure 21
To complete the design of this circuit get Supply Voltage from PLACE-> POWER and VCC.
Put these on the pins 4 and 7 and change the value from VCC to +12 and -12 Volt. Do not
mix them up. Pin 4 is negative Supply Voltage and pin 7 the positive.
Finally also get a DC voltage to be the input to the circuit. Our Schematic should have some
resemblance to figure 22.
Put two Voltage/Level Markers in the Schematic and make a simulation, but first you need to
make a Simulation Profile. Choose: Transient, Run Time =10, Max Step Size = 0.1
See how the bipolar Supply Voltage has been arranged. In order for the OP-amp to have both
positive and negative voltage output.
VCC
V2
R1
12
2k
-
OS1
1k
V
2V
3
+
U1
7
OUT
V+
V1
V-
uA741
2
R2
4
V
-VCC
OS2
1
0
6
V3
12
5
40.81uV
-VCC
VCC
0
2.000V
-4.000V
Figure 22
0V
This is called VCC/CAPSYM in GROUND or POWER PINS. In Figure 22 there four of
them. Then we have two DC Voltages V3 and V2. They are known as VDC.
13
The simulation gives figure 23:
Figure 23
The input is a 2V DC and the output is given by Vout = - Vin* R1/R2 = -2*2= -4 Volt.
It seems alright, but what happens if we let the input become say 7 Volt ?
Then according to the expression above for an inverting amplifier the output should become 14 Volt. Let us see if this is correct !
As you can see for yourself the output is maybe -11.8 Volt.
Figure 24
14
The fact is that the output value can not be outside the Supply Voltage range. In reality even
less. So what we can see in figure 24 is that we now face the reality of the world. We have left
the ideal linear behaviour and meet the non-linear world. This might be easier to see if we
apply a sine-wave input signal with amplitude 7 Volt and frequency 1000Hz.
Delete the input source and get the part VSIN. See figure 25 !
Please notice the parameter settings !
Edit the Simulation Profile: Transient Analysis, Run Time= 5m, Max Step Size =1u
How should one choose the simulation time and step size ? Well since we know that the input
signal has a period of 1 msec ( 1/ 1000Hz) then I think 5 periods would give us a satisfying
resolution if we have a maximum step size of 1μsec. That would give us 5000 plotting points.
Start the simulation and see the results in figure 26!
VCC
V2
R1
12
2k
-
OS1
1k
V
VOFF = 0
VAMPL = 7
FREQ = 1000
3
+
U1
7
OUT
OS2
1
6
0
V3
12
5
V+
V4
uA741
2
V-
R2
4
V
-VCC
-VCC
VCC
0
Figure 25
Figure 26
I think the results are reasonable you can see that when the input (the green plot) reaches
higher amplitude values the output becomes distorted/saturated (the red plot). This is
according to what we said earlier on top of this page.
15
You can also check the frequency content in the output signal. Since it is not a perfect sine
wave it contains other frequencies as well ( actually infinitely many). By the use of FFT (Fast
Fourier Transform) we can actually see which frequencies contribute mostly in the output
signal. Fourier Analysis says that we should look for multiples of the fundamental frequency
and in our plot that means multiples of 1000 Hz.
Click FFT in the Tools menu !
Figure 27: FFT
Exercise 2: In the next exercise we will look into some application using the diode.
Below we can see a half-wave rectifier. The voltage source is VSIN and the diode
is D1N4148. The other components you have seen before.
The simulation settings and the plots can be seen in figure 29 and 30 respectively.
I think you understand why it is called a half-wave rectifier.
D1
D1N4148
V1
VOFF = 0
VAMPL = 5
FREQ = 100
R1V
100
V
0
Figure 28
16
Figure 29
Figure 30
Check the current in the circuit ! Remove the voltage markers and place a current marker on
the diode instead. Please notice that the software gives different result what pin on the diode
you put the current marker on. For correct answer put it on the anode.
17
Exercise 3: Diode clamping circuit. Simulate the circuit below and see how it works.
All the parts have been used previously. The only difference is how the value of
the resistor is written. To make this work as intended it is important that the
period is much smaller than the product of R1C1.
C1
1u
V
VOFF = 0
VAMPL = 10
FREQ = 1000
V1
R1
1MEG
V
D2
D1N4148
V2
5V
0
Figure 31
5.000V
Figure 32
18
Figure 33
Check the current in the circuit ! Remove the voltage markers and place a current marker on
the diode instead. I hope the result do not surprise you !
Exercise 4: Clipping circuit with Zener diodes
We look for the part D02BZ3_3. This a Zener diode with Zener voltage 3.3 V in
the backward direction. In the forward direction it has approximately 0.7 V
voltage drop.
R1
20
V
VOFF = 0
VAMPL = 10
FREQ = 1000
V1
D02BZ3_3
D5
V
D4
D02BZ3_3
0
Figure 34
19
Use the same simulation settings as in the previous exercise. See the the simulation plot result
in figure 35.
Figure 35
We can see that when the input signal exceeds 4 Volt, the Zener diodes limits the output to the
same value. The Zener diodes works in pair, when one of them (D5) leads in the forward
direction the other one (D4) works in the backward and of course the opposite when we have
negative input values.
The sum of the voltage drops adds to 4 V or -4V.
20
Exercise 5: Common Emitter Amplifier with Bipolar Junction Transistor
Our Bipolar Junction Transistor BC547B is called Q2N2222 in the software.
R2
10k
R1
1.4k
V1
15
C2
Q2
C1
100u
V
100u
V
BC547B
V2
VOFF = 0
VAMPL = 10m
FREQ = 1000
V
R6
1k
R3
4.5k
R4
1k
C3
100u
0
The signal source is VSIN and the DC-supply is VDC.
The whole circuit is called a Common Emitter Amplifier.
Simulate by running a transient analysis the length should be approximately: 10 periods.
Find out the following
 Signal amplification from source to the load (R6) !
 Determine UCEQ and UBEQ !
In what region is the transistor operating ?
 What is the purpose of C1 and C2 ?
 Decide the currents ICQ and IBQ !
What DC-current gain does our transistor have ?
Characteristics for this amplifier is: Rin = low, Rout = high, Av= high
This is why this amplifier can not be used alone for signal amplification.
The low input resistance makes it difficult for a non-ideal signal source to hand-over the
major part of the signal to the amplifier. We have the same problem with the output
resistance there will be a non-advantageous voltage divider if the load .
Redovisning av laboration
1. Nedanstående är exempel på en icke-inverterande förstärkare. Hur ser man detta ?
21
V6
7
V+
U1
3
12
+
OS2
OUT
2
-
V1
VOFF = 0
VAMPL = 2
FREQ = 50
uA741
V
4
OS1
V-
5
6
1
0
12
V7
R2
4k
V
V
0
R1
1k
0
Figur 4
För att åstadkomma ovanstående koppling hämtas OP:n som uA741.
Signalkällan som VSIN och likspänningskällor för spänningsmatning av OP som VDC.
Jordsymbolen heter 0 och hittas i verktygsmenyn längst till höger under symbolen GND.
Ställ in simuleringstid till 80 msek, d v s 4 perioder. Hur stor förstärkning har vi teoretiskt i
denna koppling och hur stor får ni i er simulering ?
Vad händer om signalamplituden ökas till 3 Volt ?
Försök att uppskatta inresistansen i kopplingen m h a strömmätning i kopplingen ?
Verkar det rimligt jämför med kursboken !
2. Tag fram en inverterande förstärkare med samma förstärkning som ovan. Visa
simuleringen ! Använd samma matningsspänningar och signalkälla.
3.
Tag fram en adderare (summator) där vi adderar 3 stycken likspänningar på 0.5, -2 och 3
Volt respektive. Var och en av dessa skall få en förstärkning på en faktor 3.
Simulera denna och visa resultatet !
Bestäm själv lämpliga resistorvärden !
4.
Tag fram en OP-koppling som ger en skillnadsförstärkning (differential Amplifier ) på 5
ggr. Välj lämpliga resistorvärden själv. Antag att matningen av OP:n är + 15 Volt.
Dina insignaler är v1(t) = 2 sin(2π200t) och v2(t) = 3 sin(2π200t) .
Visa att kopplingen beter sig lämpligt !
5. I kopplingen nedan har vi en spänningsdelare inkopplad på en spänningsföljare.
22
På utgången av OP:n har vi en resistor som kan tänkas variera kraftigt, men den skall
ändå försörjas med samma spänning.
Det enda som skiljer från tidigare kopplingar är lastresistorn. Hämta komponenten
Param och lägg ut denna. Dubbelklicka på resistansvärdet och ändra resistorns värde
till {R_var}.
Dubbelklicka på Param och och välj New Column och skriv in variabelnamnet R_var
och värdet 100. Därefter Apply!
V1
12
R2
1k
U1 7
3
+
V+
OS2
OUT
2
uA741
-
4
OS1
V-
5
V2
6
0
12
1
R3
1k
RLast
{R_v ar}
V
PARAMETERS:
0
0
Figur 5
Dags för simuleringsinställning.
Figur 6
Men detta räcker inte vi behöver också göra inställning för parametern R_var.
Vi skall låta denna variera från 500Ω upp till 100 kΩ.
Se nedan för hur vi skall ställa in denna!
23
Figur 7
Hur påverkas spänningen över lasten för olika värden på belastningsresistansen ?
Om vi sänker resistansen till 100Ω. Vad händer nu ? Förklara !
Vi har i tidigare kopplingar sett exempel på förstärkarkopplingar med negativ återkoppling.
Det är önskvärt i nästan alla praktiska fall att ha negativ återkoppling för att få stabilitet samt
bli mer okänslig för variationer hos komponenter.
I några fall kan man tänka sig positiv återkoppling i bland annat två komparatorkopplingar.
En komparator är en komponent där vi jämför insignaler på 2 ingångar med varandra och den
som är störst förstärks med tecken och allt. Tänk en OP som har 2 stycken ingångar en
inverterande och en icke-inverterande. M h a positiv återkoppling kan vi med
spänningsdelning se till att omslag för komparator sker vid godtycklig spänning.
6. Bygg upp nedanstående koppling som är en inverterande komparator med
hysteres (Schmittrigger). Simulera 1 sek ( transientanalys) och ha ett maximalt
simuleringsteg på 1 msek.
V4
+
V+
U3
3
7
15
OS2
-
OS1
R5
R6
100k
100k
V5
6
1
15
V
0
V-
uA741
4
OUT
2
0
5
V6
VOFF = 0
VAMPL = 8
FREQ = 10
V
0
Figur 8
Förklara vad som händer ?
Vad menas med hysteresen i ovanstående koppling ? Vilket syfte har den ?
Om vi sänker insignalens amplitud till 7 Volt. Hur påverkar det utsignalen ?
Ändra omslagspunkterna till + 3V istället genom att välja andra värden på motstånden !
7. Visa att nedanstående låskrets fungerar som avsett !
24
C1
100u
D1N4148
D1
V1
R1
1k
VAMPL = 5
FREQ = 1000
0
8. Designa en klippkrets som klipper bort spänning ovanför 4.75 V och under -4.75. Använd
zenerdioder D02BZ3_9 ( zenerspänning 3.9 V). Bestäm själv lämpligt resistorvärde.
Visa att avsedd funktion fås. Insignal är en sinus med amplitud 7 Volt och frekvens 1000
Hz.
9. Bestäm R9 så att effektutvecklingen i zenerdioden inte överskrider 200mW !
Zenerdioden har en zenerspänning på 4.7 Volt.
Effekten kan mätas med en wattmeter. Ni hittar mätproben bland övriga mätprobar för
ström och spänning. Notera att wattmetern placeras på komponenten.
Ni kan låta R9 få variera mellan olika resistansvärden. Se elläralab hur man simulerar
ett parametriskt svep eller uppgift 5 ovan.
R3
100
R9
V4
DC = 10
D5
D02BZ4_7
0
25