Simulation Tutorial Micro

advertisement
ELEC 380 Electronic Circuits II
Tutorial and Simulations for Micro-Cap IV
By
Adam Zielinski
(Posted at: http://wwwece.uvic.ca/~adam/)
Version: August 22, 2002
ELEC 380 Electronic Circuits II - Tutorial
1-1
TUTORIAL
This manual is written for Micro-Cap IV - Electronic Circuit Analysis Program
for Macintosh computers. The PC Version of the program is available at:
www.spectrum-soft.com. Prior to proceeding please familiarize yourself with
the Simulation Tutorial for ELEC 330 posted at:
http://www.ece.uvic.ca/~adam/. In this Tutorial we will explore other
interesting features of the Micro-Cap IV that are relevant to the material covered
in the class. The simulations #1 to #6 are part of preparation to the laboratory
sessions and must be completed before the laboratory and obtained presented to
the laboratory instructor.
1. AC Analysis
The AC analysis allows us to see a frequency response or AC transfer function
H(jω) of a linear circuit. You can imagine that a sinusoidal voltage source with
amplitude 1 volt is applied to a specified node of a circuit (input) and that
voltage and relative phase is measured at a different specified node (output) of
the same circuit. The voltage ratio or voltage gain and relative phase shift
between these two voltages depend on frequency applied. The gain (often
expressed in decibels or dBs) and phase are plotted vs. frequency over the
specified frequency range. Frequency often is displayed in logarithmic scale. In
such scale distance between two frequencies, one 10 times larger than the other is
constant irrespective of absolute frequency and is called a decade. Similarly,
distance between two frequencies - one twice the other is constant irrespectively
of absolute frequency and is called an octave. Such plots are called frequency
responses (amplitude and phase) of a linear circuit.
In electronic circuits we frequently encounter nonlinear elements such as
transistors. For frequency response analysis (AC analysis) such elements are
linearized prior to AC analysis. Any nonlinear circuit can be approximated by a
linear circuit if the signal applied is sufficiently small.
As an illustration let us consider a simple RC circuit shown in Figure T1.
1
E1
10k
2
0.5u
.MODEL E1 SIN (F=32 A=1 DC=0 PH=0 RS=1M RP=0 TAU=0 FS=0)
Figure T1. RC Circuit
The voltage source should be added but will not play a role in AC analysis. The
output voltage phasor V(2) at node 2 is equivalent to H(jω), which is a complex
quantity. To get the amplitude response, we need to plot magnitude of H(jω) or
mag(V(2)) which is most frequently expressed in dB. This is reflected in the
dialog box shown in Figure T2 that also includes phase response PH(V(@)). The
ELEC 380 Tutorial and Simulations
Adam Zielinski  August 2002
ELEC 380 Electronic Circuits II - Tutorial
1-2
frequency range set is from 100 kHz to 1 Hz (if you think that this is a strange
order, I agree)
Figure T2. Dialog Box
The resulting plot in logarithmic frequency axis is shown in Figure T3 with the
cursor.
0.00
-8.00
-16.00
-24.00
-32.00
-40.00
1
20*log(mag(v(2)))
10
100
1K
10K
100
1K
10K
F
0.00
-18.00
-36.00
-54.00
-72.00
-90.00
1
PH(V(2))
Expression
F
20*log(mag(v(2)))
10
Left
Right
F
Delta
0.032K
-3.032
10.000K
-49.943
9.968K
-46.911
Slope
1
-4.706m
Figure T3. The frequency response; amplitude and phase
We can observe that the amplitude frequency response represents a low-pass
filter that attenuates signal at higher frequencies. At a certain frequency the
response reaches linear asymptote with slope of -20dB/decade. We also can see
that a –3dB-point occurs at 32 Hz. This is consistent with so-called 3dB or corner
frequency for RC circuit fc = 1/2πRC. This result can be verified in time domain
by performing transient analysis for signal frequency at fc=32 Hz with set up as
shown in dialog box in Figure T4.
ELEC 380 Tutorial and Simulations
Adam Zielinski  August 2002
ELEC 380 Electronic Circuits II - Tutorial
1-3
Figure T4 Dialog Box
The results are shown in Figure T5 with cursor activated. We can see that the
output waveform - v(2) has reduced amplitude to 0.707 volts, which corresponds
to 3 dB attenuation as expected. Note also a phase shift between waveforms.
1.00
0.60
0.20
-0.20
-0.60
-1.00
0m
v(1)
20m
40m
60m
80m
100m
v(2)
T
Expression
T
v(1)
v(2)
Left
Right
Delta
42.984m
0.705
0.705
100.000m
0.951
0.318
57.016m
0.246
-0.387
Slope
1
4.318
-6.783
Figure T5 Time domain responses
2. Spectral Analysis
Spectral analysis of a periodic waveform can be performed on time domain data
x(t) using Fast Fourier Transform FFT(x) algorithm. You can think of FFT as a
Fourier Series of an infinite duration periodic waveform made of infinite
repetitions of the time domain waveform of duration T. The fundamental
frequency of Fourier Series of such constructed waveform is equal to 1/T. This
will determine the frequency resolution of spectral analysis based on FFT, that is
∆F=1/T. In order to obtain valid results using FFT it is important to place
complete number of cycles of the waveform within the observation window T.
ELEC 380 Tutorial and Simulations
Adam Zielinski  August 2002
ELEC 380 Electronic Circuits II - Tutorial
1-4
FFT calculates complex numbers and often only its magnitude is of interest.
Function MAG(FFT(x)) calculates the magnitude.
Let's illustrate these points using two sinusoidal waveforms f1=1000Hz with
amplitude 1 and another at f2=2000Hz with amplitude 0.5 as shown in Figure T6
V1
10k
V2
10k
.MODEL V1 SIN (F=1000 A=1 DC=0 PH=0 RS=1M RP=0 TAU=0 FS=0)
.MODEL V2 SIN (F=2000 A=0.5 DC=0 PH=0 RS=1M RP=0 TAU=0 FS=0)
Figure T6 Two sinusoidal waveforms
The dialog box in Figure T7 leads to the results shown in Figure 8
Figure T7 Dialog Box
ELEC 380 Tutorial and Simulations
Adam Zielinski  August 2002
ELEC 380 Electronic Circuits II - Tutorial
1-5
Figure T8 Spectral representation of two harmonic signals
The frequency points are separated by ∆F = 100Hz as expected. Each frequency
component is represented by only one point in the spectrum (triangular shape is
due to the way the points are joined by lines) and two waveforms are fully
resolved. The absolute amplitude of spectral components is related to sampling
frequency of the time-domain waveforms – the higher the sampling rate, the
larger the spectral amplitude. The relative amplitudes and frequency positions of
the two spectral components are as expected.
3. Tolerances
Value of parameters of any physical electronic component is given within certain
limits defined by tolerances. For instance, set of resistors with tolerances 10% (or
10 % lot) means that an actual individual resistor will have a random value
between +/- 10% of its nominal value. Simulation allows us to investigate finite
tolerances effect on overall performance of circuit built using real components.
Several simulations are to be performed and a random value of a component
within specified tolerances is assigned at each run. This is so called Monte Carlo
method (guess where the name came from?). For Worst Case option the
parameter is assigned randomly but only at limits of its tolerances. For N
parameters this gives 2^N possible combinations. To establish good confidence
level, the number of simulations n > 2^N.
ELEC 380 Tutorial and Simulations
Adam Zielinski  August 2002
ELEC 380 Electronic Circuits II - Tutorial
1-6
As an illustration let's go back to the simple circuit from Figure T1 but assume
that the resistor is from 10% lot. With this modification the circuit becomes as
shown in Figure T9.
10k LOT=10%
1
E1
2
0.5u
.MODEL E1 SIN (F=32 A=1 DC=0 PH=0 RS=1M RP=0 TAU=0 FS=0)
Figure T9 RC Circuit with uncertain resistor value
We will proceed to investigate its frequency response as in Figure T3.
The dialog box for Monte Carlo analysis is shown in Figure T10 and the results
are shown in Figure T11.
Figure T10 Dialog Box for Random Simulation n=10
Figure T11 Amplitude frequency response for n=10 simulations
ELEC 380 Tutorial and Simulations
Adam Zielinski  August 2002
ELEC 380 Electronic Circuits II - Tutorial
1-7
4. Temperature effects
All real electronic elements change their parameters with temperature changes.
This applies to passive elements like resistors as well as to active ones like
transistors or Operational Amplifier. Simulation is an ideal and simple method to
determine the effect of temperature on a circuit. Consider a simple voltage
divider shown in Figure T12.
1
10
R1
2
R2
.Define R1 100K TC=0.001
.Define R2 100K
Figure T12 Voltage divider circuit
Here we use symbols for resistors that need to be defined. Nominal value for
both resistors is 100 kohms but resistor R1 changes its value with temperature as
determined by its temperature coefficient TC= 0.001. This coefficient specifies
how much the resistance will change from its nominal value at nominal
temperature for a one degree Centigrade of the difference between the nominal
temperature (27 degrees) and the actual one. We will illustrate this by running a
transient analysis with printout. The dialog box is shown in Figure T13.
Figure T13 Dialog box for temperature variation
ELEC 380 Tutorial and Simulations
Adam Zielinski  August 2002
ELEC 380 Electronic Circuits II - Tutorial
1-8
The simulation is run from temperatures –27 degrees to 27 degrees in steps of 27.
The numerical results obtained are shown in Figure T14
Micro-Cap IV
Transient Analysis Limits of Temperature
Date 8/8/02 Time 10:21 PM
Temperature= -27 Case= 1
T
v(2)
(uSec)
(V)
0.000 5.139
0.200 5.139
0.400 5.139
0.600 5.139
0.800 5.139
1.000 5.139
Temperature= 0 Case= 1
T
v(2)
(uSec)
(V)
0.000 5.068
0.200 5.068
0.400 5.068
0.600 5.068
0.800 5.068
1.000 5.068
Temperature= 27 Case= 1
T
v(2)
(uSec)
(V)
0.000 5.000
0.200 5.000
0.400 5.000
0.600 5.000
0.800 5.000
1.000 5.000
Figure T 14 The temperature effects
We can see that the divider functions properly only for the nominal temperature
of 27 degrees but the voltage is higher for other temperatures. This is due to a
lower resistance of R2 at lower temperatures.
ELEC 380 Tutorial and Simulations
Adam Zielinski  August 2002
ELEC 380 Electronic Circuits II — Simulation #1
2-1
SIMULATION #1
Small Signal Amplifiers
This simulation is part of preparation to the Laboratory Session #1.
1. Design the CE amplifier shown in Figure 1-1 for biasing current IE=1mA and
gain of 36 (31.1dB) at frequency 1kHz. Note that components values shown in
Figure 1-1 are not unique.
Vcc
15
56k
910
Vo
Vs
1uF
Vi
2N3904
Ve
MV1
10k
1.5k
62uF
.MODEL MV1 SIN (F=1K A=5M DC=0 PH=0 RS=1M RP=0 TAU=0 FS=0)
.MODEL 2N3904 NPN (BF=378.5 BR=2 IS=15.8478P CJC=3.62441P CJE=4.35493P
RC=1.00539U VAF=101.811 TF=666.564P TR=173.154N MJC=300M VJC=770.477M
MJE=403.042M VJE=1 NF=1.34506 ISE=61.1468P ISC=0.00155473F IKF=14.2815M
IKR=35.709 NE=2.02174 RE=1.10494 VTF=10 ITF=9.79838M XTF=499.979M
)
Figure 1-1 CE Amplifier
2. Select the proper values for the ac source (10mVp-p, f=1kHz) and transistor
(beta= BF= 150).
3. Set the proper simulation parameters for transient analysis (see dialog
box shown in Figure 1-2) and confirm the dc and ac conditions by
simulation.
Figure 1-2 Dialog Box
ELEC 380 Tutorial and Simulations
Adam Zielinski  August 2002
ELEC 380 Electronic Circuits II — Simulation #1
2-2
Note that under the Transient – Option menu the option of calculating the
operating dc-point was selected. This allows us to see the waveforms in steady
state. Shown in Figure 1-3 is a result:
5.00m
3.00m
1.00m
-1.00m
-3.00m
-5.00m
0m
Vs
1m
2m
3m
4m
5m
3m
4m
5m
T
14.25
14.17
14.09
14.01
13.93
13.85
0m
Vo
1m
2m
T
Figure 1-3 Transient Analysis
After running transient analysis select the “state variables” under Transient
Analysis Menu. You can read numerical values of dc for all nodes: In this
particular case we got:
Figure 1-4 State Variables
This feature is very convenient to verify the dc-analysis. Alternatively, you can
select Node voltages and Node numbers as shown in Figure 1-5
ELEC 380 Tutorial and Simulations
Adam Zielinski  August 2002
ELEC 380 Electronic Circuits II — Simulation #1
2-3
Figure 1-5 Node Voltages and Node Numbers
You may observe that a waveform at node 3 (output waveform) do not oscillate
exactly around 14V, as we would expect. Can you explain it?
3. To see the gain vs. frequency we should run an ac analysis. Let us select
the following parameters shown in Figure 1-6
Figure 1-6 Dialog Box
ELEC 380 Tutorial and Simulations
Adam Zielinski  August 2002
ELEC 380 Electronic Circuits II — Simulation #1
2-4
The result is shown in Figure 1-7
30.00
29.00
28.00
27.00
26.00
25.00
100
dB(Vo/Vi)
1K
10K
100K
F
Figure 1-7 Frequency response
You can see from the graph the gain becomes independent of frequency from
approximately 1kHz.The lower freq. of operation is frequently defined as
frequency when the gain drops by 3dB compare to the flat portion of the
frequency response. In this case we have the lower frequency of operation at 150
Hz.
5. Investigate the effects of temperature on the gain by ac analysis and
temperature variation from 0 to 100 degrees in 50 degree steps. What
parameters in the circuit is temperature dependent? The results are shown in
Figure 1-8
ELEC 380 Tutorial and Simulations
Adam Zielinski  August 2002
ELEC 380 Electronic Circuits II — Simulation #1
2-5
30.00
29.00
28.00
27.00
26.00
25.00
100
dB(Vo/Vi)
1K
10K
F
Expression
Left
Right
Delta
Slope
F
dB(Vo/Vi)
0.100K
25.669
100.000K
27.355
99.900K
1.686
1
16.879u
Figure 1-8 Frequency response with a realistic component
ELEC 380 Tutorial and Simulations
Adam Zielinski  August 2002
100K
ELEC 380 Electronic Circuits II —Simulation #2
3-1
SIMULATION #2
Large Signal Amplifiers
This simulation replaces the Procedures part of the Laboratory Session #3 and
should be done prior to the lab. We will introduce here the Fourier Analysis
(FFT) in Micro-Cap IV
1. Consider the same circuit as in Simulation #1 and shown in Figure 2-1
.DEFINE RL 1K
.DEFINE RC 5K
.DEFINE RE 1K
.DEFINE VCC 9
VCC
RC
R1
Vc
C1
Vi
C3
Vo
2N3904
Ve
Vs
f=10kHz
R2
RE
C2
RL
.MODEL 2N3904 NPN (BF=378.5 BR=2 IS=15.8478P CJC=3.62441P CJE=4.35493P
RC=1.00539U VAF=101.811 TF=666.564P TR=173.154N MJC=300M VJC=770.477M
MJE=403.042M VJE=1 NF=1.34506 ISE=61.1468P ISC=0.00155473F IKF=14.2815M
IKR=35.709 NE=2.02174 RE=1.10494 VTF=10 ITF=9.79838M XTF=499.979M
)
.MODEL Vs SIN (F=10K A=15M DC=0 PH=0 RS=1M RP=0 TAU=0 FS=0)
Figure 2-1 Large Signal Amplifier
Design the amplifier shown in Figure 2-1 for the maximum output compliance.
Note: the analytic results in this case will not be accurate because of large
distortion present for a large signal applied to CE amplifier. Assume: RL=1k,
RC=5k, RE=1k and frequency of operation f=10kHz. In this simulation the values
of some resistors and capacitors are not given and must be found to obtain:
Voltage gain:
42.2 or 32.2dB
Output compliance:
PP=2.2V
2. Simulate the circuit you have designed. Investigate the gain of the amplifier
and all dc-voltages in the circuit.
First we check the frequency response of the circuit using ac analysis. Result is
shown in Figure 2-2.
ELEC 380 Tutorial and Simulations
Adam Zielinski  August 2002
ELEC 380 Electronic Circuits II —Simulation #2
3-2
40.00
36.00
32.00
28.00
24.00
20.00
100
dB(Vo/Vi)
1K
10K
100K
F
Expression
Left
Right
Delta
Slope
F
dB(Vo/Vi)
0.100K
3.085
100.000K
28.874
99.900K
25.790
1
258.155u
Figure 2-2 Frequency Response of the Amplifier
As we can see the amplifier has the gain is 29 dB, which is less than expected.
Investigate and comment of this discrepancy possibly caused by an error in the
software.
2. Now perform the transient analysis.
3.
The maximum calculated input signal to avoid output clipping is 55 mV p-p but
we will drive the input with signal 30mVp-p. In simulation select the dc-point
calculation in order to avoid transients due to capacitances in the circuit.
The result are shown in Figure 2-3
ELEC 380 Tutorial and Simulations
Adam Zielinski  August 2002
ELEC 380 Electronic Circuits II —Simulation #2
3-3
15.00m
9.00m
3.00m
-3.00m
-9.00m
-15.00m
0u
Vs1
60u
120u
180u
240u
300u
180u
240u
300u
T
3.00
2.60
2.20
1.80
1.40
1.00
0u
Vc
60u
120u
T
Figure 2-3 Input and output signals
Note that the output waveform is quite distorted. This is due to nonlinear
characteristic of the transistor that shows up for large signal operation. The peakto-peak output in this case is 0.8 Vp-p.
4. Spectral (Fourier) Analysis
5.
The Fourier analysis performs Fourier series expansion of the analyzed signal
using FFT algorithm as discussed in Tutorial. As noted it is important that you
select a complete number of cycles to assure smooth boundary between
repetitions. If the boundary contains discontinuity, higher order harmonics will
be computed which are not present in the actual waveform.
Perform the transient analysis and select the following parameters as shown in
Figure 2-4. The display will show magnitude of FFT vs. selected range of
frequencies.
Figure 2-4 Parameters for FFT
ELEC 380 Tutorial and Simulations
Adam Zielinski  August 2002
ELEC 380 Electronic Circuits II —Simulation #2
3-4
The result is shown in Figure 2-5
700.00
560.00
420.00
280.00
140.00
0.00
0K
mag((FFT(Vc)))
10K
20K
30K
40K
50K
F
Figure 2-5 The Results of FFT
We can see a dc-component is present at zero frequency; fundamental frequency
component is present at 10kHz and higher harmonics at multiple of 10 kHz. We
can access the numerical values by selecting the “N” option in “Transient
Analysis Limits” and the results are shown in Figure 2-6
Figure 2-6 The numerical Results of FFT
You can see that the second harmonic distortion in this case is (4.281/52.49) x
100% = 8%. Would you by a stereo with such distortion? What is the acceptable
value?
ELEC 380 Tutorial and Simulations
Adam Zielinski  August 2002
ELEC 380 Electronic Circuits II — Simulation #3
4-1
SIMULATION #3
Frequency Response
This simulation is part of preparation to the laboratory Session #4.
1. Consider the circuit similar to that used in Simulation #2 and shown in Figure
3-1:
VCC
RC
R1
C3
Vc
Vs1
50
C1
Vi
Vo
2N3904
Ve
Vs
f=10kHz
R2
1K
C2
1K
.MODEL 2N3904 NPN (BF=378.5 BR=2 IS=15.8478P CJC=3.62441P CJE=4.35493P
RC=1.00539U VAF=101.811 TF=666.564P TR=173.154N MJC=300M VJC=770.477M
MJE=403.042M VJE=1 NF=1.34506 ISE=61.1468P ISC=0.00155473F IKF=14.2815M
IKR=35.709 NE=2.02174 RE=1.10494 VTF=10 ITF=9.79838M XTF=499.979M
)
.MODEL Vs SIN (F=10K A=15MV DC=0 PH=0 RS=50 RP=0 TAU=0 FS=0)
Figure 3-1 Amplifier
The input is Vs1 and the output is Vo. The resistor Rs=50 represents the internal
resistance of the driving source.
2. Design the amplifier for 3dB lower frequency fL=10 kHz and midband
gain Vo/Vs of 20 (or 26dB). Assume and set the following parameters for
the transistor.
3. Confirm you design by simulation.
Simulations.
Run the ac analysis. Figure 3-2 shows what you might obtain
ELEC 380 Tutorial and Simulations
Adam Zielinski  August 2002
ELEC 380 Electronic Circuits II — Simulation #3
4-2
30.00
26.00
22.00
18.00
14.00
10.00
1K
dB(Vo/Vi)
10K
100K
1M
F
Expression
Left
Right
Delta
Slope
F
dB(Vo/Vi)
0.001M
-2.735
1.000M
23.182
0.999M
25.917
1
25.942u
Figure 3-2 Frequency Response of the amplifier
4. Assume the transistor parameters as given in the model and predict the
upper frequency of operation of your amplifier. Compare it with the result
obtained by simulation and shown in Figure 3-3:
30.00
26.00
22.00
18.00
14.00
10.00
1K
dB(Vo/Vi)
10K
100K
1M
10M
100M
1G
F
Expression
Left
F
dB(Vo/Vi)
0.199M
23.178
Right
1000.000M
8.186
Delta
Slope
999.801M
-14.991
1
-14.994n
Figure 3-3 Lower and upper frequency of operation
ELEC 380 Tutorial and Simulations
Adam Zielinski  August 2002
ELEC 380 Electronic Circuits II - Simulation #4
5-1
SIMULATION #4
Differential Amplifiers
This simulation is part of preparation to the laboratory Session #5.
Consider the differential amplifier that will be used in the laboratory and shown
in Figure 4-1:
15
1.5K
Vo
Vi
2N3904 2N3904
47
10MV
47
2.2K
-15
.MODEL 10MV SIN (F=1K A=10MV DC=0 PH=0 RS=1M RP=0 TAU=0 FS=0)
.MODEL 2N3904 NPN (BF=378.5 BR=2 IS=15.8478P CJC=3.62441P CJE=4.35493P
RC=1.00539U VAF=101.811 TF=666.564P TR=173.154N MJC=300M VJC=770.477M
MJE=403.042M VJE=1 NF=1.34506 ISE=61.1468P ISC=0.00155473F IKF=14.2815M
IKR=35.709 NE=2.02174 RE=1.10494 VTF=10 ITF=9.79838M XTF=499.979M
)
Figure 4-1 Differential amplifier
1. Perform the transient and frequency analysis using Vi as the input Vo as the
output. The results are shown in Figure 4-2 and Figure 4-3
10.00m
6.00m
2.00m
-2.00m
-6.00m
-10.00m
0m
Vi
0.60m
1.20m
1.80m
2.40m
3m
1.80m
2.40m
3m
T
10.36
10.31
10.26
10.21
10.17
10.12
0m
Vo
0.60m
1.20m
T
Figure 4-2 Transient analysis
ELEC 380 Tutorial and Simulations
Adam Zielinski  August 2002
ELEC 380 Electronic Circuits II - Simulation #4
5-2
30.00
26.00
22.00
18.00
14.00
10.00
1K
dB(Vo/Vi)
10K
100K
1M
10M
100M
F
Figure 4-3 AC Analysis
2. Modify the circuit as shown in Figure 4-4 and repeat the measurements:
15
1.5K
Vo
Vi
2N3904 2N3904
47
47
10MV
2.2K
-15
.MODEL 10MV SIN (F=1K A=10MV DC=0 PH=0 RS=1M RP=0 TAU=0 FS=0)
.MODEL 2N3904 NPN (BF=378.5 BR=2 IS=15.8478P CJC=3.62441P CJE=4.35493P
RC=1.00539U VAF=101.811 TF=666.564P TR=173.154N MJC=300M VJC=770.477M
MJE=403.042M VJE=1 NF=1.34506 ISE=61.1468P ISC=0.00155473F IKF=14.2815M
IKR=35.709 NE=2.02174 RE=1.10494 VTF=10 ITF=9.79838M XTF=499.979M
)
Figure 4-4 Modified Circuit
ELEC 380 Tutorial and Simulations
Adam Zielinski  August 2002
ELEC 380 Electronic Circuits II - Simulation #4
5-3
10.00m
6.00m
2.00m
-2.00m
-6.00m
-10.00m
0m
Vi
0.60m
1.20m
1.80m
2.40m
3m
1.80m
2.40m
3m
T
10.36
10.31
10.26
10.21
10.16
10.11
0m
Vo
0.60m
1.20m
T
Figure 4-5 Transient analysis
30.00
26.00
22.00
18.00
14.00
10.00
1K
dB(Vo/Vi)
10K
100K
1M
10M
100M
F
Expression
F
dB(Vo/Vi)
Left
0.001M
21.834
Right
100.000M
16.438
Delta
Slope
99.999M
-5.395
1
-53.952n
Figure 4-6 AC analysis
3. Modify the circuit as shown in Figure 4-7 and perform the time and the frequency
analysis (note that we have to increase amplitude of the input signal).
ELEC 380 Tutorial and Simulations
Adam Zielinski  August 2002
ELEC 380 Electronic Circuits II - Simulation #4
5-4
15
1.5K
Vo
Vi
2N3904 2N3904
47
47
2.2K
-15
1000MV
.MODEL 1000MV SIN (F=1K A=1000MV DC=0 PH=0 RS=1M RP=0 TAU=0 FS=0)
.MODEL 2N3904 NPN (BF=378.5 BR=2 IS=15.8478P CJC=3.62441P CJE=4.35493P
RC=1.00539U VAF=101.811 TF=666.564P TR=173.154N MJC=300M VJC=770.477M
MJE=403.042M VJE=1 NF=1.34506 ISE=61.1468P ISC=0.00155473F IKF=14.2815M
IKR=35.709 NE=2.02174 RE=1.10494 VTF=10 ITF=9.79838M XTF=499.979M
)
Figure 4-7 Modified Circuit
1.00
0.60
0.20
-0.20
-0.60
-1.00
0m
Vi
0.60m
1.20m
1.80m
2.40m
3m
1.80m
2.40m
3m
T
10.57
10.44
10.30
10.17
10.04
9.91
0m
Vo
0.60m
1.20m
T
Figure 4-8 Transient analysis
ELEC 380 Tutorial and Simulations
Adam Zielinski  August 2002
ELEC 380 Electronic Circuits II - Simulation #4
5-5
0.00
-4.00
-8.00
-12.00
-16.00
-20.00
1K
dB(Vo/Vi)
10K
100K
1M
F
Expression
F
dB(Vo/Vi)
Left
0.001M
-9.612
Right
Delta
Slope
1.000M
-9.602
0.999M
0.010
1
10.186n
Figure 4-9 AC analysis
4. Interpret all the results obtained and compare them with calculations
ELEC 380 Tutorial and Simulations
Adam Zielinski  August 2002
ELEC 380 Electronic Circuits II - Simulation #5
6-1
SIMULATION #5
Instrumentation Amplifier using Op. Amp
This simulation is part of preparation to the Laboratory Session #7. We will
investigate the effects of finite tolerances on the circuit performance.
The basic data for a general purpose Op. Amp like LM 741 and for comparison
for a better performance LM 107 are given in Figure 5-1
Figure 5-1 LM741 and LM 107 Data Sheets
Task:
An instrumentation amplifier with differential gain of 10 is required to operate in
the frequency band from 1kHz to 10kHz. Design such an amplifier using 1%
resistors and 741 Op. Amp with finite tolerances of its parameters.
Confirm is operation and specify the tolerance of the differential gain and the
minimum CMRR your amplifier can provide within the specified band.
ELEC 380 Tutorial and Simulations
Adam Zielinski  August 2002
ELEC 380 Electronic Circuits II - Simulation #5
6-2
1. We will start by designing a simple instrumentation amplifier and check its
differential gain using the circuit below. The first stage serves only as an
inverter to generate inverted signal needed to drive the amplifier with the
differential signal only. You might check that it does not introduce any error
in the frequency band of interest.
1K
10K
10K
18
18
Vs
LM741
Vo
10K
LM301A
1K
V
10K
18
18
.MODEL LM741 OPA (LEVEL=2 ROUTAC=50 ROUTDC=75 IOFF=20N IBIAS=80N
VEE=-18 VCC=18 VPS=16 VNS=-16 CMRR=31.6228K)
.MODEL LM301A OPA (LEVEL=2 TYPE=3 A=160K ROUTAC=50 ROUTDC=75
VOFF=2M IOFF=3N IBIAS=70N VEE=-18 VCC=18 VPS=14 VNS=-14)
.MODEL V SIN (F=1MEG A=1 DC=0 PH=0 RS=1M RP=0 TAU=0 FS=0)
Figure 5-2 Instrumentation Amplifier
Its frequency response is shown in Figure 5-3.
ELEC 380 Tutorial and Simulations
Adam Zielinski  August 2002
ELEC 380 Electronic Circuits II - Simulation #5
6-3
30.00
26.00
22.00
18.00
14.00
10.00
100
db(vo/vs)
1K
10K
100K
F
Figure 5-3 Frequency Response
2. Proceed by allowing finite tolerance in the components used to built the
amplifier.
This is done by specifying the value of a component (resistors in our case) from a
5% LOT
Proceed with the simulation. If only one run is selected, the nominal values for
components are assumed. For M runs tolerance limits are randomly selected. For
N parameters this gives 2^N possible combinations. To establish a good
confidence level M>>2^N.
The result obtained for 30 runs is shown in Figure 5-4.
ELEC 380 Tutorial and Simulations
Adam Zielinski  August 2002
ELEC 380 Electronic Circuits II - Simulation #5
6-4
30.00
26.00
22.00
18.00
14.00
10.00
100
DB(Vo/Vs)
1K
10K
F
Figure 5-4 Frequency response with random parameters
3. Modify the circuit as shown in Figure 5-5 to drive it with common mode
signal only and perform the ac analysis:
ELEC 380 Tutorial and Simulations
Adam Zielinski  August 2002
100K
ELEC 380 Electronic Circuits II - Simulation #5
6-5
1K
10K
10K
18
18
Vs
LM741
Vo
10K
LM301A
1K
V
10K
18
18
.MODEL LM741 OPA (LEVEL=2 ROUTAC=50 ROUTDC=75 IOFF=20N IBIAS=80N
VEE=-18 VCC=18 VPS=16 VNS=-16 CMRR=31.6228K)
.MODEL LM301A OPA (LEVEL=2 TYPE=3 A=160K ROUTAC=50 ROUTDC=75
VOFF=2M IOFF=3N IBIAS=70N VEE=-18 VCC=18 VPS=14 VNS=-14)
.MODEL V SIN (F=1MEG A=1 DC=0 PH=0 RS=1M RP=0 TAU=0 FS=0)
Figure 5-5 Common Mode Signal
The Common Mode AC response is shown in Figure 5-6.
-35.00
-50.00
-65.00
-80.00
-95.00
-110.00
100
db(vo/vs)
1K
10K
100K
F
Figure 5-6 Common Mode response
4. From your plots deduce all the required parameters of the inst. amp and
comment on the results obtained.
ELEC 380 Tutorial and Simulations
Adam Zielinski  August 2002
ELEC 380 Electronic Circuits II —Simulation #6
7-1
SIMULATION #6
Design of a low – pass filter
This simulation replaces Laboratory Session #10.
Tasks:
1. Design the 3rd order LP Butterworth filter with 3dB bandwidth of 10kHz and
gain of 10
2. Check your design by simulation with the exact component values.
3. Select components with 5% tolerances and check the envelope of the frequency
response for 50 runs.
4. Apply square waveform of 8kHz to your filter and observe the output.
Shown in Figure 6-1 is a sample circuit:
10K
10K
40K
10K
18
18
LM741
LM741
Vs
10K
Vo
10K
10K
V
1.59NF
18
1.59NF
18
1.59NF
.MODEL V SIN (F=1MEG A=1 DC=0 PH=0 RS=1M RP=0 TAU=0 FS=0)
.MODEL LM741 OPA (LEVEL=2 ROUTAC=50 ROUTDC=75 IOFF=20N IBIAS=80N
VEE=-18 VCC=18 VPS=16 VNS=-16 CMRR=31.6228K)
Figure 6-1 Low-pass filter
ELEC 380 Tutorial and Simulations
Adam Zielinski  August 2002
ELEC 380 Electronic Circuits II —Simulation #6
7-2
The frequency response for the exact components’ values is presented in
Figure 6-2.
22.00
18.00
14.00
10.00
6.00
2.00
1K
db(Vo/Vs)
10K
100K
F
Figure 6-2 Frequency response of the filter
Filter response with the 5% components and 50 runs with randomly varying
parameters is shown in Figure 6-3
22.00
18.00
14.00
10.00
6.00
2.00
1K
db(Vo/Vs)
10K
F
Figure 6-3 Frequency response with finite tolerances
ELEC 380 Tutorial and Simulations
Adam Zielinski  August 2002
100K
Download