Top Banner
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
32
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Tutorial simulations-elec 380

ELEC 380 Electronic Circuits II

Tutorial and Simulations for Micro-Cap IVBy

Adam Zielinski(Posted at: http://wwwece.uvic.ca/~adam/)

Version: August 22, 2002

Page 2: Tutorial simulations-elec 380

ELEC 380 Electronic Circuits II - Tutorial

ELEC 380 Tutorial and SimulationsAdam Zielinski August 2002

1-1

TUTORIAL

This manual is written for Micro-Cap IV - Electronic Circuit Analysis Programfor Macintosh computers. The PC Version of the program is available at:www.spectrum-soft.com. Prior to proceeding please familiarize yourself withthe Simulation Tutorial for ELEC 330 posted at:http://www.ece.uvic.ca/~adam/. In this Tutorial we will explore otherinteresting features of the Micro-Cap IV that are relevant to the material coveredin the class. The simulations #1 to #6 are part of preparation to the laboratorysessions and must be completed before the laboratory and obtained presented tothe laboratory instructor.

1. AC Analysis

The AC analysis allows us to see a frequency response or AC transfer functionH(jω) of a linear circuit. You can imagine that a sinusoidal voltage source withamplitude 1 volt is applied to a specified node of a circuit (input) and thatvoltage and relative phase is measured at a different specified node (output) ofthe same circuit. The voltage ratio or voltage gain and relative phase shiftbetween these two voltages depend on frequency applied. The gain (oftenexpressed in decibels or dBs) and phase are plotted vs. frequency over thespecified frequency range. Frequency often is displayed in logarithmic scale. Insuch scale distance between two frequencies, one 10 times larger than the other isconstant irrespective of absolute frequency and is called a decade. Similarly,distance between two frequencies - one twice the other is constant irrespectivelyof absolute frequency and is called an octave. Such plots are called frequencyresponses (amplitude and phase) of a linear circuit.

In electronic circuits we frequently encounter nonlinear elements such astransistors. For frequency response analysis (AC analysis) such elements arelinearized prior to AC analysis. Any nonlinear circuit can be approximated by alinear circuit if the signal applied is sufficiently small.

As an illustration let us consider a simple RC circuit shown in Figure T1.

10k

0.5uE1

1 2

.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. Theoutput voltage phasor V(2) at node 2 is equivalent to H(jω), which is a complexquantity. To get the amplitude response, we need to plot magnitude of H(jω) ormag(V(2)) which is most frequently expressed in dB. This is reflected in thedialog box shown in Figure T2 that also includes phase response PH(V(@)). The

Page 3: Tutorial simulations-elec 380

ELEC 380 Electronic Circuits II - Tutorial

ELEC 380 Tutorial and SimulationsAdam Zielinski August 2002

1-2

frequency range set is from 100 kHz to 1 Hz (if you think that this is a strangeorder, I agree)

Figure T2. Dialog Box

The resulting plot in logarithmic frequency axis is shown in Figure T3 with thecursor.

1 10 100 1K 10K -40.00

-32.00

-24.00

-16.00

-8.00

0.00

20*log(mag(v(2)))F

1 10 100 1K 10K -90.00

-72.00

-54.00

-36.00

-18.00

0.00

PH(V(2)) F

Expression Left Right Delta SlopeExpression Left Right Delta Slope

20*log(mag(v(2))) -3.032 -49.943 -46.911 -4.706mF 0.032K 10.000K 9.968K 1

Figure T3. The frequency response; amplitude and phase

We can observe that the amplitude frequency response represents a low-passfilter that attenuates signal at higher frequencies. At a certain frequency theresponse reaches linear asymptote with slope of -20dB/decade. We also can seethat a –3dB-point occurs at 32 Hz. This is consistent with so-called 3dB or cornerfrequency for RC circuit fc = 1/2πRC. This result can be verified in time domainby performing transient analysis for signal frequency at fc=32 Hz with set up asshown in dialog box in Figure T4.

Page 4: Tutorial simulations-elec 380

ELEC 380 Electronic Circuits II - Tutorial

ELEC 380 Tutorial and SimulationsAdam Zielinski August 2002

1-3

Figure T4 Dialog Box

The results are shown in Figure T5 with cursor activated. We can see that theoutput waveform - v(2) has reduced amplitude to 0.707 volts, which correspondsto 3 dB attenuation as expected. Note also a phase shift between waveforms.

Figure T5 Time domain responses

2. Spectral Analysis

Spectral analysis of a periodic waveform can be performed on time domain datax(t) using Fast Fourier Transform FFT(x) algorithm. You can think of FFT as aFourier Series of an infinite duration periodic waveform made of infiniterepetitions of the time domain waveform of duration T. The fundamentalfrequency of Fourier Series of such constructed waveform is equal to 1/T. Thiswill 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 placecomplete number of cycles of the waveform within the observation window T.

0m 20m 40m 60m 80m 100m -1.00

-0.60

-0.20

0.20

0.60

1.00

v(1) T

v(2)

Expression Left Right Delta Slope

v(1) 0.705 0.951 0.246 4.318 T 42.984m 100.000m 57.016m 1

v(2) 0.705 0.318 -0.387 -6.783

Page 5: Tutorial simulations-elec 380

ELEC 380 Electronic Circuits II - Tutorial

ELEC 380 Tutorial and SimulationsAdam Zielinski August 2002

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 withamplitude 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

Page 6: Tutorial simulations-elec 380

ELEC 380 Electronic Circuits II - Tutorial

ELEC 380 Tutorial and SimulationsAdam Zielinski August 2002

1-5

Figure T8 Spectral representation of two harmonic signals

The frequency points are separated by ∆F = 100Hz as expected. Each frequencycomponent is represented by only one point in the spectrum (triangular shape isdue to the way the points are joined by lines) and two waveforms are fullyresolved. The absolute amplitude of spectral components is related to samplingfrequency of the time-domain waveforms – the higher the sampling rate, thelarger the spectral amplitude. The relative amplitudes and frequency positions ofthe two spectral components are as expected.

3. Tolerances

Value of parameters of any physical electronic component is given within certainlimits defined by tolerances. For instance, set of resistors with tolerances 10% (or10 % lot) means that an actual individual resistor will have a random valuebetween +/- 10% of its nominal value. Simulation allows us to investigate finitetolerances effect on overall performance of circuit built using real components.Several simulations are to be performed and a random value of a componentwithin specified tolerances is assigned at each run. This is so called Monte Carlomethod (guess where the name came from?). For Worst Case option theparameter is assigned randomly but only at limits of its tolerances. For Nparameters this gives 2^N possible combinations. To establish good confidencelevel, the number of simulations n > 2^N.

Page 7: Tutorial simulations-elec 380

ELEC 380 Electronic Circuits II - Tutorial

ELEC 380 Tutorial and SimulationsAdam Zielinski August 2002

1-6

As an illustration let's go back to the simple circuit from Figure T1 but assumethat the resistor is from 10% lot. With this modification the circuit becomes asshown in Figure T9.

10k LOT=10%

0.5uE1

1 2

.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 resultsare shown in Figure T11.

Figure T10 Dialog Box for Random Simulation n=10

Figure T11 Amplitude frequency response for n=10 simulations

Page 8: Tutorial simulations-elec 380

ELEC 380 Electronic Circuits II - Tutorial

ELEC 380 Tutorial and SimulationsAdam Zielinski August 2002

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 liketransistors or Operational Amplifier. Simulation is an ideal and simple method todetermine the effect of temperature on a circuit. Consider a simple voltagedivider shown in Figure T12.

R1

R210

1 2

.Define R2 100K

.Define R1 100K TC=0.001

Figure T12 Voltage divider circuit

Here we use symbols for resistors that need to be defined. Nominal value forboth resistors is 100 kohms but resistor R1 changes its value with temperature asdetermined by its temperature coefficient TC= 0.001. This coefficient specifieshow much the resistance will change from its nominal value at nominaltemperature for a one degree Centigrade of the difference between the nominaltemperature (27 degrees) and the actual one. We will illustrate this by running atransient analysis with printout. The dialog box is shown in Figure T13.

Figure T13 Dialog box for temperature variation

Page 9: Tutorial simulations-elec 380

ELEC 380 Electronic Circuits II - Tutorial

ELEC 380 Tutorial and SimulationsAdam Zielinski August 2002

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 temperatureof 27 degrees but the voltage is higher for other temperatures. This is due to alower resistance of R2 at lower temperatures.

Page 10: Tutorial simulations-elec 380

ELEC 380 Electronic Circuits II — Simulation #1

ELEC 380 Tutorial and SimulationsAdam Zielinski August 2002

2-1

SIMULATION #1Small 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 andgain of 36 (31.1dB) at frequency 1kHz. Note that components values shown inFigure 1-1 are not unique.

56k

10k

910

1uF

62uF

15

1.5k

2N3904

MV1

.MODEL 2N3904 NPN (BF=378.5 BR=2 IS=15.8478P CJC=3.62441P CJE=4.35493PRC=1.00539U VAF=101.811 TF=666.564P TR=173.154N MJC=300M VJC=770.477MMJE=403.042M VJE=1 NF=1.34506 ISE=61.1468P ISC=0.00155473F IKF=14.2815MIKR=35.709 NE=2.02174 RE=1.10494 VTF=10 ITF=9.79838M XTF=499.979M)

.MODEL MV1 SIN (F=1K A=5M DC=0 PH=0 RS=1M RP=0 TAU=0 FS=0)

V iVs

Vcc

Vo

Ve

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 dialogbox shown in Figure 1-2) and confirm the dc and ac conditions bysimulation.

