EE446 Instrumentation at Clarkson University

Tuesday, April 1, 2008

Using MATLAB to Display a Frequency Response

Let’s use MATLAB to display the Bode plot or frequency response plot corresponding to a network function. As an example, consider this network function:

and this MATLAB script:


% Bode.m - plot the Bode plot of a network function

%---------------------------------------------------------------

% Create a list of logarithmically spaced frequencies.

%---------------------------------------------------------------

wmin=1; % starting frequency, rad/s

wmax=10000; % ending frequency, rad/s

w = logspace(log10(wmin),log10(wmax));

%---------------------------------------------------------------

% Enter values of the parameters that describe the

% network function.

%---------------------------------------------------------------

K= 10; % constant

z= 100; % zero

p1=10; p2=1000; % poles

%---------------------------------------------------------------

% Calculate the value of the network function at each frequency.

% Calculate the magnitude and angle of the network function.

%---------------------------------------------------------------

for k=1:length(w)

H(k) = K*(1+j*w(k)/z) / ( (1+j*w(k)/p1) * (1+j*w(k)/p2) );

mag(k) = abs(H(k));

phase(k) = angle(H(k));

end

%---------------------------------------------------------------

% Plot the Bode plot.

%---------------------------------------------------------------

subplot(2,1,1), semilogx(w/(2*pi), 20*log10(mag))

xlabel('Frequency, Hz'), ylabel('Gain, dB')

title('Bode plot')

subplot(2,1,2), semilogx(w/(2*pi), phase)

xlabel('Frequency, Hz'), ylabel('Phase, deg')


Here’s the Bode plot produced by running the MATLAB script:


1

Wednesday, March 26, 2008

Phase Margin

Consider the transfer function



For the cases

Implement the transfer function as a direct form circuit. Verify the circuit by PSpice simulation.


Determine the loop gain twice: once analytically, using the procedure described in class, and once by PSpice simulation. Compare these results to verify the loop gain.


Use the loop gain to determine the phase margin of the circuit (and the transfer function).


Report your results in a “3-level report”.



Monday, March 3, 2008

Loop gain and phase margin

EE446 Report

To: J.A. Svoboda

From: (groups consisting of 1, 2 or 3 students)

Date: March 7, 2008

Subject: Loop gain and phase margin


Introduction: The input to the amplifier shown in Figure 1 is the source voltage, vi. The output is the node voltage, vo.


Figure 1. An amplifier circuit.


The op amp in Figure 1 is a compensated op amp satisfying the following specifications:


Specification

Max

Typical

Min

Units

input offset voltage

2



mV

bias current

25



nA

input offset current

5



nA

input resistance




output resistance

0




(dc) open-loop gain



20,000

V/V

GBP



100,000

Hz

saturation voltage


15


V

saturation current


10


mA



Conclusion: The closed loop gain of the amplifier is A(f) = … and the loop-gain is T(f) = …. The phase margin of the amplifier is … so the amplifier is (un)stable.



Results:


R1: Circuit analysis shows that t he closed loop gain of the amplifier is A(f) = … and the loop-gain is T(f) = ….


R2: PSpice simulation shows that t he closed loop gain of the amplifier is A(f) = … and the loop-gain is T(f) = ….


R3: The simulation and circuit analysis (dis)agree.


R4: The phase margin of the amplifier is … so the circuit is (un)stable.




Findings:


F1.1 Analysis of the amplifier circuit shows that Aideal = …


F1.2 Analysis of the amplifier as a feedback circuit shows that β = …


F1.3 The open-loop gain of the op amp is a(f) = …


F1.4 The loop gain is T(f) =


F1.5 The closed-loop gain of the amplifier is A(f) = …


F2.1 The PSpice simulation shown in Figure 2 … The plot of |A(f)| versus f shown in Figure 3 … From the plot …. A(f) = …


F2.2 The PSpice simulation shown in Figure 2… The plot of |T(f)| versus f shown in Figure 4 … From the plot …. T(f) = …


F3.1 The closed-loop gain, A(f), obtained by circuit analysis (dis)agrees with the simulated closed-loop gain because…


F3.2 The loop gain, T(f), obtained by circuit analysis (dis)agrees with the simulated closed loop gain because…


