#!/usr/local/bin/calc -d -f # # A license is hereby granted to reproduce this design for personal, # non-commercial use. # # THIS DESIGN IS PROVIDED "AS IS". THE AUTHOR PROVIDES NO WARRANTIES # WHATSOEVER, EXPRESSED OR IMPLIED, INCLUDING WARRANTIES OF # MERCHANTABILITY, TITLE, OR FITNESS FOR ANY PARTICULAR PURPOSE. THE # AUTHOR DOES NOT WARRANT THAT USE OF THIS DESIGN DOES NOT INFRINGE # THE INTELLECTUAL PROPERTY RIGHTS OF ANY THIRD PARTY IN ANY COUNTRY. # # So there. # # Copyright (c) 1992-2006, John Conover, All Rights Reserved. # # Comments and/or problem reports should be addressed to: # # john@email.johncon.com # # http://localhost/www.johncon.com/john/ # http://localhost/www.johncon.com/ntropix/ # http://localhost/www.johncon.com/ndustrix/ # http://localhost/www.johncon.com/nformatix/ # http://localhost/www.johncon.com/ndex/ # # Amp simulation script using the calc(1) arbitrary precision # calculator which can be used for calculating complex arithmetic, # (but any calculator capable of complex arithmetic could be used.) # # Use gnuplot, with "set logscale x 10", and "set logscale y 10" # before using the "plot" command to view the Bode plot of the output # of this simulation script. The script follows the analyisis and # engineering design sections, at the bottom of this file. # ###################################################################### # # Library functions: # # The value of pi = 3.14 ...: # pi = ln (-1) / (0 + 1i) # # Convert radians to degrees: # define degrees (radians) = (360 / (2 * pi)) * radians; # # Calculate the parallel combination of two complex impedances, a and # b: # define P (a, b) { return ((a * b) / (a + b)); } # # Convert a phasor, (complex number,) to angular degrees: # define phase (phasor) { local real = re (phasor), imaginary = im (phasor), angle; if (real == 0) { if (imaginary == 0) { angle = 0; } else if (imaginary > 0) { angle = 90; } else { angle = -90; } } else if (real < 0) { if (imaginary == 0) { angle = 180; } if (imaginary > 0) { angle = 180 + degrees (atan (imaginary / real)); } else { angle = - 180 + degrees (atan (imaginary / real)); } } else { angle = degrees (atan (imaginary / real)); } return (angle); } # ###################################################################### # # The small signal analysis: # # |\ |\ # | \ | \ # V1 + | \ | \ # -------| \ V3 | \ V4 # | G1 \___+____| G2 \____+ # | / | | / | # +---| / | | / | # | - | / | | / | # | | / | | / | # | |/ | |/ | # | | | # | +----+ | | # V2 +---| Zc |---+ | # | +----+ | # | | # | +----+ | # +---| Zf |------------------+ # | +----+ # | # +----+ # | Zi | # +----+ # | # | # ----- # ///// # # By superposition, V2 in terms of V3: # # Zi||Zf Zc||Zi # V2 = V3 ------------- + V4 ------------- # (Zi||Zf) + Zc (Zc||Zi) + Zf # # By the definition of gain, G2: # # V4 # V3 = -- # G2 # # Substituting to eliminate V3: # # V4 Zi||Zf Zc||Zi # V2 = -- * ------------- + V4 ------------- # G2 (Zi||Zf) + Zc (Zc||Zi) + Zf # # And rearranging for V4: # # Zi||Zf Zc||Zi # V2 = V4 [-------------------- + -------------] # G2 * ((Zi||Zf) + Zc) (Zc||Zi) + Zf # # By the definition of gain, G1 and G2: # # V4 # V3 = G1 (V1 - V2) = -- # G2 # # And, substituting the previous equation into the definition: # # Zi||Zf Zc||Zi V4 # G1 (V1 - V4 [-------------------- + -------------]) = -- # G2 * ((Zi||Zf) + Zc) (Zc||Zi) + Zf G2 # # Everything is in terms of V1 and V4, rearranging to find the gain of # the circuit by isolating terms containing V1 and V4: # # Zi||Zf Zc||Zi V4 # V1 - V4 [-------------------- + -------------] = ------- # G2 * ((Zi||Zf) + Zc) (Zc||Zi) + Zf G1 * G2 # # Solving for V1: # # V4 Zi||Zf Zc||Zi # V1 = ------ + V4 [------------------ + -------------] # G1 * G2 G2 ((Zi||Zf) + Zc) (Zc||Zi) + Zf # # And, combining terms: # # 1 Zi||Zf Zc||Zi # V1 = V4 [------- + -------------------- + -------------] # G1 * G2 G2 * ((Zi||Zf) + Zc) (Zc||Zi) + Zf # # Then, using the definition of the gain of the circit, G = V4 / V1: # # 1 # G = ------------------------------------------ # 1 Zi||Zf Zc||Zi # ------- + -------------------- + ------------- # G1 * G2 G2 * ((Zi||Zf) + Zc) (Zc||Zi) + Zf # # Note: For idealized amplifiers, G2 = infinity, G1 = 1, and Zc = # infinity, the gain, G, would be 1 + (Zf / Zi). # ###################################################################### # # The loop gain analysis: # # |\ |\ # | \ | \ # V1 + | \ | \ # +-----------| \ V3 | \ V4 # | | G1 \____+____| G2 \____+ # | | / | | / | # ----- +---| / | | / | # ///// | - | / | | / | # | | / | | / | # | |/ | |/ | # ei | | | # | | # X | | # | | # eo | | | # | | | # | +----+ | | # V2 +---| Zc |----+ | # | +----+ | # | | # | +----+ | # +---| Zf |-------------------+ # | +----+ # | # +----+ # | Zi | # +----+ # | # | # ----- # ///// # # By superposition at V3 = ei * G1 # # eo = (ei * G1) * ((Zi||Zf) / ((Zi||Zf) + Zc)) + # (ei * G1) * (G2 * ((Zc||Zi) / ((Zc||Zi) + Zf))) # # eo / ei = G1 * ((Zi||Zf) / ((Zi||Zf) + Zc)) + # G1 * (G2 * ((Zc||Zi) / ((Zc||Zi) + Zf))) # # eo / ei = G1 * (((Zi||Zf) / ((Zi||Zf) + Zc)) + # (G2 * ((Zc||Zi) / ((Zc||Zi) + Zf)))) # # eo Zi||Zf G2 * (Zc||Zi) # -- = G1 * (------------- + -------------) # ei (Zi||Zf) + Zc (Zc||Zi) + Zf # # The loop gain equation is quite formidable from an analytical # perspective-it has a pole and two complex conjugate zeros, (its a # "Miller Effect" mechanism if Zf = 1 / SC3,) in addition to the poles # both amplifier's gain equations, (G1 and G2.) # # Note: If G2 = 1, (a wire,) and Zc = infinity, (C3 = 0): # # eo Zi # -- = G1 * (-------) # ei Zi + Zf # # # # # Amp loop gain simulation script using the calc(1) arbitrary # # precision calculator which can be used for calculating complex # # arithmetic. # # # # Loop gain function, (f is the frequency of simulation, in Hertz; # # returns the value of the loop gain for frequency f): # # # define loop_gain (f) # { # local S, # R2, R3, # C3, # Zf, Zi, Zc, # F11, F12, F2, # G1, G2, G, GA, # GBW; # # S = 2 * pi * f * (0 + 1i); # # GA = 15E6; # GBW = 70E6; # # F11 = GBW / GA; # F12 = GBW; # F2 = 14E6; # # R2 = 909; # R3 = 303; # # C3 = 390E-12; # # Zf = R2; # Zi = R3; # Zc = 1 / (S * C3); # # G1 = GA / ((1 + (S / (2 * pi * F11))) * (1 + (S / (2 * pi * F12)))); # G2 = 1 / ((1 + (S / (2 * pi * F2))) * (1 + (S / (2 * pi * F2)))); # # G = G1 * (P (Zi, Zf) / (P (Zi, Zf) + Zc) + (G2 * (P (Zc, Zi) / (P (Zc, Zi) + Zf)))); # # return (G); # } # # # # Frequency by decades, then by steps of a tenth of a decade in each # # decade: # # # for (d = 0.001; d <= 100000000; d = d * 10) # { # # for (f = d; f < 10 * d; f = f + d) # { # temp = loop_gain (f); # printf ("%f\t%f\t%f\n", f, abs (temp), phase (temp)); # } # # } # ###################################################################### # # Amplifier characteristics, (see http://www.linear.com/ for # particulars): # # For the LT1115, (V = +/- 18, 0 <= Tc <= +70 C): # # GBW = 40 mHz., minimum to 70 mHz., typical, and a low frequency # gain of 1M minimum, to 15M, typical. The input noise voltage is # 1.2 nV / sqrt (Hz), typical. The wide band input bias noise # current is 2.2 pA / sqrt (Hz). The slew rate is 10 V / uS, # minimum, and 15 V / uS typical. The total harmonic distortion is # about 0.002% typical, and the intermodulation distortion is # 0.0002% typical. The CMRR is 100 dB minimum, to 120 dB typical. # # Ancillary information is a maximum input offset voltage of 250 # uV, a maximum input bias current of 550 nA, a maximum input # offset current of 200 nA, and a 1 / f noise current break point # of about 250 Hz. # # For the LT1206, (10 V <= V+ <= 30 V, 0 C <= Tc <= 70 C): # # GBW = 10.5 mHz., minimum, 14 mHz., typical. The input # capacitance is 2 pF, typical. The slew rate is 400 V / uS, # minimum, and 900 V / uS, typical. # # Ancillary information is a a noise voltage of 3.6 nV / sqrt # (Hz), a noise current of 2 pA / sqrt (Hz), an open loop gain of # 55 dB minimum, 68 dB typical, a 1 / f noise voltage break point # of about 300 Hz, a 1 / f noise current break point of about 100 # Hz, a 2nd order harmonic distortion of about -60 dB at 3 mHz, a # 3rd order harmonic distortion of about -70 dB at 4 mHz, a 3rd # order intercept of 4 dBm at 5 mHz, a CMRR of -55 dB, minimum -60 # dB typical, an input bias current of 2 uA typical to 25 uA # maximum, (positive input terminal,) and is stable with a # capacitive load of 10,000 pF. # ###################################################################### # # Engineering design: # # G = 1 + (Zf / Zi) = 1 + (R2 / R3) # # The worst case bandwidth of the amplifier is about 2 mHz, maximum, # (from the simulations.) The noise voltage would be (1.2E-9 * sqrt # (2E6)) * G = (1.2E-9 * sqrt (2E6)) * 4.0 = 68 uV, RMS. 2.2 V output # would correspond to dbFS = 32767.5, or an LSB would be 67 uV, e.g., # the noise floor of the design is about equal to one tenth the # quantization noise, or the total noise would not be significantly # increased. # # Input bias current noise for the LT1115 is 2.2 pA / sqrt (Hz). The # impedance of the input circuit is less than 600 Ohms, (i.e., the # impedance of what is driving the amplifier.) The noise contribution # would be 600 * 2.2 pA / sqrt (Hz) = 1.3E-9 V / sqrt (Hz) volts, and # is an insignificant noise contribution. # # For the negative input of the LT1115, the equivilent resistance is # 303||909 = 227. The noise contribution would be 227 * 2.2 pA / sqrt # (Hz) = 0.71E-9 V / sqrt (Hz), and is an insignificant noise # contribution. # # The 1 / f low frequency noise voltage break point for the LT1115 is # about 5 Hz., and is an insignificant noise contribution. # # The 1 / f low frequency input bias current noise break point for the # LT1115 is about 250 Hz, and is about 2.2 pA across sqrt (303^2 + # 600^2) = 672 Ohms, (the positive and negative noise voltages add # RMS,) or 1.47 nV / sqrt (Hz) at 250 Hz. The integral of 1 / f = ln # (f) which is 1.47 nV / sqrt (Hz) at 250 Hz. Therefore, X / 250 = # 1.47E-9, or X = 370E-9 V / sqrt (Hz), and 370E-9 * ln (200) - 370E-9 # * ln (1.6) = 2.0 uV - 0.17 uV = 1.8 uV, which is an insignificant # noise contribution. # # Overall noise performance, from 5 Hz. to 22 Khz., would be about 6.8 # uV of noise, which is about a factor of ten lower than the # quantization noise for 16 bit data. The objective of the design was # that the amplifier's noise contribution be significantly less than # the quantization noise of the input signal. The total system # noise-the quantization noise and amplifier noise would add RMS, for # an increase in noise of about sqrt (1.1) = 5%, or about a half # dB. The overall dynamic range would remain at about 10 log (2^16) = # 96 dB, the dynamic range of the input signal. # # The distortion of the LT1115, (including CMRR,) is 0.002%, or about # 1 in 50,000, corresponding to 65535 / 100000 = 1.3 LSB for 16 bit # data. Adding the 1 / 0 LSB RMS noise contributed by the amplifier, # the amplifier noise plus distortion is about equal to about 1 LSB # for 16 bit data. Since the quantization noise and amplifier noise, # (including harmonic distortion,) add RMS, the total noise is # increased, over the quantization noise, by 41%, or 0.4 LSB for 16 # bit data, which is an increase of 3 dB. # # The maximum slew rate the amplifier must handle is dV / dt = 44000 * # 2.2 * PI * 2 = 0.61 V / uS, for a maximum output signal of 2.2 Volts # at 44 Khz. The slew rate of the amplifier is limited by the LT1115, # which has a minimum slew rate of 10 V / uS, about sixteen times what # is required. (Note that if 22000-the sample frequency for 16 bit # data-is used as the maximum frequency, the slew rate is 0.30 V / uS, # and the LT1115 has a factor of 32 better performance than is # required, worst case.) This is an important requirement since slew # rate limited intermodulation distortion has odd order products that # are the difference of two frequencies, (i.e., a large low frequency # signal cross modulating a small high frequency.) # # Graphing the simulation, the worst case high frequency break point # of the amplifier is -3 dB at 10 mHz, (GBW = 10.5E6, 1E6 <= GA <= # 15E6,) giving 2 decades = 60 dB of loop gain at 22 kHz, (56 dB for a # gain of 4 = 12 dB,) worst case, (-6 dB for 44 kHz, would be 56 dB # and 50 dB respectively.) # # Closed loop stability is a formidable proposition from an analytical # perspective, since, if Zf = 1 / SC3, it has a pole and two complex # conjugate zeros that will split the poles of the amplifier(s) with # gain G1 and/or G2. Such an approach would yield very poor parametric # sensitivities, (over make tolerances, voltage, temperature, etc.,) # # However, inspecting the the equations of open loop gain, eo / ei, # and the closed loop gain, G, from above: # # eo Zi||Zf G2 * (Zc||Zi) # -- = G1 * (------------- + -------------) # ei (Zi||Zf) + Zc (Zc||Zi) + Zf # # 1 # G = ---------------------------------------------- # 1 Zi||Zf Zc||Zi # ------- + -------------------- + ------------- # G1 * G2 G2 * ((Zi||Zf) + Zc) (Zc||Zi) + Zf # # it can be seen, (if Zf = 1 / SC3,) that at high frequencies, (where # 1 / SC3 ~ 0): # # eo Zi||Zf # -- = G1 * ------ = G1 # ei Zi||Zf # # and: # # 1 G2 # G = ------------------------ = ------ # 1 Zi||Zf 1 # ------- + ------------- -- + 1 # G1 * G2 G2 * (Zi||Zf) G1 # # Apparently, at high frequencies, (where 1 / SC3 ~ 0,) the feedback # loop through Zf is disabled-shorted by C3-and the circuit consists # of two unity gain amplifiers in cascade. # # At low frequencies, (where 1 / SC3 ~ infinity,): # # eo Zi||Zf G2 * Zi Zi # -- = G1 * (------ + -------) = G1 * (1 + (G2 * -------) # ei Zi||Zf Zi + Zf Zi + Zf # # and: # # 1 # G = ----------------- # 1 Zi # ------- + ------- # G1 * G2 Zi + Zf # # meaning that the feedback through Zf is enabled. # # If Zf = R2, the transition between the two modes of operation occurs # at a frequency of S = -1 / R2 * C3). For frequencies less than S = # -1 / (R2 * C3), the feedback through Zf is active. For frequencies # greater than S = -G / (R2 * C3), the feedback through Zf is # inactive, and the only feedback loop is through C3; the amplifier # with gain G1 is operating in unity gain, and if it is stable in a # unity gain configuration, the design is stable. # # Note the requirements for unconditional stability: # # 1) The amplifier with gain G1 must be stable in a unity gain # configuration, worst case. # # 2) The frequency S = -1 / (R2 * C3) should be much greater # than the frequencies of interest, (22 kHz in the design.) # # 3) The frequency S = -G / (R2 * C3) should be much less # than the first pole in the gain of amplifier with gain G2, # (the gain, G, is 4.06 in the design, and the LT1206's worst # case gain bandwidth is 10.5 mHz.) # # Note that the requirements for unconditional stability do not depend # on parameters other than worst case values from the data sheet and # the values of three external components, R2 and C3. # # The pole, determined by R2 and C3, must be a decade away from 22 # kHz, or above 220 kHz. # # 4.06 times the the pole determined by R2 and C3 must be less # than the first pole in the LT1206, which is 10.5 mHz. # # Therefore: # # 220 kHz < 1 / (2 * Pi * R2 * C3) < 2.625 mHz # # or: # # 266 pF > C3 > 3.2 nF # # for R1 = 909 and R2 = 303 K. # # Thermal considerations are quite minimal. The worst case scenario is # a +/- 2.2 V P-P = 0 dBFS square wave signal into 26 Ohms using a 15 # * 1.1 = 16.5 Volt power supply for the LT1206's: # # Pd = (16.5 - 2) * 0.081 = 1.2 Watts # # The Theta junction-to-air for the TO-220 LT1206CT7 is 50 degrees C / # W, or at 27 degrees C, the junction temperature would be 27 + 60 = # 87 degrees C at room temperature. If extended temperature, or the # device is going to be tested for extended periods, then a heat sink # would be recommended, (for example, mounting the TO-220's on the # aluminum chassis; the TO-220's tab is internally connected to the # positive voltage, and Theta junction-to-case is 25 degrees C / W.) # The point to remember is that for every 10 degrees C increase in # junction temperature, the reliability is cut in half, (i.e., # whatever is going to fail, will fail twice as fast.) # # Under normal program content, (producing 85 dB SPL RMS into head/ear # phones, which is the maximum permissible,) of -18 dB RMS below # 0dBFS, the voltage would be 0.277 V RMS, and the current would be # 0.277 / 26 = 10.7 mA, or the power dissipation in each LT1206 would # be (16.5 - 0.277) * 0.0107 = 0.174 W, which would be a modest # junction temperature rise of 8.7 degrees C. # # As a reliability estimate, excluding the power supply, all # components are rated at 70 to 85 degrees C operation. The two # LT1206CT7's, the single LT1115CN8 are the most prone to failure-all # are rated at 2000 hours = 1 man year of 40 hours per week MTBF at 85 # degrees C. (All other components were selected conservatively, and # not stressed.) At 27 degrees C, and normal program content, the MTBF # would be increased to 2^((85 - 27) / 10) * 2000, which is about 100 # thousand hours, or about 50 years, for each of the 3 stressed # components at 2000 hours per year usage; the amplifier's overall # MTBF would be about 50 / 3 = 16 years of normal operation, (e.g., 40 # hours per week, 85 dB SPL program content into head/ear phones, 27 # degrees C,) assuming the failure rates to be ergodic. # ###################################################################### # # Notes and asides: # # The LT1010CT (TO-220, the tab is ground,) may be a lower cost # alternative to the LT1206, at a cost of $3.33. (The 8 pin dip # version has a theta J-A of 130 degrees C / W; 0.0677 W normal -18 dB # below 0 dBFS at 85 dB SPL would be a junction temperature rise of # about 9 degrees C. The LT1010N8 costs $2.92, each.) # # The LT1097CN8 may be a lower cost alternative to the LT1151, (but # may require a 10 K zero adjust); The Vos is 60 uV, Ib = 350 pA, Ios # = 350 pA, Vos / T = 1.6 uV / C, Ios / T = 6 pA / C. # ###################################################################### # # Operational amplifier simulation model: # # The operational amplifier simulation model assumes dominant pole, # unity gain stable, compensation, with a second pole not less than # the gain bandwidth of the amplifier-a worst case assumption of 90 + # 45 = 135 degrees of phase shift, or a phase margin of 45 # degrees. The dominant pole frequency will be approximately the gain # bandwidth divided by the low frequency gain of the amplifier. # # The addition, the high current buffer in the closed loop feedback of # the operational amplifier adds at least one more pole in the loop # gain equation, (at the gain bandwidth product of the current # buffer.) The current buffer can be modeled as a unity gain # operational amplifier, (Rf = 0, Ri = infinity,) with dominant pole # compensation, and a second high frequency pole-with the assumption # of 90 + 45 = 135 degrees of phase shift, or a margin of 45 # degrees-at the gain bandwidth product frequency. # # Thus, there are four poles in the loop gain: the dominant pole of # the operational amplifier; the second pole of the operational # amplifier; and the first and second pole of the current buffer. # # A simple op amp simulation script: # # The op amp has an open loop gain of one million, a gain bandwidth # product of one million, and a dominant pole at 1 Hertz. The closed # loop low frequency gain is unity. Its a template, and prints the # gain and phase lag from 0.1 Hz to 10 mHz. # # # # # Simple dominant pole op amp model simulation script using the # # calc(1) arbitrary precision calculator which can be used for # # calculating complex arithmetic. # # # # Simple op amp netlist function, (f is the frequency of simulation, # # in Hertz; returns the value of the gain of the op amp for frequency # # f): # # # define op_netlist (f) # { # local S, G, GBW, FP, Gol Gcl; # # S = 2 * pi * f * (0 + 1i); # # G = 1E6; # GBW = 1E6; # # FP = GBW / G; # # Gol = G / ((1 + (S / (2 * pi * FP)))); # # Gcl = 1 / ((1 / Gol) + 1); # # return (Gcl); # } # # # # Frequency by decades, then by steps of a tenth of a decade in each # # decade: # # # for (d = 0.1; d <= 1000000; d = d * 10) # { # # for (f = d; f < 10 * d; f = f + d) # { # temp = op_netlist (f); # printf ("%f\t%f\t%f\n", f, abs (temp), phase (temp)); # } # # } # ###################################################################### # # Amp simulation script using the calc(1) arbitrary precision # calculator which can be used for calculating complex arithmetic. # # Amp netlist function, (f is the frequency of simulation, in # Hertz; returns the value of the gain of the amp circuit for # frequency f): # define netlist (f) { local S, R2, R3, C3, Zi, Zf, Zc, F11, F12, F2, G1, G2, G, GA, GBW; S = 2 * pi * f * (0 + 1i); GA = 15E6; GBW = 70E6; F11 = GBW / GA; F12 = GBW; F2 = 14E6; R2 = 909; R3 = 303; C3 = 390E-12; G1 = GA / ((1 + (S / (2 * pi * F11))) * (1 + (S / (2 * pi * F12)))); G2 = 1 / ((1 + (S / (2 * pi * F2))) * (1 + (S / (2 * pi * F2)))); Zi = R3; Zf = R2; Zc = 1 / (S * C3); G = 1 / ((1 / (G1 * G2)) + (P (Zi, Zf) / (G2 * (P (Zi, Zf) + Zc))) + (P (Zc, Zi) / (P (Zc, Zi) + Zf))); return (G); } # # Frequency by decades, then by steps of a tenth of a decade in each # decade: # for (d = 0.001; d <= 100000000; d = d * 10) { for (f = d; f < 10 * d; f = f + d) { temp = netlist (f); printf ("%f\t%f\n", f, abs (temp)); } }