Synth-DIY: The exponential converter

The nature often has a logarithmic or exponential behaviour, this also applies to the human reception of volume levels and frequencies. So for the human ear, musical intervals like octaves feel like linear, but in fact are exponential.
One octave is the double frequency, two octaves are four times the frequency and so on. As it is easier to handle the control of pitch in a linear way (for example using a resistor divider chain in the keyboard to convert a constant current flowing through the resistors to a linear voltage depending on the key pressed), there must be something to convert the linear control to the exponential output, like the frequency of a VCO.

This is the job of the exponential converter, which is a term commonly used in electronic music instruments, whereas the term used in other technical areas usually is antilog amplifier, as it does the opposite of a logarithmic amplifier.

Semiconductors and mathematics

Exponentiation is not the most trivial mathematical function. Additions and substractions are easily done in electronics, but how is exponentiation done?
This is very simple - in a bipolar transistor, the collector current behaves exponentially to the base-emitter voltage. So one could think you can just take any bipolar transistor and use it as an exponential converter without any additional effort.
This is far from true, because besides the exponential behaviour of the transistor, there are also some other factors, not just device tolerances but much more internal bulk resistance of the emitter and thermal effects, which need to be compensated.

A common exponential converter

You might have seen this circuit or a simpler version of it, as it is used quite often in VCOs found in DIY projects and commercial synthesizers. It is a very accurate circuit, which we will take apart now and find out how it works.

In the very left, you see a simple inverting summer around an OpAmp U101, pins 1, 2 and 3. The number of inputs can vary depending on how much inputs you really need. As the input resistors R101-R103 are all the same as the feedback resistor R104, the output is the inverted sum of the input voltages. So feeding 1V to one of those input resistors gives -1V on pin 1 of this OpAmp. This is fed to a resistor network - R105-R108, which divides the voltage change of 1V down to around 18mV. This value results from some physical behaviour of the bipolar transistor and can be calculated using the Boltzmann constant and the elementary charge and is the value which is needed to double the collector current.

So the exponential behaviour with 1V/octave response is done here - except it inverts the input value. But there are two factors of thermal drift - one is the base-emitter voltage offset needed for a specific collector current. As this is nearly the same in two matched, thermally coupled transistors, we just need to use another transistor, ideally on the same chip for best thermal coupling, and create the circuit in a way that the two transistors compensate the drift.

First thermal compensation

Exactly this is done here. The pair of transistors in Q101 are matched and thermally coupled, because they are on the same chip, so they can compensate each other. To make use of this effect, the circuit works with a reference. The left transistor is used to create this reference. If the bases of both transistors are on the same potential, which is 0V due to the fixed base of the right transistor, the collector currents are the same, as the emitters are tied together. The operational amplifier U101, pins 12-14, pulls down the emitters of the transistors to get 0V on the collector of the left transistor. So the lower end of R109 is at 0V, while the upper end is at Vdd, 15V in our example, we have a fixed voltage of 15V over this resistor and know its value - 3.65MOhms as an example. So we can calculate the current through the collector of the left transistor:

Ic = U(R5) / R5 = 15V / 3.65MOhms = 4.11 microamperes.

By the way - the strange resistor values are chosen as values around in my parts collection and the whole circuit is part of my MonoMiK VCO and other modules.

The collector currents of both transistors are the same, so Ic of the right transistor also is 4.11 microamperes.

If we now lower the base of the left transistor by 18mV (due to an increment of 1V on the input), the OpAmp on pins 12-14 will pull down the emitter of the left transistor by those 18mV to keep the current through R109 stable. The capacitor C101 is just there to avoid overshooting and ringing. This also pulls down the emitter of the right transistor by 18mV, which is an increment of the base-emitter voltage by 18mV - which means doubling in the collector current.

So the collector current of the left transistor always is stable at 4.11 microamperes, but the base-emitter voltage needed for this is used as an offset for the base-emitter voltage of the right transistor. If this base-emitter voltage drifts due to a temperature change, it drifts the same amount in both transistors, so nothing happens to the collector current of the right transistor.

Finally, R113 reduces the maximum current which can flow through the transistors. In our case, the operational amplifiers output doesn't go down to -15V, but could reach -14V. Then there is the voltage drop on the transistors, roughly 0.6V. So we have around 13.4V maximum voltage drop on R113:

