(1710,2,'2012-11-04 19:38:07','2012-11-05 00:38:07','Throughout this guide I will attempt to give you some insight into the circuit theory and scientific principles at play in the NovaDrone. That said I will be giving little more than an intro to each topic and strongly encourage you to do further reading on topics you find interesting.\r\n<ul>\r\n	<li>This is a beta version of the <strong>NovaDrone Technical Guide</strong>. I expect to make revisions over time and eagerly encourage readers to send me feedback, questions, suggestions and especially corrections. Comments should be addressed to <a href=\"mailto:pete@casperelectronics.com\"><strong>pete@casperelectronics.com</strong></a>.</li>\r\n</ul>\r\n<h3 style=\"text-align: center;\"><span style=\"color: #000000;\"><strong>TABLE OF CONTENTS:</strong></span></h3>\r\n<a href=\"#sec1\"><strong><span style=\"text-decoration: underline;\">Section 1. Oscillator Primer</span></strong></a>\r\n<ul>\r\n	<li><a href=\"#1.1\"><strong>1.1 Frequency, amplitude &amp; wave shape</strong></a>\r\n<ul>\r\n	<li><a href=\"#frequency\">Frequency</a></li>\r\n	<li><a href=\"#amplitude\">Amplitude</a></li>\r\n	<li><a href=\"#waveshape\"> Wave shape</a></li>\r\n	<li><a href=\"#review\"> Review<strong></strong></a></li>\r\n</ul>\r\n</li>\r\n	<li><a href=\"#1.2\"><strong>1.2 Phase</strong></a>\r\n<ul>\r\n	<li><a href=\"#phase\"> Phase controlled amplitude modulation</a></li>\r\n</ul>\r\n</li>\r\n</ul>\r\n<a href=\"#sec2\"><strong><span style=\"text-decoration: underline;\">Section 2. NovaDrone Oscillators</span></strong></a>\r\n<ul>\r\n	<li><a href=\"#2.1\"><strong>2.1 The Circuit</strong></a>\r\n<ul>\r\n	<li><a href=\"#feedbackloops\"> Feedback loops</a></li>\r\n	<li><a href=\"#schematic\"> Schematic</a></li>\r\n	<li><a href=\"#rctimeconstant\"> RC time constant</a></li>\r\n	<li><a href=\"#howitworks\"> How it works<strong></strong></a></li>\r\n</ul>\r\n</li>\r\n	<li><a href=\"#2.2\"><strong>2.2 Pulse Width Modulation</strong></a>\r\n<ul>\r\n	<li><a href=\"#comparator\">The comparator<strong></strong></a></li>\r\n</ul>\r\n</li>\r\n</ul>\r\n<a name=\"sec1\"></a><a name=\"1.1\"></a><a href=\"#sec3\"><strong><span style=\"text-decoration: underline;\">Sectio</span></strong></a><a href=\"#sec3\"><strong><span style=\"text-decoration: underline;\">n 3. Drivers and Mixers </span>*incomplete*</strong></a>\r\n<ul>\r\n	<li><a href=\"#led\"> LED driver</a></li>\r\n	<li><a href=\"#mixer\">Signal mixer</a><strong></strong></li>\r\n</ul>\r\n<strong>SECTION 1. OSCILLATOR PRIMER <strong></strong></strong>\r\n<blockquote>\r\n<ul>\r\n	<li><span style=\"text-decoration: underline;\"><strong><strong>1.1 Frequency, amplitude and wave shape</strong></strong></span></li>\r\n</ul>\r\n</blockquote>\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/ampandfreq.jpg\"><img class=\"alignleft size-medium wp-image-1636\" title=\"Ampandfreq\" src=\"http://casperelectronics.com/wp-content/uploads/ampandfreq-200x242.jpg\" alt=\"\" width=\"200\" height=\"242\" /></a>The NovaDrone is basically a bunch of oscillators so it’s important to understand what an <strong>oscillator</strong> is. An oscillator is simply a pattern which repeats indefinitely. All of the electrically produced sound we hear is a repeating pattern of fluctuating voltage. When this is applied to a speaker, the voltage charges a coil in the speaker which pushes the cone of the speaker back and forth. This action pushes air which travels to our ears and is perceived as sound as our ear drums are excited into vibration. The sounds we hear around us are all incredibly complex patterns of air pressure modulation. Most electronic oscillators (including those used in the NovaDrone) are precise and easily controllable. <a href=\"http://casperelectronics.com/wp-content/uploads/casper/spacer1.jpg\"><img class=\"alignnone  wp-image-1302\" title=\"spacer\" src=\"http://casperelectronics.com/wp-content/uploads/casper/spacer1.jpg\" alt=\"\" width=\"460\" height=\"10\" /></a><span style=\"color: #33cccc;\">Figure 1. triangle oscillator</span>\r\n\r\nThere are three basic factors that make up all oscillators: <a name=\"frequency\"></a><strong>frequency</strong>, <strong>amplitude</strong> and <strong>wave shape</strong>. In musical terms we would call these <strong>pitch</strong>, <strong>volume</strong> and <strong>timbre</strong>. I will also talk a fair amount about <strong>phase </strong>which is relevant when working with multiple oscillators and plays an important role in creating drones. The red line in fig 1 represents a voltage which goes up and down over a period of time. This is an oscillator.\r\n<blockquote>\r\n<ul>\r\n	<li><span style=\"text-decoration: underline;\"><strong>Frequency</strong></span></li>\r\n</ul>\r\n</blockquote>\r\nOne complete sweep up and down is called a <strong>cycle</strong>. The number of cycles per second is your <strong>Frequency</strong> or <strong>Pitch</strong>.<strong></strong>\r\n<strong>Frequency</strong> is commonly measured in <strong>Hertz</strong>, which is the number of cycles per second.\r\n<a name=\"amplitude\"></a><strong>Pitch</strong> is another term for frequency which is used <span style=\"text-decoration: underline;\">only</span> when referring to the frequency of an audio signal.\r\nThe image to the left shows a triangle wave with a cycle length of .5 seconds. The frequency of this wave would be determined by seeing how many cycles will occur in 1 second. In this case there are 2 complete cycles in 1 second. That means the wave has a frequency of 2 Hertz. This is well below the hearing range. Humans can hear oscillators between 20Hz and 20,000 Hz.\r\n<blockquote>\r\n<ul>\r\n	<li><span style=\"text-decoration: underline;\"><strong>Amplitude</strong></span></li>\r\n</ul>\r\n</blockquote>\r\nAmplitude refers to the magnitude of voltage change across one cycle of an oscillation.\r\n<a name=\"waveshape\"></a>This in turn impacts the volume of the signal if it is sent to a speaker.\r\nThe image above shows a triangle wave with a positive peak of +5 volts and a negative peak of -5 volts. The amplitude is determined by figuring the absolute difference between these peaks. In this case that difference is 10 volts. This is commonly referred to as 10 Vpk-pk (10 volts peak to peak). There are many different ways to measure amplitude (pk-pk, RMS, Vp, etc…) but we’ll just be talking about Vpk-pk.<a href=\"http://casperelectronics.com/wp-content/uploads/waveshapes.png\"><img class=\"alignright\" title=\"Waveshapes\" src=\"http://casperelectronics.com/wp-content/uploads/waveshapes-200x160.png\" alt=\"\" width=\"292\" height=\"233\" /></a>\r\n<ul>\r\n	<li><span style=\"text-decoration: underline;\"><strong>Wave shape</strong></span></li>\r\n</ul>\r\nThe wave shape is the pattern of amplitude modulation over the course of a cycle.\r\nThe waveforms in fig 2 are: Sine, ramp, triangle and square.\r\nSine, triangle and square are the most common and are all symmetrical waves. That means the positive and negative portions of each cycle are of the same duration. Many musical synthesizers offer other wave forms which are asymmetrical versions of these common waves such as ramp, saw, and pulse waves.\r\nThe importance and impact of wave shape depends on its application. Many audio effects such as <strong>tremolo</strong> or <strong>phaser</strong> use low frequency oscillators (LFOs) to modulate certain parameters of the sound. It is commonly more desirable to use a sine or triangle wave for many of these effects such as the tremolo which <span style=\"color: #33cccc;\">Figure 2. Waveshapes</span>\r\n<a name=\"review\"></a>fades the volume in and out. Using a square wave for this would create dramatic shifts in volume which can be unpleasant.\r\nMany natural sounds are synthesized using overlapping wave forms like those shown above. For instance a flute can be synthesized using several octaves of a sine wave. A horn on the other hand will use more square waves and maybe a triangle or saw wave. More advanced wave and synthesis theory sites the sine wave as the basis of all wave forms. It is shown how even square waves can be created by combining several sine waves.\r\n<p style=\"padding-left: 30px;\"><span style=\"text-decoration: underline;\"><strong>Review</strong></span></p>\r\nThe basic components of an oscillator are:\r\n<h3><a name=\"1.2\"></a></h3>\r\n<strong>Frequency</strong>. The number of oscillation cycles that occur in one second. Measured in Hz\r\n<strong>Amplitude</strong>. Magnitude of voltage sweep in one cycle of an oscillator. Measured in Volts or Vpk-pk (volts peak to peak)\r\n<strong>Wave shape</strong>. Sine, triangle, square\r\n<p style=\"padding-left: 30px;\"><strong><span style=\"text-decoration: underline;\">1.2 Phase</span></strong></p>\r\n\r\n<h3></h3>\r\n&nbsp;\r\n\r\nPhase is a bit more complicated than the other terms but plays an important role in audio circuitry and especially in making drones. Phase refers to a particular position in a <span style=\"text-decoration: underline;\">single cycle</span> of a wave (such as the positive or negative peak) and is measured in degrees. It is most commonly used to describe the relationship between multiple waves.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/phasedegrees.jpg\"><img class=\"alignnone size-large wp-image-1643\" title=\"Phasedegrees\" src=\"http://casperelectronics.com/wp-content/uploads/phasedegrees-460x236.jpg\" alt=\"\" width=\"460\" height=\"236\" /></a><span style=\"color: #33cccc;\">Figure 3. Phase</span>\r\nFig. 3 shows two sine waves (red &amp; blue) of identical amplitude and frequency. The green oscillator is the mix or <em>average</em> of the red and blue oscillators.\r\nPhase is measured in degrees with 360 degrees being one complete cycle. 180 degrees is exactly ½ of a cycle.\r\nIn fig. 3 the phase of the blue oscillator is offset at 45 degree increments from the red oscillator from left to right. With each step you’ll notice that the waves get farther apart and that the amplitude of the green (average) oscillator decreases.\r\nThis may seem confusing at first but it’s really quite simple. The green oscillator is the average of the red and blue oscillators. Let’s say the red and blue oscillators sweep from -5 to +5VDC (10Vp-p). Now look at the right most illustration of the 2 waves out of phase by 180 degrees. When the blue wave is at its positive peak (90 degrees) of +5 volts, the red wave is at it’s negative peak (270 degrees) of -5 volts.\r\nWhat is the average of -5 and +5? Zero. They are always going to be the opposites of each other so the average will always be zero. Now look at the 90 degree image. When Blue is at +5 volts/90 degrees, red is at 0 volts/zero degrees. The average of +5 and zero is 2.5 volts.\r\nThe important thing to take away from the info above is that the amplitude of an oscillator created by mixing two similar oscillators is relative to the difference in phase of the two source waves.\r\nIn fig. 3 the oscillators have identical frequencies. This means that the phase relationship once established will remain the same and the resulting averaged amplitude of the two waves will also remain the same.\r\n<strong>Q: What will happen if the frequencies of your two waves are NOT identical? </strong>\r\nWe established above that the amplitude of the averaged waveform is relative to the phase difference of the two wave forms, therefore as the phase difference of two waves increases and decreases so too will the averaged waveforms’ amplitude. What we have here is phase controlled amplitude modulation and the rate of phase modulation is controlled by the frequency difference between your two oscillators.\r\nIn fig. 4 the blue oscillator has a frequency of 10 Hz, the red is 11Hz. That means that it takes the red wave 1/10<sup>th</sup> of a second longer to complete a cycle than the blue wave. You can see that with each cycle the red wave lags a little bit further behind the blue wave which increases the phase difference between the two. As a result, the amplitude of the averaged wave (green) decreases as the phase offset approaches 180 degrees and then increases as it continues past 180 to 360 degrees.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/phaseModulation.jpg\"><img class=\"alignnone size-large wp-image-1644\" title=\"PhaseModulation\" src=\"http://casperelectronics.com/wp-content/uploads/phaseModulation-460x202.jpg\" alt=\"\" width=\"460\" height=\"202\" /></a><a href=\"http://casperelectronics.com/wp-content/uploads/phase_modulation2.jpg\"><img class=\"alignnone size-large wp-image-1645\" title=\"Phase Modulation2\" src=\"http://casperelectronics.com/wp-content/uploads/phase_modulation2-460x220.jpg\" alt=\"\" width=\"460\" height=\"220\" /></a><a name=\"sec2\"></a><span style=\"color: #33cccc;\">Figure 4. Phase controlled amplitude</span>\r\n<h3><a name=\"2.1\"></a></h3>\r\nThis phenomenon of phase controlled amplitude is something many musicians use without even realizing it. This is the vary trick one uses when tuning a guitar. You tune one string to the other until the “beatingâ€ effect slows and eventually disappears.\r\n<h3><strong>SECTION 2. NOVADRONE OSCILLATORS</strong></h3>\r\n<h3 style=\"padding-left: 30px;\"><strong><span style=\"text-decoration: underline;\">2.1 The circuit</span> </strong></h3>\r\n&nbsp;\r\n\r\nThe NovaDrone contains 6 oscillators. Each oscillator outputs a square wave and a triangle wave.\r\n<span style=\"text-decoration: underline;\"><a name=\"schematic\"></a></span>The circuit which generates the oscillators is clean, simple and robust. They are generated using a remarkable device called an <strong>op amp</strong>. If you are interested in building synthesizers and don’t know where to start, read up on <strong>op amps</strong>. They are the key elements of most oscillators, filters, envelope generators, mixers and amps.\r\n<p style=\"padding-left: 30px;\"><span style=\"text-decoration: underline;\"><strong>Schematic</strong></span></p>\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/OSC2rc.jpg\"><img class=\"alignleft\" title=\"OSC2rc\" src=\"http://casperelectronics.com/wp-content/uploads/OSC2rc-200x163.jpg\" alt=\"\" width=\"200\" height=\"163\" /></a>­­Each channel of the NovaDrone (Red, green and blue) has 2 oscillators. These are shown in fig. 5 and <a name=\"feedbackloops\"></a>fig. 6. They are very similar to one another but have been calibrated for different purposes.\r\n<strong>Osc 1</strong> is an audio frequency oscillator. It has a coarse and fine tune adjustment and only operates at audible frequencies (20Hz-20kHz).\r\n<strong>Osc 2</strong> is calibrated as a low frequency oscillator (LFO) with cycles as long as 2 minutes. It has a range switch and a single adjustment knob.\r\n<p style=\"padding-left: 30px;\"><span style=\"text-decoration: underline;\"><strong>Feedback loops</strong></span></p>\r\nThe oscillator circuit is a feedback loop between two op amps that are <a href=\"http://casperelectronics.com/wp-content/uploads/OSC1rc.jpg\"><img class=\"alignleft\" title=\"OSC1rc\" src=\"http://casperelectronics.com/wp-content/uploads/OSC1rc-200x170.jpg\" alt=\"\" width=\"200\" height=\"170\" /></a>configured as a <strong>schmitt trigger</strong> and an <strong>inverting integrator</strong>.\r\nBasically an <em>integrator</em> turns square waves into triangle waves.\r\nA <em>Schmitt trigger</em> is a kind of comparator that turns modulating signals (like triangle waves) into square waves.\r\nThe key elements of the relationship between these two circuits is that they form a loop (Schmitt &gt; integrator &gt;Schmitt&gt;integrator&gt; etc…) and that the integrator is also an <strong>inverter</strong>. This creates a continuous cycle of modulation:\r\n1) Schmitt output goes HI.\r\n2) Integrator inverts Schmitt signal and outputs slope going down (LOW).\r\n3) When slope is near zero volts, Schmitt trigger is thrown and its’ output goes LOW.\r\n4) Integrator inverts and generates upward slope (HI).\r\n5) When integrator slope reaches peak, Schmitt trigger is thrown and output goes HI.\r\n<a name=\"rctimeconstant\"></a>6) etc……\r\nThis is an overly simplified explanation but enough for our purposes. Do more research on these valuable circuits once you are familiar with some of the basics of op-amps.\r\n<strong><span style=\"text-decoration: underline;\">RC (resistor capacitor)time constant</span></strong>\r\nIn both oscillators (fig. 5 and 6) the primary element which defines frequency is the <strong>RC time constant</strong>. This relationship is a core component of most oscillators and is worth reading up on.\r\n\r\nThe RC time constant is a period of time defined by the relationship between a resistor and a capacitor.\r\nThe equation for this is simply <strong>t =</strong> <strong>R*C</strong>. In the case of the oscillators above it would be <strong>t=R1*C1</strong>.\r\nUnfortunately calculating the frequency of an oscillator is more complicated than just calculating your RC constant.\r\nIn many oscillators (including this one) there is a schmitt trigger component which watches the rising or sinking voltage from the integrator. The Schmitt trigger activates when the slope reaches predefined upper and lower limits. In order to determine the frequency of an oscillator we need to know what our upper and lower limits are and then calculate how long it takes our wave (the output of the integrator) to travel from one limit to the other.\r\nThese limits are determined by the relationship of 2 resistors in the schmitt stage. In fig 5 and 6 these are R2 and R3.\r\nThe equation for determining the duration of one cycle is\r\n(1/4R1C1)*(R3/R4)\r\nIn Oscillator 2 <strong>R</strong><strong>1</strong> is a 500k potentiometer in series with a 4.7k resistor between pins 8 and 13 of the two op amps. <strong>C</strong><strong>1</strong> is one of the three capacitors between pins 13 and 14 of the rightmost op amp. One of these caps is selected using a three way switch on the NovaDrone circuit board. This controls the frequency range of the LFO.\r\nLet’s say the pot is all the way up (full resistance) and the middle cap has been selected. The equations for RC and subsequently the frequency is:\r\n<strong>R1=504,700 Ohms</strong>\r\n<a name=\"howitworks\"></a><strong>C1= .000022 Farads</strong>\r\n<strong>R2 = 8,300 Ohms</strong>\r\n<strong>R3 = 10,000 Ohms</strong>\r\n<strong>Frequency in Hz = (1 / 4*R</strong><strong>1C</strong><strong>1) * (R</strong><strong>3/R</strong><strong>2)</strong>\r\n<p style=\"padding-left: 30px;\"><span style=\"text-decoration: underline;\"><strong>How it works</strong></span></p>\r\nResistors limit the flow of current and capacitors store current. Current flows through the resistor and is stored in the capacitor. The resistor controls how much current flows into the capacitor per second. Therefore the size of capacitor and the amount of resistance will determine how long it takes to fill the capacitor. A common analogy is to think about current flow as water, the resistor as a spigot\r\n<h3><a name=\"2.2\"></a></h3>\r\nand the capacitor as a cup. The more you open the spigot (reduce resistance), the more water (electrical current) will flow and the faster the cup will fill (capacitor will charge). The oscillator circuit is configured in a special way which causes the capacitor to continuously charge and discharge. It is looking for two states from the cap, fully charged or fully discharged. When the cap reaches either of these states, the whole circuit reverses polarity and the capacitors charge status begins moving toward the opposite state. The amount of time it takes to charge and discharge is your cycle duration.\r\n<p style=\"padding-left: 30px;\"><span style=\"text-decoration: underline;\"><strong>2.2 pulse width modulation (pwm)</strong></span></p>\r\nPWM is exciting stuff….really! It is essentially a <strong>1 bit digital</strong> representation of an <strong>analog</strong> wave form.\r\nDigital wave forms only have 2 states, <strong>high</strong> and <strong>low</strong>. <strong>High</strong> is a voltage <em>at</em> or very close to the positive supply voltage. <strong>Low</strong> is a voltage <em>at</em> or very close to the negative supply voltage. It is basically just a square wave. Analog on the other hand is infinitely variable. Think about it like the difference between a light switch (digital) and a light dimmer (analog). PWM is a wave form that bridges the gap between these two formats. It can be used to make sound, control the brightness of an LED, control the speed of high torque motors and speak to microprocessors. It is also the language that a microprocessor will use to speak with the analog world.\r\nPulse Width (PW) refers to the relative durations of high and low voltage in a single <strong>cycle</strong> of a square wave.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/pulsewidth.jpg\"><img class=\"alignnone size-large wp-image-1648\" title=\"Pulsewidth\" src=\"http://casperelectronics.com/wp-content/uploads/pulsewidth-460x214.jpg\" alt=\"\" width=\"460\" height=\"214\" /></a><span style=\"color: #33cccc;\">Figure 7. Pulse width</span>\r\nFig. 7 shows three square wave oscillators of the same amplitude and frequency but with differing <strong>pulse width</strong>. The red oscillator has a 10% pulse width. That means the wave goes high for 10 % of the duration of one cycle. The green wave is 50% and the purple wave is 90%. What is important to note is that pulse width has nothing to do with frequency and only refers to the relationship between the high and low swing of the wave.\r\n<p style=\"padding-left: 30px;\"><strong><span style=\"text-decoration: underline;\">The Comparator</span></strong></p>\r\nThe job of a comparator is simple. Two signals are fed into the “+â€ and “-“ inputs (labeled 10 and 9 in fig. 8 respectively). If the voltage at the “+â€ input is <em>higher</em> than the “-“ input the output of the comparator goes <strong>high</strong>.<strong> </strong>If the “+â€ input drops below the “-“ input the output goes <strong>low</strong>.\r\nIn the NovaDrone t<a href=\"http://casperelectronics.com/wp-content/uploads/comparator.jpg\"><img class=\"alignleft\" title=\"Comparator\" src=\"http://casperelectronics.com/wp-content/uploads/comparator-200x76.jpg\" alt=\"\" width=\"200\" height=\"76\" /></a>he triangle output of Osc 1 and Osc 2 combine through a simple comparator (fig. 8) to make a single square wave with a modulating pulse width. In this way, the comparator also functions as a pulse width modulation processor.\r\n\r\nFig. 9 below shows how two triangle waves are transformed through the comparator into a square wave with a modulating pulse width.\r\nThe blue triangle wave in fig. 9 is oscillator 1. The red triangle is osc 2. The green line is the combined PWM output.\r\nAny time the blue line (osc 1) is above the red line (osc 2), the green line (pwm) goes high. As the red line rises the percentage of each cycle that the blue line is above the red line decreases. This changing percentage is what makes our modulating pulse width effect.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/PWM3-copy.jpg\"><img class=\"alignnone size-large wp-image-1647\" title=\"PWM3 Copy\" src=\"http://casperelectronics.com/wp-content/uploads/PWM3-copy-460x202.jpg\" alt=\"\" width=\"460\" height=\"202\" /></a><span style=\"color: #33cccc;\">Figure 9. Pulse width modulation detail</span>\r\n<p style=\"padding-left: 30px;\"><strong><span style=\"text-decoration: underline;\">Mixer</span></strong></p>\r\nThe audio signals from each of the three channels of the NovaDrone are mixed using the circuit in fig. 10.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/mixer.jpg\"><img class=\"alignleft\" title=\"Mixer\" src=\"http://casperelectronics.com/wp-content/uploads/mixer-200x135.jpg\" alt=\"\" width=\"200\" height=\"135\" /></a>This mixer is nice and simple and uses just one <strong>op amp</strong> and a few other components. This circuit is configured as an inverting mixer with an amplitude controlled by the <strong>feedback resistor</strong> and <strong>input resistors</strong>. The amplitude is calculated as RF/RI. In this case RF = 10,000 and RI = 100,000. That means the output signal is 1/10<sup>th</sup> the amplitude of the input signal.\r\n<strong><span style=\"text-decoration: underline;\">\r\n</span></strong>\r\n<p style=\"padding-left: 30px;\"><strong><span style=\"text-decoration: underline;\">LED drivers</span></strong></p>\r\n(3) 2N3904 NPN transistors are used to make 3 LED drivers.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/LEDdriver.jpg\"><img class=\"alignleft\" title=\"LEDdriver\" src=\"http://casperelectronics.com/wp-content/uploads/LEDdriver-200x108.jpg\" alt=\"\" width=\"200\" height=\"108\" /></a>A driver is a simple but important circuit which isolates elements which use lots of current (like LEDs) from sensitive circuits (like the oscillators in the NovaDrone). Failure to use a driver can result in something called a <strong>loading effect</strong> which basically means that the device being driven will affect the behavior of the rest of the circuit in bad ways, like the pitch changing when the lights turn on. The LED in the NovaDrone uses a lot of current relative to the rest of the circuit (90mA vs around 30mA for the rest of the circuit) therefore a driver is necessary. The key component of a driver is the <strong>transistor</strong>. This is another topic worth reading a lot about.','NovaDrone Tech Manual',0,'','inherit','open','closed','','1704-revision-5','','','2012-11-04 19:38:07','2012-11-05 00:38:07','',1704,'http://casperelectronics.com/2012/11/04/1704-revision-5/',0,'revision','',0),(1711,2,'2012-11-04 22:27:11','2012-11-05 03:27:11','Throughout this guide I will attempt to give you some insight into the circuit theory and scientific principles at play in the NovaDrone. That said I will be giving little more than an intro to each topic and strongly encourage you to do further reading on topics you find interesting.\r\n<ul>\r\n	<li>This is a beta version of the <strong>NovaDrone Technical Guide</strong>. I expect to make revisions over time and eagerly encourage readers to send me feedback, questions, suggestions and especially corrections. Comments should be addressed to <a href=\"mailto:pete@casperelectronics.com\"><strong>pete@casperelectronics.com</strong></a>.</li>\r\n</ul>\r\n<h3 style=\"text-align: center;\"><span style=\"color: #000000;\"><strong>TABLE OF CONTENTS:</strong></span></h3>\r\n<a href=\"#sec1\"><strong><span style=\"text-decoration: underline;\">Section 1. Oscillator Primer</span></strong></a>\r\n<ul>\r\n	<li><a href=\"#1.1\"><strong>1.1 Frequency, amplitude &amp; wave shape</strong></a>\r\n<ul>\r\n	<li><a href=\"#frequency\">Frequency</a></li>\r\n	<li><a href=\"#amplitude\">Amplitude</a></li>\r\n	<li><a href=\"#waveshape\"> Wave shape</a></li>\r\n	<li><a href=\"#review\"> Review<strong></strong></a></li>\r\n</ul>\r\n</li>\r\n	<li><a href=\"#1.2\"><strong>1.2 Phase</strong></a>\r\n<ul>\r\n	<li><a href=\"#phase\"> Phase controlled amplitude modulation</a></li>\r\n</ul>\r\n</li>\r\n</ul>\r\n<a href=\"#sec2\"><strong><span style=\"text-decoration: underline;\">Section 2. NovaDrone Oscillators</span></strong></a>\r\n<ul>\r\n	<li><a href=\"#2.1\"><strong>2.1 The Circuit</strong></a>\r\n<ul>\r\n	<li><a href=\"#feedbackloops\"> Feedback loops</a></li>\r\n	<li><a href=\"#schematic\"> Schematic</a></li>\r\n	<li><a href=\"#rctimeconstant\"> RC time constant</a></li>\r\n	<li><a href=\"#howitworks\"> How it works<strong></strong></a></li>\r\n</ul>\r\n</li>\r\n	<li><a href=\"#2.2\"><strong>2.2 Pulse Width Modulation</strong></a>\r\n<ul>\r\n	<li><a href=\"#comparator\">The comparator<strong></strong></a></li>\r\n</ul>\r\n</li>\r\n</ul>\r\n<a name=\"sec1\"></a><a name=\"1.1\"></a><a href=\"#sec3\"><strong><span style=\"text-decoration: underline;\">Sectio</span></strong></a><a href=\"#sec3\"><strong><span style=\"text-decoration: underline;\">n 3. Drivers and Mixers </span>*incomplete*</strong></a>\r\n<ul>\r\n	<li><a href=\"#led\"> LED driver</a></li>\r\n	<li><a href=\"#mixer\">Signal mixer</a><strong></strong></li>\r\n</ul>\r\n<strong>SECTION 1. OSCILLATOR PRIMER <strong></strong></strong>\r\n<blockquote>\r\n<ul>\r\n	<li><span style=\"text-decoration: underline;\"><strong><strong>1.1 Frequency, amplitude and wave shape</strong></strong></span></li>\r\n</ul>\r\n</blockquote>\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/ampandfreq.jpg\"><img class=\"alignleft size-medium wp-image-1636\" title=\"Ampandfreq\" src=\"http://casperelectronics.com/wp-content/uploads/ampandfreq-200x242.jpg\" alt=\"\" width=\"200\" height=\"242\" /></a>The NovaDrone is basically a bunch of oscillators so it’s important to understand what an <strong>oscillator</strong> is if you wish to fully explore the functionality of the NovaDrone.\r\n\r\nAn oscillator is simply a pattern which repeats indefinitely. All of the electrically produced sound we hear is a repeating pattern of fluctuating voltage. When this is applied to a speaker, the voltage charges a coil in the speaker which pushes the cone of the speaker back and forth. This action moves air which travels to our ears and is perceived as sound as our ear drums are excited into vibration. The sounds we hear around us are all incredibly complex patterns of air pressure modulation. Most electronic oscillators (including those used in the NovaDrone) are precise and easily controllable. <a href=\"http://casperelectronics.com/wp-content/uploads/casper/spacer1.jpg\"><img class=\"alignnone  wp-image-1302\" title=\"spacer\" src=\"http://casperelectronics.com/wp-content/uploads/casper/spacer1.jpg\" alt=\"\" width=\"460\" height=\"10\" /></a><span style=\"color: #33cccc;\">Figure 1. triangle oscillator</span>\r\n\r\nThere are three basic factors that make up all oscillators: <a name=\"frequency\"></a><strong>frequency</strong>, <strong>amplitude</strong> and <strong>wave shape</strong>. In musical terms we would call these <strong>pitch</strong>, <strong>volume</strong> and <strong>timbre</strong>. I will also talk a fair amount about <strong>phase </strong>which is relevant when working with multiple oscillators and plays an important role in creating drones. The red line in fig 1 represents a voltage which goes up and down over a period of time. This is an oscillator.\r\n<blockquote>\r\n<ul>\r\n	<li><span style=\"text-decoration: underline;\"><strong>Frequency</strong></span></li>\r\n</ul>\r\n</blockquote>\r\nOne complete sweep up and down is called a <strong>cycle</strong>. The number of cycles per second is your <strong>Frequency</strong> or <strong>Pitch</strong>.<strong></strong>\r\n<strong>Frequency</strong> is commonly measured in <strong>Hertz</strong>, which is the number of cycles per second.\r\n<a name=\"amplitude\"></a><strong>Pitch</strong> is another term for frequency which is used <span style=\"text-decoration: underline;\">only</span> when referring to the frequency of an audio signal.\r\nFigure 1 shows a triangle wave with a cycle length of .5 seconds. The frequency of this wave would be determined by seeing how many cycles will occur in 1 second. In this case there are 2 complete cycles in 1 second. That means the wave has a frequency of 2 Hertz. This is well below the hearing range. Humans can hear oscillators between 20Hz and 20,000 Hz.\r\n<blockquote>\r\n<ul>\r\n	<li><span style=\"text-decoration: underline;\"><strong>Amplitude</strong></span></li>\r\n</ul>\r\n</blockquote>\r\nAmplitude refers to the magnitude of voltage change across one cycle of an oscillation.\r\n<a name=\"waveshape\"></a>This in turn impacts the volume of the signal if it is sent to a speaker.\r\nThe image above shows a triangle wave with a positive peak of +5 volts and a negative peak of -5 volts. The amplitude is determined by figuring the absolute difference between these peaks. In this case that difference is 10 volts. This is commonly referred to as 10 Vpk-pk (10 volts peak to peak). There are many different ways to measure amplitude (pk-pk, RMS, Vp, etc…) but we’ll just be talking about Vpk-pk.<a href=\"http://casperelectronics.com/wp-content/uploads/waveshapes.png\"><img class=\"alignright\" title=\"Waveshapes\" src=\"http://casperelectronics.com/wp-content/uploads/waveshapes-200x160.png\" alt=\"\" width=\"292\" height=\"233\" /></a>\r\n<ul>\r\n	<li><span style=\"text-decoration: underline;\"><strong>Wave shape</strong></span></li>\r\n</ul>\r\nThe wave shape is the pattern of amplitude modulation over the course of a cycle.\r\nThe waveforms in fig 2 are: Sine, ramp, triangle and square.\r\nSine, triangle and square are the most common and are all symmetrical waves. That means the positive and negative portions of each cycle are of the same duration. Many musical synthesizers offer other wave forms which are asymmetrical versions of these common waves such as ramp, saw, and pulse waves.\r\nThe importance and impact of wave shape depends on its application. Many audio effects such as <strong>tremolo</strong> or <strong>phaser</strong> use low frequency oscillators (LFOs) to modulate certain parameters of the sound. It is commonly more desirable to use a sine or triangle wave for many of these effects such as the tremolo which <span style=\"color: #33cccc;\">Figure 2. Waveshapes</span>\r\n<a name=\"review\"></a>fades the volume in and out. Using a square wave for this would create dramatic shifts in volume which can be unpleasant.\r\nMany natural sounds are synthesized using overlapping wave forms like those shown above. For instance a flute can be synthesized using several octaves of a sine wave. A horn on the other hand will use more square waves and maybe a triangle or saw wave. More advanced wave and synthesis theory sites the sine wave as the basis of all wave forms. It is shown how even square waves can be created by combining several sine waves.\r\n<p style=\"padding-left: 30px;\"><span style=\"text-decoration: underline;\"><strong>Review</strong></span></p>\r\nThe basic components of an oscillator are:\r\n<h3><a name=\"1.2\"></a></h3>\r\n<strong>Frequency</strong>. The number of oscillation cycles that occur in one second. Measured in Hz\r\n<strong>Amplitude</strong>. Magnitude of voltage sweep in one cycle of an oscillator. Measured in Volts or Vpk-pk (volts peak to peak)\r\n<strong>Wave shape</strong>. Sine, triangle, square\r\n<p style=\"padding-left: 30px;\"><strong><span style=\"text-decoration: underline;\">1.2 Phase</span></strong></p>\r\nPhase is a bit more complicated than the other terms but plays an important role in audio circuitry and especially in making drones. Phase refers to a particular position in a <span style=\"text-decoration: underline;\">single cycle</span> of a wave (such as the positive or negative peak) and is measured in degrees. It is most commonly used to describe the relationship between multiple waves.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/phasedegrees.jpg\"><img class=\"alignnone size-large wp-image-1643\" title=\"Phasedegrees\" src=\"http://casperelectronics.com/wp-content/uploads/phasedegrees-460x236.jpg\" alt=\"\" width=\"460\" height=\"236\" /></a><span style=\"color: #33cccc;\">Figure 3. Phase</span>\r\nFig. 3 shows two sine waves (red &amp; blue) of identical amplitude and frequency. The green oscillator is the mix or <em>average</em> of the red and blue oscillators.\r\nPhase is measured in degrees with 360 degrees being one complete cycle. 180 degrees is exactly ½ of a cycle.\r\nIn fig. 3 the phase of the blue oscillator is offset at 45 degree increments from the red oscillator from left to right. With each step you’ll notice that the waves get farther apart and that the amplitude of the green (average) oscillator decreases.\r\nThis may seem confusing at first but it’s really quite simple. The green oscillator is the average of the red and blue oscillators. Let’s say the red and blue oscillators sweep from -5 to +5VDC (10Vp-p). Now look at the right most illustration of the 2 waves out of phase by 180 degrees. When the blue wave is at its positive peak (90 degrees) of +5 volts, the red wave is at it’s negative peak (270 degrees) of -5 volts.\r\nWhat is the average of -5 and +5? Zero. They are always going to be the opposites of each other so the average will always be zero. Now look at the 90 degree image. When Blue is at +5 volts/90 degrees, red is at 0 volts/zero degrees. The average of +5 and zero is 2.5 volts.\r\nThe important thing to take away from the info above is that the amplitude of an oscillator created by mixing two similar oscillators is relative to the difference in phase of the two source waves.\r\nIn fig. 3 the oscillators have identical frequencies. This means that the phase relationship once established will remain the same and the resulting averaged amplitude of the two waves will also remain the same.\r\n<strong>Q: What will happen if the frequencies of your two waves are NOT identical? </strong>\r\nWe established above that the amplitude of the averaged waveform is relative to the phase difference of the two wave forms, therefore as the phase difference of two waves increases and decreases so too will the averaged waveforms’ amplitude. What we have here is phase controlled amplitude modulation and the rate of phase modulation is controlled by the frequency difference between your two oscillators.\r\nIn fig. 4 the blue oscillator has a frequency of 10 Hz, the red is 11Hz. That means that it takes the red wave 1/10<sup>th</sup> of a second longer to complete a cycle than the blue wave. You can see that with each cycle the red wave lags a little bit further behind the blue wave which increases the phase difference between the two. As a result, the amplitude of the averaged wave (green) decreases as the phase offset approaches 180 degrees and then increases as it continues past 180 to 360 degrees.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/phaseModulation.jpg\"><img class=\"alignnone size-large wp-image-1644\" title=\"PhaseModulation\" src=\"http://casperelectronics.com/wp-content/uploads/phaseModulation-460x202.jpg\" alt=\"\" width=\"460\" height=\"202\" /></a><a href=\"http://casperelectronics.com/wp-content/uploads/phase_modulation2.jpg\"><img class=\"alignnone size-large wp-image-1645\" title=\"Phase Modulation2\" src=\"http://casperelectronics.com/wp-content/uploads/phase_modulation2-460x220.jpg\" alt=\"\" width=\"460\" height=\"220\" /></a><a name=\"sec2\"></a><span style=\"color: #33cccc;\">Figure 4. Phase controlled amplitude</span>\r\n<h3><a name=\"2.1\"></a></h3>\r\nThis phenomenon of phase controlled amplitude is something many musicians use without even realizing it. This is the vary trick one uses when tuning a guitar. You tune one string to the other until the “beatingâ€ effect slows and eventually disappears.\r\n<h3><strong>SECTION 2. NOVADRONE OSCILLATORS</strong></h3>\r\n<h3 style=\"padding-left: 30px;\"><strong><span style=\"text-decoration: underline;\">2.1 The circuit</span> </strong></h3>\r\n&nbsp;\r\n\r\nThe NovaDrone contains 6 oscillators. Each oscillator outputs a square wave and a triangle wave.\r\n<span style=\"text-decoration: underline;\"><a name=\"schematic\"></a></span>The circuit which generates the oscillators is clean, simple and robust. They are generated using a remarkable device called an <strong>op amp</strong>. If you are interested in building synthesizers and don’t know where to start, read up on <strong>op amps</strong>. They are the key elements of most oscillators, filters, envelope generators, mixers and amps.\r\n<p style=\"padding-left: 30px;\"><span style=\"text-decoration: underline;\"><strong>Schematic</strong></span></p>\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/OSC2rc.jpg\"><img class=\"alignleft\" title=\"OSC2rc\" src=\"http://casperelectronics.com/wp-content/uploads/OSC2rc-200x163.jpg\" alt=\"\" width=\"200\" height=\"163\" /></a>­­Each channel of the NovaDrone (Red, green and blue) has 2 oscillators. These are shown in fig. 5 and <a name=\"feedbackloops\"></a>fig. 6. They are very similar to one another but have been calibrated for different purposes.\r\n<strong>Osc 1</strong> is an audio frequency oscillator. It has a coarse and fine tune adjustment and only operates at audible frequencies (20Hz-20kHz).\r\n<strong>Osc 2</strong> is calibrated as a low frequency oscillator (LFO) with cycles as long as 2 minutes. It has a range switch and a single adjustment knob.\r\n<p style=\"padding-left: 30px;\"><span style=\"text-decoration: underline;\"><strong>Feedback loops</strong></span></p>\r\nThe oscillator circuit is a feedback loop between two op amps that are <a href=\"http://casperelectronics.com/wp-content/uploads/OSC1rc.jpg\"><img class=\"alignleft\" title=\"OSC1rc\" src=\"http://casperelectronics.com/wp-content/uploads/OSC1rc-200x170.jpg\" alt=\"\" width=\"200\" height=\"170\" /></a>configured as a <strong>schmitt trigger</strong> and an <strong>inverting integrator</strong>.\r\nBasically an <em>integrator</em> turns square waves into triangle waves.\r\nA <em>Schmitt trigger</em> is a kind of comparator that turns modulating signals (like triangle waves) into square waves.\r\nThe key elements of the relationship between these two circuits is that they form a loop (Schmitt &gt; integrator &gt;Schmitt&gt;integrator&gt; etc…) and that the integrator is also an <strong>inverter</strong>. This creates a continuous cycle of modulation:\r\n1) Schmitt output goes HI.\r\n2) Integrator inverts Schmitt signal and outputs slope going down (LOW).\r\n3) When slope is near zero volts, Schmitt trigger is thrown and its’ output goes LOW.\r\n4) Integrator inverts and generates upward slope (HI).\r\n5) When integrator slope reaches peak, Schmitt trigger is thrown and output goes HI.\r\n<a name=\"rctimeconstant\"></a>6) etc……\r\nThis is an overly simplified explanation but enough for our purposes. Do more research on these valuable circuits once you are familiar with some of the basics of op-amps.\r\n<strong><span style=\"text-decoration: underline;\">RC (resistor capacitor)time constant</span></strong>\r\nIn both oscillators (fig. 5 and 6) the primary element which defines frequency is the <strong>RC time constant</strong>. This relationship is a core component of most oscillators and is worth reading up on.\r\n\r\nThe RC time constant is a period of time defined by the relationship between a resistor and a capacitor.\r\nThe equation for this is simply <strong>t =</strong> <strong>R*C</strong>. In the case of the oscillators above it would be <strong>t=R1*C1</strong>.\r\nUnfortunately calculating the frequency of an oscillator is more complicated than just calculating your RC constant.\r\nIn many oscillators (including this one) there is a schmitt trigger component which watches the rising or sinking voltage from the integrator. The Schmitt trigger activates when the slope reaches predefined upper and lower limits. In order to determine the frequency of an oscillator we need to know what our upper and lower limits are and then calculate how long it takes our wave (the output of the integrator) to travel from one limit to the other.\r\nThese limits are determined by the relationship of 2 resistors in the schmitt stage. In fig 5 and 6 these are R2 and R3.\r\nThe equation for determining the duration of one cycle is\r\n(1/4R1C1)*(R3/R4)\r\nIn Oscillator 2 <strong>R</strong><strong>1</strong> is a 500k potentiometer in series with a 4.7k resistor between pins 8 and 13 of the two op amps. <strong>C</strong><strong>1</strong> is one of the three capacitors between pins 13 and 14 of the rightmost op amp. One of these caps is selected using a three way switch on the NovaDrone circuit board. This controls the frequency range of the LFO.\r\nLet’s say the pot is all the way up (full resistance) and the middle cap has been selected. The equations for RC and subsequently the frequency is:\r\n<strong>R1=504,700 Ohms</strong>\r\n<a name=\"howitworks\"></a><strong>C1= .000022 Farads</strong>\r\n<strong>R2 = 8,300 Ohms</strong>\r\n<strong>R3 = 10,000 Ohms</strong>\r\n<strong>Frequency in Hz = (1 / 4*R</strong><strong>1C</strong><strong>1) * (R</strong><strong>3/R</strong><strong>2)</strong>\r\n<p style=\"padding-left: 30px;\"><span style=\"text-decoration: underline;\"><strong>How it works</strong></span></p>\r\nResistors limit the flow of current and capacitors store current. Current flows through the resistor and is stored in the capacitor. The resistor controls how much current flows into the capacitor per second. Therefore the size of capacitor and the amount of resistance will determine how long it takes to fill the capacitor. A common analogy is to think about current flow as water, the resistor as a spigot\r\n<h3><a name=\"2.2\"></a></h3>\r\nand the capacitor as a cup. The more you open the spigot (reduce resistance), the more water (electrical current) will flow and the faster the cup will fill (capacitor will charge). The oscillator circuit is configured in a special way which causes the capacitor to continuously charge and discharge. It is looking for two states from the cap, fully charged or fully discharged. When the cap reaches either of these states, the whole circuit reverses polarity and the capacitors charge status begins moving toward the opposite state. The amount of time it takes to charge and discharge is your cycle duration.\r\n<p style=\"padding-left: 30px;\"><span style=\"text-decoration: underline;\"><strong>2.2 pulse width modulation (pwm)</strong></span></p>\r\nPWM is exciting stuff….really! It is essentially a <strong>1 bit digital</strong> representation of an <strong>analog</strong> wave form.\r\nDigital wave forms only have 2 states, <strong>high</strong> and <strong>low</strong>. <strong>High</strong> is a voltage <em>at</em> or very close to the positive supply voltage. <strong>Low</strong> is a voltage <em>at</em> or very close to the negative supply voltage. It is basically just a square wave. Analog on the other hand is infinitely variable. Think about it like the difference between a light switch (digital) and a light dimmer (analog). PWM is a wave form that bridges the gap between these two formats. It can be used to make sound, control the brightness of an LED, control the speed of high torque motors and speak to microprocessors. It is also the language that a microprocessor will use to speak with the analog world.\r\nPulse Width (PW) refers to the relative durations of high and low voltage in a single <strong>cycle</strong> of a square wave.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/pulsewidth.jpg\"><img class=\"alignnone size-large wp-image-1648\" title=\"Pulsewidth\" src=\"http://casperelectronics.com/wp-content/uploads/pulsewidth-460x214.jpg\" alt=\"\" width=\"460\" height=\"214\" /></a><span style=\"color: #33cccc;\">Figure 7. Pulse width</span>\r\nFig. 7 shows three square wave oscillators of the same amplitude and frequency but with differing <strong>pulse width</strong>. The red oscillator has a 10% pulse width. That means the wave goes high for 10 % of the duration of one cycle. The green wave is 50% and the purple wave is 90%. What is important to note is that pulse width has nothing to do with frequency and only refers to the relationship between the high and low swing of the wave.\r\n<p style=\"padding-left: 30px;\"><strong><span style=\"text-decoration: underline;\">The Comparator</span></strong></p>\r\nThe job of a comparator is simple. Two signals are fed into the “+â€ and “-“ inputs (labeled 10 and 9 in fig. 8 respectively). If the voltage at the “+â€ input is <em>higher</em> than the “-“ input the output of the comparator goes <strong>high</strong>.<strong> </strong>If the “+â€ input drops below the “-“ input the output goes <strong>low</strong>.\r\nIn the NovaDrone t<a href=\"http://casperelectronics.com/wp-content/uploads/comparator.jpg\"><img class=\"alignleft\" title=\"Comparator\" src=\"http://casperelectronics.com/wp-content/uploads/comparator-200x76.jpg\" alt=\"\" width=\"200\" height=\"76\" /></a>he triangle output of Osc 1 and Osc 2 combine through a simple comparator (fig. 8) to make a single square wave with a modulating pulse width. In this way, the comparator also functions as a pulse width modulation processor.\r\n\r\nFig. 9 below shows how two triangle waves are transformed through the comparator into a square wave with a modulating pulse width.\r\nThe blue triangle wave in fig. 9 is oscillator 1. The red triangle is osc 2. The green line is the combined PWM output.\r\nAny time the blue line (osc 1) is above the red line (osc 2), the green line (pwm) goes high. As the red line rises the percentage of each cycle that the blue line is above the red line decreases. This changing percentage is what makes our modulating pulse width effect.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/PWM3-copy.jpg\"><img class=\"alignnone size-large wp-image-1647\" title=\"PWM3 Copy\" src=\"http://casperelectronics.com/wp-content/uploads/PWM3-copy-460x202.jpg\" alt=\"\" width=\"460\" height=\"202\" /></a><span style=\"color: #33cccc;\">Figure 9. Pulse width modulation detail</span>\r\n<p style=\"padding-left: 30px;\"><strong><span style=\"text-decoration: underline;\">Mixer</span></strong></p>\r\nThe audio signals from each of the three channels of the NovaDrone are mixed using the circuit in fig. 10.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/mixer.jpg\"><img class=\"alignleft\" title=\"Mixer\" src=\"http://casperelectronics.com/wp-content/uploads/mixer-200x135.jpg\" alt=\"\" width=\"200\" height=\"135\" /></a>This mixer is nice and simple and uses just one <strong>op amp</strong> and a few other components. This circuit is configured as an inverting mixer with an amplitude controlled by the <strong>feedback resistor</strong> and <strong>input resistors</strong>. The amplitude is calculated as RF/RI. In this case RF = 10,000 and RI = 100,000. That means the output signal is 1/10<sup>th</sup> the amplitude of the input signal.\r\n<strong><span style=\"text-decoration: underline;\">\r\n</span></strong>\r\n<p style=\"padding-left: 30px;\"><strong><span style=\"text-decoration: underline;\">LED drivers</span></strong></p>\r\n(3) 2N3904 NPN transistors are used to make 3 LED drivers.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/LEDdriver.jpg\"><img class=\"alignleft\" title=\"LEDdriver\" src=\"http://casperelectronics.com/wp-content/uploads/LEDdriver-200x108.jpg\" alt=\"\" width=\"200\" height=\"108\" /></a>A driver is a simple but important circuit which isolates elements which use lots of current (like LEDs) from sensitive circuits (like the oscillators in the NovaDrone). Failure to use a driver can result in something called a <strong>loading effect</strong> which basically means that the device being driven will affect the behavior of the rest of the circuit in bad ways, like the pitch changing when the lights turn on. The LED in the NovaDrone uses a lot of current relative to the rest of the circuit (90mA vs around 30mA for the rest of the circuit) therefore a driver is necessary. The key component of a driver is the <strong>transistor</strong>. This is another topic worth reading a lot about.','NovaDrone Tech Manual',0,'','inherit','open','closed','','1704-revision-6','','','2012-11-04 22:27:11','2012-11-05 03:27:11','',1704,'http://casperelectronics.com/2012/11/04/1704-revision-6/',0,'revision','',0),(1712,2,'2012-11-05 15:14:25','2012-11-05 20:14:25','Throughout this guide I will attempt to give you some insight into the circuit theory and scientific principles at play in the NovaDrone. That said I will be giving little more than an intro to each topic and strongly encourage you to do further reading on topics you find interesting.\r\n<ul>\r\n	<li>This is a beta version of the <strong>NovaDrone Technical Guide</strong>. I expect to make revisions over time and eagerly encourage readers to send me feedback, questions, suggestions and especially corrections. Comments should be addressed to <a href=\"mailto:pete@casperelectronics.com\"><strong>pete@casperelectronics.com</strong></a>.</li>\r\n</ul>\r\n<h3 style=\"text-align: center;\"><span style=\"color: #000000;\"><strong>TABLE OF CONTENTS:</strong></span></h3>\r\n<a href=\"#sec1\"><strong><span style=\"text-decoration: underline;\">Section 1. Oscillator Primer</span></strong></a>\r\n<ul>\r\n	<li><a href=\"#1.1\"><strong>1.1 Frequency, amplitude &amp; wave shape</strong></a>\r\n<ul>\r\n	<li><a href=\"#frequency\">Frequency</a></li>\r\n	<li><a href=\"#amplitude\">Amplitude</a></li>\r\n	<li><a href=\"#waveshape\"> Wave shape</a></li>\r\n	<li><a href=\"#review\"> Review<strong></strong></a></li>\r\n</ul>\r\n</li>\r\n	<li><a href=\"#1.2\"><strong>1.2 Phase</strong></a>\r\n<ul>\r\n	<li><a href=\"#phase\"> Phase controlled amplitude modulation</a></li>\r\n</ul>\r\n</li>\r\n</ul>\r\n<a href=\"#sec2\"><strong><span style=\"text-decoration: underline;\">Section 2. NovaDrone Oscillators</span></strong></a>\r\n<ul>\r\n	<li><a href=\"#2.1\"><strong>2.1 The Circuit</strong></a>\r\n<ul>\r\n	<li><a href=\"#feedbackloops\"> Feedback loops</a></li>\r\n	<li><a href=\"#schematic\"> Schematic</a></li>\r\n	<li><a href=\"#rctimeconstant\"> RC time constant</a></li>\r\n	<li><a href=\"#howitworks\"> How it works<strong></strong></a></li>\r\n</ul>\r\n</li>\r\n	<li><a href=\"#2.2\"><strong>2.2 Pulse Width Modulation</strong></a>\r\n<ul>\r\n	<li><a href=\"#comparator\">The comparator<strong></strong></a></li>\r\n</ul>\r\n</li>\r\n</ul>\r\n<a name=\"sec1\"></a><a name=\"1.1\"></a><a href=\"#sec3\"><strong><span style=\"text-decoration: underline;\">Sectio</span></strong></a><a href=\"#sec3\"><strong><span style=\"text-decoration: underline;\">n 3. Drivers and Mixers </span>*incomplete*</strong></a>\r\n<ul>\r\n	<li><a href=\"#led\"> LED driver</a></li>\r\n	<li><a href=\"#mixer\">Signal mixer</a><strong></strong></li>\r\n</ul>\r\n<strong>SECTION 1. OSCILLATOR PRIMER <strong></strong></strong>\r\n<blockquote>\r\n<ul>\r\n	<li><span style=\"text-decoration: underline;\"><strong><strong>1.1 Frequency, amplitude and wave shape</strong></strong></span></li>\r\n</ul>\r\n</blockquote>\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/ampandfreq.jpg\"><img class=\"alignleft size-medium wp-image-1636\" title=\"Ampandfreq\" src=\"http://casperelectronics.com/wp-content/uploads/ampandfreq-200x242.jpg\" alt=\"\" width=\"200\" height=\"242\" /></a>The heart of the NovaDrone is a bank of six independent oscillators.\r\n\r\nAn oscillator is simply a pattern which repeats indefinitely. This can be a pattern of light, movement, electricity, even life cycles of organisms. The <a href=\"http://en.wikipedia.org/wiki/Oscillation\">wikipedia entry</a> gives dozens of examples of different kinds of oscillation.\r\n\r\nWhat we are most interested in is the modulation (changing amplitude) of electricity. All of the electrically produced sound we hear is a repeating pattern of fluctuating electrical current. When this is applied to a speaker, the current activates a coil in the speaker which pushes the cone of the speaker away from or towards a fixed magnet. This action vibrates the air in front of the speaker which in turn vibrates the air in front of that and so on until that vibration hits your ear drums and is perceived as sound. The sounds we hear around us are all incredibly complex patterns of air pressure modulation.\r\n\r\n<span style=\"color: #33cccc;\">Figure 1. triangle oscillator</span>\r\n<ul>\r\n	<li>The red line in fig 1 represents a voltage which goes up and down over a period of time. This is an oscillator.</li>\r\n</ul>\r\nThere are three basic factors that make up all oscillators: <a name=\"frequency\"></a><strong>frequency</strong>, <strong>amplitude</strong> and <strong>wave shape</strong>. In musical terms we would call these <strong>pitch</strong>, <strong>volume</strong> and <strong>timbre</strong>. I will also talk a fair amount about <strong>phase </strong>which is relevant when working with multiple oscillators and plays an important role in creating drones.\r\n\r\n&nbsp;\r\n<blockquote>\r\n<ul>\r\n	<li><span style=\"text-decoration: underline;\"><strong>Frequency</strong></span></li>\r\n</ul>\r\n</blockquote>\r\nOne complete sweep up and down is called a <strong>cycle</strong>. The number of cycles per second is your <strong>Frequency</strong> or <strong>Pitch</strong>.<strong></strong>\r\n<strong>Frequency</strong> is commonly measured in <strong>Hertz</strong>, which is the number of cycles per second.\r\n<a name=\"amplitude\"></a><strong>Pitch</strong> is another term for frequency which is used <span style=\"text-decoration: underline;\">only</span> when referring to the frequency of an audio signal.\r\nFigure 1 shows a triangle wave with a cycle length of .5 seconds. The frequency of this wave would be determined by seeing how many cycles will occur in 1 second. In this case there are 2 complete cycles in 1 second. That means the wave has a frequency of 2 Hertz. This is well below the hearing range. Humans can hear oscillators between 20Hz and 20,000 Hz.\r\n<blockquote>\r\n<ul>\r\n	<li><span style=\"text-decoration: underline;\"><strong>Amplitude</strong></span></li>\r\n</ul>\r\n</blockquote>\r\nAmplitude refers to the magnitude of voltage change across one cycle of an oscillation.\r\n<a name=\"waveshape\"></a>This in turn impacts the volume of the signal if it is sent to a speaker.\r\nThe image above shows a triangle wave with a positive peak of +5 volts and a negative peak of -5 volts. The amplitude is determined by figuring the absolute difference between these peaks. In this case that difference is 10 volts. This is commonly referred to as 10 Vpk-pk (10 volts peak to peak). There are many different ways to measure amplitude (pk-pk, RMS, Vp, etc…) but we’ll just be talking about Vpk-pk.<a href=\"http://casperelectronics.com/wp-content/uploads/waveshapes.png\"><img class=\"alignright\" title=\"Waveshapes\" src=\"http://casperelectronics.com/wp-content/uploads/waveshapes-200x160.png\" alt=\"\" width=\"292\" height=\"233\" /></a>\r\n<ul>\r\n	<li><span style=\"text-decoration: underline;\"><strong>Wave shape</strong></span></li>\r\n</ul>\r\nThe wave shape is the pattern of amplitude modulation over the course of a cycle.\r\nThe waveforms in fig 2 are: Sine, ramp, triangle and square.\r\nSine, triangle and square are the most common and are all symmetrical waves. That means the positive and negative portions of each cycle are of the same duration. Many musical synthesizers offer other wave forms which are asymmetrical versions of these common waves such as ramp, saw, and pulse waves.\r\nThe importance and impact of wave shape depends on its application. Many audio effects such as <strong>tremolo</strong> or <strong>phaser</strong> use low frequency oscillators (LFOs) to modulate certain parameters of the sound. It is commonly more desirable to use a sine or triangle wave for many of these effects such as the tremolo which <span style=\"color: #33cccc;\">Figure 2. Waveshapes</span>\r\n<a name=\"review\"></a>fades the volume in and out. Using a square wave for this would create dramatic shifts in volume which can be unpleasant.\r\nMany natural sounds are synthesized using overlapping wave forms like those shown above. For instance a flute can be synthesized using several octaves of a sine wave. A horn on the other hand will use more square waves and maybe a triangle or saw wave. More advanced wave and synthesis theory sites the sine wave as the basis of all wave forms. It is shown how even square waves can be created by combining several sine waves.\r\n<p style=\"padding-left: 30px;\"><span style=\"text-decoration: underline;\"><strong>Review</strong></span></p>\r\nThe basic components of an oscillator are:\r\n<h3><a name=\"1.2\"></a></h3>\r\n<strong>Frequency</strong>. The number of oscillation cycles that occur in one second. Measured in Hz\r\n<strong>Amplitude</strong>. Magnitude of voltage sweep in one cycle of an oscillator. Measured in Volts or Vpk-pk (volts peak to peak)\r\n<strong>Wave shape</strong>. Sine, triangle, square\r\n<p style=\"padding-left: 30px;\"><strong><span style=\"text-decoration: underline;\">1.2 Phase</span></strong></p>\r\nPhase is a bit more complicated than the other terms but plays an important role in audio circuitry and especially in making drones. Phase refers to a particular position in a <span style=\"text-decoration: underline;\">single cycle</span> of a wave (such as the positive or negative peak) and is measured in degrees. It is most commonly used to describe the relationship between multiple waves.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/phasedegrees.jpg\"><img class=\"alignnone size-large wp-image-1643\" title=\"Phasedegrees\" src=\"http://casperelectronics.com/wp-content/uploads/phasedegrees-460x236.jpg\" alt=\"\" width=\"460\" height=\"236\" /></a><span style=\"color: #33cccc;\">Figure 3. Phase</span>\r\nFig. 3 shows two sine waves (red &amp; blue) of identical amplitude and frequency. The green oscillator is the mix or <em>average</em> of the red and blue oscillators.\r\nPhase is measured in degrees with 360 degrees being one complete cycle. 180 degrees is exactly ½ of a cycle.\r\nIn fig. 3 the phase of the blue oscillator is offset at 45 degree increments from the red oscillator from left to right. With each step you’ll notice that the waves get farther apart and that the amplitude of the green (average) oscillator decreases.\r\nThis may seem confusing at first but it’s really quite simple. The green oscillator is the average of the red and blue oscillators. Let’s say the red and blue oscillators sweep from -5 to +5VDC (10Vp-p). Now look at the right most illustration of the 2 waves out of phase by 180 degrees. When the blue wave is at its positive peak (90 degrees) of +5 volts, the red wave is at it’s negative peak (270 degrees) of -5 volts.\r\nWhat is the average of -5 and +5? Zero. They are always going to be the opposites of each other so the average will always be zero. Now look at the 90 degree image. When Blue is at +5 volts/90 degrees, red is at 0 volts/zero degrees. The average of +5 and zero is 2.5 volts.\r\nThe important thing to take away from the info above is that the amplitude of an oscillator created by mixing two similar oscillators is relative to the difference in phase of the two source waves.\r\nIn fig. 3 the oscillators have identical frequencies. This means that the phase relationship once established will remain the same and the resulting averaged amplitude of the two waves will also remain the same.\r\n<strong>Q: What will happen if the frequencies of your two waves are NOT identical? </strong>\r\nWe established above that the amplitude of the averaged waveform is relative to the phase difference of the two wave forms, therefore as the phase difference of two waves increases and decreases so too will the averaged waveforms’ amplitude. What we have here is phase controlled amplitude modulation and the rate of phase modulation is controlled by the frequency difference between your two oscillators.\r\nIn fig. 4 the blue oscillator has a frequency of 10 Hz, the red is 11Hz. That means that it takes the red wave 1/10<sup>th</sup> of a second longer to complete a cycle than the blue wave. You can see that with each cycle the red wave lags a little bit further behind the blue wave which increases the phase difference between the two. As a result, the amplitude of the averaged wave (green) decreases as the phase offset approaches 180 degrees and then increases as it continues past 180 to 360 degrees.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/phaseModulation.jpg\"><img class=\"alignnone size-large wp-image-1644\" title=\"PhaseModulation\" src=\"http://casperelectronics.com/wp-content/uploads/phaseModulation-460x202.jpg\" alt=\"\" width=\"460\" height=\"202\" /></a><a href=\"http://casperelectronics.com/wp-content/uploads/phase_modulation2.jpg\"><img class=\"alignnone size-large wp-image-1645\" title=\"Phase Modulation2\" src=\"http://casperelectronics.com/wp-content/uploads/phase_modulation2-460x220.jpg\" alt=\"\" width=\"460\" height=\"220\" /></a><a name=\"sec2\"></a><span style=\"color: #33cccc;\">Figure 4. Phase controlled amplitude</span>\r\n<h3><a name=\"2.1\"></a></h3>\r\nThis phenomenon of phase controlled amplitude is something many musicians use without even realizing it. This is the vary trick one uses when tuning a guitar. You tune one string to the other until the “beatingâ€ effect slows and eventually disappears.\r\n<h3><strong>SECTION 2. NOVADRONE OSCILLATORS</strong></h3>\r\n<h3 style=\"padding-left: 30px;\"><strong><span style=\"text-decoration: underline;\">2.1 The circuit</span> </strong></h3>\r\n&nbsp;\r\n\r\nThe NovaDrone contains 6 oscillators. Each oscillator outputs a square wave and a triangle wave.\r\n<span style=\"text-decoration: underline;\"><a name=\"schematic\"></a></span>The circuit which generates the oscillators is clean, simple and robust. They are generated using a remarkable device called an <strong>op amp</strong>. If you are interested in building synthesizers and don’t know where to start, read up on <strong>op amps</strong>. They are the key elements of most oscillators, filters, envelope generators, mixers and amps.\r\n<p style=\"padding-left: 30px;\"><span style=\"text-decoration: underline;\"><strong>Schematic</strong></span></p>\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/OSC2rc.jpg\"><img class=\"alignleft\" title=\"OSC2rc\" src=\"http://casperelectronics.com/wp-content/uploads/OSC2rc-200x163.jpg\" alt=\"\" width=\"200\" height=\"163\" /></a>­­Each channel of the NovaDrone (Red, green and blue) has 2 oscillators. These are shown in fig. 5 and <a name=\"feedbackloops\"></a>fig. 6. They are very similar to one another but have been calibrated for different purposes.\r\n<strong>Osc 1</strong> is an audio frequency oscillator. It has a coarse and fine tune adjustment and only operates at audible frequencies (20Hz-20kHz).\r\n<strong>Osc 2</strong> is calibrated as a low frequency oscillator (LFO) with cycles as long as 2 minutes. It has a range switch and a single adjustment knob.\r\n<p style=\"padding-left: 30px;\"><span style=\"text-decoration: underline;\"><strong>Feedback loops</strong></span></p>\r\nThe oscillator circuit is a feedback loop between two op amps that are <a href=\"http://casperelectronics.com/wp-content/uploads/OSC1rc.jpg\"><img class=\"alignleft\" title=\"OSC1rc\" src=\"http://casperelectronics.com/wp-content/uploads/OSC1rc-200x170.jpg\" alt=\"\" width=\"200\" height=\"170\" /></a>configured as a <strong>schmitt trigger</strong> and an <strong>inverting integrator</strong>.\r\nBasically an <em>integrator</em> turns square waves into triangle waves.\r\nA <em>Schmitt trigger</em> is a kind of comparator that turns modulating signals (like triangle waves) into square waves.\r\nThe key elements of the relationship between these two circuits is that they form a loop (Schmitt &gt; integrator &gt;Schmitt&gt;integrator&gt; etc…) and that the integrator is also an <strong>inverter</strong>. This creates a continuous cycle of modulation:\r\n1) Schmitt output goes HI.\r\n2) Integrator inverts Schmitt signal and outputs slope going down (LOW).\r\n3) When slope is near zero volts, Schmitt trigger is thrown and its’ output goes LOW.\r\n4) Integrator inverts and generates upward slope (HI).\r\n5) When integrator slope reaches peak, Schmitt trigger is thrown and output goes HI.\r\n<a name=\"rctimeconstant\"></a>6) etc……\r\nThis is an overly simplified explanation but enough for our purposes. Do more research on these valuable circuits once you are familiar with some of the basics of op-amps.\r\n<strong><span style=\"text-decoration: underline;\">RC (resistor capacitor)time constant</span></strong>\r\nIn both oscillators (fig. 5 and 6) the primary element which defines frequency is the <strong>RC time constant</strong>. This relationship is a core component of most oscillators and is worth reading up on.\r\n\r\nThe RC time constant is a period of time defined by the relationship between a resistor and a capacitor.\r\nThe equation for this is simply <strong>t =</strong> <strong>R*C</strong>. In the case of the oscillators above it would be <strong>t=R1*C1</strong>.\r\nUnfortunately calculating the frequency of an oscillator is more complicated than just calculating your RC constant.\r\nIn many oscillators (including this one) there is a schmitt trigger component which watches the rising or sinking voltage from the integrator. The Schmitt trigger activates when the slope reaches predefined upper and lower limits. In order to determine the frequency of an oscillator we need to know what our upper and lower limits are and then calculate how long it takes our wave (the output of the integrator) to travel from one limit to the other.\r\nThese limits are determined by the relationship of 2 resistors in the schmitt stage. In fig 5 and 6 these are R2 and R3.\r\nThe equation for determining the duration of one cycle is\r\n(1/4R1C1)*(R3/R4)\r\nIn Oscillator 2 <strong>R</strong><strong>1</strong> is a 500k potentiometer in series with a 4.7k resistor between pins 8 and 13 of the two op amps. <strong>C</strong><strong>1</strong> is one of the three capacitors between pins 13 and 14 of the rightmost op amp. One of these caps is selected using a three way switch on the NovaDrone circuit board. This controls the frequency range of the LFO.\r\nLet’s say the pot is all the way up (full resistance) and the middle cap has been selected. The equations for RC and subsequently the frequency is:\r\n<strong>R1=504,700 Ohms</strong>\r\n<a name=\"howitworks\"></a><strong>C1= .000022 Farads</strong>\r\n<strong>R2 = 8,300 Ohms</strong>\r\n<strong>R3 = 10,000 Ohms</strong>\r\n<strong>Frequency in Hz = (1 / 4*R</strong><strong>1C</strong><strong>1) * (R</strong><strong>3/R</strong><strong>2)</strong>\r\n<p style=\"padding-left: 30px;\"><span style=\"text-decoration: underline;\"><strong>How it works</strong></span></p>\r\nResistors limit the flow of current and capacitors store current. Current flows through the resistor and is stored in the capacitor. The resistor controls how much current flows into the capacitor per second. Therefore the size of capacitor and the amount of resistance will determine how long it takes to fill the capacitor. A common analogy is to think about current flow as water, the resistor as a spigot\r\n<h3><a name=\"2.2\"></a></h3>\r\nand the capacitor as a cup. The more you open the spigot (reduce resistance), the more water (electrical current) will flow and the faster the cup will fill (capacitor will charge). The oscillator circuit is configured in a special way which causes the capacitor to continuously charge and discharge. It is looking for two states from the cap, fully charged or fully discharged. When the cap reaches either of these states, the whole circuit reverses polarity and the capacitors charge status begins moving toward the opposite state. The amount of time it takes to charge and discharge is your cycle duration.\r\n<p style=\"padding-left: 30px;\"><span style=\"text-decoration: underline;\"><strong>2.2 pulse width modulation (pwm)</strong></span></p>\r\nPWM is exciting stuff….really! It is essentially a <strong>1 bit digital</strong> representation of an <strong>analog</strong> wave form.\r\nDigital wave forms only have 2 states, <strong>high</strong> and <strong>low</strong>. <strong>High</strong> is a voltage <em>at</em> or very close to the positive supply voltage. <strong>Low</strong> is a voltage <em>at</em> or very close to the negative supply voltage. It is basically just a square wave. Analog on the other hand is infinitely variable. Think about it like the difference between a light switch (digital) and a light dimmer (analog). PWM is a wave form that bridges the gap between these two formats. It can be used to make sound, control the brightness of an LED, control the speed of high torque motors and speak to microprocessors. It is also the language that a microprocessor will use to speak with the analog world.\r\nPulse Width (PW) refers to the relative durations of high and low voltage in a single <strong>cycle</strong> of a square wave.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/pulsewidth.jpg\"><img class=\"alignnone size-large wp-image-1648\" title=\"Pulsewidth\" src=\"http://casperelectronics.com/wp-content/uploads/pulsewidth-460x214.jpg\" alt=\"\" width=\"460\" height=\"214\" /></a><span style=\"color: #33cccc;\">Figure 7. Pulse width</span>\r\nFig. 7 shows three square wave oscillators of the same amplitude and frequency but with differing <strong>pulse width</strong>. The red oscillator has a 10% pulse width. That means the wave goes high for 10 % of the duration of one cycle. The green wave is 50% and the purple wave is 90%. What is important to note is that pulse width has nothing to do with frequency and only refers to the relationship between the high and low swing of the wave.\r\n<p style=\"padding-left: 30px;\"><strong><span style=\"text-decoration: underline;\">The Comparator</span></strong></p>\r\nThe job of a comparator is simple. Two signals are fed into the “+â€ and “-“ inputs (labeled 10 and 9 in fig. 8 respectively). If the voltage at the “+â€ input is <em>higher</em> than the “-“ input the output of the comparator goes <strong>high</strong>.<strong> </strong>If the “+â€ input drops below the “-“ input the output goes <strong>low</strong>.\r\nIn the NovaDrone t<a href=\"http://casperelectronics.com/wp-content/uploads/comparator.jpg\"><img class=\"alignleft\" title=\"Comparator\" src=\"http://casperelectronics.com/wp-content/uploads/comparator-200x76.jpg\" alt=\"\" width=\"200\" height=\"76\" /></a>he triangle output of Osc 1 and Osc 2 combine through a simple comparator (fig. 8) to make a single square wave with a modulating pulse width. In this way, the comparator also functions as a pulse width modulation processor.\r\n\r\nFig. 9 below shows how two triangle waves are transformed through the comparator into a square wave with a modulating pulse width.\r\nThe blue triangle wave in fig. 9 is oscillator 1. The red triangle is osc 2. The green line is the combined PWM output.\r\nAny time the blue line (osc 1) is above the red line (osc 2), the green line (pwm) goes high. As the red line rises the percentage of each cycle that the blue line is above the red line decreases. This changing percentage is what makes our modulating pulse width effect.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/PWM3-copy.jpg\"><img class=\"alignnone size-large wp-image-1647\" title=\"PWM3 Copy\" src=\"http://casperelectronics.com/wp-content/uploads/PWM3-copy-460x202.jpg\" alt=\"\" width=\"460\" height=\"202\" /></a><span style=\"color: #33cccc;\">Figure 9. Pulse width modulation detail</span>\r\n<p style=\"padding-left: 30px;\"><strong><span style=\"text-decoration: underline;\">Mixer</span></strong></p>\r\nThe audio signals from each of the three channels of the NovaDrone are mixed using the circuit in fig. 10.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/mixer.jpg\"><img class=\"alignleft\" title=\"Mixer\" src=\"http://casperelectronics.com/wp-content/uploads/mixer-200x135.jpg\" alt=\"\" width=\"200\" height=\"135\" /></a>This mixer is nice and simple and uses just one <strong>op amp</strong> and a few other components. This circuit is configured as an inverting mixer with an amplitude controlled by the <strong>feedback resistor</strong> and <strong>input resistors</strong>. The amplitude is calculated as RF/RI. In this case RF = 10,000 and RI = 100,000. That means the output signal is 1/10<sup>th</sup> the amplitude of the input signal.\r\n<strong><span style=\"text-decoration: underline;\">\r\n</span></strong>\r\n<p style=\"padding-left: 30px;\"><strong><span style=\"text-decoration: underline;\">LED drivers</span></strong></p>\r\n(3) 2N3904 NPN transistors are used to make 3 LED drivers.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/LEDdriver.jpg\"><img class=\"alignleft\" title=\"LEDdriver\" src=\"http://casperelectronics.com/wp-content/uploads/LEDdriver-200x108.jpg\" alt=\"\" width=\"200\" height=\"108\" /></a>A driver is a simple but important circuit which isolates elements which use lots of current (like LEDs) from sensitive circuits (like the oscillators in the NovaDrone). Failure to use a driver can result in something called a <strong>loading effect</strong> which basically means that the device being driven will affect the behavior of the rest of the circuit in bad ways, like the pitch changing when the lights turn on. The LED in the NovaDrone uses a lot of current relative to the rest of the circuit (90mA vs around 30mA for the rest of the circuit) therefore a driver is necessary. The key component of a driver is the <strong>transistor</strong>. This is another topic worth reading a lot about.','NovaDrone Tech Manual',0,'','inherit','open','closed','','1704-revision-7','','','2012-11-05 15:14:25','2012-11-05 20:14:25','',1704,'http://casperelectronics.com/2012/11/05/1704-revision-7/',0,'revision','',0),(1714,2,'2012-11-05 15:31:09','2012-11-05 20:31:09','Throughout this guide I will attempt to give you some insight into the circuit theory and scientific principles at play in the NovaDrone. That said I will be giving little more than an intro to each topic and strongly encourage you to do further reading on topics you find interesting.\r\n<ul>\r\n	<li>This is a beta version of the <strong>NovaDrone Technical Guide</strong>. I expect to make revisions over time and eagerly encourage readers to send me feedback, questions, suggestions and especially corrections. Comments should be addressed to <a href=\"mailto:pete@casperelectronics.com\"><strong>pete@casperelectronics.com</strong></a>.</li>\r\n</ul>\r\n<h3 style=\"text-align: center;\"><span style=\"color: #000000;\"><strong>TABLE OF CONTENTS:</strong></span></h3>\r\n<a href=\"#sec1\"><strong><span style=\"text-decoration: underline;\">Section 1. Oscillator Primer</span></strong></a>\r\n<ul>\r\n	<li><a href=\"#1.1\"><strong>1.1 Frequency, amplitude &amp; wave shape</strong></a>\r\n<ul>\r\n	<li><a href=\"#frequency\">Frequency</a></li>\r\n	<li><a href=\"#amplitude\">Amplitude</a></li>\r\n	<li><a href=\"#waveshape\"> Wave shape</a></li>\r\n	<li><a href=\"#review\"> Review<strong></strong></a></li>\r\n</ul>\r\n</li>\r\n	<li><a href=\"#1.2\"><strong>1.2 Phase</strong></a>\r\n<ul>\r\n	<li><a href=\"#phase\"> Phase controlled amplitude modulation</a></li>\r\n</ul>\r\n</li>\r\n</ul>\r\n<a href=\"#sec2\"><strong><span style=\"text-decoration: underline;\">Section 2. NovaDrone Oscillators</span></strong></a>\r\n<ul>\r\n	<li><a href=\"#2.1\"><strong>2.1 The Circuit</strong></a>\r\n<ul>\r\n	<li><a href=\"#feedbackloops\"> Feedback loops</a></li>\r\n	<li><a href=\"#schematic\"> Schematic</a></li>\r\n	<li><a href=\"#rctimeconstant\"> RC time constant</a></li>\r\n	<li><a href=\"#howitworks\"> How it works<strong></strong></a></li>\r\n</ul>\r\n</li>\r\n	<li><a href=\"#2.2\"><strong>2.2 Pulse Width Modulation</strong></a>\r\n<ul>\r\n	<li><a href=\"#comparator\">The comparator<strong></strong></a></li>\r\n</ul>\r\n</li>\r\n</ul>\r\n<a name=\"sec1\"></a><a name=\"1.1\"></a><a href=\"#sec3\"><strong><span style=\"text-decoration: underline;\">Sectio</span></strong></a><a href=\"#sec3\"><strong><span style=\"text-decoration: underline;\">n 3. Drivers and Mixers </span>*incomplete*</strong></a>\r\n<ul>\r\n	<li><a href=\"#led\"> LED driver</a></li>\r\n	<li><a href=\"#mixer\">Signal mixer</a><strong></strong></li>\r\n</ul>\r\n<strong>SECTION 1. OSCILLATOR PRIMER <strong></strong></strong>\r\n<blockquote>\r\n<ul>\r\n	<li><span style=\"text-decoration: underline;\"><strong><strong>1.1 Frequency, amplitude and wave shape</strong></strong></span></li>\r\n</ul>\r\n</blockquote>\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/ampandfreq.jpg\"><img class=\"alignleft size-medium wp-image-1636\" title=\"Ampandfreq\" src=\"http://casperelectronics.com/wp-content/uploads/ampandfreq-200x242.jpg\" alt=\"\" width=\"200\" height=\"242\" /></a>\r\n<div>\r\n\r\nThe heart of the NovaDrone is a bank of six independent oscillators.</div>\r\nAn oscillator is simply a pattern which repeats indefinitely. This can be a pattern of light, movement, electricity, even life cycles of organisms. The <a href=\"http://en.wikipedia.org/wiki/Oscillation\">wikipedia entry</a> gives dozens of examples of different kinds of oscillation.\r\n\r\nWhat we are most interested in is the modulation (changing amplitude) of electricity. All of the electrically produced sound we hear is a repeating pattern of fluctuating electrical current.\r\n\r\n<em><span style=\"color: #33cccc;\">Figure 1. triangle oscillator</span></em>\r\n\r\nWhen this is applied to a speaker, the current activates a coil in the speaker which pushes the cone of the speaker away from or towards a fixed magnet. This action vibrates the air in front of the speaker which in turn vibrates the air in front of that and so on until that vibrations hit our ear drums and are perceived as sound. The sounds we hear around us are all incredibly complex patterns of air pressure modulation.\r\n<div>\r\n<ul>\r\n	<li><strong>The red line in fig 1 represents a voltage which goes up and down over a period of time. This is an oscillator.</strong></li>\r\n</ul>\r\nThere are three basic factors that make up all oscillators: <a name=\"frequency\"></a><strong>frequency</strong>, <strong>amplitude</strong> and <strong>wave shape</strong>. In musical terms we would call these <strong>pitch</strong>, <strong>volume</strong> and <strong>timbre</strong>. I will also talk a fair amount about <strong>phase </strong>which is relevant when working with multiple oscillators and plays an important role in creating drones.\r\n<blockquote>\r\n<ul>\r\n	<li><span style=\"text-decoration: underline;\"><strong>Frequency</strong></span></li>\r\n</ul>\r\n</blockquote>\r\nOne complete sweep up and down is called a <strong>cycle</strong>. The number of cycles per second is your <strong>Frequency</strong> or <strong>Pitch</strong>.<strong></strong>\r\n<strong>Frequency</strong> is commonly measured in <strong>Hertz</strong>, which is the number of cycles per second.\r\n<a name=\"amplitude\"></a><strong>Pitch</strong> is another term for frequency which is used <span style=\"text-decoration: underline;\">only</span> when referring to the frequency of an audio signal.\r\nFigure 1 shows a triangle wave with a cycle length of .5 seconds. The frequency of this wave would be determined by seeing how many cycles will occur in 1 second. In this case there are 2 complete cycles in 1 second. That means the wave has a frequency of 2 Hertz. This is well below the hearing range. Humans can hear oscillators between 20Hz and 20,000 Hz.\r\n<blockquote>\r\n<ul>\r\n	<li><span style=\"text-decoration: underline;\"><strong>Amplitude</strong></span></li>\r\n</ul>\r\n</blockquote>\r\nAmplitude refers to the magnitude of voltage change across one cycle of an oscillation.\r\n<a name=\"waveshape\"></a>This in turn impacts the volume of the signal if it is sent to a speaker.\r\nThe image above shows a triangle wave with a positive peak of +5 volts and a negative peak of -5 volts. The amplitude is determined by figuring the absolute difference between these peaks. In this case that difference is 10 volts. This is commonly referred to as 10 Vpk-pk (10 volts peak to peak). There are many different ways to measure amplitude (pk-pk, RMS, Vp, etc…) but we’ll just be talking about Vpk-pk.<a href=\"http://casperelectronics.com/wp-content/uploads/waveshapes.png\"><img class=\"alignright\" title=\"Waveshapes\" src=\"http://casperelectronics.com/wp-content/uploads/waveshapes-200x160.png\" alt=\"\" width=\"292\" height=\"233\" /></a>\r\n<ul>\r\n	<li><span style=\"text-decoration: underline;\"><strong>Wave shape</strong></span></li>\r\n</ul>\r\nThe wave shape is the pattern of amplitude modulation over the course of a cycle.\r\nThe waveforms in fig 2 are: Sine, ramp, triangle and square.\r\nSine, triangle and square are the most common and are all symmetrical waves. That means the positive and negative portions of each cycle are of the same duration. Many musical synthesizers offer other wave forms which are asymmetrical versions of these common waves such as ramp, saw, and pulse waves.\r\nThe importance and impact of wave shape depends on its application. Many audio effects such as <strong>tremolo</strong> or <strong>phaser</strong> use low frequency oscillators (LFOs) to modulate certain parameters of the sound. It is commonly more desirable to use a sine or triangle wave for many of these effects such as the tremolo which <span style=\"color: #33cccc;\">Figure 2. Waveshapes</span>\r\n<a name=\"review\"></a>fades the volume in and out. Using a square wave for this would create dramatic shifts in volume which can be unpleasant.\r\nMany natural sounds are synthesized using overlapping wave forms like those shown above. For instance a flute can be synthesized using several octaves of a sine wave. A horn on the other hand will use more square waves and maybe a triangle or saw wave. More advanced wave and synthesis theory sites the sine wave as the basis of all wave forms. It is shown how even square waves can be created by combining several sine waves.\r\n<p style=\"padding-left: 30px;\"><span style=\"text-decoration: underline;\"><strong>Review</strong></span></p>\r\nThe basic components of an oscillator are:\r\n<h3><a name=\"1.2\"></a></h3>\r\n<strong>Frequency</strong>. The number of oscillation cycles that occur in one second. Measured in Hz\r\n<strong>Amplitude</strong>. Magnitude of voltage sweep in one cycle of an oscillator. Measured in Volts or Vpk-pk (volts peak to peak)\r\n<strong>Wave shape</strong>. Sine, triangle, square\r\n<p style=\"padding-left: 30px;\"><strong><span style=\"text-decoration: underline;\">1.2 Phase</span></strong></p>\r\nPhase is a bit more complicated than the other terms but plays an important role in audio circuitry and especially in making drones. Phase refers to a particular position in a <span style=\"text-decoration: underline;\">single cycle</span> of a wave (such as the positive or negative peak) and is measured in degrees. It is most commonly used to describe the relationship between multiple waves.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/phasedegrees.jpg\"><img class=\"alignnone size-large wp-image-1643\" title=\"Phasedegrees\" src=\"http://casperelectronics.com/wp-content/uploads/phasedegrees-460x236.jpg\" alt=\"\" width=\"460\" height=\"236\" /></a><span style=\"color: #33cccc;\">Figure 3. Phase</span>\r\nFig. 3 shows two sine waves (red &amp; blue) of identical amplitude and frequency. The green oscillator is the mix or <em>average</em> of the red and blue oscillators.\r\nPhase is measured in degrees with 360 degrees being one complete cycle. 180 degrees is exactly ½ of a cycle.\r\nIn fig. 3 the phase of the blue oscillator is offset at 45 degree increments from the red oscillator from left to right. With each step you’ll notice that the waves get farther apart and that the amplitude of the green (average) oscillator decreases.\r\nThis may seem confusing at first but it’s really quite simple. The green oscillator is the average of the red and blue oscillators. Let’s say the red and blue oscillators sweep from -5 to +5VDC (10Vp-p). Now look at the right most illustration of the 2 waves out of phase by 180 degrees. When the blue wave is at its positive peak (90 degrees) of +5 volts, the red wave is at it’s negative peak (270 degrees) of -5 volts.\r\nWhat is the average of -5 and +5? Zero. They are always going to be the opposites of each other so the average will always be zero. Now look at the 90 degree image. When Blue is at +5 volts/90 degrees, red is at 0 volts/zero degrees. The average of +5 and zero is 2.5 volts.\r\nThe important thing to take away from the info above is that the amplitude of an oscillator created by mixing two similar oscillators is relative to the difference in phase of the two source waves.\r\nIn fig. 3 the oscillators have identical frequencies. This means that the phase relationship once established will remain the same and the resulting averaged amplitude of the two waves will also remain the same.\r\n<strong>Q: What will happen if the frequencies of your two waves are NOT identical? </strong>\r\nWe established above that the amplitude of the averaged waveform is relative to the phase difference of the two wave forms, therefore as the phase difference of two waves increases and decreases so too will the averaged waveforms’ amplitude. What we have here is phase controlled amplitude modulation and the rate of phase modulation is controlled by the frequency difference between your two oscillators.\r\nIn fig. 4 the blue oscillator has a frequency of 10 Hz, the red is 11Hz. That means that it takes the red wave 1/10<sup>th</sup> of a second longer to complete a cycle than the blue wave. You can see that with each cycle the red wave lags a little bit further behind the blue wave which increases the phase difference between the two. As a result, the amplitude of the averaged wave (green) decreases as the phase offset approaches 180 degrees and then increases as it continues past 180 to 360 degrees.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/phaseModulation.jpg\"><img class=\"alignnone size-large wp-image-1644\" title=\"PhaseModulation\" src=\"http://casperelectronics.com/wp-content/uploads/phaseModulation-460x202.jpg\" alt=\"\" width=\"460\" height=\"202\" /></a><a href=\"http://casperelectronics.com/wp-content/uploads/phase_modulation2.jpg\"><img class=\"alignnone size-large wp-image-1645\" title=\"Phase Modulation2\" src=\"http://casperelectronics.com/wp-content/uploads/phase_modulation2-460x220.jpg\" alt=\"\" width=\"460\" height=\"220\" /></a><a name=\"sec2\"></a><span style=\"color: #33cccc;\">Figure 4. Phase controlled amplitude</span>\r\n<h3><a name=\"2.1\"></a></h3>\r\nThis phenomenon of phase controlled amplitude is something many musicians use without even realizing it. This is the vary trick one uses when tuning a guitar. You tune one string to the other until the “beatingâ€ effect slows and eventually disappears.\r\n<h3><strong>SECTION 2. NOVADRONE OSCILLATORS</strong></h3>\r\n<h3 style=\"padding-left: 30px;\"><strong><span style=\"text-decoration: underline;\">2.1 The circuit</span> </strong></h3>\r\n&nbsp;\r\n\r\nThe NovaDrone contains 6 oscillators. Each oscillator outputs a square wave and a triangle wave.\r\n<span style=\"text-decoration: underline;\"><a name=\"schematic\"></a></span>The circuit which generates the oscillators is clean, simple and robust. They are generated using a remarkable device called an <strong>op amp</strong>. If you are interested in building synthesizers and don’t know where to start, read up on <strong>op amps</strong>. They are the key elements of most oscillators, filters, envelope generators, mixers and amps.\r\n<p style=\"padding-left: 30px;\"><span style=\"text-decoration: underline;\"><strong>Schematic</strong></span></p>\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/OSC2rc.jpg\"><img class=\"alignleft\" title=\"OSC2rc\" src=\"http://casperelectronics.com/wp-content/uploads/OSC2rc-200x163.jpg\" alt=\"\" width=\"200\" height=\"163\" /></a>­­Each channel of the NovaDrone (Red, green and blue) has 2 oscillators. These are shown in fig. 5 and <a name=\"feedbackloops\"></a>fig. 6. They are very similar to one another but have been calibrated for different purposes.\r\n<strong>Osc 1</strong> is an audio frequency oscillator. It has a coarse and fine tune adjustment and only operates at audible frequencies (20Hz-20kHz).\r\n<strong>Osc 2</strong> is calibrated as a low frequency oscillator (LFO) with cycles as long as 2 minutes. It has a range switch and a single adjustment knob.\r\n<p style=\"padding-left: 30px;\"><span style=\"text-decoration: underline;\"><strong>Feedback loops</strong></span></p>\r\nThe oscillator circuit is a feedback loop between two op amps that are <a href=\"http://casperelectronics.com/wp-content/uploads/OSC1rc.jpg\"><img class=\"alignleft\" title=\"OSC1rc\" src=\"http://casperelectronics.com/wp-content/uploads/OSC1rc-200x170.jpg\" alt=\"\" width=\"200\" height=\"170\" /></a>configured as a <strong>schmitt trigger</strong> and an <strong>inverting integrator</strong>.\r\nBasically an <em>integrator</em> turns square waves into triangle waves.\r\nA <em>Schmitt trigger</em> is a kind of comparator that turns modulating signals (like triangle waves) into square waves.\r\nThe key elements of the relationship between these two circuits is that they form a loop (Schmitt &gt; integrator &gt;Schmitt&gt;integrator&gt; etc…) and that the integrator is also an <strong>inverter</strong>. This creates a continuous cycle of modulation:\r\n1) Schmitt output goes HI.\r\n2) Integrator inverts Schmitt signal and outputs slope going down (LOW).\r\n3) When slope is near zero volts, Schmitt trigger is thrown and its’ output goes LOW.\r\n4) Integrator inverts and generates upward slope (HI).\r\n5) When integrator slope reaches peak, Schmitt trigger is thrown and output goes HI.\r\n<a name=\"rctimeconstant\"></a>6) etc……\r\nThis is an overly simplified explanation but enough for our purposes. Do more research on these valuable circuits once you are familiar with some of the basics of op-amps.\r\n<strong><span style=\"text-decoration: underline;\">RC (resistor capacitor)time constant</span></strong>\r\nIn both oscillators (fig. 5 and 6) the primary element which defines frequency is the <strong>RC time constant</strong>. This relationship is a core component of most oscillators and is worth reading up on.\r\n\r\nThe RC time constant is a period of time defined by the relationship between a resistor and a capacitor.\r\nThe equation for this is simply <strong>t =</strong> <strong>R*C</strong>. In the case of the oscillators above it would be <strong>t=R1*C1</strong>.\r\nUnfortunately calculating the frequency of an oscillator is more complicated than just calculating your RC constant.\r\nIn many oscillators (including this one) there is a schmitt trigger component which watches the rising or sinking voltage from the integrator. The Schmitt trigger activates when the slope reaches predefined upper and lower limits. In order to determine the frequency of an oscillator we need to know what our upper and lower limits are and then calculate how long it takes our wave (the output of the integrator) to travel from one limit to the other.\r\nThese limits are determined by the relationship of 2 resistors in the schmitt stage. In fig 5 and 6 these are R2 and R3.\r\nThe equation for determining the duration of one cycle is\r\n(1/4R1C1)*(R3/R4)\r\nIn Oscillator 2 <strong>R</strong><strong>1</strong> is a 500k potentiometer in series with a 4.7k resistor between pins 8 and 13 of the two op amps. <strong>C</strong><strong>1</strong> is one of the three capacitors between pins 13 and 14 of the rightmost op amp. One of these caps is selected using a three way switch on the NovaDrone circuit board. This controls the frequency range of the LFO.\r\nLet’s say the pot is all the way up (full resistance) and the middle cap has been selected. The equations for RC and subsequently the frequency is:\r\n<strong>R1=504,700 Ohms</strong>\r\n<a name=\"howitworks\"></a><strong>C1= .000022 Farads</strong>\r\n<strong>R2 = 8,300 Ohms</strong>\r\n<strong>R3 = 10,000 Ohms</strong>\r\n<strong>Frequency in Hz = (1 / 4*R</strong><strong>1C</strong><strong>1) * (R</strong><strong>3/R</strong><strong>2)</strong>\r\n<p style=\"padding-left: 30px;\"><span style=\"text-decoration: underline;\"><strong>How it works</strong></span></p>\r\nResistors limit the flow of current and capacitors store current. Current flows through the resistor and is stored in the capacitor. The resistor controls how much current flows into the capacitor per second. Therefore the size of capacitor and the amount of resistance will determine how long it takes to fill the capacitor. A common analogy is to think about current flow as water, the resistor as a spigot\r\n<h3><a name=\"2.2\"></a></h3>\r\nand the capacitor as a cup. The more you open the spigot (reduce resistance), the more water (electrical current) will flow and the faster the cup will fill (capacitor will charge). The oscillator circuit is configured in a special way which causes the capacitor to continuously charge and discharge. It is looking for two states from the cap, fully charged or fully discharged. When the cap reaches either of these states, the whole circuit reverses polarity and the capacitors charge status begins moving toward the opposite state. The amount of time it takes to charge and discharge is your cycle duration.\r\n<p style=\"padding-left: 30px;\"><span style=\"text-decoration: underline;\"><strong>2.2 pulse width modulation (pwm)</strong></span></p>\r\nPWM is exciting stuff….really! It is essentially a <strong>1 bit digital</strong> representation of an <strong>analog</strong> wave form.\r\nDigital wave forms only have 2 states, <strong>high</strong> and <strong>low</strong>. <strong>High</strong> is a voltage <em>at</em> or very close to the positive supply voltage. <strong>Low</strong> is a voltage <em>at</em> or very close to the negative supply voltage. It is basically just a square wave. Analog on the other hand is infinitely variable. Think about it like the difference between a light switch (digital) and a light dimmer (analog). PWM is a wave form that bridges the gap between these two formats. It can be used to make sound, control the brightness of an LED, control the speed of high torque motors and speak to microprocessors. It is also the language that a microprocessor will use to speak with the analog world.\r\nPulse Width (PW) refers to the relative durations of high and low voltage in a single <strong>cycle</strong> of a square wave.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/pulsewidth.jpg\"><img class=\"alignnone size-large wp-image-1648\" title=\"Pulsewidth\" src=\"http://casperelectronics.com/wp-content/uploads/pulsewidth-460x214.jpg\" alt=\"\" width=\"460\" height=\"214\" /></a><span style=\"color: #33cccc;\">Figure 7. Pulse width</span>\r\nFig. 7 shows three square wave oscillators of the same amplitude and frequency but with differing <strong>pulse width</strong>. The red oscillator has a 10% pulse width. That means the wave goes high for 10 % of the duration of one cycle. The green wave is 50% and the purple wave is 90%. What is important to note is that pulse width has nothing to do with frequency and only refers to the relationship between the high and low swing of the wave.\r\n<p style=\"padding-left: 30px;\"><strong><span style=\"text-decoration: underline;\">The Comparator</span></strong></p>\r\nThe job of a comparator is simple. Two signals are fed into the “+â€ and “-“ inputs (labeled 10 and 9 in fig. 8 respectively). If the voltage at the “+â€ input is <em>higher</em> than the “-“ input the output of the comparator goes <strong>high</strong>.<strong> </strong>If the “+â€ input drops below the “-“ input the output goes <strong>low</strong>.\r\nIn the NovaDrone t<a href=\"http://casperelectronics.com/wp-content/uploads/comparator.jpg\"><img class=\"alignleft\" title=\"Comparator\" src=\"http://casperelectronics.com/wp-content/uploads/comparator-200x76.jpg\" alt=\"\" width=\"200\" height=\"76\" /></a>he triangle output of Osc 1 and Osc 2 combine through a simple comparator (fig. 8) to make a single square wave with a modulating pulse width. In this way, the comparator also functions as a pulse width modulation processor.\r\n\r\nFig. 9 below shows how two triangle waves are transformed through the comparator into a square wave with a modulating pulse width.\r\nThe blue triangle wave in fig. 9 is oscillator 1. The red triangle is osc 2. The green line is the combined PWM output.\r\nAny time the blue line (osc 1) is above the red line (osc 2), the green line (pwm) goes high. As the red line rises the percentage of each cycle that the blue line is above the red line decreases. This changing percentage is what makes our modulating pulse width effect.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/PWM3-copy.jpg\"><img class=\"alignnone size-large wp-image-1647\" title=\"PWM3 Copy\" src=\"http://casperelectronics.com/wp-content/uploads/PWM3-copy-460x202.jpg\" alt=\"\" width=\"460\" height=\"202\" /></a><span style=\"color: #33cccc;\">Figure 9. Pulse width modulation detail</span>\r\n<p style=\"padding-left: 30px;\"><strong><span style=\"text-decoration: underline;\">Mixer</span></strong></p>\r\nThe audio signals from each of the three channels of the NovaDrone are mixed using the circuit in fig. 10.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/mixer.jpg\"><img class=\"alignleft\" title=\"Mixer\" src=\"http://casperelectronics.com/wp-content/uploads/mixer-200x135.jpg\" alt=\"\" width=\"200\" height=\"135\" /></a>This mixer is nice and simple and uses just one <strong>op amp</strong> and a few other components. This circuit is configured as an inverting mixer with an amplitude controlled by the <strong>feedback resistor</strong> and <strong>input resistors</strong>. The amplitude is calculated as RF/RI. In this case RF = 10,000 and RI = 100,000. That means the output signal is 1/10<sup>th</sup> the amplitude of the input signal.\r\n<strong><span style=\"text-decoration: underline;\">\r\n</span></strong>\r\n<p style=\"padding-left: 30px;\"><strong><span style=\"text-decoration: underline;\">LED drivers</span></strong></p>\r\n(3) 2N3904 NPN transistors are used to make 3 LED drivers.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/LEDdriver.jpg\"><img class=\"alignleft\" title=\"LEDdriver\" src=\"http://casperelectronics.com/wp-content/uploads/LEDdriver-200x108.jpg\" alt=\"\" width=\"200\" height=\"108\" /></a>A driver is a simple but important circuit which isolates elements which use lots of current (like LEDs) from sensitive circuits (like the oscillators in the NovaDrone). Failure to use a driver can result in something called a <strong>loading effect</strong> which basically means that the device being driven will affect the behavior of the rest of the circuit in bad ways, like the pitch changing when the lights turn on. The LED in the NovaDrone uses a lot of current relative to the rest of the circuit (90mA vs around 30mA for the rest of the circuit) therefore a driver is necessary. The key component of a driver is the <strong>transistor</strong>. This is another topic worth reading a lot about\r\n.\r\n\r\n</div>','NovaDrone Tech Manual',0,'','inherit','open','closed','','1704-revision-9','','','2012-11-05 15:31:09','2012-11-05 20:31:09','',1704,'http://casperelectronics.com/2012/11/05/1704-revision-9/',0,'revision','',0),(1715,2,'2012-11-05 15:31:47','2012-11-05 20:31:47','Throughout this guide I will attempt to give you some insight into the circuit theory and scientific principles at play in the NovaDrone. That said I will be giving little more than an intro to each topic and strongly encourage you to do further reading on topics you find interesting.\r\n<ul>\r\n	<li>This is a beta version of the <strong>NovaDrone Technical Guide</strong>. I expect to make revisions over time and eagerly encourage readers to send me feedback, questions, suggestions and especially corrections. Comments should be addressed to <a href=\"mailto:pete@casperelectronics.com\"><strong>pete@casperelectronics.com</strong></a>.</li>\r\n</ul>\r\n<h3 style=\"text-align: center;\"><span style=\"color: #000000;\"><strong>TABLE OF CONTENTS:</strong></span></h3>\r\n<a href=\"#sec1\"><strong><span style=\"text-decoration: underline;\">Section 1. Oscillator Primer</span></strong></a>\r\n<ul>\r\n	<li><a href=\"#1.1\"><strong>1.1 Frequency, amplitude &amp; wave shape</strong></a>\r\n<ul>\r\n	<li><a href=\"#frequency\">Frequency</a></li>\r\n	<li><a href=\"#amplitude\">Amplitude</a></li>\r\n	<li><a href=\"#waveshape\"> Wave shape</a></li>\r\n	<li><a href=\"#review\"> Review<strong></strong></a></li>\r\n</ul>\r\n</li>\r\n	<li><a href=\"#1.2\"><strong>1.2 Phase</strong></a>\r\n<ul>\r\n	<li><a href=\"#phase\"> Phase controlled amplitude modulation</a></li>\r\n</ul>\r\n</li>\r\n</ul>\r\n<a href=\"#sec2\"><strong><span style=\"text-decoration: underline;\">Section 2. NovaDrone Oscillators</span></strong></a>\r\n<ul>\r\n	<li><a href=\"#2.1\"><strong>2.1 The Circuit</strong></a>\r\n<ul>\r\n	<li><a href=\"#feedbackloops\"> Feedback loops</a></li>\r\n	<li><a href=\"#schematic\"> Schematic</a></li>\r\n	<li><a href=\"#rctimeconstant\"> RC time constant</a></li>\r\n	<li><a href=\"#howitworks\"> How it works<strong></strong></a></li>\r\n</ul>\r\n</li>\r\n	<li><a href=\"#2.2\"><strong>2.2 Pulse Width Modulation</strong></a>\r\n<ul>\r\n	<li><a href=\"#comparator\">The comparator<strong></strong></a></li>\r\n</ul>\r\n</li>\r\n</ul>\r\n<a name=\"sec1\"></a><a name=\"1.1\"></a><a href=\"#sec3\"><strong><span style=\"text-decoration: underline;\">Sectio</span></strong></a><a href=\"#sec3\"><strong><span style=\"text-decoration: underline;\">n 3. Drivers and Mixers </span>*incomplete*</strong></a>\r\n<ul>\r\n	<li><a href=\"#led\"> LED driver</a></li>\r\n	<li><a href=\"#mixer\">Signal mixer</a><strong></strong></li>\r\n</ul>\r\n<strong>SECTION 1. OSCILLATOR PRIMER <strong></strong></strong>\r\n<blockquote>\r\n<ul>\r\n	<li><span style=\"text-decoration: underline;\"><strong><strong>1.1 Frequency, amplitude and wave shape</strong></strong></span></li>\r\n</ul>\r\n</blockquote>\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/ampandfreq.jpg\"><img class=\"alignleft size-medium wp-image-1636\" title=\"Ampandfreq\" src=\"http://casperelectronics.com/wp-content/uploads/ampandfreq-200x242.jpg\" alt=\"\" width=\"200\" height=\"242\" /></a>\r\n<div>\r\n\r\nThe heart of the NovaDrone is a bank of six independent oscillators.\r\n\r\n</div>\r\nAn oscillator is simply a pattern which repeats indefinitely. This can be a pattern of light, movement, electricity, even life cycles of organisms. The <a href=\"http://en.wikipedia.org/wiki/Oscillation\">wikipedia entry</a> gives dozens of examples of different kinds of oscillation.\r\n\r\nWhat we are most interested in is the modulation (changing amplitude) of electricity. All of the electrically produced sound we hear is a repeating pattern of fluctuating electrical current.\r\n\r\n&nbsp;\r\n\r\n&nbsp;\r\n\r\n<em><span style=\"color: #33cccc;\">Figure 1. triangle oscillator</span></em>\r\n\r\nWhen this is applied to a speaker, the current activates a coil in the speaker which pushes the cone of the speaker away from or towards a fixed magnet. This action vibrates the air in front of the speaker which in turn vibrates the air in front of that and so on until that vibrations hit our ear drums and are perceived as sound. The sounds we hear around us are all incredibly complex patterns of air pressure modulation.\r\n<div>\r\n<ul>\r\n	<li><strong>The red line in fig 1 represents a voltage which goes up and down over a period of time. This is an oscillator.</strong></li>\r\n</ul>\r\nThere are three basic factors that make up all oscillators: <a name=\"frequency\"></a><strong>frequency</strong>, <strong>amplitude</strong> and <strong>wave shape</strong>. In musical terms we would call these <strong>pitch</strong>, <strong>volume</strong> and <strong>timbre</strong>. I will also talk a fair amount about <strong>phase </strong>which is relevant when working with multiple oscillators and plays an important role in creating drones.\r\n<blockquote>\r\n<ul>\r\n	<li><span style=\"text-decoration: underline;\"><strong>Frequency</strong></span></li>\r\n</ul>\r\n</blockquote>\r\nOne complete sweep up and down is called a <strong>cycle</strong>. The number of cycles per second is your <strong>Frequency</strong> or <strong>Pitch</strong>.<strong></strong>\r\n<strong>Frequency</strong> is commonly measured in <strong>Hertz</strong>, which is the number of cycles per second.\r\n<a name=\"amplitude\"></a><strong>Pitch</strong> is another term for frequency which is used <span style=\"text-decoration: underline;\">only</span> when referring to the frequency of an audio signal.\r\nFigure 1 shows a triangle wave with a cycle length of .5 seconds. The frequency of this wave would be determined by seeing how many cycles will occur in 1 second. In this case there are 2 complete cycles in 1 second. That means the wave has a frequency of 2 Hertz. This is well below the hearing range. Humans can hear oscillators between 20Hz and 20,000 Hz.\r\n<blockquote>\r\n<ul>\r\n	<li><span style=\"text-decoration: underline;\"><strong>Amplitude</strong></span></li>\r\n</ul>\r\n</blockquote>\r\nAmplitude refers to the magnitude of voltage change across one cycle of an oscillation.\r\n<a name=\"waveshape\"></a>This in turn impacts the volume of the signal if it is sent to a speaker.\r\nThe image above shows a triangle wave with a positive peak of +5 volts and a negative peak of -5 volts. The amplitude is determined by figuring the absolute difference between these peaks. In this case that difference is 10 volts. This is commonly referred to as 10 Vpk-pk (10 volts peak to peak). There are many different ways to measure amplitude (pk-pk, RMS, Vp, etc…) but we’ll just be talking about Vpk-pk.<a href=\"http://casperelectronics.com/wp-content/uploads/waveshapes.png\"><img class=\"alignright\" title=\"Waveshapes\" src=\"http://casperelectronics.com/wp-content/uploads/waveshapes-200x160.png\" alt=\"\" width=\"292\" height=\"233\" /></a>\r\n<ul>\r\n	<li><span style=\"text-decoration: underline;\"><strong>Wave shape</strong></span></li>\r\n</ul>\r\nThe wave shape is the pattern of amplitude modulation over the course of a cycle.\r\nThe waveforms in fig 2 are: Sine, ramp, triangle and square.\r\nSine, triangle and square are the most common and are all symmetrical waves. That means the positive and negative portions of each cycle are of the same duration. Many musical synthesizers offer other wave forms which are asymmetrical versions of these common waves such as ramp, saw, and pulse waves.\r\nThe importance and impact of wave shape depends on its application. Many audio effects such as <strong>tremolo</strong> or <strong>phaser</strong> use low frequency oscillators (LFOs) to modulate certain parameters of the sound. It is commonly more desirable to use a sine or triangle wave for many of these effects such as the tremolo which <span style=\"color: #33cccc;\">Figure 2. Waveshapes</span>\r\n<a name=\"review\"></a>fades the volume in and out. Using a square wave for this would create dramatic shifts in volume which can be unpleasant.\r\nMany natural sounds are synthesized using overlapping wave forms like those shown above. For instance a flute can be synthesized using several octaves of a sine wave. A horn on the other hand will use more square waves and maybe a triangle or saw wave. More advanced wave and synthesis theory sites the sine wave as the basis of all wave forms. It is shown how even square waves can be created by combining several sine waves.\r\n<p style=\"padding-left: 30px;\"><span style=\"text-decoration: underline;\"><strong>Review</strong></span></p>\r\nThe basic components of an oscillator are:\r\n<h3><a name=\"1.2\"></a></h3>\r\n<strong>Frequency</strong>. The number of oscillation cycles that occur in one second. Measured in Hz\r\n<strong>Amplitude</strong>. Magnitude of voltage sweep in one cycle of an oscillator. Measured in Volts or Vpk-pk (volts peak to peak)\r\n<strong>Wave shape</strong>. Sine, triangle, square\r\n<p style=\"padding-left: 30px;\"><strong><span style=\"text-decoration: underline;\">1.2 Phase</span></strong></p>\r\nPhase is a bit more complicated than the other terms but plays an important role in audio circuitry and especially in making drones. Phase refers to a particular position in a <span style=\"text-decoration: underline;\">single cycle</span> of a wave (such as the positive or negative peak) and is measured in degrees. It is most commonly used to describe the relationship between multiple waves.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/phasedegrees.jpg\"><img class=\"alignnone size-large wp-image-1643\" title=\"Phasedegrees\" src=\"http://casperelectronics.com/wp-content/uploads/phasedegrees-460x236.jpg\" alt=\"\" width=\"460\" height=\"236\" /></a><span style=\"color: #33cccc;\">Figure 3. Phase</span>\r\nFig. 3 shows two sine waves (red &amp; blue) of identical amplitude and frequency. The green oscillator is the mix or <em>average</em> of the red and blue oscillators.\r\nPhase is measured in degrees with 360 degrees being one complete cycle. 180 degrees is exactly ½ of a cycle.\r\nIn fig. 3 the phase of the blue oscillator is offset at 45 degree increments from the red oscillator from left to right. With each step you’ll notice that the waves get farther apart and that the amplitude of the green (average) oscillator decreases.\r\nThis may seem confusing at first but it’s really quite simple. The green oscillator is the average of the red and blue oscillators. Let’s say the red and blue oscillators sweep from -5 to +5VDC (10Vp-p). Now look at the right most illustration of the 2 waves out of phase by 180 degrees. When the blue wave is at its positive peak (90 degrees) of +5 volts, the red wave is at it’s negative peak (270 degrees) of -5 volts.\r\nWhat is the average of -5 and +5? Zero. They are always going to be the opposites of each other so the average will always be zero. Now look at the 90 degree image. When Blue is at +5 volts/90 degrees, red is at 0 volts/zero degrees. The average of +5 and zero is 2.5 volts.\r\nThe important thing to take away from the info above is that the amplitude of an oscillator created by mixing two similar oscillators is relative to the difference in phase of the two source waves.\r\nIn fig. 3 the oscillators have identical frequencies. This means that the phase relationship once established will remain the same and the resulting averaged amplitude of the two waves will also remain the same.\r\n<strong>Q: What will happen if the frequencies of your two waves are NOT identical? </strong>\r\nWe established above that the amplitude of the averaged waveform is relative to the phase difference of the two wave forms, therefore as the phase difference of two waves increases and decreases so too will the averaged waveforms’ amplitude. What we have here is phase controlled amplitude modulation and the rate of phase modulation is controlled by the frequency difference between your two oscillators.\r\nIn fig. 4 the blue oscillator has a frequency of 10 Hz, the red is 11Hz. That means that it takes the red wave 1/10<sup>th</sup> of a second longer to complete a cycle than the blue wave. You can see that with each cycle the red wave lags a little bit further behind the blue wave which increases the phase difference between the two. As a result, the amplitude of the averaged wave (green) decreases as the phase offset approaches 180 degrees and then increases as it continues past 180 to 360 degrees.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/phaseModulation.jpg\"><img class=\"alignnone size-large wp-image-1644\" title=\"PhaseModulation\" src=\"http://casperelectronics.com/wp-content/uploads/phaseModulation-460x202.jpg\" alt=\"\" width=\"460\" height=\"202\" /></a><a href=\"http://casperelectronics.com/wp-content/uploads/phase_modulation2.jpg\"><img class=\"alignnone size-large wp-image-1645\" title=\"Phase Modulation2\" src=\"http://casperelectronics.com/wp-content/uploads/phase_modulation2-460x220.jpg\" alt=\"\" width=\"460\" height=\"220\" /></a><a name=\"sec2\"></a><span style=\"color: #33cccc;\">Figure 4. Phase controlled amplitude</span>\r\n<h3><a name=\"2.1\"></a></h3>\r\nThis phenomenon of phase controlled amplitude is something many musicians use without even realizing it. This is the vary trick one uses when tuning a guitar. You tune one string to the other until the “beatingâ€ effect slows and eventually disappears.\r\n<h3><strong>SECTION 2. NOVADRONE OSCILLATORS</strong></h3>\r\n<h3 style=\"padding-left: 30px;\"><strong><span style=\"text-decoration: underline;\">2.1 The circuit</span> </strong></h3>\r\n&nbsp;\r\n\r\nThe NovaDrone contains 6 oscillators. Each oscillator outputs a square wave and a triangle wave.\r\n<span style=\"text-decoration: underline;\"><a name=\"schematic\"></a></span>The circuit which generates the oscillators is clean, simple and robust. They are generated using a remarkable device called an <strong>op amp</strong>. If you are interested in building synthesizers and don’t know where to start, read up on <strong>op amps</strong>. They are the key elements of most oscillators, filters, envelope generators, mixers and amps.\r\n<p style=\"padding-left: 30px;\"><span style=\"text-decoration: underline;\"><strong>Schematic</strong></span></p>\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/OSC2rc.jpg\"><img class=\"alignleft\" title=\"OSC2rc\" src=\"http://casperelectronics.com/wp-content/uploads/OSC2rc-200x163.jpg\" alt=\"\" width=\"200\" height=\"163\" /></a>­­Each channel of the NovaDrone (Red, green and blue) has 2 oscillators. These are shown in fig. 5 and <a name=\"feedbackloops\"></a>fig. 6. They are very similar to one another but have been calibrated for different purposes.\r\n<strong>Osc 1</strong> is an audio frequency oscillator. It has a coarse and fine tune adjustment and only operates at audible frequencies (20Hz-20kHz).\r\n<strong>Osc 2</strong> is calibrated as a low frequency oscillator (LFO) with cycles as long as 2 minutes. It has a range switch and a single adjustment knob.\r\n<p style=\"padding-left: 30px;\"><span style=\"text-decoration: underline;\"><strong>Feedback loops</strong></span></p>\r\nThe oscillator circuit is a feedback loop between two op amps that are <a href=\"http://casperelectronics.com/wp-content/uploads/OSC1rc.jpg\"><img class=\"alignleft\" title=\"OSC1rc\" src=\"http://casperelectronics.com/wp-content/uploads/OSC1rc-200x170.jpg\" alt=\"\" width=\"200\" height=\"170\" /></a>configured as a <strong>schmitt trigger</strong> and an <strong>inverting integrator</strong>.\r\nBasically an <em>integrator</em> turns square waves into triangle waves.\r\nA <em>Schmitt trigger</em> is a kind of comparator that turns modulating signals (like triangle waves) into square waves.\r\nThe key elements of the relationship between these two circuits is that they form a loop (Schmitt &gt; integrator &gt;Schmitt&gt;integrator&gt; etc…) and that the integrator is also an <strong>inverter</strong>. This creates a continuous cycle of modulation:\r\n1) Schmitt output goes HI.\r\n2) Integrator inverts Schmitt signal and outputs slope going down (LOW).\r\n3) When slope is near zero volts, Schmitt trigger is thrown and its’ output goes LOW.\r\n4) Integrator inverts and generates upward slope (HI).\r\n5) When integrator slope reaches peak, Schmitt trigger is thrown and output goes HI.\r\n<a name=\"rctimeconstant\"></a>6) etc……\r\nThis is an overly simplified explanation but enough for our purposes. Do more research on these valuable circuits once you are familiar with some of the basics of op-amps.\r\n<strong><span style=\"text-decoration: underline;\">RC (resistor capacitor)time constant</span></strong>\r\nIn both oscillators (fig. 5 and 6) the primary element which defines frequency is the <strong>RC time constant</strong>. This relationship is a core component of most oscillators and is worth reading up on.\r\n\r\nThe RC time constant is a period of time defined by the relationship between a resistor and a capacitor.\r\nThe equation for this is simply <strong>t =</strong> <strong>R*C</strong>. In the case of the oscillators above it would be <strong>t=R1*C1</strong>.\r\nUnfortunately calculating the frequency of an oscillator is more complicated than just calculating your RC constant.\r\nIn many oscillators (including this one) there is a schmitt trigger component which watches the rising or sinking voltage from the integrator. The Schmitt trigger activates when the slope reaches predefined upper and lower limits. In order to determine the frequency of an oscillator we need to know what our upper and lower limits are and then calculate how long it takes our wave (the output of the integrator) to travel from one limit to the other.\r\nThese limits are determined by the relationship of 2 resistors in the schmitt stage. In fig 5 and 6 these are R2 and R3.\r\nThe equation for determining the duration of one cycle is\r\n(1/4R1C1)*(R3/R4)\r\nIn Oscillator 2 <strong>R</strong><strong>1</strong> is a 500k potentiometer in series with a 4.7k resistor between pins 8 and 13 of the two op amps. <strong>C</strong><strong>1</strong> is one of the three capacitors between pins 13 and 14 of the rightmost op amp. One of these caps is selected using a three way switch on the NovaDrone circuit board. This controls the frequency range of the LFO.\r\nLet’s say the pot is all the way up (full resistance) and the middle cap has been selected. The equations for RC and subsequently the frequency is:\r\n<strong>R1=504,700 Ohms</strong>\r\n<a name=\"howitworks\"></a><strong>C1= .000022 Farads</strong>\r\n<strong>R2 = 8,300 Ohms</strong>\r\n<strong>R3 = 10,000 Ohms</strong>\r\n<strong>Frequency in Hz = (1 / 4*R</strong><strong>1C</strong><strong>1) * (R</strong><strong>3/R</strong><strong>2)</strong>\r\n<p style=\"padding-left: 30px;\"><span style=\"text-decoration: underline;\"><strong>How it works</strong></span></p>\r\nResistors limit the flow of current and capacitors store current. Current flows through the resistor and is stored in the capacitor. The resistor controls how much current flows into the capacitor per second. Therefore the size of capacitor and the amount of resistance will determine how long it takes to fill the capacitor. A common analogy is to think about current flow as water, the resistor as a spigot\r\n<h3><a name=\"2.2\"></a></h3>\r\nand the capacitor as a cup. The more you open the spigot (reduce resistance), the more water (electrical current) will flow and the faster the cup will fill (capacitor will charge). The oscillator circuit is configured in a special way which causes the capacitor to continuously charge and discharge. It is looking for two states from the cap, fully charged or fully discharged. When the cap reaches either of these states, the whole circuit reverses polarity and the capacitors charge status begins moving toward the opposite state. The amount of time it takes to charge and discharge is your cycle duration.\r\n<p style=\"padding-left: 30px;\"><span style=\"text-decoration: underline;\"><strong>2.2 pulse width modulation (pwm)</strong></span></p>\r\nPWM is exciting stuff….really! It is essentially a <strong>1 bit digital</strong> representation of an <strong>analog</strong> wave form.\r\nDigital wave forms only have 2 states, <strong>high</strong> and <strong>low</strong>. <strong>High</strong> is a voltage <em>at</em> or very close to the positive supply voltage. <strong>Low</strong> is a voltage <em>at</em> or very close to the negative supply voltage. It is basically just a square wave. Analog on the other hand is infinitely variable. Think about it like the difference between a light switch (digital) and a light dimmer (analog). PWM is a wave form that bridges the gap between these two formats. It can be used to make sound, control the brightness of an LED, control the speed of high torque motors and speak to microprocessors. It is also the language that a microprocessor will use to speak with the analog world.\r\nPulse Width (PW) refers to the relative durations of high and low voltage in a single <strong>cycle</strong> of a square wave.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/pulsewidth.jpg\"><img class=\"alignnone size-large wp-image-1648\" title=\"Pulsewidth\" src=\"http://casperelectronics.com/wp-content/uploads/pulsewidth-460x214.jpg\" alt=\"\" width=\"460\" height=\"214\" /></a><span style=\"color: #33cccc;\">Figure 7. Pulse width</span>\r\nFig. 7 shows three square wave oscillators of the same amplitude and frequency but with differing <strong>pulse width</strong>. The red oscillator has a 10% pulse width. That means the wave goes high for 10 % of the duration of one cycle. The green wave is 50% and the purple wave is 90%. What is important to note is that pulse width has nothing to do with frequency and only refers to the relationship between the high and low swing of the wave.\r\n<p style=\"padding-left: 30px;\"><strong><span style=\"text-decoration: underline;\">The Comparator</span></strong></p>\r\nThe job of a comparator is simple. Two signals are fed into the “+â€ and “-“ inputs (labeled 10 and 9 in fig. 8 respectively). If the voltage at the “+â€ input is <em>higher</em> than the “-“ input the output of the comparator goes <strong>high</strong>.<strong> </strong>If the “+â€ input drops below the “-“ input the output goes <strong>low</strong>.\r\nIn the NovaDrone t<a href=\"http://casperelectronics.com/wp-content/uploads/comparator.jpg\"><img class=\"alignleft\" title=\"Comparator\" src=\"http://casperelectronics.com/wp-content/uploads/comparator-200x76.jpg\" alt=\"\" width=\"200\" height=\"76\" /></a>he triangle output of Osc 1 and Osc 2 combine through a simple comparator (fig. 8) to make a single square wave with a modulating pulse width. In this way, the comparator also functions as a pulse width modulation processor.\r\n\r\nFig. 9 below shows how two triangle waves are transformed through the comparator into a square wave with a modulating pulse width.\r\nThe blue triangle wave in fig. 9 is oscillator 1. The red triangle is osc 2. The green line is the combined PWM output.\r\nAny time the blue line (osc 1) is above the red line (osc 2), the green line (pwm) goes high. As the red line rises the percentage of each cycle that the blue line is above the red line decreases. This changing percentage is what makes our modulating pulse width effect.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/PWM3-copy.jpg\"><img class=\"alignnone size-large wp-image-1647\" title=\"PWM3 Copy\" src=\"http://casperelectronics.com/wp-content/uploads/PWM3-copy-460x202.jpg\" alt=\"\" width=\"460\" height=\"202\" /></a><span style=\"color: #33cccc;\">Figure 9. Pulse width modulation detail</span>\r\n<p style=\"padding-left: 30px;\"><strong><span style=\"text-decoration: underline;\">Mixer</span></strong></p>\r\nThe audio signals from each of the three channels of the NovaDrone are mixed using the circuit in fig. 10.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/mixer.jpg\"><img class=\"alignleft\" title=\"Mixer\" src=\"http://casperelectronics.com/wp-content/uploads/mixer-200x135.jpg\" alt=\"\" width=\"200\" height=\"135\" /></a>This mixer is nice and simple and uses just one <strong>op amp</strong> and a few other components. This circuit is configured as an inverting mixer with an amplitude controlled by the <strong>feedback resistor</strong> and <strong>input resistors</strong>. The amplitude is calculated as RF/RI. In this case RF = 10,000 and RI = 100,000. That means the output signal is 1/10<sup>th</sup> the amplitude of the input signal.\r\n<strong><span style=\"text-decoration: underline;\">\r\n</span></strong>\r\n<p style=\"padding-left: 30px;\"><strong><span style=\"text-decoration: underline;\">LED drivers</span></strong></p>\r\n(3) 2N3904 NPN transistors are used to make 3 LED drivers.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/LEDdriver.jpg\"><img class=\"alignleft\" title=\"LEDdriver\" src=\"http://casperelectronics.com/wp-content/uploads/LEDdriver-200x108.jpg\" alt=\"\" width=\"200\" height=\"108\" /></a>A driver is a simple but important circuit which isolates elements which use lots of current (like LEDs) from sensitive circuits (like the oscillators in the NovaDrone). Failure to use a driver can result in something called a <strong>loading effect</strong> which basically means that the device being driven will affect the behavior of the rest of the circuit in bad ways, like the pitch changing when the lights turn on. The LED in the NovaDrone uses a lot of current relative to the rest of the circuit (90mA vs around 30mA for the rest of the circuit) therefore a driver is necessary. The key component of a driver is the <strong>transistor</strong>. This is another topic worth reading a lot about\r\n.\r\n\r\n</div>','NovaDrone Tech Manual',0,'','inherit','open','closed','','1704-revision-10','','','2012-11-05 15:31:47','2012-11-05 20:31:47','',1704,'http://casperelectronics.com/2012/11/05/1704-revision-10/',0,'revision','',0),(1713,2,'2012-11-05 15:22:21','2012-11-05 20:22:21','Throughout this guide I will attempt to give you some insight into the circuit theory and scientific principles at play in the NovaDrone. That said I will be giving little more than an intro to each topic and strongly encourage you to do further reading on topics you find interesting.\r\n<ul>\r\n	<li>This is a beta version of the <strong>NovaDrone Technical Guide</strong>. I expect to make revisions over time and eagerly encourage readers to send me feedback, questions, suggestions and especially corrections. Comments should be addressed to <a href=\"mailto:pete@casperelectronics.com\"><strong>pete@casperelectronics.com</strong></a>.</li>\r\n</ul>\r\n<h3 style=\"text-align: center;\"><span style=\"color: #000000;\"><strong>TABLE OF CONTENTS:</strong></span></h3>\r\n<a href=\"#sec1\"><strong><span style=\"text-decoration: underline;\">Section 1. Oscillator Primer</span></strong></a>\r\n<ul>\r\n	<li><a href=\"#1.1\"><strong>1.1 Frequency, amplitude &amp; wave shape</strong></a>\r\n<ul>\r\n	<li><a href=\"#frequency\">Frequency</a></li>\r\n	<li><a href=\"#amplitude\">Amplitude</a></li>\r\n	<li><a href=\"#waveshape\"> Wave shape</a></li>\r\n	<li><a href=\"#review\"> Review<strong></strong></a></li>\r\n</ul>\r\n</li>\r\n	<li><a href=\"#1.2\"><strong>1.2 Phase</strong></a>\r\n<ul>\r\n	<li><a href=\"#phase\"> Phase controlled amplitude modulation</a></li>\r\n</ul>\r\n</li>\r\n</ul>\r\n<a href=\"#sec2\"><strong><span style=\"text-decoration: underline;\">Section 2. NovaDrone Oscillators</span></strong></a>\r\n<ul>\r\n	<li><a href=\"#2.1\"><strong>2.1 The Circuit</strong></a>\r\n<ul>\r\n	<li><a href=\"#feedbackloops\"> Feedback loops</a></li>\r\n	<li><a href=\"#schematic\"> Schematic</a></li>\r\n	<li><a href=\"#rctimeconstant\"> RC time constant</a></li>\r\n	<li><a href=\"#howitworks\"> How it works<strong></strong></a></li>\r\n</ul>\r\n</li>\r\n	<li><a href=\"#2.2\"><strong>2.2 Pulse Width Modulation</strong></a>\r\n<ul>\r\n	<li><a href=\"#comparator\">The comparator<strong></strong></a></li>\r\n</ul>\r\n</li>\r\n</ul>\r\n<a name=\"sec1\"></a><a name=\"1.1\"></a><a href=\"#sec3\"><strong><span style=\"text-decoration: underline;\">Sectio</span></strong></a><a href=\"#sec3\"><strong><span style=\"text-decoration: underline;\">n 3. Drivers and Mixers </span>*incomplete*</strong></a>\r\n<ul>\r\n	<li><a href=\"#led\"> LED driver</a></li>\r\n	<li><a href=\"#mixer\">Signal mixer</a><strong></strong></li>\r\n</ul>\r\n<strong>SECTION 1. OSCILLATOR PRIMER <strong></strong></strong>\r\n<blockquote>\r\n<ul>\r\n	<li><span style=\"text-decoration: underline;\"><strong><strong>1.1 Frequency, amplitude and wave shape</strong></strong></span></li>\r\n</ul>\r\n</blockquote>\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/ampandfreq.jpg\"><img class=\"alignleft size-medium wp-image-1636\" title=\"Ampandfreq\" src=\"http://casperelectronics.com/wp-content/uploads/ampandfreq-200x242.jpg\" alt=\"\" width=\"200\" height=\"242\" /></a>\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/casper/spacer1.jpg\"><img src=\"http://casperelectronics.com/wp-content/uploads/casper/spacer1.jpg\" alt=\"\" title=\"spacer\" width=\"200\" height=\"100\" class=\"alignleft size-full wp-image-1302\" /></a>The heart of the NovaDrone is a bank of six independent oscillators.\r\n\r\nAn oscillator is simply a pattern which repeats indefinitely. This can be a pattern of light, movement, electricity, even life cycles of organisms. The <a href=\"http://en.wikipedia.org/wiki/Oscillation\">wikipedia entry</a> gives dozens of examples of different kinds of oscillation.\r\n\r\nWhat we are most interested in is the modulation (changing amplitude) of electricity. All of the electrically produced sound we hear is a repeating pattern of fluctuating electrical current. When this is applied to a speaker, the current activates a coil in the speaker which pushes the cone of the speaker away from or <a href=\"http://casperelectronics.com/wp-content/uploads/casper/spacer1.jpg\"><img class=\"alignright size-full wp-image-1302\" title=\"spacer\" src=\"http://casperelectronics.com/wp-content/uploads/casper/spacer1.jpg\" alt=\"\" width=\"460\" height=\"10\" /></a>towards a fixed magnet. This action vibrates the air in front of the speaker which in turn vibrates the air in front of that and so on until that vibrations hit our ear drums and are perceived as sound. The sounds we hear          around us are all incredibly complex patterns of air pressure modulation.\r\n\r\nFigure 1. triangle oscillator\r\n<ul>\r\n	<li>The red line in fig 1 represents a voltage which goes up and down over a period of time. This is an oscillator.</li>\r\n</ul>\r\nThere are three basic factors that make up all oscillators: <a name=\"frequency\"></a><strong>frequency</strong>, <strong>amplitude</strong> and <strong>wave shape</strong>. In musical terms we would call these <strong>pitch</strong>, <strong>volume</strong> and <strong>timbre</strong>. I will also talk a fair amount about <strong>phase </strong>which is relevant when working with multiple oscillators and plays an important role in creating drones.\r\n\r\n&nbsp;\r\n<blockquote>\r\n<ul>\r\n	<li><span style=\"text-decoration: underline;\"><strong>Frequency</strong></span></li>\r\n</ul>\r\n</blockquote>\r\nOne complete sweep up and down is called a <strong>cycle</strong>. The number of cycles per second is your <strong>Frequency</strong> or <strong>Pitch</strong>.<strong></strong>\r\n<strong>Frequency</strong> is commonly measured in <strong>Hertz</strong>, which is the number of cycles per second.\r\n<a name=\"amplitude\"></a><strong>Pitch</strong> is another term for frequency which is used <span style=\"text-decoration: underline;\">only</span> when referring to the frequency of an audio signal.\r\nFigure 1 shows a triangle wave with a cycle length of .5 seconds. The frequency of this wave would be determined by seeing how many cycles will occur in 1 second. In this case there are 2 complete cycles in 1 second. That means the wave has a frequency of 2 Hertz. This is well below the hearing range. Humans can hear oscillators between 20Hz and 20,000 Hz.\r\n<blockquote>\r\n<ul>\r\n	<li><span style=\"text-decoration: underline;\"><strong>Amplitude</strong></span></li>\r\n</ul>\r\n</blockquote>\r\nAmplitude refers to the magnitude of voltage change across one cycle of an oscillation.\r\n<a name=\"waveshape\"></a>This in turn impacts the volume of the signal if it is sent to a speaker.\r\nThe image above shows a triangle wave with a positive peak of +5 volts and a negative peak of -5 volts. The amplitude is determined by figuring the absolute difference between these peaks. In this case that difference is 10 volts. This is commonly referred to as 10 Vpk-pk (10 volts peak to peak). There are many different ways to measure amplitude (pk-pk, RMS, Vp, etc…) but we’ll just be talking about Vpk-pk.<a href=\"http://casperelectronics.com/wp-content/uploads/waveshapes.png\"><img class=\"alignright\" title=\"Waveshapes\" src=\"http://casperelectronics.com/wp-content/uploads/waveshapes-200x160.png\" alt=\"\" width=\"292\" height=\"233\" /></a>\r\n<ul>\r\n	<li><span style=\"text-decoration: underline;\"><strong>Wave shape</strong></span></li>\r\n</ul>\r\nThe wave shape is the pattern of amplitude modulation over the course of a cycle.\r\nThe waveforms in fig 2 are: Sine, ramp, triangle and square.\r\nSine, triangle and square are the most common and are all symmetrical waves. That means the positive and negative portions of each cycle are of the same duration. Many musical synthesizers offer other wave forms which are asymmetrical versions of these common waves such as ramp, saw, and pulse waves.\r\nThe importance and impact of wave shape depends on its application. Many audio effects such as <strong>tremolo</strong> or <strong>phaser</strong> use low frequency oscillators (LFOs) to modulate certain parameters of the sound. It is commonly more desirable to use a sine or triangle wave for many of these effects such as the tremolo which <span style=\"color: #33cccc;\">Figure 2. Waveshapes</span>\r\n<a name=\"review\"></a>fades the volume in and out. Using a square wave for this would create dramatic shifts in volume which can be unpleasant.\r\nMany natural sounds are synthesized using overlapping wave forms like those shown above. For instance a flute can be synthesized using several octaves of a sine wave. A horn on the other hand will use more square waves and maybe a triangle or saw wave. More advanced wave and synthesis theory sites the sine wave as the basis of all wave forms. It is shown how even square waves can be created by combining several sine waves.\r\n<p style=\"padding-left: 30px;\"><span style=\"text-decoration: underline;\"><strong>Review</strong></span></p>\r\nThe basic components of an oscillator are:\r\n<h3><a name=\"1.2\"></a></h3>\r\n<strong>Frequency</strong>. The number of oscillation cycles that occur in one second. Measured in Hz\r\n<strong>Amplitude</strong>. Magnitude of voltage sweep in one cycle of an oscillator. Measured in Volts or Vpk-pk (volts peak to peak)\r\n<strong>Wave shape</strong>. Sine, triangle, square\r\n<p style=\"padding-left: 30px;\"><strong><span style=\"text-decoration: underline;\">1.2 Phase</span></strong></p>\r\nPhase is a bit more complicated than the other terms but plays an important role in audio circuitry and especially in making drones. Phase refers to a particular position in a <span style=\"text-decoration: underline;\">single cycle</span> of a wave (such as the positive or negative peak) and is measured in degrees. It is most commonly used to describe the relationship between multiple waves.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/phasedegrees.jpg\"><img class=\"alignnone size-large wp-image-1643\" title=\"Phasedegrees\" src=\"http://casperelectronics.com/wp-content/uploads/phasedegrees-460x236.jpg\" alt=\"\" width=\"460\" height=\"236\" /></a><span style=\"color: #33cccc;\">Figure 3. Phase</span>\r\nFig. 3 shows two sine waves (red &amp; blue) of identical amplitude and frequency. The green oscillator is the mix or <em>average</em> of the red and blue oscillators.\r\nPhase is measured in degrees with 360 degrees being one complete cycle. 180 degrees is exactly ½ of a cycle.\r\nIn fig. 3 the phase of the blue oscillator is offset at 45 degree increments from the red oscillator from left to right. With each step you’ll notice that the waves get farther apart and that the amplitude of the green (average) oscillator decreases.\r\nThis may seem confusing at first but it’s really quite simple. The green oscillator is the average of the red and blue oscillators. Let’s say the red and blue oscillators sweep from -5 to +5VDC (10Vp-p). Now look at the right most illustration of the 2 waves out of phase by 180 degrees. When the blue wave is at its positive peak (90 degrees) of +5 volts, the red wave is at it’s negative peak (270 degrees) of -5 volts.\r\nWhat is the average of -5 and +5? Zero. They are always going to be the opposites of each other so the average will always be zero. Now look at the 90 degree image. When Blue is at +5 volts/90 degrees, red is at 0 volts/zero degrees. The average of +5 and zero is 2.5 volts.\r\nThe important thing to take away from the info above is that the amplitude of an oscillator created by mixing two similar oscillators is relative to the difference in phase of the two source waves.\r\nIn fig. 3 the oscillators have identical frequencies. This means that the phase relationship once established will remain the same and the resulting averaged amplitude of the two waves will also remain the same.\r\n<strong>Q: What will happen if the frequencies of your two waves are NOT identical? </strong>\r\nWe established above that the amplitude of the averaged waveform is relative to the phase difference of the two wave forms, therefore as the phase difference of two waves increases and decreases so too will the averaged waveforms’ amplitude. What we have here is phase controlled amplitude modulation and the rate of phase modulation is controlled by the frequency difference between your two oscillators.\r\nIn fig. 4 the blue oscillator has a frequency of 10 Hz, the red is 11Hz. That means that it takes the red wave 1/10<sup>th</sup> of a second longer to complete a cycle than the blue wave. You can see that with each cycle the red wave lags a little bit further behind the blue wave which increases the phase difference between the two. As a result, the amplitude of the averaged wave (green) decreases as the phase offset approaches 180 degrees and then increases as it continues past 180 to 360 degrees.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/phaseModulation.jpg\"><img class=\"alignnone size-large wp-image-1644\" title=\"PhaseModulation\" src=\"http://casperelectronics.com/wp-content/uploads/phaseModulation-460x202.jpg\" alt=\"\" width=\"460\" height=\"202\" /></a><a href=\"http://casperelectronics.com/wp-content/uploads/phase_modulation2.jpg\"><img class=\"alignnone size-large wp-image-1645\" title=\"Phase Modulation2\" src=\"http://casperelectronics.com/wp-content/uploads/phase_modulation2-460x220.jpg\" alt=\"\" width=\"460\" height=\"220\" /></a><a name=\"sec2\"></a><span style=\"color: #33cccc;\">Figure 4. Phase controlled amplitude</span>\r\n<h3><a name=\"2.1\"></a></h3>\r\nThis phenomenon of phase controlled amplitude is something many musicians use without even realizing it. This is the vary trick one uses when tuning a guitar. You tune one string to the other until the “beatingâ€ effect slows and eventually disappears.\r\n<h3><strong>SECTION 2. NOVADRONE OSCILLATORS</strong></h3>\r\n<h3 style=\"padding-left: 30px;\"><strong><span style=\"text-decoration: underline;\">2.1 The circuit</span> </strong></h3>\r\n&nbsp;\r\n\r\nThe NovaDrone contains 6 oscillators. Each oscillator outputs a square wave and a triangle wave.\r\n<span style=\"text-decoration: underline;\"><a name=\"schematic\"></a></span>The circuit which generates the oscillators is clean, simple and robust. They are generated using a remarkable device called an <strong>op amp</strong>. If you are interested in building synthesizers and don’t know where to start, read up on <strong>op amps</strong>. They are the key elements of most oscillators, filters, envelope generators, mixers and amps.\r\n<p style=\"padding-left: 30px;\"><span style=\"text-decoration: underline;\"><strong>Schematic</strong></span></p>\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/OSC2rc.jpg\"><img class=\"alignleft\" title=\"OSC2rc\" src=\"http://casperelectronics.com/wp-content/uploads/OSC2rc-200x163.jpg\" alt=\"\" width=\"200\" height=\"163\" /></a>­­Each channel of the NovaDrone (Red, green and blue) has 2 oscillators. These are shown in fig. 5 and <a name=\"feedbackloops\"></a>fig. 6. They are very similar to one another but have been calibrated for different purposes.\r\n<strong>Osc 1</strong> is an audio frequency oscillator. It has a coarse and fine tune adjustment and only operates at audible frequencies (20Hz-20kHz).\r\n<strong>Osc 2</strong> is calibrated as a low frequency oscillator (LFO) with cycles as long as 2 minutes. It has a range switch and a single adjustment knob.\r\n<p style=\"padding-left: 30px;\"><span style=\"text-decoration: underline;\"><strong>Feedback loops</strong></span></p>\r\nThe oscillator circuit is a feedback loop between two op amps that are <a href=\"http://casperelectronics.com/wp-content/uploads/OSC1rc.jpg\"><img class=\"alignleft\" title=\"OSC1rc\" src=\"http://casperelectronics.com/wp-content/uploads/OSC1rc-200x170.jpg\" alt=\"\" width=\"200\" height=\"170\" /></a>configured as a <strong>schmitt trigger</strong> and an <strong>inverting integrator</strong>.\r\nBasically an <em>integrator</em> turns square waves into triangle waves.\r\nA <em>Schmitt trigger</em> is a kind of comparator that turns modulating signals (like triangle waves) into square waves.\r\nThe key elements of the relationship between these two circuits is that they form a loop (Schmitt &gt; integrator &gt;Schmitt&gt;integrator&gt; etc…) and that the integrator is also an <strong>inverter</strong>. This creates a continuous cycle of modulation:\r\n1) Schmitt output goes HI.\r\n2) Integrator inverts Schmitt signal and outputs slope going down (LOW).\r\n3) When slope is near zero volts, Schmitt trigger is thrown and its’ output goes LOW.\r\n4) Integrator inverts and generates upward slope (HI).\r\n5) When integrator slope reaches peak, Schmitt trigger is thrown and output goes HI.\r\n<a name=\"rctimeconstant\"></a>6) etc……\r\nThis is an overly simplified explanation but enough for our purposes. Do more research on these valuable circuits once you are familiar with some of the basics of op-amps.\r\n<strong><span style=\"text-decoration: underline;\">RC (resistor capacitor)time constant</span></strong>\r\nIn both oscillators (fig. 5 and 6) the primary element which defines frequency is the <strong>RC time constant</strong>. This relationship is a core component of most oscillators and is worth reading up on.\r\n\r\nThe RC time constant is a period of time defined by the relationship between a resistor and a capacitor.\r\nThe equation for this is simply <strong>t =</strong> <strong>R*C</strong>. In the case of the oscillators above it would be <strong>t=R1*C1</strong>.\r\nUnfortunately calculating the frequency of an oscillator is more complicated than just calculating your RC constant.\r\nIn many oscillators (including this one) there is a schmitt trigger component which watches the rising or sinking voltage from the integrator. The Schmitt trigger activates when the slope reaches predefined upper and lower limits. In order to determine the frequency of an oscillator we need to know what our upper and lower limits are and then calculate how long it takes our wave (the output of the integrator) to travel from one limit to the other.\r\nThese limits are determined by the relationship of 2 resistors in the schmitt stage. In fig 5 and 6 these are R2 and R3.\r\nThe equation for determining the duration of one cycle is\r\n(1/4R1C1)*(R3/R4)\r\nIn Oscillator 2 <strong>R</strong><strong>1</strong> is a 500k potentiometer in series with a 4.7k resistor between pins 8 and 13 of the two op amps. <strong>C</strong><strong>1</strong> is one of the three capacitors between pins 13 and 14 of the rightmost op amp. One of these caps is selected using a three way switch on the NovaDrone circuit board. This controls the frequency range of the LFO.\r\nLet’s say the pot is all the way up (full resistance) and the middle cap has been selected. The equations for RC and subsequently the frequency is:\r\n<strong>R1=504,700 Ohms</strong>\r\n<a name=\"howitworks\"></a><strong>C1= .000022 Farads</strong>\r\n<strong>R2 = 8,300 Ohms</strong>\r\n<strong>R3 = 10,000 Ohms</strong>\r\n<strong>Frequency in Hz = (1 / 4*R</strong><strong>1C</strong><strong>1) * (R</strong><strong>3/R</strong><strong>2)</strong>\r\n<p style=\"padding-left: 30px;\"><span style=\"text-decoration: underline;\"><strong>How it works</strong></span></p>\r\nResistors limit the flow of current and capacitors store current. Current flows through the resistor and is stored in the capacitor. The resistor controls how much current flows into the capacitor per second. Therefore the size of capacitor and the amount of resistance will determine how long it takes to fill the capacitor. A common analogy is to think about current flow as water, the resistor as a spigot\r\n<h3><a name=\"2.2\"></a></h3>\r\nand the capacitor as a cup. The more you open the spigot (reduce resistance), the more water (electrical current) will flow and the faster the cup will fill (capacitor will charge). The oscillator circuit is configured in a special way which causes the capacitor to continuously charge and discharge. It is looking for two states from the cap, fully charged or fully discharged. When the cap reaches either of these states, the whole circuit reverses polarity and the capacitors charge status begins moving toward the opposite state. The amount of time it takes to charge and discharge is your cycle duration.\r\n<p style=\"padding-left: 30px;\"><span style=\"text-decoration: underline;\"><strong>2.2 pulse width modulation (pwm)</strong></span></p>\r\nPWM is exciting stuff….really! It is essentially a <strong>1 bit digital</strong> representation of an <strong>analog</strong> wave form.\r\nDigital wave forms only have 2 states, <strong>high</strong> and <strong>low</strong>. <strong>High</strong> is a voltage <em>at</em> or very close to the positive supply voltage. <strong>Low</strong> is a voltage <em>at</em> or very close to the negative supply voltage. It is basically just a square wave. Analog on the other hand is infinitely variable. Think about it like the difference between a light switch (digital) and a light dimmer (analog). PWM is a wave form that bridges the gap between these two formats. It can be used to make sound, control the brightness of an LED, control the speed of high torque motors and speak to microprocessors. It is also the language that a microprocessor will use to speak with the analog world.\r\nPulse Width (PW) refers to the relative durations of high and low voltage in a single <strong>cycle</strong> of a square wave.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/pulsewidth.jpg\"><img class=\"alignnone size-large wp-image-1648\" title=\"Pulsewidth\" src=\"http://casperelectronics.com/wp-content/uploads/pulsewidth-460x214.jpg\" alt=\"\" width=\"460\" height=\"214\" /></a><span style=\"color: #33cccc;\">Figure 7. Pulse width</span>\r\nFig. 7 shows three square wave oscillators of the same amplitude and frequency but with differing <strong>pulse width</strong>. The red oscillator has a 10% pulse width. That means the wave goes high for 10 % of the duration of one cycle. The green wave is 50% and the purple wave is 90%. What is important to note is that pulse width has nothing to do with frequency and only refers to the relationship between the high and low swing of the wave.\r\n<p style=\"padding-left: 30px;\"><strong><span style=\"text-decoration: underline;\">The Comparator</span></strong></p>\r\nThe job of a comparator is simple. Two signals are fed into the “+â€ and “-“ inputs (labeled 10 and 9 in fig. 8 respectively). If the voltage at the “+â€ input is <em>higher</em> than the “-“ input the output of the comparator goes <strong>high</strong>.<strong> </strong>If the “+â€ input drops below the “-“ input the output goes <strong>low</strong>.\r\nIn the NovaDrone t<a href=\"http://casperelectronics.com/wp-content/uploads/comparator.jpg\"><img class=\"alignleft\" title=\"Comparator\" src=\"http://casperelectronics.com/wp-content/uploads/comparator-200x76.jpg\" alt=\"\" width=\"200\" height=\"76\" /></a>he triangle output of Osc 1 and Osc 2 combine through a simple comparator (fig. 8) to make a single square wave with a modulating pulse width. In this way, the comparator also functions as a pulse width modulation processor.\r\n\r\nFig. 9 below shows how two triangle waves are transformed through the comparator into a square wave with a modulating pulse width.\r\nThe blue triangle wave in fig. 9 is oscillator 1. The red triangle is osc 2. The green line is the combined PWM output.\r\nAny time the blue line (osc 1) is above the red line (osc 2), the green line (pwm) goes high. As the red line rises the percentage of each cycle that the blue line is above the red line decreases. This changing percentage is what makes our modulating pulse width effect.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/PWM3-copy.jpg\"><img class=\"alignnone size-large wp-image-1647\" title=\"PWM3 Copy\" src=\"http://casperelectronics.com/wp-content/uploads/PWM3-copy-460x202.jpg\" alt=\"\" width=\"460\" height=\"202\" /></a><span style=\"color: #33cccc;\">Figure 9. Pulse width modulation detail</span>\r\n<p style=\"padding-left: 30px;\"><strong><span style=\"text-decoration: underline;\">Mixer</span></strong></p>\r\nThe audio signals from each of the three channels of the NovaDrone are mixed using the circuit in fig. 10.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/mixer.jpg\"><img class=\"alignleft\" title=\"Mixer\" src=\"http://casperelectronics.com/wp-content/uploads/mixer-200x135.jpg\" alt=\"\" width=\"200\" height=\"135\" /></a>This mixer is nice and simple and uses just one <strong>op amp</strong> and a few other components. This circuit is configured as an inverting mixer with an amplitude controlled by the <strong>feedback resistor</strong> and <strong>input resistors</strong>. The amplitude is calculated as RF/RI. In this case RF = 10,000 and RI = 100,000. That means the output signal is 1/10<sup>th</sup> the amplitude of the input signal.\r\n<strong><span style=\"text-decoration: underline;\">\r\n</span></strong>\r\n<p style=\"padding-left: 30px;\"><strong><span style=\"text-decoration: underline;\">LED drivers</span></strong></p>\r\n(3) 2N3904 NPN transistors are used to make 3 LED drivers.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/LEDdriver.jpg\"><img class=\"alignleft\" title=\"LEDdriver\" src=\"http://casperelectronics.com/wp-content/uploads/LEDdriver-200x108.jpg\" alt=\"\" width=\"200\" height=\"108\" /></a>A driver is a simple but important circuit which isolates elements which use lots of current (like LEDs) from sensitive circuits (like the oscillators in the NovaDrone). Failure to use a driver can result in something called a <strong>loading effect</strong> which basically means that the device being driven will affect the behavior of the rest of the circuit in bad ways, like the pitch changing when the lights turn on. The LED in the NovaDrone uses a lot of current relative to the rest of the circuit (90mA vs around 30mA for the rest of the circuit) therefore a driver is necessary. The key component of a driver is the <strong>transistor</strong>. This is another topic worth reading a lot about.','NovaDrone Tech Manual',0,'','inherit','open','closed','','1704-revision-8','','','2012-11-05 15:22:21','2012-11-05 20:22:21','',1704,'http://casperelectronics.com/2012/11/05/1704-revision-8/',0,'revision','',0),(1720,2,'2012-11-05 15:52:32','2012-11-05 20:52:32','Throughout this guide I will attempt to give you some insight into the circuit theory and scientific principles at play in the NovaDrone. That said I will be giving little more than an intro to each topic and strongly encourage you to do further reading on topics you find interesting.\r\n<ul>\r\n	<li>This is a beta version of the <strong>NovaDrone Technical Guide</strong>. I expect to make revisions over time and eagerly encourage readers to send me feedback, questions, suggestions and especially corrections. Comments should be addressed to <a href=\"mailto:pete@casperelectronics.com\"><strong>pete@casperelectronics.com</strong></a>.</li>\r\n</ul>\r\n<h3 style=\"text-align: center;\"><span style=\"color: #000000;\"><strong>TABLE OF CONTENTS:</strong></span></h3>\r\n<a href=\"#sec1\"><strong><span style=\"text-decoration: underline;\">Section 1. Oscillator Primer</span></strong></a>\r\n<ul>\r\n	<li><a href=\"#1.1\"><strong>1.1 Frequency, amplitude &amp; wave shape</strong></a>\r\n<ul>\r\n	<li><a href=\"#frequency\">Frequency</a></li>\r\n	<li><a href=\"#amplitude\">Amplitude</a></li>\r\n	<li><a href=\"#waveshape\"> Wave shape</a></li>\r\n	<li><a href=\"#review\"> Review<strong></strong></a></li>\r\n</ul>\r\n</li>\r\n	<li><a href=\"#1.2\"><strong>1.2 Phase</strong></a>\r\n<ul>\r\n	<li><a href=\"#phase\"> Phase controlled amplitude modulation</a></li>\r\n</ul>\r\n</li>\r\n</ul>\r\n<a href=\"#sec2\"><strong><span style=\"text-decoration: underline;\">Section 2. NovaDrone Oscillators</span></strong></a>\r\n<ul>\r\n	<li><a href=\"#2.1\"><strong>2.1 The Circuit</strong></a>\r\n<ul>\r\n	<li><a href=\"#feedbackloops\"> Feedback loops</a></li>\r\n	<li><a href=\"#schematic\"> Schematic</a></li>\r\n	<li><a href=\"#rctimeconstant\"> RC time constant</a></li>\r\n	<li><a href=\"#howitworks\"> How it works<strong></strong></a></li>\r\n</ul>\r\n</li>\r\n	<li><a href=\"#2.2\"><strong>2.2 Pulse Width Modulation</strong></a>\r\n<ul>\r\n	<li><a href=\"#comparator\">The comparator<strong></strong></a></li>\r\n</ul>\r\n</li>\r\n</ul>\r\n<a name=\"sec1\"></a><a name=\"1.1\"></a><a href=\"#sec3\"><strong><span style=\"text-decoration: underline;\">Sectio</span></strong></a><a href=\"#sec3\"><strong><span style=\"text-decoration: underline;\">n 3. Drivers and Mixers </span>*incomplete*</strong></a>\r\n<ul>\r\n	<li><a href=\"#led\"> LED driver</a></li>\r\n	<li><a href=\"#mixer\">Signal mixer</a><strong></strong></li>\r\n</ul>\r\n<h2 style=\"text-align: left;\"><span style=\"color: #3366ff;\"><strong>SECTION 1. OSCILLATOR PRIMER</strong></span></h2>\r\n<h2><span style=\"color: #3366ff;\"><strong style=\"text-align: center;\"><strong>◊ 1.1 Frequency, amplitude and wave shape◊</strong></strong></span></h2>\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/ampandfreq.jpg\"><img class=\"alignleft size-medium wp-image-1636\" title=\"Figure 1. A triangle wave oscillator\" src=\"http://casperelectronics.com/wp-content/uploads/ampandfreq-200x242.jpg\" alt=\"\" width=\"200\" height=\"242\" /></a>\r\n<div>\r\n\r\nThe heart of the NovaDrone is a bank of six independent oscillators.\r\n\r\n</div>\r\nAn oscillator is simply a pattern which repeats indefinitely. This can be a pattern of light, movement, electricity, even life cycles of organisms. The <a href=\"http://en.wikipedia.org/wiki/Oscillation\">wikipedia entry</a> gives dozens of examples of different kinds of oscillation.\r\n\r\nWhat we are most interested in is the modulation (changing amplitude) of electricity. All of the electrically produced sound we hear is a repeating pattern of fluctuating electrical current.\r\n\r\n&nbsp;\r\n\r\n<address> </address><address><em><span style=\"color: #33cccc;\">Figure 1. triangle oscillator</span></em></address>When this is applied to a speaker, the current activates a coil in the speaker which pushes the cone of the speaker away from or towards a fixed magnet. This action vibrates the air in front of the speaker which in turn vibrates the air in front of that and so on until that vibrations hit our ear drums and are perceived as sound. The sounds we hear around us are all incredibly complex patterns of air pressure modulation.\r\n<div>\r\n<ul>\r\n	<li><strong>The red line in fig 1 represents a voltage which goes up and down over a period of time. This is an oscillator.</strong></li>\r\n</ul>\r\nThere are three basic factors that make up all oscillators: <a name=\"frequency\"></a><strong>frequency</strong>, <strong>amplitude</strong> and <strong>wave shape</strong>. In musical terms we would call these <strong>pitch</strong>, <strong>volume</strong> and <strong>timbre</strong>. I will also talk a fair amount about <strong>phase </strong>which is relevant when working with multiple oscillators and plays an important role in creating drones.\r\n<ul>\r\n	<li>\r\n<h3><span style=\"color: #3366ff;\"><strong>Frequency</strong></span></h3>\r\n</li>\r\n</ul>\r\nOne complete sweep up and down is called a <strong>cycle</strong>. The number of cycles per second is your <strong>Frequency</strong> or <strong>Pitch</strong>.<strong></strong>\r\n<strong>Frequency</strong> is commonly measured in <strong>Hertz</strong>, which is the number of cycles per second.\r\n<a name=\"amplitude\"></a><strong>Pitch</strong> is another term for frequency which is used <span style=\"text-decoration: underline;\">only</span> when referring to the frequency of an audio signal.\r\nFigure 1 shows a triangle wave with a cycle length of .5 seconds. The frequency of this wave would be determined by seeing how many cycles will occur in 1 second. In this case there are 2 complete cycles in 1 second. That means the wave has a frequency of 2 Hertz. This is well below the hearing range. Humans can hear oscillators between 20Hz and 20,000 Hz.\r\n<ul>\r\n	<li>\r\n<h3><span style=\"color: #3366ff;\"><strong>Amplitude</strong></span></h3>\r\n</li>\r\n</ul>\r\nAmplitude refers to the magnitude of voltage change across one cycle of an oscillation.\r\n<a name=\"waveshape\"></a>This in turn impacts the volume of the signal if it is sent to a speaker.\r\nThe image above shows a triangle wave with a positive peak of +5 volts and a negative peak of -5 volts. The amplitude is determined by figuring the absolute difference between these peaks. In this case that difference is 10 volts. This is commonly referred to as 10 Vpk-pk (10 volts peak to peak). There are many different ways to measure amplitude (pk-pk, RMS, Vp, etc…) but we’ll just be talking about Vpk-pk.\r\n<ul>\r\n	<li><span style=\"text-decoration: underline;\"><strong>Wave shape</strong></span><a href=\"http://casperelectronics.com/wp-content/uploads/waveshapes.png\"><img class=\"alignright\" title=\"Waveshapes\" src=\"http://casperelectronics.com/wp-content/uploads/waveshapes-200x160.png\" alt=\"\" width=\"292\" height=\"233\" /></a></li>\r\n</ul>\r\nThe wave shape is the pattern of amplitude modulation over the course of a cycle. The waveforms in fig 2 are: Sine, ramp, triangle and square.Sine, triangle and square are the most common and are all symmetrical waves. That means the positive and negative portions of each cycle are of the same duration. Many musical synthesizers offer other wave forms which are asymmetrical versions of these common waves such as ramp, saw and pulse waves.\r\n<p style=\"text-align: right;\"><span style=\"color: #33cccc;\"> Figure 2. Waveshapes  </span></p>\r\nThe importance and impact of wave shape depends on its application. Many audio effects such as <strong>tremolo</strong> or <strong>phaser</strong> use low frequency oscillators (LFOs) to modulate certain parameters of the sound. It is commonly more desirable to use a sine or triangle wave for many of these effects such as the tremolo which\r\n<a name=\"review\"></a>fades the volume in and out. Using a square wave for this would create dramatic shifts in volume which can be unpleasant.\r\nMany natural sounds are synthesized using overlapping wave forms like those shown above. For instance a flute can be synthesized using several octaves of a sine wave. A horn on the other hand will use more square waves and maybe a triangle or saw wave. More advanced wave and synthesis theory sites the sine wave as the basis of all wave forms. It is shown how even square waves can be created by combining several sine waves.\r\n<ul>\r\n	<li><span style=\"text-decoration: underline;\"><strong>Review</strong></span></li>\r\n</ul>\r\nThe basic components of an oscillator are:\r\n<h3><a name=\"1.2\"></a></h3>\r\n<ul>\r\n	<li><strong>Frequency</strong>. The number of oscillation cycles that occur in one second. Measured in Hz</li>\r\n	<li><strong>Amplitude</strong>. Magnitude of voltage sweep in one cycle of an oscillator. Measured in Volts or Vpk-pk (volts peak to peak)</li>\r\n	<li><strong>Wave shape</strong>. Sine, triangle, square</li>\r\n</ul>\r\n<div></div>\r\n<h3 style=\"text-align: left;\"><span style=\"color: #000080;\"><strong>◊1.2 Phase◊</strong></span></h3>\r\nPhase is a bit more complicated than the other terms but plays an important role in audio circuitry and especially in making drones. Phase refers to a particular position in a <span style=\"text-decoration: underline;\">single cycle</span> of a wave (such as the positive or negative peak) and is measured in degrees. It is most commonly used to describe the relationship between multiple waves.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/phasedegrees.jpg\"><img class=\"alignnone size-large wp-image-1643\" title=\"Phasedegrees\" src=\"http://casperelectronics.com/wp-content/uploads/phasedegrees-460x236.jpg\" alt=\"\" width=\"460\" height=\"236\" /></a>\r\n\r\n<span style=\"color: #33cccc;\">Figure 3. Phase</span>\r\nFig. 3 shows two sine waves (red &amp; blue) of identical amplitude and frequency. The green oscillator is the mix or <em>average</em> of the red and blue oscillators.\r\nPhase is measured in degrees with 360 degrees being one complete cycle. 180 degrees is exactly ½ of a cycle.\r\nIn fig. 3 the phase of the blue oscillator is offset at 45 degree increments from the red oscillator from left to right. With each step you’ll notice that the waves get farther apart and that the amplitude of the green (average) oscillator decreases.\r\nThis may seem confusing at first but it’s really quite simple. The green oscillator is the average of the red and blue oscillators. Let’s say the red and blue oscillators sweep from -5 to +5VDC (10Vp-p). Now look at the right most illustration of the 2 waves out of phase by 180 degrees. When the blue wave is at its positive peak (90 degrees) of +5 volts, the red wave is at it’s negative peak (270 degrees) of -5 volts.\r\nWhat is the average of -5 and +5? Zero. They are always going to be the opposites of each other so the average will always be zero. Now look at the 90 degree image. When Blue is at +5 volts/90 degrees, red is at 0 volts/zero degrees. The average of +5 and zero is 2.5 volts.\r\nThe important thing to take away from the info above is that the amplitude of an oscillator created by mixing two similar oscillators is relative to the difference in phase of the two source waves.\r\nIn fig. 3 the oscillators have identical frequencies. This means that the phase relationship once established will remain the same and the resulting averaged amplitude of the two waves will also remain the same.\r\n<strong>Q: What will happen if the frequencies of your two waves are NOT identical? </strong>\r\nWe established above that the amplitude of the averaged waveform is relative to the phase difference of the two wave forms, therefore as the phase difference of two waves increases and decreases so too will the averaged waveforms’ amplitude. What we have here is phase controlled amplitude modulation and the rate of phase modulation is controlled by the frequency difference between your two oscillators.\r\nIn fig. 4 the blue oscillator has a frequency of 10 Hz, the red is 11Hz. That means that it takes the red wave 1/10<sup>th</sup> of a second longer to complete a cycle than the blue wave. You can see that with each cycle the red wave lags a little bit further behind the blue wave which increases the phase difference between the two. As a result, the amplitude of the averaged wave (green) decreases as the phase offset approaches 180 degrees and then increases as it continues past 180 to 360 degrees.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/phaseModulation.jpg\"><img class=\"alignnone size-large wp-image-1644\" title=\"PhaseModulation\" src=\"http://casperelectronics.com/wp-content/uploads/phaseModulation-460x202.jpg\" alt=\"\" width=\"460\" height=\"202\" /></a><a href=\"http://casperelectronics.com/wp-content/uploads/phase_modulation2.jpg\"><img class=\"alignnone size-large wp-image-1645\" title=\"Phase Modulation2\" src=\"http://casperelectronics.com/wp-content/uploads/phase_modulation2-460x220.jpg\" alt=\"\" width=\"460\" height=\"220\" /></a><a name=\"sec2\"></a><span style=\"color: #33cccc;\">Figure 4. Phase controlled amplitude</span>\r\n<h3><a name=\"2.1\"></a></h3>\r\nThis phenomenon of phase controlled amplitude is something many musicians use without even realizing it. This is the vary trick one uses when tuning a guitar. You tune one string to the other until the “beatingâ€ effect slows and eventually disappears.\r\n\r\n&nbsp;\r\n<h2 style=\"text-align: left;\"><span style=\"color: #000080;\"><strong>SECTION 2. NOVADRONE OSCILLATORS</strong></span></h2>\r\n<h3 style=\"text-align: left;\"><span style=\"color: #000080;\"><strong>◊ 2.1 The circuit ◊</strong></span></h3>\r\nThe NovaDrone contains 6 oscillators. Each oscillator outputs a square wave and a triangle wave.\r\n<span style=\"text-decoration: underline;\"><a name=\"schematic\"></a></span>The circuit which generates the oscillators is clean, simple and robust. They are generated using a remarkable device called an <strong>op amp</strong>. If you are interested in building synthesizers and don’t know where to start, read up on <strong>op amps</strong>. They are the key elements of most oscillators, filters, envelope generators, mixers and amps.\r\n<ul>\r\n	<li><span style=\"text-decoration: underline;\"><strong>Schematic</strong></span></li>\r\n</ul>\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/OSC2rc.jpg\"><img class=\"alignleft\" title=\"OSC2rc\" src=\"http://casperelectronics.com/wp-content/uploads/OSC2rc-200x163.jpg\" alt=\"\" width=\"200\" height=\"163\" /></a>­­Each channel of the NovaDrone (Red, green and blue) has 2 oscillators. These are shown in fig. 5 and <a name=\"feedbackloops\"></a>fig. 6. They are very similar to one another but have been calibrated for different purposes.\r\n<strong>Osc 1</strong> is an audio frequency oscillator. It has a coarse and fine tune adjustment and only operates at audible frequencies (20Hz-20kHz).\r\n<strong>Osc 2</strong> is calibrated as a low frequency oscillator (LFO) with cycles as long as 2 minutes. It has a range switch and a single adjustment knob.\r\n<ul>\r\n	<li><span style=\"text-decoration: underline;\"><strong>Feedback loops</strong></span></li>\r\n</ul>\r\nThe oscillator circuit is a feedback loop between two op amps that are <a href=\"http://casperelectronics.com/wp-content/uploads/OSC1rc.jpg\"><img class=\"alignleft\" title=\"OSC1rc\" src=\"http://casperelectronics.com/wp-content/uploads/OSC1rc-200x170.jpg\" alt=\"\" width=\"200\" height=\"170\" /></a>configured as a <strong>schmitt trigger</strong> and an <strong>inverting integrator</strong>.\r\nBasically an <em>integrator</em> turns square waves into triangle waves.\r\nA <em>Schmitt trigger</em> is a kind of comparator that turns modulating signals (like triangle waves) into square waves.\r\nThe key elements of the relationship between these two circuits is that they form a loop (Schmitt &gt; integrator &gt;Schmitt&gt;integrator&gt; etc…) and that the integrator is also an <strong>inverter</strong>. This creates a continuous cycle of modulation:\r\n1) Schmitt output goes HI.\r\n2) Integrator inverts Schmitt signal and outputs slope going down (LOW).\r\n3) When slope is near zero volts, Schmitt trigger is thrown and its’ output goes LOW.\r\n4) Integrator inverts and generates upward slope (HI).\r\n5) When integrator slope reaches peak, Schmitt trigger is thrown and output goes HI.\r\n<a name=\"rctimeconstant\"></a>6) etc……\r\nThis is an overly simplified explanation but enough for our purposes. Do more research on these valuable circuits once you are familiar with some of the basics of op-amps.\r\n\r\n&nbsp;\r\n<ul>\r\n	<li><strong><span style=\"text-decoration: underline;\">RC (resistor capacitor)time constant</span></strong></li>\r\n</ul>\r\nIn both oscillators (fig. 5 and 6) the primary element which defines frequency is the <strong>RC time constant</strong>. This relationship is a core component of most oscillators and is worth reading up on.\r\n\r\nThe RC time constant is a period of time defined by the relationship between a resistor and a capacitor.\r\nThe equation for this is simply <strong>t =</strong> <strong>R*C</strong>. In the case of the oscillators above it would be <strong>t=R1*C1</strong>.\r\nUnfortunately calculating the frequency of an oscillator is more complicated than just calculating your RC constant.\r\nIn many oscillators (including this one) there is a schmitt trigger component which watches the rising or sinking voltage from the integrator. The Schmitt trigger activates when the slope reaches predefined upper and lower limits. In order to determine the frequency of an oscillator we need to know what our upper and lower limits are and then calculate how long it takes our wave (the output of the integrator) to travel from one limit to the other.\r\nThese limits are determined by the relationship of 2 resistors in the schmitt stage. In fig 5 and 6 these are R2 and R3.\r\nThe equation for determining the duration of one cycle is\r\n(1/4R1C1)*(R3/R4)\r\nIn Oscillator 2 <strong>R</strong><strong>1</strong> is a 500k potentiometer in series with a 4.7k resistor between pins 8 and 13 of the two op amps. <strong>C</strong><strong>1</strong> is one of the three capacitors between pins 13 and 14 of the rightmost op amp. One of these caps is selected using a three way switch on the NovaDrone circuit board. This controls the frequency range of the LFO.\r\nLet’s say the pot is all the way up (full resistance) and the middle cap has been selected. The equations for RC and subsequently the frequency is:\r\n<strong>R1=504,700 Ohms</strong>\r\n<a name=\"howitworks\"></a><strong>C1= .000022 Farads</strong>\r\n<strong>R2 = 8,300 Ohms</strong>\r\n<strong>R3 = 10,000 Ohms</strong>\r\n<strong>Frequency in Hz = (1 / 4*R</strong><strong>1C</strong><strong>1) * (R</strong><strong>3/R</strong><strong>2)</strong>\r\n<ul>\r\n	<li><span style=\"text-decoration: underline;\"><strong>How it works</strong></span></li>\r\n</ul>\r\nResistors limit the flow of current and capacitors store current. Current flows through the resistor and is stored in the capacitor. The resistor controls how much current flows into the capacitor per second. Therefore the size of capacitor and the amount of resistance will determine how long it takes to fill the capacitor. A common analogy is to think about current flow as water, the resistor as a spigot\r\n<h3><a name=\"2.2\"></a></h3>\r\nand the capacitor as a cup. The more you open the spigot (reduce resistance), the more water (electrical current) will flow and the faster the cup will fill (capacitor will charge). The oscillator circuit is configured in a special way which causes the capacitor to continuously charge and discharge. It is looking for two states from the cap, fully charged or fully discharged. When the cap reaches either of these states, the whole circuit reverses polarity and the capacitors charge status begins moving toward the opposite state. The amount of time it takes to charge and discharge is your cycle duration.\r\n\r\n&nbsp;\r\n<h3 style=\"text-align: left;\"><span style=\"color: #000080;\"><strong>◊2.2 pulse width modulation (pwm)◊</strong></span></h3>\r\nPWM is exciting stuff….really! It is essentially a <strong>1 bit digital</strong> representation of an <strong>analog</strong> wave form.\r\nDigital wave forms only have 2 states, <strong>high</strong> and <strong>low</strong>. <strong>High</strong> is a voltage <em>at</em> or very close to the positive supply voltage. <strong>Low</strong> is a voltage <em>at</em> or very close to the negative supply voltage. It is basically just a square wave. Analog on the other hand is infinitely variable. Think about it like the difference between a light switch (digital) and a light dimmer (analog). PWM is a wave form that bridges the gap between these two formats. It can be used to make sound, control the brightness of an LED, control the speed of high torque motors and speak to microprocessors. It is also the language that a microprocessor will use to speak with the analog world.\r\nPulse Width (PW) refers to the relative durations of high and low voltage in a single <strong>cycle</strong> of a square wave.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/pulsewidth.jpg\"><img class=\"alignnone size-large wp-image-1648\" title=\"Pulsewidth\" src=\"http://casperelectronics.com/wp-content/uploads/pulsewidth-460x214.jpg\" alt=\"\" width=\"460\" height=\"214\" /></a><span style=\"color: #33cccc;\">Figure 7. Pulse width</span>\r\nFig. 7 shows three square wave oscillators of the same amplitude and frequency but with differing <strong>pulse width</strong>. The red oscillator has a 10% pulse width. That means the wave goes high for 10 % of the duration of one cycle. The green wave is 50% and the purple wave is 90%. What is important to note is that pulse width has nothing to do with frequency and only refers to the relationship between the high and low swing of the wave.\r\n<ul>\r\n	<li><strong><span style=\"text-decoration: underline;\">The Comparator</span></strong></li>\r\n</ul>\r\nThe job of a comparator is simple. Two signals are fed into the “+â€ and “-“ inputs (labeled 10 and 9 in fig. 8 respectively). If the voltage at the “+â€ input is <em>higher</em> than the “-“ input the output of the comparator goes <strong>high</strong>.<strong> </strong>If the “+â€ input drops below the “-“ input the output goes <strong>low</strong>.\r\nIn the NovaDrone t<a href=\"http://casperelectronics.com/wp-content/uploads/comparator.jpg\"><img class=\"alignleft\" title=\"Comparator\" src=\"http://casperelectronics.com/wp-content/uploads/comparator-200x76.jpg\" alt=\"\" width=\"200\" height=\"76\" /></a>he triangle output of Osc 1 and Osc 2 combine through a simple comparator (fig. 8) to make a single square wave with a modulating pulse width. In this way, the comparator also functions as a pulse width modulation processor.\r\n\r\nFig. 9 below shows how two triangle waves are transformed through the comparator into a square wave with a modulating pulse width.\r\nThe blue triangle wave in fig. 9 is oscillator 1. The red triangle is osc 2. The green line is the combined PWM output.\r\nAny time the blue line (osc 1) is above the red line (osc 2), the green line (pwm) goes high. As the red line rises the percentage of each cycle that the blue line is above the red line decreases. This changing percentage is what makes our modulating pulse width effect.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/PWM3-copy.jpg\"><img class=\"alignnone size-large wp-image-1647\" title=\"PWM3 Copy\" src=\"http://casperelectronics.com/wp-content/uploads/PWM3-copy-460x202.jpg\" alt=\"\" width=\"460\" height=\"202\" /></a>\r\n\r\n<span style=\"color: #33cccc;\">Figure 9. Pulse width modulation detail</span>\r\n<ul>\r\n	<li><strong><span style=\"text-decoration: underline;\">Mixer</span></strong></li>\r\n</ul>\r\nThe audio signals from each of the three channels of the NovaDrone are mixed using the circuit in fig. 10.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/mixer.jpg\"><img class=\"alignleft\" title=\"Mixer\" src=\"http://casperelectronics.com/wp-content/uploads/mixer-200x135.jpg\" alt=\"\" width=\"200\" height=\"135\" /></a>This mixer is nice and simple and uses just one <strong>op amp</strong> and a few other components. This circuit is configured as an inverting mixer with an amplitude controlled by the <strong>feedback resistor</strong> and <strong>input resistors</strong>. The amplitude is calculated as RF/RI. In this case RF = 10,000 and RI = 100,000. That means the output signal is 1/10<sup>th</sup> the amplitude of the input signal.\r\n<strong><span style=\"text-decoration: underline;\">\r\n</span></strong>\r\n<ul>\r\n	<li><strong><span style=\"text-decoration: underline;\">LED drivers</span></strong></li>\r\n</ul>\r\n(3) 2N3904 NPN transistors are used to make 3 LED drivers.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/LEDdriver.jpg\"><img class=\"alignleft\" title=\"LEDdriver\" src=\"http://casperelectronics.com/wp-content/uploads/LEDdriver-200x108.jpg\" alt=\"\" width=\"200\" height=\"108\" /></a>A driver is a simple but important circuit which isolates elements which use lots of current (like LEDs) from sensitive circuits (like the oscillators in the NovaDrone). Failure to use a driver can result in something called a <strong>loading effect</strong> which basically means that the device being driven will affect the behavior of the rest of the circuit in bad ways, like the pitch changing when the lights turn on. The LED in the NovaDrone uses a lot of current relative to the rest of the circuit (90mA vs around 30mA for the rest of the circuit) therefore a driver is necessary. The key component of a driver is the <strong>transistor</strong>. This is another topic worth reading a lot about\r\n.\r\n\r\n</div>','NovaDrone Tech Manual',0,'','inherit','open','closed','','1704-revision-15','','','2012-11-05 15:52:32','2012-11-05 20:52:32','',1704,'http://casperelectronics.com/2012/11/05/1704-revision-15/',0,'revision','',0),(1718,2,'2012-11-05 15:44:35','2012-11-05 20:44:35','Throughout this guide I will attempt to give you some insight into the circuit theory and scientific principles at play in the NovaDrone. That said I will be giving little more than an intro to each topic and strongly encourage you to do further reading on topics you find interesting.\r\n<ul>\r\n	<li>This is a beta version of the <strong>NovaDrone Technical Guide</strong>. I expect to make revisions over time and eagerly encourage readers to send me feedback, questions, suggestions and especially corrections. Comments should be addressed to <a href=\"mailto:pete@casperelectronics.com\"><strong>pete@casperelectronics.com</strong></a>.</li>\r\n</ul>\r\n<h3 style=\"text-align: center;\"><span style=\"color: #000000;\"><strong>TABLE OF CONTENTS:</strong></span></h3>\r\n<a href=\"#sec1\"><strong><span style=\"text-decoration: underline;\">Section 1. Oscillator Primer</span></strong></a>\r\n<ul>\r\n	<li><a href=\"#1.1\"><strong>1.1 Frequency, amplitude &amp; wave shape</strong></a>\r\n<ul>\r\n	<li><a href=\"#frequency\">Frequency</a></li>\r\n	<li><a href=\"#amplitude\">Amplitude</a></li>\r\n	<li><a href=\"#waveshape\"> Wave shape</a></li>\r\n	<li><a href=\"#review\"> Review<strong></strong></a></li>\r\n</ul>\r\n</li>\r\n	<li><a href=\"#1.2\"><strong>1.2 Phase</strong></a>\r\n<ul>\r\n	<li><a href=\"#phase\"> Phase controlled amplitude modulation</a></li>\r\n</ul>\r\n</li>\r\n</ul>\r\n<a href=\"#sec2\"><strong><span style=\"text-decoration: underline;\">Section 2. NovaDrone Oscillators</span></strong></a>\r\n<ul>\r\n	<li><a href=\"#2.1\"><strong>2.1 The Circuit</strong></a>\r\n<ul>\r\n	<li><a href=\"#feedbackloops\"> Feedback loops</a></li>\r\n	<li><a href=\"#schematic\"> Schematic</a></li>\r\n	<li><a href=\"#rctimeconstant\"> RC time constant</a></li>\r\n	<li><a href=\"#howitworks\"> How it works<strong></strong></a></li>\r\n</ul>\r\n</li>\r\n	<li><a href=\"#2.2\"><strong>2.2 Pulse Width Modulation</strong></a>\r\n<ul>\r\n	<li><a href=\"#comparator\">The comparator<strong></strong></a></li>\r\n</ul>\r\n</li>\r\n</ul>\r\n<a name=\"sec1\"></a><a name=\"1.1\"></a><a href=\"#sec3\"><strong><span style=\"text-decoration: underline;\">Sectio</span></strong></a><a href=\"#sec3\"><strong><span style=\"text-decoration: underline;\">n 3. Drivers and Mixers </span>*incomplete*</strong></a>\r\n<ul>\r\n	<li><a href=\"#led\"> LED driver</a></li>\r\n	<li><a href=\"#mixer\">Signal mixer</a><strong></strong></li>\r\n</ul>\r\n<h2 style=\"text-align: center;\"><span style=\"color: #000080;\"><strong>SECTION 1. OSCILLATOR PRIMER</strong></span></h2>\r\n<h3 style=\"text-align: center;\"><span style=\"text-decoration: underline; color: #000080;\"><strong style=\"text-align: center;\"><strong>1.1 Frequency, amplitude and wave shape</strong></strong></span></h3>\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/ampandfreq.jpg\"><img class=\"alignleft size-medium wp-image-1636\" title=\"Figure 1. A triangle wave oscillator\" src=\"http://casperelectronics.com/wp-content/uploads/ampandfreq-200x242.jpg\" alt=\"\" width=\"200\" height=\"242\" /></a>\r\n<div>\r\n\r\nThe heart of the NovaDrone is a bank of six independent oscillators.\r\n\r\n</div>\r\nAn oscillator is simply a pattern which repeats indefinitely. This can be a pattern of light, movement, electricity, even life cycles of organisms. The <a href=\"http://en.wikipedia.org/wiki/Oscillation\">wikipedia entry</a> gives dozens of examples of different kinds of oscillation.\r\n\r\nWhat we are most interested in is the modulation (changing amplitude) of electricity. All of the electrically produced sound we hear is a repeating pattern of fluctuating electrical current.\r\n\r\n&nbsp;\r\n\r\n<address> </address><address><em><span style=\"color: #33cccc;\">Figure 1. triangle oscillator</span></em></address>When this is applied to a speaker, the current activates a coil in the speaker which pushes the cone of the speaker away from or towards a fixed magnet. This action vibrates the air in front of the speaker which in turn vibrates the air in front of that and so on until that vibrations hit our ear drums and are perceived as sound. The sounds we hear around us are all incredibly complex patterns of air pressure modulation.\r\n<div>\r\n<ul>\r\n	<li><strong>The red line in fig 1 represents a voltage which goes up and down over a period of time. This is an oscillator.</strong></li>\r\n</ul>\r\nThere are three basic factors that make up all oscillators: <a name=\"frequency\"></a><strong>frequency</strong>, <strong>amplitude</strong> and <strong>wave shape</strong>. In musical terms we would call these <strong>pitch</strong>, <strong>volume</strong> and <strong>timbre</strong>. I will also talk a fair amount about <strong>phase </strong>which is relevant when working with multiple oscillators and plays an important role in creating drones.\r\n<ul>\r\n	<li><span style=\"text-decoration: underline;\"><strong>Frequency</strong></span></li>\r\n</ul>\r\nOne complete sweep up and down is called a <strong>cycle</strong>. The number of cycles per second is your <strong>Frequency</strong> or <strong>Pitch</strong>.<strong></strong>\r\n<strong>Frequency</strong> is commonly measured in <strong>Hertz</strong>, which is the number of cycles per second.\r\n<a name=\"amplitude\"></a><strong>Pitch</strong> is another term for frequency which is used <span style=\"text-decoration: underline;\">only</span> when referring to the frequency of an audio signal.\r\nFigure 1 shows a triangle wave with a cycle length of .5 seconds. The frequency of this wave would be determined by seeing how many cycles will occur in 1 second. In this case there are 2 complete cycles in 1 second. That means the wave has a frequency of 2 Hertz. This is well below the hearing range. Humans can hear oscillators between 20Hz and 20,000 Hz.\r\n<ul>\r\n	<li><span style=\"text-decoration: underline;\"><strong>Amplitude</strong></span></li>\r\n</ul>\r\nAmplitude refers to the magnitude of voltage change across one cycle of an oscillation.\r\n<a name=\"waveshape\"></a>This in turn impacts the volume of the signal if it is sent to a speaker.\r\nThe image above shows a triangle wave with a positive peak of +5 volts and a negative peak of -5 volts. The amplitude is determined by figuring the absolute difference between these peaks. In this case that difference is 10 volts. This is commonly referred to as 10 Vpk-pk (10 volts peak to peak). There are many different ways to measure amplitude (pk-pk, RMS, Vp, etc…) but we’ll just be talking about Vpk-pk.\r\n<ul>\r\n	<li><span style=\"text-decoration: underline;\"><strong>Wave shape</strong></span><a href=\"http://casperelectronics.com/wp-content/uploads/waveshapes.png\"><img class=\"alignright\" title=\"Waveshapes\" src=\"http://casperelectronics.com/wp-content/uploads/waveshapes-200x160.png\" alt=\"\" width=\"292\" height=\"233\" /></a></li>\r\n</ul>\r\nThe wave shape is the pattern of amplitude modulation over the course of a cycle. The waveforms in fig 2 are: Sine, ramp, triangle and square.Sine, triangle and square are the most common and are all symmetrical waves. That means the positive and negative portions of each cycle are of the same duration. Many musical synthesizers offer other wave forms which are asymmetrical versions of these common waves such as ramp, saw and pulse waves.\r\n<p style=\"text-align: right;\"><span style=\"color: #33cccc;\"> Figure 2. Waveshapes  </span></p>\r\nThe importance and impact of wave shape depends on its application. Many audio effects such as <strong>tremolo</strong> or <strong>phaser</strong> use low frequency oscillators (LFOs) to modulate certain parameters of the sound. It is commonly more desirable to use a sine or triangle wave for many of these effects such as the tremolo which\r\n<a name=\"review\"></a>fades the volume in and out. Using a square wave for this would create dramatic shifts in volume which can be unpleasant.\r\nMany natural sounds are synthesized using overlapping wave forms like those shown above. For instance a flute can be synthesized using several octaves of a sine wave. A horn on the other hand will use more square waves and maybe a triangle or saw wave. More advanced wave and synthesis theory sites the sine wave as the basis of all wave forms. It is shown how even square waves can be created by combining several sine waves.\r\n<ul>\r\n	<li><span style=\"text-decoration: underline;\"><strong>Review</strong></span></li>\r\n</ul>\r\nThe basic components of an oscillator are:\r\n<h3><a name=\"1.2\"></a></h3>\r\n<ul>\r\n	<li><strong>Frequency</strong>. The number of oscillation cycles that occur in one second. Measured in Hz</li>\r\n	<li><strong>Amplitude</strong>. Magnitude of voltage sweep in one cycle of an oscillator. Measured in Volts or Vpk-pk (volts peak to peak)</li>\r\n	<li><strong>Wave shape</strong>. Sine, triangle, square</li>\r\n</ul>\r\n<h3 style=\"padding-left: 30px; text-align: center;\"><span style=\"color: #000080;\"><strong><span style=\"text-decoration: underline;\">1.2 Phase</span></strong></span></h3>\r\nPhase is a bit more complicated than the other terms but plays an important role in audio circuitry and especially in making drones. Phase refers to a particular position in a <span style=\"text-decoration: underline;\">single cycle</span> of a wave (such as the positive or negative peak) and is measured in degrees. It is most commonly used to describe the relationship between multiple waves.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/phasedegrees.jpg\"><img class=\"alignnone size-large wp-image-1643\" title=\"Phasedegrees\" src=\"http://casperelectronics.com/wp-content/uploads/phasedegrees-460x236.jpg\" alt=\"\" width=\"460\" height=\"236\" /></a>\r\n\r\n<span style=\"color: #33cccc;\">Figure 3. Phase</span>\r\nFig. 3 shows two sine waves (red &amp; blue) of identical amplitude and frequency. The green oscillator is the mix or <em>average</em> of the red and blue oscillators.\r\nPhase is measured in degrees with 360 degrees being one complete cycle. 180 degrees is exactly ½ of a cycle.\r\nIn fig. 3 the phase of the blue oscillator is offset at 45 degree increments from the red oscillator from left to right. With each step you’ll notice that the waves get farther apart and that the amplitude of the green (average) oscillator decreases.\r\nThis may seem confusing at first but it’s really quite simple. The green oscillator is the average of the red and blue oscillators. Let’s say the red and blue oscillators sweep from -5 to +5VDC (10Vp-p). Now look at the right most illustration of the 2 waves out of phase by 180 degrees. When the blue wave is at its positive peak (90 degrees) of +5 volts, the red wave is at it’s negative peak (270 degrees) of -5 volts.\r\nWhat is the average of -5 and +5? Zero. They are always going to be the opposites of each other so the average will always be zero. Now look at the 90 degree image. When Blue is at +5 volts/90 degrees, red is at 0 volts/zero degrees. The average of +5 and zero is 2.5 volts.\r\nThe important thing to take away from the info above is that the amplitude of an oscillator created by mixing two similar oscillators is relative to the difference in phase of the two source waves.\r\nIn fig. 3 the oscillators have identical frequencies. This means that the phase relationship once established will remain the same and the resulting averaged amplitude of the two waves will also remain the same.\r\n<strong>Q: What will happen if the frequencies of your two waves are NOT identical? </strong>\r\nWe established above that the amplitude of the averaged waveform is relative to the phase difference of the two wave forms, therefore as the phase difference of two waves increases and decreases so too will the averaged waveforms’ amplitude. What we have here is phase controlled amplitude modulation and the rate of phase modulation is controlled by the frequency difference between your two oscillators.\r\nIn fig. 4 the blue oscillator has a frequency of 10 Hz, the red is 11Hz. That means that it takes the red wave 1/10<sup>th</sup> of a second longer to complete a cycle than the blue wave. You can see that with each cycle the red wave lags a little bit further behind the blue wave which increases the phase difference between the two. As a result, the amplitude of the averaged wave (green) decreases as the phase offset approaches 180 degrees and then increases as it continues past 180 to 360 degrees.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/phaseModulation.jpg\"><img class=\"alignnone size-large wp-image-1644\" title=\"PhaseModulation\" src=\"http://casperelectronics.com/wp-content/uploads/phaseModulation-460x202.jpg\" alt=\"\" width=\"460\" height=\"202\" /></a><a href=\"http://casperelectronics.com/wp-content/uploads/phase_modulation2.jpg\"><img class=\"alignnone size-large wp-image-1645\" title=\"Phase Modulation2\" src=\"http://casperelectronics.com/wp-content/uploads/phase_modulation2-460x220.jpg\" alt=\"\" width=\"460\" height=\"220\" /></a><a name=\"sec2\"></a><span style=\"color: #33cccc;\">Figure 4. Phase controlled amplitude</span>\r\n<h3><a name=\"2.1\"></a></h3>\r\nThis phenomenon of phase controlled amplitude is something many musicians use without even realizing it. This is the vary trick one uses when tuning a guitar. You tune one string to the other until the “beatingâ€ effect slows and eventually disappears.\r\n<h2 style=\"text-align: center;\"><span style=\"color: #000080;\"><strong>SECTION 2. NOVADRONE OSCILLATORS</strong></span></h2>\r\n<h3 style=\"text-align: center;\"><span style=\"text-decoration: underline; color: #000080;\"><strong>2.1 The circuit</strong></span></h3>\r\nThe NovaDrone contains 6 oscillators. Each oscillator outputs a square wave and a triangle wave.\r\n<span style=\"text-decoration: underline;\"><a name=\"schematic\"></a></span>The circuit which generates the oscillators is clean, simple and robust. They are generated using a remarkable device called an <strong>op amp</strong>. If you are interested in building synthesizers and don’t know where to start, read up on <strong>op amps</strong>. They are the key elements of most oscillators, filters, envelope generators, mixers and amps.\r\n<ul>\r\n	<li><span style=\"text-decoration: underline;\"><strong>Schematic</strong></span></li>\r\n</ul>\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/OSC2rc.jpg\"><img class=\"alignleft\" title=\"OSC2rc\" src=\"http://casperelectronics.com/wp-content/uploads/OSC2rc-200x163.jpg\" alt=\"\" width=\"200\" height=\"163\" /></a>­­Each channel of the NovaDrone (Red, green and blue) has 2 oscillators. These are shown in fig. 5 and <a name=\"feedbackloops\"></a>fig. 6. They are very similar to one another but have been calibrated for different purposes.\r\n<strong>Osc 1</strong> is an audio frequency oscillator. It has a coarse and fine tune adjustment and only operates at audible frequencies (20Hz-20kHz).\r\n<strong>Osc 2</strong> is calibrated as a low frequency oscillator (LFO) with cycles as long as 2 minutes. It has a range switch and a single adjustment knob.\r\n<ul>\r\n	<li><span style=\"text-decoration: underline;\"><strong>Feedback loops</strong></span></li>\r\n</ul>\r\nThe oscillator circuit is a feedback loop between two op amps that are <a href=\"http://casperelectronics.com/wp-content/uploads/OSC1rc.jpg\"><img class=\"alignleft\" title=\"OSC1rc\" src=\"http://casperelectronics.com/wp-content/uploads/OSC1rc-200x170.jpg\" alt=\"\" width=\"200\" height=\"170\" /></a>configured as a <strong>schmitt trigger</strong> and an <strong>inverting integrator</strong>.\r\nBasically an <em>integrator</em> turns square waves into triangle waves.\r\nA <em>Schmitt trigger</em> is a kind of comparator that turns modulating signals (like triangle waves) into square waves.\r\nThe key elements of the relationship between these two circuits is that they form a loop (Schmitt &gt; integrator &gt;Schmitt&gt;integrator&gt; etc…) and that the integrator is also an <strong>inverter</strong>. This creates a continuous cycle of modulation:\r\n1) Schmitt output goes HI.\r\n2) Integrator inverts Schmitt signal and outputs slope going down (LOW).\r\n3) When slope is near zero volts, Schmitt trigger is thrown and its’ output goes LOW.\r\n4) Integrator inverts and generates upward slope (HI).\r\n5) When integrator slope reaches peak, Schmitt trigger is thrown and output goes HI.\r\n<a name=\"rctimeconstant\"></a>6) etc……\r\nThis is an overly simplified explanation but enough for our purposes. Do more research on these valuable circuits once you are familiar with some of the basics of op-amps.\r\n\r\n&nbsp;\r\n<ul>\r\n	<li><strong><span style=\"text-decoration: underline;\">RC (resistor capacitor)time constant</span></strong></li>\r\n</ul>\r\nIn both oscillators (fig. 5 and 6) the primary element which defines frequency is the <strong>RC time constant</strong>. This relationship is a core component of most oscillators and is worth reading up on.\r\n\r\nThe RC time constant is a period of time defined by the relationship between a resistor and a capacitor.\r\nThe equation for this is simply <strong>t =</strong> <strong>R*C</strong>. In the case of the oscillators above it would be <strong>t=R1*C1</strong>.\r\nUnfortunately calculating the frequency of an oscillator is more complicated than just calculating your RC constant.\r\nIn many oscillators (including this one) there is a schmitt trigger component which watches the rising or sinking voltage from the integrator. The Schmitt trigger activates when the slope reaches predefined upper and lower limits. In order to determine the frequency of an oscillator we need to know what our upper and lower limits are and then calculate how long it takes our wave (the output of the integrator) to travel from one limit to the other.\r\nThese limits are determined by the relationship of 2 resistors in the schmitt stage. In fig 5 and 6 these are R2 and R3.\r\nThe equation for determining the duration of one cycle is\r\n(1/4R1C1)*(R3/R4)\r\nIn Oscillator 2 <strong>R</strong><strong>1</strong> is a 500k potentiometer in series with a 4.7k resistor between pins 8 and 13 of the two op amps. <strong>C</strong><strong>1</strong> is one of the three capacitors between pins 13 and 14 of the rightmost op amp. One of these caps is selected using a three way switch on the NovaDrone circuit board. This controls the frequency range of the LFO.\r\nLet’s say the pot is all the way up (full resistance) and the middle cap has been selected. The equations for RC and subsequently the frequency is:\r\n<strong>R1=504,700 Ohms</strong>\r\n<a name=\"howitworks\"></a><strong>C1= .000022 Farads</strong>\r\n<strong>R2 = 8,300 Ohms</strong>\r\n<strong>R3 = 10,000 Ohms</strong>\r\n<strong>Frequency in Hz = (1 / 4*R</strong><strong>1C</strong><strong>1) * (R</strong><strong>3/R</strong><strong>2)</strong>\r\n<ul>\r\n	<li><span style=\"text-decoration: underline;\"><strong>How it works</strong></span></li>\r\n</ul>\r\nResistors limit the flow of current and capacitors store current. Current flows through the resistor and is stored in the capacitor. The resistor controls how much current flows into the capacitor per second. Therefore the size of capacitor and the amount of resistance will determine how long it takes to fill the capacitor. A common analogy is to think about current flow as water, the resistor as a spigot\r\n<h3><a name=\"2.2\"></a></h3>\r\nand the capacitor as a cup. The more you open the spigot (reduce resistance), the more water (electrical current) will flow and the faster the cup will fill (capacitor will charge). The oscillator circuit is configured in a special way which causes the capacitor to continuously charge and discharge. It is looking for two states from the cap, fully charged or fully discharged. When the cap reaches either of these states, the whole circuit reverses polarity and the capacitors charge status begins moving toward the opposite state. The amount of time it takes to charge and discharge is your cycle duration.\r\n<h3 style=\"text-align: center;\"><span style=\"text-decoration: underline; color: #000080;\"><strong>2.2 pulse width modulation (pwm)</strong></span></h3>\r\nPWM is exciting stuff….really! It is essentially a <strong>1 bit digital</strong> representation of an <strong>analog</strong> wave form.\r\nDigital wave forms only have 2 states, <strong>high</strong> and <strong>low</strong>. <strong>High</strong> is a voltage <em>at</em> or very close to the positive supply voltage. <strong>Low</strong> is a voltage <em>at</em> or very close to the negative supply voltage. It is basically just a square wave. Analog on the other hand is infinitely variable. Think about it like the difference between a light switch (digital) and a light dimmer (analog). PWM is a wave form that bridges the gap between these two formats. It can be used to make sound, control the brightness of an LED, control the speed of high torque motors and speak to microprocessors. It is also the language that a microprocessor will use to speak with the analog world.\r\nPulse Width (PW) refers to the relative durations of high and low voltage in a single <strong>cycle</strong> of a square wave.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/pulsewidth.jpg\"><img class=\"alignnone size-large wp-image-1648\" title=\"Pulsewidth\" src=\"http://casperelectronics.com/wp-content/uploads/pulsewidth-460x214.jpg\" alt=\"\" width=\"460\" height=\"214\" /></a><span style=\"color: #33cccc;\">Figure 7. Pulse width</span>\r\nFig. 7 shows three square wave oscillators of the same amplitude and frequency but with differing <strong>pulse width</strong>. The red oscillator has a 10% pulse width. That means the wave goes high for 10 % of the duration of one cycle. The green wave is 50% and the purple wave is 90%. What is important to note is that pulse width has nothing to do with frequency and only refers to the relationship between the high and low swing of the wave.\r\n<ul>\r\n	<li><strong><span style=\"text-decoration: underline;\">The Comparator</span></strong></li>\r\n</ul>\r\nThe job of a comparator is simple. Two signals are fed into the “+â€ and “-“ inputs (labeled 10 and 9 in fig. 8 respectively). If the voltage at the “+â€ input is <em>higher</em> than the “-“ input the output of the comparator goes <strong>high</strong>.<strong> </strong>If the “+â€ input drops below the “-“ input the output goes <strong>low</strong>.\r\nIn the NovaDrone t<a href=\"http://casperelectronics.com/wp-content/uploads/comparator.jpg\"><img class=\"alignleft\" title=\"Comparator\" src=\"http://casperelectronics.com/wp-content/uploads/comparator-200x76.jpg\" alt=\"\" width=\"200\" height=\"76\" /></a>he triangle output of Osc 1 and Osc 2 combine through a simple comparator (fig. 8) to make a single square wave with a modulating pulse width. In this way, the comparator also functions as a pulse width modulation processor.\r\n\r\nFig. 9 below shows how two triangle waves are transformed through the comparator into a square wave with a modulating pulse width.\r\nThe blue triangle wave in fig. 9 is oscillator 1. The red triangle is osc 2. The green line is the combined PWM output.\r\nAny time the blue line (osc 1) is above the red line (osc 2), the green line (pwm) goes high. As the red line rises the percentage of each cycle that the blue line is above the red line decreases. This changing percentage is what makes our modulating pulse width effect.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/PWM3-copy.jpg\"><img class=\"alignnone size-large wp-image-1647\" title=\"PWM3 Copy\" src=\"http://casperelectronics.com/wp-content/uploads/PWM3-copy-460x202.jpg\" alt=\"\" width=\"460\" height=\"202\" /></a>\r\n\r\n<span style=\"color: #33cccc;\">Figure 9. Pulse width modulation detail</span>\r\n<ul>\r\n	<li><strong><span style=\"text-decoration: underline;\">Mixer</span></strong></li>\r\n</ul>\r\nThe audio signals from each of the three channels of the NovaDrone are mixed using the circuit in fig. 10.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/mixer.jpg\"><img class=\"alignleft\" title=\"Mixer\" src=\"http://casperelectronics.com/wp-content/uploads/mixer-200x135.jpg\" alt=\"\" width=\"200\" height=\"135\" /></a>This mixer is nice and simple and uses just one <strong>op amp</strong> and a few other components. This circuit is configured as an inverting mixer with an amplitude controlled by the <strong>feedback resistor</strong> and <strong>input resistors</strong>. The amplitude is calculated as RF/RI. In this case RF = 10,000 and RI = 100,000. That means the output signal is 1/10<sup>th</sup> the amplitude of the input signal.\r\n<strong><span style=\"text-decoration: underline;\">\r\n</span></strong>\r\n<ul>\r\n	<li><strong><span style=\"text-decoration: underline;\">LED drivers</span></strong></li>\r\n</ul>\r\n(3) 2N3904 NPN transistors are used to make 3 LED drivers.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/LEDdriver.jpg\"><img class=\"alignleft\" title=\"LEDdriver\" src=\"http://casperelectronics.com/wp-content/uploads/LEDdriver-200x108.jpg\" alt=\"\" width=\"200\" height=\"108\" /></a>A driver is a simple but important circuit which isolates elements which use lots of current (like LEDs) from sensitive circuits (like the oscillators in the NovaDrone). Failure to use a driver can result in something called a <strong>loading effect</strong> which basically means that the device being driven will affect the behavior of the rest of the circuit in bad ways, like the pitch changing when the lights turn on. The LED in the NovaDrone uses a lot of current relative to the rest of the circuit (90mA vs around 30mA for the rest of the circuit) therefore a driver is necessary. The key component of a driver is the <strong>transistor</strong>. This is another topic worth reading a lot about\r\n.\r\n\r\n</div>','NovaDrone Tech Manual',0,'','inherit','open','closed','','1704-revision-13','','','2012-11-05 15:44:35','2012-11-05 20:44:35','',1704,'http://casperelectronics.com/2012/11/05/1704-revision-13/',0,'revision','',0),(1716,2,'2012-11-05 15:33:45','2012-11-05 20:33:45','Throughout this guide I will attempt to give you some insight into the circuit theory and scientific principles at play in the NovaDrone. That said I will be giving little more than an intro to each topic and strongly encourage you to do further reading on topics you find interesting.\r\n<ul>\r\n	<li>This is a beta version of the <strong>NovaDrone Technical Guide</strong>. I expect to make revisions over time and eagerly encourage readers to send me feedback, questions, suggestions and especially corrections. Comments should be addressed to <a href=\"mailto:pete@casperelectronics.com\"><strong>pete@casperelectronics.com</strong></a>.</li>\r\n</ul>\r\n<h3 style=\"text-align: center;\"><span style=\"color: #000000;\"><strong>TABLE OF CONTENTS:</strong></span></h3>\r\n<a href=\"#sec1\"><strong><span style=\"text-decoration: underline;\">Section 1. Oscillator Primer</span></strong></a>\r\n<ul>\r\n	<li><a href=\"#1.1\"><strong>1.1 Frequency, amplitude &amp; wave shape</strong></a>\r\n<ul>\r\n	<li><a href=\"#frequency\">Frequency</a></li>\r\n	<li><a href=\"#amplitude\">Amplitude</a></li>\r\n	<li><a href=\"#waveshape\"> Wave shape</a></li>\r\n	<li><a href=\"#review\"> Review<strong></strong></a></li>\r\n</ul>\r\n</li>\r\n	<li><a href=\"#1.2\"><strong>1.2 Phase</strong></a>\r\n<ul>\r\n	<li><a href=\"#phase\"> Phase controlled amplitude modulation</a></li>\r\n</ul>\r\n</li>\r\n</ul>\r\n<a href=\"#sec2\"><strong><span style=\"text-decoration: underline;\">Section 2. NovaDrone Oscillators</span></strong></a>\r\n<ul>\r\n	<li><a href=\"#2.1\"><strong>2.1 The Circuit</strong></a>\r\n<ul>\r\n	<li><a href=\"#feedbackloops\"> Feedback loops</a></li>\r\n	<li><a href=\"#schematic\"> Schematic</a></li>\r\n	<li><a href=\"#rctimeconstant\"> RC time constant</a></li>\r\n	<li><a href=\"#howitworks\"> How it works<strong></strong></a></li>\r\n</ul>\r\n</li>\r\n	<li><a href=\"#2.2\"><strong>2.2 Pulse Width Modulation</strong></a>\r\n<ul>\r\n	<li><a href=\"#comparator\">The comparator<strong></strong></a></li>\r\n</ul>\r\n</li>\r\n</ul>\r\n<a name=\"sec1\"></a><a name=\"1.1\"></a><a href=\"#sec3\"><strong><span style=\"text-decoration: underline;\">Sectio</span></strong></a><a href=\"#sec3\"><strong><span style=\"text-decoration: underline;\">n 3. Drivers and Mixers </span>*incomplete*</strong></a>\r\n<ul>\r\n	<li><a href=\"#led\"> LED driver</a></li>\r\n	<li><a href=\"#mixer\">Signal mixer</a><strong></strong></li>\r\n</ul>\r\n<strong>SECTION 1. OSCILLATOR PRIMER <strong></strong></strong>\r\n<blockquote>\r\n<ul>\r\n	<li><span style=\"text-decoration: underline;\"><strong><strong>1.1 Frequency, amplitude and wave shape</strong></strong></span></li>\r\n</ul>\r\n</blockquote>\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/ampandfreq.jpg\"><img class=\"alignleft size-medium wp-image-1636\" title=\"Figure 1. A triangle wave oscillator\" src=\"http://casperelectronics.com/wp-content/uploads/ampandfreq-200x242.jpg\" alt=\"\" width=\"200\" height=\"242\" /></a>\r\n<div>\r\n\r\nThe heart of the NovaDrone is a bank of six independent oscillators.\r\n\r\n</div>\r\nAn oscillator is simply a pattern which repeats indefinitely. This can be a pattern of light, movement, electricity, even life cycles of organisms. The <a href=\"http://en.wikipedia.org/wiki/Oscillation\">wikipedia entry</a> gives dozens of examples of different kinds of oscillation.\r\n\r\nWhat we are most interested in is the modulation (changing amplitude) of electricity. All of the electrically produced sound we hear is a repeating pattern of fluctuating electrical current.\r\n\r\n&nbsp;\r\n\r\n<address> </address><address><em><span style=\"color: #33cccc;\">Figure 1. triangle oscillator</span></em></address>When this is applied to a speaker, the current activates a coil in the speaker which pushes the cone of the speaker away from or towards a fixed magnet. This action vibrates the air in front of the speaker which in turn vibrates the air in front of that and so on until that vibrations hit our ear drums and are perceived as sound. The sounds we hear around us are all incredibly complex patterns of air pressure modulation.\r\n<div>\r\n<ul>\r\n	<li><strong>The red line in fig 1 represents a voltage which goes up and down over a period of time. This is an oscillator.</strong></li>\r\n</ul>\r\nThere are three basic factors that make up all oscillators: <a name=\"frequency\"></a><strong>frequency</strong>, <strong>amplitude</strong> and <strong>wave shape</strong>. In musical terms we would call these <strong>pitch</strong>, <strong>volume</strong> and <strong>timbre</strong>. I will also talk a fair amount about <strong>phase </strong>which is relevant when working with multiple oscillators and plays an important role in creating drones.\r\n<blockquote>\r\n<ul>\r\n	<li><span style=\"text-decoration: underline;\"><strong>Frequency</strong></span></li>\r\n</ul>\r\n</blockquote>\r\nOne complete sweep up and down is called a <strong>cycle</strong>. The number of cycles per second is your <strong>Frequency</strong> or <strong>Pitch</strong>.<strong></strong>\r\n<strong>Frequency</strong> is commonly measured in <strong>Hertz</strong>, which is the number of cycles per second.\r\n<a name=\"amplitude\"></a><strong>Pitch</strong> is another term for frequency which is used <span style=\"text-decoration: underline;\">only</span> when referring to the frequency of an audio signal.\r\nFigure 1 shows a triangle wave with a cycle length of .5 seconds. The frequency of this wave would be determined by seeing how many cycles will occur in 1 second. In this case there are 2 complete cycles in 1 second. That means the wave has a frequency of 2 Hertz. This is well below the hearing range. Humans can hear oscillators between 20Hz and 20,000 Hz.\r\n<blockquote>\r\n<ul>\r\n	<li><span style=\"text-decoration: underline;\"><strong>Amplitude</strong></span></li>\r\n</ul>\r\n</blockquote>\r\nAmplitude refers to the magnitude of voltage change across one cycle of an oscillation.\r\n<a name=\"waveshape\"></a>This in turn impacts the volume of the signal if it is sent to a speaker.\r\nThe image above shows a triangle wave with a positive peak of +5 volts and a negative peak of -5 volts. The amplitude is determined by figuring the absolute difference between these peaks. In this case that difference is 10 volts. This is commonly referred to as 10 Vpk-pk (10 volts peak to peak). There are many different ways to measure amplitude (pk-pk, RMS, Vp, etc…) but we’ll just be talking about Vpk-pk.<a href=\"http://casperelectronics.com/wp-content/uploads/waveshapes.png\"><img class=\"alignright\" title=\"Waveshapes\" src=\"http://casperelectronics.com/wp-content/uploads/waveshapes-200x160.png\" alt=\"\" width=\"292\" height=\"233\" /></a>\r\n<ul>\r\n	<li><span style=\"text-decoration: underline;\"><strong>Wave shape</strong></span></li>\r\n</ul>\r\nThe wave shape is the pattern of amplitude modulation over the course of a cycle.\r\nThe waveforms in fig 2 are: Sine, ramp, triangle and square.\r\nSine, triangle and square are the most common and are all symmetrical waves. That means the positive and negative portions of each cycle are of the same duration. Many musical synthesizers offer other wave forms which are asymmetrical versions of these common waves such as ramp, saw, and pulse waves.\r\nThe importance and impact of wave shape depends on its application. Many audio effects such as <strong>tremolo</strong> or <strong>phaser</strong> use low frequency oscillators (LFOs) to modulate certain parameters of the sound. It is commonly more desirable to use a sine or triangle wave for many of these effects such as the tremolo which <span style=\"color: #33cccc;\">Figure 2. Waveshapes</span>\r\n<a name=\"review\"></a>fades the volume in and out. Using a square wave for this would create dramatic shifts in volume which can be unpleasant.\r\nMany natural sounds are synthesized using overlapping wave forms like those shown above. For instance a flute can be synthesized using several octaves of a sine wave. A horn on the other hand will use more square waves and maybe a triangle or saw wave. More advanced wave and synthesis theory sites the sine wave as the basis of all wave forms. It is shown how even square waves can be created by combining several sine waves.\r\n<p style=\"padding-left: 30px;\"><span style=\"text-decoration: underline;\"><strong>Review</strong></span></p>\r\nThe basic components of an oscillator are:\r\n<h3><a name=\"1.2\"></a></h3>\r\n<strong>Frequency</strong>. The number of oscillation cycles that occur in one second. Measured in Hz\r\n<strong>Amplitude</strong>. Magnitude of voltage sweep in one cycle of an oscillator. Measured in Volts or Vpk-pk (volts peak to peak)\r\n<strong>Wave shape</strong>. Sine, triangle, square\r\n<p style=\"padding-left: 30px;\"><strong><span style=\"text-decoration: underline;\">1.2 Phase</span></strong></p>\r\nPhase is a bit more complicated than the other terms but plays an important role in audio circuitry and especially in making drones. Phase refers to a particular position in a <span style=\"text-decoration: underline;\">single cycle</span> of a wave (such as the positive or negative peak) and is measured in degrees. It is most commonly used to describe the relationship between multiple waves.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/phasedegrees.jpg\"><img class=\"alignnone size-large wp-image-1643\" title=\"Phasedegrees\" src=\"http://casperelectronics.com/wp-content/uploads/phasedegrees-460x236.jpg\" alt=\"\" width=\"460\" height=\"236\" /></a><span style=\"color: #33cccc;\">Figure 3. Phase</span>\r\nFig. 3 shows two sine waves (red &amp; blue) of identical amplitude and frequency. The green oscillator is the mix or <em>average</em> of the red and blue oscillators.\r\nPhase is measured in degrees with 360 degrees being one complete cycle. 180 degrees is exactly ½ of a cycle.\r\nIn fig. 3 the phase of the blue oscillator is offset at 45 degree increments from the red oscillator from left to right. With each step you’ll notice that the waves get farther apart and that the amplitude of the green (average) oscillator decreases.\r\nThis may seem confusing at first but it’s really quite simple. The green oscillator is the average of the red and blue oscillators. Let’s say the red and blue oscillators sweep from -5 to +5VDC (10Vp-p). Now look at the right most illustration of the 2 waves out of phase by 180 degrees. When the blue wave is at its positive peak (90 degrees) of +5 volts, the red wave is at it’s negative peak (270 degrees) of -5 volts.\r\nWhat is the average of -5 and +5? Zero. They are always going to be the opposites of each other so the average will always be zero. Now look at the 90 degree image. When Blue is at +5 volts/90 degrees, red is at 0 volts/zero degrees. The average of +5 and zero is 2.5 volts.\r\nThe important thing to take away from the info above is that the amplitude of an oscillator created by mixing two similar oscillators is relative to the difference in phase of the two source waves.\r\nIn fig. 3 the oscillators have identical frequencies. This means that the phase relationship once established will remain the same and the resulting averaged amplitude of the two waves will also remain the same.\r\n<strong>Q: What will happen if the frequencies of your two waves are NOT identical? </strong>\r\nWe established above that the amplitude of the averaged waveform is relative to the phase difference of the two wave forms, therefore as the phase difference of two waves increases and decreases so too will the averaged waveforms’ amplitude. What we have here is phase controlled amplitude modulation and the rate of phase modulation is controlled by the frequency difference between your two oscillators.\r\nIn fig. 4 the blue oscillator has a frequency of 10 Hz, the red is 11Hz. That means that it takes the red wave 1/10<sup>th</sup> of a second longer to complete a cycle than the blue wave. You can see that with each cycle the red wave lags a little bit further behind the blue wave which increases the phase difference between the two. As a result, the amplitude of the averaged wave (green) decreases as the phase offset approaches 180 degrees and then increases as it continues past 180 to 360 degrees.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/phaseModulation.jpg\"><img class=\"alignnone size-large wp-image-1644\" title=\"PhaseModulation\" src=\"http://casperelectronics.com/wp-content/uploads/phaseModulation-460x202.jpg\" alt=\"\" width=\"460\" height=\"202\" /></a><a href=\"http://casperelectronics.com/wp-content/uploads/phase_modulation2.jpg\"><img class=\"alignnone size-large wp-image-1645\" title=\"Phase Modulation2\" src=\"http://casperelectronics.com/wp-content/uploads/phase_modulation2-460x220.jpg\" alt=\"\" width=\"460\" height=\"220\" /></a><a name=\"sec2\"></a><span style=\"color: #33cccc;\">Figure 4. Phase controlled amplitude</span>\r\n<h3><a name=\"2.1\"></a></h3>\r\nThis phenomenon of phase controlled amplitude is something many musicians use without even realizing it. This is the vary trick one uses when tuning a guitar. You tune one string to the other until the “beatingâ€ effect slows and eventually disappears.\r\n<h3><strong>SECTION 2. NOVADRONE OSCILLATORS</strong></h3>\r\n<h3 style=\"padding-left: 30px;\"><strong><span style=\"text-decoration: underline;\">2.1 The circuit</span> </strong></h3>\r\n&nbsp;\r\n\r\nThe NovaDrone contains 6 oscillators. Each oscillator outputs a square wave and a triangle wave.\r\n<span style=\"text-decoration: underline;\"><a name=\"schematic\"></a></span>The circuit which generates the oscillators is clean, simple and robust. They are generated using a remarkable device called an <strong>op amp</strong>. If you are interested in building synthesizers and don’t know where to start, read up on <strong>op amps</strong>. They are the key elements of most oscillators, filters, envelope generators, mixers and amps.\r\n<p style=\"padding-left: 30px;\"><span style=\"text-decoration: underline;\"><strong>Schematic</strong></span></p>\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/OSC2rc.jpg\"><img class=\"alignleft\" title=\"OSC2rc\" src=\"http://casperelectronics.com/wp-content/uploads/OSC2rc-200x163.jpg\" alt=\"\" width=\"200\" height=\"163\" /></a>­­Each channel of the NovaDrone (Red, green and blue) has 2 oscillators. These are shown in fig. 5 and <a name=\"feedbackloops\"></a>fig. 6. They are very similar to one another but have been calibrated for different purposes.\r\n<strong>Osc 1</strong> is an audio frequency oscillator. It has a coarse and fine tune adjustment and only operates at audible frequencies (20Hz-20kHz).\r\n<strong>Osc 2</strong> is calibrated as a low frequency oscillator (LFO) with cycles as long as 2 minutes. It has a range switch and a single adjustment knob.\r\n<p style=\"padding-left: 30px;\"><span style=\"text-decoration: underline;\"><strong>Feedback loops</strong></span></p>\r\nThe oscillator circuit is a feedback loop between two op amps that are <a href=\"http://casperelectronics.com/wp-content/uploads/OSC1rc.jpg\"><img class=\"alignleft\" title=\"OSC1rc\" src=\"http://casperelectronics.com/wp-content/uploads/OSC1rc-200x170.jpg\" alt=\"\" width=\"200\" height=\"170\" /></a>configured as a <strong>schmitt trigger</strong> and an <strong>inverting integrator</strong>.\r\nBasically an <em>integrator</em> turns square waves into triangle waves.\r\nA <em>Schmitt trigger</em> is a kind of comparator that turns modulating signals (like triangle waves) into square waves.\r\nThe key elements of the relationship between these two circuits is that they form a loop (Schmitt &gt; integrator &gt;Schmitt&gt;integrator&gt; etc…) and that the integrator is also an <strong>inverter</strong>. This creates a continuous cycle of modulation:\r\n1) Schmitt output goes HI.\r\n2) Integrator inverts Schmitt signal and outputs slope going down (LOW).\r\n3) When slope is near zero volts, Schmitt trigger is thrown and its’ output goes LOW.\r\n4) Integrator inverts and generates upward slope (HI).\r\n5) When integrator slope reaches peak, Schmitt trigger is thrown and output goes HI.\r\n<a name=\"rctimeconstant\"></a>6) etc……\r\nThis is an overly simplified explanation but enough for our purposes. Do more research on these valuable circuits once you are familiar with some of the basics of op-amps.\r\n<strong><span style=\"text-decoration: underline;\">RC (resistor capacitor)time constant</span></strong>\r\nIn both oscillators (fig. 5 and 6) the primary element which defines frequency is the <strong>RC time constant</strong>. This relationship is a core component of most oscillators and is worth reading up on.\r\n\r\nThe RC time constant is a period of time defined by the relationship between a resistor and a capacitor.\r\nThe equation for this is simply <strong>t =</strong> <strong>R*C</strong>. In the case of the oscillators above it would be <strong>t=R1*C1</strong>.\r\nUnfortunately calculating the frequency of an oscillator is more complicated than just calculating your RC constant.\r\nIn many oscillators (including this one) there is a schmitt trigger component which watches the rising or sinking voltage from the integrator. The Schmitt trigger activates when the slope reaches predefined upper and lower limits. In order to determine the frequency of an oscillator we need to know what our upper and lower limits are and then calculate how long it takes our wave (the output of the integrator) to travel from one limit to the other.\r\nThese limits are determined by the relationship of 2 resistors in the schmitt stage. In fig 5 and 6 these are R2 and R3.\r\nThe equation for determining the duration of one cycle is\r\n(1/4R1C1)*(R3/R4)\r\nIn Oscillator 2 <strong>R</strong><strong>1</strong> is a 500k potentiometer in series with a 4.7k resistor between pins 8 and 13 of the two op amps. <strong>C</strong><strong>1</strong> is one of the three capacitors between pins 13 and 14 of the rightmost op amp. One of these caps is selected using a three way switch on the NovaDrone circuit board. This controls the frequency range of the LFO.\r\nLet’s say the pot is all the way up (full resistance) and the middle cap has been selected. The equations for RC and subsequently the frequency is:\r\n<strong>R1=504,700 Ohms</strong>\r\n<a name=\"howitworks\"></a><strong>C1= .000022 Farads</strong>\r\n<strong>R2 = 8,300 Ohms</strong>\r\n<strong>R3 = 10,000 Ohms</strong>\r\n<strong>Frequency in Hz = (1 / 4*R</strong><strong>1C</strong><strong>1) * (R</strong><strong>3/R</strong><strong>2)</strong>\r\n<p style=\"padding-left: 30px;\"><span style=\"text-decoration: underline;\"><strong>How it works</strong></span></p>\r\nResistors limit the flow of current and capacitors store current. Current flows through the resistor and is stored in the capacitor. The resistor controls how much current flows into the capacitor per second. Therefore the size of capacitor and the amount of resistance will determine how long it takes to fill the capacitor. A common analogy is to think about current flow as water, the resistor as a spigot\r\n<h3><a name=\"2.2\"></a></h3>\r\nand the capacitor as a cup. The more you open the spigot (reduce resistance), the more water (electrical current) will flow and the faster the cup will fill (capacitor will charge). The oscillator circuit is configured in a special way which causes the capacitor to continuously charge and discharge. It is looking for two states from the cap, fully charged or fully discharged. When the cap reaches either of these states, the whole circuit reverses polarity and the capacitors charge status begins moving toward the opposite state. The amount of time it takes to charge and discharge is your cycle duration.\r\n<p style=\"padding-left: 30px;\"><span style=\"text-decoration: underline;\"><strong>2.2 pulse width modulation (pwm)</strong></span></p>\r\nPWM is exciting stuff….really! It is essentially a <strong>1 bit digital</strong> representation of an <strong>analog</strong> wave form.\r\nDigital wave forms only have 2 states, <strong>high</strong> and <strong>low</strong>. <strong>High</strong> is a voltage <em>at</em> or very close to the positive supply voltage. <strong>Low</strong> is a voltage <em>at</em> or very close to the negative supply voltage. It is basically just a square wave. Analog on the other hand is infinitely variable. Think about it like the difference between a light switch (digital) and a light dimmer (analog). PWM is a wave form that bridges the gap between these two formats. It can be used to make sound, control the brightness of an LED, control the speed of high torque motors and speak to microprocessors. It is also the language that a microprocessor will use to speak with the analog world.\r\nPulse Width (PW) refers to the relative durations of high and low voltage in a single <strong>cycle</strong> of a square wave.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/pulsewidth.jpg\"><img class=\"alignnone size-large wp-image-1648\" title=\"Pulsewidth\" src=\"http://casperelectronics.com/wp-content/uploads/pulsewidth-460x214.jpg\" alt=\"\" width=\"460\" height=\"214\" /></a><span style=\"color: #33cccc;\">Figure 7. Pulse width</span>\r\nFig. 7 shows three square wave oscillators of the same amplitude and frequency but with differing <strong>pulse width</strong>. The red oscillator has a 10% pulse width. That means the wave goes high for 10 % of the duration of one cycle. The green wave is 50% and the purple wave is 90%. What is important to note is that pulse width has nothing to do with frequency and only refers to the relationship between the high and low swing of the wave.\r\n<p style=\"padding-left: 30px;\"><strong><span style=\"text-decoration: underline;\">The Comparator</span></strong></p>\r\nThe job of a comparator is simple. Two signals are fed into the “+â€ and “-“ inputs (labeled 10 and 9 in fig. 8 respectively). If the voltage at the “+â€ input is <em>higher</em> than the “-“ input the output of the comparator goes <strong>high</strong>.<strong> </strong>If the “+â€ input drops below the “-“ input the output goes <strong>low</strong>.\r\nIn the NovaDrone t<a href=\"http://casperelectronics.com/wp-content/uploads/comparator.jpg\"><img class=\"alignleft\" title=\"Comparator\" src=\"http://casperelectronics.com/wp-content/uploads/comparator-200x76.jpg\" alt=\"\" width=\"200\" height=\"76\" /></a>he triangle output of Osc 1 and Osc 2 combine through a simple comparator (fig. 8) to make a single square wave with a modulating pulse width. In this way, the comparator also functions as a pulse width modulation processor.\r\n\r\nFig. 9 below shows how two triangle waves are transformed through the comparator into a square wave with a modulating pulse width.\r\nThe blue triangle wave in fig. 9 is oscillator 1. The red triangle is osc 2. The green line is the combined PWM output.\r\nAny time the blue line (osc 1) is above the red line (osc 2), the green line (pwm) goes high. As the red line rises the percentage of each cycle that the blue line is above the red line decreases. This changing percentage is what makes our modulating pulse width effect.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/PWM3-copy.jpg\"><img class=\"alignnone size-large wp-image-1647\" title=\"PWM3 Copy\" src=\"http://casperelectronics.com/wp-content/uploads/PWM3-copy-460x202.jpg\" alt=\"\" width=\"460\" height=\"202\" /></a><span style=\"color: #33cccc;\">Figure 9. Pulse width modulation detail</span>\r\n<p style=\"padding-left: 30px;\"><strong><span style=\"text-decoration: underline;\">Mixer</span></strong></p>\r\nThe audio signals from each of the three channels of the NovaDrone are mixed using the circuit in fig. 10.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/mixer.jpg\"><img class=\"alignleft\" title=\"Mixer\" src=\"http://casperelectronics.com/wp-content/uploads/mixer-200x135.jpg\" alt=\"\" width=\"200\" height=\"135\" /></a>This mixer is nice and simple and uses just one <strong>op amp</strong> and a few other components. This circuit is configured as an inverting mixer with an amplitude controlled by the <strong>feedback resistor</strong> and <strong>input resistors</strong>. The amplitude is calculated as RF/RI. In this case RF = 10,000 and RI = 100,000. That means the output signal is 1/10<sup>th</sup> the amplitude of the input signal.\r\n<strong><span style=\"text-decoration: underline;\">\r\n</span></strong>\r\n<p style=\"padding-left: 30px;\"><strong><span style=\"text-decoration: underline;\">LED drivers</span></strong></p>\r\n(3) 2N3904 NPN transistors are used to make 3 LED drivers.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/LEDdriver.jpg\"><img class=\"alignleft\" title=\"LEDdriver\" src=\"http://casperelectronics.com/wp-content/uploads/LEDdriver-200x108.jpg\" alt=\"\" width=\"200\" height=\"108\" /></a>A driver is a simple but important circuit which isolates elements which use lots of current (like LEDs) from sensitive circuits (like the oscillators in the NovaDrone). Failure to use a driver can result in something called a <strong>loading effect</strong> which basically means that the device being driven will affect the behavior of the rest of the circuit in bad ways, like the pitch changing when the lights turn on. The LED in the NovaDrone uses a lot of current relative to the rest of the circuit (90mA vs around 30mA for the rest of the circuit) therefore a driver is necessary. The key component of a driver is the <strong>transistor</strong>. This is another topic worth reading a lot about\r\n.\r\n\r\n</div>','NovaDrone Tech Manual',0,'','inherit','open','closed','','1704-revision-11','','','2012-11-05 15:33:45','2012-11-05 20:33:45','',1704,'http://casperelectronics.com/2012/11/05/1704-revision-11/',0,'revision','',0),(1717,2,'2012-11-05 15:40:36','2012-11-05 20:40:36','Throughout this guide I will attempt to give you some insight into the circuit theory and scientific principles at play in the NovaDrone. That said I will be giving little more than an intro to each topic and strongly encourage you to do further reading on topics you find interesting.\r\n<ul>\r\n	<li>This is a beta version of the <strong>NovaDrone Technical Guide</strong>. I expect to make revisions over time and eagerly encourage readers to send me feedback, questions, suggestions and especially corrections. Comments should be addressed to <a href=\"mailto:pete@casperelectronics.com\"><strong>pete@casperelectronics.com</strong></a>.</li>\r\n</ul>\r\n<h3 style=\"text-align: center;\"><span style=\"color: #000000;\"><strong>TABLE OF CONTENTS:</strong></span></h3>\r\n<a href=\"#sec1\"><strong><span style=\"text-decoration: underline;\">Section 1. Oscillator Primer</span></strong></a>\r\n<ul>\r\n	<li><a href=\"#1.1\"><strong>1.1 Frequency, amplitude &amp; wave shape</strong></a>\r\n<ul>\r\n	<li><a href=\"#frequency\">Frequency</a></li>\r\n	<li><a href=\"#amplitude\">Amplitude</a></li>\r\n	<li><a href=\"#waveshape\"> Wave shape</a></li>\r\n	<li><a href=\"#review\"> Review<strong></strong></a></li>\r\n</ul>\r\n</li>\r\n	<li><a href=\"#1.2\"><strong>1.2 Phase</strong></a>\r\n<ul>\r\n	<li><a href=\"#phase\"> Phase controlled amplitude modulation</a></li>\r\n</ul>\r\n</li>\r\n</ul>\r\n<a href=\"#sec2\"><strong><span style=\"text-decoration: underline;\">Section 2. NovaDrone Oscillators</span></strong></a>\r\n<ul>\r\n	<li><a href=\"#2.1\"><strong>2.1 The Circuit</strong></a>\r\n<ul>\r\n	<li><a href=\"#feedbackloops\"> Feedback loops</a></li>\r\n	<li><a href=\"#schematic\"> Schematic</a></li>\r\n	<li><a href=\"#rctimeconstant\"> RC time constant</a></li>\r\n	<li><a href=\"#howitworks\"> How it works<strong></strong></a></li>\r\n</ul>\r\n</li>\r\n	<li><a href=\"#2.2\"><strong>2.2 Pulse Width Modulation</strong></a>\r\n<ul>\r\n	<li><a href=\"#comparator\">The comparator<strong></strong></a></li>\r\n</ul>\r\n</li>\r\n</ul>\r\n<a name=\"sec1\"></a><a name=\"1.1\"></a><a href=\"#sec3\"><strong><span style=\"text-decoration: underline;\">Sectio</span></strong></a><a href=\"#sec3\"><strong><span style=\"text-decoration: underline;\">n 3. Drivers and Mixers </span>*incomplete*</strong></a>\r\n<ul>\r\n	<li><a href=\"#led\"> LED driver</a></li>\r\n	<li><a href=\"#mixer\">Signal mixer</a><strong></strong></li>\r\n</ul>\r\n<p style=\"text-align: center;\"><strong>SECTION 1. OSCILLATOR PRIMER <strong></strong></strong></p>\r\n<p style=\"text-align: center;\"><span style=\"text-decoration: underline;\"><strong style=\"text-align: center;\"><strong>1.1 Frequency, amplitude and wave shape</strong></strong></span></p>\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/ampandfreq.jpg\"><img class=\"alignleft size-medium wp-image-1636\" title=\"Figure 1. A triangle wave oscillator\" src=\"http://casperelectronics.com/wp-content/uploads/ampandfreq-200x242.jpg\" alt=\"\" width=\"200\" height=\"242\" /></a>\r\n<div>\r\n\r\nThe heart of the NovaDrone is a bank of six independent oscillators.\r\n\r\n</div>\r\nAn oscillator is simply a pattern which repeats indefinitely. This can be a pattern of light, movement, electricity, even life cycles of organisms. The <a href=\"http://en.wikipedia.org/wiki/Oscillation\">wikipedia entry</a> gives dozens of examples of different kinds of oscillation.\r\n\r\nWhat we are most interested in is the modulation (changing amplitude) of electricity. All of the electrically produced sound we hear is a repeating pattern of fluctuating electrical current.\r\n\r\n&nbsp;\r\n\r\n<address> </address><address><em><span style=\"color: #33cccc;\">Figure 1. triangle oscillator</span></em></address>When this is applied to a speaker, the current activates a coil in the speaker which pushes the cone of the speaker away from or towards a fixed magnet. This action vibrates the air in front of the speaker which in turn vibrates the air in front of that and so on until that vibrations hit our ear drums and are perceived as sound. The sounds we hear around us are all incredibly complex patterns of air pressure modulation.\r\n<div>\r\n<ul>\r\n	<li><strong>The red line in fig 1 represents a voltage which goes up and down over a period of time. This is an oscillator.</strong></li>\r\n</ul>\r\nThere are three basic factors that make up all oscillators: <a name=\"frequency\"></a><strong>frequency</strong>, <strong>amplitude</strong> and <strong>wave shape</strong>. In musical terms we would call these <strong>pitch</strong>, <strong>volume</strong> and <strong>timbre</strong>. I will also talk a fair amount about <strong>phase </strong>which is relevant when working with multiple oscillators and plays an important role in creating drones.\r\n<blockquote>\r\n<ul>\r\n	<li><span style=\"text-decoration: underline;\"><strong>Frequency</strong></span></li>\r\n</ul>\r\n</blockquote>\r\nOne complete sweep up and down is called a <strong>cycle</strong>. The number of cycles per second is your <strong>Frequency</strong> or <strong>Pitch</strong>.<strong></strong>\r\n<strong>Frequency</strong> is commonly measured in <strong>Hertz</strong>, which is the number of cycles per second.\r\n<a name=\"amplitude\"></a><strong>Pitch</strong> is another term for frequency which is used <span style=\"text-decoration: underline;\">only</span> when referring to the frequency of an audio signal.\r\nFigure 1 shows a triangle wave with a cycle length of .5 seconds. The frequency of this wave would be determined by seeing how many cycles will occur in 1 second. In this case there are 2 complete cycles in 1 second. That means the wave has a frequency of 2 Hertz. This is well below the hearing range. Humans can hear oscillators between 20Hz and 20,000 Hz.\r\n<blockquote>\r\n<ul>\r\n	<li><span style=\"text-decoration: underline;\"><strong>Amplitude</strong></span></li>\r\n</ul>\r\n</blockquote>\r\nAmplitude refers to the magnitude of voltage change across one cycle of an oscillation.\r\n<a name=\"waveshape\"></a>This in turn impacts the volume of the signal if it is sent to a speaker.\r\nThe image above shows a triangle wave with a positive peak of +5 volts and a negative peak of -5 volts. The amplitude is determined by figuring the absolute difference between these peaks. In this case that difference is 10 volts. This is commonly referred to as 10 Vpk-pk (10 volts peak to peak). There are many different ways to measure amplitude (pk-pk, RMS, Vp, etc…) but we’ll just be talking about Vpk-pk.\r\n<blockquote>\r\n<ul>\r\n	<li><span style=\"text-decoration: underline;\"><strong>Wave shape</strong></span><a href=\"http://casperelectronics.com/wp-content/uploads/waveshapes.png\"><img class=\"alignright\" title=\"Waveshapes\" src=\"http://casperelectronics.com/wp-content/uploads/waveshapes-200x160.png\" alt=\"\" width=\"292\" height=\"233\" /></a></li>\r\n</ul>\r\n</blockquote>\r\nThe wave shape is the pattern of amplitude modulation over the course of a cycle. The waveforms in fig 2 are: Sine, ramp, triangle and square.Sine, triangle and square are the most common and are all symmetrical waves. That means the positive and negative portions of each cycle are of the same duration. Many musical synthesizers offer other wave forms which are asymmetrical versions of these common waves such as ramp, saw and pulse waves.\r\n<p style=\"text-align: right;\"><span style=\"color: #33cccc;\"> Figure 2. Waveshapes  </span></p>\r\nThe importance and impact of wave shape depends on its application. Many audio effects such as <strong>tremolo</strong> or <strong>phaser</strong> use low frequency oscillators (LFOs) to modulate certain parameters of the sound. It is commonly more desirable to use a sine or triangle wave for many of these effects such as the tremolo which\r\n<a name=\"review\"></a>fades the volume in and out. Using a square wave for this would create dramatic shifts in volume which can be unpleasant.\r\nMany natural sounds are synthesized using overlapping wave forms like those shown above. For instance a flute can be synthesized using several octaves of a sine wave. A horn on the other hand will use more square waves and maybe a triangle or saw wave. More advanced wave and synthesis theory sites the sine wave as the basis of all wave forms. It is shown how even square waves can be created by combining several sine waves.\r\n<ul>\r\n	<li><span style=\"text-decoration: underline;\"><strong>Review</strong></span></li>\r\n</ul>\r\nThe basic components of an oscillator are:\r\n<h3><a name=\"1.2\"></a></h3>\r\n<ul>\r\n	<li><strong>Frequency</strong>. The number of oscillation cycles that occur in one second. Measured in Hz</li>\r\n	<li><strong>Amplitude</strong>. Magnitude of voltage sweep in one cycle of an oscillator. Measured in Volts or Vpk-pk (volts peak to peak)</li>\r\n	<li><strong>Wave shape</strong>. Sine, triangle, square</li>\r\n</ul>\r\n<p style=\"padding-left: 30px; text-align: center;\"><strong><span style=\"text-decoration: underline;\">1.2 Phase</span></strong></p>\r\nPhase is a bit more complicated than the other terms but plays an important role in audio circuitry and especially in making drones. Phase refers to a particular position in a <span style=\"text-decoration: underline;\">single cycle</span> of a wave (such as the positive or negative peak) and is measured in degrees. It is most commonly used to describe the relationship between multiple waves.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/phasedegrees.jpg\"><img class=\"alignnone size-large wp-image-1643\" title=\"Phasedegrees\" src=\"http://casperelectronics.com/wp-content/uploads/phasedegrees-460x236.jpg\" alt=\"\" width=\"460\" height=\"236\" /></a><span style=\"color: #33cccc;\">Figure 3. Phase</span>\r\nFig. 3 shows two sine waves (red &amp; blue) of identical amplitude and frequency. The green oscillator is the mix or <em>average</em> of the red and blue oscillators.\r\nPhase is measured in degrees with 360 degrees being one complete cycle. 180 degrees is exactly ½ of a cycle.\r\nIn fig. 3 the phase of the blue oscillator is offset at 45 degree increments from the red oscillator from left to right. With each step you’ll notice that the waves get farther apart and that the amplitude of the green (average) oscillator decreases.\r\nThis may seem confusing at first but it’s really quite simple. The green oscillator is the average of the red and blue oscillators. Let’s say the red and blue oscillators sweep from -5 to +5VDC (10Vp-p). Now look at the right most illustration of the 2 waves out of phase by 180 degrees. When the blue wave is at its positive peak (90 degrees) of +5 volts, the red wave is at it’s negative peak (270 degrees) of -5 volts.\r\nWhat is the average of -5 and +5? Zero. They are always going to be the opposites of each other so the average will always be zero. Now look at the 90 degree image. When Blue is at +5 volts/90 degrees, red is at 0 volts/zero degrees. The average of +5 and zero is 2.5 volts.\r\nThe important thing to take away from the info above is that the amplitude of an oscillator created by mixing two similar oscillators is relative to the difference in phase of the two source waves.\r\nIn fig. 3 the oscillators have identical frequencies. This means that the phase relationship once established will remain the same and the resulting averaged amplitude of the two waves will also remain the same.\r\n<strong>Q: What will happen if the frequencies of your two waves are NOT identical? </strong>\r\nWe established above that the amplitude of the averaged waveform is relative to the phase difference of the two wave forms, therefore as the phase difference of two waves increases and decreases so too will the averaged waveforms’ amplitude. What we have here is phase controlled amplitude modulation and the rate of phase modulation is controlled by the frequency difference between your two oscillators.\r\nIn fig. 4 the blue oscillator has a frequency of 10 Hz, the red is 11Hz. That means that it takes the red wave 1/10<sup>th</sup> of a second longer to complete a cycle than the blue wave. You can see that with each cycle the red wave lags a little bit further behind the blue wave which increases the phase difference between the two. As a result, the amplitude of the averaged wave (green) decreases as the phase offset approaches 180 degrees and then increases as it continues past 180 to 360 degrees.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/phaseModulation.jpg\"><img class=\"alignnone size-large wp-image-1644\" title=\"PhaseModulation\" src=\"http://casperelectronics.com/wp-content/uploads/phaseModulation-460x202.jpg\" alt=\"\" width=\"460\" height=\"202\" /></a><a href=\"http://casperelectronics.com/wp-content/uploads/phase_modulation2.jpg\"><img class=\"alignnone size-large wp-image-1645\" title=\"Phase Modulation2\" src=\"http://casperelectronics.com/wp-content/uploads/phase_modulation2-460x220.jpg\" alt=\"\" width=\"460\" height=\"220\" /></a><a name=\"sec2\"></a><span style=\"color: #33cccc;\">Figure 4. Phase controlled amplitude</span>\r\n<h3><a name=\"2.1\"></a></h3>\r\nThis phenomenon of phase controlled amplitude is something many musicians use without even realizing it. This is the vary trick one uses when tuning a guitar. You tune one string to the other until the “beatingâ€ effect slows and eventually disappears.\r\n<h3 style=\"text-align: center;\"><strong>SECTION 2. NOVADRONE OSCILLATORS</strong></h3>\r\n<h3 style=\"text-align: center;\"><strong><span style=\"text-decoration: underline;\">2.1 The circuit</span> </strong></h3>\r\n&nbsp;\r\n\r\nThe NovaDrone contains 6 oscillators. Each oscillator outputs a square wave and a triangle wave.\r\n<span style=\"text-decoration: underline;\"><a name=\"schematic\"></a></span>The circuit which generates the oscillators is clean, simple and robust. They are generated using a remarkable device called an <strong>op amp</strong>. If you are interested in building synthesizers and don’t know where to start, read up on <strong>op amps</strong>. They are the key elements of most oscillators, filters, envelope generators, mixers and amps.\r\n<ul>\r\n	<li><span style=\"text-decoration: underline;\"><strong>Schematic</strong></span></li>\r\n</ul>\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/OSC2rc.jpg\"><img class=\"alignleft\" title=\"OSC2rc\" src=\"http://casperelectronics.com/wp-content/uploads/OSC2rc-200x163.jpg\" alt=\"\" width=\"200\" height=\"163\" /></a>­­Each channel of the NovaDrone (Red, green and blue) has 2 oscillators. These are shown in fig. 5 and <a name=\"feedbackloops\"></a>fig. 6. They are very similar to one another but have been calibrated for different purposes.\r\n<strong>Osc 1</strong> is an audio frequency oscillator. It has a coarse and fine tune adjustment and only operates at audible frequencies (20Hz-20kHz).\r\n<strong>Osc 2</strong> is calibrated as a low frequency oscillator (LFO) with cycles as long as 2 minutes. It has a range switch and a single adjustment knob.\r\n<ul>\r\n	<li><span style=\"text-decoration: underline;\"><strong>Feedback loops</strong></span></li>\r\n</ul>\r\nThe oscillator circuit is a feedback loop between two op amps that are <a href=\"http://casperelectronics.com/wp-content/uploads/OSC1rc.jpg\"><img class=\"alignleft\" title=\"OSC1rc\" src=\"http://casperelectronics.com/wp-content/uploads/OSC1rc-200x170.jpg\" alt=\"\" width=\"200\" height=\"170\" /></a>configured as a <strong>schmitt trigger</strong> and an <strong>inverting integrator</strong>.\r\nBasically an <em>integrator</em> turns square waves into triangle waves.\r\nA <em>Schmitt trigger</em> is a kind of comparator that turns modulating signals (like triangle waves) into square waves.\r\nThe key elements of the relationship between these two circuits is that they form a loop (Schmitt &gt; integrator &gt;Schmitt&gt;integrator&gt; etc…) and that the integrator is also an <strong>inverter</strong>. This creates a continuous cycle of modulation:\r\n1) Schmitt output goes HI.\r\n2) Integrator inverts Schmitt signal and outputs slope going down (LOW).\r\n3) When slope is near zero volts, Schmitt trigger is thrown and its’ output goes LOW.\r\n4) Integrator inverts and generates upward slope (HI).\r\n5) When integrator slope reaches peak, Schmitt trigger is thrown and output goes HI.\r\n<a name=\"rctimeconstant\"></a>6) etc……\r\nThis is an overly simplified explanation but enough for our purposes. Do more research on these valuable circuits once you are familiar with some of the basics of op-amps.\r\n<strong><span style=\"text-decoration: underline;\">RC (resistor capacitor)time constant</span></strong>\r\nIn both oscillators (fig. 5 and 6) the primary element which defines frequency is the <strong>RC time constant</strong>. This relationship is a core component of most oscillators and is worth reading up on.\r\n\r\nThe RC time constant is a period of time defined by the relationship between a resistor and a capacitor.\r\nThe equation for this is simply <strong>t =</strong> <strong>R*C</strong>. In the case of the oscillators above it would be <strong>t=R1*C1</strong>.\r\nUnfortunately calculating the frequency of an oscillator is more complicated than just calculating your RC constant.\r\nIn many oscillators (including this one) there is a schmitt trigger component which watches the rising or sinking voltage from the integrator. The Schmitt trigger activates when the slope reaches predefined upper and lower limits. In order to determine the frequency of an oscillator we need to know what our upper and lower limits are and then calculate how long it takes our wave (the output of the integrator) to travel from one limit to the other.\r\nThese limits are determined by the relationship of 2 resistors in the schmitt stage. In fig 5 and 6 these are R2 and R3.\r\nThe equation for determining the duration of one cycle is\r\n(1/4R1C1)*(R3/R4)\r\nIn Oscillator 2 <strong>R</strong><strong>1</strong> is a 500k potentiometer in series with a 4.7k resistor between pins 8 and 13 of the two op amps. <strong>C</strong><strong>1</strong> is one of the three capacitors between pins 13 and 14 of the rightmost op amp. One of these caps is selected using a three way switch on the NovaDrone circuit board. This controls the frequency range of the LFO.\r\nLet’s say the pot is all the way up (full resistance) and the middle cap has been selected. The equations for RC and subsequently the frequency is:\r\n<strong>R1=504,700 Ohms</strong>\r\n<a name=\"howitworks\"></a><strong>C1= .000022 Farads</strong>\r\n<strong>R2 = 8,300 Ohms</strong>\r\n<strong>R3 = 10,000 Ohms</strong>\r\n<strong>Frequency in Hz = (1 / 4*R</strong><strong>1C</strong><strong>1) * (R</strong><strong>3/R</strong><strong>2)</strong>\r\n<ul>\r\n	<li><span style=\"text-decoration: underline;\"><strong>How it works</strong></span></li>\r\n</ul>\r\nResistors limit the flow of current and capacitors store current. Current flows through the resistor and is stored in the capacitor. The resistor controls how much current flows into the capacitor per second. Therefore the size of capacitor and the amount of resistance will determine how long it takes to fill the capacitor. A common analogy is to think about current flow as water, the resistor as a spigot\r\n<h3><a name=\"2.2\"></a></h3>\r\nand the capacitor as a cup. The more you open the spigot (reduce resistance), the more water (electrical current) will flow and the faster the cup will fill (capacitor will charge). The oscillator circuit is configured in a special way which causes the capacitor to continuously charge and discharge. It is looking for two states from the cap, fully charged or fully discharged. When the cap reaches either of these states, the whole circuit reverses polarity and the capacitors charge status begins moving toward the opposite state. The amount of time it takes to charge and discharge is your cycle duration.\r\n<p style=\"text-align: center;\"><span style=\"text-decoration: underline;\"><strong>2.2 pulse width modulation (pwm)</strong></span></p>\r\nPWM is exciting stuff….really! It is essentially a <strong>1 bit digital</strong> representation of an <strong>analog</strong> wave form.\r\nDigital wave forms only have 2 states, <strong>high</strong> and <strong>low</strong>. <strong>High</strong> is a voltage <em>at</em> or very close to the positive supply voltage. <strong>Low</strong> is a voltage <em>at</em> or very close to the negative supply voltage. It is basically just a square wave. Analog on the other hand is infinitely variable. Think about it like the difference between a light switch (digital) and a light dimmer (analog). PWM is a wave form that bridges the gap between these two formats. It can be used to make sound, control the brightness of an LED, control the speed of high torque motors and speak to microprocessors. It is also the language that a microprocessor will use to speak with the analog world.\r\nPulse Width (PW) refers to the relative durations of high and low voltage in a single <strong>cycle</strong> of a square wave.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/pulsewidth.jpg\"><img class=\"alignnone size-large wp-image-1648\" title=\"Pulsewidth\" src=\"http://casperelectronics.com/wp-content/uploads/pulsewidth-460x214.jpg\" alt=\"\" width=\"460\" height=\"214\" /></a><span style=\"color: #33cccc;\">Figure 7. Pulse width</span>\r\nFig. 7 shows three square wave oscillators of the same amplitude and frequency but with differing <strong>pulse width</strong>. The red oscillator has a 10% pulse width. That means the wave goes high for 10 % of the duration of one cycle. The green wave is 50% and the purple wave is 90%. What is important to note is that pulse width has nothing to do with frequency and only refers to the relationship between the high and low swing of the wave.\r\n<ul>\r\n	<li><strong><span style=\"text-decoration: underline;\">The Comparator</span></strong></li>\r\n</ul>\r\nThe job of a comparator is simple. Two signals are fed into the “+â€ and “-“ inputs (labeled 10 and 9 in fig. 8 respectively). If the voltage at the “+â€ input is <em>higher</em> than the “-“ input the output of the comparator goes <strong>high</strong>.<strong> </strong>If the “+â€ input drops below the “-“ input the output goes <strong>low</strong>.\r\nIn the NovaDrone t<a href=\"http://casperelectronics.com/wp-content/uploads/comparator.jpg\"><img class=\"alignleft\" title=\"Comparator\" src=\"http://casperelectronics.com/wp-content/uploads/comparator-200x76.jpg\" alt=\"\" width=\"200\" height=\"76\" /></a>he triangle output of Osc 1 and Osc 2 combine through a simple comparator (fig. 8) to make a single square wave with a modulating pulse width. In this way, the comparator also functions as a pulse width modulation processor.\r\n\r\nFig. 9 below shows how two triangle waves are transformed through the comparator into a square wave with a modulating pulse width.\r\nThe blue triangle wave in fig. 9 is oscillator 1. The red triangle is osc 2. The green line is the combined PWM output.\r\nAny time the blue line (osc 1) is above the red line (osc 2), the green line (pwm) goes high. As the red line rises the percentage of each cycle that the blue line is above the red line decreases. This changing percentage is what makes our modulating pulse width effect.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/PWM3-copy.jpg\"><img class=\"alignnone size-large wp-image-1647\" title=\"PWM3 Copy\" src=\"http://casperelectronics.com/wp-content/uploads/PWM3-copy-460x202.jpg\" alt=\"\" width=\"460\" height=\"202\" /></a>\r\n\r\n<span style=\"color: #33cccc;\">Figure 9. Pulse width modulation detail</span>\r\n<ul>\r\n	<li><strong><span style=\"text-decoration: underline;\">Mixer</span></strong></li>\r\n</ul>\r\nThe audio signals from each of the three channels of the NovaDrone are mixed using the circuit in fig. 10.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/mixer.jpg\"><img class=\"alignleft\" title=\"Mixer\" src=\"http://casperelectronics.com/wp-content/uploads/mixer-200x135.jpg\" alt=\"\" width=\"200\" height=\"135\" /></a>This mixer is nice and simple and uses just one <strong>op amp</strong> and a few other components. This circuit is configured as an inverting mixer with an amplitude controlled by the <strong>feedback resistor</strong> and <strong>input resistors</strong>. The amplitude is calculated as RF/RI. In this case RF = 10,000 and RI = 100,000. That means the output signal is 1/10<sup>th</sup> the amplitude of the input signal.\r\n<strong><span style=\"text-decoration: underline;\">\r\n</span></strong>\r\n<ul>\r\n	<li><strong><span style=\"text-decoration: underline;\">LED drivers</span></strong></li>\r\n</ul>\r\n(3) 2N3904 NPN transistors are used to make 3 LED drivers.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/LEDdriver.jpg\"><img class=\"alignleft\" title=\"LEDdriver\" src=\"http://casperelectronics.com/wp-content/uploads/LEDdriver-200x108.jpg\" alt=\"\" width=\"200\" height=\"108\" /></a>A driver is a simple but important circuit which isolates elements which use lots of current (like LEDs) from sensitive circuits (like the oscillators in the NovaDrone). Failure to use a driver can result in something called a <strong>loading effect</strong> which basically means that the device being driven will affect the behavior of the rest of the circuit in bad ways, like the pitch changing when the lights turn on. The LED in the NovaDrone uses a lot of current relative to the rest of the circuit (90mA vs around 30mA for the rest of the circuit) therefore a driver is necessary. The key component of a driver is the <strong>transistor</strong>. This is another topic worth reading a lot about\r\n.\r\n\r\n</div>','NovaDrone Tech Manual',0,'','inherit','open','closed','','1704-revision-12','','','2012-11-05 15:40:36','2012-11-05 20:40:36','',1704,'http://casperelectronics.com/2012/11/05/1704-revision-12/',0,'revision','',0),(1719,2,'2012-11-05 15:49:30','2012-11-05 20:49:30','Throughout this guide I will attempt to give you some insight into the circuit theory and scientific principles at play in the NovaDrone. That said I will be giving little more than an intro to each topic and strongly encourage you to do further reading on topics you find interesting.\r\n<ul>\r\n	<li>This is a beta version of the <strong>NovaDrone Technical Guide</strong>. I expect to make revisions over time and eagerly encourage readers to send me feedback, questions, suggestions and especially corrections. Comments should be addressed to <a href=\"mailto:pete@casperelectronics.com\"><strong>pete@casperelectronics.com</strong></a>.</li>\r\n</ul>\r\n<h3 style=\"text-align: center;\"><span style=\"color: #000000;\"><strong>TABLE OF CONTENTS:</strong></span></h3>\r\n<a href=\"#sec1\"><strong><span style=\"text-decoration: underline;\">Section 1. Oscillator Primer</span></strong></a>\r\n<ul>\r\n	<li><a href=\"#1.1\"><strong>1.1 Frequency, amplitude &amp; wave shape</strong></a>\r\n<ul>\r\n	<li><a href=\"#frequency\">Frequency</a></li>\r\n	<li><a href=\"#amplitude\">Amplitude</a></li>\r\n	<li><a href=\"#waveshape\"> Wave shape</a></li>\r\n	<li><a href=\"#review\"> Review<strong></strong></a></li>\r\n</ul>\r\n</li>\r\n	<li><a href=\"#1.2\"><strong>1.2 Phase</strong></a>\r\n<ul>\r\n	<li><a href=\"#phase\"> Phase controlled amplitude modulation</a></li>\r\n</ul>\r\n</li>\r\n</ul>\r\n<a href=\"#sec2\"><strong><span style=\"text-decoration: underline;\">Section 2. NovaDrone Oscillators</span></strong></a>\r\n<ul>\r\n	<li><a href=\"#2.1\"><strong>2.1 The Circuit</strong></a>\r\n<ul>\r\n	<li><a href=\"#feedbackloops\"> Feedback loops</a></li>\r\n	<li><a href=\"#schematic\"> Schematic</a></li>\r\n	<li><a href=\"#rctimeconstant\"> RC time constant</a></li>\r\n	<li><a href=\"#howitworks\"> How it works<strong></strong></a></li>\r\n</ul>\r\n</li>\r\n	<li><a href=\"#2.2\"><strong>2.2 Pulse Width Modulation</strong></a>\r\n<ul>\r\n	<li><a href=\"#comparator\">The comparator<strong></strong></a></li>\r\n</ul>\r\n</li>\r\n</ul>\r\n<a name=\"sec1\"></a><a name=\"1.1\"></a><a href=\"#sec3\"><strong><span style=\"text-decoration: underline;\">Sectio</span></strong></a><a href=\"#sec3\"><strong><span style=\"text-decoration: underline;\">n 3. Drivers and Mixers </span>*incomplete*</strong></a>\r\n<ul>\r\n	<li><a href=\"#led\"> LED driver</a></li>\r\n	<li><a href=\"#mixer\">Signal mixer</a><strong></strong></li>\r\n</ul>\r\n<h2 style=\"text-align: left;\"><span style=\"color: #000080;\"><strong>SECTION 1. OSCILLATOR PRIMER</strong></span></h2>\r\n<span style=\"color: #000080;\"><strong style=\"text-align: center;\"><strong>◊ 1.1 Frequency, amplitude and wave shape◊</strong></strong></span>\r\n\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/ampandfreq.jpg\"><img class=\"alignleft size-medium wp-image-1636\" title=\"Figure 1. A triangle wave oscillator\" src=\"http://casperelectronics.com/wp-content/uploads/ampandfreq-200x242.jpg\" alt=\"\" width=\"200\" height=\"242\" /></a>\r\n<div>\r\n\r\nThe heart of the NovaDrone is a bank of six independent oscillators.\r\n\r\n</div>\r\nAn oscillator is simply a pattern which repeats indefinitely. This can be a pattern of light, movement, electricity, even life cycles of organisms. The <a href=\"http://en.wikipedia.org/wiki/Oscillation\">wikipedia entry</a> gives dozens of examples of different kinds of oscillation.\r\n\r\nWhat we are most interested in is the modulation (changing amplitude) of electricity. All of the electrically produced sound we hear is a repeating pattern of fluctuating electrical current.\r\n\r\n&nbsp;\r\n\r\n<address> </address><address><em><span style=\"color: #33cccc;\">Figure 1. triangle oscillator</span></em></address>When this is applied to a speaker, the current activates a coil in the speaker which pushes the cone of the speaker away from or towards a fixed magnet. This action vibrates the air in front of the speaker which in turn vibrates the air in front of that and so on until that vibrations hit our ear drums and are perceived as sound. The sounds we hear around us are all incredibly complex patterns of air pressure modulation.\r\n<div>\r\n<ul>\r\n	<li><strong>The red line in fig 1 represents a voltage which goes up and down over a period of time. This is an oscillator.</strong></li>\r\n</ul>\r\nThere are three basic factors that make up all oscillators: <a name=\"frequency\"></a><strong>frequency</strong>, <strong>amplitude</strong> and <strong>wave shape</strong>. In musical terms we would call these <strong>pitch</strong>, <strong>volume</strong> and <strong>timbre</strong>. I will also talk a fair amount about <strong>phase </strong>which is relevant when working with multiple oscillators and plays an important role in creating drones.\r\n<ul>\r\n	<li><span style=\"text-decoration: underline;\"><strong>Frequency</strong></span></li>\r\n</ul>\r\nOne complete sweep up and down is called a <strong>cycle</strong>. The number of cycles per second is your <strong>Frequency</strong> or <strong>Pitch</strong>.<strong></strong>\r\n<strong>Frequency</strong> is commonly measured in <strong>Hertz</strong>, which is the number of cycles per second.\r\n<a name=\"amplitude\"></a><strong>Pitch</strong> is another term for frequency which is used <span style=\"text-decoration: underline;\">only</span> when referring to the frequency of an audio signal.\r\nFigure 1 shows a triangle wave with a cycle length of .5 seconds. The frequency of this wave would be determined by seeing how many cycles will occur in 1 second. In this case there are 2 complete cycles in 1 second. That means the wave has a frequency of 2 Hertz. This is well below the hearing range. Humans can hear oscillators between 20Hz and 20,000 Hz.\r\n<ul>\r\n	<li><span style=\"text-decoration: underline;\"><strong>Amplitude</strong></span></li>\r\n</ul>\r\nAmplitude refers to the magnitude of voltage change across one cycle of an oscillation.\r\n<a name=\"waveshape\"></a>This in turn impacts the volume of the signal if it is sent to a speaker.\r\nThe image above shows a triangle wave with a positive peak of +5 volts and a negative peak of -5 volts. The amplitude is determined by figuring the absolute difference between these peaks. In this case that difference is 10 volts. This is commonly referred to as 10 Vpk-pk (10 volts peak to peak). There are many different ways to measure amplitude (pk-pk, RMS, Vp, etc…) but we’ll just be talking about Vpk-pk.\r\n<ul>\r\n	<li><span style=\"text-decoration: underline;\"><strong>Wave shape</strong></span><a href=\"http://casperelectronics.com/wp-content/uploads/waveshapes.png\"><img class=\"alignright\" title=\"Waveshapes\" src=\"http://casperelectronics.com/wp-content/uploads/waveshapes-200x160.png\" alt=\"\" width=\"292\" height=\"233\" /></a></li>\r\n</ul>\r\nThe wave shape is the pattern of amplitude modulation over the course of a cycle. The waveforms in fig 2 are: Sine, ramp, triangle and square.Sine, triangle and square are the most common and are all symmetrical waves. That means the positive and negative portions of each cycle are of the same duration. Many musical synthesizers offer other wave forms which are asymmetrical versions of these common waves such as ramp, saw and pulse waves.\r\n<p style=\"text-align: right;\"><span style=\"color: #33cccc;\"> Figure 2. Waveshapes  </span></p>\r\nThe importance and impact of wave shape depends on its application. Many audio effects such as <strong>tremolo</strong> or <strong>phaser</strong> use low frequency oscillators (LFOs) to modulate certain parameters of the sound. It is commonly more desirable to use a sine or triangle wave for many of these effects such as the tremolo which\r\n<a name=\"review\"></a>fades the volume in and out. Using a square wave for this would create dramatic shifts in volume which can be unpleasant.\r\nMany natural sounds are synthesized using overlapping wave forms like those shown above. For instance a flute can be synthesized using several octaves of a sine wave. A horn on the other hand will use more square waves and maybe a triangle or saw wave. More advanced wave and synthesis theory sites the sine wave as the basis of all wave forms. It is shown how even square waves can be created by combining several sine waves.\r\n<ul>\r\n	<li><span style=\"text-decoration: underline;\"><strong>Review</strong></span></li>\r\n</ul>\r\nThe basic components of an oscillator are:\r\n<h3><a name=\"1.2\"></a></h3>\r\n<ul>\r\n	<li><strong>Frequency</strong>. The number of oscillation cycles that occur in one second. Measured in Hz</li>\r\n	<li><strong>Amplitude</strong>. Magnitude of voltage sweep in one cycle of an oscillator. Measured in Volts or Vpk-pk (volts peak to peak)</li>\r\n	<li><strong>Wave shape</strong>. Sine, triangle, square</li>\r\n</ul>\r\n<div></div>\r\n<h3 style=\"text-align: left;\"><span style=\"color: #000080;\"><strong>◊1.2 Phase◊</strong></span></h3>\r\nPhase is a bit more complicated than the other terms but plays an important role in audio circuitry and especially in making drones. Phase refers to a particular position in a <span style=\"text-decoration: underline;\">single cycle</span> of a wave (such as the positive or negative peak) and is measured in degrees. It is most commonly used to describe the relationship between multiple waves.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/phasedegrees.jpg\"><img class=\"alignnone size-large wp-image-1643\" title=\"Phasedegrees\" src=\"http://casperelectronics.com/wp-content/uploads/phasedegrees-460x236.jpg\" alt=\"\" width=\"460\" height=\"236\" /></a>\r\n\r\n<span style=\"color: #33cccc;\">Figure 3. Phase</span>\r\nFig. 3 shows two sine waves (red &amp; blue) of identical amplitude and frequency. The green oscillator is the mix or <em>average</em> of the red and blue oscillators.\r\nPhase is measured in degrees with 360 degrees being one complete cycle. 180 degrees is exactly ½ of a cycle.\r\nIn fig. 3 the phase of the blue oscillator is offset at 45 degree increments from the red oscillator from left to right. With each step you’ll notice that the waves get farther apart and that the amplitude of the green (average) oscillator decreases.\r\nThis may seem confusing at first but it’s really quite simple. The green oscillator is the average of the red and blue oscillators. Let’s say the red and blue oscillators sweep from -5 to +5VDC (10Vp-p). Now look at the right most illustration of the 2 waves out of phase by 180 degrees. When the blue wave is at its positive peak (90 degrees) of +5 volts, the red wave is at it’s negative peak (270 degrees) of -5 volts.\r\nWhat is the average of -5 and +5? Zero. They are always going to be the opposites of each other so the average will always be zero. Now look at the 90 degree image. When Blue is at +5 volts/90 degrees, red is at 0 volts/zero degrees. The average of +5 and zero is 2.5 volts.\r\nThe important thing to take away from the info above is that the amplitude of an oscillator created by mixing two similar oscillators is relative to the difference in phase of the two source waves.\r\nIn fig. 3 the oscillators have identical frequencies. This means that the phase relationship once established will remain the same and the resulting averaged amplitude of the two waves will also remain the same.\r\n<strong>Q: What will happen if the frequencies of your two waves are NOT identical? </strong>\r\nWe established above that the amplitude of the averaged waveform is relative to the phase difference of the two wave forms, therefore as the phase difference of two waves increases and decreases so too will the averaged waveforms’ amplitude. What we have here is phase controlled amplitude modulation and the rate of phase modulation is controlled by the frequency difference between your two oscillators.\r\nIn fig. 4 the blue oscillator has a frequency of 10 Hz, the red is 11Hz. That means that it takes the red wave 1/10<sup>th</sup> of a second longer to complete a cycle than the blue wave. You can see that with each cycle the red wave lags a little bit further behind the blue wave which increases the phase difference between the two. As a result, the amplitude of the averaged wave (green) decreases as the phase offset approaches 180 degrees and then increases as it continues past 180 to 360 degrees.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/phaseModulation.jpg\"><img class=\"alignnone size-large wp-image-1644\" title=\"PhaseModulation\" src=\"http://casperelectronics.com/wp-content/uploads/phaseModulation-460x202.jpg\" alt=\"\" width=\"460\" height=\"202\" /></a><a href=\"http://casperelectronics.com/wp-content/uploads/phase_modulation2.jpg\"><img class=\"alignnone size-large wp-image-1645\" title=\"Phase Modulation2\" src=\"http://casperelectronics.com/wp-content/uploads/phase_modulation2-460x220.jpg\" alt=\"\" width=\"460\" height=\"220\" /></a><a name=\"sec2\"></a><span style=\"color: #33cccc;\">Figure 4. Phase controlled amplitude</span>\r\n<h3><a name=\"2.1\"></a></h3>\r\nThis phenomenon of phase controlled amplitude is something many musicians use without even realizing it. This is the vary trick one uses when tuning a guitar. You tune one string to the other until the “beatingâ€ effect slows and eventually disappears.\r\n\r\n&nbsp;\r\n<p style=\"text-align: left;\"></p>\r\n\r\n<h2 style=\"text-align: left;\"><span style=\"color: #000080;\"><strong>SECTION 2. NOVADRONE OSCILLATORS</strong></span></h2>\r\n<h3 style=\"text-align: left;\"><span style=\"color: #000080;\"><strong>◊ 2.1 The circuit ◊</strong></span></h3>\r\nThe NovaDrone contains 6 oscillators. Each oscillator outputs a square wave and a triangle wave.\r\n<span style=\"text-decoration: underline;\"><a name=\"schematic\"></a></span>The circuit which generates the oscillators is clean, simple and robust. They are generated using a remarkable device called an <strong>op amp</strong>. If you are interested in building synthesizers and don’t know where to start, read up on <strong>op amps</strong>. They are the key elements of most oscillators, filters, envelope generators, mixers and amps.\r\n<ul>\r\n	<li><span style=\"text-decoration: underline;\"><strong>Schematic</strong></span></li>\r\n</ul>\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/OSC2rc.jpg\"><img class=\"alignleft\" title=\"OSC2rc\" src=\"http://casperelectronics.com/wp-content/uploads/OSC2rc-200x163.jpg\" alt=\"\" width=\"200\" height=\"163\" /></a>­­Each channel of the NovaDrone (Red, green and blue) has 2 oscillators. These are shown in fig. 5 and <a name=\"feedbackloops\"></a>fig. 6. They are very similar to one another but have been calibrated for different purposes.\r\n<strong>Osc 1</strong> is an audio frequency oscillator. It has a coarse and fine tune adjustment and only operates at audible frequencies (20Hz-20kHz).\r\n<strong>Osc 2</strong> is calibrated as a low frequency oscillator (LFO) with cycles as long as 2 minutes. It has a range switch and a single adjustment knob.\r\n<ul>\r\n	<li><span style=\"text-decoration: underline;\"><strong>Feedback loops</strong></span></li>\r\n</ul>\r\nThe oscillator circuit is a feedback loop between two op amps that are <a href=\"http://casperelectronics.com/wp-content/uploads/OSC1rc.jpg\"><img class=\"alignleft\" title=\"OSC1rc\" src=\"http://casperelectronics.com/wp-content/uploads/OSC1rc-200x170.jpg\" alt=\"\" width=\"200\" height=\"170\" /></a>configured as a <strong>schmitt trigger</strong> and an <strong>inverting integrator</strong>.\r\nBasically an <em>integrator</em> turns square waves into triangle waves.\r\nA <em>Schmitt trigger</em> is a kind of comparator that turns modulating signals (like triangle waves) into square waves.\r\nThe key elements of the relationship between these two circuits is that they form a loop (Schmitt &gt; integrator &gt;Schmitt&gt;integrator&gt; etc…) and that the integrator is also an <strong>inverter</strong>. This creates a continuous cycle of modulation:\r\n1) Schmitt output goes HI.\r\n2) Integrator inverts Schmitt signal and outputs slope going down (LOW).\r\n3) When slope is near zero volts, Schmitt trigger is thrown and its’ output goes LOW.\r\n4) Integrator inverts and generates upward slope (HI).\r\n5) When integrator slope reaches peak, Schmitt trigger is thrown and output goes HI.\r\n<a name=\"rctimeconstant\"></a>6) etc……\r\nThis is an overly simplified explanation but enough for our purposes. Do more research on these valuable circuits once you are familiar with some of the basics of op-amps.\r\n\r\n&nbsp;\r\n<ul>\r\n	<li><strong><span style=\"text-decoration: underline;\">RC (resistor capacitor)time constant</span></strong></li>\r\n</ul>\r\nIn both oscillators (fig. 5 and 6) the primary element which defines frequency is the <strong>RC time constant</strong>. This relationship is a core component of most oscillators and is worth reading up on.\r\n\r\nThe RC time constant is a period of time defined by the relationship between a resistor and a capacitor.\r\nThe equation for this is simply <strong>t =</strong> <strong>R*C</strong>. In the case of the oscillators above it would be <strong>t=R1*C1</strong>.\r\nUnfortunately calculating the frequency of an oscillator is more complicated than just calculating your RC constant.\r\nIn many oscillators (including this one) there is a schmitt trigger component which watches the rising or sinking voltage from the integrator. The Schmitt trigger activates when the slope reaches predefined upper and lower limits. In order to determine the frequency of an oscillator we need to know what our upper and lower limits are and then calculate how long it takes our wave (the output of the integrator) to travel from one limit to the other.\r\nThese limits are determined by the relationship of 2 resistors in the schmitt stage. In fig 5 and 6 these are R2 and R3.\r\nThe equation for determining the duration of one cycle is\r\n(1/4R1C1)*(R3/R4)\r\nIn Oscillator 2 <strong>R</strong><strong>1</strong> is a 500k potentiometer in series with a 4.7k resistor between pins 8 and 13 of the two op amps. <strong>C</strong><strong>1</strong> is one of the three capacitors between pins 13 and 14 of the rightmost op amp. One of these caps is selected using a three way switch on the NovaDrone circuit board. This controls the frequency range of the LFO.\r\nLet’s say the pot is all the way up (full resistance) and the middle cap has been selected. The equations for RC and subsequently the frequency is:\r\n<strong>R1=504,700 Ohms</strong>\r\n<a name=\"howitworks\"></a><strong>C1= .000022 Farads</strong>\r\n<strong>R2 = 8,300 Ohms</strong>\r\n<strong>R3 = 10,000 Ohms</strong>\r\n<strong>Frequency in Hz = (1 / 4*R</strong><strong>1C</strong><strong>1) * (R</strong><strong>3/R</strong><strong>2)</strong>\r\n<ul>\r\n	<li><span style=\"text-decoration: underline;\"><strong>How it works</strong></span></li>\r\n</ul>\r\nResistors limit the flow of current and capacitors store current. Current flows through the resistor and is stored in the capacitor. The resistor controls how much current flows into the capacitor per second. Therefore the size of capacitor and the amount of resistance will determine how long it takes to fill the capacitor. A common analogy is to think about current flow as water, the resistor as a spigot\r\n<h3><a name=\"2.2\"></a></h3>\r\nand the capacitor as a cup. The more you open the spigot (reduce resistance), the more water (electrical current) will flow and the faster the cup will fill (capacitor will charge). The oscillator circuit is configured in a special way which causes the capacitor to continuously charge and discharge. It is looking for two states from the cap, fully charged or fully discharged. When the cap reaches either of these states, the whole circuit reverses polarity and the capacitors charge status begins moving toward the opposite state. The amount of time it takes to charge and discharge is your cycle duration.\r\n\r\n&nbsp;\r\n<h3 style=\"text-align: left;\"><span style=\"color: #000080;\"><strong>◊2.2 pulse width modulation (pwm)◊</strong></span></h3>\r\nPWM is exciting stuff….really! It is essentially a <strong>1 bit digital</strong> representation of an <strong>analog</strong> wave form.\r\nDigital wave forms only have 2 states, <strong>high</strong> and <strong>low</strong>. <strong>High</strong> is a voltage <em>at</em> or very close to the positive supply voltage. <strong>Low</strong> is a voltage <em>at</em> or very close to the negative supply voltage. It is basically just a square wave. Analog on the other hand is infinitely variable. Think about it like the difference between a light switch (digital) and a light dimmer (analog). PWM is a wave form that bridges the gap between these two formats. It can be used to make sound, control the brightness of an LED, control the speed of high torque motors and speak to microprocessors. It is also the language that a microprocessor will use to speak with the analog world.\r\nPulse Width (PW) refers to the relative durations of high and low voltage in a single <strong>cycle</strong> of a square wave.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/pulsewidth.jpg\"><img class=\"alignnone size-large wp-image-1648\" title=\"Pulsewidth\" src=\"http://casperelectronics.com/wp-content/uploads/pulsewidth-460x214.jpg\" alt=\"\" width=\"460\" height=\"214\" /></a><span style=\"color: #33cccc;\">Figure 7. Pulse width</span>\r\nFig. 7 shows three square wave oscillators of the same amplitude and frequency but with differing <strong>pulse width</strong>. The red oscillator has a 10% pulse width. That means the wave goes high for 10 % of the duration of one cycle. The green wave is 50% and the purple wave is 90%. What is important to note is that pulse width has nothing to do with frequency and only refers to the relationship between the high and low swing of the wave.\r\n<ul>\r\n	<li><strong><span style=\"text-decoration: underline;\">The Comparator</span></strong></li>\r\n</ul>\r\nThe job of a comparator is simple. Two signals are fed into the “+â€ and “-“ inputs (labeled 10 and 9 in fig. 8 respectively). If the voltage at the “+â€ input is <em>higher</em> than the “-“ input the output of the comparator goes <strong>high</strong>.<strong> </strong>If the “+â€ input drops below the “-“ input the output goes <strong>low</strong>.\r\nIn the NovaDrone t<a href=\"http://casperelectronics.com/wp-content/uploads/comparator.jpg\"><img class=\"alignleft\" title=\"Comparator\" src=\"http://casperelectronics.com/wp-content/uploads/comparator-200x76.jpg\" alt=\"\" width=\"200\" height=\"76\" /></a>he triangle output of Osc 1 and Osc 2 combine through a simple comparator (fig. 8) to make a single square wave with a modulating pulse width. In this way, the comparator also functions as a pulse width modulation processor.\r\n\r\nFig. 9 below shows how two triangle waves are transformed through the comparator into a square wave with a modulating pulse width.\r\nThe blue triangle wave in fig. 9 is oscillator 1. The red triangle is osc 2. The green line is the combined PWM output.\r\nAny time the blue line (osc 1) is above the red line (osc 2), the green line (pwm) goes high. As the red line rises the percentage of each cycle that the blue line is above the red line decreases. This changing percentage is what makes our modulating pulse width effect.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/PWM3-copy.jpg\"><img class=\"alignnone size-large wp-image-1647\" title=\"PWM3 Copy\" src=\"http://casperelectronics.com/wp-content/uploads/PWM3-copy-460x202.jpg\" alt=\"\" width=\"460\" height=\"202\" /></a>\r\n\r\n<span style=\"color: #33cccc;\">Figure 9. Pulse width modulation detail</span>\r\n<ul>\r\n	<li><strong><span style=\"text-decoration: underline;\">Mixer</span></strong></li>\r\n</ul>\r\nThe audio signals from each of the three channels of the NovaDrone are mixed using the circuit in fig. 10.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/mixer.jpg\"><img class=\"alignleft\" title=\"Mixer\" src=\"http://casperelectronics.com/wp-content/uploads/mixer-200x135.jpg\" alt=\"\" width=\"200\" height=\"135\" /></a>This mixer is nice and simple and uses just one <strong>op amp</strong> and a few other components. This circuit is configured as an inverting mixer with an amplitude controlled by the <strong>feedback resistor</strong> and <strong>input resistors</strong>. The amplitude is calculated as RF/RI. In this case RF = 10,000 and RI = 100,000. That means the output signal is 1/10<sup>th</sup> the amplitude of the input signal.\r\n<strong><span style=\"text-decoration: underline;\">\r\n</span></strong>\r\n<ul>\r\n	<li><strong><span style=\"text-decoration: underline;\">LED drivers</span></strong></li>\r\n</ul>\r\n(3) 2N3904 NPN transistors are used to make 3 LED drivers.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/LEDdriver.jpg\"><img class=\"alignleft\" title=\"LEDdriver\" src=\"http://casperelectronics.com/wp-content/uploads/LEDdriver-200x108.jpg\" alt=\"\" width=\"200\" height=\"108\" /></a>A driver is a simple but important circuit which isolates elements which use lots of current (like LEDs) from sensitive circuits (like the oscillators in the NovaDrone). Failure to use a driver can result in something called a <strong>loading effect</strong> which basically means that the device being driven will affect the behavior of the rest of the circuit in bad ways, like the pitch changing when the lights turn on. The LED in the NovaDrone uses a lot of current relative to the rest of the circuit (90mA vs around 30mA for the rest of the circuit) therefore a driver is necessary. The key component of a driver is the <strong>transistor</strong>. This is another topic worth reading a lot about\r\n.\r\n\r\n</div>','NovaDrone Tech Manual',0,'','inherit','open','closed','','1704-revision-14','','','2012-11-05 15:49:30','2012-11-05 20:49:30','',1704,'http://casperelectronics.com/2012/11/05/1704-revision-14/',0,'revision','',0),(1721,2,'2012-11-05 15:54:22','2012-11-05 20:54:22','Throughout this guide I will attempt to give you some insight into the circuit theory and scientific principles at play in the NovaDrone. That said I will be giving little more than an intro to each topic and strongly encourage you to do further reading on topics you find interesting.\r\n<ul>\r\n	<li>This is a beta version of the <strong>NovaDrone Technical Guide</strong>. I expect to make revisions over time and eagerly encourage readers to send me feedback, questions, suggestions and especially corrections. Comments should be addressed to <a href=\"mailto:pete@casperelectronics.com\"><strong>pete@casperelectronics.com</strong></a>.</li>\r\n</ul>\r\n<h3 style=\"text-align: center;\"><span style=\"color: #000000;\"><strong>TABLE OF CONTENTS:</strong></span></h3>\r\n<a href=\"#sec1\"><strong><span style=\"text-decoration: underline;\">Section 1. Oscillator Primer</span></strong></a>\r\n<ul>\r\n	<li><a href=\"#1.1\"><strong>1.1 Frequency, amplitude &amp; wave shape</strong></a>\r\n<ul>\r\n	<li><a href=\"#frequency\">Frequency</a></li>\r\n	<li><a href=\"#amplitude\">Amplitude</a></li>\r\n	<li><a href=\"#waveshape\"> Wave shape</a></li>\r\n	<li><a href=\"#review\"> Review<strong></strong></a></li>\r\n</ul>\r\n</li>\r\n	<li><a href=\"#1.2\"><strong>1.2 Phase</strong></a>\r\n<ul>\r\n	<li><a href=\"#phase\"> Phase controlled amplitude modulation</a></li>\r\n</ul>\r\n</li>\r\n</ul>\r\n<a href=\"#sec2\"><strong><span style=\"text-decoration: underline;\">Section 2. NovaDrone Oscillators</span></strong></a>\r\n<ul>\r\n	<li><a href=\"#2.1\"><strong>2.1 The Circuit</strong></a>\r\n<ul>\r\n	<li><a href=\"#feedbackloops\"> Feedback loops</a></li>\r\n	<li><a href=\"#schematic\"> Schematic</a></li>\r\n	<li><a href=\"#rctimeconstant\"> RC time constant</a></li>\r\n	<li><a href=\"#howitworks\"> How it works<strong></strong></a></li>\r\n</ul>\r\n</li>\r\n	<li><a href=\"#2.2\"><strong>2.2 Pulse Width Modulation</strong></a>\r\n<ul>\r\n	<li><a href=\"#comparator\">The comparator<strong></strong></a></li>\r\n</ul>\r\n</li>\r\n</ul>\r\n<a name=\"sec1\"></a><a name=\"1.1\"></a><a href=\"#sec3\"><strong><span style=\"text-decoration: underline;\">Sectio</span></strong></a><a href=\"#sec3\"><strong><span style=\"text-decoration: underline;\">n 3. Drivers and Mixers </span>*incomplete*</strong></a>\r\n<ul>\r\n	<li><a href=\"#led\"> LED driver</a></li>\r\n	<li><a href=\"#mixer\">Signal mixer</a><strong></strong></li>\r\n</ul>\r\n<h2 style=\"text-align: left;\"><span style=\"color: #3366ff;\"><strong>SECTION 1. OSCILLATOR PRIMER</strong></span></h2>\r\n<h2><span style=\"color: #3366ff;\"><strong style=\"text-align: center;\"><strong>◊ 1.1 Frequency, amplitude and wave shape◊</strong></strong></span></h2>\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/ampandfreq.jpg\"><img class=\"alignleft size-medium wp-image-1636\" title=\"Figure 1. A triangle wave oscillator\" src=\"http://casperelectronics.com/wp-content/uploads/ampandfreq-200x242.jpg\" alt=\"\" width=\"200\" height=\"242\" /></a>\r\n<div>\r\n<hr>\r\nThe heart of the NovaDrone is a bank of six independent oscillators.\r\n\r\n</div>\r\nAn oscillator is simply a pattern which repeats indefinitely. This can be a pattern of light, movement, electricity, even life cycles of organisms. The <a href=\"http://en.wikipedia.org/wiki/Oscillation\">wikipedia entry</a> gives dozens of examples of different kinds of oscillation.\r\n\r\nWhat we are most interested in is the modulation (changing amplitude) of electricity. All of the electrically produced sound we hear is a repeating pattern of fluctuating electrical current.\r\n\r\n&nbsp;\r\n\r\n<address> </address><address><em><span style=\"color: #33cccc;\">Figure 1. triangle oscillator</span></em></address>When this is applied to a speaker, the current activates a coil in the speaker which pushes the cone of the speaker away from or towards a fixed magnet. This action vibrates the air in front of the speaker which in turn vibrates the air in front of that and so on until that vibrations hit our ear drums and are perceived as sound. The sounds we hear around us are all incredibly complex patterns of air pressure modulation.\r\n<div>\r\n<ul>\r\n	<li><strong>The red line in fig 1 represents a voltage which goes up and down over a period of time. This is an oscillator.</strong></li>\r\n</ul>\r\nThere are three basic factors that make up all oscillators: <a name=\"frequency\"></a><strong>frequency</strong>, <strong>amplitude</strong> and <strong>wave shape</strong>. In musical terms we would call these <strong>pitch</strong>, <strong>volume</strong> and <strong>timbre</strong>. I will also talk a fair amount about <strong>phase </strong>which is relevant when working with multiple oscillators and plays an important role in creating drones.\r\n<ul>\r\n<hr>\r\n	<li>\r\n<h3><span style=\"color: #3366ff;\"><strong>Frequency</strong></span></h3>\r\n</li>\r\n</ul>\r\nOne complete sweep up and down is called a <strong>cycle</strong>. The number of cycles per second is your <strong>Frequency</strong> or <strong>Pitch</strong>.<strong></strong>\r\n<strong>Frequency</strong> is commonly measured in <strong>Hertz</strong>, which is the number of cycles per second.\r\n<a name=\"amplitude\"></a><strong>Pitch</strong> is another term for frequency which is used <span style=\"text-decoration: underline;\">only</span> when referring to the frequency of an audio signal.\r\nFigure 1 shows a triangle wave with a cycle length of .5 seconds. The frequency of this wave would be determined by seeing how many cycles will occur in 1 second. In this case there are 2 complete cycles in 1 second. That means the wave has a frequency of 2 Hertz. This is well below the hearing range. Humans can hear oscillators between 20Hz and 20,000 Hz.\r\n<ul><hr>\r\n	<li>\r\n<h3><span style=\"color: #3366ff;\"><strong>Amplitude</strong></span></h3>\r\n</li>\r\n</ul>\r\nAmplitude refers to the magnitude of voltage change across one cycle of an oscillation.\r\n<a name=\"waveshape\"></a>This in turn impacts the volume of the signal if it is sent to a speaker.\r\nThe image above shows a triangle wave with a positive peak of +5 volts and a negative peak of -5 volts. The amplitude is determined by figuring the absolute difference between these peaks. In this case that difference is 10 volts. This is commonly referred to as 10 Vpk-pk (10 volts peak to peak). There are many different ways to measure amplitude (pk-pk, RMS, Vp, etc…) but we’ll just be talking about Vpk-pk.\r\n<ul><hr>\r\n	<li><span style=\"text-decoration: underline;\"><strong>Wave shape</strong></span><a href=\"http://casperelectronics.com/wp-content/uploads/waveshapes.png\"><img class=\"alignright\" title=\"Waveshapes\" src=\"http://casperelectronics.com/wp-content/uploads/waveshapes-200x160.png\" alt=\"\" width=\"292\" height=\"233\" /></a></li>\r\n</ul>\r\nThe wave shape is the pattern of amplitude modulation over the course of a cycle. The waveforms in fig 2 are: Sine, ramp, triangle and square.Sine, triangle and square are the most common and are all symmetrical waves. That means the positive and negative portions of each cycle are of the same duration. Many musical synthesizers offer other wave forms which are asymmetrical versions of these common waves such as ramp, saw and pulse waves.\r\n<p style=\"text-align: right;\"><span style=\"color: #33cccc;\"> Figure 2. Waveshapes  </span></p>\r\nThe importance and impact of wave shape depends on its application. Many audio effects such as <strong>tremolo</strong> or <strong>phaser</strong> use low frequency oscillators (LFOs) to modulate certain parameters of the sound. It is commonly more desirable to use a sine or triangle wave for many of these effects such as the tremolo which\r\n<a name=\"review\"></a>fades the volume in and out. Using a square wave for this would create dramatic shifts in volume which can be unpleasant.\r\nMany natural sounds are synthesized using overlapping wave forms like those shown above. For instance a flute can be synthesized using several octaves of a sine wave. A horn on the other hand will use more square waves and maybe a triangle or saw wave. More advanced wave and synthesis theory sites the sine wave as the basis of all wave forms. It is shown how even square waves can be created by combining several sine waves.\r\n<ul><hr>\r\n	<li><span style=\"text-decoration: underline;\"><strong>Review</strong></span></li>\r\n</ul>\r\nThe basic components of an oscillator are:\r\n<h3><a name=\"1.2\"></a></h3>\r\n<ul>\r\n	<li><strong>Frequency</strong>. The number of oscillation cycles that occur in one second. Measured in Hz</li>\r\n	<li><strong>Amplitude</strong>. Magnitude of voltage sweep in one cycle of an oscillator. Measured in Volts or Vpk-pk (volts peak to peak)</li>\r\n	<li><strong>Wave shape</strong>. Sine, triangle, square</li>\r\n</ul><hr><hr>\r\n<div></div>\r\n<h3 style=\"text-align: left;\"><span style=\"color: #000080;\"><strong>◊1.2 Phase◊</strong></span></h3>\r\nPhase is a bit more complicated than the other terms but plays an important role in audio circuitry and especially in making drones. Phase refers to a particular position in a <span style=\"text-decoration: underline;\">single cycle</span> of a wave (such as the positive or negative peak) and is measured in degrees. It is most commonly used to describe the relationship between multiple waves.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/phasedegrees.jpg\"><img class=\"alignnone size-large wp-image-1643\" title=\"Phasedegrees\" src=\"http://casperelectronics.com/wp-content/uploads/phasedegrees-460x236.jpg\" alt=\"\" width=\"460\" height=\"236\" /></a>\r\n\r\n<span style=\"color: #33cccc;\">Figure 3. Phase</span>\r\nFig. 3 shows two sine waves (red &amp; blue) of identical amplitude and frequency. The green oscillator is the mix or <em>average</em> of the red and blue oscillators.\r\nPhase is measured in degrees with 360 degrees being one complete cycle. 180 degrees is exactly ½ of a cycle.\r\nIn fig. 3 the phase of the blue oscillator is offset at 45 degree increments from the red oscillator from left to right. With each step you’ll notice that the waves get farther apart and that the amplitude of the green (average) oscillator decreases.\r\nThis may seem confusing at first but it’s really quite simple. The green oscillator is the average of the red and blue oscillators. Let’s say the red and blue oscillators sweep from -5 to +5VDC (10Vp-p). Now look at the right most illustration of the 2 waves out of phase by 180 degrees. When the blue wave is at its positive peak (90 degrees) of +5 volts, the red wave is at it’s negative peak (270 degrees) of -5 volts.\r\nWhat is the average of -5 and +5? Zero. They are always going to be the opposites of each other so the average will always be zero. Now look at the 90 degree image. When Blue is at +5 volts/90 degrees, red is at 0 volts/zero degrees. The average of +5 and zero is 2.5 volts.\r\nThe important thing to take away from the info above is that the amplitude of an oscillator created by mixing two similar oscillators is relative to the difference in phase of the two source waves.\r\nIn fig. 3 the oscillators have identical frequencies. This means that the phase relationship once established will remain the same and the resulting averaged amplitude of the two waves will also remain the same.\r\n<strong>Q: What will happen if the frequencies of your two waves are NOT identical? </strong>\r\nWe established above that the amplitude of the averaged waveform is relative to the phase difference of the two wave forms, therefore as the phase difference of two waves increases and decreases so too will the averaged waveforms’ amplitude. What we have here is phase controlled amplitude modulation and the rate of phase modulation is controlled by the frequency difference between your two oscillators.\r\nIn fig. 4 the blue oscillator has a frequency of 10 Hz, the red is 11Hz. That means that it takes the red wave 1/10<sup>th</sup> of a second longer to complete a cycle than the blue wave. You can see that with each cycle the red wave lags a little bit further behind the blue wave which increases the phase difference between the two. As a result, the amplitude of the averaged wave (green) decreases as the phase offset approaches 180 degrees and then increases as it continues past 180 to 360 degrees.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/phaseModulation.jpg\"><img class=\"alignnone size-large wp-image-1644\" title=\"PhaseModulation\" src=\"http://casperelectronics.com/wp-content/uploads/phaseModulation-460x202.jpg\" alt=\"\" width=\"460\" height=\"202\" /></a><a href=\"http://casperelectronics.com/wp-content/uploads/phase_modulation2.jpg\"><img class=\"alignnone size-large wp-image-1645\" title=\"Phase Modulation2\" src=\"http://casperelectronics.com/wp-content/uploads/phase_modulation2-460x220.jpg\" alt=\"\" width=\"460\" height=\"220\" /></a><a name=\"sec2\"></a><span style=\"color: #33cccc;\">Figure 4. Phase controlled amplitude</span>\r\n<h3><a name=\"2.1\"></a></h3>\r\nThis phenomenon of phase controlled amplitude is something many musicians use without even realizing it. This is the vary trick one uses when tuning a guitar. You tune one string to the other until the “beatingâ€ effect slows and eventually disappears.\r\n\r\n&nbsp;\r\n<h2 style=\"text-align: left;\"><span style=\"color: #000080;\"><strong>SECTION 2. NOVADRONE OSCILLATORS</strong></span></h2>\r\n<h3 style=\"text-align: left;\"><span style=\"color: #000080;\"><strong>◊ 2.1 The circuit ◊</strong></span></h3>\r\nThe NovaDrone contains 6 oscillators. Each oscillator outputs a square wave and a triangle wave.\r\n<span style=\"text-decoration: underline;\"><a name=\"schematic\"></a></span>The circuit which generates the oscillators is clean, simple and robust. They are generated using a remarkable device called an <strong>op amp</strong>. If you are interested in building synthesizers and don’t know where to start, read up on <strong>op amps</strong>. They are the key elements of most oscillators, filters, envelope generators, mixers and amps.\r\n<ul>\r\n	<li><span style=\"text-decoration: underline;\"><strong>Schematic</strong></span></li>\r\n</ul>\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/OSC2rc.jpg\"><img class=\"alignleft\" title=\"OSC2rc\" src=\"http://casperelectronics.com/wp-content/uploads/OSC2rc-200x163.jpg\" alt=\"\" width=\"200\" height=\"163\" /></a>­­Each channel of the NovaDrone (Red, green and blue) has 2 oscillators. These are shown in fig. 5 and <a name=\"feedbackloops\"></a>fig. 6. They are very similar to one another but have been calibrated for different purposes.\r\n<strong>Osc 1</strong> is an audio frequency oscillator. It has a coarse and fine tune adjustment and only operates at audible frequencies (20Hz-20kHz).\r\n<strong>Osc 2</strong> is calibrated as a low frequency oscillator (LFO) with cycles as long as 2 minutes. It has a range switch and a single adjustment knob.\r\n<ul>\r\n	<li><span style=\"text-decoration: underline;\"><strong>Feedback loops</strong></span></li>\r\n</ul>\r\nThe oscillator circuit is a feedback loop between two op amps that are <a href=\"http://casperelectronics.com/wp-content/uploads/OSC1rc.jpg\"><img class=\"alignleft\" title=\"OSC1rc\" src=\"http://casperelectronics.com/wp-content/uploads/OSC1rc-200x170.jpg\" alt=\"\" width=\"200\" height=\"170\" /></a>configured as a <strong>schmitt trigger</strong> and an <strong>inverting integrator</strong>.\r\nBasically an <em>integrator</em> turns square waves into triangle waves.\r\nA <em>Schmitt trigger</em> is a kind of comparator that turns modulating signals (like triangle waves) into square waves.\r\nThe key elements of the relationship between these two circuits is that they form a loop (Schmitt &gt; integrator &gt;Schmitt&gt;integrator&gt; etc…) and that the integrator is also an <strong>inverter</strong>. This creates a continuous cycle of modulation:\r\n1) Schmitt output goes HI.\r\n2) Integrator inverts Schmitt signal and outputs slope going down (LOW).\r\n3) When slope is near zero volts, Schmitt trigger is thrown and its’ output goes LOW.\r\n4) Integrator inverts and generates upward slope (HI).\r\n5) When integrator slope reaches peak, Schmitt trigger is thrown and output goes HI.\r\n<a name=\"rctimeconstant\"></a>6) etc……\r\nThis is an overly simplified explanation but enough for our purposes. Do more research on these valuable circuits once you are familiar with some of the basics of op-amps.\r\n\r\n&nbsp;\r\n<ul>\r\n	<li><strong><span style=\"text-decoration: underline;\">RC (resistor capacitor)time constant</span></strong></li>\r\n</ul>\r\nIn both oscillators (fig. 5 and 6) the primary element which defines frequency is the <strong>RC time constant</strong>. This relationship is a core component of most oscillators and is worth reading up on.\r\n\r\nThe RC time constant is a period of time defined by the relationship between a resistor and a capacitor.\r\nThe equation for this is simply <strong>t =</strong> <strong>R*C</strong>. In the case of the oscillators above it would be <strong>t=R1*C1</strong>.\r\nUnfortunately calculating the frequency of an oscillator is more complicated than just calculating your RC constant.\r\nIn many oscillators (including this one) there is a schmitt trigger component which watches the rising or sinking voltage from the integrator. The Schmitt trigger activates when the slope reaches predefined upper and lower limits. In order to determine the frequency of an oscillator we need to know what our upper and lower limits are and then calculate how long it takes our wave (the output of the integrator) to travel from one limit to the other.\r\nThese limits are determined by the relationship of 2 resistors in the schmitt stage. In fig 5 and 6 these are R2 and R3.\r\nThe equation for determining the duration of one cycle is\r\n(1/4R1C1)*(R3/R4)\r\nIn Oscillator 2 <strong>R</strong><strong>1</strong> is a 500k potentiometer in series with a 4.7k resistor between pins 8 and 13 of the two op amps. <strong>C</strong><strong>1</strong> is one of the three capacitors between pins 13 and 14 of the rightmost op amp. One of these caps is selected using a three way switch on the NovaDrone circuit board. This controls the frequency range of the LFO.\r\nLet’s say the pot is all the way up (full resistance) and the middle cap has been selected. The equations for RC and subsequently the frequency is:\r\n<strong>R1=504,700 Ohms</strong>\r\n<a name=\"howitworks\"></a><strong>C1= .000022 Farads</strong>\r\n<strong>R2 = 8,300 Ohms</strong>\r\n<strong>R3 = 10,000 Ohms</strong>\r\n<strong>Frequency in Hz = (1 / 4*R</strong><strong>1C</strong><strong>1) * (R</strong><strong>3/R</strong><strong>2)</strong>\r\n<ul>\r\n	<li><span style=\"text-decoration: underline;\"><strong>How it works</strong></span></li>\r\n</ul>\r\nResistors limit the flow of current and capacitors store current. Current flows through the resistor and is stored in the capacitor. The resistor controls how much current flows into the capacitor per second. Therefore the size of capacitor and the amount of resistance will determine how long it takes to fill the capacitor. A common analogy is to think about current flow as water, the resistor as a spigot\r\n<h3><a name=\"2.2\"></a></h3>\r\nand the capacitor as a cup. The more you open the spigot (reduce resistance), the more water (electrical current) will flow and the faster the cup will fill (capacitor will charge). The oscillator circuit is configured in a special way which causes the capacitor to continuously charge and discharge. It is looking for two states from the cap, fully charged or fully discharged. When the cap reaches either of these states, the whole circuit reverses polarity and the capacitors charge status begins moving toward the opposite state. The amount of time it takes to charge and discharge is your cycle duration.\r\n\r\n&nbsp;\r\n<h3 style=\"text-align: left;\"><span style=\"color: #000080;\"><strong>◊2.2 pulse width modulation (pwm)◊</strong></span></h3>\r\nPWM is exciting stuff….really! It is essentially a <strong>1 bit digital</strong> representation of an <strong>analog</strong> wave form.\r\nDigital wave forms only have 2 states, <strong>high</strong> and <strong>low</strong>. <strong>High</strong> is a voltage <em>at</em> or very close to the positive supply voltage. <strong>Low</strong> is a voltage <em>at</em> or very close to the negative supply voltage. It is basically just a square wave. Analog on the other hand is infinitely variable. Think about it like the difference between a light switch (digital) and a light dimmer (analog). PWM is a wave form that bridges the gap between these two formats. It can be used to make sound, control the brightness of an LED, control the speed of high torque motors and speak to microprocessors. It is also the language that a microprocessor will use to speak with the analog world.\r\nPulse Width (PW) refers to the relative durations of high and low voltage in a single <strong>cycle</strong> of a square wave.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/pulsewidth.jpg\"><img class=\"alignnone size-large wp-image-1648\" title=\"Pulsewidth\" src=\"http://casperelectronics.com/wp-content/uploads/pulsewidth-460x214.jpg\" alt=\"\" width=\"460\" height=\"214\" /></a><span style=\"color: #33cccc;\">Figure 7. Pulse width</span>\r\nFig. 7 shows three square wave oscillators of the same amplitude and frequency but with differing <strong>pulse width</strong>. The red oscillator has a 10% pulse width. That means the wave goes high for 10 % of the duration of one cycle. The green wave is 50% and the purple wave is 90%. What is important to note is that pulse width has nothing to do with frequency and only refers to the relationship between the high and low swing of the wave.\r\n<ul>\r\n	<li><strong><span style=\"text-decoration: underline;\">The Comparator</span></strong></li>\r\n</ul>\r\nThe job of a comparator is simple. Two signals are fed into the “+â€ and “-“ inputs (labeled 10 and 9 in fig. 8 respectively). If the voltage at the “+â€ input is <em>higher</em> than the “-“ input the output of the comparator goes <strong>high</strong>.<strong> </strong>If the “+â€ input drops below the “-“ input the output goes <strong>low</strong>.\r\nIn the NovaDrone t<a href=\"http://casperelectronics.com/wp-content/uploads/comparator.jpg\"><img class=\"alignleft\" title=\"Comparator\" src=\"http://casperelectronics.com/wp-content/uploads/comparator-200x76.jpg\" alt=\"\" width=\"200\" height=\"76\" /></a>he triangle output of Osc 1 and Osc 2 combine through a simple comparator (fig. 8) to make a single square wave with a modulating pulse width. In this way, the comparator also functions as a pulse width modulation processor.\r\n\r\nFig. 9 below shows how two triangle waves are transformed through the comparator into a square wave with a modulating pulse width.\r\nThe blue triangle wave in fig. 9 is oscillator 1. The red triangle is osc 2. The green line is the combined PWM output.\r\nAny time the blue line (osc 1) is above the red line (osc 2), the green line (pwm) goes high. As the red line rises the percentage of each cycle that the blue line is above the red line decreases. This changing percentage is what makes our modulating pulse width effect.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/PWM3-copy.jpg\"><img class=\"alignnone size-large wp-image-1647\" title=\"PWM3 Copy\" src=\"http://casperelectronics.com/wp-content/uploads/PWM3-copy-460x202.jpg\" alt=\"\" width=\"460\" height=\"202\" /></a>\r\n\r\n<span style=\"color: #33cccc;\">Figure 9. Pulse width modulation detail</span>\r\n<ul>\r\n	<li><strong><span style=\"text-decoration: underline;\">Mixer</span></strong></li>\r\n</ul>\r\nThe audio signals from each of the three channels of the NovaDrone are mixed using the circuit in fig. 10.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/mixer.jpg\"><img class=\"alignleft\" title=\"Mixer\" src=\"http://casperelectronics.com/wp-content/uploads/mixer-200x135.jpg\" alt=\"\" width=\"200\" height=\"135\" /></a>This mixer is nice and simple and uses just one <strong>op amp</strong> and a few other components. This circuit is configured as an inverting mixer with an amplitude controlled by the <strong>feedback resistor</strong> and <strong>input resistors</strong>. The amplitude is calculated as RF/RI. In this case RF = 10,000 and RI = 100,000. That means the output signal is 1/10<sup>th</sup> the amplitude of the input signal.\r\n<strong><span style=\"text-decoration: underline;\">\r\n</span></strong>\r\n<ul>\r\n	<li><strong><span style=\"text-decoration: underline;\">LED drivers</span></strong></li>\r\n</ul>\r\n(3) 2N3904 NPN transistors are used to make 3 LED drivers.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/LEDdriver.jpg\"><img class=\"alignleft\" title=\"LEDdriver\" src=\"http://casperelectronics.com/wp-content/uploads/LEDdriver-200x108.jpg\" alt=\"\" width=\"200\" height=\"108\" /></a>A driver is a simple but important circuit which isolates elements which use lots of current (like LEDs) from sensitive circuits (like the oscillators in the NovaDrone). Failure to use a driver can result in something called a <strong>loading effect</strong> which basically means that the device being driven will affect the behavior of the rest of the circuit in bad ways, like the pitch changing when the lights turn on. The LED in the NovaDrone uses a lot of current relative to the rest of the circuit (90mA vs around 30mA for the rest of the circuit) therefore a driver is necessary. The key component of a driver is the <strong>transistor</strong>. This is another topic worth reading a lot about\r\n.\r\n\r\n</div>','NovaDrone Tech Manual',0,'','inherit','open','closed','','1704-revision-16','','','2012-11-05 15:54:22','2012-11-05 20:54:22','',1704,'http://casperelectronics.com/2012/11/05/1704-revision-16/',0,'revision','',0),(1722,2,'2012-11-05 15:59:42','2012-11-05 20:59:42','Throughout this guide I will attempt to give you some insight into the circuit theory and scientific principles at play in the NovaDrone. That said I will be giving little more than an intro to each topic and strongly encourage you to do further reading on topics you find interesting.\r\n<ul>\r\n	<li>This is a beta version of the <strong>NovaDrone Technical Guide</strong>. I expect to make revisions over time and eagerly encourage readers to send me feedback, questions, suggestions and especially corrections. Comments should be addressed to <a href=\"mailto:pete@casperelectronics.com\"><strong>pete@casperelectronics.com</strong></a>.</li>\r\n</ul>\r\n<h3 style=\"text-align: center;\"><span style=\"color: #000000;\"><strong>TABLE OF CONTENTS:</strong></span></h3>\r\n<a href=\"#sec1\"><strong><span style=\"text-decoration: underline;\">Section 1. Oscillator Primer</span></strong></a>\r\n<ul>\r\n	<li><a href=\"#1.1\"><strong>1.1 Frequency, amplitude &amp; wave shape</strong></a>\r\n<ul>\r\n	<li><a href=\"#frequency\">Frequency</a></li>\r\n	<li><a href=\"#amplitude\">Amplitude</a></li>\r\n	<li><a href=\"#waveshape\"> Wave shape</a></li>\r\n	<li><a href=\"#review\"> Review<strong></strong></a></li>\r\n</ul>\r\n</li>\r\n	<li><a href=\"#1.2\"><strong>1.2 Phase</strong></a>\r\n<ul>\r\n	<li><a href=\"#phase\"> Phase controlled amplitude modulation</a></li>\r\n</ul>\r\n</li>\r\n</ul>\r\n<a href=\"#sec2\"><strong><span style=\"text-decoration: underline;\">Section 2. NovaDrone Oscillators</span></strong></a>\r\n<ul>\r\n	<li><a href=\"#2.1\"><strong>2.1 The Circuit</strong></a>\r\n<ul>\r\n	<li><a href=\"#feedbackloops\"> Feedback loops</a></li>\r\n	<li><a href=\"#schematic\"> Schematic</a></li>\r\n	<li><a href=\"#rctimeconstant\"> RC time constant</a></li>\r\n	<li><a href=\"#howitworks\"> How it works<strong></strong></a></li>\r\n</ul>\r\n</li>\r\n	<li><a href=\"#2.2\"><strong>2.2 Pulse Width Modulation</strong></a>\r\n<ul>\r\n	<li><a href=\"#comparator\">The comparator<strong></strong></a></li>\r\n</ul>\r\n</li>\r\n</ul>\r\n<a name=\"sec1\"></a><a name=\"1.1\"></a><a href=\"#sec3\"><strong><span style=\"text-decoration: underline;\">Sectio</span></strong></a><a href=\"#sec3\"><strong><span style=\"text-decoration: underline;\">n 3. Drivers and Mixers </span>*incomplete*</strong></a>\r\n<ul>\r\n	<li><a href=\"#led\"> LED driver</a></li>\r\n	<li><a href=\"#mixer\">Signal mixer</a><strong></strong></li>\r\n</ul>\r\n\r\n<hr />\r\n\r\n<h2 style=\"text-align: left;\"><span style=\"color: #3366ff;\"><strong>SECTION 1. OSCILLATOR PRIMER</strong></span></h2>\r\n<h2><span style=\"color: #3366ff;\"><strong style=\"text-align: center;\"><strong>◊ 1.1 Frequency, amplitude and wave shape◊</strong></strong></span></h2>\r\n\r\n<hr />\r\n\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/ampandfreq.jpg\"><img class=\"alignleft size-medium wp-image-1636\" title=\"Figure 1. A triangle wave oscillator\" src=\"http://casperelectronics.com/wp-content/uploads/ampandfreq-200x242.jpg\" alt=\"\" width=\"200\" height=\"242\" /></a>\r\n<div>\r\n\r\nThe heart of the NovaDrone is a bank of six independent oscillators.\r\n\r\n</div>\r\nAn oscillator is simply a pattern which repeats indefinitely. This can be a pattern of light, movement, electricity, even life cycles of organisms. The <a href=\"http://en.wikipedia.org/wiki/Oscillation\">wikipedia entry</a> gives dozens of examples of different kinds of oscillation.\r\n\r\nWhat we are most interested in is the modulation (changing amplitude) of electricity. All of the electrically produced sound we hear is a repeating pattern of fluctuating electrical current.\r\n\r\n&nbsp;\r\n\r\n<address> </address><address><em><span style=\"color: #33cccc;\">Figure 1. triangle oscillator</span></em></address>When this is applied to a speaker, the current activates a coil in the speaker which pushes the cone of the speaker away from or towards a fixed magnet. This action vibrates the air in front of the speaker which in turn vibrates the air in front of that and so on until that vibrations hit our ear drums and are perceived as sound. The sounds we hear around us are all incredibly complex patterns of air pressure modulation.\r\n<div>\r\n<ul>\r\n	<li><strong>The red line in fig 1 represents a voltage which goes up and down over a period of time. This is an oscillator.</strong></li>\r\n</ul>\r\nThere are three basic factors that make up all oscillators: <a name=\"frequency\"></a><strong>frequency</strong>, <strong>amplitude</strong> and <strong>wave shape</strong>. In musical terms we would call these <strong>pitch</strong>, <strong>volume</strong> and <strong>timbre</strong>. I will also talk a fair amount about <strong>phase </strong>which is relevant when working with multiple oscillators and plays an important role in creating drones.\r\n\r\n<hr />\r\n\r\n<ul>\r\n	<li>\r\n<h3><span style=\"color: #3366ff;\"><strong>Frequency</strong></span></h3>\r\n</li>\r\n</ul>\r\nOne complete sweep up and down is called a <strong>cycle</strong>. The number of cycles per second is your <strong>Frequency</strong> or <strong>Pitch</strong>.<strong></strong>\r\n<strong>Frequency</strong> is commonly measured in <strong>Hertz</strong>, which is the number of cycles per second.\r\n<a name=\"amplitude\"></a><strong>Pitch</strong> is another term for frequency which is used <span style=\"text-decoration: underline;\">only</span> when referring to the frequency of an audio signal.\r\nFigure 1 shows a triangle wave with a cycle length of .5 seconds. The frequency of this wave would be determined by seeing how many cycles will occur in 1 second. In this case there are 2 complete cycles in 1 second. That means the wave has a frequency of 2 Hertz. This is well below the hearing range. Humans can hear oscillators between 20Hz and 20,000 Hz.\r\n\r\n<hr />\r\n\r\n<ul>\r\n	<li>\r\n<h3><span style=\"color: #3366ff;\"><strong>Amplitude</strong></span></h3>\r\n</li>\r\n</ul>\r\nAmplitude refers to the magnitude of voltage change across one cycle of an oscillation.\r\n<a name=\"waveshape\"></a>This in turn impacts the volume of the signal if it is sent to a speaker.\r\nThe image above shows a triangle wave with a positive peak of +5 volts and a negative peak of -5 volts. The amplitude is determined by figuring the absolute difference between these peaks. In this case that difference is 10 volts. This is commonly referred to as 10 Vpk-pk (10 volts peak to peak). There are many different ways to measure amplitude (pk-pk, RMS, Vp, etc…) but we’ll just be talking about Vpk-pk.\r\n\r\n<hr />\r\n\r\n<ul>\r\n	<li>\r\n<h3><span style=\"color: #3366ff;\"><strong>Wave shape</strong></span><a href=\"http://casperelectronics.com/wp-content/uploads/waveshapes.png\"><img class=\"alignright\" title=\"Waveshapes\" src=\"http://casperelectronics.com/wp-content/uploads/waveshapes-200x160.png\" alt=\"\" width=\"292\" height=\"233\" /></a></h3>\r\n</li>\r\n</ul>\r\nThe wave shape is the pattern of amplitude modulation over the course of a cycle. The waveforms in fig 2 are: Sine, ramp, triangle and square.Sine, triangle and square are the most common and are all symmetrical waves. That means the positive and negative portions of each cycle are of the same duration. Many musical synthesizers offer other wave forms which are asymmetrical versions of these common waves such as ramp, saw and pulse waves.\r\n<p style=\"text-align: right;\"><span style=\"color: #33cccc;\"> Figure 2. Waveshapes  </span></p>\r\nThe importance and impact of wave shape depends on its application. Many audio effects such as <strong>tremolo</strong> or <strong>phaser</strong> use low frequency oscillators (LFOs) to modulate certain parameters of the sound. It is commonly more desirable to use a sine or triangle wave for many of these effects such as the tremolo which\r\n<a name=\"review\"></a>fades the volume in and out. Using a square wave for this would create dramatic shifts in volume which can be unpleasant.\r\nMany natural sounds are synthesized using overlapping wave forms like those shown above. For instance a flute can be synthesized using several octaves of a sine wave. A horn on the other hand will use more square waves and maybe a triangle or saw wave. More advanced wave and synthesis theory sites the sine wave as the basis of all wave forms. It is shown how even square waves can be created by combining several sine waves.\r\n\r\n<hr />\r\n\r\n<ul>\r\n	<li>\r\n<h3><strong>Review</strong></h3>\r\n</li>\r\n</ul>\r\nThe basic components of an oscillator are:\r\n<h3><a name=\"1.2\"></a></h3>\r\n<ul>\r\n	<li><strong>Frequency</strong>. The number of oscillation cycles that occur in one second. Measured in Hz</li>\r\n	<li><strong>Amplitude</strong>. Magnitude of voltage sweep in one cycle of an oscillator. Measured in Volts or Vpk-pk (volts peak to peak)</li>\r\n	<li><strong>Wave shape</strong>. Sine, triangle, square</li>\r\n</ul>\r\n\r\n<hr />\r\n\r\n\r\n\r\n<hr />\r\n\r\n<div></div>\r\n<h2 style=\"text-align: left;\"><span style=\"color: #3366ff;\"><strong>◊1.2 Phase◊</strong></span></h2>\r\nPhase is a bit more complicated than the other terms but plays an important role in audio circuitry and especially in making drones. Phase refers to a particular position in a <span style=\"text-decoration: underline;\">single cycle</span> of a wave (such as the positive or negative peak) and is measured in degrees. It is most commonly used to describe the relationship between multiple waves.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/phasedegrees.jpg\"><img class=\"alignnone size-large wp-image-1643\" title=\"Phasedegrees\" src=\"http://casperelectronics.com/wp-content/uploads/phasedegrees-460x236.jpg\" alt=\"\" width=\"460\" height=\"236\" /></a>\r\n\r\n<span style=\"color: #33cccc;\">Figure 3. Phase</span>\r\nFig. 3 shows two sine waves (red &amp; blue) of identical amplitude and frequency. The green oscillator is the mix or <em>average</em> of the red and blue oscillators.\r\nPhase is measured in degrees with 360 degrees being one complete cycle. 180 degrees is exactly ½ of a cycle.\r\nIn fig. 3 the phase of the blue oscillator is offset at 45 degree increments from the red oscillator from left to right. With each step you’ll notice that the waves get farther apart and that the amplitude of the green (average) oscillator decreases.\r\nThis may seem confusing at first but it’s really quite simple. The green oscillator is the average of the red and blue oscillators. Let’s say the red and blue oscillators sweep from -5 to +5VDC (10Vp-p). Now look at the right most illustration of the 2 waves out of phase by 180 degrees. When the blue wave is at its positive peak (90 degrees) of +5 volts, the red wave is at it’s negative peak (270 degrees) of -5 volts.\r\nWhat is the average of -5 and +5? Zero. They are always going to be the opposites of each other so the average will always be zero. Now look at the 90 degree image. When Blue is at +5 volts/90 degrees, red is at 0 volts/zero degrees. The average of +5 and zero is 2.5 volts.\r\nThe important thing to take away from the info above is that the amplitude of an oscillator created by mixing two similar oscillators is relative to the difference in phase of the two source waves.\r\nIn fig. 3 the oscillators have identical frequencies. This means that the phase relationship once established will remain the same and the resulting averaged amplitude of the two waves will also remain the same.\r\n<strong>Q: What will happen if the frequencies of your two waves are NOT identical? </strong>\r\nWe established above that the amplitude of the averaged waveform is relative to the phase difference of the two wave forms, therefore as the phase difference of two waves increases and decreases so too will the averaged waveforms’ amplitude. What we have here is phase controlled amplitude modulation and the rate of phase modulation is controlled by the frequency difference between your two oscillators.\r\nIn fig. 4 the blue oscillator has a frequency of 10 Hz, the red is 11Hz. That means that it takes the red wave 1/10<sup>th</sup> of a second longer to complete a cycle than the blue wave. You can see that with each cycle the red wave lags a little bit further behind the blue wave which increases the phase difference between the two. As a result, the amplitude of the averaged wave (green) decreases as the phase offset approaches 180 degrees and then increases as it continues past 180 to 360 degrees.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/phaseModulation.jpg\"><img class=\"alignnone size-large wp-image-1644\" title=\"PhaseModulation\" src=\"http://casperelectronics.com/wp-content/uploads/phaseModulation-460x202.jpg\" alt=\"\" width=\"460\" height=\"202\" /></a><a href=\"http://casperelectronics.com/wp-content/uploads/phase_modulation2.jpg\"><img class=\"alignnone size-large wp-image-1645\" title=\"Phase Modulation2\" src=\"http://casperelectronics.com/wp-content/uploads/phase_modulation2-460x220.jpg\" alt=\"\" width=\"460\" height=\"220\" /></a><a name=\"sec2\"></a><span style=\"color: #33cccc;\">Figure 4. Phase controlled amplitude</span>\r\n<h3><a name=\"2.1\"></a></h3>\r\nThis phenomenon of phase controlled amplitude is something many musicians use without even realizing it. This is the vary trick one uses when tuning a guitar. You tune one string to the other until the “beatingâ€ effect slows and eventually disappears.\r\n\r\n&nbsp;\r\n<h2 style=\"text-align: left;\"><span style=\"color: #3366ff;\"><strong>SECTION 2. NOVADRONE OSCILLATORS</strong></span></h2>\r\n<h2 style=\"text-align: left;\"><span style=\"color: #3366ff;\"><strong>◊ 2.1 The circuit ◊</strong></span></h2>\r\nThe NovaDrone contains 6 oscillators. Each oscillator outputs a square wave and a triangle wave.\r\n<span style=\"text-decoration: underline;\"><a name=\"schematic\"></a></span>The circuit which generates the oscillators is clean, simple and robust. They are generated using a remarkable device called an <strong>op amp</strong>. If you are interested in building synthesizers and don’t know where to start, read up on <strong>op amps</strong>. They are the key elements of most oscillators, filters, envelope generators, mixers and amps.\r\n<ul>\r\n	<li>\r\n<h3><span style=\"color: #3366ff;\"><strong>Schematic</strong></span></h3>\r\n</li>\r\n</ul>\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/OSC2rc.jpg\"><img class=\"alignleft\" title=\"OSC2rc\" src=\"http://casperelectronics.com/wp-content/uploads/OSC2rc-200x163.jpg\" alt=\"\" width=\"200\" height=\"163\" /></a>­­Each channel of the NovaDrone (Red, green and blue) has 2 oscillators. These are shown in fig. 5 and <a name=\"feedbackloops\"></a>fig. 6. They are very similar to one another but have been calibrated for different purposes.\r\n<strong>Osc 1</strong> is an audio frequency oscillator. It has a coarse and fine tune adjustment and only operates at audible frequencies (20Hz-20kHz).\r\n<strong>Osc 2</strong> is calibrated as a low frequency oscillator (LFO) with cycles as long as 2 minutes. It has a range switch and a single adjustment knob.\r\n<ul>\r\n	<li>\r\n<h3><span style=\"color: #3366ff;\"><strong>Feedback loops</strong></span></h3>\r\n</li>\r\n</ul>\r\nThe oscillator circuit is a feedback loop between two op amps that are <a href=\"http://casperelectronics.com/wp-content/uploads/OSC1rc.jpg\"><img class=\"alignleft\" title=\"OSC1rc\" src=\"http://casperelectronics.com/wp-content/uploads/OSC1rc-200x170.jpg\" alt=\"\" width=\"200\" height=\"170\" /></a>configured as a <strong>schmitt trigger</strong> and an <strong>inverting integrator</strong>.\r\nBasically an <em>integrator</em> turns square waves into triangle waves.\r\nA <em>Schmitt trigger</em> is a kind of comparator that turns modulating signals (like triangle waves) into square waves.\r\nThe key elements of the relationship between these two circuits is that they form a loop (Schmitt &gt; integrator &gt;Schmitt&gt;integrator&gt; etc…) and that the integrator is also an <strong>inverter</strong>. This creates a continuous cycle of modulation:\r\n1) Schmitt output goes HI.\r\n2) Integrator inverts Schmitt signal and outputs slope going down (LOW).\r\n3) When slope is near zero volts, Schmitt trigger is thrown and its’ output goes LOW.\r\n4) Integrator inverts and generates upward slope (HI).\r\n5) When integrator slope reaches peak, Schmitt trigger is thrown and output goes HI.\r\n<a name=\"rctimeconstant\"></a>6) etc……\r\nThis is an overly simplified explanation but enough for our purposes. Do more research on these valuable circuits once you are familiar with some of the basics of op-amps.\r\n<ul>\r\n	<li>\r\n<h3><span style=\"color: #3366ff;\"><strong>RC (resistor capacitor)time constant</strong></span></h3>\r\n</li>\r\n</ul>\r\nIn both oscillators (fig. 5 and 6) the primary element which defines frequency is the <strong>RC time constant</strong>. This relationship is a core component of most oscillators and is worth reading up on.\r\n\r\nThe RC time constant is a period of time defined by the relationship between a resistor and a capacitor.\r\nThe equation for this is simply <strong>t =</strong> <strong>R*C</strong>. In the case of the oscillators above it would be <strong>t=R1*C1</strong>.\r\nUnfortunately calculating the frequency of an oscillator is more complicated than just calculating your RC constant.\r\nIn many oscillators (including this one) there is a schmitt trigger component which watches the rising or sinking voltage from the integrator. The Schmitt trigger activates when the slope reaches predefined upper and lower limits. In order to determine the frequency of an oscillator we need to know what our upper and lower limits are and then calculate how long it takes our wave (the output of the integrator) to travel from one limit to the other.\r\nThese limits are determined by the relationship of 2 resistors in the schmitt stage. In fig 5 and 6 these are R2 and R3.\r\nThe equation for determining the duration of one cycle is\r\n(1/4R1C1)*(R3/R4)\r\nIn Oscillator 2 <strong>R</strong><strong>1</strong> is a 500k potentiometer in series with a 4.7k resistor between pins 8 and 13 of the two op amps. <strong>C</strong><strong>1</strong> is one of the three capacitors between pins 13 and 14 of the rightmost op amp. One of these caps is selected using a three way switch on the NovaDrone circuit board. This controls the frequency range of the LFO.\r\nLet’s say the pot is all the way up (full resistance) and the middle cap has been selected. The equations for RC and subsequently the frequency is:\r\n<strong>R1=504,700 Ohms</strong>\r\n<a name=\"howitworks\"></a><strong>C1= .000022 Farads</strong>\r\n<strong>R2 = 8,300 Ohms</strong>\r\n<strong>R3 = 10,000 Ohms</strong>\r\n<strong>Frequency in Hz = (1 / 4*R</strong><strong>1C</strong><strong>1) * (R</strong><strong>3/R</strong><strong>2)</strong>\r\n<ul>\r\n	<li>\r\n<h3><span style=\"color: #3366ff;\"><strong>How it works</strong></span></h3>\r\n</li>\r\n</ul>\r\nResistors limit the flow of current and capacitors store current. Current flows through the resistor and is stored in the capacitor. The resistor controls how much current flows into the capacitor per second. Therefore the size of capacitor and the amount of resistance will determine how long it takes to fill the capacitor. A common analogy is to think about current flow as water, the resistor as a spigot\r\n<h3><a name=\"2.2\"></a></h3>\r\nand the capacitor as a cup. The more you open the spigot (reduce resistance), the more water (electrical current) will flow and the faster the cup will fill (capacitor will charge). The oscillator circuit is configured in a special way which causes the capacitor to continuously charge and discharge. It is looking for two states from the cap, fully charged or fully discharged. When the cap reaches either of these states, the whole circuit reverses polarity and the capacitors charge status begins moving toward the opposite state. The amount of time it takes to charge and discharge is your cycle duration.\r\n\r\n&nbsp;\r\n<h2 style=\"text-align: left;\"><span style=\"color: #3366ff;\"><strong>◊2.2 pulse width modulation (pwm)◊</strong></span></h2>\r\nPWM is exciting stuff….really! It is essentially a <strong>1 bit digital</strong> representation of an <strong>analog</strong> wave form.\r\nDigital wave forms only have 2 states, <strong>high</strong> and <strong>low</strong>. <strong>High</strong> is a voltage <em>at</em> or very close to the positive supply voltage. <strong>Low</strong> is a voltage <em>at</em> or very close to the negative supply voltage. It is basically just a square wave. Analog on the other hand is infinitely variable. Think about it like the difference between a light switch (digital) and a light dimmer (analog). PWM is a wave form that bridges the gap between these two formats. It can be used to make sound, control the brightness of an LED, control the speed of high torque motors and speak to microprocessors. It is also the language that a microprocessor will use to speak with the analog world.\r\nPulse Width (PW) refers to the relative durations of high and low voltage in a single <strong>cycle</strong> of a square wave.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/pulsewidth.jpg\"><img class=\"alignnone size-large wp-image-1648\" title=\"Pulsewidth\" src=\"http://casperelectronics.com/wp-content/uploads/pulsewidth-460x214.jpg\" alt=\"\" width=\"460\" height=\"214\" /></a><span style=\"color: #33cccc;\">Figure 7. Pulse width</span>\r\nFig. 7 shows three square wave oscillators of the same amplitude and frequency but with differing <strong>pulse width</strong>. The red oscillator has a 10% pulse width. That means the wave goes high for 10 % of the duration of one cycle. The green wave is 50% and the purple wave is 90%. What is important to note is that pulse width has nothing to do with frequency and only refers to the relationship between the high and low swing of the wave.\r\n<ul>\r\n	<li>\r\n<h3><span style=\"color: #3366ff;\"><strong>The Comparator</strong></span></h3>\r\n</li>\r\n</ul>\r\nThe job of a comparator is simple. Two signals are fed into the “+â€ and “-“ inputs (labeled 10 and 9 in fig. 8 respectively). If the voltage at the “+â€ input is <em>higher</em> than the “-“ input the output of the comparator goes <strong>high</strong>.<strong> </strong>If the “+â€ input drops below the “-“ input the output goes <strong>low</strong>.\r\nIn the NovaDrone t<a href=\"http://casperelectronics.com/wp-content/uploads/comparator.jpg\"><img class=\"alignleft\" title=\"Comparator\" src=\"http://casperelectronics.com/wp-content/uploads/comparator-200x76.jpg\" alt=\"\" width=\"200\" height=\"76\" /></a>he triangle output of Osc 1 and Osc 2 combine through a simple comparator (fig. 8) to make a single square wave with a modulating pulse width. In this way, the comparator also functions as a pulse width modulation processor.\r\n\r\nFig. 9 below shows how two triangle waves are transformed through the comparator into a square wave with a modulating pulse width.\r\nThe blue triangle wave in fig. 9 is oscillator 1. The red triangle is osc 2. The green line is the combined PWM output.\r\nAny time the blue line (osc 1) is above the red line (osc 2), the green line (pwm) goes high. As the red line rises the percentage of each cycle that the blue line is above the red line decreases. This changing percentage is what makes our modulating pulse width effect.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/PWM3-copy.jpg\"><img class=\"alignnone size-large wp-image-1647\" title=\"PWM3 Copy\" src=\"http://casperelectronics.com/wp-content/uploads/PWM3-copy-460x202.jpg\" alt=\"\" width=\"460\" height=\"202\" /></a>\r\n\r\n<span style=\"color: #33cccc;\">Figure 9. Pulse width modulation detail</span>\r\n<ul>\r\n	<li>\r\n<h3><span style=\"color: #3366ff;\"><strong>Mixer</strong></span></h3>\r\n</li>\r\n</ul>\r\nThe audio signals from each of the three channels of the NovaDrone are mixed using the circuit in fig. 10.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/mixer.jpg\"><img class=\"alignleft\" title=\"Mixer\" src=\"http://casperelectronics.com/wp-content/uploads/mixer-200x135.jpg\" alt=\"\" width=\"200\" height=\"135\" /></a>This mixer is nice and simple and uses just one <strong>op amp</strong> and a few other components. This circuit is configured as an inverting mixer with an amplitude controlled by the <strong>feedback resistor</strong> and <strong>input resistors</strong>. The amplitude is calculated as RF/RI. In this case RF = 10,000 and RI = 100,000. That means the output signal is 1/10<sup>th</sup> the amplitude of the input signal.\r\n<strong><span style=\"text-decoration: underline;\">\r\n</span></strong>\r\n<ul>\r\n	<li>\r\n<h3><span style=\"color: #3366ff;\"><strong>LED drivers</strong></span></h3>\r\n</li>\r\n</ul>\r\n(3) 2N3904 NPN transistors are used to make 3 LED drivers.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/LEDdriver.jpg\"><img class=\"alignleft\" title=\"LEDdriver\" src=\"http://casperelectronics.com/wp-content/uploads/LEDdriver-200x108.jpg\" alt=\"\" width=\"200\" height=\"108\" /></a>A driver is a simple but important circuit which isolates elements which use lots of current (like LEDs) from sensitive circuits (like the oscillators in the NovaDrone). Failure to use a driver can result in something called a <strong>loading effect</strong> which basically means that the device being driven will affect the behavior of the rest of the circuit in bad ways, like the pitch changing when the lights turn on. The LED in the NovaDrone uses a lot of current relative to the rest of the circuit (90mA vs around 30mA for the rest of the circuit) therefore a driver is necessary. The key component of a driver is the <strong>transistor</strong>. This is another topic worth reading a lot about\r\n.\r\n\r\n</div>','NovaDrone Tech Manual',0,'','inherit','open','closed','','1704-revision-17','','','2012-11-05 15:59:42','2012-11-05 20:59:42','',1704,'http://casperelectronics.com/2012/11/05/1704-revision-17/',0,'revision','',0),(1723,2,'2012-11-05 16:02:26','2012-11-05 21:02:26','Throughout this guide I will attempt to give you some insight into the circuit theory and scientific principles at play in the NovaDrone. That said I will be giving little more than an intro to each topic and strongly encourage you to do further reading on topics you find interesting.\r\n<ul>\r\n	<li>This is a beta version of the <strong>NovaDrone Technical Guide</strong>. I expect to make revisions over time and eagerly encourage readers to send me feedback, questions, suggestions and especially corrections. Comments should be addressed to <a href=\"mailto:pete@casperelectronics.com\"><strong>pete@casperelectronics.com</strong></a>.</li>\r\n</ul>\r\n<h3 style=\"text-align: center;\"><span style=\"color: #000000;\"><strong>TABLE OF CONTENTS:</strong></span></h3>\r\n<a href=\"#sec1\"><strong><span style=\"text-decoration: underline;\">Section 1. Oscillator Primer</span></strong></a><hr>\r\n<ul>\r\n	<li><a href=\"#1.1\"><strong>1.1 Frequency, amplitude &amp; wave shape</strong></a>\r\n<ul>\r\n	<li><a href=\"#frequency\">Frequency</a></li>\r\n	<li><a href=\"#amplitude\">Amplitude</a></li>\r\n	<li><a href=\"#waveshape\"> Wave shape</a></li>\r\n	<li><a href=\"#review\"> Review<strong></strong></a></li>\r\n</ul>\r\n</li>\r\n	<li><a href=\"#1.2\"><strong>1.2 Phase</strong></a>\r\n<ul>\r\n	<li><a href=\"#phase\"> Phase controlled amplitude modulation</a></li>\r\n</ul>\r\n</li>\r\n</ul>\r\n<a href=\"#sec2\"><strong><span style=\"text-decoration: underline;\">Section 2. NovaDrone Oscillators</span></strong></a>\r\n<ul>\r\n	<li><a href=\"#2.1\"><strong>2.1 The Circuit</strong></a>\r\n<ul>\r\n	<li><a href=\"#feedbackloops\"> Feedback loops</a></li>\r\n	<li><a href=\"#schematic\"> Schematic</a></li>\r\n	<li><a href=\"#rctimeconstant\"> RC time constant</a></li>\r\n	<li><a href=\"#howitworks\"> How it works<strong></strong></a></li>\r\n</ul>\r\n</li>\r\n	<li><a href=\"#2.2\"><strong>2.2 Pulse Width Modulation</strong></a>\r\n<ul>\r\n	<li><a href=\"#comparator\">The comparator<strong></strong></a></li>\r\n</ul>\r\n</li>\r\n</ul>\r\n<a name=\"sec1\"></a><a name=\"1.1\"></a><a href=\"#sec3\"><strong><span style=\"text-decoration: underline;\">Sectio</span></strong></a><a href=\"#sec3\"><strong><span style=\"text-decoration: underline;\">n 3. Drivers and Mixers </span>*incomplete*</strong></a>\r\n<ul>\r\n	<li><a href=\"#led\"> LED driver</a></li>\r\n	<li><a href=\"#mixer\">Signal mixer</a><strong></strong></li>\r\n</ul>\r\n\r\n<hr />\r\n\r\n<h2 style=\"text-align: left;\"><span style=\"color: #3366ff;\"><strong>SECTION 1. OSCILLATOR PRIMER</strong></span></h2>\r\n<h2><span style=\"color: #3366ff;\"><strong style=\"text-align: center;\"><strong>◊ 1.1 Frequency, amplitude and wave shape◊</strong></strong></span></h2>\r\n\r\n<hr />\r\n\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/ampandfreq.jpg\"><img class=\"alignleft size-medium wp-image-1636\" title=\"Figure 1. A triangle wave oscillator\" src=\"http://casperelectronics.com/wp-content/uploads/ampandfreq-200x242.jpg\" alt=\"\" width=\"200\" height=\"242\" /></a>\r\n<div>\r\n\r\nThe heart of the NovaDrone is a bank of six independent oscillators.\r\n\r\n</div>\r\nAn oscillator is simply a pattern which repeats indefinitely. This can be a pattern of light, movement, electricity, even life cycles of organisms. The <a href=\"http://en.wikipedia.org/wiki/Oscillation\">wikipedia entry</a> gives dozens of examples of different kinds of oscillation.\r\n\r\nWhat we are most interested in is the modulation (changing amplitude) of electricity. All of the electrically produced sound we hear is a repeating pattern of fluctuating electrical current.\r\n\r\n&nbsp;\r\n\r\n<address> </address><address><em><span style=\"color: #33cccc;\">Figure 1. triangle oscillator</span></em></address>When this is applied to a speaker, the current activates a coil in the speaker which pushes the cone of the speaker away from or towards a fixed magnet. This action vibrates the air in front of the speaker which in turn vibrates the air in front of that and so on until that vibrations hit our ear drums and are perceived as sound. The sounds we hear around us are all incredibly complex patterns of air pressure modulation.\r\n<div>\r\n<ul>\r\n	<li><strong>The red line in fig 1 represents a voltage which goes up and down over a period of time. This is an oscillator.</strong></li>\r\n</ul>\r\nThere are three basic factors that make up all oscillators: <a name=\"frequency\"></a><strong>frequency</strong>, <strong>amplitude</strong> and <strong>wave shape</strong>. In musical terms we would call these <strong>pitch</strong>, <strong>volume</strong> and <strong>timbre</strong>. I will also talk a fair amount about <strong>phase </strong>which is relevant when working with multiple oscillators and plays an important role in creating drones.\r\n\r\n<hr />\r\n\r\n<ul>\r\n	<li>\r\n<h3><span style=\"color: #3366ff;\"><strong>Frequency</strong></span></h3>\r\n</li>\r\n</ul>\r\nOne complete sweep up and down is called a <strong>cycle</strong>. The number of cycles per second is your <strong>Frequency</strong> or <strong>Pitch</strong>.<strong></strong>\r\n<strong>Frequency</strong> is commonly measured in <strong>Hertz</strong>, which is the number of cycles per second.\r\n<a name=\"amplitude\"></a><strong>Pitch</strong> is another term for frequency which is used <span style=\"text-decoration: underline;\">only</span> when referring to the frequency of an audio signal.\r\nFigure 1 shows a triangle wave with a cycle length of .5 seconds. The frequency of this wave would be determined by seeing how many cycles will occur in 1 second. In this case there are 2 complete cycles in 1 second. That means the wave has a frequency of 2 Hertz. This is well below the hearing range. Humans can hear oscillators between 20Hz and 20,000 Hz.\r\n\r\n<hr />\r\n\r\n<ul>\r\n	<li>\r\n<h3><span style=\"color: #3366ff;\"><strong>Amplitude</strong></span></h3>\r\n</li>\r\n</ul>\r\nAmplitude refers to the magnitude of voltage change across one cycle of an oscillation.\r\n<a name=\"waveshape\"></a>This in turn impacts the volume of the signal if it is sent to a speaker.\r\nThe image above shows a triangle wave with a positive peak of +5 volts and a negative peak of -5 volts. The amplitude is determined by figuring the absolute difference between these peaks. In this case that difference is 10 volts. This is commonly referred to as 10 Vpk-pk (10 volts peak to peak). There are many different ways to measure amplitude (pk-pk, RMS, Vp, etc…) but we’ll just be talking about Vpk-pk.\r\n\r\n<hr />\r\n\r\n<ul>\r\n	<li>\r\n<h3><span style=\"color: #3366ff;\"><strong>Wave shape</strong></span><a href=\"http://casperelectronics.com/wp-content/uploads/waveshapes.png\"><img class=\"alignright\" title=\"Waveshapes\" src=\"http://casperelectronics.com/wp-content/uploads/waveshapes-200x160.png\" alt=\"\" width=\"292\" height=\"233\" /></a></h3>\r\n</li>\r\n</ul>\r\nThe wave shape is the pattern of amplitude modulation over the course of a cycle. The waveforms in fig 2 are: Sine, ramp, triangle and square.Sine, triangle and square are the most common and are all symmetrical waves. That means the positive and negative portions of each cycle are of the same duration. Many musical synthesizers offer other wave forms which are asymmetrical versions of these common waves such as ramp, saw and pulse waves.\r\n<p style=\"text-align: right;\"><span style=\"color: #33cccc;\"> Figure 2. Waveshapes  </span></p>\r\nThe importance and impact of wave shape depends on its application. Many audio effects such as <strong>tremolo</strong> or <strong>phaser</strong> use low frequency oscillators (LFOs) to modulate certain parameters of the sound. It is commonly more desirable to use a sine or triangle wave for many of these effects such as the tremolo which\r\n<a name=\"review\"></a>fades the volume in and out. Using a square wave for this would create dramatic shifts in volume which can be unpleasant.\r\nMany natural sounds are synthesized using overlapping wave forms like those shown above. For instance a flute can be synthesized using several octaves of a sine wave. A horn on the other hand will use more square waves and maybe a triangle or saw wave. More advanced wave and synthesis theory sites the sine wave as the basis of all wave forms. It is shown how even square waves can be created by combining several sine waves.\r\n\r\n<hr />\r\n\r\n<ul>\r\n	<li>\r\n<h3><strong>Review</strong></h3>\r\n</li>\r\n</ul>\r\nThe basic components of an oscillator are:\r\n<h3><a name=\"1.2\"></a></h3>\r\n<ul>\r\n	<li><strong>Frequency</strong>. The number of oscillation cycles that occur in one second. Measured in Hz</li>\r\n	<li><strong>Amplitude</strong>. Magnitude of voltage sweep in one cycle of an oscillator. Measured in Volts or Vpk-pk (volts peak to peak)</li>\r\n	<li><strong>Wave shape</strong>. Sine, triangle, square</li>\r\n</ul>\r\n\r\n<hr />\r\n\r\n\r\n\r\n<hr />\r\n\r\n<div></div>\r\n<h2 style=\"text-align: left;\"><span style=\"color: #3366ff;\"><strong>◊1.2 Phase◊</strong></span></h2>\r\nPhase is a bit more complicated than the other terms but plays an important role in audio circuitry and especially in making drones. Phase refers to a particular position in a <span style=\"text-decoration: underline;\">single cycle</span> of a wave (such as the positive or negative peak) and is measured in degrees. It is most commonly used to describe the relationship between multiple waves.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/phasedegrees.jpg\"><img class=\"alignnone size-large wp-image-1643\" title=\"Phasedegrees\" src=\"http://casperelectronics.com/wp-content/uploads/phasedegrees-460x236.jpg\" alt=\"\" width=\"460\" height=\"236\" /></a>\r\n\r\n<span style=\"color: #33cccc;\">Figure 3. Phase</span>\r\nFig. 3 shows two sine waves (red &amp; blue) of identical amplitude and frequency. The green oscillator is the mix or <em>average</em> of the red and blue oscillators.\r\nPhase is measured in degrees with 360 degrees being one complete cycle. 180 degrees is exactly ½ of a cycle.\r\nIn fig. 3 the phase of the blue oscillator is offset at 45 degree increments from the red oscillator from left to right. With each step you’ll notice that the waves get farther apart and that the amplitude of the green (average) oscillator decreases.\r\nThis may seem confusing at first but it’s really quite simple. The green oscillator is the average of the red and blue oscillators. Let’s say the red and blue oscillators sweep from -5 to +5VDC (10Vp-p). Now look at the right most illustration of the 2 waves out of phase by 180 degrees. When the blue wave is at its positive peak (90 degrees) of +5 volts, the red wave is at it’s negative peak (270 degrees) of -5 volts.\r\nWhat is the average of -5 and +5? Zero. They are always going to be the opposites of each other so the average will always be zero. Now look at the 90 degree image. When Blue is at +5 volts/90 degrees, red is at 0 volts/zero degrees. The average of +5 and zero is 2.5 volts.\r\nThe important thing to take away from the info above is that the amplitude of an oscillator created by mixing two similar oscillators is relative to the difference in phase of the two source waves.\r\nIn fig. 3 the oscillators have identical frequencies. This means that the phase relationship once established will remain the same and the resulting averaged amplitude of the two waves will also remain the same.\r\n<strong>Q: What will happen if the frequencies of your two waves are NOT identical? </strong>\r\nWe established above that the amplitude of the averaged waveform is relative to the phase difference of the two wave forms, therefore as the phase difference of two waves increases and decreases so too will the averaged waveforms’ amplitude. What we have here is phase controlled amplitude modulation and the rate of phase modulation is controlled by the frequency difference between your two oscillators.\r\nIn fig. 4 the blue oscillator has a frequency of 10 Hz, the red is 11Hz. That means that it takes the red wave 1/10<sup>th</sup> of a second longer to complete a cycle than the blue wave. You can see that with each cycle the red wave lags a little bit further behind the blue wave which increases the phase difference between the two. As a result, the amplitude of the averaged wave (green) decreases as the phase offset approaches 180 degrees and then increases as it continues past 180 to 360 degrees.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/phaseModulation.jpg\"><img class=\"alignnone size-large wp-image-1644\" title=\"PhaseModulation\" src=\"http://casperelectronics.com/wp-content/uploads/phaseModulation-460x202.jpg\" alt=\"\" width=\"460\" height=\"202\" /></a><a href=\"http://casperelectronics.com/wp-content/uploads/phase_modulation2.jpg\"><img class=\"alignnone size-large wp-image-1645\" title=\"Phase Modulation2\" src=\"http://casperelectronics.com/wp-content/uploads/phase_modulation2-460x220.jpg\" alt=\"\" width=\"460\" height=\"220\" /></a><a name=\"sec2\"></a><span style=\"color: #33cccc;\">Figure 4. Phase controlled amplitude</span>\r\n<h3><a name=\"2.1\"></a></h3>\r\nThis phenomenon of phase controlled amplitude is something many musicians use without even realizing it. This is the vary trick one uses when tuning a guitar. You tune one string to the other until the “beatingâ€ effect slows and eventually disappears.\r\n<hr /><hr />\r\n&nbsp;\r\n<h2 style=\"text-align: left;\"><span style=\"color: #3366ff;\"><strong>SECTION 2. NOVADRONE OSCILLATORS</strong></span></h2><hr />\r\n<h2 style=\"text-align: left;\"><span style=\"color: #3366ff;\"><strong>◊ 2.1 The circuit ◊</strong></span></h2>\r\nThe NovaDrone contains 6 oscillators. Each oscillator outputs a square wave and a triangle wave.\r\n<span style=\"text-decoration: underline;\"><a name=\"schematic\"></a></span>The circuit which generates the oscillators is clean, simple and robust. They are generated using a remarkable device called an <strong>op amp</strong>. If you are interested in building synthesizers and don’t know where to start, read up on <strong>op amps</strong>. They are the key elements of most oscillators, filters, envelope generators, mixers and amps.\r\n<ul><hr />\r\n	<li>\r\n<h3><span style=\"color: #3366ff;\"><strong>Schematic</strong></span></h3>\r\n</li>\r\n</ul>\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/OSC2rc.jpg\"><img class=\"alignleft\" title=\"OSC2rc\" src=\"http://casperelectronics.com/wp-content/uploads/OSC2rc-200x163.jpg\" alt=\"\" width=\"200\" height=\"163\" /></a>­­Each channel of the NovaDrone (Red, green and blue) has 2 oscillators. These are shown in fig. 5 and <a name=\"feedbackloops\"></a>fig. 6. They are very similar to one another but have been calibrated for different purposes.\r\n<strong>Osc 1</strong> is an audio frequency oscillator. It has a coarse and fine tune adjustment and only operates at audible frequencies (20Hz-20kHz).\r\n<strong>Osc 2</strong> is calibrated as a low frequency oscillator (LFO) with cycles as long as 2 minutes. It has a range switch and a single adjustment knob.\r\n<ul><hr />\r\n	<li>\r\n<h3><span style=\"color: #3366ff;\"><strong>Feedback loops</strong></span></h3>\r\n</li>\r\n</ul>\r\nThe oscillator circuit is a feedback loop between two op amps that are <a href=\"http://casperelectronics.com/wp-content/uploads/OSC1rc.jpg\"><img class=\"alignleft\" title=\"OSC1rc\" src=\"http://casperelectronics.com/wp-content/uploads/OSC1rc-200x170.jpg\" alt=\"\" width=\"200\" height=\"170\" /></a>configured as a <strong>schmitt trigger</strong> and an <strong>inverting integrator</strong>.\r\nBasically an <em>integrator</em> turns square waves into triangle waves.\r\nA <em>Schmitt trigger</em> is a kind of comparator that turns modulating signals (like triangle waves) into square waves.\r\nThe key elements of the relationship between these two circuits is that they form a loop (Schmitt &gt; integrator &gt;Schmitt&gt;integrator&gt; etc…) and that the integrator is also an <strong>inverter</strong>. This creates a continuous cycle of modulation:\r\n1) Schmitt output goes HI.\r\n2) Integrator inverts Schmitt signal and outputs slope going down (LOW).\r\n3) When slope is near zero volts, Schmitt trigger is thrown and its’ output goes LOW.\r\n4) Integrator inverts and generates upward slope (HI).\r\n5) When integrator slope reaches peak, Schmitt trigger is thrown and output goes HI.\r\n<a name=\"rctimeconstant\"></a>6) etc……\r\nThis is an overly simplified explanation but enough for our purposes. Do more research on these valuable circuits once you are familiar with some of the basics of op-amps.\r\n<ul><hr />\r\n	<li>\r\n<h3><span style=\"color: #3366ff;\"><strong>RC (resistor capacitor)time constant</strong></span></h3>\r\n</li>\r\n</ul>\r\nIn both oscillators (fig. 5 and 6) the primary element which defines frequency is the <strong>RC time constant</strong>. This relationship is a core component of most oscillators and is worth reading up on.\r\n\r\nThe RC time constant is a period of time defined by the relationship between a resistor and a capacitor.\r\nThe equation for this is simply <strong>t =</strong> <strong>R*C</strong>. In the case of the oscillators above it would be <strong>t=R1*C1</strong>.\r\nUnfortunately calculating the frequency of an oscillator is more complicated than just calculating your RC constant.\r\nIn many oscillators (including this one) there is a schmitt trigger component which watches the rising or sinking voltage from the integrator. The Schmitt trigger activates when the slope reaches predefined upper and lower limits. In order to determine the frequency of an oscillator we need to know what our upper and lower limits are and then calculate how long it takes our wave (the output of the integrator) to travel from one limit to the other.\r\nThese limits are determined by the relationship of 2 resistors in the schmitt stage. In fig 5 and 6 these are R2 and R3.\r\nThe equation for determining the duration of one cycle is\r\n(1/4R1C1)*(R3/R4)\r\nIn Oscillator 2 <strong>R</strong><strong>1</strong> is a 500k potentiometer in series with a 4.7k resistor between pins 8 and 13 of the two op amps. <strong>C</strong><strong>1</strong> is one of the three capacitors between pins 13 and 14 of the rightmost op amp. One of these caps is selected using a three way switch on the NovaDrone circuit board. This controls the frequency range of the LFO.\r\nLet’s say the pot is all the way up (full resistance) and the middle cap has been selected. The equations for RC and subsequently the frequency is:\r\n<strong>R1=504,700 Ohms</strong>\r\n<a name=\"howitworks\"></a><strong>C1= .000022 Farads</strong>\r\n<strong>R2 = 8,300 Ohms</strong>\r\n<strong>R3 = 10,000 Ohms</strong>\r\n<strong>Frequency in Hz = (1 / 4*R</strong><strong>1C</strong><strong>1) * (R</strong><strong>3/R</strong><strong>2)</strong>\r\n<ul><hr />\r\n	<li>\r\n<h3><span style=\"color: #3366ff;\"><strong>How it works</strong></span></h3>\r\n</li>\r\n</ul>\r\nResistors limit the flow of current and capacitors store current. Current flows through the resistor and is stored in the capacitor. The resistor controls how much current flows into the capacitor per second. Therefore the size of capacitor and the amount of resistance will determine how long it takes to fill the capacitor. A common analogy is to think about current flow as water, the resistor as a spigot\r\n<h3><a name=\"2.2\"></a></h3>\r\nand the capacitor as a cup. The more you open the spigot (reduce resistance), the more water (electrical current) will flow and the faster the cup will fill (capacitor will charge). The oscillator circuit is configured in a special way which causes the capacitor to continuously charge and discharge. It is looking for two states from the cap, fully charged or fully discharged. When the cap reaches either of these states, the whole circuit reverses polarity and the capacitors charge status begins moving toward the opposite state. The amount of time it takes to charge and discharge is your cycle duration.\r\n\r\n&nbsp;<hr /><hr />\r\n<h2 style=\"text-align: left;\"><span style=\"color: #3366ff;\"><strong>◊2.2 pulse width modulation (pwm)◊</strong></span></h2>\r\nPWM is exciting stuff….really! It is essentially a <strong>1 bit digital</strong> representation of an <strong>analog</strong> wave form.\r\nDigital wave forms only have 2 states, <strong>high</strong> and <strong>low</strong>. <strong>High</strong> is a voltage <em>at</em> or very close to the positive supply voltage. <strong>Low</strong> is a voltage <em>at</em> or very close to the negative supply voltage. It is basically just a square wave. Analog on the other hand is infinitely variable. Think about it like the difference between a light switch (digital) and a light dimmer (analog). PWM is a wave form that bridges the gap between these two formats. It can be used to make sound, control the brightness of an LED, control the speed of high torque motors and speak to microprocessors. It is also the language that a microprocessor will use to speak with the analog world.\r\nPulse Width (PW) refers to the relative durations of high and low voltage in a single <strong>cycle</strong> of a square wave.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/pulsewidth.jpg\"><img class=\"alignnone size-large wp-image-1648\" title=\"Pulsewidth\" src=\"http://casperelectronics.com/wp-content/uploads/pulsewidth-460x214.jpg\" alt=\"\" width=\"460\" height=\"214\" /></a><span style=\"color: #33cccc;\">Figure 7. Pulse width</span>\r\nFig. 7 shows three square wave oscillators of the same amplitude and frequency but with differing <strong>pulse width</strong>. The red oscillator has a 10% pulse width. That means the wave goes high for 10 % of the duration of one cycle. The green wave is 50% and the purple wave is 90%. What is important to note is that pulse width has nothing to do with frequency and only refers to the relationship between the high and low swing of the wave.\r\n<ul><hr />\r\n	<li>\r\n<h3><span style=\"color: #3366ff;\"><strong>The Comparator</strong></span></h3>\r\n</li>\r\n</ul>\r\nThe job of a comparator is simple. Two signals are fed into the “+â€ and “-“ inputs (labeled 10 and 9 in fig. 8 respectively). If the voltage at the “+â€ input is <em>higher</em> than the “-“ input the output of the comparator goes <strong>high</strong>.<strong> </strong>If the “+â€ input drops below the “-“ input the output goes <strong>low</strong>.\r\nIn the NovaDrone t<a href=\"http://casperelectronics.com/wp-content/uploads/comparator.jpg\"><img class=\"alignleft\" title=\"Comparator\" src=\"http://casperelectronics.com/wp-content/uploads/comparator-200x76.jpg\" alt=\"\" width=\"200\" height=\"76\" /></a>he triangle output of Osc 1 and Osc 2 combine through a simple comparator (fig. 8) to make a single square wave with a modulating pulse width. In this way, the comparator also functions as a pulse width modulation processor.\r\n\r\nFig. 9 below shows how two triangle waves are transformed through the comparator into a square wave with a modulating pulse width.\r\nThe blue triangle wave in fig. 9 is oscillator 1. The red triangle is osc 2. The green line is the combined PWM output.\r\nAny time the blue line (osc 1) is above the red line (osc 2), the green line (pwm) goes high. As the red line rises the percentage of each cycle that the blue line is above the red line decreases. This changing percentage is what makes our modulating pulse width effect.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/PWM3-copy.jpg\"><img class=\"alignnone size-large wp-image-1647\" title=\"PWM3 Copy\" src=\"http://casperelectronics.com/wp-content/uploads/PWM3-copy-460x202.jpg\" alt=\"\" width=\"460\" height=\"202\" /></a>\r\n\r\n<span style=\"color: #33cccc;\">Figure 9. Pulse width modulation detail</span>\r\n<ul><hr />\r\n	<li>\r\n<h3><span style=\"color: #3366ff;\"><strong>Mixer</strong></span></h3>\r\n</li>\r\n</ul>\r\nThe audio signals from each of the three channels of the NovaDrone are mixed using the circuit in fig. 10.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/mixer.jpg\"><img class=\"alignleft\" title=\"Mixer\" src=\"http://casperelectronics.com/wp-content/uploads/mixer-200x135.jpg\" alt=\"\" width=\"200\" height=\"135\" /></a>This mixer is nice and simple and uses just one <strong>op amp</strong> and a few other components. This circuit is configured as an inverting mixer with an amplitude controlled by the <strong>feedback resistor</strong> and <strong>input resistors</strong>. The amplitude is calculated as RF/RI. In this case RF = 10,000 and RI = 100,000. That means the output signal is 1/10<sup>th</sup> the amplitude of the input signal.\r\n<strong><span style=\"text-decoration: underline;\">\r\n</span></strong>\r\n<ul><hr />\r\n	<li>\r\n<h3><span style=\"color: #3366ff;\"><strong>LED drivers</strong></span></h3>\r\n</li>\r\n</ul>\r\n(3) 2N3904 NPN transistors are used to make 3 LED drivers.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/LEDdriver.jpg\"><img class=\"alignleft\" title=\"LEDdriver\" src=\"http://casperelectronics.com/wp-content/uploads/LEDdriver-200x108.jpg\" alt=\"\" width=\"200\" height=\"108\" /></a>A driver is a simple but important circuit which isolates elements which use lots of current (like LEDs) from sensitive circuits (like the oscillators in the NovaDrone). Failure to use a driver can result in something called a <strong>loading effect</strong> which basically means that the device being driven will affect the behavior of the rest of the circuit in bad ways, like the pitch changing when the lights turn on. The LED in the NovaDrone uses a lot of current relative to the rest of the circuit (90mA vs around 30mA for the rest of the circuit) therefore a driver is necessary. The key component of a driver is the <strong>transistor</strong>. This is another topic worth reading a lot about\r\n.\r\n\r\n</div>','NovaDrone Tech Manual',0,'','inherit','open','closed','','1704-revision-18','','','2012-11-05 16:02:26','2012-11-05 21:02:26','',1704,'http://casperelectronics.com/2012/11/05/1704-revision-18/',0,'revision','',0),(1724,2,'2012-11-05 16:03:50','2012-11-05 21:03:50','Throughout this guide I will attempt to give you some insight into the circuit theory and scientific principles at play in the NovaDrone. That said I will be giving little more than an intro to each topic and strongly encourage you to do further reading on topics you find interesting.\r\n<ul>\r\n	<li>This is a beta version of the <strong>NovaDrone Technical Guide</strong>. I expect to make revisions over time and eagerly encourage readers to send me feedback, questions, suggestions and especially corrections. Comments should be addressed to <a href=\"mailto:pete@casperelectronics.com\"><strong>pete@casperelectronics.com</strong></a>.</li>\r\n</ul>\r\n<h3 style=\"text-align: center;\"><span style=\"color: #000000;\"><strong>TABLE OF CONTENTS:</strong></span></h3>\r\n<a href=\"#sec1\"><strong><span style=\"text-decoration: underline;\">Section 1. Oscillator Primer</span></strong></a><hr>\r\n<ul>\r\n	<li><a href=\"#1.1\"><strong>1.1 Frequency, amplitude &amp; wave shape</strong></a>\r\n<ul>\r\n	<li><a href=\"#frequency\">Frequency</a></li>\r\n	<li><a href=\"#amplitude\">Amplitude</a></li>\r\n	<li><a href=\"#waveshape\"> Wave shape</a></li>\r\n	<li><a href=\"#review\"> Review<strong></strong></a></li>\r\n</ul>\r\n</li>\r\n	<li><a href=\"#1.2\"><strong>1.2 Phase</strong></a>\r\n<ul>\r\n	<li><a href=\"#phase\"> Phase controlled amplitude modulation</a></li>\r\n</ul>\r\n</li>\r\n</ul>\r\n<a href=\"#sec2\"><strong><span style=\"text-decoration: underline;\">Section 2. NovaDrone Oscillators</span></strong></a>\r\n<ul>\r\n	<li><a href=\"#2.1\"><strong>2.1 The Circuit</strong></a>\r\n<ul>\r\n	<li><a href=\"#feedbackloops\"> Feedback loops</a></li>\r\n	<li><a href=\"#schematic\"> Schematic</a></li>\r\n	<li><a href=\"#rctimeconstant\"> RC time constant</a></li>\r\n	<li><a href=\"#howitworks\"> How it works<strong></strong></a></li>\r\n</ul>\r\n</li>\r\n	<li><a href=\"#2.2\"><strong>2.2 Pulse Width Modulation</strong></a>\r\n<ul>\r\n	<li><a href=\"#comparator\">The comparator<strong></strong></a></li>\r\n</ul>\r\n</li>\r\n</ul>\r\n<a name=\"sec1\"></a><a name=\"1.1\"></a><a href=\"#sec3\"><strong><span style=\"text-decoration: underline;\">Sectio</span></strong></a><a href=\"#sec3\"><strong><span style=\"text-decoration: underline;\">n 3. Drivers and Mixers </span>*incomplete*</strong></a>\r\n<ul>\r\n	<li><a href=\"#led\"> LED driver</a></li>\r\n	<li><a href=\"#mixer\">Signal mixer</a><strong></strong></li>\r\n</ul>\r\n\r\n<hr />\r\n\r\n<h2 style=\"text-align: left;\"><span style=\"color: #3366ff;\"><strong>SECTION 1. OSCILLATOR PRIMER</strong></span></h2>\r\n<h2><span style=\"color: #3366ff;\"><strong style=\"text-align: center;\"><strong>◊ 1.1 Frequency, amplitude and wave shape◊</strong></strong></span></h2>\r\n\r\n\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/ampandfreq.jpg\"><img class=\"alignleft size-medium wp-image-1636\" title=\"Figure 1. A triangle wave oscillator\" src=\"http://casperelectronics.com/wp-content/uploads/ampandfreq-200x242.jpg\" alt=\"\" width=\"200\" height=\"242\" /></a>\r\n<div>\r\n\r\nThe heart of the NovaDrone is a bank of six independent oscillators.\r\n\r\n</div>\r\nAn oscillator is simply a pattern which repeats indefinitely. This can be a pattern of light, movement, electricity, even life cycles of organisms. The <a href=\"http://en.wikipedia.org/wiki/Oscillation\">wikipedia entry</a> gives dozens of examples of different kinds of oscillation.\r\n\r\nWhat we are most interested in is the modulation (changing amplitude) of electricity. All of the electrically produced sound we hear is a repeating pattern of fluctuating electrical current.\r\n\r\n&nbsp;\r\n\r\n<address> </address><address><em><span style=\"color: #33cccc;\">Figure 1. triangle oscillator</span></em></address>When this is applied to a speaker, the current activates a coil in the speaker which pushes the cone of the speaker away from or towards a fixed magnet. This action vibrates the air in front of the speaker which in turn vibrates the air in front of that and so on until that vibrations hit our ear drums and are perceived as sound. The sounds we hear around us are all incredibly complex patterns of air pressure modulation.\r\n<div>\r\n<ul>\r\n	<li><strong>The red line in fig 1 represents a voltage which goes up and down over a period of time. This is an oscillator.</strong></li>\r\n</ul>\r\nThere are three basic factors that make up all oscillators: <a name=\"frequency\"></a><strong>frequency</strong>, <strong>amplitude</strong> and <strong>wave shape</strong>. In musical terms we would call these <strong>pitch</strong>, <strong>volume</strong> and <strong>timbre</strong>. I will also talk a fair amount about <strong>phase </strong>which is relevant when working with multiple oscillators and plays an important role in creating drones.\r\n\r\n<hr />\r\n\r\n<ul>\r\n	<li>\r\n<h3><span style=\"color: #3366ff;\"><strong>Frequency</strong></span></h3>\r\n</li>\r\n</ul>\r\nOne complete sweep up and down is called a <strong>cycle</strong>. The number of cycles per second is your <strong>Frequency</strong> or <strong>Pitch</strong>.<strong></strong>\r\n<strong>Frequency</strong> is commonly measured in <strong>Hertz</strong>, which is the number of cycles per second.\r\n<a name=\"amplitude\"></a><strong>Pitch</strong> is another term for frequency which is used <span style=\"text-decoration: underline;\">only</span> when referring to the frequency of an audio signal.\r\nFigure 1 shows a triangle wave with a cycle length of .5 seconds. The frequency of this wave would be determined by seeing how many cycles will occur in 1 second. In this case there are 2 complete cycles in 1 second. That means the wave has a frequency of 2 Hertz. This is well below the hearing range. Humans can hear oscillators between 20Hz and 20,000 Hz.\r\n\r\n<hr />\r\n\r\n<ul>\r\n	<li>\r\n<h3><span style=\"color: #3366ff;\"><strong>Amplitude</strong></span></h3>\r\n</li>\r\n</ul>\r\nAmplitude refers to the magnitude of voltage change across one cycle of an oscillation.\r\n<a name=\"waveshape\"></a>This in turn impacts the volume of the signal if it is sent to a speaker.\r\nThe image above shows a triangle wave with a positive peak of +5 volts and a negative peak of -5 volts. The amplitude is determined by figuring the absolute difference between these peaks. In this case that difference is 10 volts. This is commonly referred to as 10 Vpk-pk (10 volts peak to peak). There are many different ways to measure amplitude (pk-pk, RMS, Vp, etc…) but we’ll just be talking about Vpk-pk.\r\n\r\n<hr />\r\n\r\n<ul>\r\n	<li>\r\n<h3><span style=\"color: #3366ff;\"><strong>Wave shape</strong></span><a href=\"http://casperelectronics.com/wp-content/uploads/waveshapes.png\"><img class=\"alignright\" title=\"Waveshapes\" src=\"http://casperelectronics.com/wp-content/uploads/waveshapes-200x160.png\" alt=\"\" width=\"292\" height=\"233\" /></a></h3>\r\n</li>\r\n</ul>\r\nThe wave shape is the pattern of amplitude modulation over the course of a cycle. The waveforms in fig 2 are: Sine, ramp, triangle and square.Sine, triangle and square are the most common and are all symmetrical waves. That means the positive and negative portions of each cycle are of the same duration. Many musical synthesizers offer other wave forms which are asymmetrical versions of these common waves such as ramp, saw and pulse waves.\r\n<p style=\"text-align: right;\"><span style=\"color: #33cccc;\"> Figure 2. Waveshapes  </span></p>\r\nThe importance and impact of wave shape depends on its application. Many audio effects such as <strong>tremolo</strong> or <strong>phaser</strong> use low frequency oscillators (LFOs) to modulate certain parameters of the sound. It is commonly more desirable to use a sine or triangle wave for many of these effects such as the tremolo which\r\n<a name=\"review\"></a>fades the volume in and out. Using a square wave for this would create dramatic shifts in volume which can be unpleasant.\r\nMany natural sounds are synthesized using overlapping wave forms like those shown above. For instance a flute can be synthesized using several octaves of a sine wave. A horn on the other hand will use more square waves and maybe a triangle or saw wave. More advanced wave and synthesis theory sites the sine wave as the basis of all wave forms. It is shown how even square waves can be created by combining several sine waves.\r\n\r\n<hr />\r\n\r\n<ul>\r\n	<li>\r\n<h3><strong>Review</strong></h3>\r\n</li>\r\n</ul>\r\nThe basic components of an oscillator are:\r\n<h3><a name=\"1.2\"></a></h3>\r\n<ul>\r\n	<li><strong>Frequency</strong>. The number of oscillation cycles that occur in one second. Measured in Hz</li>\r\n	<li><strong>Amplitude</strong>. Magnitude of voltage sweep in one cycle of an oscillator. Measured in Volts or Vpk-pk (volts peak to peak)</li>\r\n	<li><strong>Wave shape</strong>. Sine, triangle, square</li>\r\n</ul>\r\n\r\n<hr />\r\n\r\n\r\n\r\n<hr />\r\n\r\n<div></div>\r\n<h2 style=\"text-align: left;\"><span style=\"color: #3366ff;\"><strong>◊1.2 Phase◊</strong></span></h2>\r\nPhase is a bit more complicated than the other terms but plays an important role in audio circuitry and especially in making drones. Phase refers to a particular position in a <span style=\"text-decoration: underline;\">single cycle</span> of a wave (such as the positive or negative peak) and is measured in degrees. It is most commonly used to describe the relationship between multiple waves.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/phasedegrees.jpg\"><img class=\"alignnone size-large wp-image-1643\" title=\"Phasedegrees\" src=\"http://casperelectronics.com/wp-content/uploads/phasedegrees-460x236.jpg\" alt=\"\" width=\"460\" height=\"236\" /></a>\r\n\r\n<span style=\"color: #33cccc;\">Figure 3. Phase</span>\r\nFig. 3 shows two sine waves (red &amp; blue) of identical amplitude and frequency. The green oscillator is the mix or <em>average</em> of the red and blue oscillators.\r\nPhase is measured in degrees with 360 degrees being one complete cycle. 180 degrees is exactly ½ of a cycle.\r\nIn fig. 3 the phase of the blue oscillator is offset at 45 degree increments from the red oscillator from left to right. With each step you’ll notice that the waves get farther apart and that the amplitude of the green (average) oscillator decreases.\r\nThis may seem confusing at first but it’s really quite simple. The green oscillator is the average of the red and blue oscillators. Let’s say the red and blue oscillators sweep from -5 to +5VDC (10Vp-p). Now look at the right most illustration of the 2 waves out of phase by 180 degrees. When the blue wave is at its positive peak (90 degrees) of +5 volts, the red wave is at it’s negative peak (270 degrees) of -5 volts.\r\nWhat is the average of -5 and +5? Zero. They are always going to be the opposites of each other so the average will always be zero. Now look at the 90 degree image. When Blue is at +5 volts/90 degrees, red is at 0 volts/zero degrees. The average of +5 and zero is 2.5 volts.\r\nThe important thing to take away from the info above is that the amplitude of an oscillator created by mixing two similar oscillators is relative to the difference in phase of the two source waves.\r\nIn fig. 3 the oscillators have identical frequencies. This means that the phase relationship once established will remain the same and the resulting averaged amplitude of the two waves will also remain the same.\r\n<strong>Q: What will happen if the frequencies of your two waves are NOT identical? </strong>\r\nWe established above that the amplitude of the averaged waveform is relative to the phase difference of the two wave forms, therefore as the phase difference of two waves increases and decreases so too will the averaged waveforms’ amplitude. What we have here is phase controlled amplitude modulation and the rate of phase modulation is controlled by the frequency difference between your two oscillators.\r\nIn fig. 4 the blue oscillator has a frequency of 10 Hz, the red is 11Hz. That means that it takes the red wave 1/10<sup>th</sup> of a second longer to complete a cycle than the blue wave. You can see that with each cycle the red wave lags a little bit further behind the blue wave which increases the phase difference between the two. As a result, the amplitude of the averaged wave (green) decreases as the phase offset approaches 180 degrees and then increases as it continues past 180 to 360 degrees.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/phaseModulation.jpg\"><img class=\"alignnone size-large wp-image-1644\" title=\"PhaseModulation\" src=\"http://casperelectronics.com/wp-content/uploads/phaseModulation-460x202.jpg\" alt=\"\" width=\"460\" height=\"202\" /></a><a href=\"http://casperelectronics.com/wp-content/uploads/phase_modulation2.jpg\"><img class=\"alignnone size-large wp-image-1645\" title=\"Phase Modulation2\" src=\"http://casperelectronics.com/wp-content/uploads/phase_modulation2-460x220.jpg\" alt=\"\" width=\"460\" height=\"220\" /></a><a name=\"sec2\"></a><span style=\"color: #33cccc;\">Figure 4. Phase controlled amplitude</span>\r\n<h3><a name=\"2.1\"></a></h3>\r\nThis phenomenon of phase controlled amplitude is something many musicians use without even realizing it. This is the vary trick one uses when tuning a guitar. You tune one string to the other until the “beatingâ€ effect slows and eventually disappears.\r\n<hr /><hr />\r\n&nbsp;\r\n<h2 style=\"text-align: left;\"><span style=\"color: #3366ff;\"><strong>SECTION 2. NOVADRONE OSCILLATORS</strong></span></h2><hr />\r\n<h2 style=\"text-align: left;\"><span style=\"color: #3366ff;\"><strong>◊ 2.1 The circuit ◊</strong></span></h2>\r\nThe NovaDrone contains 6 oscillators. Each oscillator outputs a square wave and a triangle wave.\r\n<span style=\"text-decoration: underline;\"><a name=\"schematic\"></a></span>The circuit which generates the oscillators is clean, simple and robust. They are generated using a remarkable device called an <strong>op amp</strong>. If you are interested in building synthesizers and don’t know where to start, read up on <strong>op amps</strong>. They are the key elements of most oscillators, filters, envelope generators, mixers and amps.\r\n<ul><hr />\r\n	<li>\r\n<h3><span style=\"color: #3366ff;\"><strong>Schematic</strong></span></h3>\r\n</li>\r\n</ul>\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/OSC2rc.jpg\"><img class=\"alignleft\" title=\"OSC2rc\" src=\"http://casperelectronics.com/wp-content/uploads/OSC2rc-200x163.jpg\" alt=\"\" width=\"200\" height=\"163\" /></a>­­Each channel of the NovaDrone (Red, green and blue) has 2 oscillators. These are shown in fig. 5 and <a name=\"feedbackloops\"></a>fig. 6. They are very similar to one another but have been calibrated for different purposes.\r\n<strong>Osc 1</strong> is an audio frequency oscillator. It has a coarse and fine tune adjustment and only operates at audible frequencies (20Hz-20kHz).\r\n<strong>Osc 2</strong> is calibrated as a low frequency oscillator (LFO) with cycles as long as 2 minutes. It has a range switch and a single adjustment knob.\r\n<ul><hr />\r\n	<li>\r\n<h3><span style=\"color: #3366ff;\"><strong>Feedback loops</strong></span></h3>\r\n</li>\r\n</ul>\r\nThe oscillator circuit is a feedback loop between two op amps that are <a href=\"http://casperelectronics.com/wp-content/uploads/OSC1rc.jpg\"><img class=\"alignleft\" title=\"OSC1rc\" src=\"http://casperelectronics.com/wp-content/uploads/OSC1rc-200x170.jpg\" alt=\"\" width=\"200\" height=\"170\" /></a>configured as a <strong>schmitt trigger</strong> and an <strong>inverting integrator</strong>.\r\nBasically an <em>integrator</em> turns square waves into triangle waves.\r\nA <em>Schmitt trigger</em> is a kind of comparator that turns modulating signals (like triangle waves) into square waves.\r\nThe key elements of the relationship between these two circuits is that they form a loop (Schmitt &gt; integrator &gt;Schmitt&gt;integrator&gt; etc…) and that the integrator is also an <strong>inverter</strong>. This creates a continuous cycle of modulation:\r\n1) Schmitt output goes HI.\r\n2) Integrator inverts Schmitt signal and outputs slope going down (LOW).\r\n3) When slope is near zero volts, Schmitt trigger is thrown and its’ output goes LOW.\r\n4) Integrator inverts and generates upward slope (HI).\r\n5) When integrator slope reaches peak, Schmitt trigger is thrown and output goes HI.\r\n<a name=\"rctimeconstant\"></a>6) etc……\r\nThis is an overly simplified explanation but enough for our purposes. Do more research on these valuable circuits once you are familiar with some of the basics of op-amps.\r\n<ul><hr />\r\n	<li>\r\n<h3><span style=\"color: #3366ff;\"><strong>RC (resistor capacitor)time constant</strong></span></h3>\r\n</li>\r\n</ul>\r\nIn both oscillators (fig. 5 and 6) the primary element which defines frequency is the <strong>RC time constant</strong>. This relationship is a core component of most oscillators and is worth reading up on.\r\n\r\nThe RC time constant is a period of time defined by the relationship between a resistor and a capacitor.\r\nThe equation for this is simply <strong>t =</strong> <strong>R*C</strong>. In the case of the oscillators above it would be <strong>t=R1*C1</strong>.\r\nUnfortunately calculating the frequency of an oscillator is more complicated than just calculating your RC constant.\r\nIn many oscillators (including this one) there is a schmitt trigger component which watches the rising or sinking voltage from the integrator. The Schmitt trigger activates when the slope reaches predefined upper and lower limits. In order to determine the frequency of an oscillator we need to know what our upper and lower limits are and then calculate how long it takes our wave (the output of the integrator) to travel from one limit to the other.\r\nThese limits are determined by the relationship of 2 resistors in the schmitt stage. In fig 5 and 6 these are R2 and R3.\r\nThe equation for determining the duration of one cycle is\r\n(1/4R1C1)*(R3/R4)\r\nIn Oscillator 2 <strong>R</strong><strong>1</strong> is a 500k potentiometer in series with a 4.7k resistor between pins 8 and 13 of the two op amps. <strong>C</strong><strong>1</strong> is one of the three capacitors between pins 13 and 14 of the rightmost op amp. One of these caps is selected using a three way switch on the NovaDrone circuit board. This controls the frequency range of the LFO.\r\nLet’s say the pot is all the way up (full resistance) and the middle cap has been selected. The equations for RC and subsequently the frequency is:\r\n<strong>R1=504,700 Ohms</strong>\r\n<a name=\"howitworks\"></a><strong>C1= .000022 Farads</strong>\r\n<strong>R2 = 8,300 Ohms</strong>\r\n<strong>R3 = 10,000 Ohms</strong>\r\n<strong>Frequency in Hz = (1 / 4*R</strong><strong>1C</strong><strong>1) * (R</strong><strong>3/R</strong><strong>2)</strong>\r\n<ul><hr />\r\n	<li>\r\n<h3><span style=\"color: #3366ff;\"><strong>How it works</strong></span></h3>\r\n</li>\r\n</ul>\r\nResistors limit the flow of current and capacitors store current. Current flows through the resistor and is stored in the capacitor. The resistor controls how much current flows into the capacitor per second. Therefore the size of capacitor and the amount of resistance will determine how long it takes to fill the capacitor. A common analogy is to think about current flow as water, the resistor as a spigot\r\n<h3><a name=\"2.2\"></a></h3>\r\nand the capacitor as a cup. The more you open the spigot (reduce resistance), the more water (electrical current) will flow and the faster the cup will fill (capacitor will charge). The oscillator circuit is configured in a special way which causes the capacitor to continuously charge and discharge. It is looking for two states from the cap, fully charged or fully discharged. When the cap reaches either of these states, the whole circuit reverses polarity and the capacitors charge status begins moving toward the opposite state. The amount of time it takes to charge and discharge is your cycle duration.\r\n\r\n&nbsp;<hr /><hr />\r\n<h2 style=\"text-align: left;\"><span style=\"color: #3366ff;\"><strong>◊2.2 pulse width modulation (pwm)◊</strong></span></h2>\r\nPWM is exciting stuff….really! It is essentially a <strong>1 bit digital</strong> representation of an <strong>analog</strong> wave form.\r\nDigital wave forms only have 2 states, <strong>high</strong> and <strong>low</strong>. <strong>High</strong> is a voltage <em>at</em> or very close to the positive supply voltage. <strong>Low</strong> is a voltage <em>at</em> or very close to the negative supply voltage. It is basically just a square wave. Analog on the other hand is infinitely variable. Think about it like the difference between a light switch (digital) and a light dimmer (analog). PWM is a wave form that bridges the gap between these two formats. It can be used to make sound, control the brightness of an LED, control the speed of high torque motors and speak to microprocessors. It is also the language that a microprocessor will use to speak with the analog world.\r\nPulse Width (PW) refers to the relative durations of high and low voltage in a single <strong>cycle</strong> of a square wave.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/pulsewidth.jpg\"><img class=\"alignnone size-large wp-image-1648\" title=\"Pulsewidth\" src=\"http://casperelectronics.com/wp-content/uploads/pulsewidth-460x214.jpg\" alt=\"\" width=\"460\" height=\"214\" /></a><span style=\"color: #33cccc;\">Figure 7. Pulse width</span>\r\nFig. 7 shows three square wave oscillators of the same amplitude and frequency but with differing <strong>pulse width</strong>. The red oscillator has a 10% pulse width. That means the wave goes high for 10 % of the duration of one cycle. The green wave is 50% and the purple wave is 90%. What is important to note is that pulse width has nothing to do with frequency and only refers to the relationship between the high and low swing of the wave.\r\n<ul><hr />\r\n	<li>\r\n<h3><span style=\"color: #3366ff;\"><strong>The Comparator</strong></span></h3>\r\n</li>\r\n</ul>\r\nThe job of a comparator is simple. Two signals are fed into the “+â€ and “-“ inputs (labeled 10 and 9 in fig. 8 respectively). If the voltage at the “+â€ input is <em>higher</em> than the “-“ input the output of the comparator goes <strong>high</strong>.<strong> </strong>If the “+â€ input drops below the “-“ input the output goes <strong>low</strong>.\r\nIn the NovaDrone t<a href=\"http://casperelectronics.com/wp-content/uploads/comparator.jpg\"><img class=\"alignleft\" title=\"Comparator\" src=\"http://casperelectronics.com/wp-content/uploads/comparator-200x76.jpg\" alt=\"\" width=\"200\" height=\"76\" /></a>he triangle output of Osc 1 and Osc 2 combine through a simple comparator (fig. 8) to make a single square wave with a modulating pulse width. In this way, the comparator also functions as a pulse width modulation processor.\r\n\r\nFig. 9 below shows how two triangle waves are transformed through the comparator into a square wave with a modulating pulse width.\r\nThe blue triangle wave in fig. 9 is oscillator 1. The red triangle is osc 2. The green line is the combined PWM output.\r\nAny time the blue line (osc 1) is above the red line (osc 2), the green line (pwm) goes high. As the red line rises the percentage of each cycle that the blue line is above the red line decreases. This changing percentage is what makes our modulating pulse width effect.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/PWM3-copy.jpg\"><img class=\"alignnone size-large wp-image-1647\" title=\"PWM3 Copy\" src=\"http://casperelectronics.com/wp-content/uploads/PWM3-copy-460x202.jpg\" alt=\"\" width=\"460\" height=\"202\" /></a>\r\n\r\n<span style=\"color: #33cccc;\">Figure 9. Pulse width modulation detail</span>\r\n<ul><hr />\r\n	<li>\r\n<h3><span style=\"color: #3366ff;\"><strong>Mixer</strong></span></h3>\r\n</li>\r\n</ul>\r\nThe audio signals from each of the three channels of the NovaDrone are mixed using the circuit in fig. 10.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/mixer.jpg\"><img class=\"alignleft\" title=\"Mixer\" src=\"http://casperelectronics.com/wp-content/uploads/mixer-200x135.jpg\" alt=\"\" width=\"200\" height=\"135\" /></a>This mixer is nice and simple and uses just one <strong>op amp</strong> and a few other components. This circuit is configured as an inverting mixer with an amplitude controlled by the <strong>feedback resistor</strong> and <strong>input resistors</strong>. The amplitude is calculated as RF/RI. In this case RF = 10,000 and RI = 100,000. That means the output signal is 1/10<sup>th</sup> the amplitude of the input signal.\r\n<strong><span style=\"text-decoration: underline;\">\r\n</span></strong>\r\n<ul><hr />\r\n	<li>\r\n<h3><span style=\"color: #3366ff;\"><strong>LED drivers</strong></span></h3>\r\n</li>\r\n</ul>\r\n(3) 2N3904 NPN transistors are used to make 3 LED drivers.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/LEDdriver.jpg\"><img class=\"alignleft\" title=\"LEDdriver\" src=\"http://casperelectronics.com/wp-content/uploads/LEDdriver-200x108.jpg\" alt=\"\" width=\"200\" height=\"108\" /></a>A driver is a simple but important circuit which isolates elements which use lots of current (like LEDs) from sensitive circuits (like the oscillators in the NovaDrone). Failure to use a driver can result in something called a <strong>loading effect</strong> which basically means that the device being driven will affect the behavior of the rest of the circuit in bad ways, like the pitch changing when the lights turn on. The LED in the NovaDrone uses a lot of current relative to the rest of the circuit (90mA vs around 30mA for the rest of the circuit) therefore a driver is necessary. The key component of a driver is the <strong>transistor</strong>. This is another topic worth reading a lot about\r\n.\r\n\r\n</div>','NovaDrone Tech Manual',0,'','inherit','open','closed','','1704-revision-19','','','2012-11-05 16:03:50','2012-11-05 21:03:50','',1704,'http://casperelectronics.com/2012/11/05/1704-revision-19/',0,'revision','',0),(1725,2,'2012-11-05 16:07:48','2012-11-05 21:07:48','Throughout this guide I will attempt to give you some insight into the circuit theory and scientific principles at play in the NovaDrone. That said I will be giving little more than an intro to each topic and strongly encourage you to do further reading on topics you find interesting.\r\n<ul>\r\n	<li>This is a beta version of the <strong>NovaDrone Technical Guide</strong>. I expect to make revisions over time and eagerly encourage readers to send me feedback, questions, suggestions and especially corrections. Comments should be addressed to <a href=\"mailto:pete@casperelectronics.com\"><strong>pete@casperelectronics.com</strong></a>.</li>\r\n</ul>\r\n<h3 style=\"text-align: center;\"><span style=\"color: #000000;\"><strong>TABLE OF CONTENTS:</strong></span></h3>\r\n<a href=\"#sec1\"><strong><span style=\"text-decoration: underline;\">Section 1. Oscillator Primer</span></strong></a><hr>\r\n<ul>\r\n	<li><a href=\"#1.1\"><strong>1.1 Frequency, amplitude &amp; wave shape</strong></a>\r\n<ul>\r\n	<li><a href=\"#frequency\">Frequency</a></li>\r\n	<li><a href=\"#amplitude\">Amplitude</a></li>\r\n	<li><a href=\"#waveshape\"> Wave shape</a></li>\r\n	<li><a href=\"#review\"> Review<strong></strong></a></li>\r\n</ul>\r\n</li>\r\n	<li><a href=\"#1.2\"><strong>1.2 Phase</strong></a>\r\n<ul>\r\n	<li><a href=\"#phase\"> Phase controlled amplitude modulation</a></li>\r\n</ul>\r\n</li>\r\n</ul>\r\n<a href=\"#sec2\"><strong><span style=\"text-decoration: underline;\">Section 2. NovaDrone Oscillators</span></strong></a>\r\n<ul>\r\n	<li><a href=\"#2.1\"><strong>2.1 The Circuit</strong></a>\r\n<ul>\r\n	<li><a href=\"#feedbackloops\"> Feedback loops</a></li>\r\n	<li><a href=\"#schematic\"> Schematic</a></li>\r\n	<li><a href=\"#rctimeconstant\"> RC time constant</a></li>\r\n	<li><a href=\"#howitworks\"> How it works<strong></strong></a></li>\r\n</ul>\r\n</li>\r\n	<li><a href=\"#2.2\"><strong>2.2 Pulse Width Modulation</strong></a>\r\n<ul>\r\n	<li><a href=\"#comparator\">The comparator<strong></strong></a></li>\r\n</ul>\r\n</li>\r\n</ul>\r\n<a name=\"sec1\"></a><a name=\"1.1\"></a><a href=\"#sec3\"><strong><span style=\"text-decoration: underline;\">Sectio</span></strong></a><a href=\"#sec3\"><strong><span style=\"text-decoration: underline;\">n 3. Drivers and Mixers </span>*incomplete*</strong></a>\r\n<ul>\r\n	<li><a href=\"#led\"> LED driver</a></li>\r\n	<li><a href=\"#mixer\">Signal mixer</a><strong></strong></li>\r\n</ul>\r\n\r\n<hr />\r\n\r\n<h2 style=\"text-align: left;\"><span style=\"color: #3366ff;\"><strong>SECTION 1. OSCILLATOR PRIMER</strong></span></h2>\r\n<h2><span style=\"color: #3366ff;\"><strong style=\"text-align: center;\"><strong>◊ 1.1 Frequency, amplitude and wave shape◊</strong></strong></span></h2>\r\n\r\n\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/ampandfreq.jpg\"><img class=\"alignleft size-medium wp-image-1636\" title=\"Figure 1. A triangle wave oscillator\" src=\"http://casperelectronics.com/wp-content/uploads/ampandfreq-200x242.jpg\" alt=\"\" width=\"200\" height=\"242\" /></a>\r\n<div>\r\n\r\nThe heart of the NovaDrone is a bank of six independent oscillators.\r\n\r\n</div>\r\nAn oscillator is simply a pattern which repeats indefinitely. This can be a pattern of light, movement, electricity, even life cycles of organisms. The <a href=\"http://en.wikipedia.org/wiki/Oscillation\">wikipedia entry</a> gives dozens of examples of different kinds of oscillation.\r\n\r\nWhat we are most interested in is the modulation (changing amplitude) of electricity. All of the electrically produced sound we hear is a repeating pattern of fluctuating electrical current.\r\n\r\n&nbsp;\r\n\r\n<address> </address><address><em><span style=\"color: #33cccc;\">Figure 1. triangle oscillator</span></em></address>When this is applied to a speaker, the current activates a coil in the speaker which pushes the cone of the speaker away from or towards a fixed magnet. This action vibrates the air in front of the speaker which in turn vibrates the air in front of that and so on until that vibrations hit our ear drums and are perceived as sound. The sounds we hear around us are all incredibly complex patterns of air pressure modulation.\r\n<div>\r\n<ul>\r\n	<li><strong>The red line in fig 1 represents a voltage which goes up and down over a period of time. This is an oscillator.</strong></li>\r\n</ul>\r\nThere are three basic factors that make up all oscillators: <a name=\"frequency\"></a><strong>frequency</strong>, <strong>amplitude</strong> and <strong>wave shape</strong>. In musical terms we would call these <strong>pitch</strong>, <strong>volume</strong> and <strong>timbre</strong>. I will also talk a fair amount about <strong>phase </strong>which is relevant when working with multiple oscillators and plays an important role in creating drones.\r\n\r\n<hr />\r\n\r\n<ul>\r\n	<li>\r\n<h3><span style=\"color: #3366ff;\"><strong>Frequency</strong></span></h3>\r\n</li>\r\n</ul>\r\nOne complete sweep up and down is called a <strong>cycle</strong>. The number of cycles per second is your <strong>Frequency</strong> or <strong>Pitch</strong>.<strong></strong>\r\n<strong>Frequency</strong> is commonly measured in <strong>Hertz</strong>, which is the number of cycles per second.\r\n<a name=\"amplitude\"></a><strong>Pitch</strong> is another term for frequency which is used <span style=\"text-decoration: underline;\">only</span> when referring to the frequency of an audio signal.\r\nFigure 1 shows a triangle wave with a cycle length of .5 seconds. The frequency of this wave would be determined by seeing how many cycles will occur in 1 second. In this case there are 2 complete cycles in 1 second. That means the wave has a frequency of 2 Hertz. This is well below the hearing range. Humans can hear oscillators between 20Hz and 20,000 Hz.\r\n\r\n<hr />\r\n\r\n<ul>\r\n	<li>\r\n<h3><span style=\"color: #3366ff;\"><strong>Amplitude</strong></span></h3>\r\n</li>\r\n</ul>\r\nAmplitude refers to the magnitude of voltage change across one cycle of an oscillation.\r\n<a name=\"waveshape\"></a>This in turn impacts the volume of the signal if it is sent to a speaker.\r\nThe image above shows a triangle wave with a positive peak of +5 volts and a negative peak of -5 volts. The amplitude is determined by figuring the absolute difference between these peaks. In this case that difference is 10 volts. This is commonly referred to as 10 Vpk-pk (10 volts peak to peak). There are many different ways to measure amplitude (pk-pk, RMS, Vp, etc…) but we’ll just be talking about Vpk-pk.\r\n\r\n<hr />\r\n\r\n<ul>\r\n	<li>\r\n<h3><span style=\"color: #3366ff;\"><strong>Wave shape</strong></span><a href=\"http://casperelectronics.com/wp-content/uploads/waveshapes.png\"><img class=\"alignright\" title=\"Waveshapes\" src=\"http://casperelectronics.com/wp-content/uploads/waveshapes-200x160.png\" alt=\"\" width=\"292\" height=\"233\" /></a></h3>\r\n</li>\r\n</ul>\r\nThe wave shape is the pattern of amplitude modulation over the course of a cycle. The waveforms in fig 2 are: Sine, ramp, triangle and square.Sine, triangle and square are the most common and are all symmetrical waves. That means the positive and negative portions of each cycle are of the same duration. Many musical synthesizers offer other wave forms which are asymmetrical versions of these common waves such as ramp, saw and pulse waves.\r\n<p style=\"text-align: right;\"><span style=\"color: #33cccc;\"> Figure 2. Waveshapes  </span></p>\r\nThe importance and impact of wave shape depends on its application. Many audio effects such as <strong>tremolo</strong> or <strong>phaser</strong> use low frequency oscillators (LFOs) to modulate certain parameters of the sound. It is commonly more desirable to use a sine or triangle wave for many of these effects such as the tremolo which\r\n<a name=\"review\"></a>fades the volume in and out. Using a square wave for this would create dramatic shifts in volume which can be unpleasant.\r\nMany natural sounds are synthesized using overlapping wave forms like those shown above. For instance a flute can be synthesized using several octaves of a sine wave. A horn on the other hand will use more square waves and maybe a triangle or saw wave. More advanced wave and synthesis theory sites the sine wave as the basis of all wave forms. It is shown how even square waves can be created by combining several sine waves.\r\n\r\n<hr />\r\n\r\n<ul>\r\n	<li>\r\n<h3><strong>Review</strong></h3>\r\n</li>\r\n</ul>\r\nThe basic components of an oscillator are:\r\n<h3><a name=\"1.2\"></a></h3>\r\n<ul>\r\n	<li><strong>Frequency</strong>. The number of oscillation cycles that occur in one second. Measured in Hz</li>\r\n	<li><strong>Amplitude</strong>. Magnitude of voltage sweep in one cycle of an oscillator. Measured in Volts or Vpk-pk (volts peak to peak)</li>\r\n	<li><strong>Wave shape</strong>. Sine, triangle, square</li>\r\n</ul>\r\n\r\n<hr />\r\n\r\n\r\n\r\n<hr />\r\n\r\n<div></div>\r\n<h2 style=\"text-align: left;\"><span style=\"color: #3366ff;\"><strong>◊1.2 Phase◊</strong></span></h2>\r\nPhase is a bit more complicated than the other terms but plays an important role in audio circuitry and especially in making drones. Phase refers to a particular position in a <span style=\"text-decoration: underline;\">single cycle</span> of a wave (such as the positive or negative peak) and is measured in degrees. It is most commonly used to describe the relationship between multiple waves.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/phasedegrees.jpg\"><img class=\"alignnone size-large wp-image-1643\" title=\"Phasedegrees\" src=\"http://casperelectronics.com/wp-content/uploads/phasedegrees-460x236.jpg\" alt=\"\" width=\"460\" height=\"236\" /></a>\r\n\r\n<span style=\"color: #33cccc;\">Figure 3. Phase</span>\r\nFig. 3 shows two sine waves (red &amp; blue) of identical amplitude and frequency. The green oscillator is the mix or <em>average</em> of the red and blue oscillators.\r\nPhase is measured in degrees with 360 degrees being one complete cycle. 180 degrees is exactly ½ of a cycle.\r\nIn fig. 3 the phase of the blue oscillator is offset at 45 degree increments from the red oscillator from left to right. With each step you’ll notice that the waves get farther apart and that the amplitude of the green (average) oscillator decreases.\r\nThis may seem confusing at first but it’s really quite simple. The green oscillator is the average of the red and blue oscillators. Let’s say the red and blue oscillators sweep from -5 to +5VDC (10Vp-p). Now look at the right most illustration of the 2 waves out of phase by 180 degrees. When the blue wave is at its positive peak (90 degrees) of +5 volts, the red wave is at it’s negative peak (270 degrees) of -5 volts.\r\nWhat is the average of -5 and +5? Zero. They are always going to be the opposites of each other so the average will always be zero. Now look at the 90 degree image. When Blue is at +5 volts/90 degrees, red is at 0 volts/zero degrees. The average of +5 and zero is 2.5 volts.\r\nThe important thing to take away from the info above is that the amplitude of an oscillator created by mixing two similar oscillators is relative to the difference in phase of the two source waves.\r\nIn fig. 3 the oscillators have identical frequencies. This means that the phase relationship once established will remain the same and the resulting averaged amplitude of the two waves will also remain the same.\r\n<strong>Q: What will happen if the frequencies of your two waves are NOT identical? </strong>\r\nWe established above that the amplitude of the averaged waveform is relative to the phase difference of the two wave forms, therefore as the phase difference of two waves increases and decreases so too will the averaged waveforms’ amplitude. What we have here is phase controlled amplitude modulation and the rate of phase modulation is controlled by the frequency difference between your two oscillators.\r\nIn fig. 4 the blue oscillator has a frequency of 10 Hz, the red is 11Hz. That means that it takes the red wave 1/10<sup>th</sup> of a second longer to complete a cycle than the blue wave. You can see that with each cycle the red wave lags a little bit further behind the blue wave which increases the phase difference between the two. As a result, the amplitude of the averaged wave (green) decreases as the phase offset approaches 180 degrees and then increases as it continues past 180 to 360 degrees.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/phaseModulation.jpg\"><img class=\"alignnone size-large wp-image-1644\" title=\"PhaseModulation\" src=\"http://casperelectronics.com/wp-content/uploads/phaseModulation-460x202.jpg\" alt=\"\" width=\"460\" height=\"202\" /></a><a href=\"http://casperelectronics.com/wp-content/uploads/phase_modulation2.jpg\"><img class=\"alignnone size-large wp-image-1645\" title=\"Phase Modulation2\" src=\"http://casperelectronics.com/wp-content/uploads/phase_modulation2-460x220.jpg\" alt=\"\" width=\"460\" height=\"220\" /></a><a name=\"sec2\"></a><span style=\"color: #33cccc;\">Figure 4. Phase controlled amplitude</span>\r\n<h3><a name=\"2.1\"></a></h3>\r\nThis phenomenon of phase controlled amplitude is something many musicians use without even realizing it. This is the vary trick one uses when tuning a guitar. You tune one string to the other until the “beatingâ€ effect slows and eventually disappears.\r\n<hr /><hr />\r\n&nbsp;\r\n<h2 style=\"text-align: left;\"><span style=\"color: #3366ff;\"><strong>SECTION 2. NOVADRONE OSCILLATORS</strong></span></h2><hr />\r\n<h2 style=\"text-align: left;\"><span style=\"color: #3366ff;\"><strong>◊ 2.1 The circuit ◊</strong></span></h2>\r\nThe NovaDrone contains 6 oscillators. Each oscillator outputs a square wave and a triangle wave.\r\n<span style=\"text-decoration: underline;\"><a name=\"schematic\"></a></span>The circuit which generates the oscillators is clean, simple and robust. They are generated using a remarkable device called an <strong>op amp</strong>. If you are interested in building synthesizers and don’t know where to start, read up on <strong>op amps</strong>. They are the key elements of most oscillators, filters, envelope generators, mixers and amps.\r\n<ul><hr />\r\n	<li>\r\n<h3><span style=\"color: #3366ff;\"><strong>Schematic</strong></span></h3>\r\n</li>\r\n</ul>\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/OSC2rc.jpg\"><img class=\"alignleft\" title=\"OSC2rc\" src=\"http://casperelectronics.com/wp-content/uploads/OSC2rc-200x163.jpg\" alt=\"\" width=\"200\" height=\"163\" /></a>­­Each channel of the NovaDrone (Red, green and blue) has 2 oscillators. These are shown in fig. 5 and <a name=\"feedbackloops\"></a>fig. 6. They are very similar to one another but have been calibrated for different purposes.\r\n<strong>Osc 1</strong> is an audio frequency oscillator. It has a coarse and fine tune adjustment and only operates at audible frequencies (20Hz-20kHz).\r\n<strong>Osc 2</strong> is calibrated as a low frequency oscillator (LFO) with cycles as long as 2 minutes. It has a range switch and a single adjustment knob.\r\n<ul><hr />\r\n	<li>\r\n<h3><span style=\"color: #3366ff;\"><strong>Feedback loops</strong></span></h3>\r\n</li>\r\n</ul>\r\nThe oscillator circuit is a feedback loop between two op amps that are <a href=\"http://casperelectronics.com/wp-content/uploads/OSC1rc.jpg\"><img class=\"alignleft\" title=\"OSC1rc\" src=\"http://casperelectronics.com/wp-content/uploads/OSC1rc-200x170.jpg\" alt=\"\" width=\"200\" height=\"170\" /></a>configured as a <strong>schmitt trigger</strong> and an <strong>inverting integrator</strong>.\r\nBasically an <em>integrator</em> turns square waves into triangle waves.\r\nA <em>Schmitt trigger</em> is a kind of comparator that turns modulating signals (like triangle waves) into square waves.\r\nThe key elements of the relationship between these two circuits is that they form a loop (Schmitt &gt; integrator &gt;Schmitt&gt;integrator&gt; etc…) and that the integrator is also an <strong>inverter</strong>. This creates a continuous cycle of modulation:\r\n1) Schmitt output goes HI.\r\n2) Integrator inverts Schmitt signal and outputs slope going down (LOW).\r\n3) When slope is near zero volts, Schmitt trigger is thrown and its’ output goes LOW.\r\n4) Integrator inverts and generates upward slope (HI).\r\n5) When integrator slope reaches peak, Schmitt trigger is thrown and output goes HI.\r\n<a name=\"rctimeconstant\"></a>6) etc……\r\nThis is an overly simplified explanation but enough for our purposes. Do more research on these valuable circuits once you are familiar with some of the basics of op-amps.\r\n<ul><hr />\r\n	<li>\r\n<h3><span style=\"color: #3366ff;\"><strong>RC (resistor capacitor)time constant</strong></span></h3>\r\n</li>\r\n</ul>\r\nIn both oscillators (fig. 5 and 6) the primary element which defines frequency is the <strong>RC time constant</strong>. This relationship is a core component of most oscillators and is worth reading up on.\r\n\r\nThe RC time constant is a period of time defined by the relationship between a resistor and a capacitor.\r\nThe equation for this is simply <strong>t =</strong> <strong>R*C</strong>. In the case of the oscillators above it would be <strong>t=R1*C1</strong>.\r\nUnfortunately calculating the frequency of an oscillator is more complicated than just calculating your RC constant.\r\nIn many oscillators (including this one) there is a schmitt trigger component which watches the rising or sinking voltage from the integrator. The Schmitt trigger activates when the slope reaches predefined upper and lower limits. In order to determine the frequency of an oscillator we need to know what our upper and lower limits are and then calculate how long it takes our wave (the output of the integrator) to travel from one limit to the other.\r\nThese limits are determined by the relationship of 2 resistors in the schmitt stage. In fig 5 and 6 these are R2 and R3.\r\nThe equation for determining the duration of one cycle is\r\n(1/4R1C1)*(R3/R4)\r\nIn Oscillator 2 <strong>R</strong><strong>1</strong> is a 500k potentiometer in series with a 4.7k resistor between pins 8 and 13 of the two op amps. <strong>C</strong><strong>1</strong> is one of the three capacitors between pins 13 and 14 of the rightmost op amp. One of these caps is selected using a three way switch on the NovaDrone circuit board. This controls the frequency range of the LFO.\r\nLet’s say the pot is all the way up (full resistance) and the middle cap has been selected. The equations for RC and subsequently the frequency is:\r\n<strong>R1=504,700 Ohms</strong>\r\n<a name=\"howitworks\"></a><strong>C1= .000022 Farads</strong>\r\n<strong>R2 = 8,300 Ohms</strong>\r\n<strong>R3 = 10,000 Ohms</strong>\r\n<strong>Frequency in Hz = (1 / 4*R</strong><strong>1C</strong><strong>1) * (R</strong><strong>3/R</strong><strong>2)</strong>\r\n<ul><hr />\r\n	<li>\r\n<h3><span style=\"color: #3366ff;\"><strong>How it works</strong></span></h3>\r\n</li>\r\n</ul>\r\nResistors limit the flow of current and capacitors store current. Current flows through the resistor and is stored in the capacitor. The resistor controls how much current flows into the capacitor per second. Therefore the size of capacitor and the amount of resistance will determine how long it takes to fill the capacitor. A common analogy is to think about current flow as water, the resistor as a spigot\r\n<h3><a name=\"2.2\"></a></h3>\r\nand the capacitor as a cup. The more you open the spigot (reduce resistance), the more water (electrical current) will flow and the faster the cup will fill (capacitor will charge). The oscillator circuit is configured in a special way which causes the capacitor to continuously charge and discharge. It is looking for two states from the cap, fully charged or fully discharged. When the cap reaches either of these states, the whole circuit reverses polarity and the capacitors charge status begins moving toward the opposite state. The amount of time it takes to charge and discharge is your cycle duration.\r\n\r\n&nbsp;<hr /><hr />\r\n<h2 style=\"text-align: left;\"><span style=\"color: #3366ff;\"><strong>◊2.2 pulse width modulation (pwm)◊</strong></span></h2>\r\nPWM is exciting stuff….really! It is essentially a <strong>1 bit digital</strong> representation of an <strong>analog</strong> wave form.\r\nDigital wave forms only have 2 states, <strong>high</strong> and <strong>low</strong>. <strong>High</strong> is a voltage <em>at</em> or very close to the positive supply voltage. <strong>Low</strong> is a voltage <em>at</em> or very close to the negative supply voltage. It is basically just a square wave. Analog on the other hand is infinitely variable. Think about it like the difference between a light switch (digital) and a light dimmer (analog). PWM is a wave form that bridges the gap between these two formats. It can be used to make sound, control the brightness of an LED, control the speed of high torque motors and speak to microprocessors. It is also the language that a microprocessor will use to speak with the analog world.\r\nPulse Width (PW) refers to the relative durations of high and low voltage in a single <strong>cycle</strong> of a square wave.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/pulsewidth.jpg\"><img class=\"alignnone size-large wp-image-1648\" title=\"Pulsewidth\" src=\"http://casperelectronics.com/wp-content/uploads/pulsewidth-460x214.jpg\" alt=\"\" width=\"460\" height=\"214\" /></a><span style=\"color: #33cccc;\">Figure 7. Pulse width</span>\r\nFig. 7 shows three square wave oscillators of the same amplitude and frequency but with differing <strong>pulse width</strong>. The red oscillator has a 10% pulse width. That means the wave goes high for 10 % of the duration of one cycle. The green wave is 50% and the purple wave is 90%. What is important to note is that pulse width has nothing to do with frequency and only refers to the relationship between the high and low swing of the wave.\r\n<ul><hr />\r\n	<li>\r\n<h3><span style=\"color: #3366ff;\"><strong>The Comparator</strong></span></h3>\r\n</li>\r\n</ul>\r\nThe job of a comparator is simple. Two signals are fed into the “+â€ and “-“ inputs (labeled 10 and 9 in fig. 8 respectively). If the voltage at the “+â€ input is <em>higher</em> than the “-“ input the output of the comparator goes <strong>high</strong>.<strong> </strong>If the “+â€ input drops below the “-“ input the output goes <strong>low</strong>.\r\nIn the NovaDrone t<a href=\"http://casperelectronics.com/wp-content/uploads/comparator.jpg\"><img class=\"alignleft\" title=\"Comparator\" src=\"http://casperelectronics.com/wp-content/uploads/comparator-200x76.jpg\" alt=\"\" width=\"200\" height=\"76\" /></a>he triangle output of Osc 1 and Osc 2 combine through a simple comparator (fig. 8) to make a single square wave with a modulating pulse width. In this way, the comparator also functions as a pulse width modulation processor.\r\n\r\nFig. 9 below shows how two triangle waves are transformed through the comparator into a square wave with a modulating pulse width.\r\nThe blue triangle wave in fig. 9 is oscillator 1. The red triangle is osc 2. The green line is the combined PWM output.\r\nAny time the blue line (osc 1) is above the red line (osc 2), the green line (pwm) goes high. As the red line rises the percentage of each cycle that the blue line is above the red line decreases. This changing percentage is what makes our modulating pulse width effect.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/PWM3-copy.jpg\"><img class=\"alignnone size-large wp-image-1647\" title=\"PWM3 Copy\" src=\"http://casperelectronics.com/wp-content/uploads/PWM3-copy-460x202.jpg\" alt=\"\" width=\"460\" height=\"202\" /></a>\r\n\r\n<span style=\"color: #33cccc;\">Figure 9. Pulse width modulation detail</span>\r\n<ul><hr />\r\n	<li>\r\n<h3><span style=\"color: #3366ff;\"><strong>Mixer</strong></span></h3>\r\n</li>\r\n</ul>\r\nThe audio signals from each of the three channels of the NovaDrone are mixed using the circuit in fig. 10.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/mixer.jpg\"><img class=\"alignleft\" title=\"Mixer\" src=\"http://casperelectronics.com/wp-content/uploads/mixer-200x135.jpg\" alt=\"\" width=\"200\" height=\"135\" /></a>This mixer is nice and simple and uses just one <strong>op amp</strong> and a few other components. This circuit is configured as an inverting mixer with an amplitude controlled by the <strong>feedback resistor</strong> and <strong>input resistors</strong>. The amplitude is calculated as RF/RI. In this case RF = 10,000 and RI = 100,000. That means the output signal is 1/10<sup>th</sup> the amplitude of the input signal.\r\n<strong><span style=\"text-decoration: underline;\">\r\n</span></strong>\r\n<ul><hr />\r\n	<li>\r\n<h3><span style=\"color: #3366ff;\"><strong>LED drivers</strong></span></h3>\r\n</li>\r\n</ul>\r\n(3) 2N3904 NPN transistors are used to make 3 LED drivers.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/LEDdriver.jpg\"><img class=\"alignleft\" title=\"LEDdriver\" src=\"http://casperelectronics.com/wp-content/uploads/LEDdriver-200x108.jpg\" alt=\"\" width=\"200\" height=\"108\" /></a>A driver is a simple but important circuit which isolates elements which use lots of current (like LEDs) from sensitive circuits (like the oscillators in the NovaDrone). Failure to use a driver can result in something called a <strong>loading effect</strong> which basically means that the device being driven will affect the behavior of the rest of the circuit in bad ways, like the pitch changing when the lights turn on. The LED in the NovaDrone uses a lot of current relative to the rest of the circuit (90mA vs around 30mA for the rest of the circuit) therefore a driver is necessary. The key component of a driver is the <strong>transistor</strong>. This is another topic worth reading a lot about\r\n.\r\n\r\n</div>','NovaDrone Tech Manual',0,'','inherit','open','closed','','1704-revision-20','','','2012-11-05 16:07:48','2012-11-05 21:07:48','',1704,'http://casperelectronics.com/2012/11/05/1704-revision-20/',0,'revision','',0),(1727,2,'2012-11-06 17:17:22','2012-11-06 22:17:22','Throughout this guide I will attempt to give you some insight into the circuit theory and scientific principles at play in the NovaDrone. That said I will be giving little more than an intro to each topic and strongly encourage you to do further reading on topics you find interesting.\r\n<ul>\r\n	<li>This is a beta version of the <strong>NovaDrone Technical Guide</strong>. I expect to make revisions over time and eagerly encourage readers to send me feedback, questions, suggestions and especially corrections. Comments should be addressed to <a href=\"mailto:pete@casperelectronics.com\"><strong>pete@casperelectronics.com</strong></a>.</li>\r\n</ul>\r\n\r\n<hr />\r\n\r\n<h3 style=\"text-align: center;\"><span style=\"color: #000000;\"><strong>TABLE OF CONTENTS:</strong></span></h3>\r\n<a href=\"#sec1\"><strong><span style=\"text-decoration: underline;\">Section 1. Oscillator Primer</span></strong></a>\r\n<ul>\r\n	<li><a href=\"#1.1\"><strong>1.1 Frequency, amplitude &amp; wave shape</strong></a>\r\n<ul>\r\n	<li><a href=\"#frequency\">Frequency</a></li>\r\n	<li><a href=\"#amplitude\">Amplitude</a></li>\r\n	<li><a href=\"#waveshape\"> Wave shape</a></li>\r\n	<li><a href=\"#review\"> Review<strong></strong></a></li>\r\n</ul>\r\n</li>\r\n	<li><a href=\"#1.2\"><strong>1.2 Phase</strong></a>\r\n<ul>\r\n	<li><a href=\"#phase\"> Phase controlled amplitude modulation</a></li>\r\n</ul>\r\n</li>\r\n</ul>\r\n<a href=\"#sec2\"><strong><span style=\"text-decoration: underline;\">Section 2. NovaDrone Oscillators</span></strong></a>\r\n<ul>\r\n	<li><a href=\"#2.1\"><strong>2.1 The Circuit</strong></a>\r\n<ul>\r\n	<li><a href=\"#feedbackloops\"> Feedback loops</a></li>\r\n	<li><a href=\"#schematic\"> Schematic</a></li>\r\n	<li><a href=\"#rctimeconstant\"> RC time constant</a></li>\r\n	<li><a href=\"#howitworks\"> How it works<strong></strong></a></li>\r\n</ul>\r\n</li>\r\n	<li><a href=\"#2.2\"><strong>2.2 Pulse Width Modulation</strong></a>\r\n<ul>\r\n	<li><a href=\"#comparator\">The comparator<strong></strong></a></li>\r\n</ul>\r\n</li>\r\n</ul>\r\n<a name=\"sec1\"></a><a name=\"1.1\"></a><a href=\"#sec3\"><strong><span style=\"text-decoration: underline;\">Sectio</span></strong></a><a href=\"#sec3\"><strong><span style=\"text-decoration: underline;\">n 3. Drivers and Mixers </span>*incomplete*</strong></a>\r\n<ul>\r\n	<li><a href=\"#led\"> LED driver</a></li>\r\n	<li><a href=\"#mixer\">Signal mixer</a><strong></strong></li>\r\n</ul>\r\n\r\n<hr />\r\n\r\n<h2 style=\"text-align: left;\"><span style=\"color: #3366ff;\"><strong>SECTION 1. OSCILLATOR PRIMER</strong></span></h2>\r\n<h2><span style=\"color: #3366ff;\"><strong style=\"text-align: center;\"><strong>◊ 1.1 Frequency, amplitude and wave shape◊</strong></strong></span></h2>\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/ampandfreq.jpg\"><img class=\"alignleft size-medium wp-image-1636\" title=\"Figure 1. A triangle wave oscillator\" src=\"http://casperelectronics.com/wp-content/uploads/ampandfreq-200x242.jpg\" alt=\"\" width=\"200\" height=\"242\" /></a>\r\n<div>\r\n\r\nThe heart of the NovaDrone is a bank of six independent oscillators.\r\n\r\n</div>\r\nAn oscillator is simply a pattern which repeats indefinitely. This can be a pattern of light, movement, electricity, even life cycles of organisms. The <a href=\"http://en.wikipedia.org/wiki/Oscillation\">wikipedia entry</a> gives dozens of examples of different kinds of oscillation.\r\n\r\nWhat we are most interested in is the modulation (changing amplitude) of electricity. All of the electrically produced sound we hear is a repeating pattern of fluctuating electrical current.\r\n\r\n&nbsp;\r\n\r\n<address> </address><address><em><span style=\"color: #33cccc;\">Figure 1. triangle oscillator</span></em></address>When this is applied to a speaker, the current activates a coil in the speaker which pushes the cone of the speaker away from or towards a fixed magnet. This action vibrates the air in front of the speaker which in turn vibrates the air in front of that and so on until that vibrations hit our ear drums and are perceived as sound. The sounds we hear around us are all incredibly complex patterns of air pressure modulation.\r\n<div>\r\n<ul>\r\n	<li><strong>The red line in fig 1 represents a voltage which goes up and down over a period of time. This is an oscillator.</strong></li>\r\n</ul>\r\nThere are three basic factors that make up all oscillators: <a name=\"frequency\"></a><strong>frequency</strong>, <strong>amplitude</strong> and <strong>wave shape</strong>. In musical terms we would call these <strong>pitch</strong>, <strong>volume</strong> and <strong>timbre</strong>. I will also talk a fair amount about <strong>phase </strong>which is relevant when working with multiple oscillators and plays an important role in creating drones.\r\n\r\n<hr />\r\n\r\n<ul>\r\n	<li>\r\n<h3><span style=\"color: #3366ff;\"><strong>Frequency</strong></span></h3>\r\n</li>\r\n</ul>\r\nOne complete sweep up and down is called a <strong>cycle</strong>. The number of cycles per second is your <strong>Frequency</strong> or <strong>Pitch</strong>.<strong></strong>\r\n<strong>Frequency</strong> is commonly measured in <strong>Hertz</strong>, which is the number of cycles per second.\r\n<a name=\"amplitude\"></a><strong>Pitch</strong> is another term for frequency which is used <span style=\"text-decoration: underline;\">only</span> when referring to the frequency of an audio signal.\r\nFigure 1 shows a triangle wave with a cycle length of .5 seconds. The frequency of this wave would be determined by seeing how many cycles will occur in 1 second. In this case there are 2 complete cycles in 1 second. That means the wave has a frequency of 2 Hertz. This is well below the hearing range. Humans can hear oscillators between 20Hz and 20,000 Hz.\r\n\r\n<hr />\r\n\r\n<ul>\r\n	<li>\r\n<h3><span style=\"color: #3366ff;\"><strong>Amplitude</strong></span></h3>\r\n</li>\r\n</ul>\r\nAmplitude refers to the magnitude of voltage change across one cycle of an oscillation.\r\n<a name=\"waveshape\"></a>This in turn impacts the volume of the signal if it is sent to a speaker.\r\nThe image above shows a triangle wave with a positive peak of +5 volts and a negative peak of -5 volts. The amplitude is determined by figuring the absolute difference between these peaks. In this case that difference is 10 volts. This is commonly referred to as 10 Vpk-pk (10 volts peak to peak). There are many different ways to measure amplitude (pk-pk, RMS, Vp, etc…) but we’ll just be talking about Vpk-pk.\r\n\r\n<hr />\r\n\r\n<ul>\r\n	<li>\r\n<h3><span style=\"color: #3366ff;\"><strong>Wave shape</strong></span><a href=\"http://casperelectronics.com/wp-content/uploads/waveshapes.png\"><img class=\"alignright\" title=\"Waveshapes\" src=\"http://casperelectronics.com/wp-content/uploads/waveshapes-200x160.png\" alt=\"\" width=\"292\" height=\"233\" /></a></h3>\r\n</li>\r\n</ul>\r\nThe wave shape is the pattern of amplitude modulation over the course of a cycle. The waveforms in fig 2 are: Sine, ramp, triangle and square.Sine, triangle and square are the most common and are all symmetrical waves. That means the positive and negative portions of each cycle are of the same duration. Many musical synthesizers offer other wave forms which are asymmetrical versions of these common waves such as ramp, saw and pulse waves.\r\n<p style=\"text-align: right;\"><span style=\"color: #33cccc;\"> Figure 2. Waveshapes  </span></p>\r\nThe importance and impact of wave shape depends on its application. Many audio effects such as <strong>tremolo</strong> or <strong>phaser</strong> use low frequency oscillators (LFOs) to modulate certain parameters of the sound. It is commonly more desirable to use a sine or triangle wave for many of these effects such as the tremolo which\r\n<a name=\"review\"></a>fades the volume in and out. Using a square wave for this would create dramatic shifts in volume which can be unpleasant.\r\nMany natural sounds are synthesized using overlapping wave forms like those shown above. For instance a flute can be synthesized using several octaves of a sine wave. A horn on the other hand will use more square waves and maybe a triangle or saw wave. More advanced wave and synthesis theory sites the sine wave as the basis of all wave forms. It is shown how even square waves can be created by combining several sine waves.\r\n\r\n<hr />\r\n\r\n<ul>\r\n	<li>\r\n<h3><strong>Review</strong></h3>\r\n</li>\r\n</ul>\r\nThe basic components of an oscillator are:\r\n<h3><a name=\"1.2\"></a></h3>\r\n<ul>\r\n	<li><strong>Frequency</strong>. The number of oscillation cycles that occur in one second. Measured in Hz</li>\r\n	<li><strong>Amplitude</strong>. Magnitude of voltage sweep in one cycle of an oscillator. Measured in Volts or Vpk-pk (volts peak to peak)</li>\r\n	<li><strong>Wave shape</strong>. Sine, triangle, square</li>\r\n</ul>\r\n\r\n<hr />\r\n\r\n<div></div>\r\n<h2 style=\"text-align: left;\"><span style=\"color: #3366ff;\"><strong>◊1.2 Phase◊</strong></span></h2>\r\nPhase is a bit more complicated than the other terms but plays an important role in audio circuitry and especially in making drones. Phase refers to a particular position in a <span style=\"text-decoration: underline;\">single cycle</span> of a wave (such as the positive or negative peak) and is measured in degrees. It is most commonly used to describe the relationship between multiple waves.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/phasedegrees.jpg\"><img class=\"alignnone size-large wp-image-1643\" title=\"Phasedegrees\" src=\"http://casperelectronics.com/wp-content/uploads/phasedegrees-460x236.jpg\" alt=\"\" width=\"460\" height=\"236\" /></a>\r\n\r\n<span style=\"color: #33cccc;\">Figure 3. Phase</span>\r\nFig. 3 shows two sine waves (red &amp; blue) of identical amplitude and frequency. The green oscillator is the mix or <em>average</em> of the red and blue oscillators.\r\nPhase is measured in degrees with 360 degrees being one complete cycle. 180 degrees is exactly ½ of a cycle.\r\nIn fig. 3 the phase of the blue oscillator is offset at 45 degree increments from the red oscillator from left to right. With each step you’ll notice that the waves get farther apart and that the amplitude of the green (average) oscillator decreases.\r\nThis may seem confusing at first but it’s really quite simple. The green oscillator is the average of the red and blue oscillators. Let’s say the red and blue oscillators sweep from -5 to +5VDC (10Vp-p). Now look at the right most illustration of the 2 waves out of phase by 180 degrees. When the blue wave is at its positive peak (90 degrees) of +5 volts, the red wave is at it’s negative peak (270 degrees) of -5 volts.\r\nWhat is the average of -5 and +5? Zero. They are always going to be the opposites of each other so the average will always be zero. Now look at the 90 degree image. When Blue is at +5 volts/90 degrees, red is at 0 volts/zero degrees. The average of +5 and zero is 2.5 volts.\r\nThe important thing to take away from the info above is that the amplitude of an oscillator created by mixing two similar oscillators is relative to the difference in phase of the two source waves.\r\nIn fig. 3 the oscillators have identical frequencies. This means that the phase relationship once established will remain the same and the resulting averaged amplitude of the two waves will also remain the same.\r\n<strong>Q: What will happen if the frequencies of your two waves are NOT identical? </strong>\r\nWe established above that the amplitude of the averaged waveform is relative to the phase difference of the two wave forms, therefore as the phase difference of two waves increases and decreases so too will the averaged waveforms’ amplitude. What we have here is phase controlled amplitude modulation and the rate of phase modulation is controlled by the frequency difference between your two oscillators.\r\nIn fig. 4 the blue oscillator has a frequency of 10 Hz, the red is 11Hz. That means that it takes the red wave 1/10<sup>th</sup> of a second longer to complete a cycle than the blue wave. You can see that with each cycle the red wave lags a little bit further behind the blue wave which increases the phase difference between the two. As a result, the amplitude of the averaged wave (green) decreases as the phase offset approaches 180 degrees and then increases as it continues past 180 to 360 degrees.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/phaseModulation.jpg\"><img class=\"alignnone size-large wp-image-1644\" title=\"PhaseModulation\" src=\"http://casperelectronics.com/wp-content/uploads/phaseModulation-460x202.jpg\" alt=\"\" width=\"460\" height=\"202\" /></a><a href=\"http://casperelectronics.com/wp-content/uploads/phase_modulation2.jpg\"><img class=\"alignnone size-large wp-image-1645\" title=\"Phase Modulation2\" src=\"http://casperelectronics.com/wp-content/uploads/phase_modulation2-460x220.jpg\" alt=\"\" width=\"460\" height=\"220\" /></a><a name=\"sec2\"></a><span style=\"color: #33cccc;\">Figure 4. Phase controlled amplitude</span>\r\n<h3><a name=\"2.1\"></a></h3>\r\nThis phenomenon of phase controlled amplitude is something many musicians use without even realizing it. This is the vary trick one uses when tuning a guitar. You tune one string to the other until the “beatingâ€ effect slows and eventually disappears.\r\n\r\n<hr />\r\n\r\n&nbsp;\r\n<h2 style=\"text-align: left;\"><span style=\"color: #3366ff;\"><strong>SECTION 2. NOVADRONE OSCILLATORS</strong></span></h2>\r\n\r\n<hr />\r\n\r\n<h2 style=\"text-align: left;\"><span style=\"color: #3366ff;\"><strong>◊ 2.1 The circuit ◊</strong></span></h2>\r\nThe NovaDrone contains 6 oscillators. Each oscillator outputs a square wave and a triangle wave.\r\n<span style=\"text-decoration: underline;\"><a name=\"schematic\"></a></span>The circuit which generates the oscillators is clean, simple and robust. They are generated using a remarkable device called an <strong>op amp</strong>. If you are interested in building synthesizers and don’t know where to start, read up on <strong>op amps</strong>. They are the key elements of most oscillators, filters, envelope generators, mixers and amps.\r\n\r\n<hr />\r\n\r\n<ul>\r\n	<li>\r\n<h3><span style=\"color: #3366ff;\"><strong>Schematic</strong></span></h3>\r\n</li>\r\n</ul>\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/OSC2rc.jpg\"><img class=\"alignleft\" title=\"OSC2rc\" src=\"http://casperelectronics.com/wp-content/uploads/OSC2rc-200x163.jpg\" alt=\"\" width=\"200\" height=\"163\" /></a><img class=\"alignleft\" title=\"OSC1rc\" src=\"http://casperelectronics.com/wp-content/uploads/OSC1rc-200x170.jpg\" alt=\"\" width=\"200\" height=\"163\" />\r\n\r\n&nbsp;\r\n\r\n&nbsp;\r\n\r\n&nbsp;\r\n\r\n&nbsp;\r\n\r\n&nbsp;\r\n\r\n&nbsp;\r\n\r\n<span style=\"color: #33cccc;\">Figure 5. LFO                                    Figure 6. Audio oscillator</span>\r\n\r\nEach channel of the NovaDrone (Red, green and blue) has 2 oscillators. These are shown in fig. 5 and\r\n\r\n<a name=\"feedbackloops\"></a> They are very similar to one another but have been calibrated for different purposes.\r\n<strong>Osc 1</strong> is an audio frequency oscillator. It has a coarse and fine tune adjustment and only operates at audible frequencies (20Hz-20kHz).\r\n<strong>Osc 2</strong> is calibrated as a low frequency oscillator (LFO) with cycles as long as 2 minutes. It has a range switch and a single adjustment knob.\r\n\r\n<hr />\r\n\r\n&nbsp;\r\n<ul>\r\n	<li>\r\n<h3><span style=\"color: #3366ff;\"><strong>Feedback loops</strong></span></h3>\r\n</li>\r\n</ul>\r\nThe oscillator circuit is a feedback loop between two op amps that are configured as a <strong>schmitt trigger</strong> and an <strong>inverting integrator</strong>.\r\nBasically an <em>integrator</em> turns square waves into triangle waves.\r\nA <em>Schmitt trigger</em> is a kind of comparator that turns modulating signals (like triangle waves) into square waves.\r\nThe key elements of the relationship between these two circuits is that they form a loop (Schmitt &gt; integrator &gt;Schmitt&gt;integrator&gt; etc…) and that the integrator is also an <strong>inverter</strong>. This creates a continuous cycle of modulation:\r\n1) Schmitt output goes HI.\r\n2) Integrator inverts Schmitt signal and outputs slope going down (LOW).\r\n3) When slope is near zero volts, Schmitt trigger is thrown and its’ output goes LOW.\r\n4) Integrator inverts and generates upward slope (HI).\r\n5) When integrator slope reaches peak, Schmitt trigger is thrown and output goes HI.\r\n<a name=\"rctimeconstant\"></a>6) etc……\r\nThis is an overly simplified explanation but enough for our purposes. Do more research on these valuable circuits once you are familiar with some of the basics of op-amps.\r\n\r\n<hr />\r\n\r\n<ul>\r\n	<li>\r\n<h3><span style=\"color: #3366ff;\"><strong>RC (resistor capacitor)time constant</strong></span></h3>\r\n</li>\r\n</ul>\r\nIn both oscillators (fig. 5 and 6) the primary element which defines frequency is the <strong>RC time constant</strong>. This relationship is a core component of most oscillators and is worth reading up on.\r\n\r\nThe RC time constant is a period of time defined by the relationship between a resistor and a capacitor.\r\nThe equation for this is simply <strong>t =</strong> <strong>R*C</strong>. In the case of the oscillators above it would be <strong>t=R1*C1</strong>.\r\nUnfortunately calculating the frequency of an oscillator is more complicated than just calculating your RC constant.\r\nIn many oscillators (including this one) there is a schmitt trigger component which watches the rising or sinking voltage from the integrator. The Schmitt trigger activates when the slope reaches predefined upper and lower limits. In order to determine the frequency of an oscillator we need to know what our upper and lower limits are and then calculate how long it takes our wave (the output of the integrator) to travel from one limit to the other.\r\nThese limits are determined by the relationship of 2 resistors in the schmitt stage. In fig 5 and 6 these are R2 and R3.\r\nThe equation for determining the duration of one cycle is\r\n(1/4R1C1)*(R3/R4)\r\nIn Oscillator 2 <strong>R</strong><strong>1</strong> is a 500k potentiometer in series with a 4.7k resistor between pins 8 and 13 of the two op amps. <strong>C</strong><strong>1</strong> is one of the three capacitors between pins 13 and 14 of the rightmost op amp. One of these caps is selected using a three way switch on the NovaDrone circuit board. This controls the frequency range of the LFO.\r\nLet’s say the pot is all the way up (full resistance) and the middle cap has been selected. The equations for RC and subsequently the frequency is:\r\n<strong>R1=504,700 Ohms</strong>\r\n<a name=\"howitworks\"></a><strong>C1= .000022 Farads</strong>\r\n<strong>R2 = 8,300 Ohms</strong>\r\n<strong>R3 = 10,000 Ohms</strong>\r\n<strong>Frequency in Hz = (1 / 4*R</strong><strong>1C</strong><strong>1) * (R</strong><strong>3/R</strong><strong>2)</strong>\r\n\r\n<hr />\r\n\r\n<ul>\r\n	<li>\r\n<h3><span style=\"color: #3366ff;\"><strong>How it works</strong></span></h3>\r\n</li>\r\n</ul>\r\nResistors limit the flow of current and capacitors store current. Current flows through the resistor and is stored in the capacitor. The resistor controls how much current flows into the capacitor per second. Therefore the size of capacitor and the amount of resistance will determine how long it takes to fill the capacitor. A common analogy is to think about current flow as water, the resistor as a spigot\r\n<h3><a name=\"2.2\"></a></h3>\r\nand the capacitor as a cup. The more you open the spigot (reduce resistance), the more water (electrical current) will flow and the faster the cup will fill (capacitor will charge). The oscillator circuit is configured in a special way which causes the capacitor to continuously charge and discharge. It is looking for two states from the cap, fully charged or fully discharged. When the cap reaches either of these states, the whole circuit reverses polarity and the capacitors charge status begins moving toward the opposite state. The amount of time it takes to charge and discharge is your cycle duration.\r\n\r\n<hr />\r\n\r\n<h2 style=\"text-align: left;\"><span style=\"color: #3366ff;\"><strong>◊2.2 pulse width modulation (pwm)◊</strong></span></h2>\r\nPWM is exciting stuff….really! It is essentially a <strong>1 bit digital</strong> representation of an <strong>analog</strong> wave form.\r\nDigital wave forms only have 2 states, <strong>high</strong> and <strong>low</strong>. <strong>High</strong> is a voltage <em>at</em> or very close to the positive supply voltage. <strong>Low</strong> is a voltage <em>at</em> or very close to the negative supply voltage. It is basically just a square wave. Analog on the other hand is infinitely variable. Think about it like the difference between a light switch (digital) and a light dimmer (analog). PWM is a wave form that bridges the gap between these two formats. It can be used to make sound, control the brightness of an LED, control the speed of high torque motors and speak to microprocessors. It is also the language that a microprocessor will use to speak with the analog world.\r\nPulse Width (PW) refers to the relative durations of high and low voltage in a single <strong>cycle</strong> of a square wave.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/pulsewidth.jpg\"><img class=\"alignnone size-large wp-image-1648\" title=\"Pulsewidth\" src=\"http://casperelectronics.com/wp-content/uploads/pulsewidth-460x214.jpg\" alt=\"\" width=\"460\" height=\"214\" /></a><span style=\"color: #33cccc;\">Figure 7. Pulse width</span>\r\nFig. 7 shows three square wave oscillators of the same amplitude and frequency but with differing <strong>pulse width</strong>. The red oscillator has a 10% pulse width. That means the wave goes high for 10 % of the duration of one cycle. The green wave is 50% and the purple wave is 90%. What is important to note is that pulse width has nothing to do with frequency and only refers to the relationship between the high and low swing of the wave.\r\n\r\n<hr />\r\n\r\n<ul>\r\n	<li>\r\n<h3><span style=\"color: #3366ff;\"><strong>The Comparator</strong></span></h3>\r\n</li>\r\n</ul>\r\nThe job of a comparator is simple. Two signals are fed into the “+â€ and “-“ inputs (labeled 10 and 9 in fig. 8 respectively). If the voltage at the “+â€ input is <em>higher</em> than the “-“ input the output of the comparator goes <strong>high</strong>.<strong> </strong>If the “+â€ input drops below the “-“ input the output goes <strong>low</strong>.\r\nIn the NovaDrone t<a href=\"http://casperelectronics.com/wp-content/uploads/comparator.jpg\"><img class=\"alignleft\" title=\"Comparator\" src=\"http://casperelectronics.com/wp-content/uploads/comparator-200x76.jpg\" alt=\"\" width=\"200\" height=\"76\" /></a>he triangle output of Osc 1 and Osc 2 combine through a simple comparator (fig. 8) to make a single square wave with a modulating pulse width. In this way, the\r\n\r\n<span style=\"color: #33cccc;\">Figure 8.</span>                                           comparator also functions as a pulse width modulation processor.\r\n\r\nFig. 9 below shows how two triangle waves are transformed through the comparator into a square wave with a modulating pulse width.\r\nThe blue triangle wave in fig. 9 is oscillator 1. The red triangle is osc 2. The green line is the combined PWM output.\r\nAny time the blue line (osc 1) is above the red line (osc 2), the green line (pwm) goes high. As the red line rises the percentage of each cycle that the blue line is above the red line decreases. This changing percentage is what makes our modulating pulse width effect.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/PWM3-copy.jpg\"><img class=\"alignnone size-large wp-image-1647\" title=\"PWM3 Copy\" src=\"http://casperelectronics.com/wp-content/uploads/PWM3-copy-460x202.jpg\" alt=\"\" width=\"460\" height=\"202\" /></a>\r\n\r\n<span style=\"color: #33cccc;\">Figure 9. Pulse width modulation detail</span>\r\n\r\n<hr />\r\n\r\n<ul>\r\n	<li>\r\n<h3><span style=\"color: #3366ff;\"><strong>Mixer</strong></span></h3>\r\n</li>\r\n</ul>\r\nThe audio signals from each of the three channels of the NovaDrone are mixed using the circuit in fig. 10.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/mixer.jpg\"><img class=\"alignleft\" title=\"Mixer\" src=\"http://casperelectronics.com/wp-content/uploads/mixer-200x135.jpg\" alt=\"\" width=\"200\" height=\"135\" /></a>This mixer is nice and simple and uses just one <strong>op amp</strong> and a few other components. This circuit is configured as an inverting mixer with an amplitude controlled by the <strong>feedback resistor</strong> and <strong>input resistors</strong>. The amplitude is calculated as RF/RI. In this case RF = 10,000 and RI = 100,000. That means the output signal is 1/10<sup>th</sup> the amplitude of the input signal.\r\n<strong><span style=\"text-decoration: underline;\">\r\n</span></strong>\r\n\r\n<hr />\r\n\r\n<ul>\r\n	<li>\r\n<h3><span style=\"color: #3366ff;\"><strong>LED drivers</strong></span></h3>\r\n</li>\r\n</ul>\r\n(3) 2N3904 NPN transistors are used to make 3 LED drivers.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/LEDdriver.jpg\"><img class=\"alignleft\" title=\"LEDdriver\" src=\"http://casperelectronics.com/wp-content/uploads/LEDdriver-200x108.jpg\" alt=\"\" width=\"200\" height=\"108\" /></a>A driver is a simple but important circuit which isolates elements which use lots of current (like LEDs) from sensitive circuits (like the oscillators in the NovaDrone). Failure to use a driver can result in something called a <strong>loading effect</strong> which basically means that the device being driven will affect the behavior of the rest of the circuit in bad ways, like the pitch changing when the lights turn on. The LED in the NovaDrone uses a lot of current relative to the rest of the circuit (90mA vs around 30mA for the rest of the circuit) therefore a driver is necessary. The key component of a driver is the <strong>transistor</strong>. This is another topic worth reading a lot about\r\n.\r\n\r\n</div>','NovaDrone Tech Manual',0,'','inherit','open','closed','','1704-revision-22','','','2012-11-06 17:17:22','2012-11-06 22:17:22','',1704,'http://casperelectronics.com/2012/11/06/1704-revision-22/',0,'revision','',0),(1729,2,'2012-11-06 17:20:35','2012-11-06 22:20:35','Throughout this guide I will attempt to give you some insight into the circuit theory and scientific principles at play in the NovaDrone. That said I will be giving little more than an intro to each topic and strongly encourage you to do further reading on topics you find interesting.\r\n<ul>\r\n	<li>This is a beta version of the <strong>NovaDrone Technical Guide</strong>. I expect to make revisions over time and eagerly encourage readers to send me feedback, questions, suggestions and especially corrections. Comments should be addressed to <a href=\"mailto:pete@casperelectronics.com\"><strong>pete@casperelectronics.com</strong></a>.</li>\r\n</ul>\r\n\r\n<hr />\r\n\r\n<h3 style=\"text-align: center;\"><span style=\"color: #000000;\"><strong>TABLE OF CONTENTS:</strong></span></h3>\r\n<a href=\"#sec1\"><strong><span style=\"text-decoration: underline;\">Section 1. Oscillator Primer</span></strong></a>\r\n<ul>\r\n	<li><a href=\"#1.1\"><strong>1.1 Frequency, amplitude &amp; wave shape</strong></a>\r\n<ul>\r\n	<li><a href=\"#frequency\">Frequency</a></li>\r\n	<li><a href=\"#amplitude\">Amplitude</a></li>\r\n	<li><a href=\"#waveshape\"> Wave shape</a></li>\r\n	<li><a href=\"#review\"> Review<strong></strong></a></li>\r\n</ul>\r\n</li>\r\n	<li><a href=\"#1.2\"><strong>1.2 Phase</strong></a>\r\n<ul>\r\n	<li><a href=\"#phase\"> Phase controlled amplitude modulation</a></li>\r\n</ul>\r\n</li>\r\n</ul>\r\n<a href=\"#sec2\"><strong><span style=\"text-decoration: underline;\">Section 2. NovaDrone Oscillators</span></strong></a>\r\n<ul>\r\n	<li><a href=\"#2.1\"><strong>2.1 The Circuit</strong></a>\r\n<ul>\r\n	<li><a href=\"#feedbackloops\"> Feedback loops</a></li>\r\n	<li><a href=\"#schematic\"> Schematic</a></li>\r\n	<li><a href=\"#rctimeconstant\"> RC time constant</a></li>\r\n	<li><a href=\"#howitworks\"> How it works<strong></strong></a></li>\r\n</ul>\r\n</li>\r\n	<li><a href=\"#2.2\"><strong>2.2 Pulse Width Modulation</strong></a>\r\n<ul>\r\n	<li><a href=\"#comparator\">The comparator<strong></strong></a></li>\r\n</ul>\r\n</li>\r\n</ul>\r\n<a name=\"sec1\"></a><a name=\"1.1\"></a><a href=\"#sec3\"><strong><span style=\"text-decoration: underline;\">Sectio</span></strong></a><a href=\"#sec3\"><strong><span style=\"text-decoration: underline;\">n 3. Drivers and Mixers </span>*incomplete*</strong></a>\r\n<ul>\r\n	<li><a href=\"#led\"> LED driver</a></li>\r\n	<li><a href=\"#mixer\">Signal mixer</a><strong></strong></li>\r\n</ul>\r\n\r\n<hr />\r\n\r\n<h2 style=\"text-align: left;\"><span style=\"color: #3366ff;\"><strong>SECTION 1. OSCILLATOR PRIMER</strong></span></h2>\r\n<h2><span style=\"color: #3366ff;\"><strong style=\"text-align: center;\"><strong>◊ 1.1 Frequency, amplitude and wave shape◊</strong></strong></span></h2>\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/ampandfreq.jpg\"><img class=\"alignleft size-medium wp-image-1636\" title=\"Figure 1. A triangle wave oscillator\" src=\"http://casperelectronics.com/wp-content/uploads/ampandfreq-200x242.jpg\" alt=\"\" width=\"200\" height=\"242\" /></a>\r\n<div>\r\n\r\nThe heart of the NovaDrone is a bank of six independent oscillators.\r\n\r\n</div>\r\nAn oscillator is simply a pattern which repeats indefinitely. This can be a pattern of light, movement, electricity, even life cycles of organisms. The <a href=\"http://en.wikipedia.org/wiki/Oscillation\">wikipedia entry</a> gives dozens of examples of different kinds of oscillation.\r\n\r\nWhat we are most interested in is the modulation (changing amplitude) of electricity. All of the electrically produced sound we hear is a repeating pattern of fluctuating electrical current.\r\n\r\n&nbsp;\r\n\r\n<address> </address><address><em><span style=\"color: #33cccc;\">Figure 1. triangle oscillator</span></em></address>When this is applied to a speaker, the current activates a coil in the speaker which pushes the cone of the speaker away from or towards a fixed magnet. This action vibrates the air in front of the speaker which in turn vibrates the air in front of that and so on until that vibrations hit our ear drums and are perceived as sound. The sounds we hear around us are all incredibly complex patterns of air pressure modulation.\r\n<div>\r\n<ul>\r\n	<li><strong>The red line in fig 1 represents a voltage which goes up and down over a period of time. This is an oscillator.</strong></li>\r\n</ul>\r\nThere are three basic factors that make up all oscillators: <a name=\"frequency\"></a><strong>frequency</strong>, <strong>amplitude</strong> and <strong>wave shape</strong>. In musical terms we would call these <strong>pitch</strong>, <strong>volume</strong> and <strong>timbre</strong>. I will also talk a fair amount about <strong>phase </strong>which is relevant when working with multiple oscillators and plays an important role in creating drones.\r\n\r\n<hr />\r\n\r\n<ul>\r\n	<li>\r\n<h3><span style=\"color: #3366ff;\"><strong>Frequency</strong></span></h3>\r\n</li>\r\n</ul>\r\nOne complete sweep up and down is called a <strong>cycle</strong>. The number of cycles per second is your <strong>Frequency</strong> or <strong>Pitch</strong>.<strong></strong>\r\n<strong>Frequency</strong> is commonly measured in <strong>Hertz</strong>, which is the number of cycles per second.\r\n<a name=\"amplitude\"></a><strong>Pitch</strong> is another term for frequency which is used <span style=\"text-decoration: underline;\">only</span> when referring to the frequency of an audio signal.\r\nFigure 1 shows a triangle wave with a cycle length of .5 seconds. The frequency of this wave would be determined by seeing how many cycles will occur in 1 second. In this case there are 2 complete cycles in 1 second. That means the wave has a frequency of 2 Hertz. This is well below the hearing range. Humans can hear oscillators between 20Hz and 20,000 Hz.\r\n\r\n<hr />\r\n\r\n<ul>\r\n	<li>\r\n<h3><span style=\"color: #3366ff;\"><strong>Amplitude</strong></span></h3>\r\n</li>\r\n</ul>\r\nAmplitude refers to the magnitude of voltage change across one cycle of an oscillation.\r\n<a name=\"waveshape\"></a>This in turn impacts the volume of the signal if it is sent to a speaker.\r\nThe image above shows a triangle wave with a positive peak of +5 volts and a negative peak of -5 volts. The amplitude is determined by figuring the absolute difference between these peaks. In this case that difference is 10 volts. This is commonly referred to as 10 Vpk-pk (10 volts peak to peak). There are many different ways to measure amplitude (pk-pk, RMS, Vp, etc…) but we’ll just be talking about Vpk-pk.\r\n\r\n<hr />\r\n\r\n<ul>\r\n	<li>\r\n<h3><span style=\"color: #3366ff;\"><strong>Wave shape</strong></span><a href=\"http://casperelectronics.com/wp-content/uploads/waveshapes.png\"><img class=\"alignright\" title=\"Waveshapes\" src=\"http://casperelectronics.com/wp-content/uploads/waveshapes-200x160.png\" alt=\"\" width=\"292\" height=\"233\" /></a></h3>\r\n</li>\r\n</ul>\r\nThe wave shape is the pattern of amplitude modulation over the course of a cycle. The waveforms in fig 2 are: Sine, ramp, triangle and square.Sine, triangle and square are the most common and are all symmetrical waves. That means the positive and negative portions of each cycle are of the same duration. Many musical synthesizers offer other wave forms which are asymmetrical versions of these common waves such as ramp, saw and pulse waves.\r\n<p style=\"text-align: right;\"><span style=\"color: #33cccc;\"> Figure 2. Waveshapes  </span></p>\r\nThe importance and impact of wave shape depends on its application. Many audio effects such as <strong>tremolo</strong> or <strong>phaser</strong> use low frequency oscillators (LFOs) to modulate certain parameters of the sound. It is commonly more desirable to use a sine or triangle wave for many of these effects such as the tremolo which\r\n<a name=\"review\"></a>fades the volume in and out. Using a square wave for this would create dramatic shifts in volume which can be unpleasant.\r\nMany natural sounds are synthesized using overlapping wave forms like those shown above. For instance a flute can be synthesized using several octaves of a sine wave. A horn on the other hand will use more square waves and maybe a triangle or saw wave. More advanced wave and synthesis theory sites the sine wave as the basis of all wave forms. It is shown how even square waves can be created by combining several sine waves.\r\n\r\n<hr />\r\n\r\n<ul>\r\n	<li>\r\n<h3><strong>Review</strong></h3>\r\n</li>\r\n</ul>\r\nThe basic components of an oscillator are:\r\n<h3><a name=\"1.2\"></a></h3>\r\n<ul>\r\n	<li><strong>Frequency</strong>. The number of oscillation cycles that occur in one second. Measured in Hz</li>\r\n	<li><strong>Amplitude</strong>. Magnitude of voltage sweep in one cycle of an oscillator. Measured in Volts or Vpk-pk (volts peak to peak)</li>\r\n	<li><strong>Wave shape</strong>. Sine, triangle, square</li>\r\n</ul>\r\n\r\n<hr />\r\n\r\n<div></div>\r\n<h2 style=\"text-align: left;\"><span style=\"color: #3366ff;\"><strong>◊1.2 Phase◊</strong></span></h2>\r\nPhase is a bit more complicated than the other terms but plays an important role in audio circuitry and especially in making drones. Phase refers to a particular position in a <span style=\"text-decoration: underline;\">single cycle</span> of a wave (such as the positive or negative peak) and is measured in degrees. It is most commonly used to describe the relationship between multiple waves.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/phasedegrees.jpg\"><img class=\"alignnone size-large wp-image-1643\" title=\"Phasedegrees\" src=\"http://casperelectronics.com/wp-content/uploads/phasedegrees-460x236.jpg\" alt=\"\" width=\"460\" height=\"236\" /></a>\r\n\r\n<span style=\"color: #33cccc;\">Figure 3. Phase</span>\r\nFig. 3 shows two sine waves (red &amp; blue) of identical amplitude and frequency. The green oscillator is the mix or <em>average</em> of the red and blue oscillators.\r\nPhase is measured in degrees with 360 degrees being one complete cycle. 180 degrees is exactly ½ of a cycle.\r\nIn fig. 3 the phase of the blue oscillator is offset at 45 degree increments from the red oscillator from left to right. With each step you’ll notice that the waves get farther apart and that the amplitude of the green (average) oscillator decreases.\r\nThis may seem confusing at first but it’s really quite simple. The green oscillator is the average of the red and blue oscillators. Let’s say the red and blue oscillators sweep from -5 to +5VDC (10Vp-p). Now look at the right most illustration of the 2 waves out of phase by 180 degrees. When the blue wave is at its positive peak (90 degrees) of +5 volts, the red wave is at it’s negative peak (270 degrees) of -5 volts.\r\nWhat is the average of -5 and +5? Zero. They are always going to be the opposites of each other so the average will always be zero. Now look at the 90 degree image. When Blue is at +5 volts/90 degrees, red is at 0 volts/zero degrees. The average of +5 and zero is 2.5 volts.\r\nThe important thing to take away from the info above is that the amplitude of an oscillator created by mixing two similar oscillators is relative to the difference in phase of the two source waves.\r\nIn fig. 3 the oscillators have identical frequencies. This means that the phase relationship once established will remain the same and the resulting averaged amplitude of the two waves will also remain the same.\r\n<strong>Q: What will happen if the frequencies of your two waves are NOT identical? </strong>\r\nWe established above that the amplitude of the averaged waveform is relative to the phase difference of the two wave forms, therefore as the phase difference of two waves increases and decreases so too will the averaged waveforms’ amplitude. What we have here is phase controlled amplitude modulation and the rate of phase modulation is controlled by the frequency difference between your two oscillators.\r\nIn fig. 4 the blue oscillator has a frequency of 10 Hz, the red is 11Hz. That means that it takes the red wave 1/10<sup>th</sup> of a second longer to complete a cycle than the blue wave. You can see that with each cycle the red wave lags a little bit further behind the blue wave which increases the phase difference between the two. As a result, the amplitude of the averaged wave (green) decreases as the phase offset approaches 180 degrees and then increases as it continues past 180 to 360 degrees.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/phaseModulation.jpg\"><img class=\"alignnone size-large wp-image-1644\" title=\"PhaseModulation\" src=\"http://casperelectronics.com/wp-content/uploads/phaseModulation-460x202.jpg\" alt=\"\" width=\"460\" height=\"202\" /></a><a href=\"http://casperelectronics.com/wp-content/uploads/phase_modulation2.jpg\"><img class=\"alignnone size-large wp-image-1645\" title=\"Phase Modulation2\" src=\"http://casperelectronics.com/wp-content/uploads/phase_modulation2-460x220.jpg\" alt=\"\" width=\"460\" height=\"220\" /></a><a name=\"sec2\"></a><span style=\"color: #33cccc;\">Figure 4. Phase controlled amplitude</span>\r\n<h3><a name=\"2.1\"></a></h3>\r\nThis phenomenon of phase controlled amplitude is something many musicians use without even realizing it. This is the vary trick one uses when tuning a guitar. You tune one string to the other until the “beatingâ€ effect slows and eventually disappears.\r\n\r\n<hr />\r\n\r\n&nbsp;\r\n<h2 style=\"text-align: left;\"><span style=\"color: #3366ff;\"><strong>SECTION 2. NOVADRONE OSCILLATORS</strong></span></h2>\r\n\r\n<hr />\r\n\r\n<h2 style=\"text-align: left;\"><span style=\"color: #3366ff;\"><strong>◊ 2.1 The circuit ◊</strong></span></h2>\r\nThe NovaDrone contains 6 oscillators. Each oscillator outputs a square wave and a triangle wave.\r\n<span style=\"text-decoration: underline;\"><a name=\"schematic\"></a></span>The circuit which generates the oscillators is clean, simple and robust. They are generated using a remarkable device called an <strong>op amp</strong>. If you are interested in building synthesizers and don’t know where to start, read up on <strong>op amps</strong>. They are the key elements of most oscillators, filters, envelope generators, mixers and amps.\r\n\r\n<hr />\r\n\r\n<ul>\r\n	<li>\r\n<h3><span style=\"color: #3366ff;\"><strong>Schematic</strong></span></h3>\r\n</li>\r\n</ul>\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/OSC2rc.jpg\"><img class=\"alignleft\" title=\"OSC2rc\" src=\"http://casperelectronics.com/wp-content/uploads/OSC2rc-200x163.jpg\" alt=\"\" width=\"200\" height=\"163\" /></a><img class=\"alignleft\" title=\"OSC1rc\" src=\"http://casperelectronics.com/wp-content/uploads/OSC1rc-200x170.jpg\" alt=\"\" width=\"200\" height=\"163\" />\r\n\r\n&nbsp;\r\n\r\n&nbsp;\r\n\r\n&nbsp;\r\n\r\n&nbsp;\r\n\r\n&nbsp;\r\n\r\n<img class=\"size-full wp-image-1302 alignleft\" title=\"spacer\" src=\"http://casperelectronics.com/wp-content/uploads/casper/spacer1.jpg\" alt=\"\" width=\"460\" height=\"10\" /></div>\r\n<div>\r\n<span style=\"color: #33cccc;\">Figure 5. LFO                                    Figure 6. Audio oscillator</span>\r\n\r\nEach channel of the NovaDrone (Red, green and blue) has 2 oscillators. These are shown in fig. 5 an\r\n\r\nd\r\n\r\n<a name=\"feedbackloops\"></a> They are very similar to one another but have been calibrated for different purposes.\r\n<strong>Osc 1</strong> is an audio frequency oscillator. It has a coarse and fine tune adjustment and only operates at audible frequencies (20Hz-20kHz).\r\n<strong>Osc 2</strong> is calibrated as a low frequency oscillator (LFO) with cycles as long as 2 minutes. It has a range switch and a single adjustment knob.\r\n\r\n<hr />\r\n\r\n&nbsp;\r\n<ul>\r\n	<li>\r\n<h3><span style=\"color: #3366ff;\"><strong>Feedback loops</strong></span></h3>\r\n</li>\r\n</ul>\r\nThe oscillator circuit is a feedback loop between two op amps that are configured as a <strong>schmitt trigger</strong> and an <strong>inverting integrator</strong>.\r\nBasically an <em>integrator</em> turns square waves into triangle waves.\r\nA <em>Schmitt trigger</em> is a kind of comparator that turns modulating signals (like triangle waves) into square waves.\r\nThe key elements of the relationship between these two circuits is that they form a loop (Schmitt &gt; integrator &gt;Schmitt&gt;integrator&gt; etc…) and that the integrator is also an <strong>inverter</strong>. This creates a continuous cycle of modulation:\r\n1) Schmitt output goes HI.\r\n2) Integrator inverts Schmitt signal and outputs slope going down (LOW).\r\n3) When slope is near zero volts, Schmitt trigger is thrown and its’ output goes LOW.\r\n4) Integrator inverts and generates upward slope (HI).\r\n5) When integrator slope reaches peak, Schmitt trigger is thrown and output goes HI.\r\n<a name=\"rctimeconstant\"></a>6) etc……\r\nThis is an overly simplified explanation but enough for our purposes. Do more research on these valuable circuits once you are familiar with some of the basics of op-amps.\r\n\r\n<hr />\r\n\r\n<ul>\r\n	<li>\r\n<h3><span style=\"color: #3366ff;\"><strong>RC (resistor capacitor)time constant</strong></span></h3>\r\n</li>\r\n</ul>\r\nIn both oscillators (fig. 5 and 6) the primary element which defines frequency is the <strong>RC time constant</strong>. This relationship is a core component of most oscillators and is worth reading up on.\r\n\r\nThe RC time constant is a period of time defined by the relationship between a resistor and a capacitor.\r\nThe equation for this is simply <strong>t =</strong> <strong>R*C</strong>. In the case of the oscillators above it would be <strong>t=R1*C1</strong>.\r\nUnfortunately calculating the frequency of an oscillator is more complicated than just calculating your RC constant.\r\nIn many oscillators (including this one) there is a schmitt trigger component which watches the rising or sinking voltage from the integrator. The Schmitt trigger activates when the slope reaches predefined upper and lower limits. In order to determine the frequency of an oscillator we need to know what our upper and lower limits are and then calculate how long it takes our wave (the output of the integrator) to travel from one limit to the other.\r\nThese limits are determined by the relationship of 2 resistors in the schmitt stage. In fig 5 and 6 these are R2 and R3.\r\nThe equation for determining the duration of one cycle is\r\n(1/4R1C1)*(R3/R4)\r\nIn Oscillator 2 <strong>R</strong><strong>1</strong> is a 500k potentiometer in series with a 4.7k resistor between pins 8 and 13 of the two op amps. <strong>C</strong><strong>1</strong> is one of the three capacitors between pins 13 and 14 of the rightmost op amp. One of these caps is selected using a three way switch on the NovaDrone circuit board. This controls the frequency range of the LFO.\r\nLet’s say the pot is all the way up (full resistance) and the middle cap has been selected. The equations for RC and subsequently the frequency is:\r\n<strong>R1=504,700 Ohms</strong>\r\n<a name=\"howitworks\"></a><strong>C1= .000022 Farads</strong>\r\n<strong>R2 = 8,300 Ohms</strong>\r\n<strong>R3 = 10,000 Ohms</strong>\r\n<strong>Frequency in Hz = (1 / 4*R</strong><strong>1C</strong><strong>1) * (R</strong><strong>3/R</strong><strong>2)</strong>\r\n\r\n<hr />\r\n\r\n<ul>\r\n	<li>\r\n<h3><span style=\"color: #3366ff;\"><strong>How it works</strong></span></h3>\r\n</li>\r\n</ul>\r\nResistors limit the flow of current and capacitors store current. Current flows through the resistor and is stored in the capacitor. The resistor controls how much current flows into the capacitor per second. Therefore the size of capacitor and the amount of resistance will determine how long it takes to fill the capacitor. A common analogy is to think about current flow as water, the resistor as a spigot\r\n<h3><a name=\"2.2\"></a></h3>\r\nand the capacitor as a cup. The more you open the spigot (reduce resistance), the more water (electrical current) will flow and the faster the cup will fill (capacitor will charge). The oscillator circuit is configured in a special way which causes the capacitor to continuously charge and discharge. It is looking for two states from the cap, fully charged or fully discharged. When the cap reaches either of these states, the whole circuit reverses polarity and the capacitors charge status begins moving toward the opposite state. The amount of time it takes to charge and discharge is your cycle duration.\r\n\r\n<hr />\r\n\r\n<h2 style=\"text-align: left;\"><span style=\"color: #3366ff;\"><strong>◊2.2 pulse width modulation (pwm)◊</strong></span></h2>\r\nPWM is exciting stuff….really! It is essentially a <strong>1 bit digital</strong> representation of an <strong>analog</strong> wave form.\r\nDigital wave forms only have 2 states, <strong>high</strong> and <strong>low</strong>. <strong>High</strong> is a voltage <em>at</em> or very close to the positive supply voltage. <strong>Low</strong> is a voltage <em>at</em> or very close to the negative supply voltage. It is basically just a square wave. Analog on the other hand is infinitely variable. Think about it like the difference between a light switch (digital) and a light dimmer (analog). PWM is a wave form that bridges the gap between these two formats. It can be used to make sound, control the brightness of an LED, control the speed of high torque motors and speak to microprocessors. It is also the language that a microprocessor will use to speak with the analog world.\r\nPulse Width (PW) refers to the relative durations of high and low voltage in a single <strong>cycle</strong> of a square wave.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/pulsewidth.jpg\"><img class=\"alignnone size-large wp-image-1648\" title=\"Pulsewidth\" src=\"http://casperelectronics.com/wp-content/uploads/pulsewidth-460x214.jpg\" alt=\"\" width=\"460\" height=\"214\" /></a><span style=\"color: #33cccc;\">Figure 7. Pulse width</span>\r\nFig. 7 shows three square wave oscillators of the same amplitude and frequency but with differing <strong>pulse width</strong>. The red oscillator has a 10% pulse width. That means the wave goes high for 10 % of the duration of one cycle. The green wave is 50% and the purple wave is 90%. What is important to note is that pulse width has nothing to do with frequency and only refers to the relationship between the high and low swing of the wave.\r\n\r\n<hr />\r\n\r\n<ul>\r\n	<li>\r\n<h3><span style=\"color: #3366ff;\"><strong>The Comparator</strong></span></h3>\r\n</li>\r\n</ul>\r\nThe job of a comparator is simple. Two signals are fed into the “+â€ and “-“ inputs (labeled 10 and 9 in fig. 8 respectively). If the voltage at the “+â€ input is <em>higher</em> than the “-“ input the output of the comparator goes <strong>high</strong>.<strong> </strong>If the “+â€ input drops below the “-“ input the output goes <strong>low</strong>.\r\nIn the NovaDrone t<a href=\"http://casperelectronics.com/wp-content/uploads/comparator.jpg\"><img class=\"alignleft\" title=\"Comparator\" src=\"http://casperelectronics.com/wp-content/uploads/comparator-200x76.jpg\" alt=\"\" width=\"200\" height=\"76\" /></a>he triangle output of Osc 1 and Osc 2 combine through a simple comparator (fig. 8) to make a single square wave with a modulating pulse width. In this way, the\r\n\r\n<span style=\"color: #33cccc;\">Figure 8.</span>                                           comparator also functions as a pulse width modulation processor.\r\n\r\nFig. 9 below shows how two triangle waves are transformed through the comparator into a square wave with a modulating pulse width.\r\nThe blue triangle wave in fig. 9 is oscillator 1. The red triangle is osc 2. The green line is the combined PWM output.\r\nAny time the blue line (osc 1) is above the red line (osc 2), the green line (pwm) goes high. As the red line rises the percentage of each cycle that the blue line is above the red line decreases. This changing percentage is what makes our modulating pulse width effect.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/PWM3-copy.jpg\"><img class=\"alignnone size-large wp-image-1647\" title=\"PWM3 Copy\" src=\"http://casperelectronics.com/wp-content/uploads/PWM3-copy-460x202.jpg\" alt=\"\" width=\"460\" height=\"202\" /></a>\r\n\r\n<span style=\"color: #33cccc;\">Figure 9. Pulse width modulation detail</span>\r\n\r\n<hr />\r\n\r\n<ul>\r\n	<li>\r\n<h3><span style=\"color: #3366ff;\"><strong>Mixer</strong></span></h3>\r\n</li>\r\n</ul>\r\nThe audio signals from each of the three channels of the NovaDrone are mixed using the circuit in fig. 10.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/mixer.jpg\"><img class=\"alignleft\" title=\"Mixer\" src=\"http://casperelectronics.com/wp-content/uploads/mixer-200x135.jpg\" alt=\"\" width=\"200\" height=\"135\" /></a>This mixer is nice and simple and uses just one <strong>op amp</strong> and a few other components. This circuit is configured as an inverting mixer with an amplitude controlled by the <strong>feedback resistor</strong> and <strong>input resistors</strong>. The amplitude is calculated as RF/RI. In this case RF = 10,000 and RI = 100,000. That means the output signal is 1/10<sup>th</sup> the amplitude of the input signal.\r\n<strong><span style=\"text-decoration: underline;\">\r\n</span></strong>\r\n\r\n<hr />\r\n\r\n<ul>\r\n	<li>\r\n<h3><span style=\"color: #3366ff;\"><strong>LED drivers</strong></span></h3>\r\n</li>\r\n</ul>\r\n(3) 2N3904 NPN transistors are used to make 3 LED drivers.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/LEDdriver.jpg\"><img class=\"alignleft\" title=\"LEDdriver\" src=\"http://casperelectronics.com/wp-content/uploads/LEDdriver-200x108.jpg\" alt=\"\" width=\"200\" height=\"108\" /></a>A driver is a simple but important circuit which isolates elements which use lots of current (like LEDs) from sensitive circuits (like the oscillators in the NovaDrone). Failure to use a driver can result in something called a <strong>loading effect</strong> which basically means that the device being driven will affect the behavior of the rest of the circuit in bad ways, like the pitch changing when the lights turn on. The LED in the NovaDrone uses a lot of current relative to the rest of the circuit (90mA vs around 30mA for the rest of the circuit) therefore a driver is necessary. The key component of a driver is the <strong>transistor</strong>. This is another topic worth reading a lot about\r\n.\r\n\r\n</div>','NovaDrone Tech Manual',0,'','inherit','open','closed','','1704-revision-24','','','2012-11-06 17:20:35','2012-11-06 22:20:35','',1704,'http://casperelectronics.com/2012/11/06/1704-revision-24/',0,'revision','',0),(1728,2,'2012-11-06 17:18:54','2012-11-06 22:18:54','Throughout this guide I will attempt to give you some insight into the circuit theory and scientific principles at play in the NovaDrone. That said I will be giving little more than an intro to each topic and strongly encourage you to do further reading on topics you find interesting.\r\n<ul>\r\n	<li>This is a beta version of the <strong>NovaDrone Technical Guide</strong>. I expect to make revisions over time and eagerly encourage readers to send me feedback, questions, suggestions and especially corrections. Comments should be addressed to <a href=\"mailto:pete@casperelectronics.com\"><strong>pete@casperelectronics.com</strong></a>.</li>\r\n</ul>\r\n\r\n<hr />\r\n\r\n<h3 style=\"text-align: center;\"><span style=\"color: #000000;\"><strong>TABLE OF CONTENTS:</strong></span></h3>\r\n<a href=\"#sec1\"><strong><span style=\"text-decoration: underline;\">Section 1. Oscillator Primer</span></strong></a>\r\n<ul>\r\n	<li><a href=\"#1.1\"><strong>1.1 Frequency, amplitude &amp; wave shape</strong></a>\r\n<ul>\r\n	<li><a href=\"#frequency\">Frequency</a></li>\r\n	<li><a href=\"#amplitude\">Amplitude</a></li>\r\n	<li><a href=\"#waveshape\"> Wave shape</a></li>\r\n	<li><a href=\"#review\"> Review<strong></strong></a></li>\r\n</ul>\r\n</li>\r\n	<li><a href=\"#1.2\"><strong>1.2 Phase</strong></a>\r\n<ul>\r\n	<li><a href=\"#phase\"> Phase controlled amplitude modulation</a></li>\r\n</ul>\r\n</li>\r\n</ul>\r\n<a href=\"#sec2\"><strong><span style=\"text-decoration: underline;\">Section 2. NovaDrone Oscillators</span></strong></a>\r\n<ul>\r\n	<li><a href=\"#2.1\"><strong>2.1 The Circuit</strong></a>\r\n<ul>\r\n	<li><a href=\"#feedbackloops\"> Feedback loops</a></li>\r\n	<li><a href=\"#schematic\"> Schematic</a></li>\r\n	<li><a href=\"#rctimeconstant\"> RC time constant</a></li>\r\n	<li><a href=\"#howitworks\"> How it works<strong></strong></a></li>\r\n</ul>\r\n</li>\r\n	<li><a href=\"#2.2\"><strong>2.2 Pulse Width Modulation</strong></a>\r\n<ul>\r\n	<li><a href=\"#comparator\">The comparator<strong></strong></a></li>\r\n</ul>\r\n</li>\r\n</ul>\r\n<a name=\"sec1\"></a><a name=\"1.1\"></a><a href=\"#sec3\"><strong><span style=\"text-decoration: underline;\">Sectio</span></strong></a><a href=\"#sec3\"><strong><span style=\"text-decoration: underline;\">n 3. Drivers and Mixers </span>*incomplete*</strong></a>\r\n<ul>\r\n	<li><a href=\"#led\"> LED driver</a></li>\r\n	<li><a href=\"#mixer\">Signal mixer</a><strong></strong></li>\r\n</ul>\r\n\r\n<hr />\r\n\r\n<h2 style=\"text-align: left;\"><span style=\"color: #3366ff;\"><strong>SECTION 1. OSCILLATOR PRIMER</strong></span></h2>\r\n<h2><span style=\"color: #3366ff;\"><strong style=\"text-align: center;\"><strong>◊ 1.1 Frequency, amplitude and wave shape◊</strong></strong></span></h2>\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/ampandfreq.jpg\"><img class=\"alignleft size-medium wp-image-1636\" title=\"Figure 1. A triangle wave oscillator\" src=\"http://casperelectronics.com/wp-content/uploads/ampandfreq-200x242.jpg\" alt=\"\" width=\"200\" height=\"242\" /></a>\r\n<div>\r\n\r\nThe heart of the NovaDrone is a bank of six independent oscillators.\r\n\r\n</div>\r\nAn oscillator is simply a pattern which repeats indefinitely. This can be a pattern of light, movement, electricity, even life cycles of organisms. The <a href=\"http://en.wikipedia.org/wiki/Oscillation\">wikipedia entry</a> gives dozens of examples of different kinds of oscillation.\r\n\r\nWhat we are most interested in is the modulation (changing amplitude) of electricity. All of the electrically produced sound we hear is a repeating pattern of fluctuating electrical current.\r\n\r\n&nbsp;\r\n\r\n<address> </address><address><em><span style=\"color: #33cccc;\">Figure 1. triangle oscillator</span></em></address>When this is applied to a speaker, the current activates a coil in the speaker which pushes the cone of the speaker away from or towards a fixed magnet. This action vibrates the air in front of the speaker which in turn vibrates the air in front of that and so on until that vibrations hit our ear drums and are perceived as sound. The sounds we hear around us are all incredibly complex patterns of air pressure modulation.\r\n<div>\r\n<ul>\r\n	<li><strong>The red line in fig 1 represents a voltage which goes up and down over a period of time. This is an oscillator.</strong></li>\r\n</ul>\r\nThere are three basic factors that make up all oscillators: <a name=\"frequency\"></a><strong>frequency</strong>, <strong>amplitude</strong> and <strong>wave shape</strong>. In musical terms we would call these <strong>pitch</strong>, <strong>volume</strong> and <strong>timbre</strong>. I will also talk a fair amount about <strong>phase </strong>which is relevant when working with multiple oscillators and plays an important role in creating drones.\r\n\r\n<hr />\r\n\r\n<ul>\r\n	<li>\r\n<h3><span style=\"color: #3366ff;\"><strong>Frequency</strong></span></h3>\r\n</li>\r\n</ul>\r\nOne complete sweep up and down is called a <strong>cycle</strong>. The number of cycles per second is your <strong>Frequency</strong> or <strong>Pitch</strong>.<strong></strong>\r\n<strong>Frequency</strong> is commonly measured in <strong>Hertz</strong>, which is the number of cycles per second.\r\n<a name=\"amplitude\"></a><strong>Pitch</strong> is another term for frequency which is used <span style=\"text-decoration: underline;\">only</span> when referring to the frequency of an audio signal.\r\nFigure 1 shows a triangle wave with a cycle length of .5 seconds. The frequency of this wave would be determined by seeing how many cycles will occur in 1 second. In this case there are 2 complete cycles in 1 second. That means the wave has a frequency of 2 Hertz. This is well below the hearing range. Humans can hear oscillators between 20Hz and 20,000 Hz.\r\n\r\n<hr />\r\n\r\n<ul>\r\n	<li>\r\n<h3><span style=\"color: #3366ff;\"><strong>Amplitude</strong></span></h3>\r\n</li>\r\n</ul>\r\nAmplitude refers to the magnitude of voltage change across one cycle of an oscillation.\r\n<a name=\"waveshape\"></a>This in turn impacts the volume of the signal if it is sent to a speaker.\r\nThe image above shows a triangle wave with a positive peak of +5 volts and a negative peak of -5 volts. The amplitude is determined by figuring the absolute difference between these peaks. In this case that difference is 10 volts. This is commonly referred to as 10 Vpk-pk (10 volts peak to peak). There are many different ways to measure amplitude (pk-pk, RMS, Vp, etc…) but we’ll just be talking about Vpk-pk.\r\n\r\n<hr />\r\n\r\n<ul>\r\n	<li>\r\n<h3><span style=\"color: #3366ff;\"><strong>Wave shape</strong></span><a href=\"http://casperelectronics.com/wp-content/uploads/waveshapes.png\"><img class=\"alignright\" title=\"Waveshapes\" src=\"http://casperelectronics.com/wp-content/uploads/waveshapes-200x160.png\" alt=\"\" width=\"292\" height=\"233\" /></a></h3>\r\n</li>\r\n</ul>\r\nThe wave shape is the pattern of amplitude modulation over the course of a cycle. The waveforms in fig 2 are: Sine, ramp, triangle and square.Sine, triangle and square are the most common and are all symmetrical waves. That means the positive and negative portions of each cycle are of the same duration. Many musical synthesizers offer other wave forms which are asymmetrical versions of these common waves such as ramp, saw and pulse waves.\r\n<p style=\"text-align: right;\"><span style=\"color: #33cccc;\"> Figure 2. Waveshapes  </span></p>\r\nThe importance and impact of wave shape depends on its application. Many audio effects such as <strong>tremolo</strong> or <strong>phaser</strong> use low frequency oscillators (LFOs) to modulate certain parameters of the sound. It is commonly more desirable to use a sine or triangle wave for many of these effects such as the tremolo which\r\n<a name=\"review\"></a>fades the volume in and out. Using a square wave for this would create dramatic shifts in volume which can be unpleasant.\r\nMany natural sounds are synthesized using overlapping wave forms like those shown above. For instance a flute can be synthesized using several octaves of a sine wave. A horn on the other hand will use more square waves and maybe a triangle or saw wave. More advanced wave and synthesis theory sites the sine wave as the basis of all wave forms. It is shown how even square waves can be created by combining several sine waves.\r\n\r\n<hr />\r\n\r\n<ul>\r\n	<li>\r\n<h3><strong>Review</strong></h3>\r\n</li>\r\n</ul>\r\nThe basic components of an oscillator are:\r\n<h3><a name=\"1.2\"></a></h3>\r\n<ul>\r\n	<li><strong>Frequency</strong>. The number of oscillation cycles that occur in one second. Measured in Hz</li>\r\n	<li><strong>Amplitude</strong>. Magnitude of voltage sweep in one cycle of an oscillator. Measured in Volts or Vpk-pk (volts peak to peak)</li>\r\n	<li><strong>Wave shape</strong>. Sine, triangle, square</li>\r\n</ul>\r\n\r\n<hr />\r\n\r\n<div></div>\r\n<h2 style=\"text-align: left;\"><span style=\"color: #3366ff;\"><strong>◊1.2 Phase◊</strong></span></h2>\r\nPhase is a bit more complicated than the other terms but plays an important role in audio circuitry and especially in making drones. Phase refers to a particular position in a <span style=\"text-decoration: underline;\">single cycle</span> of a wave (such as the positive or negative peak) and is measured in degrees. It is most commonly used to describe the relationship between multiple waves.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/phasedegrees.jpg\"><img class=\"alignnone size-large wp-image-1643\" title=\"Phasedegrees\" src=\"http://casperelectronics.com/wp-content/uploads/phasedegrees-460x236.jpg\" alt=\"\" width=\"460\" height=\"236\" /></a>\r\n\r\n<span style=\"color: #33cccc;\">Figure 3. Phase</span>\r\nFig. 3 shows two sine waves (red &amp; blue) of identical amplitude and frequency. The green oscillator is the mix or <em>average</em> of the red and blue oscillators.\r\nPhase is measured in degrees with 360 degrees being one complete cycle. 180 degrees is exactly ½ of a cycle.\r\nIn fig. 3 the phase of the blue oscillator is offset at 45 degree increments from the red oscillator from left to right. With each step you’ll notice that the waves get farther apart and that the amplitude of the green (average) oscillator decreases.\r\nThis may seem confusing at first but it’s really quite simple. The green oscillator is the average of the red and blue oscillators. Let’s say the red and blue oscillators sweep from -5 to +5VDC (10Vp-p). Now look at the right most illustration of the 2 waves out of phase by 180 degrees. When the blue wave is at its positive peak (90 degrees) of +5 volts, the red wave is at it’s negative peak (270 degrees) of -5 volts.\r\nWhat is the average of -5 and +5? Zero. They are always going to be the opposites of each other so the average will always be zero. Now look at the 90 degree image. When Blue is at +5 volts/90 degrees, red is at 0 volts/zero degrees. The average of +5 and zero is 2.5 volts.\r\nThe important thing to take away from the info above is that the amplitude of an oscillator created by mixing two similar oscillators is relative to the difference in phase of the two source waves.\r\nIn fig. 3 the oscillators have identical frequencies. This means that the phase relationship once established will remain the same and the resulting averaged amplitude of the two waves will also remain the same.\r\n<strong>Q: What will happen if the frequencies of your two waves are NOT identical? </strong>\r\nWe established above that the amplitude of the averaged waveform is relative to the phase difference of the two wave forms, therefore as the phase difference of two waves increases and decreases so too will the averaged waveforms’ amplitude. What we have here is phase controlled amplitude modulation and the rate of phase modulation is controlled by the frequency difference between your two oscillators.\r\nIn fig. 4 the blue oscillator has a frequency of 10 Hz, the red is 11Hz. That means that it takes the red wave 1/10<sup>th</sup> of a second longer to complete a cycle than the blue wave. You can see that with each cycle the red wave lags a little bit further behind the blue wave which increases the phase difference between the two. As a result, the amplitude of the averaged wave (green) decreases as the phase offset approaches 180 degrees and then increases as it continues past 180 to 360 degrees.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/phaseModulation.jpg\"><img class=\"alignnone size-large wp-image-1644\" title=\"PhaseModulation\" src=\"http://casperelectronics.com/wp-content/uploads/phaseModulation-460x202.jpg\" alt=\"\" width=\"460\" height=\"202\" /></a><a href=\"http://casperelectronics.com/wp-content/uploads/phase_modulation2.jpg\"><img class=\"alignnone size-large wp-image-1645\" title=\"Phase Modulation2\" src=\"http://casperelectronics.com/wp-content/uploads/phase_modulation2-460x220.jpg\" alt=\"\" width=\"460\" height=\"220\" /></a><a name=\"sec2\"></a><span style=\"color: #33cccc;\">Figure 4. Phase controlled amplitude</span>\r\n<h3><a name=\"2.1\"></a></h3>\r\nThis phenomenon of phase controlled amplitude is something many musicians use without even realizing it. This is the vary trick one uses when tuning a guitar. You tune one string to the other until the “beatingâ€ effect slows and eventually disappears.\r\n\r\n<hr />\r\n\r\n&nbsp;\r\n<h2 style=\"text-align: left;\"><span style=\"color: #3366ff;\"><strong>SECTION 2. NOVADRONE OSCILLATORS</strong></span></h2>\r\n\r\n<hr />\r\n\r\n<h2 style=\"text-align: left;\"><span style=\"color: #3366ff;\"><strong>◊ 2.1 The circuit ◊</strong></span></h2>\r\nThe NovaDrone contains 6 oscillators. Each oscillator outputs a square wave and a triangle wave.\r\n<span style=\"text-decoration: underline;\"><a name=\"schematic\"></a></span>The circuit which generates the oscillators is clean, simple and robust. They are generated using a remarkable device called an <strong>op amp</strong>. If you are interested in building synthesizers and don’t know where to start, read up on <strong>op amps</strong>. They are the key elements of most oscillators, filters, envelope generators, mixers and amps.\r\n\r\n<hr />\r\n\r\n<ul>\r\n	<li>\r\n<h3><span style=\"color: #3366ff;\"><strong>Schematic</strong></span></h3>\r\n</li>\r\n</ul>\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/OSC2rc.jpg\"><img class=\"alignleft\" title=\"OSC2rc\" src=\"http://casperelectronics.com/wp-content/uploads/OSC2rc-200x163.jpg\" alt=\"\" width=\"200\" height=\"163\" /></a><img class=\"alignleft\" title=\"OSC1rc\" src=\"http://casperelectronics.com/wp-content/uploads/OSC1rc-200x170.jpg\" alt=\"\" width=\"200\" height=\"163\" />\r\n\r\n&nbsp;\r\n\r\n&nbsp;\r\n\r\n&nbsp;\r\n\r\n&nbsp;\r\n\r\n&nbsp;\r\n\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/casper/spacer1.jpg\"><img class=\"alignright size-full wp-image-1302\" title=\"spacer\" src=\"http://casperelectronics.com/wp-content/uploads/casper/spacer1.jpg\" alt=\"\" width=\"460\" height=\"10\" /></a>&nbsp;\r\n\r\n<span style=\"color: #33cccc;\">Figure 5. LFO                                    Figure 6. Audio oscillator</span>\r\n\r\nEach channel of the NovaDrone (Red, green and blue) has 2 oscillators. These are shown in fig. 5 and\r\n\r\n<a name=\"feedbackloops\"></a> They are very similar to one another but have been calibrated for different purposes.\r\n<strong>Osc 1</strong> is an audio frequency oscillator. It has a coarse and fine tune adjustment and only operates at audible frequencies (20Hz-20kHz).\r\n<strong>Osc 2</strong> is calibrated as a low frequency oscillator (LFO) with cycles as long as 2 minutes. It has a range switch and a single adjustment knob.\r\n\r\n<hr />\r\n\r\n&nbsp;\r\n<ul>\r\n	<li>\r\n<h3><span style=\"color: #3366ff;\"><strong>Feedback loops</strong></span></h3>\r\n</li>\r\n</ul>\r\nThe oscillator circuit is a feedback loop between two op amps that are configured as a <strong>schmitt trigger</strong> and an <strong>inverting integrator</strong>.\r\nBasically an <em>integrator</em> turns square waves into triangle waves.\r\nA <em>Schmitt trigger</em> is a kind of comparator that turns modulating signals (like triangle waves) into square waves.\r\nThe key elements of the relationship between these two circuits is that they form a loop (Schmitt &gt; integrator &gt;Schmitt&gt;integrator&gt; etc…) and that the integrator is also an <strong>inverter</strong>. This creates a continuous cycle of modulation:\r\n1) Schmitt output goes HI.\r\n2) Integrator inverts Schmitt signal and outputs slope going down (LOW).\r\n3) When slope is near zero volts, Schmitt trigger is thrown and its’ output goes LOW.\r\n4) Integrator inverts and generates upward slope (HI).\r\n5) When integrator slope reaches peak, Schmitt trigger is thrown and output goes HI.\r\n<a name=\"rctimeconstant\"></a>6) etc……\r\nThis is an overly simplified explanation but enough for our purposes. Do more research on these valuable circuits once you are familiar with some of the basics of op-amps.\r\n\r\n<hr />\r\n\r\n<ul>\r\n	<li>\r\n<h3><span style=\"color: #3366ff;\"><strong>RC (resistor capacitor)time constant</strong></span></h3>\r\n</li>\r\n</ul>\r\nIn both oscillators (fig. 5 and 6) the primary element which defines frequency is the <strong>RC time constant</strong>. This relationship is a core component of most oscillators and is worth reading up on.\r\n\r\nThe RC time constant is a period of time defined by the relationship between a resistor and a capacitor.\r\nThe equation for this is simply <strong>t =</strong> <strong>R*C</strong>. In the case of the oscillators above it would be <strong>t=R1*C1</strong>.\r\nUnfortunately calculating the frequency of an oscillator is more complicated than just calculating your RC constant.\r\nIn many oscillators (including this one) there is a schmitt trigger component which watches the rising or sinking voltage from the integrator. The Schmitt trigger activates when the slope reaches predefined upper and lower limits. In order to determine the frequency of an oscillator we need to know what our upper and lower limits are and then calculate how long it takes our wave (the output of the integrator) to travel from one limit to the other.\r\nThese limits are determined by the relationship of 2 resistors in the schmitt stage. In fig 5 and 6 these are R2 and R3.\r\nThe equation for determining the duration of one cycle is\r\n(1/4R1C1)*(R3/R4)\r\nIn Oscillator 2 <strong>R</strong><strong>1</strong> is a 500k potentiometer in series with a 4.7k resistor between pins 8 and 13 of the two op amps. <strong>C</strong><strong>1</strong> is one of the three capacitors between pins 13 and 14 of the rightmost op amp. One of these caps is selected using a three way switch on the NovaDrone circuit board. This controls the frequency range of the LFO.\r\nLet’s say the pot is all the way up (full resistance) and the middle cap has been selected. The equations for RC and subsequently the frequency is:\r\n<strong>R1=504,700 Ohms</strong>\r\n<a name=\"howitworks\"></a><strong>C1= .000022 Farads</strong>\r\n<strong>R2 = 8,300 Ohms</strong>\r\n<strong>R3 = 10,000 Ohms</strong>\r\n<strong>Frequency in Hz = (1 / 4*R</strong><strong>1C</strong><strong>1) * (R</strong><strong>3/R</strong><strong>2)</strong>\r\n\r\n<hr />\r\n\r\n<ul>\r\n	<li>\r\n<h3><span style=\"color: #3366ff;\"><strong>How it works</strong></span></h3>\r\n</li>\r\n</ul>\r\nResistors limit the flow of current and capacitors store current. Current flows through the resistor and is stored in the capacitor. The resistor controls how much current flows into the capacitor per second. Therefore the size of capacitor and the amount of resistance will determine how long it takes to fill the capacitor. A common analogy is to think about current flow as water, the resistor as a spigot\r\n<h3><a name=\"2.2\"></a></h3>\r\nand the capacitor as a cup. The more you open the spigot (reduce resistance), the more water (electrical current) will flow and the faster the cup will fill (capacitor will charge). The oscillator circuit is configured in a special way which causes the capacitor to continuously charge and discharge. It is looking for two states from the cap, fully charged or fully discharged. When the cap reaches either of these states, the whole circuit reverses polarity and the capacitors charge status begins moving toward the opposite state. The amount of time it takes to charge and discharge is your cycle duration.\r\n\r\n<hr />\r\n\r\n<h2 style=\"text-align: left;\"><span style=\"color: #3366ff;\"><strong>◊2.2 pulse width modulation (pwm)◊</strong></span></h2>\r\nPWM is exciting stuff….really! It is essentially a <strong>1 bit digital</strong> representation of an <strong>analog</strong> wave form.\r\nDigital wave forms only have 2 states, <strong>high</strong> and <strong>low</strong>. <strong>High</strong> is a voltage <em>at</em> or very close to the positive supply voltage. <strong>Low</strong> is a voltage <em>at</em> or very close to the negative supply voltage. It is basically just a square wave. Analog on the other hand is infinitely variable. Think about it like the difference between a light switch (digital) and a light dimmer (analog). PWM is a wave form that bridges the gap between these two formats. It can be used to make sound, control the brightness of an LED, control the speed of high torque motors and speak to microprocessors. It is also the language that a microprocessor will use to speak with the analog world.\r\nPulse Width (PW) refers to the relative durations of high and low voltage in a single <strong>cycle</strong> of a square wave.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/pulsewidth.jpg\"><img class=\"alignnone size-large wp-image-1648\" title=\"Pulsewidth\" src=\"http://casperelectronics.com/wp-content/uploads/pulsewidth-460x214.jpg\" alt=\"\" width=\"460\" height=\"214\" /></a><span style=\"color: #33cccc;\">Figure 7. Pulse width</span>\r\nFig. 7 shows three square wave oscillators of the same amplitude and frequency but with differing <strong>pulse width</strong>. The red oscillator has a 10% pulse width. That means the wave goes high for 10 % of the duration of one cycle. The green wave is 50% and the purple wave is 90%. What is important to note is that pulse width has nothing to do with frequency and only refers to the relationship between the high and low swing of the wave.\r\n\r\n<hr />\r\n\r\n<ul>\r\n	<li>\r\n<h3><span style=\"color: #3366ff;\"><strong>The Comparator</strong></span></h3>\r\n</li>\r\n</ul>\r\nThe job of a comparator is simple. Two signals are fed into the “+â€ and “-“ inputs (labeled 10 and 9 in fig. 8 respectively). If the voltage at the “+â€ input is <em>higher</em> than the “-“ input the output of the comparator goes <strong>high</strong>.<strong> </strong>If the “+â€ input drops below the “-“ input the output goes <strong>low</strong>.\r\nIn the NovaDrone t<a href=\"http://casperelectronics.com/wp-content/uploads/comparator.jpg\"><img class=\"alignleft\" title=\"Comparator\" src=\"http://casperelectronics.com/wp-content/uploads/comparator-200x76.jpg\" alt=\"\" width=\"200\" height=\"76\" /></a>he triangle output of Osc 1 and Osc 2 combine through a simple comparator (fig. 8) to make a single square wave with a modulating pulse width. In this way, the\r\n\r\n<span style=\"color: #33cccc;\">Figure 8.</span>                                           comparator also functions as a pulse width modulation processor.\r\n\r\nFig. 9 below shows how two triangle waves are transformed through the comparator into a square wave with a modulating pulse width.\r\nThe blue triangle wave in fig. 9 is oscillator 1. The red triangle is osc 2. The green line is the combined PWM output.\r\nAny time the blue line (osc 1) is above the red line (osc 2), the green line (pwm) goes high. As the red line rises the percentage of each cycle that the blue line is above the red line decreases. This changing percentage is what makes our modulating pulse width effect.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/PWM3-copy.jpg\"><img class=\"alignnone size-large wp-image-1647\" title=\"PWM3 Copy\" src=\"http://casperelectronics.com/wp-content/uploads/PWM3-copy-460x202.jpg\" alt=\"\" width=\"460\" height=\"202\" /></a>\r\n\r\n<span style=\"color: #33cccc;\">Figure 9. Pulse width modulation detail</span>\r\n\r\n<hr />\r\n\r\n<ul>\r\n	<li>\r\n<h3><span style=\"color: #3366ff;\"><strong>Mixer</strong></span></h3>\r\n</li>\r\n</ul>\r\nThe audio signals from each of the three channels of the NovaDrone are mixed using the circuit in fig. 10.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/mixer.jpg\"><img class=\"alignleft\" title=\"Mixer\" src=\"http://casperelectronics.com/wp-content/uploads/mixer-200x135.jpg\" alt=\"\" width=\"200\" height=\"135\" /></a>This mixer is nice and simple and uses just one <strong>op amp</strong> and a few other components. This circuit is configured as an inverting mixer with an amplitude controlled by the <strong>feedback resistor</strong> and <strong>input resistors</strong>. The amplitude is calculated as RF/RI. In this case RF = 10,000 and RI = 100,000. That means the output signal is 1/10<sup>th</sup> the amplitude of the input signal.\r\n<strong><span style=\"text-decoration: underline;\">\r\n</span></strong>\r\n\r\n<hr />\r\n\r\n<ul>\r\n	<li>\r\n<h3><span style=\"color: #3366ff;\"><strong>LED drivers</strong></span></h3>\r\n</li>\r\n</ul>\r\n(3) 2N3904 NPN transistors are used to make 3 LED drivers.\r\n<a href=\"http://casperelectronics.com/wp-content/uploads/LEDdriver.jpg\"><img class=\"alignleft\" title=\"LEDdriver\" src=\"http://casperelectronics.com/wp-content/uploads/LEDdriver-200x108.jpg\" alt=\"\" width=\"200\" height=\"108\" /></a>A driver is a simple but important circuit which isolates elements which use lots of current (like LEDs) from sensitive circuits (like the oscillators in the NovaDrone). Failure to use a driver can result in something called a <strong>loading effect</strong> which basically means that the device being driven will affect the behavior of the rest of the circuit in bad ways, like the pitch changing when the lights turn on. The LED in the NovaDrone uses a lot of current relative to the rest of the circuit (90mA vs around 30mA for the rest of the circuit) therefore a driver is necessary. The key component of a driver is the <strong>transistor</strong>. This is another topic worth reading a lot about\r\n.\r\n\r\n</div>','NovaDrone Tech Manual',0,'','inherit','open','closed','','1704-revision-23','','','2012-11-06 17:18:54','2012-11-06 22:18:54','',1704,'http://casperelectronics.com/2012/11/06/1704-revision-23/',0,'revision','',0),