Content deleted Content added
m Robot: Automated text replacement (-{{Wikibookspar +{{Wikibooks) |
Em3rgent0rdr (talk | contribs) There must have previously been a diagram showing non-idealities, so I've readded one back with a short caption identifying some of them. Also simply having a "large" gain and input impedance isn't enough to be "considered ideal", but rather the unreachable "ideal" would have infinite gain and infinite input impedance. |
||
(521 intermediate revisions by more than 100 users not shown) | |||
Line 1:
{{Short description|none}} <!-- This short description is INTENTIONALLY "none" - please see WP:SDNONE before you consider changing it! -->
{{main article|Operational amplifier}}
This article illustrates some typical '''operational amplifier applications'''. Operational amplifiers are optimised for use with [[negative feedback]], and this article discusses only negative-feedback applications. When positive feedback is required, a [[comparator]] is usually more appropriate. See [[Comparator applications]] for further information.
== Practical considerations ==
[[File:Op-Amp_Internal.svg|right|thumb|250x250px|Fig. 1: an equivalent circuit of an operational amplifier that models some non-ideal parameters using resistances. A real operational amplifier has a finite input impedance <math>R_\text{in}</math>, a non-zero output impedance <math>R_\text{out}</math>, and a finite gain <math>G</math>.]]
In this article, a simplified schematic notation is used that ignores details such as device selection and power supply connections. Non-ideal properties (such as those shown in Fig. 1) are ignored.
=== Operational amplifiers parameter requirements ===
In order for a particular device to be used in an application, it must satisfy certain requirements. The operational amplifier must
* have large open-loop signal gain (voltage gain of 200,000 is obtained in early integrated circuit exemplars), and
* have input impedance large with respect to values present in the feedback network.
With these requirements satisfied, one can use the method of [[virtual ground]] to quickly and intuitively grasp the behavior of the op-amp circuits.
=== Component specification ===
Resistors used in practical solid-state op-amp circuits are typically in the kΩ range. Resistors much greater than 1 MΩ cause excessive [[thermal noise]] and make the circuit operation susceptible to significant errors due to bias or leakage currents.
=== Input bias currents and input offset ===
Practical operational amplifiers draw a small current from each of their inputs due to bias requirements (in the case of bipolar junction transistor-based inputs) or leakage (in the case of MOSFET-based inputs).
These currents flow through the resistances connected to the inputs and produce small voltage drops across those resistances. Appropriate design of the feedback network can alleviate problems associated with input bias currents and common-mode gain, as explained below. The heuristic rule is to ensure that the impedance "looking out" of each input terminal is identical.
===Power supply effects===
Although power supplies are not indicated in the (simplified) operational amplifier designs below, they are nonetheless present and can be critical in operational amplifier circuit design.
==== Supply noise ====
Power supply imperfections (e.g., power signal ripple, non-zero source impedance) may lead to noticeable deviations from ideal operational amplifier behavior. For example, operational amplifiers have a specified [[power supply rejection ratio]] that indicates how well the output can reject signals that appear on the power supply inputs. Power supply inputs are often noisy in large designs because the power supply is used by nearly every component in the design, and inductance effects prevent current from being instantaneously delivered to every component at once. As a consequence, when a component requires large injections of current (e.g., a digital component that is frequently switching from one state to another), nearby components can experience sagging at their connection to the power supply. This problem can be mitigated with appropriate use of [[decoupling capacitor|bypass capacitor]]s connected across each power supply pin and ground. When bursts of current are required by a component, the component can ''bypass'' the power supply by receiving the current directly from the nearby capacitor (which is then slowly recharged by the power supply).
==== Using power supply currents in the signal path ====
Additionally, current drawn into the operational amplifier from the power supply can be used as inputs to external circuitry that augment the capabilities of the operational amplifier. For example, an operational amplifier may not be fit for a particular high-gain application because its output would be required to generate signals outside of the safe range generated by the amplifier. In this case, an external [[push–pull output|push–pull amplifier]] can be controlled by the current into and out of the operational amplifier. Thus, the operational amplifier may itself operate within its factory specified bounds while still allowing the negative feedback path to include a large output signal well outside of those bounds.<ref>Paul Horowitz and Winfield Hill, ''[[The Art of Electronics]]''. 2nd ed. Cambridge University Press, Cambridge, 1989 {{ISBN|0-521-37095-7}}</ref>
==Amplifiers==
The first example is the differential amplifier, from which many of the other applications can be derived, including the [[#Inverting amplifier|inverting]], [[#Non-inverting amplifier configuration|non-inverting]], and [[summing amplifier]], the [[#Voltage follower|voltage follower]], [[#Inverting integrator|integrator]], [[#Inverting differentiator|differentiator]], and [[#Inductance gyrator|gyrator]].
=== Differential amplifier (difference amplifier) ===
{{main article|Differential amplifier}}
[[File:Op-Amp Differential Amplifier.svg|300px||class=skin-invert]]
Amplifies the difference in voltage between its inputs.
:The name "differential amplifier" must not be confused with the "[[#Inverting differentiator|differentiator]]", which is also shown on this page.
:The "[[#Instrumentation amplifier|instrumentation amplifier]]", which is also shown on this page, is a modification of the differential amplifier that also provides high [[input impedance]].
The circuit shown computes the [[subtraction|difference]] of two voltages, multiplied by some gain factor. The output voltage
Or, expressed as a function of the common-mode input ''V''<sub>com</sub> and difference input ''V''<sub>dif</sub>:
:<math>V_\text{com} = (V_1 + V_2) / 2; V_\text{dif} = V_2 - V_1,</math>
the output voltage is
:<math>V_\text{out} \frac{R_1}{R_\text{f}} = V_\text{com} \frac{R_1 / R_\text{f} - R_2 / R_\text{g}}{1 + R_2 / R_\text{g}} + V_\text{dif} \frac{1 + (R_2 / R_\text{g} + R_1 / R_\text{f}) / 2}{1 + R_2 / R_\text{g}}.</math>
In order for this circuit to produce a signal proportional to the voltage difference of the input terminals, the coefficient of the ''V''<sub>com</sub> term (the common-mode gain) must be zero, or
:<math>R_1 / R_\text{f} = R_2 / R_\text{g}.</math>
With this constraint<ref group="nb">If you think of the left-hand side of the relation as the closed-loop gain of the inverting input, and the right-hand side as the gain of the non-inverting input, then matching these two quantities provides an output insensitive to the common-mode voltage of <math>V_1</math> and <math>V_2</math>.</ref> in place, the [[common-mode rejection ratio]] of this circuit is infinitely large, and the output
:<math>V_\text{out} = \frac{R_\text{f}}{R_1} V_\text{dif} = \frac{R_\text{f}}{R_1} \left(V_2 - V_1\right),</math>
where the simple expression ''R''<sub>''f''</sub> / ''R''<sub>1</sub> represents the closed-loop gain of the differential amplifier.
The special case when the closed-loop gain is unity is a differential follower, with
:<math>V_\text{out} = V_2 - V_1.</math>
{{clear}}
=== Inverting amplifier ===
[[File:Op-Amp Inverting Amplifier.svg|300px|class=skin-invert]]
An inverting amplifier is a special case of the [[differential amplifier]] in which that circuit's non-inverting input ''V''<sub>2</sub> is grounded, and inverting input ''V''<sub>1</sub> is identified with ''V''<sub>in</sub> above. The closed-loop gain is ''R''<sub>f</sub> / ''R''<sub>in</sub>, hence
:<math>V_{\text{out}} = -\frac{R_{\text{f}}}{R_{\text{in}}} V_{\text{in}}\!\,</math>.
The simplified circuit above is like the differential amplifier in the limit of ''R''<sub>2</sub> and ''R''<sub>g</sub> very small. In this case, though, the circuit will be susceptible to input bias current drift because of the mismatch between ''R''<sub>f</sub> and ''R''<sub>in</sub>.
To intuitively see the gain equation above, calculate the current in ''R''<sub>in</sub>:
:<math> i_{\text{in}} = \frac{ V_{\text{in}} }{ R_{\text{in}} } </math>
then recall that this same current must be passing through ''R''<sub>f</sub>, therefore (because ''V''<sub>−</sub> = ''V''<sub>+</sub> = 0):
:<math> V_{\text{out}} = -i_{\text{in}} R_{\text{f}} = - V_{\text{in}} \frac{ R_{\text{f}} }{ R_{\text{in}} }</math>
A mechanical analogy is a seesaw, with the ''V''<sub>−</sub> node (between ''R''<sub>in</sub> and ''R''<sub>f</sub>) as the fulcrum, at ground potential. ''V''<sub>in</sub> is at a length ''R''<sub>in</sub> from the fulcrum; ''V''<sub>out</sub> is at a length ''R''<sub>f</sub>. When ''V''<sub>in</sub> descends "below ground", the output ''V''<sub>out</sub> rises proportionately to balance the seesaw, and ''vice versa''.<ref>Basic Electronics Theory, Delton T. Horn, 4th ed. McGraw-Hill Professional, 1994, p. 342–343.</ref>
As the negative input of the op-amp acts as a virtual ground, the input impedance of this circuit is equal to ''R''<sub>in</sub>.
{{clear}}
===Non-inverting amplifier{{anchor|Non-inverting amplifier configuration}}===
[[File:Op-Amp Non-Inverting Amplifier.svg|300px|class=skin-invert]]
A non-inverting amplifier is a special case of the [[differential amplifier]] in which that circuit's inverting input ''V''<sub>1</sub> is grounded, and non-inverting input ''V''<sub>2</sub> is identified with ''V''<sub>in</sub> above, with ''R''<sub>1</sub> ≫ ''R''<sub>2</sub>.
Referring to the circuit immediately above,
:<math>V_{\text{out}} = \left(1 + \frac{ R_{\text{2}} }{ R_{\text{1}} } \right) V_{\text{in}}\!\,</math>.
To intuitively see this gain equation, use the virtual ground technique to calculate the current in resistor ''R''<sub>1</sub>:
:<math> i_1 = \frac{ V_{\text{in}} }{ R_1 }\,, </math>
then recall that this same current must be passing through ''R''<sub>2</sub>, therefore:
:<math> V_{\text{out}} = V_{\text{in}} + i_1 R_2 = V_{\text{in}} \left( 1 + \frac{ R_2 }{ R_1 } \right)</math>
Unlike the inverting amplifier, a non-inverting amplifier cannot have a gain of less than 1.
A mechanical analogy is a [[Lever#Classes of levers|class-2 lever]], with one terminal of ''R''<sub>1</sub> as the fulcrum, at ground potential. ''V''<sub>in</sub> is at a length ''R''<sub>1</sub> from the fulcrum; ''V''<sub>out</sub> is at a length ''R''<sub>2</sub> further along. When ''V''<sub>in</sub> ascends "above ground", the output ''V''<sub>out</sub> rises proportionately with the lever.
The input impedance of the simplified non-inverting amplifier is high:
:<math> Z_{\text{in}} = (1+A_\text{OL}B)Z_{\text{dif}}</math>
where ''Z''<sub>dif</sub> is the op-amp's input impedance to differential signals, and ''A''<sub>OL</sub> is the open-loop voltage gain of the op-amp (which varies with frequency), and ''B'' is the [[Negative-feedback amplifier#Gain reduction|feedback factor]] (the fraction of the output signal that returns to the input).<ref name=":1">{{Cite web|url=http://hyperphysics.phy-astr.gsu.edu/hbase/Electronic/feedn.html#c3|title=Benefits of Negative Feedback|website=HyperPhysics|access-date=2018-05-07}}</ref><ref name=":0">{{Cite book|last=Simpson|first=Robert E.|title=Introductory electronics for scientists and engineers|date=1987|publisher=Allyn and Bacon|isbn=0205083773|edition=2nd|___location=Boston|pages=291|chapter=7.2 Negative Voltage Feedback|oclc=13821010|quote=input impedance of an amplifier without negative feedback is ''increased'' by adding negative feedback. .. <math>Z_\mathrm{inf}=(1+A_0 B)Z_\mathrm{ino}</math> .. output impedance .. is ''decreased'' .. <math>Z_\mathrm{outf}=Z_\mathrm{out} / (1+A_0 B)</math>}}</ref> In the case of the ideal op-amp, with ''A''<sub>OL</sub> infinite and ''Z''<sub>dif</sub> infinite, the input impedance is also infinite. In this case, though, the circuit will be susceptible to input bias current drift because of the mismatch between the impedances driving the ''V''<sub>+</sub> and ''V''<sub>−</sub> op-amp inputs.
The feedback loop similarly decreases the output impedance:
:<math> Z_{\text{out}} = \frac{Z_{\text{OL}}}{1+A_\text{OL}B}</math>
where ''Z''<sub>out</sub> is the output impedance with feedback, and ''Z''<sub>OL</sub> is the open-loop output impedance.<ref name=":0" />
{{clear}}
=== Voltage follower (unity buffer amplifier){{anchor|Voltage follower}} ===
[[File:Op-Amp Unity-Gain Buffer.svg|200px|class=skin-invert]]
Used as a [[buffer amplifier]] to eliminate loading effects (e.g., connecting a device with a high [[source impedance]] to a device with a low [[input impedance]]).
:<math> V_{\text{out}} = V_{\text{in}} \! </math>
:<math>Z_{\text{in}} = \infty</math> (realistically, the differential input impedance of the op-amp itself (1 MΩ to 1 TΩ), multiplied by the open-loop gain of the op-amp)
Due to the strong (i.e., [[unity (mathematics)|unity]] gain) feedback and certain non-ideal characteristics of real operational amplifiers, this feedback system is prone to have poor [[phase margin|stability margin]]s. Consequently, the system may be [[BIBO stability|unstable]] when connected to sufficiently capacitive loads. In these cases, a [[frequency compensation|lag compensation]] network (e.g., connecting the load to the voltage follower through a resistor) can be used to restore stability. The manufacturer [[data sheet]] for the operational amplifier may provide guidance for the selection of components in external compensation networks. Alternatively, another operational amplifier can be chosen that has more appropriate internal compensation.
The input and output impedance are affected by the feedback loop in the same way as the non-inverting amplifier, with ''B''=1.<ref name=":1" /><ref name=":0" />
{{clear}}
=== Summing amplifier ===
[[
A summing
:<math> V_{\text{out}} = -R_{\text{f}} \left( \frac{V_1}{R_1} + \frac{V_2}{R_2} + \cdots + \frac{V_n}{R_n} \right) </math>
Line 137 ⟶ 130:
* When <math>R_1 = R_2 = \cdots = R_n</math>, and <math>R_{\text{f}}</math> independent
:<math> V_{\text{out}} = -\frac{R_{\text{f}}}{R_1} ( V_1 + V_2 + \cdots + V_n ) \!
* When <math>R_1 = R_2 = \cdots = R_n = R_{\text{f}}</math>
:<math> V_{\text{out}} = -( V_1 + V_2 + \cdots + V_n ) \!
* Input impedance of the '''''n''th''' input is <math>Z_n = R_n</math> (<math>V_-</math> is a [[virtual ground]])
=== Instrumentation amplifier ===
{{main article|Instrumentation amplifier}}
[[File:Op-Amp Instrumentation Amplifier.svg|300px|class=skin-invert]]
Combines very high [[input impedance]], high [[common-mode rejection]], low [[DC offset]], and other properties used in making very accurate, low-noise measurements
* Is made by adding a [[#Non-inverting amplifier|non-inverting]] [[buffer amplifier|buffer]] to each input of the [[#Differential_amplifier_.28difference_amplifier.29|differential amplifier]] to increase the input impedance.
{{clear}}
==Oscillators==
=== Wien bridge oscillator ===
{{main article|Wien bridge oscillator}}
[[File:Wien bridge classic osc.svg|300px|class=skin-invert]]
Produces a very low distortion [[sine wave]]. Uses negative temperature compensation in the form of a light bulb or diode.
{{clear}}
==Filters==
{{main article|Active filter}}
Operational amplifiers can be used in construction of [[active filter]]s, providing high-pass, low-pass, band-pass, reject and delay functions. The high input impedance and gain of an op-amp allow straightforward calculation of element values, allowing accurate implementation of any desired filter topology with little concern for the loading effects of stages in the filter or of subsequent stages. However, the frequencies at which active filters can be implemented is limited; when the behavior of the amplifiers departs significantly from the ideal behavior assumed in elementary design of the filters, filter performance is degraded.
==Comparator==
{{main article|Comparator|Comparator applications}} [[File:Op-Amp Comparator.svg|200px|class=skin-invert]]
An operational amplifier can, if necessary, be forced to act as a comparator. The smallest difference between the input voltages will be amplified enormously, causing the output to swing to nearly the supply voltage. However, it is usually better to use a dedicated comparator for this purpose, as its output has a higher slew rate and can reach either power supply rail. Some op-amps have clamping diodes on the input that prevent use as a comparator.<ref>{{cite web | url=http://e2e.ti.com/blogs_/archives/b/thesignal/archive/2012/03/14/op-amps-used-as-comparators-is-it-okay.aspx | title=Op Amps used as Comparators—is it okay? - the Signal - Archives - TI E2E support forums }}</ref>
==Integration and differentiation==
=== Inverting integrator ===
{{main article|Op amp integrator}}
The integrator is mostly used in [[analog computer]]s, [[analog-to-digital converter]]s and wave-shaping circuits. A simple version is:
[[File:Op-Amp Integrating Amplifier.svg|300px|class=skin-invert]]
Assuming ideal elements, it [[Integral|integrates]] the input signal (multiplied by <math>-\tfrac{1}{RC}</math>) over a time interval from ''t''<sub>0</sub> to ''t''<sub>1</sub>, yielding an output voltage at time ''t'' = ''t''<sub>1</sub> of:
:<math>V_\text{out}(t_1) = V_\text{out}(t_0) - \frac{1}{RC} \int_{t_0}^{t_1} V_\text{in}(t) \,dt,</math>
where ''V''<sub>out</sub>(''t''<sub>0</sub>) is the capacitor's initial voltage at time ''t'' = ''t''<sub>0</sub>. In other words, the circuit's output voltage changes over the time interval by an amount proportional to the time integral of the input voltage:
:<math>-\frac{1}{RC} \int_{t_0}^{t_1} V_\text{in}(t) \,dt.</math>
This circuit can be viewed as an active [[Low-pass filter|low-pass]] [[electronic filter]] with a single [[complex pole|pole]] at DC (i.e., where <math>\omega = 0</math>).
Its practicality is limited by a significant problem: unless the capacitor is periodically discharged, the output voltage will eventually drift outside of the operational amplifier's operating range. This can be due to any combination of:
* a non-zero [[DC component]] in the input ''V''<sub>in</sub>,
* a non-zero opamp input bias current,
* a non-zero opamp input offset voltage.<ref name="microchip-opa-dc">{{cite web
|title = AN1177 Op-Amp Precision Design: DC Errors
|publisher = Microchip
|date = 2 January 2008
|url = http://ww1.microchip.com/downloads/en/AppNotes/01177a.pdf
|archive-url = https://web.archive.org/web/20190709005741/http://ww1.microchip.com/downloads/en/AppNotes/01177a.pdf
|archive-date = 2019-07-09
|url-status = live
|access-date = 26 December 2012
}}</ref>
The following slightly more complex circuit can ameliorate the second two problems, and in some cases, the first as well, but has a limited bandwidth of integration:
[[File:Op-Amp Integrating Amplifier balanced.svg|100pxl|class=skin-invert]]
Here, the feedback resistor R<sub>f</sub> provides a discharge path for capacitor C<sub>f</sub>. The series resistor R<sub>n</sub> at the non-inverting input alleviates input bias current and common-mode problems, provided it is set to the parallel resistance of R<sub>i</sub> [[Parallel (operator)#Circuit analysis|||]] R<sub>f</sub>:
:<math>R_\text{n} = R_\text{i} || R_\text{f} = \frac{1}{ \frac{1}{R_\text{i}} + \frac{1}{R_\text{f}} } \, .</math>
{{Section link|Op amp integrator|Practical circuit}} explains the output drift adds a small finite DC error voltage:
: <math>V_\text{error} = \left( \frac{R_\text{f}}{R_\text{i}} + 1 \right) \left( V_\text{OS} + I_\text{B-} \left( R_\text{f} \parallel R_\text{i} \right) \right) .</math>
Because the circuit is a first-order low-pass filter with a flat response up to its cutoff frequency <math>\tfrac{1}{2 \pi C_f R_f}</math>, it only functions as an integrator for frequencies significantly higher than that cutoff.{{clear}}
=== Inverting differentiator ===
{{main article|Differentiator#Active differentiator}}
[[File:Op-Amp Differentiating Amplifier.svg|300px|class=skin-invert]]
Assuming ideal elements, this circuit [[Derivative|differentiates]] the signal (multiplied by <math>-RC</math>) over time:
:<math>V_\text{out} = -RC \frac{dV_\text{in}}{dt},</math>
where <math>V_\text{in}</math> and <math>V_\text{out}</math> are functions of time.
The transfer function of the inverting differentiator has a single [[complex zero|zero]] in the origin (i.e., where [[angular frequency]] <math>\omega = 0</math>). The high-pass characteristics of a differentiating amplifier can lead to stability challenges when the circuit is used in an analog servo loop (e.g., in a [[PID controller]] with a significant derivative gain). In particular, as a [[root locus|root locus analysis]] would show, increasing feedback gain will drive a closed-loop pole toward marginal stability at the DC zero introduced by the differentiator.
==Synthetic elements==
=== Inductance gyrator ===
{{main article|Gyrator}}
[[File:Op-Amp Gyrator.svg|300px|class=skin-invert]]
Simulates an [[inductor]] (i.e., provides [[inductance]] without the use of a possibly costly inductor). The circuit exploits the fact that the current flowing through a capacitor behaves through time as the voltage across an inductor. The capacitor used in this circuit is geometrically smaller than the inductor it simulates, and its capacitance is less subject to changes in value due to environmental changes. Applications where this circuit may be superior to a physical inductor are simulating a variable inductance or simulating a very large inductance.
This circuit is of limited use in applications relying on the [[back EMF]] property of an inductor, as this effect will be limited in a gyrator circuit to the voltage supplies of the op-amp.
{{clear}}
=== Negative impedance converter (NIC) ===
{{main article|Negative impedance converter}}
[[File:Op-Amp Negative Impedance Converter.svg|300px|class=skin-invert]]
Creates a [[resistor]] having a negative value for any signal generator.
In this case, the ratio between the input voltage and the input current (thus the input resistance) is given by
: <math>R_\text{in} = -R_3 \frac{R_1}{R_2}.</math>
In general, the components <math>R_1</math>, <math>R_2</math>, and <math>R_3</math> need not be resistors; they can be any component that can be described with an [[Electrical impedance|impedance]].
{{clear}}
==Non-linear==
{{Unreferenced section|date=February 2022}}
=== Precision rectifier ===
{{main article|Precision rectifier}}
[[File:Op-Amp Precision Rectifier.svg|250px|class=skin-invert]]
The voltage drop ''V''<sub>F</sub> across the forward-biased diode in the circuit of a passive rectifier is undesired. In this active version, the problem is solved by connecting the diode in the negative feedback loop. The op-amp compares the output voltage across the load with the input voltage and increases its own output voltage with the value of ''V''<sub>F</sub>. As a result, the voltage drop ''V''<sub>F</sub> is compensated, and the circuit behaves very nearly as an ideal (''super'') [[diode]] with ''V''<sub>F</sub> = 0 V.
The circuit has speed limitations at high frequency because of the slow negative feedback and due to the low slew rate of many non-ideal op-amps.
{{clear}}
===
[[File:Op-Amp Exponential Amplifier.svg|300px|class=skin-invert]]
The [[Shockley diode equation]] gives the [[current–voltage relationship]] for an ideal semiconductor [[diode]]:
:
where <math>I_\text{S}</math> is the [[saturation current]], <math>V_\text{D}</math> is the forward voltage across the diode, and <math>V_\text{T}</math> is the [[thermal voltage]] (approximately 26 mV at room temperature). When <math>V_\text{D} \gg V_\text{T},</math> the diode's current is approximately proportional to an [[exponential function]]:
: <math>I_\text{D} \simeq I_\text{S} e^{\frac{V_\text{D}}{V_\text{T}}}.</math>
The opamp's inverting input is virtually grounded and ideally draws no current. Thus, the output voltage will be:
: <math>V_\text{out} = -R I_\text{D}.</math>
The output voltage <math>V_\text{out}</math> is thus approximately an exponential function of the input voltage <math>V_\text{in}</math>:
: <math>V_\text{out} \simeq -R I_\text{S} e^{\frac{V_\text{in}}{V_\text{T}}} \, .</math>
This implementation does not consider temperature stability and other non-ideal effects.{{clear}}
=== Logarithmic output ===
{{See also|Log amplifier}}Since the [[logarithm]] is the [[inverse function]] of exponentiation, the exponential output circuit described above can be rearranged by swapping the diode into the feedback path of the opamp to form a [[log amplifier]]:
[[File:Op-Amp Logarithmic Amplifier.svg|300px|class=skin-invert]]
Since the opamp's inverting input is virtually grounded and ideally draws no current, <math>V_\text{out} {=} V_\text{D}</math> and the current flowing from the source through the resistor and diode is:
: <math>\frac{V_\text{in}}{R} = I_\text{R} = I_\text{D},</math>
where <math>I_\text{D}</math> is the current through the diode, which as described earlier is approximately:
: <math>I_\text{D} \simeq I_\text{S} e^{\frac{V_\text{D}}{V_\text{T}}}.</math>
Solving for <math>V_\text{out}</math> gives an approximately logarithmic relationship between the input voltage <math>V_\text{in}</math> and the output voltage <math>V_\text{out}</math>:
: <math>V_\text{out} \simeq -V_\text{T} \ln \left(\frac{V_\text{in}}{I_\text{S} R}\right) \, .</math>
This implementation does not consider temperature stability and other non-ideal effects.
{{clear}}
=== Piecewise linear output ===
[[Piecewise linear function|Piecewise linear functions]] can approximate [[Nonlinear system|non-linear functions]] as a series of connected [[line segments]]. [[Gain compression]] circuits (like [[Sine and cosine|sine]] or [[square root]]) use diodes or transistors to switch between line segments with slopes determined by resistive [[voltage divider]] networks. Expansion circuits may be built using a compression circuit as feedback of an opamp.<ref name=":2">{{Cite web |last=Kuhn |first=Kenneth A. |date=2004-03-24 |title=Piecewise Linear Circuits |url=https://www.kennethkuhn.com/students/ee431/piecewise_linear_circuits.pdf}}</ref>
==== Temperature-compensated compression ====
[[File:Piecewise linear temperature compensated amplifier.gif|thumb|Temperature-compensated three-segment compression function]]The schematic shown for a "temperature-compensated three-segment compression function"<ref>{{Cite web |date=April 1968 |title=AN-4 Monolithic Op Amp—the Universal Linear Component |url=https://www.ti.com/lit/an/snoa650b/snoa650b.pdf |website=[[Texas Instruments]]}}</ref><ref>{{Cite web |date=September 2002 |title=National Semiconductor Application Note 31 |url=http://www.frankshospitalworkshop.com/electronics/documents/OP%20Amp%20Circuit%20Collection%20-%20National.pdf}}</ref> produces a gain compression transfer function where each subsequent line segment reduces the steepness of the transfer function. For small signals, transistors Q2 and Q3 produce very little base current, and so the circuit's gain is determined just by the feedback resistance of R2 divided by the input resistance of R1. Once the output voltage exceeds around 2 V (whose exact voltage depends on R3 and R4 and the -15 V supply), then Q3 saturates, so the circuit's feedback resistance is determined by R4 in parallel with R2, reducing the gain. As the output voltage increases more, Q2 will saturate, so the circuit's gain is again reduced by the additional inclusion of R6 into the parallel feedback resistance. Temperature-compensation transistors Q4 and Q1 cancel out the temperature-dependent [[p–n junction]] base-emitter forward voltage drop of Q3 and Q2. Additional linear segments can be added using additional copies of the resistor-transistor-resistor chains (like the chain R5, Q2, R6 or the chain R3, Q3, R4 but with different values) in a similar manner to further compress the input. This circuit's compression function only works for negative inputs. Diode D1 forces the output to zero if a positive input is applied.
== Other applications ==
{{div col|colwidth=30em}}
* audio and video [[preamplifier
* [[Filter (signal processing)|filter]]s
* [[voltage regulator]] and [[current regulator]]
* [[analog-to-digital converter]]
* [[digital-to-analog converter]]
* [[Clamper (electronics)|voltage clamp]]
* [[electronic oscillator|oscillator]]s and [[waveform generator]]s
* [[Analog computer]]
* [[Capacitance multiplier]]
* [[Charge amplifier]]
{{div col end}}
== See also ==
{{div col|colwidth=30em}}
* [[Current-feedback operational amplifier]]
* [[Frequency compensation]]
* [[Operational amplifier]]
* [[Operational transconductance amplifier]]
* [[
{{div col end}}
== Notes ==
{{Reflist|group=nb}}
== References ==
{{
==
{{Main|Operational amplifier#Further reading|l1=Operational amplifier further reading}}
== External links ==
{{Wikibooks|Electronics|Op-Amps}}
* {{cite web|url= https://web.archive.org/web/20060108060032/http://instruct1.cit.cornell.edu/courses/bionb440/datasheets/SingleSupply.pdf |title=Single supply op-amp circuit collection }} {{small|(163 [[Kibibyte|KiB]])}}
* {{cite web|url= https://www.ti.com/lit/an/snla140d/snla140d.pdf |title=Op-amp circuit collection }} {{small|(2980 [[Kibibyte|KiB]])}}
* {{
* {{
* {{cite web|url= http://focus.ti.com/lit/an/sboa092a/sboa092a.pdf |title=Handbook of operational amplifier applications }} {{small|(2.00 [[Mebibyte|MiB]])}} – [[Texas Instruments]] [[Application note]]
* [http://focus.ti.com/analog/docs/gencontent.tsp?familyId=57&genContentId=28017 Low Side Current Sensing Using Operational Amplifiers] {{Webarchive|url=https://web.archive.org/web/20090408192711/http://focus.ti.com/analog/docs/gencontent.tsp?familyId=57&genContentId=28017 |date=2009-04-08 }}
* {{cite web |url= http://www.national.com/an/AN/AN-30.pdf |title= Log/anti-log generators, cube generator, multiply/divide amp |url-status= dead |archive-url= https://web.archive.org/web/20080509065104/http://www.national.com/an/AN/AN-30.pdf |archive-date= 2008-05-09 }} {{small|(165 [[Kibibyte|KiB]])}}
* [https://web.archive.org/web/20060215074343/http://www.edn.com/archives/1994/030394/05di7.htm Logarithmically variable gain from a linear variable component]
* [http://www.philbrickarchive.org/1964-1_v12_no1_the_lightning_empiricist.htm Impedance and admittance transformations using operational amplifiers] by D. H. Sheingold
* [http://www.linear.com/docs/4138 ''High Speed Amplifier Techniques ''] very practical and readable{{spaced ndash}}with photos and real waveforms
* [http://www.electronicproducts.com/Analog_Mixed_Signal_ICs/Amplifiers/Properly_terminating_an_unused_op_amp.aspx Properly terminating an unused op-amp]
[[Category:
|