F4.1 The PSpice simulation shown in Figure 2… The magnitude and phase of T(f) versus f are shown in Figure 5 … From these plots …. The phase margin of the amplifier circuit is .…



Thursday, February 21, 2008

PSpice model of a compensated op amp

EE446 Report

To: P.J. Galvin, R.J Shoop and M.E. Turk

From: (1, 2 or 3 person teams)

Date: 2/25/08

Subject: PSpice model of the TL054 op amp


Introduction: The circuit shown in Figure 1 is proposed as a model of a compensated op amp. This model incorporates the input and output impedances of the op amp and the open loop gain of a compensated op amp:

where ao is the dc gain, ft is the unity-gain bandwidth and vo is the node voltage at the output node of the op amp.



Figure 1.Model of a Compensated Op Amp


The parameters of the model are related to the parameters of a compensated op amp by the equations

Ri =… , A = … , R = … , C = … and Ro = …


Conclusion: …




Results:


R1: The parameters of the TL054 op amp are …. Using the equations given in the introduction, the parameters of the model of the TL054 op amp are ….


R2: The plot of vo as a function of vD shown in Figure 2 was obtained using the PSpice simulation shown in Figure 3…


R3: The simulation indicate that …



Tuesday, February 5, 2008

Using Superposition the Partition the Task


Janet Howells, Michael Kubeja, Russell Shoop, John Stevens and Michelle Turk:


EE446 Report

To:

From:

Date:

Subject: Response to bias current Ib1 in the Instrumentation Circuit


Introduction: Consider the circuit shown in Figure 1

Figure 1.

Conclusion: The output voltage, vo, of the circuit shown in Figure 1 input current IB1 by the equation …

vo = …

Results:


R1: The equation relating vo and IB1 is derived as follows: …

Finally

vo = …

R2: The plot of vo as a function of IB1 show in Figure 2 was obtained using the PSpice simulation shown in Figure 3…

R3: The simulation agrees with the equation because …



Patrick Galvin, Dillon Hanley, Andrew Potocek, Joel Reeves and James Smith:



Michael Bonadonna, Thomas Herrington, Ryan Swanson, Adam Winterkorn and Gregory Zenger:



James DeMay, Andrew Foster, James Madison, Jonathan Marshall, Kurtis Rooks and Kurt Roskopf:







Sunday, February 3, 2008

Op Amp Offset Voltage and Current

EE446 Report

To: J.A. Svoboda

From:

Date:

Subject: Effect of Op Amp Offset Voltage and Current on an Instrumentation Circuit

Introduction: The circuit shown in Figure 1 produces an output voltage, vo, that represents the temperature T, in degree C, measured by the transducer. The nonideal op amp represents the LM 307 op amp manufactured by National Semiconductor Corporation (http://www.national.com/ds/LM/LM107.pdf#page=1&search=%22LM307%22).

Figure 1. A temperature transducer and amplifier.


Conclusion: After choosing R3 = … to minimize the effects of the op amp offset, the maximum output offset voltage is eos = … which is equivalent to an input temperature of T = …


Results:

R1: Accounting for the offsets introduced by the op amp, the output voltage is given by


vo = …


R2: After choosing R3 = … to minimize the effects of the op amp offset, the maximum output offset voltage is

eos = …


R3: The maximum output offset voltage is equivalent to an input temperature of T = …



Findings:


F1.1 The nonideal op amp is modeled as shown in Figure 2.


Figure 2. Op Amp Model


F1.2 The specifications for a LM307 op amp at room temperature indicate that | vos | < …, | iB | <…, and | ios | < ….


F1.3 Replacing the nonideal op amp by its model gives the circuit shown in Figure 3.

Figure 3.


F1.4 Using superposition (provide derivation), the output voltage of the circuit shown in Figure 3 is found to be

vo = …


F2.1 To minimize the effects of the offsets, choose R3 …. (Provide derivation showing how to choose resistance R3.) Then, choose R3.


F2.2 After choosing R3 = … to minimize the effects of the op amp offset, the maximum output offset voltage is

eos = …


F2.3 The PSpice simulation shown in Figure 4 confirms this value of output offset voltage.


Figure 4. Replace this Figure with your simulation.


F3.1 The maximum output offset voltage is equivalent to an input temperature of T = …