My Attempt at Trimming a Linear to Exponential Converter - Page 1
Forum section: electronics / projects

author: Yansi
author_rank: Super Contributor
timestamp: December 22, 2020, 09:32:44 pm
content: Hello,I've been studying up on precision exponential converters. This website has by far the best explanation of the theory behind workings of the transistor differential pair based converter.https://www.xonik.no/theory/vco/expo_converter_1.htmlhttps://www.xonik.no/theory/vco/expo_converter_2.htmlAt the end of part 2, he explains the use of the temperature compensating resistor, to cancel the temperature dependence of VT. Unfortunately, these specific tempco resistors seem to by quite a rare animal, so I thought there must a different way to it. What I came up with, is the following circuit:The input base of the transistor accepts low voltages only, so you already usually have a voltage divider there. I then figured out, I could place a PTC in the lower part of the divider, to increase the voltage with temperature.I have selected KTY81-210 as the most likely candidate as the PTC. By connecting a resistor in parallel with the PTC, I can control the tempco (Tk, %/K) of the PTC, although not in linear fashion - but it doesn't matter, read along!I then derived all equations to calculate both resistors of the divider, to satisfy both the requirement of specific %/K tempco and specific voltage output.In the following image, you can see the principle of my temperature compensation and the equations that are used to calculate R1 and R2. Rt is the nominal resistance of the PTC at reference temperature (25°C), Tk(RT)is the nominal %/K coefficient at the reference temperature (0.79 %/K in case of the KTY81-210). Tk is the required tempco slope.To calculate the resistor divider, one needs to simplify using Thevenin equivalent circuit and calculate the equivalent Vi and Ri values. The Ri value is given strictly by the temperature coefficient ratio of the PTC and the required slope.I have then evaluated the performance of the circuit, using the datasheet resistance table of KTY81-200, and calculated the resulting output current according to the Ebers-Moll equation. In the plot below, you can see both the uncompensated converter and the compensated one, using this method. Considering this was just a thought experiment (as obviously, I haven't had anything better to do the whole afternoon), I was quite surprised the compensation works so well across so wide temperature range. The exponential output current error seems to fit well within a 1 % across a 100 K temperature range. Could be likely tweaked even better.The above plot was created with the following parameters: R1 = 47 kohm, R2 = 1.5 kohm, Iref = 15 uA and the deltaVBEwas 17.8 mV/K, which equals to doubling of the output current at 25 °C. The voltage divider was calculated for 1 V per octave output - as typically used in analog sound synthesizers.I am aware of that the above algebra contains a lot of simplifications and assumptions about the transistor pair, but still I am quite surprised of the result. Can anyone confirm, my calculations were done right? Or have I just reinvented the wheel?Sure one can use a dedicated IC, but that was not the point of all this. The KTY series PTC thermistors are widely available, unlike precision tempco resistors, that are manufactured only in specific Tk groups with large tolerances. The proposed circuit above offers the flexibility to set an arbitrary temperature compensation slope.

author: Kleinstein
author_rank: Super Contributor
timestamp: December 22, 2020, 10:55:56 pm
content: Combining a higher TC PTC with a parallel (or series) resistor is nothing new. The more usual starting point would be a PT1000 resistor with a TC that is no so much higher than needed. The KTY82 ones are usually cheaper.

author: Yansi
author_rank: Super Contributor
timestamp: December 22, 2020, 11:54:17 pm
content: Isn't KTY82 just the exact same sensor, only different package?Not that the parallel combination is anything new, but haven't seen a schematic where it was actually used like this in conjunction with the exp converter. Mostly use either ovenized transistor array (use spare transistors from transistor array IC to stabilize chip temperature) or use (these days mostly) unobtanium special tempco resistors. Hence curious why aren't these PTCs used more often. The PTC should give superior precision to what a resistor with +-10%(or even worse) tempco spec would allow.Pricewise, seems not much of a difference, whether the KTY8x PTC or a tempco resistor.Apart that the KTY8x are always at the shelves.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: December 23, 2020, 02:36:28 am
content: Not sure about application, but it is something I've considered before. Here's a single-point adjustment (calculated using the derivative at a point):https://www.seventransistorlabs.com/Calc/Tempco.htmlProbably, a lot of commercial applications are spoiled by the availability of tuned tempcos? Like radios using exactly N750 or whatever caps they happen to need, instead of having to make do with say N3300s and a ton of padding. I...don't really think or know that custom tempco resistors have been as popular as the capacitor types? But I use them so rarely, it's easily more on the side of my just not knowing.On a related note, I've tweaked NTC thermistors and resistors to just about cancel the Vbe tempco in a constant current or foldback limiter; I don't have an analytical solution for that (but also kind of doubt that one would be reasonably tractable?), but it's easy enough to poke around with in SPICE, given suitable models for each. Typical performance is +/- 10% current and/or offset over a rather wide temp range (like 0-125C, or even -40-150C, or maybe a bit looser at that end).Also about NTCs, since their values vary so aggressively, you can use a couple different values, stacked with parallel and series resistors, to make a more linear curve. This may be of interest in this topic [analog-computing purposes], for when you need an NTC complementary to a PTAT or something like that. Though again I don't have any results handy, and you'd probably just have to iterate a design. Just a thought.Tim

author: Yansi
author_rank: Super Contributor
timestamp: December 23, 2020, 11:36:28 am
content: Never head to deal with capacitor tempcos, although I have read a lot of older radio-related literature, where they solved oscillator stability by combining different caps (long obsolete stuff these days, where fractional PLLs and DDSs are a common thing).About the tempco resistors - I've read somewhere, that they are quite difficult to produce, due to wild variability of the resulting tempco, so they need to be sorted into bins - nothing really that precise, as a modern temperature sensing PTC.I would happily test my circuit, if I could just find a single freaking KTY8x PTC! I know I have a bunch of them, but when I need them, I can't find them.

author: mag_therm
author_rank: Frequent Contributor
timestamp: December 23, 2020, 07:03:15 pm
content: Do you need the log of an input?I tried something similar for a photographic light meter with extended temperature range.The log transfer function is by the classical op amp with feedback diode working in small current range of the junction.Instead of using a sister diode to compensate in-circuit for the variation of Vt with temperature, I used it to drive a heater.Then the heater resistors and two diodes are mounted in a little aluminum "oven" with high thermal conductance between the components.I made the circuit just using LM324 and 1n4148 , also did some qucs parametric sweeps vs cold battery voltage and diode temperature.I think the better way to compensate for your junction Vt, is by using another similar junction.(?)

author: David Hess
author_rank: Super Contributor
timestamp: December 23, 2020, 11:45:34 pm
content: Quote from: Yansi on December 22, 2020, 09:32:44 pmAnother way to compensate the temperature dependence is to use a transistor array with one of the extra transistors operating as a temperature sensor and another operating as the heater. See page 15 of Linear Technology application note 14 for an example of this in connection with an exponential voltage to frequency converter for music applications.Know that it is not only Vt that varies with temperature but the gain as well. Vt is usually compensated using another matched junction while the gain is corrected by the compensation resistor.

author: Yansi
author_rank: Super Contributor
timestamp: December 24, 2020, 12:06:34 am
content: Quote from: David Hess on December 23, 2020, 11:45:34 pmI wanted for once to try without an unobtanium transistor array - just press hand-matched pair of transistors together with the PTC into a piece of aluminium bar.Are there any transistors arrays made these days? CA3046 is nice (already seen the appnote), but apart from getting unknown stuff from the far east... there may be anything but a set of matched transistor on a single die.QuoteHaven't you mix&matched? Vt is what's affecting the gain. (Saturation current Isis what is compensated by the matched junction in the differential pair, Isis what is settign the initial current).

author: David Hess
author_rank: Super Contributor
timestamp: December 24, 2020, 12:20:20 am
content: Quote from: Yansi on December 24, 2020, 12:06:34 amSorry, what I meant is Vt varies from transistor to transistor, so a matched transistor removes the effects of variation between parts and the resistor compensates the change in gain with temperature.The ovenized version still requires two transistors to compensate for variation in Vt.

author: Yansi
author_rank: Super Contributor
timestamp: December 24, 2020, 12:52:23 am
content: Okay, found that a few matched transistors are still manufactured, for prices one just can't resist loving - screw you customer, that you need something bit niche! It is not a problem to make a million transistor CPU, but two transistors are a problem. Come on..I'll try buying a bunch of transistor arrays from Aliexpress and test them out later (CA3046, CA3096, LM394). But still interested to see, how a hand matched PTC compensated pair would perform.After all, I even have a handful of old can-package style transistor pairs, however these are some obscure parts that were made behind the iron curtain, no clue if they are even single-die or just two transistor dies slapped in a package.

author: Yansi
author_rank: Super Contributor
timestamp: December 24, 2020, 01:21:53 am
content: Huh, looksie what I found!MMPQ3904 quad (datasheet). But they are not matched as far as I can tell, and likely separate dies of 2N3904.Still in stock, price very good.//EDIT: Wooo! Matched pair of 847s(BCM847DS, datasheet)for a couple of cents! Amazing.

author: Kleinstein
author_rank: Super Contributor
timestamp: December 25, 2020, 11:09:22 am
content: There are still matched transistor pairs / sets available, like the MAT1 ...14 series, thought they are not cheap.There are also a few low level chips that could be used, e.g. the MC1496, by using only part of the circuit.The cheap ones like the BCM847 or MMPQ3904 are usually just separate dies in one case. This can be OK too, but may have more offset.

author: Messtechniker
author_rank: Frequent Contributor
timestamp: December 25, 2020, 10:02:48 pm
content: Because I was forced to replace the now obsolete CA3046 doing its exp. or rather log. thing, I did the following avoiding special components altogether:Make a tight pack of 5 BD 139s because of their housing.2 matched ones for the exp. function, in the middle one as a temperature sensor and one each on the outside as heaters.See pic.

author: David Hess
author_rank: Super Contributor
timestamp: December 26, 2020, 09:35:36 pm
content: THAT Corporation also makes them but they are not cheap:http://www.thatcorp.com/300-series_Matched_Transistor_Array_ICs.shtml

author: Yansi
author_rank: Super Contributor
timestamp: December 27, 2020, 03:59:54 pm
content: I've quickly found all those THAT, MAT and whatever SSM20xx parts. However they all fall in a category "prohibitively expensive", for an application where LM3046 once was all that was needed.I've ordered some of the PTCs to try my TC compensation first, as I have no previous experience building EXP converters, so I need to try them all, to see what works and what doesn't and what fits the application.Also, bunch of different oldies (CA3046, CA3092, LM394 etc...) are on the way from china, so let's see, what they will be. I'll update the thread when I get them.

author: David Hess
author_rank: Super Contributor
timestamp: December 28, 2020, 05:19:00 am
content: Quote from: Yansi on December 27, 2020, 03:59:54 pmIt is a sad situation. Another oldie but goodie was the LM389 which was an LM386 audio amplifier plus three uncommitted NPN transistors.

author: fcb
author_rank: Super Contributor
timestamp: December 29, 2020, 07:23:10 pm
content: I've used BC847BPN and BC847BS in a few commercial analog synth designs. They are cheap and surprisingly well-matched.

author: Yansi
author_rank: Super Contributor
timestamp: December 29, 2020, 10:11:16 pm
content: And how did you solve the tempco compensation?

author: fcb
author_rank: Super Contributor
timestamp: December 29, 2020, 11:43:19 pm
content: Various ways to deal with tempco compensation on different products, including NTC resistors, Vbe temperature sensing (probably the easiest) and continuous digital adjustment (when not playing user commanded notes, the synth rearranges its switching matrix and continuously tunes itself - product still active so no names).The biggest takeaway would be to keep the maximum current (from your exp. converter) as low as possible (in VCO’s this is typically when you are generating the highest frequencies) - you can often detect a pitch-bend in analog VCOs on high notes caused by self heating in exp. converters.

author: Yansi
author_rank: Super Contributor
timestamp: December 30, 2020, 01:51:38 am
content: Oh well, if you can involve a microprocessor in the loop... stuff becomes way more interesting in various ways.Most times the reference currents for the EXP converter seemed to be in the low tens of uA, like 10 or 15, which over 10 octaves end up somewhere from 10 to 15 mA. Which can indeed generate significant heating, if the Vce is north of 5 V.

author: fcb
author_rank: Super Contributor
timestamp: December 30, 2020, 11:10:10 am
content: In ultrawide exp. converters I've used cascode transistors to lower the heating. Also experimented with SOT223 packaged single transistors on a large plane to reduce tempco effects.Quote from: Yansi on December 30, 2020, 01:51:38 amI'd go alot lower than 10-15uA for your lowest frequency, use small mainbrand C0G triangle capacitor. Treat it like RF with a splash of volt-nuttery for layout. Microphonics can be an issue, and for some VCO core types charge-injection from current steering switches is an issue.As for using the microcontroller to tune. All the synthesis was analog, we just needed to keep it perfectly in-tune with no user intervention. The DACs (repurposed audio 24bit audio dacs) output the CV which was adjusted using a table, table constantly updated as described before. There's a song out there that sampled one of these synths with broken matrix doing the usually quiet auto-tune.

author: Yansi
author_rank: Super Contributor
timestamp: December 30, 2020, 11:44:40 am
content: 24bit audio DACs? Guessing a design choice due to these being veeeery cheap, compared to simple freaking >=16bit DAC with SPI or I2C.Why not using a film cap in the oscillator? Wouldn't that be more stable with less leakage? I know polystyrene caps definitely get made even under 100 pF (guessing the cap may not be much larger than few hundred puff, if the reference current is like << 10 uA in the low end).And speaking of the heating effects with large Ic: Cascoding would definitely help, I also already tried wiring the output collector a transresistance amplifier (I to V converter), which forces the output transistor to work at Vce = Vbe level and it works. The exponential could be trimmed almost perfect, but the linearity of my VCO suffered badly.

author: fcb
author_rank: Super Contributor
timestamp: December 30, 2020, 03:27:28 pm
content: Quote from: Yansi on December 30, 2020, 11:44:40 amYes audio DAC's are cheap - we didn't need absolute voltage accuracy, just resolution and some speed. I2S is pretty easy to generate.Film caps are expensive and through-hole. And if you think about it, in this application a little leakage isn't a big problem unless you are trying to be ultra-linear. Keep the size of your triangle down and it's effect is smaller still.

author: bson
author_rank: Unknown
timestamp: December 30, 2020, 07:44:04 pm
content: How fast do PTCs change? Junction temperatures can change very quickly and closely match a signal, but I would personally strongly suspect a PTC might not be as quick. In addition, heating it is a function of current and dissipation, while cooling is only a function of dissipation, so there will always be an asymmetry, i.e. f(I(w), Pd(w)) != f(0, Pd(w)) except at one or more specific values for w. This is true for both the PTC and the junction, and it seems very unlikely you'd find better than a very coarse match. The only good match (my wild guess) is another identical junction, and for Pd(w) to match they need to be thermally coupled.

author: Yansi
author_rank: Super Contributor
timestamp: December 30, 2020, 10:29:26 pm
content: PTC will be as quick as you can couple heat to it. Same as using a tempco resistor, or another transistor.As we obviously know, matched transistor arrays are no longer manufactured. Only pairs. No spare transistor left for compensation, let alone to work as a heater.And the PTC/tempco resistor compensation is not there really to compensate instantaneous temperature changes (heating should always be minimized, as correctly pointed above to both lower the current and Vce), but overall average temperature.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: December 30, 2020, 11:17:33 pm
content: Yeah, nothing that's going to respond fast enough, or couple tightly enough, to be useful for AC purposes. We're talking whole seconds here. Just tracking ambient, that sort of thing.Apparently, manufacturers often can customize devices with holes in them (drilled or molded?), so you can get a thermocouple right on the junction or backplate or what have you. That'd be interesting for this kind of thing... but, of course, good luck doing that in one-offs (as a small customer or amateur with no expectation of quantity purchasing), or in production.Tim

author: mag_therm
author_rank: Frequent Contributor
timestamp: December 31, 2020, 09:17:35 pm
content: Transient heating of an antilog oven.The oven (below) has two heating resistors, at 3 and 9 o'clock each dissipating 500mWThe light sensor and its lens are in the large hole.The two 1n4148 diodes are next to each resistor.The lowest hole (unused) is for the op amp input resistor if necessary.One diode does the antilog of the light.The idea is that all components will be close to the same temperature, as controlled by the second diode.The oven ( img 1) is made of 6061 aluminum, and the properties of epoxy were used for the components in the holes. The surfaces are radiating and convecting to -10 CelsiusIn the mp4 (link), the initial temperature is -10 Celsius and the heating is shown at steps of 10 second.The oven can just reach 20 Celsius in 100 seconds with the total of 1 Watt heating.https://app.box.com/s/ww70n900pipayx858i32vqz5tv08cogl(I will need to take down the mp4 file after a week or so.)