Monday, March 20, 2023

A bit about how think about the basic operation of the LM13700

It's really hard to find any absolute truths about how to design for the LM13700 as the formulas available are not possible to use directly. Thus, most people end up simulating or experimenting until they get the desired results.

This post tries to give a few good starters for the most basic cases - using the LM13700 as a simple VCA without any feedback etc. Using the details here will get you in the ballpark of what you need, without being perfect. You then have to try various resistor values until you get what you need.

Maximum values from the datasheet

- I_abc: 2mA

- I_d: 2mA

- V_differential: +/-5V

Facts (of the not so fun type)

The relationship between I_abc and gain is independent of supply voltage, BUT:

  • I_d is directly proportional to supply voltage so the circuit generating it must be changed if changing supply voltage.
  • The voltage at the I_abc input changes with supply voltage, so HOW I_abc is generated changes if it does not come from an ideal constant current source.
  • Using the linearising diodes allows you to use a much higher input signal without distortion. A higher input means better signal-to-noise ratio, e.g. less noise on the output.

Design stuff

  • I_abc and I_signal should be as large as possible (for reduced noise), within the max/design limits.
    • When using the linearising diodes, I_signal can be much larger. 
  • I_abc goes through and sets up a voltage across R_abc. This has to follow Ohm's law, and so R_abc must be picked so that the voltage across can be large enough to hold up V = R* I for the I we want. It should not allow more than 2mA (I = V/R), any higher and the LM13700 self destructs. A bit of a safety margin is good, so maxing out at 1.8mA is fine. When switching from a 15V to 12V supply, R_abc must be reduced accordingly to allow the same I_abc range.
    • The voltage at the I_abc input is said to be two diode drops above the negative rail: V_abc = 2*V_be + V-. As a diode drop is approximately 0.7V, using a 15V supply we should expect a voltage of 1.4V -15V = -13.6V
    • In my simulations I've found this to be approximately true but it seems to change a little bit (around 0.5V) with control CV. It IS however consistent between 12 and 15V, with V_abc for 12V aways being 3V lower than for 15V.
  • When using the linearising diodes, gain is propotional to I_d.
    • Try to keep I_d = 1mA
    • I_d is calculated as (+V - 0.7V) / R_d, for example, for 15V supply and 13k R_d, I_d = 14.3V / 13kOhm
    • As I_d is not constant (it changes slightly with signal input), this will not always be the exact current, but it will give the correct relationship between I_d for 12 and 15V supplies
    • Keep | I_s | < I_d / 2  - I_s is signal input current, but it's not evident exactly what that means, see more about the missing/wrong formula for gain below
  • Differential input voltage must be < 60mV_pp (peak to peak) to keep THD < 0.1%. 
    • I am again not entirely sure what this means, but the datasheet uses an example with a 30k input resistor and a (trimable) 500R resistor to ground, and says that "the input divider in the input will reduce the 1Vp to 33mVpp. A simple resistor divider with 30k on top and 500R at the bottom will reduce a 2Vpp to 33mVpp so it may very well be just that, meaning that whatever input you have must be divided down so that it is at max 30Vp (single peak) or 60Vpp, ignoring any DC offset.
  • I don't understand how to select resistors to connect to +in and -in, but the norm is to use a 1k pot between the inputs with the center tied to GND. 
    • This makes it possible to trim out DC offset/CV bleedthrough from the output.
    • If the output coupled (AC coupling removes any DC component so any slight mismatch/off-centering will disappear)  two 510R to GND can be used instead.
  • Output current (and thus gain) when using linearising diodes can be approximated as I_o = I_g * I_abc / I_d
    • I_g is the current in the input resistor and is approximated as V_in / R_in
    • I_d is current into the diode biasing input and is (Vsupply - 0.7)  / R_d
    • The approximation is around 10-20% wrong
  • Output current when NOT using linearising diodes is I_out = V_in * q * I_abc / 2kT.
    • V_in is the differential voltage between the positive and negative inputs
    • k is the Boltzmann constant
    • q is the electron charge
    • k is the ambient temperature in Kelvin
    • q/kT = 38.7 V^-1 at 25C (yay, temperature dependence!)
    • A good approximation for V_in is to use the voltage at the resistor formed by R_in and R_g, the resistor from the input to ground: V_diff = V_in * R_g / (R_g + R_in)
    • The approximation is just 1-2 percentage points wrong compared to the simulated results, but the simulated results are 10-15% different than the calculated output. The real life results may be even more different.
    • The calculated current is for an AC-coupled output. In reality, the output has a DC component, meaning it is not centered. The resistors to ground lessens this effect. Adding a DC voltage to the input can also center the output.
  • Output current is converted to a voltage by sinking it to ground and buffering the output. The output voltage is then V_out = I_out * R_out

