A simple VCO for an analog synthesizer - Page 1
Forum section: electronics / projects

author: brananarchy
author_rank: Newbie
timestamp: January 02, 2018, 04:17:55 am
content: This (relatively) simple oscillator outputs a triangle wave with a 1V/octave control voltage (that is, a 2V input produces a signal with twice the frequency of a 1V input). It's my first analog design, so feedback and comments are very welcome!A basic functional overview:U1A scales the input voltage from 1V/octave to 20mV/octave, and the trimmable voltage divider finishes scaling to the ~17mV/octave to drive the exponential converter.U1B, Q4, and Q5 are an exponential voltage to current converter. This arrangement cancels out most of the temperature dependency in the relationship between Vbe and Ic of a single BJT.Q1, Q2, and Q3 along with Q6 and Q7 form a pair of current mirrors which can charge or discharge C1 with the same magnitude current as output by the converterThe diode bridge allows C1 to either charge via Q3 or discharge via Q7, depending on the output of the schmitt trigger made with U2AU2B just buffers the voltage from C1. Its output is also the output of the oscillator.The triangle output is slightly lopsided - the rise time is about 1.25 the fall time. I suspect that this is due to the totally unmatched jellybean transistors I used to breadboard this causing the current mirrors to be imperfect. I have a few THAT corp matched transistor arrays, and I intend to re-breadboard the circuit using those to see what happens.It maxes out at about 7kHz, and I imagine goes pretty flat some time before that (I haven't done a full tuning test yet). I'm unsure what's causing that. I'm going to try experimenting with some other schmitt trigger designs to see if that helps. It's also possible I'm saturating the exponential converter, and will either need to tweak the resistors in that, or just use a smaller cap to increase the top end. It's stable well below audio frequencies right now, so a smaller cap would be feasible.Once I've dealt with those issues, there are still several more modules I need to design and build to turn this into a practical synthesizer. It's already pretty awesome to twiddle the control voltage knob and hear the frequency sweep, though!

author: jbb
author_rank: Super Contributor
timestamp: January 02, 2018, 07:56:54 am
content: That’s a fun circuit. I’m always amazed to think about building music from op-amps.I’m not fantastic with this style of analog, but something looks odd around Q7 and D1-D4. It clearly works, so maybe just a drafting issue.It looks like your output is a bit asymmetrical. This could be due to inaccuracy in the current mirror (maybe some emitter resistance would help balance things up) or the comparator hysteresis. As it stands, variations in the +-12V rails or temperature differences between the transistors will affect the symmetry and output frequency. You might want some kind of fixed reference for the hysteresis.The exponential converter looks interesting - I might knock one up on a breadboard...I also suggest some low pass filtering (10kHz+) of the input signal to avoid weird radio-receiver operation and provide some ESD protection to U1A.

author: jbb
author_rank: Super Contributor
timestamp: January 02, 2018, 08:03:18 am
content: Also thanks for the description and clear schematic.Edit: the documenthttp://electronotes.netfirms.com/s019.pdflooks very helpful and suggests some additional measures for improving performance over temperature.

author: Kleinstein
author_rank: Super Contributor
timestamp: January 02, 2018, 10:58:32 am
content: Q7 is very likely draw the wrong way around (E and C swapped).

author: bd139
author_rank: Super Contributor
timestamp: January 02, 2018, 11:42:26 am
content: Interesting design. Thanks for taking the time to post. Good job if that's your first designThe THAT arrays are quite expensive. Have a look around for the good old CA3096 IC. I scored a whole tube of them on ebay for £10. There is a modern HFA3096 array by Intersil which is a good bet as well but Vce(max) is low and the fT is 8GHz (!) so it may have oscillation problems. Also some of the BCM847 series arrays are well matched and a lot cheaper:https://assets.nexperia.com/documents/data-sheet/BCM847BV_BS_DS.pdf

author: Yansi
author_rank: Super Contributor
timestamp: January 02, 2018, 12:02:19 pm
content: I do not understand how the diode switch works. Isn't D2 and D4 also drawn with a wrong polarity?And regarding the current mirrors: There are a lot of dual transistor singlechip solutions available, such as BCV61/62 current mirrors. By stacking two of those, you can get a quite well behaved current mirror.

