This is only a preview of the January 2022 issue of Practical Electronics. You can view 0 of the 72 pages in the full issue. Articles in this series:
|
ial amplifiers
Circuit Surgery
Regular clinic by Ian Bell
Op Amp Logarithmic and Exponential Amplifiers – Part 2
L
ast month, we started to
look at op amp-based logarithmic and exponential (also called
antilog) amplifiers, focusing on logarithmic circuits. This month it is the
turn of exponential amplifiers.
Raised to the power
Exponentials are the opposite of logarithms (inverse function), hence the
term ‘antilog’. ‘Exponentiation’ means
one number to the power of another, for
example, x to the power y (xy). As noted
last month, for base 10 logarithms, if y =
log10(x) then we can find x from y using
x = 10y, that is 10 to the power y. Natural
logarithms use base e, where e = 2.71828
(approximately). The ‘exponential function’ means ea, so if:
y = ln(x) then x = ey = exp(y)
We also noted that we can easily convert between logarithm bases using a
scaling factor, for example:
log10(x) = ln(x) / ln(10) ≈ ln(x) / 2.303.
This is useful because we might need a
log10 function from a circuit, but log and
antilog amplifiers are inherently based on
the natural exponential (base e) relationship between the forward voltage of a PN
junction (diode) and the current through
it. For the antilog function we have:
𝑎𝑎! = 𝑒𝑒 "!ln(&)(
So, we can use a circuit based on the
PN junction
𝑉𝑉) exponential function to
𝐼𝐼) =obtain
𝐼𝐼* %expan
) output
+ − 1. related
𝑉𝑉+
to exponentiation of any
number (within reason),
for example:
𝑉𝑉- 2n or 10n.
𝑉𝑉, = −𝐼𝐼* 𝑅𝑅 %exp ) + − 1.
𝑉𝑉+
Fig.1. Ideal exponential or antilog input-output relationships: unscaled (y1, green, input
scaled by 0.5 (y2, yellow) and output scaled by 2.
implementation of multiplication. Exponential amplifiers probably have a
smaller range of uses than logarithmic
amplifiers, but one interesting example is in analogue music synthesisers.
In fact, these articles were originally
inspired by the use of exponential
amplifiers in the MIDI Ultimate Synthesiser project, which concluded in
July 2019.
In the MIDI Ultimate, and similar designs, a linear control voltage is used
to set the frequency of the note to be
played. The frequencies of notes on a
musical scale form a geometric progression, that is, each frequency is found by
multiplying the previous one by a fixed
value (or divided to find the previous
one). This requires a fixed reference frequency (f0), typically 440Hz (A above
middle C). If the multiplying factor is
a, then the next notes are af0, a2f0, a3f0
and so on. In general, the n-th note up
from the reference is anf0. The control
voltage for the synthesiser represents n,
so we need to convert this to an to get
a value proportional to the frequency.
Given that the Western music scale has
twelve notes (semitones) for each doubling of frequency (octave) we need:
a = 2(1/12) ≈ 1.05946, so that a12 = 2
Analogue synthesisers
As mentioned last month,
⁄𝑉𝑉+ )
𝐼𝐼). exponential
𝐼𝐼* exp(𝑉𝑉01.amplifiers
= can
2 = be used in multipli𝐼𝐼)/
𝐼𝐼* exp(𝑉𝑉01/ ⁄𝑉𝑉+ )
er circuits to convert the
addition of logarithms to
the final results, but this
𝑉𝑉01. 𝑉𝑉01.
necessarily
exp is
) not −
+ = 2 the best Fig.2. LTspice schematic for plotting Fig.1
𝑉𝑉+
𝑉𝑉+
54
𝑉𝑉01. − 𝑉𝑉01/ = 𝑉𝑉+ 𝑙𝑙𝑙𝑙(2)
Practical Electronics | January | 2022
The equation above shows that we can
obtain the required input-output relationship for the synthesiser with an
exponential amplifier based on a PN
junction response, with suitable scaling.
Exponential functions
As we did with the logarithmic amplifier,
we will start by looking at the exponential function itself. Fig.1 shows three
responses of ideal exponential amplifiers to input voltage x, where:
y1 = exp(x)
y2 = exp(x/2)
y3= 2*exp(x)
As with the idealised logarithmic curves
last month, these graphs were produced
using LTspice behavioural voltage sources and a DC sweep simulation, as shown
Fig.3. Depending on the range of observation relative to function behaviour,
in Fig.2. These curves represent mathexponentiation can show relatively slow (Fig.1) or extremely rapid change (this example).
ematical (idealised circuit) functions
rather than real circuit responses. The
population is infected. In the case of
IR
shape of these curves illustrates the
exponential amplifiers, the supply
R
general behaviour of an exponential revoltage or other circuit limitation will
ID
sponse. As input amplitude increases,
determine the maximum output value.
VI
–
the effect of further increases becomes
Fig.3 shows another exponential funcVO
U1
greater. The rate of increase increases
tion plotted on the same axes as Fig.1,
+
with increasing input – it follows that
this is y = 1.0×10−23exp(100x). With the
the input/output curve is flat for small
given input range this function produces
inputs and very steep for large inputs.
a very large output range, unlike the exIf we do not scale the output, then
amples plotted in Fig.1. With x = 1 this
Oppass
amp through
exponential
amplifiers
all the curves
1 for
zero
function gives y = 2.7 × 1023.
Fig.4. Exponential voltage amplifier based
input (x = 0) see y1 and y2 in Fig.1. This
on a diode and op amp.
is because for any number n (other than
Diode equation
amplifier (one with an input of current
zero), n0 = 1, so exp(0) = e0 = 1. Scaling
As mentioned above, exponential amand output of voltage). Such a circuit
the output by n means that the output
plifiers can be based on the exponential
𝑎𝑎! = 𝑒𝑒 "!ln(&)( relationship of the
is shown in Fig.4, in which the op amp
equals n for an input of 0 (see y3 in Fig.2).
current-voltage
and resistor form a transimpedance amdiode, which is:
Scaling the input down (see y2 in Fig.2)
plifier with gain R (V/A, volts per amp).
results in a slower rate of change (and
𝑉𝑉)
For the circuit in Fig.4, like the logavice versa) – this changes the effective
𝐼𝐼) = 𝐼𝐼* %exp ) + − 1.
rithmic amplifier discussed last month,
number base of the exponentiation.
𝑉𝑉+
the op amp’s inverting input acts as
a virtual earth, so the input voltage
Here, VD is the voltage across the diode
Use and misuse
𝑉𝑉is effectively applied as the voltage
and ID is the current
The fact that viral infections can increase
through it. IS is the
𝑅𝑅 %exp ) +current
− 1. – a parameter
, = −𝐼𝐼*saturation
across the diode, that is VI = VD. ID is
exponentially has perhaps increased 𝑉𝑉diode
𝑉𝑉+
awareness of the term ‘exponential’
specific to the particular diode or trangiven by the diode equation above.
during the COVID-19 pandemic, but
sistor. VT is the thermal voltage (defined
The resistor is connected between the
it is often misused (or misunderstood) 𝐼𝐼).
output and virtual earth, so the voltage
last month).
This
version
of
the
equation
⁄
)
𝐼𝐼* exp(𝑉𝑉01. 𝑉𝑉+
= 2 = the −1 term, which is often left
to simply mean increasing rapidly, 𝐼𝐼 includes
across it is equal to the output voltage
𝐼𝐼* exp(𝑉𝑉01/ ⁄𝑉𝑉+ )
)/
rather than the correct description of
(VO) and from Ohm’s law the current
out to give a simplified version of the
situations where the rate of change is
equation that applies to relatively large
is IR= −VO/R.
proportional to the quantity itself. Obforward
voltages.
This
fuller
equation
𝑉𝑉01. 𝑉𝑉01.
exp )applies
− to small
+ = forward
2
servations of exponential phenomenon
also
and reverse
𝑉𝑉+
𝑉𝑉
may show slow changes if the flatter,
voltages.
Given+ that we know exp(0) = 1,
IR
slower, growth part of the function is
the −1 term ensures that ID = 0 for VD =
applicable – eventually the rate will
0. In terms of an exponential amplifier
R
𝑉𝑉01. − 𝑉𝑉01/ = 𝑉𝑉+ 𝑙𝑙𝑙𝑙(2)
increase significantly, but in some situresponse,
the −1 term will result in an
IC
ations, this may not be observed.
output level shift (offset) in comparison
VI
–
VO
Pure exponential functions will
with the basic exponential response.
U1
eventually produce extremely large
VBE
+
Q
numbers, but in real systems expoExponential amplifier
nential phenomenon will reach some
We can obtain a current which is expoform of physical limit beyond which
nentially related to an applied voltage
further increase is not possible. In the
simply by applying the voltage to a diode.
Fig.5. Exponential voltage amplifier based
case of a virus (with no immunisation)
This can be converted to a voltage by apon a bipolar transistor and op amp.
the growth will stop when the entire
plying the current to a transimpedance
Practical Electronics | January | 2022
55
𝑎𝑎! = 𝑒𝑒 "!ln(&)(
𝑉𝑉)
𝐼𝐼) =𝑎𝑎𝐼𝐼!* %exp
) + − 1.
= 𝑒𝑒 "!ln(&)(
𝑉𝑉+
𝑉𝑉)
𝐼𝐼) = 𝐼𝐼* %exp ) + − 1.
𝑉𝑉+
𝑉𝑉)𝑉𝑉
%exp
) ) +- +−−1.1.
𝑉𝑉,𝐼𝐼)==−𝐼𝐼𝐼𝐼** 𝑅𝑅
%exp
𝑉𝑉+𝑉𝑉
+
a factor of two change
in the output we
𝑉𝑉𝑉𝑉, =take
−𝐼𝐼* the
𝑅𝑅 %exp
) of
+−
1.diode currents:
can
ratio
the
𝑉𝑉+
𝑉𝑉- ⁄ )
𝐼𝐼𝑉𝑉).
* exp(𝑉𝑉
+
−𝐼𝐼 𝑅𝑅𝐼𝐼%exp
) 01.
+ −𝑉𝑉1.
, =
= 2 *=
𝑉𝑉+ ⁄ )
𝐼𝐼)/
𝐼𝐼* exp(𝑉𝑉01/
𝑉𝑉+
𝐼𝐼).
𝐼𝐼* exp(𝑉𝑉01. ⁄𝑉𝑉+ )
=2=
𝐼𝐼)/
𝐼𝐼* exp(𝑉𝑉
01/ ⁄𝑉𝑉+ )
Simplifying
by cancelling
the IS terms
𝐼𝐼).
𝐼𝐼* exp(𝑉𝑉
01. ⁄𝑉𝑉+ )
𝑉𝑉
𝑉𝑉
01.
01.
and
rearranging
the
exponents
gives:
=
2
=
+=2
𝐼𝐼)/exp ) 𝑉𝑉 𝐼𝐼*−
exp(𝑉𝑉
𝑉𝑉+ 01/ ⁄𝑉𝑉+ )
+
𝑉𝑉01. 𝑉𝑉01.
exp )
−
+=2
𝑉𝑉+
𝑉𝑉+
𝑉𝑉01. 𝑉𝑉01.
𝑉𝑉exp
− = 𝑉𝑉++𝑙𝑙𝑙𝑙(2)
=2
01.)− 𝑉𝑉01/
𝑉𝑉+
𝑉𝑉
+
Taking natural
logs
of both sides and re𝑉𝑉01. − 𝑉𝑉results
𝑙𝑙𝑙𝑙(2)
01/ = 𝑉𝑉+
arranging
in:
𝑉𝑉01. − 𝑉𝑉01/ = 𝑉𝑉+ 𝑙𝑙𝑙𝑙(2)
Fig.6. LTspice simulation schematic of the circuit in Fig.5, set up to illustrate doubling of
the output for an 18mV input change.
ponential amplifiers
Assuming an ideal op amp, no current will flow into the op amp’s inputs
(assume it has infinite input impedance and requires zero external bias
current).
This
means that all the cur𝑎𝑎! =
𝑒𝑒 "!ln(&)(
rent in the diode must flow through
the resistor, so ID = IR.
In ID = IR substitude
ID with the diode
𝑉𝑉)
𝐼𝐼) = 𝐼𝐼* %exp
+ − 1.
equation
from)above
and IR with −VO/R.
𝑉𝑉+
Then rearrange to
make VO the subject:
𝑉𝑉𝑉𝑉, = −𝐼𝐼* 𝑅𝑅 %exp ) + − 1.
𝑉𝑉+
This equation is of the same form as the
𝐼𝐼).
𝐼𝐼* exp(𝑉𝑉01. ⁄𝑉𝑉+ )
generic
voltage amplifier dis= 2exponential
=
⁄𝑉𝑉+ )scaling by 1/V ,
𝐼𝐼
𝐼𝐼* exp(𝑉𝑉
)/
cussed above,
with01/
input
T
output scaling by ISR, and an offset with
respect to the natural exponential so that
𝑉𝑉01. 𝑉𝑉op
01.amp) V = 0 when V =
(with
I
exp an
) ideal
−
+=2 O
𝑉𝑉
𝑉𝑉
+
0. As with+ the logarithmic
amplifier, we
note that with VT and IS being dependent
on temperature, then so is the amplifier
𝑉𝑉01. −More
𝑉𝑉01/ on
= 𝑉𝑉this
output.
shortly.
+ 𝑙𝑙𝑙𝑙(2)
56
Transistor-based exponential
amplifier
Like logarithmic amplifiers, it is common
to use a transistor rather than a diode
for the PN junction. The basic circuit is
shown in Fig.5. The input is applied to
the base-emitter junction of the transistor and the collector current is applied
to the transconductance amplifier. The
circuit shows the base grounded and the
input applied to the emitter, but it could
be the other way round, as long as VBE is
set by the input. With an NPN transistor
(as shown) the input voltage needs to be
negative to give a positive VBE for transistor to conduct. The circuit is inverting,
like the one in Fig.4, so the output is positive with the negative input. The circuit
can also be built with a PNP transistor
and positive input voltage.
For musical applications it is useful
to know the voltage change at the input
for a doubling of the output (an octave
change). For two inputs to the circuit
in Fig.5, VBE1 and VBE2 which result in
At 27°C VT is about 26mV so VTln(2) is
about 18mV. We need an 18mV per octave
control voltage at the base-emitter junction of a transistor to obtain a suitable
exponential control current or voltage.
This can be easily scaled by an input
circuit to give a more convenient (and
typically used) 1V per octave overall.
An input step of 18mV to double the
output voltage can be illustrated by the
LTspice simulation schematic shown in
Fig.6. The resistor is chosen to give convenient output voltages for the point of
illustration, for example 100, 200, 400
and 800mV. The simulation steps the
input in 18mV increments so that the
relevant data points are clear to see. The
result, shown in Fig.7, shows the doubling of output voltage with the 18mV
input steps. The graph has straight lines
because of the minimal number of data
points. Running this with a much smaller
step size would produce a smooth curve.
Temperature effects and thermal
compensation
As mentioned above, and as discussed
for the logarithmic amplifier, the basic
implementations of these circuits are
Fig.7. Results
from LTspice
simulation of
the circuit in
Fig.5
Practical Electronics | January | 2022
Correction to Circuit Surgery, December 2021
Fig.10. Results of the temperature-effect simulation.
Unfortunately, Fig.10 was a repeat
The sharp-eyed among you no doubt
spotted a gremlin that worked its way of Fig.8. The correct graph is shown
into last month’s (December 2021) above. Apologies for the confusion and
Circuit Surgery, at the end of the article. any resultant head scratching!
the same VBE as Q2 and so will also keep
Simulation files
the same current as temperature varies.
Thus, the input voltage will be shifting
Most, but not every month, LTSpice
the current in Q1 relative to a reference
is used to support descriptions and
point that does not change with temperaanalysis in Circuit Surgery.
The examples and files are available
ture. R3 limits the op amp output current
for download from the PE website.
to prevent damage to the transistors and
C1 reduces gain at high
frequencies to improve
stability. A similar circuit can also be used
to provide temperature
compensation for a
logarithmic amplifier.
This circuit requires
the transistors to be
matched and at the
same temperature. The
BACK ISSUES – ONLY £6.49
latter can be acheived
by clamping them toPractical
Practical
Practical
Practical
Practical
Electronics
Electronics
Electronics
Electronics
Electronics
gether or placing them
very close together on
a heatsink.
BACK ISSUES
The UK’s premier electronics and computing maker magazine
Circuit Surgery
Timing and metastability
in synchronous circuits
Build an RGB display project
using a Micromite Plus
Timing and metastability
in synchronous circuits
Construct a
transistor radio
WIN!
Microchip
Curiosity HPC
Development
Board
www.electronpublishing.com
R1
Compensation circuit
Q 1
–
U1
+
R3
C1
VIn
–
U2
+
Fig.8. Exponential amplifier with temperature compensation
Practical Electronics | January | 2022
VO
<at>practicalelec
Audio Out
The UK’s premier electronics and computing maker magazine
Circuit Surgery
How to make a
transistor radio
Superb PE PIC
Development
Board
Transformers
and LTspice
Audio Out
Make it with Micromite
Accessing Internet data
with your MKC
Superb microphone
preamplifier
Touchscreen
Wide-range
RCL Box
WIN!
Microchip
PIC24F LCD and
USB Curiosity
Development
Board
WIN!
Microchip
MCP19114 Flyback
Standalone
Evaluation
Board
Programmable
Thermal
Regulator
Apr 2021 £4.99
04
9 772632 573016
practicalelectronics
PLUS!
Techno Talk – No blame, no shame?
Cool Beans – Round-up of NeoPixel effects
Net Work – Videoconference cameras
www.electronpublishing.com
<at>practicalelec
Mar 2021 £4.99
03
9 772632 573016
practicalelectronics
PLUS!
Fabulous low-cost
Concrete speakers!
Techno Talk – Bad science and good
Cool Beans – Smoothing LED colour transitions
Net Work – Lockdown technology and how we now work
www.electronpublishing.com
PIC n’ Mix
Software tools for
the PIC18F
Ultrabrite LED
bike light
WIN!
Microchip
Explorer 16/32
Development
Kit
Make it with Micromite
Circuit Surgery
Understanding
Differential amplifiers
Analogue inputs and
using servomotors
Don’t miss
our Super
Random
Number
Generator
<at>practicalelec
Jun 2021 £4.99
06
9 772632 573016
practicalelectronics
Audio Out
Constructing the PE
Theremin amplifier
WIN!
Meet the
Micromite
Clever Controller
for dumb chargers
Hi-Fi amp on
the cheap!
Completing the
High-power 45V/8A
Variable Linear Supply
Making a
splash with
NeoPixels!
Building the
Low-noise
theremin PSU
PLUS!
Cool Beans – Even cooler ping-pong ball lights!
Net Work – IP security cameras
Techno Talk – The perils of an enquiring mind...
www.electronpublishing.com
Circuit Surgery
Micro-Cap 12
simulator review
WIN!
Microchip
MPLAB Starter Kit
for Serial Memory
Products
WIN!
Robot Buggy
Ultrasound
sensing!
Roadies’ Test
Signal Generator
Tunable HF
Preamplifier
The UK’s premier electronics and computing maker magazine
Flowerpot speakers!
A low-cost route to
high-quality Hi-Fi
Mastering stepper
motor drivers
Meet the Cricket:
making IoT designs
super easy!
Programmable
Thermal
Regulator
PLUS!
Q 2
Make it with Micromite
Fun display project
using a Micromite Plus
Nutube Guitar
Overdrive and
Distortion Pedal
WIN!
Techno Talk – Tin whiskers scourge
Cool Beans – Bouncing around the Maxiverse
Net Work – Hydrogen: a viable alternative to batteries?
R2
The UK’s premier electronics and computing maker magazine
Circuit Surgery
Audio Out
Make it with Micromite
Frequency Reference Mastering
Signal Distributor
RFID tags for
your projects
Make your own PCBs
with our precision
Solder Reflow Oven
VP
–
N NEW E
EW
PE
D NA –
ES M
IG E
N
!
Practical
Electronics
–
N NEW E
EW
PE
D NA –
ES M
IG E
N
!
very sensitive to temperature. Above, we
found that the voltage change required to
double, or half, the output was VTln(2) (=
18mV at 27°C). This depends on VT but
not on IS. VT varies linearly with temperature so it is relatively easy to compensate
for – a resistor with the right temperature
coefficient used in the gain-setting of an
input scaling amplifier will do the job.
A problem remains in that the absolute transistor current, which is doubled
or halved by the 18mV voltage change,
depends on both IS and VT and hence on
temperature. One way to address this is
to set up the transistor that is used for
the exponential function (Q1 in Fig.5 and
Fig.6) with a reference VBE which is compensated for temperature changes, and
arrange the input voltage to shift the transistor VBE relative to the operating point.
The circuit in Fig.8 is based on this
idea. Transistor Q1 is used to provide
the exponential function. Its base-emitter
voltage is equal to the base-emitter voltage of Q2 minus the input voltage. If the
input is 0V then the two transistors will
have the same VBE – this will set the reference current. Changes in VIn will shift
the VBE of Q1 away from this point. An
input of 18mV will reduce the VBE of Q1
by 18mV, halving the output. An input
of −18mV will increase the VBE by 18mV,
doubling the output.
The current in Q2 is kept constant by
the feedback loop provided by op amp
U2. The feedback ensures that the voltage difference between the op amp’s
inputs is zero. This means that the collector of Q2 and one end of R2 are at 0V.
Thus, the current in R2 is constant at VP
/ R2 (VP is the positive supply voltage).
Assuming no current flows into the op
amp, all the current in R2 flows in Q2,
so Q2 has a constant current and its VBE
will be whatever is required to achieve
this. If the temperature, and hence the
transistor behaviour changes, then the
VBE of Q2 will alter to keep the current
constant. With zero input, Q1 will have
<at>practicalelec
Sep 2020 £4.99
09
9 772632 573016
practicalelectronics
Fun LED
Christmas
Tree offer!
PLUS!
Techno Talk – Triumph or travesty?
Cool Beans – Mastering NeoPixel programming
Net Work – The (electric) car’s the star!
www.electronpublishing.com
<at>practicalelec
Dec 2020 £4.99
12
9 772632 573016
practicalelectronics
We can supply back issues of PE/EPE by post.
We stock magazines back to 2006, except for the following:
2006 Jan, Feb, Mar, Apr, May, Jul
2007 Jun, Jul, Aug
2008 Aug, Nov, Dec
2009 Jan, Mar, Apr
2010 May, Jun, Jul, Aug, Oct, Nov
2011 Jan
2014 Jan
2018 Jan, Nov, Dec
2019 Jan, Feb, Apr, May, Jun
Issues from Jan 1999 are available on CD-ROM / DVD-ROM
If we do not have a a paper version of a particular
issue, then a PDF can be supplied – your email address
must be included on your order.
Please make sure all components are still available before
commencing any project from a back-dated issue.
57
|