Figure 1-2 Dialog Box

Page 11: Tutorial simulations-elec 380

ELEC 380 Electronic Circuits II — Simulation #1

ELEC 380 Tutorial and SimulationsAdam Zielinski August 2002

2-2

Note that under the Transient – Option menu the option of calculating theoperating dc-point was selected. This allows us to see the waveforms in steadystate. Shown in Figure 1-3 is a result:

0m 1m 2m 3m 4m 5m -5.00m

-3.00m

-1.00m

1.00m

3.00m

5.00m

VsT

0m 1m 2m 3m 4m 5m 13.85

13.93

14.01

14.09

14.17

14.25

VoT

Figure 1-3 Transient Analysis

After running transient analysis select the “state variables” under TransientAnalysis Menu. You can read numerical values of dc for all nodes: In thisparticular case we got:

Figure 1-4 State Variables

This feature is very convenient to verify the dc-analysis. Alternatively, you canselect Node voltages and Node numbers as shown in Figure 1-5

Page 12: Tutorial simulations-elec 380

ELEC 380 Electronic Circuits II — Simulation #1

ELEC 380 Tutorial and SimulationsAdam Zielinski August 2002

2-3

Figure 1-5 Node Voltages and Node Numbers

You may observe that a waveform at node 3 (output waveform) do not oscillateexactly 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 selectthe following parameters shown in Figure 1-6