author: Zero999
author_rank: Super Contributor
timestamp: January 02, 2018, 02:01:12 pm
content: U2A is acting as a comparator, yet the TL072 is designed to be a linear amplifier. This will slow it down and could be contributing to the asymmetrical waveform. Look at the square wave output with an oscilloscope. Is the duty cycle 50%? Is the positive voltage, equal to the negative voltage?The circuit is quite complex, considering the performance isn't that great. I've had more success with a comparator, op-amp based integrator and some switching transistors. See the thread linked below. I've only posted simulations but I have actually built some of those circuits, with reasonable results. I'll post some pictures, if I find it and have the time.https://www.eevblog.com/forum/beginners/simple-analog-function-generator-design/

author: Wimberleytech
author_rank: Super Contributor
timestamp: January 02, 2018, 02:24:24 pm
content: Quote from: bd139 on January 02, 2018, 11:42:26 amThanks for the tip on the HFA3096. I love the CA3096 and also bought a few off ebay (not as good a deal as you). Was gonna be miserly about their use until now I can get the Intersil part when I run out!!

author: bd139
author_rank: Super Contributor
timestamp: January 02, 2018, 03:30:54 pm
content: Just be careful if you do get the HFA3096. While a compatible device it's somewhat more fragile with much lower breakdown voltages. Keep your rails to +/-5V which isn't much headroom with a Vbe drop or two in your circuits. If it goes over 12V it will go to silicon heaven. I only bothered to look at the datasheet properly when I was soldering my third one onto a carrier boardThe BCM847 is much better for that really.

author: Kleinstein
author_rank: Super Contributor
timestamp: January 02, 2018, 04:02:09 pm
content: For the current mirrors one could add small emitter resistors, to make them less critical. Dual transistors like the BCM or BCV61/62 should be good enough. If at all the log converter is critical. There is still a residual temperature dependence in this log conversion - those 1 V/octave is still about proportional to absolute temperature. To make is really temperature stable, a compensation with something like a PT1000 or a KTY81 is needed.

author: floobydust
author_rank: Super Contributor
timestamp: January 02, 2018, 06:33:28 pm
content: Temperature and Vcc variations make a VCO design that stays in tune very difficult. Some discussion here:Re: Syncing Synth VCOs

author: w2aew
author_rank: Super Contributor
timestamp: January 02, 2018, 06:36:56 pm
content: Q7 sure looks upside-down, and the diode steering arrangement looks wrong. I did a simpler variation of the basic circuit (minus the voltage controlled current source & mirror bit) as a circuit tutorial video a few years ago:

author: David Hess
author_rank: Super Contributor
timestamp: January 02, 2018, 11:41:36 pm
content: A lot of old discrete plus operational amplifier function generators work this way with a pair of variable current sources driving a diode bridge for switching feeding an integration capacitor. With care, this topology is suitable to 10s of MHz. Check out the schematics for the old Tektronix FG501, FG502, FG503, FG504, and FG507 function generators.In your case, the discrete transistor current mirrors need emitter degeneration for better accuracy. Even then, the resistance may be trimmed for best symmetry. Usually operational amplifier are used for each current source for best accuracy.Quote from: Kleinstein on January 02, 2018, 04:02:09 pmOr ovenize a transistor array by using one transistor as a temperature sensor and another as a heater. For examples, see figure 21 of Linear of Technology application note 14, figure 4 Linear of Technology application note 5, and National Semiconductor application notes 256, 264, and 299.

author: bd139
author_rank: Super Contributor
timestamp: January 02, 2018, 11:56:26 pm
content: There’s a log amplifier in art of electronics 1st edition as well. That uses two junctions in different feedback paths to compensate for temperature drift. I built that successfully and using both Vbe junctions in a CA3096 and it was rock solid. Drift was completely unmeasurable with my kit even giving it a blast with the wife’s hairdryer. I had crap kit back then so that’s not a glowing recommendation

author: David Hess
author_rank: Super Contributor
timestamp: January 03, 2018, 01:24:51 am
content: Quote from: bd139 on January 02, 2018, 11:56:26 pmI do not have the first edition but if it is the same circuit shown in the second edition, the second transistor only compensates for the temperature dependent offset and not the gain which varies by 0.35%/C necessitate a +3500ppm/C resistor. The second edition points this out in the text and suggests using a thermistor network to adjust the gain of the output amplifier which is normally how it is done.

