Saturday, February 9, 2008

How a VCO works

How does a voltage-controlled oscillator actually work? If you've studied electrical engineering, you've doubtless come across "natural" oscillator circuits like the Hartley or Colpitts oscillators. These circuits generally rely on the natural resonance of a combination of inductors and capacitors to create oscillation, or to the inclusion (e.g., a crystal oscillator) of a component that mechanically or electrically resonantes at a given frequency. They "want" to oscillate at a given frequency in the same way that a violin string does -- a small amount of energy fed into the system, in almost any form, creates the oscillation.


Well, if you are designing a VCO for a synthesizer, you can forget all of the above. Synth VCOs aren't designed using naturally resonant circuits. There are two main reasons why. The first is that circuits such as Hartley oscillators were originally conceived as RF oscillators, operating at frequencies far above the audio range. Making an RF oscillator circuit designed to run in the megahertz range run at, say 500 Hz, requires unreasonably large inductors or capacitors, and it could be expected that the resulting circuit would not be very stable. The second reason is that it is difficult to make these circuit voltage controllable over a large frequency range. There is such a thing as an RF VCO; they are usually designed using a component called a varactor, which is basically a voltage-controlled capacitor. However, the basic physics limits the range of values that a varactor can be driven to, and the resulting circuit usually only has a range of about an octave. This is usually sufficient for RF use (consider, for instance, that the span of the FM broadcast radio band is only about 1/5 octave), so nobody bothers to attempt to improve these circuits further. However, the range of human hearing is about 10 octaves, and any reasonable synth VCO is expected to operate over a range of at least five octaves to be musically useful.


So synth circuit designers, starting with Moog and Buchla in the early 1960s, long ago turned to "artificial" oscillator circuits that do not rely on natural resonance. Rather, they rely on an analog implementation of a mathematical function that can be made to increase and decrease proportionally to the control voltage. A second consideration is that a useful synth VCO is expected to output several different waveforms, so that the synth player has harmonic starting points for creating a given sound. Rather than create a separate VCO circuit for each desired waveform, it is far more cost-effective to design a VCO "core" that generates a waveform from which the other desired waveforms can be derived.