Figure 1-6 Dialog Box

Page 13: Tutorial simulations-elec 380

ELEC 380 Electronic Circuits II — Simulation #1

ELEC 380 Tutorial and SimulationsAdam Zielinski August 2002

2-4

The result is shown in Figure 1-7

100 1K 10K 100K 25.00

26.00

27.00

28.00

29.00

30.00

dB(Vo/Vi)F

Figure 1-7 Frequency response

You can see from the graph the gain becomes independent of frequency fromapproximately 1kHz.The lower freq. of operation is frequently defined asfrequency when the gain drops by 3dB compare to the flat portion of thefrequency response. In this case we have the lower frequency of operation at 150Hz.

5. Investigate the effects of temperature on the gain by ac analysis andtemperature variation from 0 to 100 degrees in 50 degree steps. Whatparameters in the circuit is temperature dependent? The results are shown inFigure 1-8

Page 14: Tutorial simulations-elec 380

ELEC 380 Electronic Circuits II — Simulation #1

ELEC 380 Tutorial and SimulationsAdam Zielinski August 2002

2-5

100 1K 10K 100K 25.00

26.00

27.00

28.00

29.00

30.00

dB(Vo/Vi) F

Expression Left Right Delta Slope

dB(Vo/Vi) 25.669 27.355 1.686 16.879uF 0.100K 100.000K 99.900K 1

Figure 1-8 Frequency response with a realistic component

Page 15: Tutorial simulations-elec 380

ELEC 380 Electronic Circuits II — Simulation #2

ELEC 380 Tutorial and SimulationsAdam Zielinski August 2002

3-1

SIMULATION #2Large Signal Amplifiers

This simulation replaces the Procedures part of the Laboratory Session #3 andshould 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

R1

R2

RC

C1

C2

VCC

RE

C3

RLV s

2N3904