author: bd139
author_rank: Super Contributor
timestamp: January 03, 2018, 09:25:59 am
content: You may be correct there. I don't have a second edition to verify the differences either. Will scan and post it later if I get a few minutes. The first edition might be devoid of that explanation. It was a little terse compared to later volumes (one reason I keep it around - doesn't try and murder you like 3rd edition does)

author: David Hess
author_rank: Super Contributor
timestamp: January 04, 2018, 03:48:46 am
content: A +3500ppm/C resistor shows up in most log amplifier designs and if there was a way for making one without it, they would as with the temperature stabilized examples that I linked. Monolithic construction is not sufficient by itself or you could make a log amplifier with a transistor array and no further temperature compensation. If you do a search for this resistor, it comes up most common in connection with analog music synthesis for obvious reasons.

author: Keicar
author_rank: Regular Contributor
timestamp: January 04, 2018, 11:27:26 pm
content: This might be relevant and/or helpful:http://www.openmusiclabs.com/files/expotemp.pdfKarl.

author: Audioguru
author_rank: Super Contributor
timestamp: January 05, 2018, 12:53:48 am
content: Have you tried the very simple circuit in the datasheet of an LM324 or LM358 opamp? it would work better with a better opamp.

author: Someone
author_rank: Super Contributor
timestamp: January 05, 2018, 01:18:51 am
content: Quote from: Audioguru on January 05, 2018, 12:53:48 amThat example does not have the exponentially scaled control voltage the OP is working around.

author: Zero999
author_rank: Super Contributor
timestamp: January 05, 2018, 09:56:55 am
content: Quote from: Someone on January 05, 2018, 01:18:51 amYes, I missed that too.Quote from: brananarchy on January 02, 2018, 04:17:55 amWhy not add an exponential circuit to the circuit posted by audioguru? If higher frequencies are needed, then the LM358 should be replaced with an op-amp and comparator.

author: w2aew
author_rank: Super Contributor
timestamp: January 05, 2018, 02:56:17 pm
content: Quote from: Hero999 on January 05, 2018, 09:56:55 amBecause the amplitude of the triangle output of this circuit is frequency dependent (constant charge/discharge current in the integrator).

author: David Hess
author_rank: Super Contributor
timestamp: January 05, 2018, 03:30:46 pm
content: Quote from: w2aew on January 05, 2018, 02:56:17 pmHuh? It is not a very good circuit and I have used it before but the triangle wave amplitude is only controlled by the operational amplifier on the right side operating as a comparator. The input voltage controls the integration current and the comparator controls the triangle wave amplitude so frequency is linearly dependent on input voltage.

author: Zero999
author_rank: Super Contributor
timestamp: January 05, 2018, 04:31:59 pm
content: Quote from: David Hess on January 05, 2018, 03:30:46 pmYes, that's right, the comparator controls the amplitude. However, at higher frequencies, the amplitude does tend to increase, due to the propagation delay of the comparator, the output tends to overshoot somewhat.

author: w2aew
author_rank: Super Contributor
timestamp: January 05, 2018, 06:11:55 pm
content: Quote from: Hero999 on January 05, 2018, 04:31:59 pmYeah - my bad. I only glanced at the circuit for a few mS and thought I saw an integrator being driven by a variable freq square wave. Of course, the amplitude of the triangle is basically set by the hysteresis limits of the second op amp (comparator) stage.

author: David Hess
author_rank: Super Contributor
timestamp: January 06, 2018, 01:43:41 am
content: Quote from: Hero999 on January 05, 2018, 04:31:59 pmThere is a variation where the output from the integrator drives the other comparator input through a resistor so bypassing the resistor with just the right capacitance triggers the comparator earlier as the frequency rises compensating for the delay and linearize the frequency versus voltage.

author: Svgeesus
author_rank: Regular Contributor
timestamp: January 06, 2018, 01:36:42 pm
content: Quote from: floobydust on January 02, 2018, 06:33:28 pmAnother two useful resources on tempco for exponential converters:www.openmusiclabs.com/files/expotemp.pdfhttp://www.schmitzbits.de/expo_tutorial/An example tricore oscillator circuit by Ian Fritz with a temperature compensated expo converter:http://ijfritz.byethost4.com/sy_cir4.htmAnd another by Thomas Henryhttp://www.birthofasynth.com/Thomas_Henry/Pages/VCO-1.html#Design_Analysis:_The_Exponential_Converter