Imax = U(R113) / R113 = 4.45mA

This helps to roughly estimate the range of the whole circuit - at least in the positive range starting at 0V at the input. 4.45mA / 4.11µA are around 1000. 2^10 is 1024, so we have 10 octaves or electronically can go up to 10V on the input (or better say the sum of all inputs can be 10V). The lower end is somehow limited by the rails of the OpAmp pins 1-3, but we easily can go down to -10V here. But as then, we are at 4nA, which is a really very small current, maybe even smaller than some leakage currents you have in the circuit, so tracking might get worse at very low input voltages. Usually, it's enough for the LFO range of your VCO, as you might not need accurate tracking with those low frequencies.

Second thermal compensation

The base-emitter offset is not the only factor which changes with the temperature. Those 18mV base-emitter change to double the collector current is not constant. If you look at the formula with the Boltzmann constant and elementary charge again, you see that this voltage rises with the temperature. This is compensated by R108, which has a positive temperature coefficient and so also rises its value with the temperature. This compensation is not really perfect, so the more you go away from the reference current, the larger the error of the output current gets. So it is a good idea to choose a reference current, which is near the middle of the range needed for your application - which might be the pitch of your VCO. For other applications than VCOs, the error might not be too critical, so if you don't want to use your filter as oscillator while self-oscillating, you can accept an error, for a VCA it's even more uncritical - in this case you can choose a much simpler circuit for the exponential behaviour.
Four resistors for a simple voltage divider might look a bit much for this purpose, but everything has a reason. First, R105 and R106 are used to have a main resistor a bit lower than what we need (R105) and a variable resistor (R106), which in sum with R105 is a bit more than what we need. So R106 is there to fine-tune the V/Oct scaling, sometimes called keyboard tracking. The R107 in series with R108 is an idea by René Schmitz. In earlier times, those two resistors were one special temperature compensating resistor with around 1KOhms (meaning different values for R105 and R106) and 3300-3500ppm (parts per million) temperature coefficient. As today those resistors are hard to obtain, René had the idea to use the KTY81 series temperature sensor, which is a PTC with around 7900ppm temperature coefficient. As we need around 3400ppm, the series resistor R107 lowers the temperature coefficient of the allover resistance of R107 and R108 to what we need. The R108 i used here is a KTY81-110, different types are also possible, check the datasheets.

Bulk emitter resistance compensation