The most common type of VCO core is the "sawtooth core", which, as the name implies, outputs a sawtooth waveform. A sawtooth wave rises (or falls) in a straight line from a starting point to an ending point, at which time it instantaneously jumps back to the starting value. (The name stems from the waveform's appearance on a scope; it looks like the teeth of a hand saw.) The slope of the line -- how rapidly the voltage value rises from the starting value to the finishing value -- determines the frequency.  A block diagram of a sawtooth-core circuit is shown below:




The simplest way for a VCO core to make a sawtooth wave is to "integrate" the control voltage. What does this mean? Consider one of those novelty water features that consists of water that pours into a bucket mounted on an axle. When the bucket gets full, the center of gravity rises far enough that the bucket tips over. The water is dumped out into a pool, and then the empty bucket (because it is weighted at the bottom) tips back to the upright position and begins catching water again. The bucket integrates the water flow; the level of water in the bucket is a function of the rate of water flow and how long the water has been flowing in the bucket. Presuming that the water flow is of a constant rate, and the bucket is a perfect cylinder, then if the water level in the bucket is plotted over time, the graph looks like a sloped straight line. Like the straight line of a sawtooth wave. The water level "resets" to its starting point when the bucket tips and empties itself.

A capacitor is the electrical equivalent of the bucket. If a constant current is applied to the capacitor, the voltage across the capacitor will rise at a constant rate. (The capacitor integrates the current.) A fairly basic circuit (left as an exercise, but it's not difficult) can take the control voltage and output a constant current which is proportional to the voltage. The equivalent of the bucket tipping is provided by a transistor which shorts out the capacitor when triggered. While it is charging, a voltage comparator constantly compares the voltage across the capacitor to a reference voltage. When the voltage across the cap exceeds the reference voltage, the comparator momentarily triggers the transistor which shorts out the cap, discharging it back to the starting voltage. So you get a sawtooth wave -- the voltage rises (or falls, if the applied current is negative) linearly to a threshold value determined by the reference voltage, and then it instantaneously jumps back to the starting value. The constant-current source is arranged so that a control voltage varies the charging rate, and that is what determines the output frequency. Wave shaping circuits derive the other desired waveforms -- square, pulse, triangle, etc. -- from the sawtooth output by the core circuit.


Why do VCOs drift? There are three main sources of drift in the sawtooth-core circuit, mostly temperature related. The relationship between the control voltage and the current output by the constant-current source may shift. The comparator circuit may develop offsets, causing it to trigger early or late. Or the reference voltage may change. An early trigger or a decrease in the reference voltage cause the oscillator to go sharp; a late trigger or an increase in the reference voltage does the opposite. However, another significant source of drift exists outside of the core circuit proper. The response to the control voltage of the VCO core circuit presented here is linear; that is to say, volts/Hz. In order to achieve a volts/octave response, the control voltage input must first be processed by a circuit called an "exponentional converter", which re-scales the control voltage internally so that each unit of increase (usually 1 volt) in the input control voltage results in a doubling of the output frequency of the VCO. This is done in the analog realm by wiring a transistor in a certain way. But, it is inherent in the physics of the transistor, when it is used in this manner, that the output will vary by a known amount for a given change in temperature. Circuit designers usually compensate for this by including a resistor known as a "tempco" in the circuit. The tempco varies its resistance by a known amount for each degree change in temperature. If it can be mounted so that it accurately senses the expo converter transistor's temperature, it can be made to compensate for the transistor's drift. That is a pretty large "if", though. Designers use various methods of thermally coupling the transistor and the tempco, ranging from glueing the two together, to mounting them both on a common heat sink.


This is the basic description of how most synth VCOs work. Variations of the circuit are sometimes seen. An alternate to the sawtooth core circuit called the triangle core (which, as you would expect, outputs a triangle wave) is sometimes used. (The current Plan B Model 15 VCO employs a triangle core.) An integrated circuit called the uA726 was used in the EML 101 and some Minimoogs to perform expo conversion; instead of compensating for temperature drift, it kept the expo converting transistor at a constant temperature using an internal heater and thermostat. (Unfortunately, it is long out of production, and NOS ones go for $70-100 on eBay. Fortunately, they don't fail often.)


However, the most radical alteration of the basic VCO circuit was the one undertaken by several manufacturers in the early 1980s. To improve the VCO's tuning stability, they radically altered the circuit and created the digitally controlled oscillator, or DCO. I'll analyze the Roland Juno-106's DCO circuit in a future post.

9 comments:

slowlan said...

Many thanks for your concise and clear description, which I think I saw first on VSE.

I have read three elec tronics textbooks in the hope of understanding what I am doing when I solder up a DIY synth module (Elby, CGS )but your description is the best yet!

Many thanks

slowalan

Dave Cornutt said...

You're welcome. Yes, this article is an expanded version of a post I made on VSE back in January.

synthfreak said...

Great explanation.

FYI - linked to this from the Synthtopia blog.

Miconos said...

good post, thanks

Tom said...

very good explanation. thanks for posting this. the bucket analogy is great, it helps alot to understand whats going on.

dfous said...

Bon marche de Dofus Kamas.achat de dofus.le prix moins cher.nous vendons dofus,or de Wakfu. 24/7 appui-en-ligne et livraison rapide.Wakfu Kamas
china: chinaserving

dreaz said...

I am grateful to you for this great content.aöf thanks radyo dinle cool hikaye very nice ssk only cinsellik very nice ehliyet only home free kadın last go korku jomax med olsaoy hikaye lesto go müzik dinle free only film izle love aşk only mp3 indir only radyolar lest go açıköğretim free net only filmler

Benjamin Budts said...

I'm debugging Juergen Haible's living vco... This is my first SDIY project and this was really useful. Thx a lot

Grant Overend said...

Fantastic explanation!