20.309:Recitation 092107: Difference between revisions

From OpenWetWare
Jump to navigationJump to search
Line 76: Line 76:
|}
|}


==Modeling real components with ideal elements==
==Modeling real components==


===Modeling a battery===
*The ideal elements comprise a vocabulary of mathematical relationships that are useful for modeling real systems.
*In many situations, a single ideal element models the behavior of a real component well.
*At other times, such as high frequency, high load, or high gain, it may be necessary to create a more sophisticated model


===Example: modeling a battery===
[[Image:AAA and D cell.jpg|thumb]]
[[Image:AAA and D cell.jpg|thumb]]


===Modeling an op amp===
===Modeling an op amp===

Revision as of 19:23, 23 September 2007

20.309 Fall Semester 2007
Recitation Notes for 9/21/2007


Review of ideal circuit elements

Linear Passive
Element Symbol Equation Comments
Resistor [math]\displaystyle{ \frac{V}{I}=R }[/math]
  • constant, real impedance [math]\displaystyle{ R }[/math]
  • only element that dissipates power
Inductor [math]\displaystyle{ \frac{V}{I}=L i \omega }[/math]
  • impedance is imaginary
  • magnitude increases linearly with frequency
Capacitor [math]\displaystyle{ \frac{V}{I}=\frac{1}{C i \omega} }[/math]
  • impedance is imaginary
  • magnitude decreases as 1/ω


Independent Sources
Element Symbol Equation Comments
Voltage Source [math]\displaystyle{ V=constant }[/math]
  • constant output voltage regardless of load
  • zero output impedance
Current Source [math]\displaystyle{ I=constant }[/math]
  • constant output current regardless of load
  • infinite output impedance


Dependent Sources
Element Symbol Equation Comments
Op Amp [math]\displaystyle{ V_o=A(V_+ - V_-) }[/math]
  • [math]\displaystyle{ A\rightarrow\infty }[/math]
  • infinite input impedance
  • zero output impedance

Modeling real components

  • The ideal elements comprise a vocabulary of mathematical relationships that are useful for modeling real systems.
  • In many situations, a single ideal element models the behavior of a real component well.
  • At other times, such as high frequency, high load, or high gain, it may be necessary to create a more sophisticated model

Example: modeling a battery


Modeling an op amp

Sallen Key circuit

Key concepts

  • Even though the circuit is complicated, solving it requires only two techniques: the golden rules and Kirchoff' Current Law.
  • Because of the buffer amplifer at its output, the Sallen Key circuit has low output impedence.
  • The circuit implements a second order low pass filter. (There are also band and high pass versions.)
  • The cutoff frequency, ωc, occurs where the magnitude of the transfer funcion falls to [math]\displaystyle{ 1/\sqrt{2} }[/math].
  • Above the cutoff frequency, the second order transfer function falls off twice as fast as the first order — 40 dB per decade versus 20.

Approach to solving the Sallen Key circuit

  1. Apply the Golden Rules
  2. Apply KCL at the [math]\displaystyle{ V_x }[/math] node
  3. Apply KCL at the [math]\displaystyle{ V_- }[/math] node
  4. Solve one equation for [math]\displaystyle{ V_x }[/math] and substitute into the other
  5. Rewrite the result in the form of a transfer function [math]\displaystyle{ V_o / V_i }[/math]

ALthough the details are different, the same approach will work to solve the op amp question on Homework #1

The gruesome details

Apply the Golden Rules

In the Sallen Key circuit, a wire connects [math]\displaystyle{ V_- }[/math] to [math]\displaystyle{ V_o }[/math]. Therefore, [math]\displaystyle{ V_- = V_+ = V_o }[/math]. This will be a useful substitution when applying KCL.

Apply KCL at the [math]\displaystyle{ V_x }[/math] node

KCL
[math]\displaystyle{ \frac{V_i-V_x}{R_1} + \frac{V_o-V_x}{R_2} + C_1 s (V_o - V_x) = 0 }[/math]      (1)