Even the two temperature compensations are not enough for an accurate exponential converter, there are more physical effects around a BJT which introduce errors to the circuit. We have to get rid of one further factor - the bulk emitter resistance. This is not zero, so the collector current lifts up the internal emitter voltage by the voltage drop over the bulk emitter resistance. This voltage drop changes the real base-emitter voltage and so has a direct influence on the collector current. This factor isn't compensated by using the two transistors, as one transistor always drives a constant current while the other transistor drives a changing current. The larger the current gets, the larger the error is.
Dave Rossum found a simple and effective way to compensate this problem by feeding part of the voltage drop on R113 to the base of the left transistor. This makes it necessary for the circuit to pull down the emitter a bit more to reach the reference current through R109 again.
The original circuit by Dave Rossum (which in fact i have never seen in the original, as i don't have the necessary ElectroNotes issue) consisted of a diode and a resistor. The current flowing through the diode in this circuit is very small, so one nice effect disappears - the compensation of the voltage drop of the base-emitter diode of the right transistor.
The circuit i implemented here might have the roots in another idey by René Schmitz, who thought it's a good idea to have the same current flowing through the compensation diode as through the base emitter diode of the right transistor. This is achived by having the same resistor for the emitters of the transistors as for the diode (the 4.3KOhms resistor in parallel with the 10KOhms variable resistor is 3.007KOhms). On R115, we get a portion of this voltage drop now, which we feed into the base of the left transistor via R116. This resistor has a very large resistance, as just a very small portion has to be fed back to the transistor. This resistor depends on the bulk emitter resistance of the transistors you use - i somehow calculated around a bit with the estimations of the bulk emitter resistance and came to a result, which was quite near the resistor i found out experimentally, but i think it is a good idea to experiment around a bit with several resistors, starting with R115 in the middle position and having R116 not smaller than 100KOhms. But more on this later, when we talk about adjustment of this circuit.

The output of the exponential converter

As the exponential behaviour of the transistor results in a collector current change, the output is not a voltage but a current. If you look at the polarity of the whole circuit, the collector of the right transistor pulls down with the desired current (on output iout) and is capable to drive down to a bit below 0V there. This current can be used as a charge current for the integrator of a sawtooth oscillator or as the control current of a differential amplifier constructed from BJTs. OTAs usually need a different polarity, so the whole circuit must be turned around, using a PNP transistor pair. Those are a bit more evil to get, so you might to match your own from BC558C or so.

Linear inputs (frequency modulation)

The main inputs exp1-exp3 deliver an exponential current response on the output. For some cases, like oscillator FM, you might need linear response on the output. This is what lin1-lin3 are for. Those inputs are no magic at all - if you have a closer look at the whole loop around the OpAmp pins 12-14 and remember the words about the reference current, you will see that with those inputs you can just modify the reference current. As the exp inputs form some kind of multiplier for the reference current, the output current will always change linear in the desired way with the linear inputs. The inputs are designed for a range of +-5V giving an output current of 0% to 200%, where 100% is reached with 0V on the linear inputs, which uses the reference current defined by R109.

Other stuff

Most is said about this. If you know OpAmps (and you should, when you are learning about exponential converters :), you understand the behaviour of the OpAmps in this circuit and know how to add or remove inputs.
The chosen transistor array is a LM3046 here, which is easy to obtain, cheap, and gives a very good circuit behaviour with the compensation methods shown. You can replace it by other transistors, but you need to change R116 also.
If you don't need a large range or don't need the accuracy, you can leave away D102, R114-R116, which is just there for the bulk-emitter resistance compensation (in VCOs, this is necessary to keep a good tracking with high frequencies).
The diode D101 wasn't mentioned. This is there if you lower the linear inputs too much. Then, OpAmp pin 14 will go up, the whole circuit won't work correctly any longer, the reference current disappears, pin 14 can go even higher, in worst case, this can destroy your transistors because of having them reverse biased. It is also not the best style to just short the OpAmp output with the diode in this case, but usually, the OpAmp is short circuit protected and can deliver a maximum of 20mA (this is for the TL074 shown here), the diode has no problems with 100mA. But everything gets warm, so it is not the worst idea to carefully design everything around the linear inputs.
Q101 and R108 have to be thermally coupled, see the photos of the MonoMiK VCO how this can be done.
For perfectionism, you can also match D102 to the base-emitter voltage of Q101 and also put it in thermal contact with the transistors.

Depending on what you want to control with the circuit, things get more or less complicated. If you are adjusting this circuit within a VCO, your CCO core should be designed in a way that it really has a linear Hz/A response. If you introduce errors here, you might find a very strange tracking behaviour of your exponential converter. If you want to first check the behaviour of the circuit and design the oscillator core later, you can use a resistor from iout to Vdd and measure the voltage drop across it. Take care of the resistance of your multimeter - it introduces errors, but as we don't want to measure absolute values but just ratios, this is okay. Use a 4.7KOhms resistor or so. If you try different resistors, you might find different tracking behaviours, but the results should always be in a range you can adjust with R106 and R115.

Preparations

First, if you are unsure about your bulk emitter resistance compensation, remove R116 before starting. If you are quite sure about this resistor, turn R115 to the left, having the connected end of R116 on Vss potential. Turn R106 to the middle, prepare something which is capable to produce accurate output voltages in 1V steps - maybe a good MIDI-CV interface or a well-adjusted keyboard of a modular synthesizer. You also need negative voltages! Remove all signals from the inputs, attach your voltage generator to one of the exponential inputs.

Apply -1V to one of the inputs. Measure the current (with an oscillator attached, frequency or period duration usually are much more accurate), note it down.
Apply +1V to the input, measure the current (or frequency/duration)
Divide the two values. The current for the +1V should be 4 times the current for the -1V. The same applies for the frequency, for the duration, it's vice versa.
If your factor is below 4, turn R106 a bit more to the R105 end, it it's above, turn it more to the transistor end.
Repeat this procedure until you are satisfied with the result.
Check if you have good values with 0V and +2V also. Maybe you even want to check -2V and 0V. If you have a weaker scaling with 0V and +2V and a harder scaling with -2V and 0V, you might see the missing bulk emitter resistance compensation.