.MODEL Vs SIN (F=10K A=15M 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.35493PRC=1.00539U VAF=101.811 TF=666.564P TR=173.154N MJC=300M VJC=770.477MMJE=403.042M VJE=1 NF=1.34506 ISE=61.1468P ISC=0.00155473F IKF=14.2815MIKR=35.709 NE=2.02174 RE=1.10494 VTF=10 ITF=9.79838M XTF=499.979M)

Vo

V i

Ve

Vc

.DEFINE RL 1K

.DEFINE RC 5K

.DEFINE RE 1K

.DEFINE VCC 9

f=10kHz

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 largedistortion 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 valuesof some resistors and capacitors are not given and must be found to obtain:

Voltage gain: 42.2 or 32.2dBOutput compliance: PP=2.2V

2. Simulate the circuit you have designed. Investigate the gain of the amplifierand all dc-voltages in the circuit.

First we check the frequency response of the circuit using ac analysis. Result isshown in Figure 2-2.

Page 16: Tutorial simulations-elec 380

ELEC 380 Electronic Circuits II — Simulation #2

ELEC 380 Tutorial and SimulationsAdam Zielinski August 2002

3-2

100 1K 10K 100K 20.00

24.00

28.00

32.00

36.00

40.00

dB(Vo/Vi) F

Expression Left Right Delta Slope

dB(Vo/Vi) 3.085 28.874 25.790 258.155uF 0.100K 100.000K 99.900K 1

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 thesoftware.

2. Now perform the transient analysis.3.

The maximum calculated input signal to avoid output clipping is 55 mV p-p butwe will drive the input with signal 30mVp-p. In simulation select the dc-pointcalculation in order to avoid transients due to capacitances in the circuit.The result are shown in Figure 2-3

Page 17: Tutorial simulations-elec 380

ELEC 380 Electronic Circuits II — Simulation #2

ELEC 380 Tutorial and SimulationsAdam Zielinski August 2002

3-3

0u 60u 120u 180u 240u 300u -15.00m

-9.00m

-3.00m

3.00m

9.00m

15.00m

Vs1T

0u 60u 120u 180u 240u 300u 1.00

1.40

1.80

2.20

2.60

3.00

VcT

Figure 2-3 Input and output signals

Note that the output waveform is quite distorted. This is due to nonlinearcharacteristic of the transistor that shows up for large signal operation. The peak-to-peak output in this case is 0.8 Vp-p.

4. Spectral (Fourier) Analysis5.

The Fourier analysis performs Fourier series expansion of the analyzed signalusing FFT algorithm as discussed in Tutorial. As noted it is important that youselect a complete number of cycles to assure smooth boundary betweenrepetitions. If the boundary contains discontinuity, higher order harmonics willbe computed which are not present in the actual waveform.

Perform the transient analysis and select the following parameters as shown inFigure 2-4. The display will show magnitude of FFT vs. selected range offrequencies.

Figure 2-4 Parameters for FFT

Page 18: Tutorial simulations-elec 380

ELEC 380 Electronic Circuits II — Simulation #2

ELEC 380 Tutorial and SimulationsAdam Zielinski August 2002

3-4

The result is shown in Figure 2-5

0K 10K 20K 30K 40K 50K 0.00

140.00

280.00

420.00

560.00

700.00

mag((FFT(Vc)))F

Figure 2-5 The Results of FFT

We can see a dc-component is present at zero frequency; fundamental frequencycomponent is present at 10kHz and higher harmonics at multiple of 10 kHz. Wecan access the numerical values by selecting the “N” option in “TransientAnalysis 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) x100% = 8%. Would you by a stereo with such distortion? What is the acceptablevalue?

Page 19: Tutorial simulations-elec 380

ELEC 380 Electronic Circuits II — Simulation #3

ELEC 380 Tutorial and SimulationsAdam Zielinski August 2002

4-1

SIMULATION #3Frequency 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 Figure3-1:

R1

R2

RC

C1

C2V s

VCC

1K

C3

1K

2N390450

f=10kHz

.MODEL 2N3904 NPN (BF=378.5 BR=2 IS=15.8478P CJC=3.62441P CJE=4.35493PRC=1.00539U VAF=101.811 TF=666.564P TR=173.154N MJC=300M VJC=770.477MMJE=403.042M VJE=1 NF=1.34506 ISE=61.1468P ISC=0.00155473F IKF=14.2815MIKR=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)