Changing supply voltages


The only part of the LM13700 that is really affected by changing the supply voltages, is the voltage level at the I_abc input, which is needed when selecting an appropriate R_abc:
  • The voltage at the I_abc input is said to be two diode drops above the negative rail: V_abc = 2*V_be + V-. As a diode drop is approximately 0.7V, using a 15V supply we should expect a voltage of 1.4V -15V = -13.6V
Other than that, the resistor that is used to generate the current into the linearising diodes, I_d, must be changed. 
  • I = (Vsupply+ - 0.7V) / R_d
Whatever circuit generates I_abc may need modifications. For the linear control voltage of the Xonik VCA nothing has to change. 

For an exponential converter, you need to change:
  • The reference current resistor to get the same reference current: I_ref = Vsupply- / R_ref
  • The offset voltage resistor is connected to Vsupply and must be recalculated
  • R_abc must be changed to allow a smaller (when going from 15V to 12V) resistor to pass the same I_abc
The currents and voltages around the inputs are independent of supply voltage, and the gain is proportional to I_abc with exactly the same ratio for 12 and 15V supplies. 

NB: All of this is based on studying the simulation results so a disclaimer is necessary, things may be a bit different in real life :-D

A bit of background


An example of the circuit using I_d / linearising diodes:


An example of the circuit without using linearising diodes. R4 may be replaced with a short but that will move the output more off center.



Formulas

Without an R_d/I_d:

- gain is said to be q * I_abc / 2kT. My simulations show that it is close to what the simulator says.

- kT/q = 26mV at 25C

- however, this is only an approximation for small differential input voltages. How small? Not sure, I can't find it even though I thought I read it in the datasheet.

- and you need the differential input voltage, but that can be approximated as described above.

With  R_d/I_d:

- gain is said to be I_out = I_s * (2*I_abc / I_d), for  | I_s | < I_d / 2

- however, nobody really knows what that means exactly, and what I_s is it seems.

- Iain from Lushprojects (http://lushprojects.com/blog/2012/08/lm13700-missing-forumla/) came up with an alternative formula: I_out = I_g * I_abc / I_d, where I_g is the current in the signal input resistor. It is said to be around 12% less than the actual gain but gives a ballpark at least.

- I_g can be approximated as V_in / R_in, in other words ignoring that the input is not at 0V. 

- The error in the formula is larger the smaller the biasing resistors get (and the smaller the input resistor gets), simply because the current in the biasing resistor increases relative to the input current. For the normal 500R biasing resistors, the error is around 17-19%.  

- The error in the formula are supply voltage independent.

The takeaway from these formulas are that the gain is dependent on I_d and that you can use a bigger input signal when using I_d, meaning less noise.

Links about the wrong formula: 

- http://lushprojects.com/blog/2012/08/lm13700-missing-forumla/

- https://modwiggler.com/forum/viewtopic.php?t=65783

- http://lushprojects.com/circuitjs/circuitjs.html?startCircuit=ota-gain.txt


A bit about the internals


Internally the circuit consists of four current mirrors and a differential transistor pair.

A current mirror is a circuit that makes sure that the current in two of its legs stays the same - one is the reference and one is the output - independent of what is connected to its output.

For this circuit, one of the mirrors makes sure the sum of the currents through the differential transistors, I_4 and I_5 here, equals the control current I_abc.

The three others bounces I4 and I5 around and combines them at the output, with the result being that I_4 + I_5 = I_abc

When trying to understand the circuit, it is useful to separate the analysis into two parts - what happens without any external AC input, and what happens with ONLY the AC input - as there will be a DC offset both at the input and output terminals.

Also, it helps to think about what voltages and currents are significant and what can be ignored/expected to be fairly equal.

No comments:

Post a Comment