Multiply by [math]\displaystyle{ R_1 R_2 }[/math]
[math]\displaystyle{ R_2(V_i-V_x) + R_1(V_o-V_x) + R_1 R_2 C_1 s (V_o - V_x) = 0 }[/math]      (2)


Gather terms
[math]\displaystyle{ R_2 V_i - (R_2 + R_1 + R_1 R_2 C_1 s) V_x + (R_1 + R_1 R_2 C_1 s)V_o = 0 }[/math]      (3)


Apply KCL at the [math]\displaystyle{ V_- }[/math] node

KCL
[math]\displaystyle{ \frac{V_x-V_o}{R_2} - V_o C_2 s = 0 }[/math]      (4)


Multiply by [math]\displaystyle{ R_2 }[/math]
[math]\displaystyle{ V_x=V_o (1 + R_2 C_2 s) }[/math]      (5)


Substitute for [math]\displaystyle{ V_x }[/math] (equation 5 into equation 3)

Sustitute
[math]\displaystyle{ R_2 V_i - (R_2 + R_1 + R_1 R_2 C_1 s) (1 + R_2 C_2 s) V_o + (R_1 + R_1 R_2 C_1 s)V_o = 0 }[/math]      (6)


Multiply and collect terms
[math]\displaystyle{ R_2 V_i + (-R_2 -R_1 - R_1 R_2 C_1 s - R_2^2 C_2 s - R_1 R_2 C_2 s - R_1 R_2^2 C_1 C_2 s^2 + R_1 + R_1 R_2 C_1 s)V_o = 0 }[/math]      (7)


[math]\displaystyle{ V_i = \{ R_1 R_2 C_1 C_2 s^2 + C_2(R_1 + R_2) s + 1\}V_o }[/math]      (8)


Rewrite as a transfer function

[math]\displaystyle{ \frac{V_o}{V_i} = \frac{1}{ R_1 R_2 C_1 C_2 s^2 + C_2(R_1 + R_2) s + 1} }[/math]      (9)


Comparison of first and second order transfer functions

Compare the Sallen Key transfer function with the first order low pass filter we considered in class:

[math]\displaystyle{ \frac{V_o}{V_i} = \frac{1}{ R C s + 1} }[/math]


Because its transfer function includes an [math]\displaystyle{ s^2 }[/math] term, the Sallen Key filter is called a second order filter. The magnitude of both functions is plotted below. Although they have similar cutoff frequencies, the Sallen Key function falls off twice as fast as the passive RC filter (40 dB/decade versus 20 dB/decade).

Here is the Matlab code that generated the plot:

%Clear the plot axes
clf;

%Component values for Sallen Key circuit (gives Fc = 1)
R1=1;
R2=1;
C1=1;
C2=1;

%Generate a vector for the frequency axis with exponential spacing
w = -2:.01:2;
w = 10 .^ w;
s = Fc * w * j;

% Sallen Key transfer function
Vsk = 1 ./ (R1 * R2 * C1 * C2 * s .^2 + (R1 + R2) * C2 * s + 1);

%Plot the magnitude of the transfer function on a log-log scale vs.
%frequency
loglog( abs(s), abs(Vsk), 'b', 'LineWidth', 3);

%Maintain the current plot
hold on

%Adjust axes for a little headroom around the plot
axis([ min(abs(s)), max(abs(s)), 1.2 * min(abs(Vsk)), 1.2 * max(abs(Vsk))])

%Component values for 1st order circuit
R = 1;
C = 1;

% Single order low pass transfer function
Vlp = 1 ./(R * C * s + 1);

%Plot the magnitude of the transfer function on athe same axes
loglog(abs(s), abs(Vlp), 'r', 'LineWidth', 3);

%Add a chart title, legend, and axis labels
title('First and Second Order Filter Responses', 'FontSize', 18)
legend('Second Order', 'First Order', 'Location', 'SouthWest');
ylabel('|H(s)|', 'FontSize', 14);
xlabel('Frequency', 'FontSize', 14);