V i

VoVc

Ve

Vs1

Figure 3-1 Amplifier

The input is Vs1 and the output is Vo. The resistor Rs=50 represents the internalresistance of the driving source.

2. Design the amplifier for 3dB lower frequency fL=10 kHz and midbandgain Vo/Vs of 20 (or 26dB). Assume and set the following parameters forthe transistor.

3. Confirm you design by simulation.

Simulations.Run the ac analysis. Figure 3-2 shows what you might obtain

Page 20: Tutorial simulations-elec 380

ELEC 380 Electronic Circuits II — Simulation #3

ELEC 380 Tutorial and SimulationsAdam Zielinski August 2002

4-2

1K 10K 100K 1M 10.00

14.00

18.00

22.00

26.00

30.00

dB(Vo/Vi) F

Expression Left Right Delta Slope

dB(Vo/Vi) -2.735 23.182 25.917 25.942uF 0.001M 1.000M 0.999M 1

Figure 3-2 Frequency Response of the amplifier

4. Assume the transistor parameters as given in the model and predict theupper frequency of operation of your amplifier. Compare it with the resultobtained by simulation and shown in Figure 3-3:

1K 10K 100K 1M 10M 100M 1G 10.00

14.00

18.00

22.00

26.00

30.00

dB(Vo/Vi) F

Expression Left Right Delta Slope

dB(Vo/Vi) 23.178 8.186 -14.991 -14.994nF 0.199M 1000.000M 999.801M 1

Figure 3-3 Lower and upper frequency of operation

Page 21: Tutorial simulations-elec 380

ELEC 380 Electronic Circuits II - Simulation #4

ELEC 380 Tutorial and SimulationsAdam Zielinski August 2002

5-1

SIMULATION #4Differential Amplifiers

This simulation is part of preparation to the laboratory Session #5.Consider the differential amplifier that will be used in the laboratory and shownin Figure 4-1:

1.5K

10MV

15

47 47

2N3904 2N3904

2.2K

-15

.MODEL 2N3904 NPN (BF=378.5 BR=2 IS=15.8478P CJC=3.62441P CJE=4.35493PRC=1.00539U VAF=101.811 TF=666.564P TR=173.154N MJC=300M VJC=770.477MMJE=403.042M VJE=1 NF=1.34506 ISE=61.1468P ISC=0.00155473F IKF=14.2815MIKR=35.709 NE=2.02174 RE=1.10494 VTF=10 ITF=9.79838M XTF=499.979M)

.MODEL 10MV SIN (F=1K A=10MV DC=0 PH=0 RS=1M RP=0 TAU=0 FS=0)

V i

Vo

Figure 4-1 Differential amplifier

1. Perform the transient and frequency analysis using Vi as the input Vo as theoutput. The results are shown in Figure 4-2 and Figure 4-3

0m 0.60m 1.20m 1.80m 2.40m 3m -10.00m

-6.00m

-2.00m

2.00m

6.00m

10.00m

ViT

0m 0.60m 1.20m 1.80m 2.40m 3m 10.12

10.17

10.21

10.26

10.31

10.36

VoT

Figure 4-2 Transient analysis

Page 22: Tutorial simulations-elec 380

ELEC 380 Electronic Circuits II - Simulation #4

ELEC 380 Tutorial and SimulationsAdam Zielinski August 2002

5-2

1K 10K 100K 1M 10M 100M 10.00

14.00

18.00

22.00

26.00

30.00

dB(Vo/Vi)F

Figure 4-3 AC Analysis

2. Modify the circuit as shown in Figure 4-4 and repeat the measurements:

1.5K

10MV

15

47 47

2N3904 2N3904

2.2K

-15

.MODEL 2N3904 NPN (BF=378.5 BR=2 IS=15.8478P CJC=3.62441P CJE=4.35493PRC=1.00539U VAF=101.811 TF=666.564P TR=173.154N MJC=300M VJC=770.477MMJE=403.042M VJE=1 NF=1.34506 ISE=61.1468P ISC=0.00155473F IKF=14.2815MIKR=35.709 NE=2.02174 RE=1.10494 VTF=10 ITF=9.79838M XTF=499.979M)

.MODEL 10MV SIN (F=1K A=10MV DC=0 PH=0 RS=1M RP=0 TAU=0 FS=0)

V i

Vo

