DIY VCO Part 1: The analog oscillator core anyone can build

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
when I was first starting out trying to build a synthesizer I could only really find two types of oscillator designs either that simple but not really usable or with all the bells and whistles you could wish for but way too complex for a beginner so once I found my way around this stuff I was curious to see if I could cobble together a kind of baseline VCO as simple as possible while still being musically useful and here's what I came up with an analog sawtooth core oscillator with reasonably accurate volt per octave tracking made from just a handful of really cheap components and because it has that volt per octave tracking you can use it with most standard sequences like this sq1 for example to understand how it works let's first talk about what an oscillation is exactly you're probably quite used to seeing the little waveform symbols on your synth there's a few different shapes square triangle sine sawtooth some V cos even have weird ones like shark fin or reverse sawtooth now the question is what are these waves made of in other words what is oscillating here you could of course be blunt about it and say electricity obviously and you would be kind of right but unfortunately that answer is not really helpful we need to be a little more precise here before we go on though I want to warn you I am NOT an electrician so my explanations might be overly simplistic or even a little off but so far they've worked for me and just take everything I say here with a grain of salt with that out of the way let's talk about electricity electricity basically has two main properties that we're able to measure current and voltage since it's hard to visualize those on account of electricity being invisible and all people settled on using water in a pipe as a metaphor so imagine you have a pipe filled with water closed off at both ends since no force is applied to the water it's not moving also we could say that the pressure in the pipe is at a kind of neutral level this situation is comparable to what's happening inside this piece of wire at the moment since there is nothing pushing electricity into it there is neither current nor voltage with the current being movement while the voltage would be pressure if I hold one end of the wire to the positive terminal of this battery though the story changes imagine that we connect a water pump to this end of the pipe while the other end is still closed off the pump will now start pushing what into the pipe but since the water can't move out the other end we're only going to be raising the pressure inside the pipe and that's roughly what's happening with our wire and the battery no current is flowing but the voltage inside the wire has been raised to nine volts since it's a 9-volt battery now if I were to turn the water pump off we can expect to see the pressure inside the pipe return to the initial neutral level the same deal with our wire if instead of the nine volts from the positive terminal I would apply zero volts from the negative terminal the voltage in the wire would equalize if I'd be able to repeat this process at a high frequency say a hundred times a second I'd have created a 100 Hertz electrical oscillation and what does the waveform look like let's check out a quick diagram here the x-axis is showing time while the y-axis is showing voltage now for simplicity's sake we're assuming that the switching between zero and nine volts is instant and that the time in either states is going to be exactly equal if that's the case we'd get a graph like this for our thought experiment and surprise it looks like a square this is what a square wave really is an ideally instant constant swinging between two fixed voltage levels where the wave forms Heights determines the volume while the width determines the frequency same idea applies to all the other waveforms they're just characteristically shaped repeating voltage swings with that in mind let's look at the one we're trying to produce here so there's two distinct phases in this waveform first we have the initial almost instant rice followed by a constant slower decline in voltage what's interesting about this and that's why I've chosen this waveform for my oscillator is that a sawtooth waves frequency is solely determined by the duration of its second phase the longer it takes for that voltage to fall down the lower the frequency of the wave and vice versa this makes it comparable easy to manipulate that frequent but before we get into that let's take a look at our basic oscillator core so at the center of it all we're using just four components a capacitor hey Schmidt trigger inverter a diode and a resistor that's all that's needed for a fixed frequency sawtooth oscillation to understand what these components do let's talk about water again we'll tackle resistors first while a conductive wire is like a very big pipe where lots of water can pass through a resistor is like a narrow pipe that restricts the amount of water that can flow the narrowness of the pipe is determined by the resistance value measured in ohms the higher that value the tight of the pipe a capacitor is a bit like a balloon that you can attach to the open end of a pipe if there's some pressure inside the pipe the balloon will fill up with water until the pressure equalizes then should the pressure in the pipe drop the balloon releases the water it stored into the pipe the maximum size of that balloon is determined by the capacitors capacitance which we measure in farad diodes are basically like one-way valves water can only pass through in one direction that direction is indicated by the arrow in the diode symbol so any water trying to move in this direction is blocked it can only go from here to here finally there's the Schmitt trigger inverter you can think of that like two separate things over here there's a sensor that measures the pressure inside an attached pipe on the other side there is a water pump this pumps operation is controlled by the sensor whenever the pressure at this point is below a certain threshold the pump will be working if the pressure is above a second threshold the pump won't be working here's a quick graph to visualize that this line represents the pressure at the sensor while this line shows the pressure at the pumps output so every time we cross this threshold on our way up and this one on our way down the pump changes its state one thing that's very very important to keep in mind no water flows into the sensor it's really just sensing the pressure without affecting it so let's put all of this together now when you're trying to analyze a circuit like this it's always helpful to imagine a snapshot of a state zero so in the very beginning once we put this together and turn it on what's happening here well we can start out by looking at this point we'll keep track of the pressure level here by tracing it as a graph so initially there will be no pressure here because the capacitor is empty and nothing is passing through our diode yet so we start out down here and that means that the sensor here is telling the pump to start working because we are below the lower threshold so now we have a flow from this point through our diode to this point next there's two ways to go for water through this resistor to ground and into the capacitor here but what exactly does it mean when electricity is going to ground to stay within our analogy imagine that ground is basically what's behind an opening in our pipe system it is a wide open space into which our water can be released and that means that through this part here our water can leave the system for good how much that depends on the resistor value here or the narrowness of this pipe and the pressure at this point with the capacitor path it's a little more complicated if it's completely empty this is virtually indistinguishable from a straight connection to ground the balloon is empty and you can dump water into it effortlessly at first but as it fills up it starts to push back it gets harder and harder to push more water in until the pressure here is not strong enough anymore and now the capacitor looks like a dead end as if the pipes just straight closed at this point okay but what happens with our water coming from over here then well since at first our capacitor is empty this is the path of least resistance so pretty much everything will flow into here but while the capacitor is filling up the pressure at this point will increase rapidly because now the only way out is through this resistor we're just a very limited amount of water can leave our system the lion's share is going to accumulate here raising the pressure so on our graph we'll see a very very steep rise but an increase in pressure at this point is at the same time registered by the Schmitt trigger sensor so as a reaction the pump will instantly stop working once the capacitor is charged and the pressure passes the sensors upper threshold so let's assume we're in this state now the capacitor is charged enough so that the sensor here tells the pump to shut down this means that no water is being pushed through our diode anymore which in turn means that our capacitor has no opposing force anymore we've essentially stopped pushing water into it so our balloon will push its contents back into the system and where does the water go well it can't go this way because the diode is blocking that there's only one pathway this time through our resistor and to ground but because that resistor is restricting the amount of water that can pass through our capacitor won't discharge instantly it will take some time so on our graph will see a slow decline this will keep going until you reach our Schmitt triggers lower threshold once we pass that on our way down will be basically restarting the cycle because now the pump will flip on again and everything repeats the capacitor will be charged the pump turns off the capacitor discharges via a resistor and so on and that's really all there is to a very basic sort of oscillation but don't take my word for it let's build this and see if it actually works like that yes everything we need a breadboard some sort of power supply you can use a 9-volt battery but I am using myself build tool supply a 2.2 nano farad capacitor a 100k ohm resistor a small signal diode and for the Schmitt trigger inverter I am using a 4106 IC which is six of those in one single chip and to start off let's look at how the chip works here's a pin out diagram to get the chip working at all we need to connect this pin to the power rail while this pin needs to be tied to ground then we can basically choose any of these inverters to be the one we'll be working with I'm picking the one down here there's one catch to using this chip though we need to connect all the unused inputs to ground because otherwise they might pick up static noise and make the inverter we do use act irrationally so first let's set up that chip next I'll put in the diode orientation is important here if you look at it closely you'll notice this thick black stripe on one side of it this represents the line and the diode symbol meaning that current can only flow from here to here for the capacitor the orientation doesn't matter but beware that's not true for every type I'm using a foil capacitor here which is non polarized electrolytic ones on the other hand are polarized make sure to keep this in mind then I'll add in the resistor here the orientation also does not matter finally I'll connect my power supply to the breadboards rails and now this should already be oscillating to check on that I'll use an oscilloscope an oscilloscope works pretty much like the sensor on our Schmitt trigger it's detecting pressure levels and then drawing them onto a screen this makes it a very useful tool for monitoring and troubleshooting to use it our first steps to connect this wire to our circuits ground and then connect this wire to wherever we want to monitor the voltage levels in our case that would be right here at the intersection of Schmitt trigger input capacitor and drain resistor and yes we're actually seeing what we expected to see first a new instant rise in pressure followed by a slower decline and this waveform just repeats indefinitely so our basic oscillator seems to be working but what good is an oscillator that you can't hear right so let's figure out how to connect this to a sound system or headphones whatever you prefer you might be tempted to just attach an audio jack socket right where we plugged our oscilloscope in generally that's going in the right direction but sadly it won't work at all let me demonstrate the wave just disappears and that actually makes a lot of sense because what we're effectively doing is providing an additional path for or proverbial water to flow into and that way our capacitor is never being charged because all of the current is leaving through our audio jack so by trying to listen to the oscillation we're actively stopping it because we are tampering with the construction of the whole thing to avoid doing that we will need to use a buffer buffers also work with pressure sensors but they use them to simply mirror or copy the voltage levels that they detect and since no current is flowing into the sensors they are not interfering with what they're attached to that's why they are a perfect fit for our problem here with the buffer we can leave our oscillator structurally intact and working while still being able to listen in with our sound system to build a buffer I am going to use an op-amp setup like this this way we'll have our sensor on this side while over here we'll get our copy of the sensed voltage levels sounds simple enough but there is a catch this is the pin our diagram 480 lo7 4 which is 4 op amps in one chip now with our 4106 we had a power and a ground connector but with this chip there's power and negative power what's up with that well the thing about voltages is that they're always just relative if we talk about a 9-volt battery for example all we really know is that the voltage difference between the two terminals is going to be nine volts if your battery is fresh so what we're basically doing there is that we're picking a pressure level to cause zero volts and then measure everything relative to that pressure level but that means that zero volts doesn't necessarily mean no pressure at all and that's where negative voltages come into play because by our definition any pressure level below the one we pick to be zero volts must be below zero volts and therefore negative so having a positive a ground and a negative rail is really just having three distinct pressure levels to work with okay but why is that necessary for our buffer well it's mostly to prevent distortion open buffers to just fine when they have to copy voltage levels that are comfortably in between their positive and negative supply rails but if those voltage levels get close to those rails the buffer can't accurately reproduce them anymore so what we could just hook it up to our positive and ground rails we should instead use positive and negative rails just to provide it with enough Headroom and prevent distortion outright if you have a dual power supply like this one that's not a problem but what if you want to use batteries instead thankfully that's totally doable you just need to connect two 9-volt batteries like this if you do that the negative terminal of this one becomes your minus 9 volts while the positive terminal of this one is now your plus 9 volts and the other two combine to become your new ground easy so let's add our negative power rail to the breadboard and set up the op amp buffer okay so now that our buffer is done we need to connect it to our oscillator core right where we've plugged in our oscilloscope so can we listen to it finally we could but we might get a very distorted signal and or wreck our speaker's doing it and that's why there's a few more precautions to take the first one of which being to install a coupling capacitor to understand what it's necessary we'll have to talk a bit about offset voltages remember how we said that electrical oscillations are just swings between two voltage levels the thing about that is that those voltage levels could be up here or even down here and the negatives it doesn't matter you'd still have the same oscillation and waveform but it's Center is shifted either upwards or downwards normally with audio signals that Center would be around zero volts so right here in the middle but these two oscillations have what we call an offset voltage plus five for this one minus five for this one and if we look at the graph for our oscillator again this is also off center that is not ideal for audio signals because it might cause an amplifier to distort the sound so what we need to do is remove any offset voltage from our oscillation thankfully doing that is really easy we just need two components a capacitor and a resistor set up like this here's how it works first imagine two pipes being connected with a balloon kind of between them like this now no water can get from one pipe into the other since it's blocked by the balloon but and that's the kicker water from here can still push in this direction by bending and stretching the balloon causing a flow in the other pipe by displacement and vice-versa next we'll have to bring in our resistor after the coupling point going straight to ground this acts like a kind of equalizing valve and that's how we knock out the offset voltage because now imagine we apply a steady 5 volts from this side then on this side we'll read 0 volt after a short amount of time why well we are pushing water into the balloon with a constant force from here the balloon is stretching into this pipe pushing water in this direction if we didn't have the equalizing valve here that'd be no way to go for that water but since we do have it the excess water can drain out through this narrow pipe out of the system until the pressure is neutralized and no water is actively flowing anymore ok so now imagine that the pressure on this side starts oscillating let's say between 4 & 6 volts when we start to go below 5 volts on this side the balloon will begin contracting basically sucking the water in this pipe to the left this will create a negative pressure level here like is if you're sucking on a straw making the voltage drop below 0 volts then once we've completed the bottom half of a waveform we go above 5 volts on this side and our balloon will inflate and stretch out again pushing the water here to the right and the pressure will go positive making the voltage rise above 0 volts so we've resented our oscillation around the zero volts line but what about the resistor if water can escape through here doesn't that mess with our oscillation well technically yes but practically we're choosing a narrow enough pipe here to make the effect on quick pressure changes negligible don't take my word for it though let's try it out I'll add in a 1 micro farad capacitor and a 100k ohm resistor after our buffer and now let's hook our oscilloscope up to this point ideally our sawtooth will look as pointy and sharp as ever looks good enough for me so can we listen in now well we're almost there but as a final touch we should decrease the volume of our oscillation because a very loud signal like this can again damage your amp or your speakers to do that we will use a voltage divider which is just two resistors set up like this here's the input and over here is the output if r1 and r2 are the same size the output voltage will be half of what the input voltage is how does it work let's use our analogy again so we have a pipe on this side where water is being pushed in this direction with a specific amount of force attached here is a narrow pipe which represents r1 followed by another wide pipe then down here there's this other narrow pipe representing r2 where water can exit the pipe system finally imagine we have a pressure sensor attached right here ok so first think about what would happen if our 2 was completely closed off our sensor here would tell us that the pressure in this pipe is exactly the same as the pressure in this pipe over here because the pushing force from here has no else to go it has to accumulate over here on the other hand imagine r2 would just be a wide opening then the pressure here would be 0 because it would all escape through here but what happens if r2 is neither completely closed off nor wide open well then the pressure here would accumulate to varying degrees depending on the narrowness of the two resistor paths so if pipe r1 is white and pipe r2 is narrow most of the pressure will be retained here but if it's the reverse the pressure level will be only a tiny fraction and if r1 and r2 are identical the pressure here will be exactly half of what we sent in here so since an oscillation is really just a swing between voltage levels we should be able to scale or divide it down by using this method to see if that works let's first check the size of our original oscillation on the oscilloscope so you can see that the oscillation is between the bottom of this Square and the top of this square so we could say that it has a height of three squares and now I'll set up our voltage divider with two 100k on resistors and I'm expecting to see the size of that oscillation to be cut down by 1/2 yeah that looks about right now the oscillation is about one and a half squares high so now we're finally good to connect this to an amp [Music] and that you have it even though the frequency is really a bit too high but dealing with that is going to have to wait till the next episode then we will figure out how to change the frequency both manually and using a voltage
Info
Channel: Moritz Klein
Views: 404,842
Rating: undefined out of 5
Keywords: DIY, VCO, Synth, Analog, Oscillator
Id: QBatvo8bCa4
Channel Id: undefined
Length: 27min 9sec (1629 seconds)
Published: Sat Jun 20 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.