Figure 4-4 Modified Circuit

Page 23: Tutorial simulations-elec 380

ELEC 380 Electronic Circuits II - Simulation #4

ELEC 380 Tutorial and SimulationsAdam Zielinski August 2002

5-3

0m 0.60m 1.20m 1.80m 2.40m 3m -10.00m

-6.00m

-2.00m

2.00m

6.00m

10.00m

ViT

0m 0.60m 1.20m 1.80m 2.40m 3m 10.11

10.16

10.21

10.26

10.31

10.36

VoT

Figure 4-5 Transient analysis

1K 10K 100K 1M 10M 100M 10.00

14.00

18.00

22.00

26.00

30.00

dB(Vo/Vi) F

Expression Left Right Delta Slope

dB(Vo/Vi) 21.834 16.438 -5.395 -53.952nF 0.001M 100.000M 99.999M 1

Figure 4-6 AC analysis

3. Modify the circuit as shown in Figure 4-7 and perform the time and the frequencyanalysis (note that we have to increase amplitude of the input signal).

Page 24: Tutorial simulations-elec 380

ELEC 380 Electronic Circuits II - Simulation #4

ELEC 380 Tutorial and SimulationsAdam Zielinski August 2002

5-4

1.5K

1000MV

15

47 47

2N3904 2N3904

2.2K

-15

.MODEL 2N3904 NPN (BF=378.5 BR=2 IS=15.8478P CJC=3.62441P CJE=4.35493PRC=1.00539U VAF=101.811 TF=666.564P TR=173.154N MJC=300M VJC=770.477MMJE=403.042M VJE=1 NF=1.34506 ISE=61.1468P ISC=0.00155473F IKF=14.2815MIKR=35.709 NE=2.02174 RE=1.10494 VTF=10 ITF=9.79838M XTF=499.979M)

.MODEL 1000MV SIN (F=1K A=1000MV DC=0 PH=0 RS=1M RP=0 TAU=0 FS=0)

V i

Vo

Figure 4-7 Modified Circuit

0m 0.60m 1.20m 1.80m 2.40m 3m -1.00

-0.60

-0.20

0.20

0.60

1.00

ViT

0m 0.60m 1.20m 1.80m 2.40m 3m 9.91

10.04

10.17

10.30

10.44

10.57

VoT

Figure 4-8 Transient analysis

Page 25: Tutorial simulations-elec 380

ELEC 380 Electronic Circuits II - Simulation #4

ELEC 380 Tutorial and SimulationsAdam Zielinski August 2002

5-5

1K 10K 100K 1M -20.00

-16.00

-12.00

-8.00

-4.00

0.00

dB(Vo/Vi) F

Expression Left Right Delta Slope

dB(Vo/Vi) -9.612 -9.602 0.010 10.186nF 0.001M 1.000M 0.999M 1

Figure 4-9 AC analysis

4. Interpret all the results obtained and compare them with calculations

Page 26: Tutorial simulations-elec 380

ELEC 380 Electronic Circuits II - Simulation #5

ELEC 380 Tutorial and SimulationsAdam Zielinski August 2002

6-1

SIMULATION #5Instrumentation Amplifier using Op. Amp

This simulation is part of preparation to the Laboratory Session #7. We willinvestigate the effects of finite tolerances on the circuit performance.

The basic data for a general purpose Op. Amp like LM 741 and for comparisonfor 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 inthe 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 theminimum CMRR your amplifier can provide within the specified band.

Page 27: Tutorial simulations-elec 380

ELEC 380 Electronic Circuits II - Simulation #5

ELEC 380 Tutorial and SimulationsAdam Zielinski August 2002

6-2

1. We will start by designing a simple instrumentation amplifier and check itsdifferential gain using the circuit below. The first stage serves only as aninverter to generate inverted signal needed to drive the amplifier with thedifferential signal only. You might check that it does not introduce any errorin the frequency band of interest.

LM74110K

10K

1K

1K 10K

10K

VLM301A

18

18

18

18

.MODEL V SIN (F=1MEG A=1 DC=0 PH=0 RS=1M RP=0 TAU=0 FS=0)

Vs Vo

.MODEL LM741 OPA (LEVEL=2 ROUTAC=50 ROUTDC=75 IOFF=20N IBIAS=80NVEE=-18 VCC=18 VPS=16 VNS=-16 CMRR=31.6228K)

.MODEL LM301A OPA (LEVEL=2 TYPE=3 A=160K ROUTAC=50 ROUTDC=75VOFF=2M IOFF=3N IBIAS=70N VEE=-18 VCC=18 VPS=14 VNS=-14)

Figure 5-2 Instrumentation Amplifier

Its frequency response is shown in Figure 5-3.

Page 28: Tutorial simulations-elec 380

ELEC 380 Electronic Circuits II - Simulation #5

ELEC 380 Tutorial and SimulationsAdam Zielinski August 2002

6-3

100 1K 10K 100K 10.00

14.00

18.00

22.00

26.00

30.00

db(vo/vs)F

Figure 5-3 Frequency Response

2. Proceed by allowing finite tolerance in the components used to built theamplifier.

This is done by specifying the value of a component (resistors in our case) from a5% LOT

Proceed with the simulation. If only one run is selected, the nominal values forcomponents are assumed. For M runs tolerance limits are randomly selected. ForN parameters this gives 2^N possible combinations. To establish a goodconfidence level M>>2^N.

The result obtained for 30 runs is shown in Figure 5-4.

Page 29: Tutorial simulations-elec 380

ELEC 380 Electronic Circuits II - Simulation #5

ELEC 380 Tutorial and SimulationsAdam Zielinski August 2002

6-4

100 1K 10K 100K 10.00

14.00

18.00

22.00

26.00

30.00

DB(Vo/Vs)F

Figure 5-4 Frequency response with random parameters

3. Modify the circuit as shown in Figure 5-5 to drive it with common modesignal only and perform the ac analysis:

Page 30: Tutorial simulations-elec 380

ELEC 380 Electronic Circuits II - Simulation #5

ELEC 380 Tutorial and SimulationsAdam Zielinski August 2002

6-5

LM74110K

10K

1K

1K 10K

10K

VLM301A

18

18

18

18

.MODEL V SIN (F=1MEG A=1 DC=0 PH=0 RS=1M RP=0 TAU=0 FS=0)

Vs Vo

.MODEL LM741 OPA (LEVEL=2 ROUTAC=50 ROUTDC=75 IOFF=20N IBIAS=80NVEE=-18 VCC=18 VPS=16 VNS=-16 CMRR=31.6228K)

.MODEL LM301A OPA (LEVEL=2 TYPE=3 A=160K ROUTAC=50 ROUTDC=75VOFF=2M IOFF=3N IBIAS=70N VEE=-18 VCC=18 VPS=14 VNS=-14)

Figure 5-5 Common Mode Signal

The Common Mode AC response is shown in Figure 5-6.

100 1K 10K 100K-110.00

-95.00

-80.00

-65.00

-50.00

-35.00

db(vo/vs)F

Figure 5-6 Common Mode response

4. From your plots deduce all the required parameters of the inst. amp andcomment on the results obtained.

Page 31: Tutorial simulations-elec 380

ELEC 380 Electronic Circuits II — Simulation #6

ELEC 380 Tutorial and SimulationsAdam Zielinski August 2002

7-1

SIMULATION #6Design 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 frequencyresponse 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

10K

10K

40K

10K

1.59NF1.59NF

1.59NF

10K

V

LM741

LM74118

18

18

18

.MODEL V SIN (F=1MEG A=1 DC=0 PH=0 RS=1M RP=0 TAU=0 FS=0)

Vs

Vo

.MODEL LM741 OPA (LEVEL=2 ROUTAC=50 ROUTDC=75 IOFF=20N IBIAS=80NVEE=-18 VCC=18 VPS=16 VNS=-16 CMRR=31.6228K)

Figure 6-1 Low-pass filter

Page 32: Tutorial simulations-elec 380

ELEC 380 Electronic Circuits II — Simulation #6

ELEC 380 Tutorial and SimulationsAdam Zielinski August 2002

7-2

The frequency response for the exact components’ values is presented inFigure 6-2.

1K 10K 100K 2.00

6.00

10.00

14.00

18.00

22.00

db(Vo/Vs)F

Figure 6-2 Frequency response of the filter

Filter response with the 5% components and 50 runs with randomly varyingparameters is shown in Figure 6-3

1K 10K 100K 2.00

6.00

10.00

14.00

18.00

22.00

db(Vo/Vs)F

Figure 6-3 Frequency response with finite tolerances